commit 5fce313ffccea424487c83037b16f72f4f48eeb9
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Jan 21 12:24:02 2018 +0100

    Fix output of quote ligatures with TeX font LuaTeX
    
    Fixes: #10988
---
 src/insets/InsetQuotes.cpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp
index 7ae2d0f..1613eb3 100644
--- a/src/insets/InsetQuotes.cpp
+++ b/src/insets/InsetQuotes.cpp
@@ -898,15 +898,21 @@ void InsetQuotes::latex(otexstream & os, OutputParams 
const & runparams) const
        if (!runparams.pass_thru) {
                // Guard against unwanted ligatures with preceding text
                char_type const lastchar = os.lastChar();
+               // LuaTeX does not respect {} as ligature breaker by design,
+               // see https://tex.stackexchange.com/q/349725/19291
+               docstring const nolig =
+                               (runparams.flavor == OutputParams::LUATEX
+                                || runparams.flavor == 
OutputParams::DVILUATEX) ?
+                                       from_ascii("\\/") : from_ascii("{}");
                // !` ?` => !{}` ?{}`
                if (prefixIs(qstr, from_ascii("`"))
                    && (lastchar == '!' || lastchar == '?'))
-                       os << "{}";
+                       os << nolig;
                // ``` ''' ,,, <<< >>>
                // => `{}`` '{}'' ,{},, <{}<< >{}>>
                if (contains(from_ascii(",'`<>"), lastchar)
                    && prefixIs(qstr, lastchar))
-                       os << "{}";
+                       os << nolig;
        }
 
        os << qstr;

Reply via email to