]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathUnderset.cpp
Merge branch 'master' of git.lyx.org:lyx
[lyx.git] / src / mathed / InsetMathUnderset.cpp
index 0da62f915535cb8a1ed5736b8de67b0a9aeaf994..7632b0c6af2e6e9c1d01906163314a3e8f0560af 100644 (file)
@@ -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) << '}';
 }
 
@@ -115,11 +117,10 @@ void InsetMathUnderset::validate(LaTeXFeatures & features) const
        if (features.runparams().isLaTeX())
                features.require("amsmath");
        else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
-               features.addPreambleSnippet("<style type=\"text/css\">\n"
+               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%;}\n"
-                       "</style>");
+                       "span.bottom{font-size: 66%;}");
 
        InsetMathNest::validate(features);
 }