document.header[i : j + 1] = []
+def convert_includeall(document):
+ " Add maintain_unincluded_children param "
+
+ i = 0
+ i = find_token(document.header, "\\maintain_unincluded_children", 0)
+ if i == -1:
+ i = find_token(document.header, "\\textclass", 0)
+ if i == -1:
+ document.warning("Malformed LyX document! Missing \\textclass header.")
+ return
+ document.header.insert(i, "\\maintain_unincluded_children false")
+ return
+
+
def revert_includeall(document):
" Remove maintain_unincluded_children param "
del_token(document.header, '\\maintain_unincluded_children', 0)
def convert_math_output(document):
- " Convert \html_use_mathml to \html_math_output "
+ r" Convert \html_use_mathml to \html_math_output "
i = find_token(document.header, "\\html_use_mathml", 0)
if i == -1:
return
def revert_math_output(document):
- " Revert \html_math_output to \html_use_mathml "
+ r" Revert \html_math_output to \html_use_mathml "
i = find_token(document.header, "\\html_math_output", 0)
if i == -1:
return
def convert_prettyref(document):
" Converts prettyref references to neutral formatted refs "
- re_ref = re.compile("^\s*reference\s+\"(\w+):(\S+)\"")
- nm_ref = re.compile("^\s*name\s+\"(\w+):(\S+)\"")
+ re_ref = re.compile("^\\s*reference\\s+\"(\\w+):(\\S+)\"")
+ nm_ref = re.compile("^\\s*name\\s+\"(\\w+):(\\S+)\"")
i = 0
while True:
def revert_refstyle(document):
" Reverts neutral formatted refs to prettyref "
- re_ref = re.compile("^reference\s+\"(\w+):(\S+)\"")
- nm_ref = re.compile("^\s*name\s+\"(\w+):(\S+)\"")
+ re_ref = re.compile("^reference\\s+\"(\\w+):(\\S+)\"")
+ nm_ref = re.compile("^\\s*name\\s+\"(\\w+):(\\S+)\"")
i = 0
while True:
def revert_mathrsfs(document):
- " Load mathrsfs if \mathrsfs us use in the document "
+ r" Load mathrsfs if \mathrsfs us use in the document "
i = 0
for line in document.body:
if line.find("\\mathscr{") != -1:
if not check_passthru:
return
- rx = re.compile("\\\\begin_layout \s*(\w+)")
+ rx = re.compile("\\\\begin_layout \\s*(\\w+)")
beg = 0
for lay in ["Chunk", "Scrap"]:
while True:
" http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg161298.html "
if not check_passthru:
return
- rx = re.compile("\\\\begin_layout \s*(\w+)")
+ rx = re.compile("\\\\begin_layout \\s*(\\w+)")
beg = 0
for lay in ["Chunk", "Scrap"]:
while True:
def convert_langpack(document):
" Add \\language_package parameter "
- i = find_token(document.header, "\language" , 0)
+ i = find_token(document.header, r"\language" , 0)
if i == -1:
document.warning("Malformed document. No \\language defined!")
return
[373, [merge_gbrief]],
[374, []],
[375, []],
- [376, []],
+ [376, [convert_includeall]],
[377, []],
[378, []],
[379, [convert_math_output]],