From a20477993bda8e9eaca1c8934e2b6f8991af562b Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Sat, 8 Oct 2022 16:42:55 +0200 Subject: [PATCH] Preview: do not overwrite fg/bg color names that beamer uses Rename them to lyxfg/lyxbg Fixes bug #12563. --- lib/scripts/legacy_lyxpreview2ppm.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/scripts/legacy_lyxpreview2ppm.py b/lib/scripts/legacy_lyxpreview2ppm.py index 29eb833f54..6ee5870df6 100644 --- a/lib/scripts/legacy_lyxpreview2ppm.py +++ b/lib/scripts/legacy_lyxpreview2ppm.py @@ -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)