commit 772469027ce3d42e5ee1affe5db1b29e0f1ee2fc
Author: Juergen Spitzmueller <[email protected]>
Date:   Wed Aug 20 18:26:37 2025 +0200

    Fix pseudo paragraph (#13216)
    
    A blank between two display equations was wrongly interpreted
    as paragraph break since it stands alone on the line.
    
    We now add an empty group to prevent LaTeX from such an
    interpretation.
---
 src/Paragraph.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 7c84cad554..78ba89e1d8 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3107,6 +3107,17 @@ void Paragraph::latex(BufferParams const & bparams,
                        }
                }
 
+               if (runparams.wasDisplayMath && c == ' ' && i + 1 < size()
+                   && getInset(i + 1) && getInset(i + 1)->asInsetMath()
+                   && getInset(i + 1)->asInsetMath()->asHullInset()
+                   && getInset(i + 
1)->asInsetMath()->asHullInset()->outerDisplay()) {
+                       // A blank following displayed math, and another 
displayed math follows:
+                       // Add group to prevent LaTeX from interpreting this as 
a paragraph break.
+                       // Within a changed font, LaTeX would even error as 
font commands are
+                       // not \long (#13216).
+                       os << "{}";
+               }
+
                OutputParams rp = runparams;
                rp.free_spacing = style.free_spacing;
                rp.local_font = &current_font;
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to