From: Georg Baum Date: Sun, 8 Jan 2006 15:35:38 +0000 (+0000) Subject: Convert bib_environment in layout2layout X-Git-Tag: 1.6.10~13707 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7adc8beb4d338b82b52e768ce4538c3168dc986f;p=features.git Convert bib_environment in layout2layout git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10715 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 5751ed6473..0a7831def6 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,11 @@ +2006-01-08 Georg Baum + + * 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 * layouts/cv.layout (Bibliography): change latextype to diff --git a/lib/layouts/aastex.layout b/lib/layouts/aastex.layout index bb72ea78bc..17ba120e48 100644 --- a/lib/layouts/aastex.layout +++ b/lib/layouts/aastex.layout @@ -443,7 +443,7 @@ End Style References Margin First_Dynamic - LatexType Item_Environment + LatexType Bib_Environment LatexName thebibliography NextNoIndent 1 LeftMargin MM diff --git a/lib/layouts/kluwer.layout b/lib/layouts/kluwer.layout index 4eec1590aa..b6e10c98f4 100644 --- a/lib/layouts/kluwer.layout +++ b/lib/layouts/kluwer.layout @@ -344,7 +344,7 @@ End Style References Margin First_Dynamic - LatexType Item_Environment + LatexType Bib_Environment LatexName thebibliography NextNoIndent 1 LeftMargin MM diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py index 426e1e7589..33bec8581e 100644 --- a/lib/scripts/layout2layout.py +++ b/lib/scripts/layout2layout.py @@ -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