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

Skip to content

Commit ab7c982

Browse files
committed
Merge pull request #5928 from Grillard/master
fix for latex call on PS backend closes #5923
1 parent 31fa2b2 commit ab7c982

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
@@ -1464,6 +1464,10 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble,
14641464
# multiple
14651465
if sys.platform == 'win32': precmd = '%s &&'% os.path.splitdrive(tmpdir)[0]
14661466
else: precmd = ''
1467+
#Replace \\ for / so latex does not think there is a function call
1468+
latexfile = latexfile.replace("\\", "/")
1469+
# Replace ~ so Latex does not think it is line break
1470+
latexfile = latexfile.replace("~", "\\string~")
14671471
command = '%s cd "%s" && latex -interaction=nonstopmode "%s" > "%s"'\
14681472
%(precmd, tmpdir, latexfile, outfile)
14691473
verbose.report(command, 'debug')

0 commit comments

Comments
 (0)