diff --git a/lib/scripts/lyxpreview-lytex2bitmap.py b/lib/scripts/lyxpreview-lytex2bitmap.py index 1e4cf5d863..26efeb612a 100755 --- a/lib/scripts/lyxpreview-lytex2bitmap.py +++ b/lib/scripts/lyxpreview-lytex2bitmap.py @@ -149,7 +149,7 @@ def color_pdf(latex_file, bg_color, fg_color): def fix_latex_file(latex_file): - documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt)(.)(.+)") + documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt,?)(.+)") tmp = mkstemp() @@ -161,7 +161,7 @@ def fix_latex_file(latex_file): continue changed = 1 - tmp.write("%s%s%s\n" % (match.group(1), match.group(3), match.group(4))) + tmp.write("%s%s%s\n" % (match.group(1), match.group(3))) if changed: copyfileobj(tmp, open(latex_file,"wb"), 1) diff --git a/lib/scripts/lyxpreview2bitmap.py b/lib/scripts/lyxpreview2bitmap.py index 7929ae014e..dbc5d566f6 100755 --- a/lib/scripts/lyxpreview2bitmap.py +++ b/lib/scripts/lyxpreview2bitmap.py @@ -168,7 +168,7 @@ def color_pdf(latex_file, bg_color, fg_color): def fix_latex_file(latex_file): - documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt)(.)(.+)") + documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt,?)(.+)") tmp = mkstemp() @@ -180,7 +180,7 @@ def fix_latex_file(latex_file): continue changed = 1 - tmp.write("%s%s%s\n" % (match.group(1), match.group(3), match.group(4))) + tmp.write("%s%s\n" % (match.group(1), match.group(3))) if changed: copyfileobj(tmp, open(latex_file,"wb"), 1)