void InsetMathEnsureMath::validate(LaTeXFeatures & features) const { // FIXME XHTML // It'd be better to be able to get this from an InsetLayout, but at present // InsetLayouts do not seem really to work for things that aren't InsetTexts. if (features.runparams().math_flavor == OutputParams::MathAsMathML) features.addCSSSnippet("mstyle.math { font-style: italic; }"); else if (features.runparams().math_flavor == OutputParams::MathAsHTML) features.addCSSSnippet("span.mathbox { font-style: italic; }"); InsetMathNest::validate(features); }
void InsetMathBig::validate(LaTeXFeatures & features) const { if (features.runparams().math_flavor == OutputParams::MathAsHTML) features.addCSSSnippet( "span.bigsymbol{font-size: 150%;}\n" "span.biggsymbol{font-size: 200%;}\n" "span.bigggsymbol{font-size: 225%;}"); }
void InsetMathSize::validate(LaTeXFeatures & features) const { if (features.runparams().math_flavor == OutputParams::MathAsHTML) features.addCSSSnippet( "span.displaystyle, span.textstyle{font-size: normal;}\n" "span.scriptstyle {font-size: small;}\n" "span.scriptscriptstyle {font-size: x-small;}"); InsetMathNest::validate(features); }
void InsetMathXArrow::validate(LaTeXFeatures & features) const { features.require("amsmath"); if (features.runparams().math_flavor == OutputParams::MathAsHTML) // CSS adapted from eLyXer features.addCSSSnippet( "span.xarrow{display: inline-block; vertical-align: middle; text-align:center;}\n" "span.xatop{display: block;}\n" "span.xabottom{display: block;}"); InsetMathNest::validate(features); }
void InsetMathSubstack::validate(LaTeXFeatures & features) const { if (features.runparams().isLaTeX()) features.require("amsmath"); else if (features.runparams().math_flavor == OutputParams::MathAsHTML) features.addCSSSnippet( "span.substack{display: inline-block; vertical-align: middle; text-align:center; font-size: 75%;}\n" "span.substack span{display: block;}"); InsetMathGrid::validate(features); }
void InsetMathCases::validate(LaTeXFeatures & features) const { features.require("amsmath"); InsetMathGrid::validate(features); if (features.runparams().math_flavor == OutputParams::MathAsHTML) // CSS based on eLyXer's features.addCSSSnippet( "table.cases{display: inline-block; text-align: center;" "border-left: thin solid black; vertical-align: middle; padding-left: 0.5ex;}\n" "table.cases td {text-align: left;}"); }
// ideas borrowed from the eLyXer code void InsetMathDecoration::validate(LaTeXFeatures & features) const { if (features.runparams().math_flavor == OutputParams::MathAsHTML) { string const name = to_utf8(key_->name); if (name == "bar") { features.addCSSSnippet("span.overbar{border-top: thin black solid;}"); } else if (name == "underbar" || name == "underline") { features.addCSSSnippet("span.underbar{border-bottom: thin black solid;}"); } else { features.addCSSSnippet( "span.symbolpair{display: inline-block; text-align:center;}\n" "span.symontop{vertical-align: top;}\n" "span.symonbot{vertical-align: bottom;}\n" "span.symbolpair span{display: block;}\n" "span.symbol{height: 0.5ex;}"); } } else { if (!key_->requires.empty()) features.require(key_->requires); } InsetMathNest::validate(features); }
void InsetMathSymbol::validate(LaTeXFeatures & features) const { // this is not really the ideal place to do this, but we can't // validate in InsetMathExInt. if (features.runparams().math_flavor == OutputParams::MathAsHTML && sym_->name == from_ascii("int")) { features.addCSSSnippet( "span.limits{display: inline-block; vertical-align: middle; text-align:center; font-size: 75%;}\n" "span.limits span{display: block;}\n" "span.intsym{font-size: 150%;}\n" "sub.limit{font-size: 75%;}\n" "sup.limit{font-size: 75%;}"); } else { if (!sym_->requires.empty()) features.require(sym_->requires); } }
void InsetMathSqrt::validate(LaTeXFeatures & features) const { if (features.runparams().math_flavor == OutputParams::MathAsHTML) features.addCSSSnippet("span.sqrtof{border-top: thin solid black;}"); InsetMathNest::validate(features); }