BufferParams.cpp: correct output for \mathindent after [fc1c5c6f/lyxgit]

- also adapt the lyx2lyx logic to the changed implementation
This commit is contained in:
Uwe Stöhr 2017-04-15 17:32:58 +02:00
parent 5c91be293d
commit 3677c20be9
2 changed files with 5 additions and 4 deletions

View File

@ -2000,11 +2000,12 @@ def revert_mathindent(document):
add_to_preamble(document, ["\\setlength{\\mathindent}{" + value + '}'])
del document.header[i]
# now set the document class option
regexp = re.compile(r'(\\is_math_indent)')
regexp = re.compile(r'(\\is_math_indent 1)')
i = find_re(document.header, regexp, 0)
value = "1"
if i == -1:
return
regexp = re.compile(r'(\\is_math_indent)')
j = find_re(document.header, regexp, 0)
del document.header[j]
else:
k = find_token(document.header, "\\options", 0)
if k != -1:

View File

@ -1348,7 +1348,7 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
else
os << "\n\\defskip " << getDefSkip().asLyXCommand();
os << "\n\\is_math_indent " << is_math_indent;
if (is_math_indent)
if (is_math_indent && getMathIndentation().asLyXCommand() != "default")
os << "\n\\math_indentation " << getMathIndentation().asLyXCommand();
os << "\n\\quotes_style "
<< string_quotes_style[quotes_style]