You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in conf.py. On make latexpdf we find in PDF output curly quotes ”versions” ’version’
Note that the latex file itself does correctly contain "versions" 'version' Environment info
OS: Mac
Python version: 3.7.5
Sphinx version: 2.x
Sphinx extensions: none
Extra tools: TeXLive 2019
This is reminiscent to #5179 (which was lualatex specific) and the fix as #5790 works.
In contrast, straight double quotes remains with pdflatex straight in PDF output as long as \usepackage[T1]{fontenc} is used, which is Sphinx default. Thus xelatex/lualatex behaves differently on same latex input.
But 'version' in input will give ’version’ in PDF for all engines (not tested Japanese). I am surprised that this has not been raised as issue so far, I need to investigate a bit, keeping it separate. With the default smartquotes = True the output will have the expected typographical curly quotes‘version’ (and “versions”) expected for English language.
The text was updated successfully, but these errors were encountered:
jfbu
changed the title
PDF build via xelatex transforms straight double quotes into curly ones (smartquotes being turned off))
PDF build via xelatex transforms straight double quotes into curly ones (smartquotes being turned off)
Dec 4, 2019
Closes: sphinx-doc#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).
Consider following source
Test ==== "versions" 'version'
And
in conf.py. On
make latexpdf
we find in PDF output curly quotes”versions” ’version’
Note that the latex file itself does correctly contain
"versions" 'version'
Environment info
This is reminiscent to #5179 (which was lualatex specific) and the fix as #5790 works.
In contrast, straight double quotes remains with pdflatex straight in PDF output as long as
\usepackage[T1]{fontenc}
is used, which is Sphinx default. Thusxelatex/lualatex
behaves differently on same latex input.But
'version'
in input will give’version’
in PDF for all engines (not tested Japanese). I am surprised that this has not been raised as issue so far, I need to investigate a bit, keeping it separate. With the defaultsmartquotes = True
the output will have the expected typographical curly quotes‘version’
(and“versions”
) expected for English language.The text was updated successfully, but these errors were encountered: