mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
HTML for xarrows.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35026 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c8bc76b333
commit
b520657039
@ -86,9 +86,27 @@ void InsetMathXArrow::mathmlize(MathStream & ms) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InsetMathXArrow::htmlize(HtmlStream & os) const
|
||||||
|
{
|
||||||
|
char const * const arrow = name_ == "xleftarrow"
|
||||||
|
? "←" : "→";
|
||||||
|
os << MTag("span", "class='xarrow'")
|
||||||
|
<< MTag("span", "class='xatop'") << cell(0) << ETag("span")
|
||||||
|
<< MTag("span", "class='xabottom'") << arrow << ETag("span")
|
||||||
|
<< ETag("span");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetMathXArrow::validate(LaTeXFeatures & features) const
|
void InsetMathXArrow::validate(LaTeXFeatures & features) const
|
||||||
{
|
{
|
||||||
features.require("amsmath");
|
features.require("amsmath");
|
||||||
|
if (features.runparams().math_flavor == OutputParams::MathAsHTML)
|
||||||
|
// CSS adapted from eLyXer
|
||||||
|
features.addPreambleSnippet("<style type=\"text/css\">\n"
|
||||||
|
"span.xarrow{display: inline-block; vertical-align: middle; text-align:center;}\n"
|
||||||
|
"span.xatop{display: block;}\n"
|
||||||
|
"span.xabottom{display: block;}\n"
|
||||||
|
"</style>");
|
||||||
InsetMathNest::validate(features);
|
InsetMathNest::validate(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,8 @@ public:
|
|||||||
///
|
///
|
||||||
void mathmlize(MathStream &) const;
|
void mathmlize(MathStream &) const;
|
||||||
///
|
///
|
||||||
|
void htmlize(HtmlStream &) const;
|
||||||
|
///
|
||||||
void validate(LaTeXFeatures & features) const;
|
void validate(LaTeXFeatures & features) const;
|
||||||
///
|
///
|
||||||
InsetCode lyxCode() const { return MATH_XARROW_CODE; }
|
InsetCode lyxCode() const { return MATH_XARROW_CODE; }
|
||||||
|
Loading…
Reference in New Issue
Block a user