Skip to content

Commit

Permalink
Merge pull request #13375 from meeseeksmachine/auto-backport-of-pr-13…
Browse files Browse the repository at this point in the history
…372-on-7.x

Backport PR #13372 on branch 7.x (use full-alpha transparency on dvipng rendered LaTeX)
  • Loading branch information
Carreau committed Dec 7, 2021
2 parents 19a3119 + c50767f commit 2f5df18
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
23 changes: 20 additions & 3 deletions IPython/lib/latextools.py
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion IPython/utils/timing.py
Expand Up @@ -62,7 +62,6 @@ def clock2():
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...
Expand Down

0 comments on commit 2f5df18

Please sign in to comment.