def revert_clearpage(document):
- " clearpage -> ERT"
+ " clearpage -> ERT "
i = 0
while 1:
i = find_token(document.body, "\\clearpage", i)
def revert_cleardoublepage(document):
- " cleardoublepage -> ERT"
+ " cleardoublepage -> ERT "
i = 0
while 1:
i = find_token(document.body, "\\cleardoublepage", i)
i = i + 1
+def convert_lyxline(document):
+ " remove fontsize commands for \lyxline "
+ # The problematic is: The old \lyxline definition doesn't handle the fontsize
+ # to change the line thickness. The new definiton does this so that imported
+ # \lyxlines would have a different line thickness. The eventual fontsize command
+ # before \lyxline is therefore removed to get the same output.
+ fontsizes = ["tiny", "scriptsize", "footnotesize", "small", "normalsize",
+ "large", "Large", "LARGE", "huge", "Huge"]
+ for n in range(0, len(fontsizes)-1):
+ i = 0
+ k = 0
+ while 1:
+ i = find_token(document.body, "\\size " + fontsizes[n], i)
+ k = find_token(document.body, "\\lyxline",i)
+ # the corresponding fontsize command is always 2 lines before the \lyxline
+ if (i != -1 and k == i+2):
+ document.body[i:i+1] = []
+ else:
+ break
+ i = i + 1
+
+
def revert_encodings(document):
" Set new encodings to auto. "
encodings = ["8859-6", "8859-8", "cp437", "cp437de", "cp850", "cp852",
[254, [convert_esint]],
[255, []],
[256, []],
- [257, [convert_caption]]]
+ [257, [convert_caption, convert_lyxline]]]
revert = [[256, [revert_caption]],
[255, [revert_encodings]],
"\\providecommand{\\LyX}{L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}";
string const lyxline_def =
- "\\newcommand{\\lyxline}[1]{\n"
- " {#1 \\vspace{1ex} \\hrule width \\columnwidth \\vspace{1ex}}\n"
- "}";
+ "\\newcommand{\\lyxline}[1][1pt]{%\n"
+ " \\par\\noindent%\n"
+ " \\rule[.5ex]{\\linewidth}{#1}\\par}";
string const noun_def = "\\newcommand{\\noun}[1]{\\textsc{#1}}";