Skip to content

Commit 3db8a0d

Browse files
authored
Merge pull request #10348 from anntzer/stricter-texmanager
When latex fails, make sure it does not write a dvi.
2 parents 44a9036 + c81bb9d commit 3db8a0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/texmanager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ def make_dvi(self, tex, fontsize):
361361
texfile = self.make_tex(tex, fontsize)
362362
with Locked(self.texcache):
363363
self._run_checked_subprocess(
364-
["latex", "-interaction=nonstopmode", texfile], tex)
364+
["latex", "-interaction=nonstopmode", "--halt-on-error",
365+
texfile], tex)
365366
for fname in glob.glob(basefile + '*'):
366367
if not fname.endswith(('dvi', 'tex')):
367368
try:
@@ -387,7 +388,8 @@ def make_dvi_preview(self, tex, fontsize):
387388
if not os.path.exists(dvifile) or not os.path.exists(baselinefile):
388389
texfile = self.make_tex_preview(tex, fontsize)
389390
report = self._run_checked_subprocess(
390-
["latex", "-interaction=nonstopmode", texfile], tex)
391+
["latex", "-interaction=nonstopmode", "--halt-on-error",
392+
texfile], tex)
391393

392394
# find the box extent information in the latex output
393395
# file and store them in ".baseline" file

0 commit comments

Comments
 (0)