HTML for stackrel.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33989 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-03-31 20:54:27 +00:00
parent 85425d8e6c
commit bab268352b
2 changed files with 30 additions and 0 deletions

View 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

View 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: