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
{{ message }}
Repository navigation
LaTeX: backticks in code-blocks trigger latexpdf build warning (and font change) with late TeXLive 2019 #8711
For users with LaTeX2e 2020-02-02 or later (i.e. final TL2019 but not early one) latexpdf build console output might get cluttered with
Package textcomp Warning: Symbol \textasciigrave not provided by
(textcomp) font family pcr in TS1 encoding.
(textcomp) Default family used instead on input line 98.
for each backtick rendered as a literal. The glyph in pdf output is slightly different. Possibly looks better, actually.
To Reproduce
Steps to reproduce the behavior:
Insert this in index.rst and issue make latexpdf.
::
The :py:func:`enumerate` function can be used for ...
Expected behavior
No LaTeX warnings.
Environment info
OS: [e.g. Unix/Linux/Mac/Win/other with version]
Python version: [e.g. 3.7.1]
Sphinx version: 3.4.0, 4.0.0+/3ed7590ed
LaTeX: TeXLive 2019 after LaTeX 2e 2020-02-02 update or TeXLive 2020.
changed the title [-]LaTeX: backticks in code-blocks trigger latexpdf build warning with late TeXLive 2019 (and font change)[/-][+]LaTeX: backticks in code-blocks trigger latexpdf build warning (and font change) with late TeXLive 2019[/+]on Jan 20, 2021
The problem is not only for code-blocks, this rst source:
We have a LaTeX problem with \`backticks'
triggers
Package textcomp Warning: Symbol \textasciigrave not provided by
(textcomp) font family ptm in TS1 encoding.
(textcomp) Default family used instead on input line 97.
if using default Sphinx "times" font for pdf output of main text.
The subsituted glyph looks actually better (at least for mono font). The problem is with the numerous warnings and loading of an extra tex font. Probably the reasonable way out (as LaTeX2e is not going to change back) is to switch to the TeX Gyre fonts. (might improve support for european languages, only Latin ones) This means also that we need to augment our dependencies for Linux distros and tell people to look out for "tex-gyre" or similar named package to install on their systems (Ubuntu xenial has it.)
This shows how the backtick and single quote (non smartified) look like with Sphinx default fonts for make latexpdf, when done with LaTeX posterior to 2020/02/02, and how it was before. And it shows how it would look like if we switched to the tex-gyre fonts by default (indenpendently hopefully of whether using LaTeX from 2015 or from 2020).
@tk0miya simplest way would be to replace our default \usepackage{times} by \usepackage{newtxtext}. The latter uses the tex gyre fonts clones for times+helvetica+courier. Arguably we could add \usepackage{newtxmath} for math equations matching better with Times-like body font.
@tk0miya simplest way would be to replace our default \usepackage{times} by \usepackage{newtxtext}. The latter uses the tex gyre fonts clones for times+helvetica+courier. Arguably we could add \usepackage{newtxmath} for math equations matching better with Times-like body font.
The package newtxtext is very useful to a LaTeX user, but not so much to us, because its goodies are mainly available via LaTeX macros which we are not going to output. Besides, it loads quite a few LaTeX packages. And on Ubuntu it is in texlive-fonts-extra which is very big (almost half a gigabyte). So in the end at #8716 I decided to use more directly tgtermes and tgheros (they are really almost exactly like what \usepackage{times} provided but the LaTeX support of the font system is more complete, for example they fix this issue and might improve support of European languages without having to use xetex or luatex).
For the monospace font newtxtt LaTeX package exists and has much less LaTeX dependencies than newtxtext, and I wish I could use it. Unfortunately it too adds texlive-fonts-extra as font dependency. What it would bring in addition to direct txtt usage is a choice of shapes for the 0 digit. txtt only has a slashed one, but newtxtt has a dotted one as well as two oblong ones, and one with the slash in other direction. Also newtxtt has an option to scale the font. But I felt txtt at regular size is already a good match to times (tgtermes).
Activity
[-]LaTeX: backticks in code-blocks trigger latexpdf build warning with late TeXLive 2019 (and font change)[/-][+]LaTeX: backticks in code-blocks trigger latexpdf build warning (and font change) with late TeXLive 2019[/+]jfbu commentedon Jan 20, 2021
The problem is not only for code-blocks, this rst source:
We have a LaTeX problem with \`backticks'triggers
if using default Sphinx "times" font for pdf output of main text.
jfbu commentedon Jan 20, 2021
The subsituted glyph looks actually better (at least for mono font). The problem is with the numerous warnings and loading of an extra tex font. Probably the reasonable way out (as LaTeX2e is not going to change back) is to switch to the TeX Gyre fonts. (might improve support for european languages, only Latin ones) This means also that we need to augment our dependencies for Linux distros and tell people to look out for "tex-gyre" or similar named package to install on their systems (Ubuntu xenial has it.)
I am attaching
testasciigrave.pdf with its latex source
testasciigrave.tex.txt with extra
.txtin filename to attach here.This shows how the backtick and single quote (non smartified) look like with Sphinx default fonts for
make latexpdf, when done with LaTeX posterior to 2020/02/02, and how it was before. And it shows how it would look like if we switched to the tex-gyre fonts by default (indenpendently hopefully of whether using LaTeX from 2015 or from 2020).tk0miya commentedon Jan 20, 2021
+1 for adding the font to our dependency list. It's good timing for us to do that because we have a plan for a major release this spring.
jfbu commentedon Jan 20, 2021
@tk0miya simplest way would be to replace our default
\usepackage{times}by\usepackage{newtxtext}. The latter uses the tex gyre fonts clones for times+helvetica+courier. Arguably we could add\usepackage{newtxmath}for math equations matching better with Times-like body font.LaTeX: update default font configuration
LaTeX: update default font configuration
jfbu commentedon Jan 20, 2021
The package
newtxtextis very useful to a LaTeX user, but not so much to us, because its goodies are mainly available via LaTeX macros which we are not going to output. Besides, it loads quite a few LaTeX packages. And on Ubuntu it is in texlive-fonts-extra which is very big (almost half a gigabyte). So in the end at #8716 I decided to use more directly tgtermes and tgheros (they are really almost exactly like what\usepackage{times}provided but the LaTeX support of the font system is more complete, for example they fix this issue and might improve support of European languages without having to use xetex or luatex).For the monospace font
newtxttLaTeX package exists and has much less LaTeX dependencies thannewtxtext, and I wish I could use it. Unfortunately it too adds texlive-fonts-extra as font dependency. What it would bring in addition to directtxttusage is a choice of shapes for the 0 digit.txttonly has a slashed one, butnewtxtthas a dotted one as well as two oblong ones, and one with the slash in other direction. Alsonewtxtthas an option to scale the font. But I felttxttat regular size is already a good match to times (tgtermes).jfbu commentedon Jan 23, 2021
Fixed by #8716 for next major release
Master.patch (#1)