commit 767f3e5b819079deecbcbc938a3bbcea1227437f
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Mon Apr 10 08:37:04 2023 +0200

    Fix spacing in forceLTR for classic latex
---
 src/Paragraph.cpp |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 5944aa6..c332ab0 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1091,6 +1091,8 @@ void Paragraph::Private::latexInset(BufferParams const & 
bparams,
        }
 
        bool close_brace = false;
+       bool const disp_env = (inset->isEnvironment() && 
inset->getLayout().isDisplay())
+                       || runparams.inDisplayMath;
        string close_env;
        odocstream::pos_type const len = os.os().tellp();
 
@@ -1105,7 +1107,7 @@ void Paragraph::Private::latexInset(BufferParams const & 
bparams,
                if (runparams.use_polyglossia) {
                        // (lua)bidi
                        // Displayed environments go in an LTR environment
-                       if (inset->isEnvironment() && 
inset->getLayout().isDisplay()) {
+                       if (disp_env) {
                                os << "\\begin{LTR}";
                                close_env = "LTR";
                        } else {
@@ -1119,6 +1121,8 @@ void Paragraph::Private::latexInset(BufferParams const & 
bparams,
                } else {
                        // babel classic
                        os << "\\L{";
+                       if (disp_env)
+                               os << safebreakln;
                        close_brace = true;
                }
        }
@@ -1200,8 +1204,11 @@ void Paragraph::Private::latexInset(BufferParams const & 
bparams,
        if (!close_env.empty())
                os << "\\end{" << close_env << "}";
 
-       if (close_brace)
+       if (close_brace) {
                os << '}';
+               if (disp_env)
+                       os << safebreakln;
+       }
 
        if (os.texrow().rows() > previous_row_count) {
                os.texrow().start(owner_->id(), i + 1);
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to