]> git.lyx.org Git - features.git/commitdiff
Amend 7441172d
authorUdi-Fogiel <udifoglle@gmail.com>
Fri, 29 Dec 2023 19:10:50 +0000 (20:10 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Fri, 29 Dec 2023 19:10:50 +0000 (20:10 +0100)
colswitch was checking for oldstyle instead of normalcolor
to see if we need \normalcolor, which lead to appearence
of \color{none} in some cases, but "none" is not a known
color.

src/mathed/InsetMathColor.cpp

index e3be8ff9bf9bf22efd0b8b389159f70bac59ba29..549ff37b0ab52fe11f131b09f0273f45482968d3 100644 (file)
@@ -111,9 +111,9 @@ void InsetMathColor::write(TeXMathStream & os) const
        bool adjchk = os.latex() && !os.inMathClass() && (normalcolor(color_) || oldstyle_);
        bool adjust_front = frontclass != "mathord" && adjchk;
        bool adjust_back = backclass != "mathord" && adjchk;
-       docstring const colswitch =
-               oldstyle_ ? from_ascii("{\\color{") + color_ + from_ascii("}")
-                         : from_ascii("{\\normalcolor ");
+       docstring const colswitch = normalcolor(color_)
+                       ? from_ascii("{\\normalcolor ")
+                       : from_ascii("{\\color{") + color_ + from_ascii("}");
 
        if (adjust_front && adjust_back) {
                os << '\\' << frontclass << colswitch << cell(0).front() << '}';