summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Sanda <ps@twin.jikos.cz>2018-02-21 17:24:52 +0100
committerPavel Sanda <ps@twin.jikos.cz>2018-02-21 17:24:52 +0100
commit01c59e91b3010a26d252c31439aea61d2922f52a (patch)
tree27972810ceb8aab49c2e7040caa1a4dd9f9f985b /app-office/lyx/files/legacy.patch
parentFix SRC_URI of pdfeditor. (diff)
downloadrebutia-01c59e91b3010a26d252c31439aea61d2922f52a.tar.gz
rebutia-01c59e91b3010a26d252c31439aea61d2922f52a.tar.bz2
rebutia-01c59e91b3010a26d252c31439aea61d2922f52a.zip
lyx live 2.3 patch, not for wider use, it counts on qt4.
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" \
+