]> git.lyx.org Git - features.git/commitdiff
Convert bib_environment in layout2layout
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 8 Jan 2006 15:35:38 +0000 (15:35 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 8 Jan 2006 15:35:38 +0000 (15:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10715 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/layouts/aastex.layout
lib/layouts/kluwer.layout
lib/scripts/layout2layout.py

index 5751ed64737547b51f3b48cac633a5f13ebbc4ae..0a7831def6a30bdf8a6b5b63c75c22869a44209b 100644 (file)
@@ -1,3 +1,11 @@
+2006-01-08  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * scripts/layout2layout.py: add "LatexType Bib_Environment" to style
+       if LabelType is Bibliography.
+       * layouts/aastex.layout:
+       * layouts/kluwer.layout: Change LatexType of Bibliography style to
+       Bib_Environment. 
+
 2006-01-05  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * layouts/cv.layout (Bibliography): change latextype to
index bb72ea78bcadbc1a86ab6bd9aaad4e4d9c8024e5..17ba120e4863ff555a941e3101b82d594ec96842 100644 (file)
@@ -443,7 +443,7 @@ End
 
 Style References
        Margin                First_Dynamic
-       LatexType             Item_Environment
+       LatexType             Bib_Environment
        LatexName             thebibliography
        NextNoIndent          1
        LeftMargin            MM
index 4eec1590aa50ff0a6a44f96f0eedc23f2181b5b6..b6e10c98f4b8f4584fcf5f42dc62ab6e21ccbf11 100644 (file)
@@ -344,7 +344,7 @@ End
 
 Style References
        Margin                First_Dynamic
-       LatexType             Item_Environment
+       LatexType             Bib_Environment
        LatexName             thebibliography
        NextNoIndent          1
        LeftMargin            MM
index 426e1e7589e248c2cde91232ba60b6886a366ddb..33bec8581ee0c80a1af471726c4344ea0cd48812 100644 (file)
@@ -62,9 +62,16 @@ def convert(lines):
     re_EndPreamble = re.compile(r'^(\s*)EndPreamble', re.IGNORECASE)
     re_MaxCounter = re.compile(r'^\s*MaxCounter', re.IGNORECASE)
     re_LabelType = re.compile(r'^(\s*)(LabelType)(\s+)(\S+)', re.IGNORECASE)
+    re_LatexType = re.compile(r'^(\s*)(LatexType)(\s+)(\S+)', re.IGNORECASE)
+    re_Style = re.compile(r'^(\s*)(Style)(\s+)(\S+)', re.IGNORECASE)
+    re_End = re.compile(r'^(\s*)(End)(\s*)$', re.IGNORECASE)
 
     i = 0
     only_comment = 1
+    label = ""
+    space1 = ""
+    latextype = ""
+    style = ""
     while i < len(lines):
 
         # Skip comments and empty lines
@@ -110,13 +117,30 @@ def convert(lines):
         match = re_LabelType.match(lines[i])
         if match:
             label = match.group(4)
+            space1 = match.group(1)
             if string.lower(label[:8]) == "counter_":
                 counter = label[8:]
                 lines[i] = re_LabelType.sub(r'\1\2\3Counter', lines[i])
                 # use the same indentation
-                space1 = match.group(1)
                 lines.insert(i + 1, "%sLabelCounter %s" % (space1, counter))
 
+        # Add a line "LatexType Bib_Environment" if LabelType is Bibliography
+        # (or change the existing LatexType)
+        match = re_LatexType.match(lines[i])
+        if match:
+            latextype = match.group(4)
+            lines[i] = re_LatexType.sub(r'\1\2\3Bib_Environment', lines[i])
+        match = re_Style.match(lines[i])
+        if match:
+            style = match.group(4)
+            label = ""
+            space1 = ""
+            latextype = ""
+        if re_End.match(lines[i]) and string.lower(label) == "bibliography":
+            if (latextype == ""):
+                lines.insert(i, "%sLatexType Bib_Environment" % space1)
+                i = i + 1
+
         i = i + 1