From c1bfaa5c76ce99c222b5454c60b44d9c28543f5f Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Mon, 17 Oct 2016 19:35:04 +0200 Subject: [PATCH] Fix latex error when change-tracked deleted display math starts a new paragraph LaTeX refuses to break a line when it is empty. But we have to start a new line here, otherwise the whole displayed equation would be typeset as it were inline with previous content. The solution is to put a zero-length space just before the line break. Moreover, this is the right thing to do, as it simulates the extra space that is normally added in this circumstance. --- src/mathed/InsetMathHull.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 61c044a972..8bc67797b1 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1021,8 +1021,10 @@ void InsetMathHull::header_write(WriteStream & os) const break; case hullEquation: - if (os.strikeoutMath()) - os << "\\\\\\\\\n\\lyxmathsout{\\parbox{\\columnwidth}{"; + if (os.strikeoutMath()) { + os << "\\\\\\mbox{}\\\\\n" + << "\\lyxmathsout{\\parbox{\\columnwidth}{"; + } os << "\n"; os.startOuterRow(); if (n) @@ -1036,8 +1038,10 @@ void InsetMathHull::header_write(WriteStream & os) const case hullFlAlign: case hullGather: case hullMultline: - if (os.strikeoutMath()) - os << "\\\\\\\\\n\\lyxmathsout{\\parbox{\\columnwidth}{"; + if (os.strikeoutMath()) { + os << "\\\\\\mbox{}\\\\\n" + << "\\lyxmathsout{\\parbox{\\columnwidth}{"; + } os << "\n"; os.startOuterRow(); os << "\\begin{" << hullName(type_) << star(n) << "}\n"; -- 2.39.2