From c50767fd277e82ee50db319443b2716f988fc0a7 2021-12-06 23:33:18 From: Matthias Bussonnier Date: 2021-12-06 23:33:18 Subject: [PATCH] Backport PR #13372: use full-alpha transparency on dvipng rendered LaTeX --- diff --git a/IPython/lib/latextools.py b/IPython/lib/latextools.py index cbcc7d9..f976f2e 100644 --- a/IPython/lib/latextools.py +++ b/IPython/lib/latextools.py @@ -151,9 +151,26 @@ def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0): resolution = round(150*scale) subprocess.check_call( - ["dvipng", "-T", "tight", "-D", str(resolution), "-z", "9", - "-bg", "transparent", "-o", outfile, dvifile, "-fg", color], - cwd=workdir, stdout=devnull, stderr=devnull) + [ + "dvipng", + "-T", + "tight", + "-D", + str(resolution), + "-z", + "9", + "-bg", + "Transparent", + "-o", + outfile, + dvifile, + "-fg", + color, + ], + cwd=workdir, + stdout=devnull, + stderr=devnull, + ) with open(outfile, "rb") as f: return f.read() diff --git a/IPython/utils/timing.py b/IPython/utils/timing.py index 32741ac..92f6883 100644 --- a/IPython/utils/timing.py +++ b/IPython/utils/timing.py @@ -62,7 +62,6 @@ if resource is not None and hasattr(resource, "getrusage"): Similar to clock(), but return a tuple of user/system times.""" return resource.getrusage(resource.RUSAGE_SELF)[:2] - else: # There is no distinction of user/system time under windows, so we just use # time.perff_counter() for everything...