fix bibenvironment handling in layout2layout

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10755 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-01-19 08:40:10 +00:00
parent c823a6afd3
commit ba4236f744
2 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,7 @@
2006-01-18 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* scripts/layout2layout.py: fix creation of "LatexType Bib_Environment"
2006-01-08 Georg Baum <Georg.Baum@post.rwth-aachen.de> 2006-01-08 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* scripts/layout2layout.py: add "LatexType Bib_Environment" to style * scripts/layout2layout.py: add "LatexType Bib_Environment" to style

View File

@ -70,7 +70,7 @@ def convert(lines):
only_comment = 1 only_comment = 1
label = "" label = ""
space1 = "" space1 = ""
latextype = "" latextype_line = -1
style = "" style = ""
while i < len(lines): while i < len(lines):
@ -128,18 +128,19 @@ def convert(lines):
# (or change the existing LatexType) # (or change the existing LatexType)
match = re_LatexType.match(lines[i]) match = re_LatexType.match(lines[i])
if match: if match:
latextype = match.group(4) latextype_line = i
lines[i] = re_LatexType.sub(r'\1\2\3Bib_Environment', lines[i])
match = re_Style.match(lines[i]) match = re_Style.match(lines[i])
if match: if match:
style = match.group(4) style = match.group(4)
label = "" label = ""
space1 = "" space1 = ""
latextype = "" latextype_line = -1
if re_End.match(lines[i]) and string.lower(label) == "bibliography": if re_End.match(lines[i]) and string.lower(label) == "bibliography":
if (latextype == ""): if (latextype_line < 0):
lines.insert(i, "%sLatexType Bib_Environment" % space1) lines.insert(i, "%sLatexType Bib_Environment" % space1)
i = i + 1 i = i + 1
else:
lines[latextype_line] = re_LatexType.sub(r'\1\2\3Bib_Environment', lines[latextype_line])
i = i + 1 i = i + 1