]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathDecoration.cpp
Add \makeat switches to babel settings if necessary.
[lyx.git] / src / mathed / InsetMathDecoration.cpp
index 1cb3aebcc197a5528da5ab25cd96d5c5e9c25574..b9202f5d6394bbf5cc0e1d7623916d60f023c65b 100644 (file)
@@ -47,7 +47,7 @@ Inset * InsetMathDecoration::clone() const
 
 bool InsetMathDecoration::upper() const
 {
-       return key_->name.substr(0, 5) != "under";
+       return key_->name.substr(0, 5) != "under" && key_->name != "utilde";
 }
 
 
@@ -93,7 +93,9 @@ bool InsetMathDecoration::wide() const
                        key_->name == "widetilde" ||
                        key_->name == "underleftarrow" ||
                        key_->name == "underrightarrow" ||
-                       key_->name == "underleftrightarrow";
+                       key_->name == "underleftrightarrow" ||
+                       key_->name == "undertilde" ||
+                       key_->name == "utilde";
 }
 
 
@@ -105,10 +107,9 @@ InsetMath::mode_type InsetMathDecoration::currentMode() const
 
 void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       bool const upshape = currentMode() == TEXT_MODE
+       bool really_change_font = currentMode() == TEXT_MODE
                                && isMathFont(from_ascii(mi.base.fontname));
-       ShapeChanger dummy(mi.base.font, upshape ?
-                               UP_SHAPE : mi.base.font.shape());
+       FontSetChanger dummy(mi.base, "textnormal", really_change_font);
 
        cell(0).metrics(mi, dim);
 
@@ -129,10 +130,9 @@ void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetMathDecoration::draw(PainterInfo & pi, int x, int y) const
 {
-       bool const upshape = currentMode() == TEXT_MODE
+       bool really_change_font = currentMode() == TEXT_MODE
                                && isMathFont(from_ascii(pi.base.fontname));
-       ShapeChanger dummy(pi.base.font, upshape ?
-                               UP_SHAPE : pi.base.font.shape());
+       FontSetChanger dummy(pi.base, "textnormal", really_change_font);
 
        cell(0).draw(pi, x + 1, y);
        Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
@@ -206,6 +206,8 @@ namespace {
                // this is the macron, again, but it works
                t["underline"] = Attributes(false, "¯");
                t["underrightarrow"] = Attributes(false, "⟶");
+               t["undertilde"] = Attributes(false, "∼");
+               t["utilde"] = Attributes(false, "∼");
                t["vec"] = Attributes(true, "→");
                t["widehat"] = Attributes(true, "^");
                t["widetilde"] = Attributes(true, "∼");
@@ -273,21 +275,16 @@ void InsetMathDecoration::validate(LaTeXFeatures & features) const
        if (features.runparams().math_flavor == OutputParams::MathAsHTML) {
                string const name = to_utf8(key_->name);
                if (name == "bar") {
-                       features.addPreambleSnippet("<style type=\"text/css\">\n"
-                               "span.overbar{border-top: thin black solid;}\n"
-                               "</style>");
+                       features.addCSSSnippet("span.overbar{border-top: thin black solid;}");
                } else if (name == "underbar" || name == "underline") {
-                       features.addPreambleSnippet("<style type=\"text/css\">\n"
-                               "span.underbar{border-bottom: thin black solid;}\n"
-                               "</style>");
+                       features.addCSSSnippet("span.underbar{border-bottom: thin black solid;}");
                } else {
-                       features.addPreambleSnippet("<style type=\"text/css\">\n"
+                       features.addCSSSnippet(
                                "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>");
+                               "span.symbol{height: 0.5ex;}");
                }
        } else {
                if (!key_->requires.empty())