Show More
@@ -146,7 +146,7 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):" | |||||
146 | return None |
|
146 | return None | |
147 |
|
147 | |||
148 | startupinfo = None |
|
148 | startupinfo = None | |
149 |
if os.name == |
|
149 | if os.name == "nt": | |
150 | # prevent popup-windows |
|
150 | # prevent popup-windows | |
151 | startupinfo = subprocess.STARTUPINFO() |
|
151 | startupinfo = subprocess.STARTUPINFO() | |
152 | startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW |
|
152 | startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW | |
@@ -163,7 +163,11 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):" | |||||
163 | with open(os.devnull, 'wb') as devnull: |
|
163 | with open(os.devnull, 'wb') as devnull: | |
164 | subprocess.check_call( |
|
164 | subprocess.check_call( | |
165 | ["latex", "-halt-on-error", "-interaction", "batchmode", tmpfile], |
|
165 | ["latex", "-halt-on-error", "-interaction", "batchmode", tmpfile], | |
166 | cwd=workdir, stdout=devnull, stderr=devnull, startupinfo=startupinfo) |
|
166 | cwd=workdir, | |
|
167 | stdout=devnull, | |||
|
168 | stderr=devnull, | |||
|
169 | startupinfo=startupinfo, | |||
|
170 | ) | |||
167 |
|
171 | |||
168 | resolution = round(150*scale) |
|
172 | resolution = round(150*scale) | |
169 | subprocess.check_call( |
|
173 | subprocess.check_call( | |
@@ -186,7 +190,7 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):" | |||||
186 | cwd=workdir, |
|
190 | cwd=workdir, | |
187 | stdout=devnull, |
|
191 | stdout=devnull, | |
188 | stderr=devnull, |
|
192 | stderr=devnull, | |
189 | startupinfo=startupinfo |
|
193 | startupinfo=startupinfo, | |
190 | ) |
|
194 | ) | |
191 |
|
195 | |||
192 | with outfile.open("rb") as f: |
|
196 | with outfile.open("rb") as f: |
General Comments 0
You need to be logged in to leave comments.
Login now