X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathSize.cpp;h=a638f43851d368fbdfde456c37edda9185b57c0c;hb=f67cf6f4bb3e3d22ac9aebfa22027c3537cbdf61;hp=e7b78b99e09dbed62a10fd7b6f92b4ea2c42481f;hpb=a36607b800dff96f256b64350416a5f566590ad3;p=lyx.git diff --git a/src/mathed/InsetMathSize.cpp b/src/mathed/InsetMathSize.cpp index e7b78b99e0..a638f43851 100644 --- a/src/mathed/InsetMathSize.cpp +++ b/src/mathed/InsetMathSize.cpp @@ -12,6 +12,7 @@ #include "InsetMathSize.h" +#include "LaTeXFeatures.h" #include "MathData.h" #include "MathParser.h" #include "MathStream.h" @@ -79,8 +80,16 @@ void InsetMathSize::mathmlize(MathStream & ms) const stringstream attrs; attrs << "displaystyle='" << (dispstyle ? "true" : "false") << "' scriptlevel='" << scriptlevel << "'"; - ms << "" - << cell(0) << ""; + ms << MTag("mstyle", attrs.str()) << ">" + << cell(0) << ETag("mstyle"); +} + + +void InsetMathSize::htmlize(HtmlStream & os) const +{ + string const & name = to_utf8(key_->name); + os << MTag("span", "class='" + name + "'") + << cell(0) << ETag("span"); } @@ -96,4 +105,14 @@ void InsetMathSize::infoize(odocstream & os) const } +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); +} + } // namespace lyx