##// END OF EJS Templates
use relative filename in latex and dvips commands
Pieter Eendebak -
Show More
@@ -146,11 +146,11 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):"
146 return None
146 return None
147 try:
147 try:
148 workdir = Path(tempfile.mkdtemp())
148 workdir = Path(tempfile.mkdtemp())
149 tmpfile = workdir.joinpath("tmp.tex")
149 tmpfile = "tmp.tex"
150 dvifile = workdir.joinpath("tmp.dvi")
150 dvifile = "tmp.dvi"
151 outfile = workdir.joinpath("tmp.png")
151 outfile = "tmp.png"
152
152
153 with tmpfile.open("w", encoding="utf8") as f:
153 with workdir.joinpath(tmpfile).open("w", encoding="utf8") as f:
154 f.writelines(genelatex(s, wrap))
154 f.writelines(genelatex(s, wrap))
155
155
156 with open(os.devnull, 'wb') as devnull:
156 with open(os.devnull, 'wb') as devnull:
@@ -181,7 +181,7 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):"
181 stderr=devnull,
181 stderr=devnull,
182 )
182 )
183
183
184 with outfile.open("rb") as f:
184 with workdir.joinpath(outfile).open("rb") as f:
185 return f.read()
185 return f.read()
186 except subprocess.CalledProcessError:
186 except subprocess.CalledProcessError:
187 return None
187 return None
General Comments 0
You need to be logged in to leave comments. Login now