8000 Clarify error with usetex when cm-super is not installed. · matplotlib/matplotlib@20e705b · GitHub
[go: up one dir, main page]

Skip to content

Commit 20e705b

Browse files
committed
Clarify error with usetex when cm-super is not installed.
This PR makes the error when cm-super is not installed (and rcParams["text.latex.unicode"] = True, which is now the default) be ``` ! LaTeX Error: File `type1ec.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.5 \usepackage {type1ec}^^M No pages of output. ``` (or, if using miktex, miktex will prompt for installing cm-super).
1 parent 3320e23 commit 20e705b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/matplotlib/texmanager.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,13 @@ class TexManager(object):
8686
'helvetica': ('phv', r'\usepackage{helvet}'),
8787
'avant garde': ('pag', r'\usepackage{avant}'),
8888
'courier': ('pcr', r'\usepackage{courier}'),
89-
'monospace': ('cmtt', ''),
90-
'computer modern roman': ('cmr', ''),
91-
'computer modern sans serif': ('cmss', ''),
92-
'computer modern typewriter': ('cmtt', '')}
89+
# Loading the type1ec package ensures that cm-super is installed, which
90+
# is necessary for unicode computer modern. (It also allows the use of
91+
# computer modern at arbitrary sizes, but that's just a side effect.)
92+
'monospace': ('cmtt', r'\usepackage{type1ec}'),
93+
'computer modern roman': ('cmr', r'\usepackage{type1ec}'),
94+
'computer modern sans serif': ('cmss', r'\usepackage{type1ec}'),
95+
'computer modern typewriter': ('cmtt', r'\usepackage{type1ec}')}
9396

9497
_rc_cache = None
9598
_rc_cache_keys = (

0 commit comments

Comments
 (0)
0