Closed (fixed)
Project:
DruTeX
Version:
master
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
6 Sep 2006 at 03:01 UTC
Updated:
14 Apr 2008 at 08:41 UTC
Jump to comment: Most recent file
I use the LaTeX Renderer and the ImageMagick (convert) to render mathematics equations. However, I found that the PNG image generated always has a white background. The rendered image thus doesn't look nice with a background that is not white.
Therefore it would be nice to render it with a white background. Currently I'm using the custom method to achieve this, but you guys may want to consider including it as default?
cd [TMP_DIR]; TEXINPUTS="[DRUTEX_DIR]//:" latex -interaction=batchmode [HASH].tex
convert -density [DPI] -trim -transparent "#FFFFFF" +repage [TMP_DIR]/[HASH].ps [IMG_FILE]
Basically, the addition of the option -transparent "#FFFFFF" does the trick. If possible, it's even better to allow the user to specify the color (default: black) of the symbols rendered.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | test_dvipng_1.png | 1.05 KB | vyvee |
Comments
Comment #1
dfg commentedI may add a "dvipng (transparent background)" and "ImageMagic (transparent background)" mode.
You should also try:
This gives you transparent math images that kick ass, because the contours are alpha-blended. It's much better than what you can achive with ImageMagick. Dvipng is also much faster if LaTeX is set up correctly and the fonts are available in PostScript (what should be the default for the standard LaTeX fonts [Computer Modern]).
But be sure to use the newest version of dvipng: Dvipng 1.8 - it really makes the difference. It also must be built with freetype2 support.
Comment #2
vyvee commentedThanks for your suggestion. I'm using convert just because it's already there in my server. Ya, I think 'convert' won't do alpha-blending with the option I use.
I'm installing dvipng now and will try it soon! I use mathematical formulas in some of my web pages & I would like to make them look nice. :)
Comment #3
dfg commentedIf I can you give even more tipps:
When you use sans-serif fonts, you may want to use a more modern version of latex fonts, e.g. look at the fonts on http://daniel-gutekunst.de/
The latex font I use there is called lmss (standing for latin modern sans serif).
The font isn't bundeled within the teTeX distribution you find on most servers...you need teTeX 3.0, or installing the font manually on 2.x
But I suggest installing teTeX 3.0.
Then, I can give you instructions on how to use the font (I also want to include the instructions with DruTeX).
teTeX 3.0 + dvipng 1.8 + lmss font will yield very fast rendering at very high quality.
Comment #4
vyvee commentedThanks for the information. Will appreciate if you can explain how to make use of the font.
The 'default' computer modern font looks good enough (and I'm using it). But if we use sans serif font for normal text on the same page, the lmss looks really more 'compatible' with the context.
Oops, my server is still using teTeX 2.x. Probably it's time to upgrade it now.
Comment #5
student2 commentedHello every body
thanks Daniel for all these efforts
i asked the server support team to install dvipng by download it from
http://linux.softpedia.com/get/Text-Editing-Processing/Markup/dvipng-271...
but one of them reply and said:
"Unfortunately, I have been unable to find a version of the dvipng that
will compile successfully on this server, and no binaries are
available. Until there is a version that will work on this version of RHEL, we
will not be able to install this. "
from where can i get a RHEL version of dvipng please?
Comment #6
vyvee commentedI have been using
dvipngto generate PNG images with transparent background for my site (according to the comment #1 by dfg above). Alas! I just noticed that the lousy IE couldn't handle these images correctly!I have looked for workarounds from the net, including the use of AlphaImageLoader. Unfortunately, all workarounds I know don't seem to work well here. See the file attached as an example. You should be able to see it properly under Firefox, but not IE (I use IE6 under Windows 2000). Does anybody has a quick fix for this problem? If not, I'm considering generating two sets of PNGs: one lower-quality-but-acceptable-by-IE set for IE users, and another high-quality set for others.
I never want to compromise with IE. :( But I don't want the readers of my site to suffer just because of IE... :(
Comment #7
student2 commentedHello
vyvee , IE version 7 support transparenty of PNG ,
to fix it in the older versions use the script at
http://homepage.ntlworld.com/bobosola/pnginfo.htm
Where are you dfg ?
what about dvipng for RHEL srever, pls?
from where can i get it?
best regards
Comment #8
steven jones commentedDefaults added to 1.x series.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.