Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07856d8

Browse files
committed
Fix backend_pgf header.
At least in some cases (i.e. locally...), tex appears to treat a first line of `% TeX program = ...` passed to its stdin as an empty filename followed by a comment, leading to a crash ("I can't find file ''"). Fix that by moving the comment to the second line.
1 parent af33de4 commit 07856d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,10 @@ def _build_latex_header():
212212
# fonts later when we don't expect the additional output on stdout.
213213
# TODO: is this sufficient?
214214
latex_header = [
215+
r"\documentclass{minimal}",
215216
# Include TeX program name as a comment for cache invalidation.
217+
# TeX does not allow this to be the first line.
216218
r"% !TeX program = {}".format(rcParams["pgf.texsystem"]),
217-
r"\documentclass{minimal}",
218219
latex_preamble,
219220
latex_fontspec,
220221
r"\begin{document}",

0 commit comments

Comments
 (0)