]> git.lyx.org Git - features.git/commitdiff
Fix latex error when change-tracked deleted display math starts a new paragraph
authorEnrico Forestieri <forenr@lyx.org>
Mon, 17 Oct 2016 17:35:04 +0000 (19:35 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 17 Oct 2016 17:35:04 +0000 (19:35 +0200)
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

index 61c044a972d45a5c96aa19c686a190f0c49a98d2..8bc67797b1a8f9589c76a861305d69ee032ef9ad 100644 (file)
@@ -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";