]> git.lyx.org Git - features.git/commitdiff
Do not wrap forceTLR in \L with babel and unicode engines
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 24 Dec 2022 08:20:02 +0000 (09:20 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 24 Dec 2022 08:20:02 +0000 (09:20 +0100)
It does not seem to be needed, the \L macro is undefined, and there
does not seem to be an alternative.

src/Paragraph.cpp

index 063bf324de3c5897c7792633aa41c71c7b782861..8f5f6f371d4cf399565d0aee3c953cb317b0a8fb 100644 (file)
@@ -1094,16 +1094,21 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
        odocstream::pos_type const len = os.os().tellp();
 
        if (inset->forceLTR(runparams)
+           // babel with Xe/LuaTeX does not need a switch
+           // and \L is not defined there.
+           && (!runparams.isFullUnicode() || !runparams.use_babel)
            && running_font.isRightToLeft()
            // ERT is an exception, it should be output with no
            // decorations at all
            && inset->lyxCode() != ERT_CODE) {
-               if (runparams.use_polyglossia) {
+               if (runparams.use_polyglossia)
+                       // (lua)bidi
                        os << "\\LRE{";
-               else if (running_font.language()->lang() == "farsi"
-                          || running_font.language()->lang() == "arabic_arabi")
+               else if (running_font.language()->lang() == "farsi"
+                        || running_font.language()->lang() == "arabic_arabi")
                        os << "\\textLR{" << termcmd;
                else
+                       // babel classic
                        os << "\\L{";
                close = true;
        }