Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Jan 10 '12 at 14:46

This question came from our site for professional and enthusiast programmers.

    
If I understand this correctly, there is no transparent background color. The transparency needs to be a property of the image itself. –  Peter Grill Jan 10 '12 at 6:27

1 Answer 1

up vote 2 down vote accepted

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()
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.