]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyxconvert_221.py
add bibtopic support (bug 870).
[lyx.git] / lib / lyx2lyx / lyxconvert_221.py
index 14ade384ac295963c226ede5f0fc53d2d3014d63..2b809b1f36e5744fe97936a22cc4611695022c67 100644 (file)
@@ -1,4 +1,5 @@
 # This file is part of lyx2lyx
+# -*- coding: iso-8859-1 -*-
 # Copyright (C) 2002 Dekel Tsur <dekel@lyx.org>
 #
 # This program is free software; you can redistribute it and/or
@@ -16,6 +17,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 import string
+from parser_tools import find_token
 
 def add_end(header):
     header.append("\\end_header");
@@ -29,10 +31,19 @@ def convert_bibtex(lines):
         lines[i] = string.replace(lines[i],"\\begin_inset LatexCommand \\BibTeX",
                                   "\\begin_inset LatexCommand \\bibtex")
 
+def remove_insetparent(lines):
+    i = 0
+    while 1:
+        i = find_token(lines, "\\begin_inset LatexCommand \\lyxparent", i)
+        if i == -1:
+            break
+        del lines[i:i+3]
+
 def convert(header, body):
     add_end(header)
     convert_spaces(body)
     convert_bibtex(body)
+    remove_insetparent(body)
 
 if __name__ == "__main__":
     pass