commit 86b8b0340d4fa83540840fca56a79990f37ba657
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Mon Mar 17 18:31:36 2025 +0100

    Use "prologue" xcolor option when needed (named colors + dvips)
---
 src/LaTeXFeatures.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index e1566fdb99..b40b3304d1 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -1163,6 +1163,7 @@ string const LaTeXFeatures::getColorOptions() const
        // for more info see Bufferparams.cpp
 
        // [x]color.sty
+       vector<string> models;
        string clashdefs;
        if (isRequired("xcolor:svgnames")) {
                // Handle clashing x11colors
@@ -1171,10 +1172,11 @@ string const LaTeXFeatures::getColorOptions() const
                                string const nlatex = "DVIPS" + 
theLaTeXColors().getLaTeXColor(cc.first).latex();
                                lcolor.setLaTeXName(cc.first, nlatex);
                                clashdefs += "\\DefineNamedColor{named}{" + 
nlatex + "}{cmyk}{" + cc.second + "}\n";
+                               if (runparams_.flavor == Flavor::LaTeX || 
runparams_.flavor == Flavor::DviLuaTeX)
+                                       models.push_back("prologue");
                        }
                }
        }
-       vector<string> models;
        if (isRequired("xcolor:dvipsnames"))
                models.push_back("dvipsnames");
        if (isRequired("xcolor:svgnames"))
@@ -1183,6 +1185,8 @@ string const LaTeXFeatures::getColorOptions() const
                models.push_back("x11names");
        if (isRequired("xcolor:table"))
                models.push_back("table");
+       // remove duplicate entries
+       models.erase(unique(models.begin(), models.end()), models.end());
        if ((mustProvide("color") && !isRequired("xcolor") && 
!isProvided("xcolor"))
            || mustProvide("xcolor")) {
                string const package =
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to