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

src/mathed/InsetMathSize.cpp
src/mathed/InsetMathSize.h

index e038c7a8f5abda8a2a8d7728325caddcd81eb093..fa0bc45604b3d26b26935f97e599617d6a86accf 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "InsetMathSize.h"
 
+#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathParser.h"
 #include "MathStream.h"
@@ -84,6 +85,14 @@ void InsetMathSize::mathmlize(MathStream & ms) const
 }
 
 
+void InsetMathSize::htmlize(HtmlStream & os) const
+{
+       string const & name = to_utf8(key_->name);
+       os <<   MTag("span", "class='" + name + "'")
+                       << cell(0) << ETag("span");
+}
+
+
 void InsetMathSize::normalize(NormalStream & os) const
 {
        os << '[' << key_->name << ' ' << cell(0) << ']';
@@ -96,4 +105,14 @@ void InsetMathSize::infoize(odocstream & os) const
 }
 
 
+void InsetMathSize::validate(LaTeXFeatures & features) const
+{
+       if (features.runparams().math_flavor == OutputParams::MathAsHTML)
+               features.addPreambleSnippet("<style type=\"text/css\">\n"
+                       "span.displaystyle, span.textstyle{font-size: normal;}\n"
+                       "span.scriptstyle {font-size: small;}\n"
+                       "span.scriptscriptstyle {font-size: x-small;}\n"
+                       "</style>");
+}
+
 } // namespace lyx
index df90193572c5663908e0fabed809cdf468ecddcb..f3d8f8d37a6acb74991534c03ab2879a60abebb8 100644 (file)
@@ -42,6 +42,10 @@ public:
        ///
        void mathmlize(MathStream &) const;
        ///
+       void htmlize(HtmlStream &) const;
+       ///
+       void validate(LaTeXFeatures &) const;
+       ///
        InsetCode lyxCode() const { return MATH_SIZE_CODE; }
 
 private: