spatialaudio / nbsphinx

:ledger: Sphinx source parser for Jupyter notebooks
https://nbsphinx.readthedocs.io/
MIT License
450 stars 130 forks source link

LaTeX: Package textcomp Warning: Symbol \textasciigrave not provided #663

Open mgeier opened 2 years ago

mgeier commented 2 years ago

The "Font warnings" are another can of worms. I only looked briefly (well not so briefly sadly and worst is that I did not complete fully investigation) at

Package textcomp Warning: Symbol \textasciigrave not provided by (textcomp) font family zlmtt in TS1 encoding. (textcomp) Default family used instead on input line 3594.

As far as I can tell for now this is triggered by

At thsi stage my guess is that textcomp is not aware of relatively recent zlmtt font package (2014), but I pushed investigation only half-way so maybe the above is all wrong.

And some other things such as

[10] [11] [12] [13] [14] [15]

Package textcomp Warning: Symbol \textasciigrave not provided by (textcomp) font family pplj in TS1 encoding. (textcomp) Default family used instead on input line 1267.

[16] [17] [18] I did not look at yet.

These things can usually be ignored if some correct glyph ends up in PDF, although sometimes it needlessly enlarge PDF size from loading a substitute font.

(all of the above with "font" meaning one of those famous TeX fonts with only room for 128 or 256 glyphs each.)


I was told an easy solution already more than a year ago at https://github.com/latex3/latex2e/issues/478 but I had forgotten about it (and opened earlier today a new isse https://github.com/latex3/latex2e/issues/905 at their project, but it is almost a duplicate).

Thus:

The LaTeX warnings related to \textasciigrave can be silenced adding this in the preamble:

\DeclareTextSymbolDefault{\textasciigrave}{TS1}

It may be worthwile to add

\tracinglostchars=3

to preamble. This causes a LaTeX build error in case a font is missing a character glyph... (since TeXLive 2021 release), and is mostly very useful in the context of Unicode engines (xetex, luatex) and OpenType fonts.

Originally posted by @jfbu in https://github.com/spatialaudio/nbsphinx/issues/657#issuecomment-1206136935

mgeier commented 2 years ago

The cause of this warning has been fixed in #658, but the problem can appear again when there is a stray backtick somewhere.

jfbu commented 2 years ago

At thsi stage my guess is that textcomp is not aware of relatively recent zlmtt font package (2014),

I reported the issue to the zlmtt (a monospace font which was used here for code-block renderings) maintainer and he has made an update so the issue will not show in future.

Changes in version 1.032

  1. Added code to zlmtt.sty to specify sub-encoding 0. (Latex assigned sub-encoding 9, preventing some textcomp glyphs from rendering correctly.)

As per Palatino font pplj which is maintained by LaTeX team, I think no update will happen there, so the \DeclareTextSymbolDefault{\textasciigrave}{TS1} work-around might be needed in future if the issue re-surfaces due to some stray backtick. See https://github.com/latex3/latex2e/issues/905. If some people actually look at their latex build logs... they might read this comment in future and learn about this workaround here ;-) or perhaps identify a problem in their sources explaining the stray backtick...