Description
I've just run into #16911. The problem is that the type1ec
LaTeX package is necessary when text.latex.unicode
is True
in the rcParams
(which is the default since 3.0). On debian this is part of the cm-super
system package. I've had some trouble discovering this information.
- As of Clarify error with usetex when cm-super is not installed. #14151 the problem is clear at least:
type1ec
is missing. (Although I got this error using a completely innocent, ascii-only, as far as I know ligature-free label in a plot. The error hadn't come up two figures earlier with other, innocent, ascii-only labels. And this is withouttext.usetex
.) - This LaTeX package isn't mentioned anywhere on the matplotlib website, and only one closed issue mentions it.
- It's not trivial to track down the appropriate debian package, fortunately the linked issue took care of this.
- As a side note, I read that the default for
text.latex.unicode
changed toTrue
in 3.0 here, but this is not mentioned in the easy-to-find What's new, only in the hard-to-discover API changes.
Ideally the dependency should be mentioned somewhere, perhaps among the installation guide. Currently that page mentions
LaTeX and GhostScript (>=9.0) : for rendering text with LaTeX;
In Text rendering with LaTeX (which focusses on usetex
) it mentions
On Ubuntu and Gentoo, the base texlive install does not ship with the type1cm package. You may need to install some of the extra packages to get all the goodies that come bundled with other latex distributions.
Note that type1cm
is part of texlive-latex-extra
which is a straightforward system package to install for LaTeX stuff, and for matplotlib in particular. However, type1ec
is not included there, and what's worse, apt search type1ec
doesn't turn up any resuts (unlike the same for type1cm
).