]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/layout2layout.py
tufte-handout.lyx: remove some unnecessary TeX code
[lyx.git] / lib / scripts / layout2layout.py
index 48a1e03f213b8f31cda58b6ce239ec04aa444527..7de844b87fb66ed41f5aaf216c5f0caa4165c08c 100644 (file)
@@ -193,6 +193,14 @@ import os, re, string, sys
 # New Layout tag "ProvideStyle"
 # Change "IfStyle" to "ModifyStyle"
 
+# Incremented to format 59, 22 November 2015 by gm
+# New Tag "OutlinerName"
+# New Layout tags "AddToToc", "IsTocCaption"
+# New Layout argument tag "IsTocCaption"
+
+# Incremented to format 60, 25 March 2016 by lasgouttes
+# Rename caption subtype LongTableNoNumber to Unnumbered
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -200,7 +208,7 @@ import os, re, string, sys
 # development/tools/updatelayouts.py script to update all
 # layout files to the new format.
 
-currentFormat = 58
+currentFormat = 60
 
 
 def usage(prog_name):
@@ -314,6 +322,7 @@ def convert(lines):
     re_TopEnvironment = re.compile(r'^(\s*)LabelType(\s+)Top_Environment\s*$', re.IGNORECASE)
     re_CenteredEnvironment = re.compile(r'^(\s*)LabelType(\s+)Centered_Top_Environment\s*$', re.IGNORECASE)
     re_ChapterStyle = re.compile(r'^\s*Style\s+Chapter\s*$', re.IGNORECASE)
+    re_InsetLayout_CaptionLTNN = re.compile(r'^(\s*InsetLayout\s+)(Caption:LongTableNonumber)', re.IGNORECASE)
 
 
     # counters for sectioning styles (hardcoded in 1.3)
@@ -425,6 +434,21 @@ def convert(lines):
                 i += 1
             continue
 
+        if format == 59:
+            match = re_InsetLayout_CaptionLTNN.match(lines[i])
+            if not match:
+                i += 1
+                continue
+            # '^(\s*InsetLayout\s+)(Caption:LongTableNonumber)'
+            lead  = match.group(1)
+            lines[i] = lead + "Caption:Unnumbered"
+            i += 1
+            continue
+
+        if format == 58:
+            # nothing to do.
+            i += 1
+            continue
 
         if format == 57:
             match = re_IfStyle.match(lines[i])