mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix output of quote ligatures with TeX font LuaTeX
Fixes: #10988
(cherry picked from commit 5fce313ffc
)
This commit is contained in:
parent
5018d23ff9
commit
17e241c694
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user