]> git.lyx.org Git - features.git/commitdiff
* lib/scripts/layout2layout.py
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 13 Apr 2006 08:54:50 +0000 (08:54 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 13 Apr 2006 08:54:50 +0000 (08:54 +0000)
(convert): Change "LabelType Static" to "LabelType Itemize" for
itemize environments
(convert): Change "LabelType Counter_EnumI" to "LabelType Enumerate"
for enumerate environments

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13659 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/layout2layout.py

index dddeaaf6f5dda943cb8d837394fe27c2c5e51c49..ff16f5cb962cad32a3ad0c165d5cd86e931fd0c6 100644 (file)
@@ -114,6 +114,7 @@ def convert(lines):
     labelstring_line = -1
     labelstringappendix_line = -1
     labeltype_line = -1
+    latextype = ""
     latextype_line = -1
     style = ""
     maxcounter = 0
@@ -206,6 +207,7 @@ def convert(lines):
         # Remember the LatexType line
         match = re_LatexType.match(lines[i])
         if match:
+            latextype = string.lower(match.group(4))
             latextype_line = i
 
         # Reset variables at the beginning of a style definition
@@ -220,6 +222,7 @@ def convert(lines):
             labelstring_line = -1
             labelstringappendix_line = -1
             labeltype_line = -1
+            latextype = ""
             latextype_line = -1
 
         if re_End.match(lines[i]):
@@ -233,6 +236,16 @@ def convert(lines):
                 else:
                     lines[latextype_line] = re_LatexType.sub(r'\1\2\3Bib_Environment', lines[latextype_line])
 
+            # Change "LabelType Static" to "LabelType Itemize" for itemize environments
+            if latextype == "item_environment" and string.lower(label) == "static":
+                lines[labeltype_line] = re_LabelType.sub(r'\1\2\3Itemize', lines[labeltype_line])
+
+            # Change "LabelType Counter_EnumI" to "LabelType Enumerate" for enumerate environments
+            if latextype == "item_environment" and string.lower(label) == "counter_enumi":
+                lines[labeltype_line] = re_LabelType.sub(r'\1\2\3Enumerate', lines[labeltype_line])
+                # Don't add the LabelCounter line later
+                counter = ""
+
             # Replace
             #
             # LabelString "Chapter"