LaTeX: inhibit so-called TeX Ligatures with xelatex and lualatex

Closes: #6886

It is difficult to understand why fontspec _by default_ turns straight
double quotes " into ” i.e. right curly ones, calling this "TeX
ligature", but that's life and fortunately fontspec also provides a way
to turn this off. With this workaround also a straight ' in LaTeX file,
(i.e. a straight ' in source and smartquotes = False was used) will not
become a curly quote and this is an advantage compared to the pdflatex
situation.

We suppress TeX Ligatures also for \ttfamily (used in code-blocks) but
that appears to be already the case with fontspec although user manual
does not seem explicit (and no list of what exactly the TeX Ligatures
are is to be found in fontspec user documentation, one has to go into
its source code). (the fact that Pygmentize escapes the " to \char`\"
TeX mark-up would not by itself prevent the transformation into a curly
double quote, it is because fontspec does not apply this transform to
monospace typeface that it did not show).
This commit is contained in:
jfbu 2019-12-04 23:57:46 +01:00
parent 7292ab7eef
commit bc1557528f
2 changed files with 5 additions and 2 deletions

View File

@ -81,6 +81,8 @@ Bugs fixed
include this match. include this match.
* #6848: config.py shouldn't pop extensions from overrides * #6848: config.py shouldn't pop extensions from overrides
* #6867: text: extra spaces are inserted to hyphenated words on folding lines * #6867: text: extra spaces are inserted to hyphenated words on folding lines
* #6886: LaTeX: xelatex converts straight double quotes into right curly ones
(shows when :confval:`smartquotes` is ``False``)
* #6876: LaTeX: multi-line display of authors on title page has ragged edges * #6876: LaTeX: multi-line display of authors on title page has ragged edges
Testing Testing

View File

@ -194,7 +194,8 @@ ADDITIONAL_SETTINGS = {
'latex_engine': 'xelatex', 'latex_engine': 'xelatex',
'polyglossia': '\\usepackage{polyglossia}', 'polyglossia': '\\usepackage{polyglossia}',
'babel': '', 'babel': '',
'fontenc': '\\usepackage{fontspec}', 'fontenc': ('\\usepackage{fontspec}\n'
'\\defaultfontfeatures[\\rmfamily,\\sffamily,\\ttfamily]{}'),
'fontpkg': XELATEX_DEFAULT_FONTPKG, 'fontpkg': XELATEX_DEFAULT_FONTPKG,
'textgreek': '', 'textgreek': '',
'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0' 'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0'
@ -205,7 +206,7 @@ ADDITIONAL_SETTINGS = {
'polyglossia': '\\usepackage{polyglossia}', 'polyglossia': '\\usepackage{polyglossia}',
'babel': '', 'babel': '',
'fontenc': ('\\usepackage{fontspec}\n' 'fontenc': ('\\usepackage{fontspec}\n'
'\\defaultfontfeatures[\\rmfamily,\\sffamily]{}'), '\\defaultfontfeatures[\\rmfamily,\\sffamily,\\ttfamily]{}'),
'fontpkg': LUALATEX_DEFAULT_FONTPKG, 'fontpkg': LUALATEX_DEFAULT_FONTPKG,
'textgreek': '', 'textgreek': '',
'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0' 'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0'