mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
HTML for binomials.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33995 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
348991cd71
commit
1eb8311aff
@ -578,12 +578,49 @@ void InsetMathBinom::mathmlize(MathStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathBinom::htmlize(HtmlStream & os) const
|
||||
{
|
||||
char ldelim = ' ';
|
||||
char rdelim = ' ';
|
||||
switch (kind_) {
|
||||
case BINOM:
|
||||
case TBINOM:
|
||||
case DBINOM:
|
||||
case CHOOSE:
|
||||
ldelim = '(';
|
||||
rdelim = ')';
|
||||
break;
|
||||
case BRACE:
|
||||
ldelim = '{';
|
||||
rdelim = '}';
|
||||
break;
|
||||
case BRACK:
|
||||
ldelim = '[';
|
||||
rdelim = ']';
|
||||
break;
|
||||
}
|
||||
os << MTag("span", "class='binomdelim'") << ldelim << ETag("span") << '\n'
|
||||
<< MTag("span", "class='binom'") << '\n'
|
||||
<< MTag("span") << cell(0) << ETag("span") << '\n'
|
||||
<< MTag("span") << cell(1) << ETag("span") << '\n'
|
||||
<< ETag("span") << '\n'
|
||||
<< MTag("span", "class='binomdelim'") << rdelim << ETag("span") << '\n';
|
||||
}
|
||||
|
||||
|
||||
void InsetMathBinom::validate(LaTeXFeatures & features) const
|
||||
{
|
||||
if (kind_ == BINOM)
|
||||
features.require("binom");
|
||||
if (kind_ == DBINOM || kind_ == TBINOM)
|
||||
features.require("amsmath");
|
||||
if (features.runparams().isLaTeX()) {
|
||||
if (kind_ == BINOM)
|
||||
features.require("binom");
|
||||
if (kind_ == DBINOM || kind_ == TBINOM)
|
||||
features.require("amsmath");
|
||||
} else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
|
||||
features.addPreambleSnippet("<style type=\"text/css\">\n"
|
||||
"span.binom{display: inline-block; vertical-align: bottom; text-align:center;}\n"
|
||||
"span.binom span{display: block;}\n"
|
||||
"span.binomdelim{font-size: 2em;}\n"
|
||||
"</style>");
|
||||
InsetMathNest::validate(features);
|
||||
}
|
||||
|
||||
|
@ -125,6 +125,8 @@ public:
|
||||
///
|
||||
void mathmlize(MathStream &) const;
|
||||
///
|
||||
void htmlize(HtmlStream &) const;
|
||||
///
|
||||
void validate(LaTeXFeatures & features) const;
|
||||
///
|
||||
InsetCode lyxCode() const { return MATH_FRAC_CODE; }
|
||||
|
Loading…
Reference in New Issue
Block a user