]> git.lyx.org Git - features.git/commitdiff
HTML for underset.
authorRichard Heck <rgheck@comcast.net>
Wed, 31 Mar 2010 20:12:52 +0000 (20:12 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 31 Mar 2010 20:12:52 +0000 (20:12 +0000)
Neither underset nor overset will work reliably, I'm afraid, but such is
the price of using HTML rather than MathML.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33982 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathUnderset.cpp
src/mathed/InsetMathUnderset.h

index a447cac7f7959eb37f10a377ff38deab2ef85c22..0da62f915535cb8a1ed5736b8de67b0a9aeaf994 100644 (file)
@@ -101,9 +101,26 @@ 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.addPreambleSnippet("<style type=\"text/css\">\n"
+                       "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>");
+
        InsetMathNest::validate(features);
 }
 
index c2af955ba26a45b7b8363d470efe8a8cef948a76..239a576aebb06d6d4b909a4553dbe4119621e8b9 100644 (file)
@@ -40,6 +40,8 @@ public:
        ///
        void mathmlize(MathStream &) const;
        ///
+       void htmlize(HtmlStream &) const;
+       ///
        void validate(LaTeXFeatures & features) const;
        ///
        InsetCode lyxCode() const { return MATH_UNDERSET_CODE; }