##// END OF EJS Templates
prevent popup windows during execution of latex_to_png_dvipng
Pieter Eendebak -
Show More
@@ -144,6 +144,13 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):"
144 144 find_cmd('dvipng')
145 145 except FindCmdError:
146 146 return None
147
148 startupinfo = None
149 if os.name == 'nt':
150 # prevent popup-windows
151 startupinfo = subprocess.STARTUPINFO()
152 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
153
147 154 try:
148 155 workdir = Path(tempfile.mkdtemp())
149 156 tmpfile = workdir.joinpath("tmp.tex")
@@ -156,7 +163,7 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):"
156 163 with open(os.devnull, 'wb') as devnull:
157 164 subprocess.check_call(
158 165 ["latex", "-halt-on-error", "-interaction", "batchmode", tmpfile],
159 cwd=workdir, stdout=devnull, stderr=devnull)
166 cwd=workdir, stdout=devnull, stderr=devnull, startupinfo=startupinfo)
160 167
161 168 resolution = round(150*scale)
162 169 subprocess.check_call(
@@ -179,6 +186,7 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):"
179 186 cwd=workdir,
180 187 stdout=devnull,
181 188 stderr=devnull,
189 startupinfo=startupinfo
182 190 )
183 191
184 192 with outfile.open("rb") as f:
General Comments 0
You need to be logged in to leave comments. Login now