]> git.lyx.org Git - lyx.git/commitdiff
Preview: do not overwrite fg/bg color names that beamer uses
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 8 Oct 2022 14:42:55 +0000 (16:42 +0200)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Wed, 23 Nov 2022 02:26:18 +0000 (21:26 -0500)
Rename them to lyxfg/lyxbg

Fixes bug #12563.

(cherry picked from commit a20477993bda8e9eaca1c8934e2b6f8991af562b)

lib/scripts/legacy_lyxpreview2ppm.py

index 8effd5bd00cfdc5ba2a60992db72c517570f2424..08703fb38046b94dfc5001da10ac003877220613 100644 (file)
@@ -235,9 +235,9 @@ def legacy_latex_file(latex_file, fg_color, bg_color):
             else:
                 tmp.write(b"""
 \\usepackage{color}
-\\definecolor{fg}{rgb}{%s}
-\\definecolor{bg}{rgb}{%s}
-\\pagecolor{bg}
+\\definecolor{lyxfg}{rgb}{%s}
+\\definecolor{lyxbg}{rgb}{%s}
+\\pagecolor{lyxbg}
 \\usepackage{polyglossia}
 """ % (fg_color_gr, bg_color_gr))
                 polyglossia = True
@@ -248,16 +248,16 @@ def legacy_latex_file(latex_file, fg_color, bg_color):
         if not polyglossia:
             tmp.write(b"""
 \\usepackage{color}
-\\definecolor{fg}{rgb}{%s}
-\\definecolor{bg}{rgb}{%s}
-\\pagecolor{bg}
+\\definecolor{lyxfg}{rgb}{%s}
+\\definecolor{lyxbg}{rgb}{%s}
+\\pagecolor{lyxbg}
 \\usepackage[%s,tightpage]{preview}
 \\makeatletter
 \\def\\t@a{cmr}
 \\if\\f@family\\t@a
 \\IfFileExists{lmodern.sty}{\\usepackage{lmodern}}{\\usepackage{ae,aecompl}}
 \\fi
-\\g@addto@macro\\preview{\\begingroup\\color{bg}\\special{ps::clippath fill}\\color{fg}}
+\\g@addto@macro\\preview{\\begingroup\\color{lyxbg}\\special{ps::clippath fill}\\color{lyxfg}}
 \\g@addto@macro\\endpreview{\\endgroup}
 \\makeatother
 """ % (fg_color_gr, bg_color_gr, previewopts))
@@ -265,7 +265,7 @@ def legacy_latex_file(latex_file, fg_color, bg_color):
             tmp.write(b"""
 \\usepackage[%s,tightpage]{preview}
 \\makeatletter
-\\g@addto@macro\\preview{\\begingroup\\color{bg}\\special{ps::clippath fill}\\color{fg}}
+\\g@addto@macro\\preview{\\begingroup\\color{lyxbg}\\special{ps::clippath fill}\\color{lyxfg}}
 \\g@addto@macro\\endpreview{\\endgroup}
 \\makeatother
 """ % previewopts)