]> git.lyx.org Git - features.git/commitdiff
HTML for substack. Sort of. There's an odd problem here, that is
authorRichard Heck <rgheck@comcast.net>
Wed, 31 Mar 2010 21:17:30 +0000 (21:17 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 31 Mar 2010 21:17:30 +0000 (21:17 +0000)
actually a general LyX bug, but I'll report that to the list.

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

src/mathed/InsetMathSubstack.cpp
src/mathed/InsetMathSubstack.h

index 544230a659ccc6372660ea732dad3e3c77cc45bd..5f7e9f644b5adf841281843abde648c4eacc631f 100644 (file)
@@ -118,9 +118,25 @@ void InsetMathSubstack::maple(MapleStream & os) const
 }
 
 
+void InsetMathSubstack::htmlize(HtmlStream & os) const
+{
+       os << MTag("span", "class='substack'");
+       for (row_type row = 0; row < nrows(); ++row) 
+               os << MTag("span") << cell(index(row, 0)) << ETag("span");
+       os << ETag("span");
+}
+
+       
 void InsetMathSubstack::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.substack{display: inline-block; vertical-align: middle; text-align:center; font-size: 75%;}\n"
+                       "span.substack span{display: block;}\n"
+                       "</style>");
+       
        InsetMathGrid::validate(features);
 }
 
index fbf5f756cc18f9669591bd69949488a9d2b31998..612187ae895a9c63f30684f657cd1a685a914eb4 100644 (file)
@@ -39,11 +39,13 @@ public:
        ///
        void write(WriteStream & os) const;
        ///
+       void htmlize(HtmlStream &) const;
+       ///
        void normalize(NormalStream &) const;
        ///
        void maple(MapleStream &) const;
        ///
-       void validate(LaTeXFeatures & features) const;
+       void validate(LaTeXFeatures &) const;
        ///
        InsetCode lyxCode() const { return MATH_SUBSTACK_CODE; }