]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/lyxpreview2bitmap.py
iucr.layout: use Item_Environment for a style as proposed by Jürgen
[lyx.git] / lib / scripts / lyxpreview2bitmap.py
index c647abbbd6e24c7a3a8773d40832a5bdab082930..5eca9599908f6c6faccb97dec0c79e23dfef2a11 100755 (executable)
@@ -160,25 +160,18 @@ def extract_metrics_info(dvipng_stdout):
 
 def fix_latex_file(latex_file):
     documentclass_re = re.compile("(\\\\documentclass\[)(1[012]pt,?)(.+)")
-    newcommandx_re = re.compile("^(\\\\newcommandx)(.+)")
 
     tmp = mkstemp()
 
     changed = 0
     for line in open(latex_file, 'r').readlines():
         match = documentclass_re.match(line)
-        if match != None:
-            changed = 1
-            tmp.write("%s%s\n" % (match.group(1), match.group(3)))
-            continue
-
-        match = newcommandx_re.match(line)
         if match == None:
             tmp.write(line)
             continue
 
         changed = 1
-        tmp.write("\\providecommandx%s\n" % match.group(2))
+        tmp.write("%s%s\n" % (match.group(1), match.group(3)))
 
     if changed:
         copyfileobj(tmp, open(latex_file,"wb"), 1)