From e4f1d9952bed9c02a92a80148cc49b29291b58d5 Mon Sep 17 00:00:00 2001 From: gnnoh <48518325+gnnoh@users.noreply.github.com> Date: Wed, 31 Aug 2022 16:49:22 +0800 Subject: [PATCH] Make dvipng use transparent background by default (#2036) * make dvipng use transparent background by default Note that if using all-lowercase 'transparent', it will give "a simple fully transparent background with non-transparent antialiased pixels", which is unnecessary. * latex.py: format --- pylib/anki/latex.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pylib/anki/latex.py b/pylib/anki/latex.py index c2033523b..e492422c8 100644 --- a/pylib/anki/latex.py +++ b/pylib/anki/latex.py @@ -17,7 +17,18 @@ from anki.utils import call, is_mac, namedtmp, tmpdir pngCommands = [ ["latex", "-interaction=nonstopmode", "tmp.tex"], - ["dvipng", "-D", "200", "-T", "tight", "tmp.dvi", "-o", "tmp.png"], + [ + "dvipng", + "-bg", + "Transparent", + "-D", + "200", + "-T", + "tight", + "tmp.dvi", + "-o", + "tmp.png", + ], ] svgCommands = [