commit c1bfaa5c76ce99c222b5454c60b44d9c28543f5f
Author: Enrico Forestieri <for...@lyx.org>
Date:   Mon Oct 17 19:35:04 2016 +0200

    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 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 61c044a..8bc6779 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";

Reply via email to