I can confirm this bug with dvipng --- with the "-bg Transparent" option, dvipng ignores the background color from the input tex file, whereas without that option it always produces an opaque background. There's currently no way to dynamically change command line parameters, so I'm not sure how to solve this problem while supporting both use cases.
-- Sébastien Miquel
On Wed, Apr 7, 2021 at 1:38 PM Sébastien Miquel <sebastien.miquel@posteo.eu> wrote:To reproduce with `emacs -Q` : - Open an org buffer - Call ~(setq org-format-latex-options '(:foreground default :background "Black" :matchers ("$")))~ - Call =C-c C-x C-l= (org-latex-preview) on a latex fragment such as $abc$ This bug was introduced by the commit 2f9e1569f which adds the option `-bg Transparent` to the arguments of `dvipng`. According to its manual, this option should be ignored if a background is already set, but it doesn't seem to be. Perhaps org should set it differently. -- Sébastien Miquel