Show More
@@ -132,14 +132,15 b' def latex_to_png_dvipng(s, wrap):' | |||||
132 | with open(tmpfile, "w") as f: |
|
132 | with open(tmpfile, "w") as f: | |
133 | f.writelines(genelatex(s, wrap)) |
|
133 | f.writelines(genelatex(s, wrap)) | |
134 |
|
134 | |||
135 | subprocess.check_call( |
|
135 | with open(os.devnull, 'w') as devnull: | |
136 | ["latex", "-halt-on-errror", tmpfile], cwd=workdir, |
|
136 | subprocess.check_call( | |
137 | stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
|
137 | ["latex", "-halt-on-error", tmpfile], cwd=workdir, | |
138 |
|
138 | stdout=devnull, stderr=devnull) | ||
139 | subprocess.check_call( |
|
139 | ||
140 | ["dvipng", "-T", "tight", "-x", "1500", "-z", "9", |
|
140 | subprocess.check_call( | |
141 | "-bg", "transparent", "-o", outfile, dvifile], cwd=workdir, |
|
141 | ["dvipng", "-T", "tight", "-x", "1500", "-z", "9", | |
142 | stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
|
142 | "-bg", "transparent", "-o", outfile, dvifile], cwd=workdir, | |
|
143 | stdout=devnull, stderr=devnull) | |||
143 |
|
144 | |||
144 | with open(outfile, "rb") as f: |
|
145 | with open(outfile, "rb") as f: | |
145 | bin_data = f.read() |
|
146 | bin_data = f.read() |
General Comments 0
You need to be logged in to leave comments.
Login now