1 # This file is part of lyx2lyx
2 # Copyright (C) 2003 José Matos <jamatos@fep.up.pt>
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 from parser_tools import find_token
21 def rm_end_header(lines):
22 i = find_token(lines, "\\end_header", 0)
27 def convert_spaces(lines):
28 for i in range(len(lines)):
29 lines[i] = string.replace(lines[i],"\\InsetSpace ~", "\\SpecialChar ~")
31 def convert_bibtex(lines):
32 for i in range(len(lines)):
33 lines[i] = string.replace(lines[i], "\\begin_inset LatexCommand \\bibtex",
34 "\\begin_inset LatexCommand \\BibTeX")
36 def rm_tracking_changes(lines):
37 i = find_token(lines, "\\author", 0)
41 i = find_token(lines, "\\tracking_changes", 0)
46 def rm_body_changes(lines):
49 i = find_token(lines, "\\change_", i)
55 def convert(header, body):
59 rm_tracking_changes(header)
62 if __name__ == "__main__":