i += 1
continue
- document.body[j - 2 : j + 1] = put_cmd_in_ert("\\end{landscape}")
- document.body[i : i + 4] = put_cmd_in_ert("\\begin{landscape}")
+ if document.body[i] == "\\begin_inset Flex Landscape (Floating)":
+ document.body[j - 2 : j + 1] = put_cmd_in_ert("\\end{landscape}}")
+ document.body[i : i + 4] = put_cmd_in_ert("\\afterpage{\\begin{landscape}")
+ add_to_preamble(document, ["\\usepackage{afterpage}"])
+ else:
+ document.body[j - 2 : j + 1] = put_cmd_in_ert("\\end{landscape}")
+ document.body[i : i + 4] = put_cmd_in_ert("\\begin{landscape}")
+
add_to_preamble(document, ["\\usepackage{pdflscape}"])
# no need to reset i
+def convert_fontenc(document):
+ " Convert default fontenc setting "
+
+ i = find_token(document.header, "\\fontencoding global", 0)
+ if i == -1:
+ return
+
+ document.header[i] = document.header[i].replace("global", "auto")
+
+
+def revert_fontenc(document):
+ " Revert default fontenc setting "
+
+ i = find_token(document.header, "\\fontencoding auto", 0)
+ if i == -1:
+ return
+
+ document.header[i] = document.header[i].replace("auto", "global")
+
+
+def revert_nospellcheck(document):
+ " Remove nospellcheck font info param "
+
+ i = 0
+ while True:
+ i = find_token(document.body, '\\nospellcheck', i)
+ if i == -1:
+ return
+ del document.body[i]
+
+
##
# Conversion hub
#
[545, [convert_lst_literalparam]],
[546, []],
[547, []],
- [548, []]
+ [548, []],
+ [549, []],
+ [550, [convert_fontenc]],
+ [551, []]
]
revert = [
+ [549, [revert_nospellcheck]],
+ [549, [revert_fontenc]],
+ [548, []],# dummy format change
[547, [revert_lscape]],
[546, [revert_xcharter]],
[545, [revert_paratype]],