[Tex/LaTex] Specify transparent background color

transparency

I use Python-Sphinx to document some Python code I wrote. I'm using the pngmath extension to render LaTeX math expressions. The problem is, the background-color of the rendered images is white and the background color on which the images are shown differs from page to page. I can set the background color with

\usepackage{color}
\pagecolor{%color%}

but there does not seem to be a transparent color. How can I make the background color of the images transparent?

Best Answer

Adding -bg Transparent to dvipng works fine.

Note

The Python-Sphinx documentation says

When you “add” an argument, you need to reproduce the default arguments if you want to keep them; that is, like this:

pngmath_dvipng_args = ['-gamma 1.5', '-D 110', '-bg Transparent']

-- Math support in Sphinx

But in the configuration file, this has to be

pngmath_dvipng_args = ['gamma', '1.5', '-D', '110', '-bg', 'Transparent']
# or
pngmath_dvipng_args = 'gamma 1.5 -D 110 -bg Transparent'.split()