X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathUnderset.cpp;h=7632b0c6af2e6e9c1d01906163314a3e8f0560af;hb=c9609fe56a2deb40f001503c2fd707c990a2e0e2;hp=a447cac7f7959eb37f10a377ff38deab2ef85c22;hpb=f29db33e695d6cd8dd3dd33c62832ec681df2675;p=lyx.git diff --git a/src/mathed/InsetMathUnderset.cpp b/src/mathed/InsetMathUnderset.cpp index a447cac7f7..7632b0c6af 100644 --- a/src/mathed/InsetMathUnderset.cpp +++ b/src/mathed/InsetMathUnderset.cpp @@ -85,6 +85,8 @@ bool InsetMathUnderset::idxUpDown(Cursor & cur, bool up) const void InsetMathUnderset::write(WriteStream & os) const { MathEnsurer ensurer(os); + if (os.fragile()) + os << "\\protect"; os << "\\underset{" << cell(0) << "}{" << cell(1) << '}'; } @@ -101,9 +103,25 @@ void InsetMathUnderset::mathmlize(MathStream & ms) const } +void InsetMathUnderset::htmlize(HtmlStream & os) const +{ + os << MTag("span", "class='underset'") + << MTag("span") << cell(0) << ETag("span") + << MTag("span", "class='bottom'") << cell(1) << ETag("span") + << ETag("span"); +} + + void InsetMathUnderset::validate(LaTeXFeatures & features) const { - features.require("amsmath"); + if (features.runparams().isLaTeX()) + features.require("amsmath"); + else if (features.runparams().math_flavor == OutputParams::MathAsHTML) + features.addCSSSnippet( + "span.underset{display: inline-block; vertical-align: top; text-align:center;}\n" + "span.underset span {display: block;}\n" + "span.bottom{font-size: 66%;}"); + InsetMathNest::validate(features); }