]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathColor.cpp
In mathed, require xcolor instead of color when appropriate
[lyx.git] / src / mathed / InsetMathColor.cpp
index c50f61360932a519e6b6f030bd369f2f07852814..cbf6cb5d860cf455e92fcbe34f1f798f277ab7ef 100644 (file)
@@ -74,8 +74,24 @@ static bool normalcolor(docstring const & color)
 void InsetMathColor::validate(LaTeXFeatures & features) const
 {
        InsetMathNest::validate(features);
-       if (!normalcolor(color_))
-               features.require("color");
+       if (!normalcolor(color_)) {
+               switch (lcolor.getFromLaTeXName(to_utf8(color_))) {
+                       case Color_brown:
+                       case Color_darkgray:
+                       case Color_gray:
+                       case Color_lightgray:
+                       case Color_lime:
+                       case Color_olive:
+                       case Color_orange:
+                       case Color_pink:
+                       case Color_purple:
+                       case Color_teal:
+                       case Color_violet:
+                               features.require("xcolor");
+                       default:
+                               features.require("color");
+               }
+       }
 }