]> git.lyx.org Git - features.git/commitdiff
HTML for stackrel.
authorRichard Heck <rgheck@comcast.net>
Wed, 31 Mar 2010 20:54:27 +0000 (20:54 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 31 Mar 2010 20:54:27 +0000 (20:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33989 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathStackrel.cpp
src/mathed/InsetMathStackrel.h

index 84e2d95191c47da70c73369312afddd78b47d25d..a7cb00b3228c362e79ed07c2aa2418f55ce5a100 100644 (file)
@@ -11,6 +11,8 @@
 #include <config.h>
 
 #include "InsetMathStackrel.h"
+
+#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
 
@@ -74,4 +76,28 @@ void InsetMathStackrel::mathmlize(MathStream & ms) const
        ms << "<mover accent='false'>" << cell(1) << cell(0) << "</mover>";
 }
 
+
+void InsetMathStackrel::htmlize(HtmlStream & os) const
+{
+       // at the moment, this is exactly the same as overset
+       os << MTag("span", "class='overset'")
+                << MTag("span", "class='top'") << cell(0) << ETag("span")
+                << MTag("span") << cell(1) << ETag("span")
+                << ETag("span");
+}
+
+
+void InsetMathStackrel::validate(LaTeXFeatures & features) const
+{
+       // from overset
+       if (features.runparams().math_flavor == OutputParams::MathAsHTML)
+               features.addPreambleSnippet("<style type=\"text/css\">\n"
+                       "span.overset{display: inline-block; vertical-align: bottom; text-align:center;}\n"
+                       "span.overset span {display: block;}\n"
+                       "span.top{font-size: 66%;}\n"
+                       "</style>");
+
+       InsetMathNest::validate(features);
+}
+
 } // namespace lyx
index 88f080071363391ff117d651f5f836c37b337d7b..11160c37ef95ab27bd927277310dc528b5231b50 100644 (file)
@@ -32,6 +32,10 @@ public:
        ///
        void mathmlize(MathStream &) const;
        ///
+       void htmlize(HtmlStream &) const;
+       /// 
+       void validate(LaTeXFeatures &) const;
+       ///
        InsetCode lyxCode() const { return MATH_STACKREL_CODE; }
 
 private: