From: Richard Heck Date: Wed, 31 Mar 2010 20:37:23 +0000 (+0000) Subject: HTML for math sizes. X-Git-Tag: 2.0.0~3595 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f3711d8a651445a61e1a759ac7493a9c5c7800e2;p=lyx.git HTML for math sizes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33985 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMathSize.cpp b/src/mathed/InsetMathSize.cpp index e038c7a8f5..fa0bc45604 100644 --- a/src/mathed/InsetMathSize.cpp +++ b/src/mathed/InsetMathSize.cpp @@ -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(""); +} + } // namespace lyx diff --git a/src/mathed/InsetMathSize.h b/src/mathed/InsetMathSize.h index df90193572..f3d8f8d37a 100644 --- a/src/mathed/InsetMathSize.h +++ b/src/mathed/InsetMathSize.h @@ -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: