InsetMathBig via HTML.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33946 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-03-30 02:04:07 +00:00
parent 0190b003b0
commit e64be58736
2 changed files with 70 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#include "InsetMathBig.h"
#include "LaTeXFeatures.h"
#include "MathSupport.h"
#include "MathStream.h"
#include "MetricsInfo.h"
@ -149,6 +150,60 @@ void InsetMathBig::mathmlize(MathStream & os) const
}
void InsetMathBig::htmlize(HtmlStream & os) const
{
std::string name;
switch (size()) {
case 0: case 1: name = "big"; break;
case 2: case 3: name = "bigg"; break;
case 4: case 5: name = "biggg"; break;
default: name = "big"; break;
}
os << MTag("span", "class='" + name + "symbol'");
if (delim_ == "(" || delim_ == ")"
|| delim_ == "[" || delim_ == "]"
|| delim_ == "|" || delim_ == "/")
os << delim_;
else if (delim_ == "\\{" || delim_ == "\\lbrace")
os << "{";
else if (delim_ == "\\}" || delim_ == "\\rbrace")
os << "}";
else if (delim_ == "\\slash")
os << "/";
else if (delim_ == "\\|" || delim_ == "\\vert")
os << "|";
else if (delim_ == "\\Vert")
os << "&par;";
else if (delim_ == "\\\\" || delim_ == "\\backslash")
os <<" \\";
else if (delim_ == "\\langle")
os << "&lt;";
else if (delim_ == "\\rangle")
os << "&gt;";
else if (delim_ == "\\lceil")
os << "&lceil;";
else if (delim_ == "\\rceil")
os << "&rceil;";
else if (delim_ == "\\lfloor")
os << "&lfloor;";
else if (delim_ == "\\rfloor")
os << "&rfloor;";
else if (delim_ == "\\downarrow")
os << "&darr;";
else if (delim_ == "\\uparrow")
os << "&uarr;";
else if (delim_ == "\\Downarrow")
os << "&dArr;";
else if (delim_ == "\\Uparrow")
os << "&uArr;";
else if (delim_ == "\\updownarrow")
os << "&varr;";
else if (delim_ == "\\Updownarrow")
os << "&vArr;";
os << ETag("span");
}
void InsetMathBig::infoize2(odocstream & os) const
{
os << name_;
@ -172,4 +227,15 @@ bool InsetMathBig::isBigInsetDelim(docstring const & delim)
}
void InsetMathBig::validate(LaTeXFeatures & features) const
{
if (features.runparams().flavor == OutputParams::HTML)
features.addPreambleSnippet("<style type=\"text/css\">\n"
"span.bigsymbol{font-size: 150%;}\n"
"span.biggsymbol{font-size: 200%;}\n"
"span.bigggsymbol{font-size: 225%;}\n"
"</style>");
}
} // namespace lyx

View File

@ -37,11 +37,15 @@ public:
///
void mathmlize(MathStream &) const;
///
void htmlize(HtmlStream &) const;
///
void infoize2(odocstream & os) const;
///
static bool isBigInsetDelim(docstring const &);
///
InsetCode lyxCode() const { return MATH_BIG_CODE; }
///
void validate(LaTeXFeatures &) const;
private:
virtual Inset * clone() const;
///