]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSize.cpp
Use master buffer's setting for math output type.
[lyx.git] / src / mathed / InsetMathSize.cpp
index e7b78b99e09dbed62a10fd7b6f92b4ea2c42481f..a638f43851d368fbdfde456c37edda9185b57c0c 100644 (file)
@@ -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 << "<mstyle " << from_ascii(attrs.str()) << ">"
-          << cell(0) << "</mstyle>";
+       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