8000 Fix for latex call on PS backend on windows · matplotlib/matplotlib@e6b9604 · GitHub
[go: up one dir, main page]

Skip to content

Commit e6b9604

Browse files
committed
Fix for latex call on PS backend on windows
Sometimes, the filename for "latexfile" ends up in the short 8.3 format on windows, but latex does not like the `~ ` in the filename.
1 parent 2a4863c commit e6b9604

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,10 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble,
14521452
# multiple
14531453
if sys.platform == 'win32': precmd = '%s &&'% os.path.splitdrive(tmpdir)[0]
14541454
else: precmd = ''
1455+
#Replace \\ for / so latex does not think there is a function call
1456+
latexfile = latexfile.replace("\\", "/")
1457+
# Replace ~ so Latex does not think it is line break
1458+
latexfile = latexfile.replace("~", "\\string~")
14551459
command = '%s cd "%s" && latex -interaction=nonstopmode "%s" > "%s"'\
14561460
%(precmd, tmpdir, latexfile, outfile)
14571461
verbose.report(command, 'debug')

0 commit comments

Comments
 (0)
0