Show More
@@ -151,9 +151,26 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):" | |||||
151 |
|
151 | |||
152 | resolution = round(150*scale) |
|
152 | resolution = round(150*scale) | |
153 | subprocess.check_call( |
|
153 | subprocess.check_call( | |
154 | ["dvipng", "-T", "tight", "-D", str(resolution), "-z", "9", |
|
154 | [ | |
155 | "-bg", "transparent", "-o", outfile, dvifile, "-fg", color], |
|
155 | "dvipng", | |
156 | cwd=workdir, stdout=devnull, stderr=devnull) |
|
156 | "-T", | |
|
157 | "tight", | |||
|
158 | "-D", | |||
|
159 | str(resolution), | |||
|
160 | "-z", | |||
|
161 | "9", | |||
|
162 | "-bg", | |||
|
163 | "Transparent", | |||
|
164 | "-o", | |||
|
165 | outfile, | |||
|
166 | dvifile, | |||
|
167 | "-fg", | |||
|
168 | color, | |||
|
169 | ], | |||
|
170 | cwd=workdir, | |||
|
171 | stdout=devnull, | |||
|
172 | stderr=devnull, | |||
|
173 | ) | |||
157 |
|
174 | |||
158 | with open(outfile, "rb") as f: |
|
175 | with open(outfile, "rb") as f: | |
159 | return f.read() |
|
176 | return f.read() |
@@ -62,7 +62,6 b' if resource is not None and hasattr(resource, "getrusage"):' | |||||
62 | Similar to clock(), but return a tuple of user/system times.""" |
|
62 | Similar to clock(), but return a tuple of user/system times.""" | |
63 | return resource.getrusage(resource.RUSAGE_SELF)[:2] |
|
63 | return resource.getrusage(resource.RUSAGE_SELF)[:2] | |
64 |
|
64 | |||
65 |
|
||||
66 | else: |
|
65 | else: | |
67 | # There is no distinction of user/system time under windows, so we just use |
|
66 | # There is no distinction of user/system time under windows, so we just use | |
68 | # time.perff_counter() for everything... |
|
67 | # time.perff_counter() for everything... |
General Comments 0
You need to be logged in to leave comments.
Login now