Found by 2to3, but useful for python2 as well for consistency reasons.
if i == -1:
return
lines[i+1:i+1] = ["\\use_natbib 0",
- "\use_numerical_citations 0"]
+ "\\use_numerical_citations 0"]
supported_versions = ["1.2.%d" % i for i in range(5)] + ["1.2"]
pretext.append(tw)
if osf:
pretext.append('\\defaultfontfeatures{Numbers=OldStyle}')
- pretext.append('\usepackage{xunicode}')
- pretext.append('\usepackage{xltxtra}')
+ pretext.append('\\usepackage{xunicode}')
+ pretext.append('\\usepackage{xltxtra}')
insert_to_preamble(document, pretext)
document.body[stins:endins + 1] = newcontent
if foundone:
- add_to_preamble(document, ["\usepackage{nameref}"])
+ add_to_preamble(document, ["\\usepackage{nameref}"])
def remove_Nameref(document):
finally:
if load_rotating:
- add_to_preamble(document, ["\\@ifundefined{turnbox}{\usepackage{rotating}}{}"])
+ add_to_preamble(document, ["\\@ifundefined{turnbox}{\\usepackage{rotating}}{}"])
def convert_cell_rotation(document):
finally:
if load_rotating:
- add_to_preamble(document, ["\\@ifundefined{turnbox}{\usepackage{rotating}}{}"])
+ add_to_preamble(document, ["\\@ifundefined{turnbox}{\\usepackage{rotating}}{}"])
def convert_table_rotation(document):
# register that xcolor must be loaded in the preamble
if xcolor == False:
xcolor = True
- add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\usepackage{xcolor}}{}"])
+ add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\\usepackage{xcolor}}{}"])
# find the next \\color and/or the next \\end_layout
j = find_token(document.body, "\\color", i + 1)
k = find_token(document.body, "\\end_layout", i + 1)
pass
else:
# we also neeed to load xcolor in the preamble but only once
- add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\usepackage{xcolor}}{}"])
+ add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\\usepackage{xcolor}}{}"])
document.body[einset + 1 : einset + 1] = put_cmd_in_ert("}")
if framecolor != defaultframecolor:
document.body[binset:binset] = put_cmd_in_ert("\\fcolorbox{" + framecolor + "}{" + backcolor + "}{")