usage:
revert_Argument_to_TeX_brace(document, LineOfBegin, LineOfEnd, StartArgument, EndArgument, isEnvironment, isOpt)
LineOfBegin is the line of the \\begin_layout or \\begin_inset statement
- LineOfEnd is the line of the \end_layout or \end_inset statement, if "0" is given, the end of the file is used instead
+ LineOfEnd is the line of the \\end_layout or \\end_inset statement, if "0" is given, the end of the file is used instead
StartArgument is the number of the first argument that needs to be converted
EndArgument is the number of the last argument that needs to be converted or the last defined one
isEnvironment must be true, if the layout is for a LaTeX environment
else:
beginBrace = find_token(document.body, "{", endBrace, end_layout)
# assure that the ERTs are consecutive (11 or 12 depending if there is a space between the ERTs or not)
- if beginBrance != -1 and (beginBrace == endBrace + 11 or beginBrace == endBrace + 12):
+ if beginBrace != -1 and (beginBrace == endBrace + 11 or beginBrace == endBrace + 12):
end = find_token(document.body, "\\end_inset", beginBrace)
document.body[lineERT : end + 1] = ["\\end_layout", "", "\\end_inset"]
if loop == 1:
def revert_negative_space(document):
- "Revert InsetSpace negmedspace and negthickspace into its TeX-code counterpart"
+ "Revert InsetSpace negmedspace and negthickspace into their TeX-code counterparts"
i = 0
j = 0
reverted = False
if reverted == True:
i = find_token(document.header, "\\use_amsmath 2", 0)
if i == -1:
- add_to_preamble(document, ["\\@ifundefined{negthickspace}{\\usepackage{amsmath}}"])
+ add_to_preamble(document, ["\\@ifundefined{negthickspace}{\\usepackage{amsmath}}{}"])
return
if i == -1:
return
def convert_listoflistings(document):
- 'Convert ERT \lstlistoflistings to TOC lstlistoflistings inset'
+ r'Convert ERT \lstlistoflistings to TOC lstlistoflistings inset'
# We can support roundtrip because the command is so simple
i = 0
while True: