summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-office/lyx/files/legacy.patch')
-rw-r--r--app-office/lyx/files/legacy.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/app-office/lyx/files/legacy.patch b/app-office/lyx/files/legacy.patch
new file mode 100644
index 0000000..d546851
--- /dev/null
+++ b/app-office/lyx/files/legacy.patch
@@ -0,0 +1,33 @@
+diff --git a/lib/scripts/legacy_lyxpreview2ppm.py b/lib/scripts/legacy_lyxpreview2ppm.py
+index be242cc..3125006 100644
+--- a/lib/scripts/legacy_lyxpreview2ppm.py
++++ b/lib/scripts/legacy_lyxpreview2ppm.py
+@@ -172,11 +172,18 @@ def legacy_latex_file(latex_file, fg_color, bg_color, bg_color_gr):
+ use_preview_dvi_re = re.compile("(\s*\\\\usepackage\[[^]]+)(dvips\]{preview})")
+ use_preview_pdf_re = re.compile("(\s*\\\\usepackage\[[^]]+)(pdftex\]{preview})")
+
++ do_not_color_pictures_re = re.compile("(\\includegraphics)")
++
+ tmp = mkstemp()
+
+ success = 0
+ try:
+ for line in open(latex_file, 'r').readlines():
++ match = do_not_color_pictures_re.search(line)
++ if match != None:
++ tmp.write("\colorbox{white}{" + line + "}\n")
++ continue
++
+ match = use_preview_dvi_re.match(line)
+ if match == None:
+ match = use_preview_pdf_re.match(line)
+@@ -192,7 +199,7 @@ def legacy_latex_file(latex_file, fg_color, bg_color, bg_color_gr):
+
+ success = 1
+ tmp.write("%stightpage,%s\n" \
+- " \\AtBeginDocument{\\AtBeginDvi{%%\n" \
++ " \\usepackage{color}\n\\AtBeginDocument{\\AtBeginDvi{%%\n" \
+ " \\special{!userdict begin/bop-hook{//bop-hook exec\n" \
+ " <%s%s>{255 div}forall setrgbcolor\n" \
+ " clippath fill setrgbcolor}bind def end}}}\n" \
+