]> git.lyx.org Git - features.git/commitdiff
Fix output of quote ligatures with TeX font LuaTeX
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 21 Jan 2018 11:24:02 +0000 (12:24 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 22 Jan 2018 08:24:59 +0000 (09:24 +0100)
Fixes: #10988
(cherry picked from commit 5fce313ffccea424487c83037b16f72f4f48eeb9)

src/insets/InsetQuotes.cpp

index 8b5334d1d36f0d16e4f9d7c08a87abe567950c03..be06bd4978eb1444f9cf27f586461e7fd1c0f431 100644 (file)
@@ -901,15 +901,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;