dvipng color trouble
金曜日, 12 月 28th, 2007I still have yet to find a fix to the dvipng discoloration mystery I ran into back at The Academic Approach, even with the latest MacTeX version, so I’m going to repost the problem here.
In May 2007, I wrote the following to the OS X TeX listhost:1
Hi all,
I’ve recently run into what I believe is a rare bug in
dvipng: here’s the setup. (To play along, you can get my test files: http://mitcho.com/discolor.zip .) I am using MacTeX… in fact, it’s today’s release.The LaTeX source file (
discolored.tex) loads just two packages:colorandgraphicx. The body does two things: an\includegraphicswith a local PNG file (with thebboption to specify theBoundingBoxexplicitly) and a\textcolorcommand introducing some green text, using the green defined there.
pdflatexproduces the expected result: the figure and the green text.But when you run the following commands…
latex discolored.tex
dvipng -D 200 discolored.dviyou get a PNG (discolored1.png) which shows the text in a brownish color… the green is gone!!
There are two quick ways to fix this that I’ve found: one is to not include the image… if you comment the
\includegraphicscommand out, the color comes out fine. The second is to not specify a-D(output resolution) parameter in thedvipng… this also gives you the expected output. However, in my current project, neither of these are available options…I am frankly not very familiar with the inner workings of
dvipng… does anyone have any thoughts? Can this bug be reproduced?Any hints or suggestions are welcome!
Ditto.
-
Inline cropped images added to this web version, just to spice things up. ↩