- : InsetMathNest(buf, 1), key_(key)
+ : InsetMathNest(buf, 1), key_(key), dh_(0), dy_(0), dw_(0)
- key_->name == "underbrace" ||
- key_->name == "overleftarrow" ||
- key_->name == "overrightarrow" ||
- key_->name == "overleftrightarrow" ||
- key_->name == "underleftarrow" ||
- key_->name == "underrightarrow" ||
- key_->name == "underleftrightarrow";
+ key_->name == "underbrace";
key_->name == "widetilde" ||
key_->name == "underleftarrow" ||
key_->name == "underrightarrow" ||
key_->name == "widetilde" ||
key_->name == "underleftarrow" ||
key_->name == "underrightarrow" ||
- key_->name == "underleftrightarrow";
+ key_->name == "underleftrightarrow" ||
+ key_->name == "undertilde" ||
+ key_->name == "utilde";
+}
+
+
+InsetMath::mode_type InsetMathDecoration::currentMode() const
+{
+ return key_->name == "underbar" ? TEXT_MODE : MATH_MODE;
cell(0).metrics(mi, dim);
dh_ = 6; //mathed_char_height(LM_TC_VAR, mi, 'I', ascent_, descent_);
cell(0).metrics(mi, dim);
dh_ = 6; //mathed_char_height(LM_TC_VAR, mi, 'I', ascent_, descent_);
- cell(0).draw(pi, x + 1, y);
+ Changer dummy = pi.base.changeEnsureMath(currentMode());
+
+ cell(0).draw(pi, x, y);
Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
if (wide())
mathed_draw_deco(pi, x + 1, y + dy_, dim0.wid, dh_, key_->name);
else
mathed_draw_deco(pi, x + 1 + (dim0.wid - dw_) / 2,
y + dy_, dw_, dh_, key_->name);
Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
if (wide())
mathed_draw_deco(pi, x + 1, y + dy_, dim0.wid, dh_, key_->name);
else
mathed_draw_deco(pi, x + 1 + (dim0.wid - dw_) / 2,
y + dy_, dw_, dh_, key_->name);
// the decorations we need to support are listed in lib/symbols
t["acute"] = Attributes(true, "´");
t["bar"] = Attributes(true, "‾");
// the decorations we need to support are listed in lib/symbols
t["acute"] = Attributes(true, "´");
t["bar"] = Attributes(true, "‾");
// this is the macron, again, but it works
t["underline"] = Attributes(false, "¯");
t["underrightarrow"] = Attributes(false, "⟶");
// this is the macron, again, but it works
t["underline"] = Attributes(false, "¯");
t["underrightarrow"] = Attributes(false, "⟶");
t["vec"] = Attributes(true, "→");
t["widehat"] = Attributes(true, "^");
t["widetilde"] = Attributes(true, "∼");
}
t["vec"] = Attributes(true, "→");
t["widehat"] = Attributes(true, "^");
t["widetilde"] = Attributes(true, "∼");
}
- Translator const & t = translator();
- Translator::const_iterator cur = t.find(to_utf8(key_->name));
+ TranslationMap const & t = translationMap();
+ TranslationMap::const_iterator cur = t.find(to_utf8(key_->name));
LASSERT(cur != t.end(), return);
char const * const outag = cur->second.over ? "mover" : "munder";
os << MTag(outag)
LASSERT(cur != t.end(), return);
char const * const outag = cur->second.over ? "mover" : "munder";
os << MTag(outag)
if (name == "underbar" || name == "underline") {
os << MTag("span", "class='underbar'") << cell(0) << ETag("span");
return;
}
if (name == "underbar" || name == "underline") {
os << MTag("span", "class='underbar'") << cell(0) << ETag("span");
return;
}
bool symontop = cur->second.over;
string const symclass = symontop ? "symontop" : "symonbot";
os << MTag("span", "class='symbolpair " + symclass + "'")
<< '\n';
bool symontop = cur->second.over;
string const symclass = symontop ? "symontop" : "symonbot";
os << MTag("span", "class='symbolpair " + symclass + "'")
<< '\n';
// ideas borrowed from the eLyXer code
void InsetMathDecoration::validate(LaTeXFeatures & features) const
{
// ideas borrowed from the eLyXer code
void InsetMathDecoration::validate(LaTeXFeatures & features) const
{
"span.symbolpair{display: inline-block; text-align:center;}\n"
"span.symontop{vertical-align: top;}\n"
"span.symonbot{vertical-align: bottom;}\n"
"span.symbolpair{display: inline-block; text-align:center;}\n"
"span.symontop{vertical-align: top;}\n"
"span.symonbot{vertical-align: bottom;}\n"