Am Mittwoch, 18. Januar 2006 17:57 schrieb Juergen Spitzmueller:
> Attached the original beamer.layout and the result of its conversion by
> means of layout2layout. As Jean-Marc already noted, the problem is that
> Bib_Environments are added all over the place.
> 
> Hope this helps,

Yes, it did. There was a check for the right style missing. Here is the 
fix, please test.


Georg
Index: lib/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.755
diff -u -p -r1.755 ChangeLog
--- lib/ChangeLog	8 Jan 2006 15:35:37 -0000	1.755
+++ lib/ChangeLog	18 Jan 2006 21:27:52 -0000
@@ -1,3 +1,7 @@
+2006-01-18  Georg Baum  <[EMAIL PROTECTED]>
+
+	* scripts/layout2layout.py: fix creation of "LatexType Bib_Environment"
+
 2006-01-08  Georg Baum  <[EMAIL PROTECTED]>
 
 	* scripts/layout2layout.py: add "LatexType Bib_Environment" to style
Index: lib/scripts/layout2layout.py
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/scripts/layout2layout.py,v
retrieving revision 1.3
diff -u -p -r1.3 layout2layout.py
--- lib/scripts/layout2layout.py	8 Jan 2006 15:35:38 -0000	1.3
+++ lib/scripts/layout2layout.py	18 Jan 2006 21:27:52 -0000
@@ -70,7 +70,7 @@ def convert(lines):
     only_comment = 1
     label = ""
     space1 = ""
-    latextype = ""
+    latextype_line = -1
     style = ""
     while i < len(lines):
 
@@ -79,7 +79,7 @@ def convert(lines):
             i = i + 1
             continue
 
-	# insert file format if not already there
+        # insert file format if not already there
         if (only_comment):
                 match = re_Format.match(lines[i])
                 if match:
@@ -128,18 +128,19 @@ def convert(lines):
         # (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])
+            latextype_line = i
         match = re_Style.match(lines[i])
         if match:
             style = match.group(4)
             label = ""
             space1 = ""
-            latextype = ""
+            latextype_line = -1
         if re_End.match(lines[i]) and string.lower(label) == "bibliography":
-            if (latextype == ""):
+            if (latextype_line < 0):
                 lines.insert(i, "%sLatexType Bib_Environment" % space1)
                 i = i + 1
+            else:
+                lines[latextype_line] = re_LatexType.sub(r'\1\2\3Bib_Environment', lines[latextype_line])
 
         i = i + 1
 

Reply via email to