mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 06:20:28 +00:00
Treat certain decoration cases differently.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33956 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
69fc590ee3
commit
ed71c32fcd
@ -215,9 +215,21 @@ void InsetMathDecoration::mathmlize(MathStream & os) const
|
|||||||
|
|
||||||
void InsetMathDecoration::htmlize(HtmlStream & os) const
|
void InsetMathDecoration::htmlize(HtmlStream & os) const
|
||||||
{
|
{
|
||||||
|
string const name = to_utf8(key_->name);
|
||||||
|
if (name == "bar") {
|
||||||
|
os << MTag("span", "class='overbar'") << cell(0) << ETag("span");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name == "underbar" || name == "underline") {
|
||||||
|
os << MTag("span", "class='underbar'") << cell(0) << ETag("span");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Translator const & t = translator();
|
Translator const & t = translator();
|
||||||
Translator::const_iterator cur = t.find(to_utf8(key_->name));
|
Translator::const_iterator cur = t.find(name);
|
||||||
LASSERT(cur != t.end(), return);
|
LASSERT(cur != t.end(), return);
|
||||||
|
|
||||||
bool symontop = cur->second.over;
|
bool symontop = cur->second.over;
|
||||||
string const symclass = symontop ? "symontop" : "symonbot";
|
string const symclass = symontop ? "symontop" : "symonbot";
|
||||||
os << MTag("span", "class='symbolpair " + symclass + "'")
|
os << MTag("span", "class='symbolpair " + symclass + "'")
|
||||||
@ -240,13 +252,24 @@ void InsetMathDecoration::htmlize(HtmlStream & os) const
|
|||||||
void InsetMathDecoration::validate(LaTeXFeatures & features) const
|
void InsetMathDecoration::validate(LaTeXFeatures & features) const
|
||||||
{
|
{
|
||||||
if (features.runparams().flavor == OutputParams::HTML) {
|
if (features.runparams().flavor == OutputParams::HTML) {
|
||||||
features.addPreambleSnippet("<style type=\"text/css\">\n"
|
string const name = to_utf8(key_->name);
|
||||||
"span.symbolpair{display: inline-block; text-align:center;}\n"
|
if (name == "bar") {
|
||||||
"span.symontop{vertical-align: top;}\n"
|
features.addPreambleSnippet("<style type=\"text/css\">\n"
|
||||||
"span.symonbot{vertical-align: bottom;}\n"
|
"span.overbar{border-top: thin black solid;}\n"
|
||||||
"span.symbolpair span{display: block;}\n"
|
"</style>");
|
||||||
"span.symbol{height: 0.5ex;}\n"
|
} else if (name == "underbar" || name == "underline") {
|
||||||
"</style>");
|
features.addPreambleSnippet("<style type=\"text/css\">\n"
|
||||||
|
"span.underbar{border-bottom: thin black solid;}\n"
|
||||||
|
"</style>");
|
||||||
|
} else {
|
||||||
|
features.addPreambleSnippet("<style type=\"text/css\">\n"
|
||||||
|
"span.symbolpair{display: inline-block; text-align:center;}\n"
|
||||||
|
"span.symontop{vertical-align: top;}\n"
|
||||||
|
"span.symonbot{vertical-align: bottom;}\n"
|
||||||
|
"span.symbolpair span{display: block;}\n"
|
||||||
|
"span.symbol{height: 0.5ex;}\n"
|
||||||
|
"</style>");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!key_->requires.empty())
|
if (!key_->requires.empty())
|
||||||
features.require(to_utf8(key_->requires));
|
features.require(to_utf8(key_->requires));
|
||||||
|
Loading…
Reference in New Issue
Block a user