From ccc0e03fdc4c880685db016d97cdea802512d104 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 5 Oct 2016 01:18:15 +0200 Subject: [PATCH] In mathed, require xcolor instead of color when appropriate Fixes bug #10417. --- src/mathed/InsetMathColor.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathColor.cpp b/src/mathed/InsetMathColor.cpp index c50f613609..cbf6cb5d86 100644 --- a/src/mathed/InsetMathColor.cpp +++ b/src/mathed/InsetMathColor.cpp @@ -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"); + } + } } -- 2.39.2