dvipng (1) Linux Manual Page
NAME
dvipng – A DVI-to-PNG translator
SYNOPSIS
dvipng [options] filename
dvipng [options] [filename] –
DESCRIPTION
This program makes PNG and/or GIF graphics from DVI files as obtained from TeX and its relatives.
If GIF support is enabled, GIF output is chosen by using the dvigif binary or with the –gif option.
The benefits of dvipng/dvigif include
- *
- Speed. It is a very fast bitmap-rendering code for DVI files, which makes it suitable for generating large amounts of images on-the-fly, as needed in preview-latex, WeBWorK and others.
- *
- It does not read the postamble, so it can be started before TeX finishes. There is a
–followswitch that makes dvipng wait at end-of-file for further output, unless it finds the POST marker that indicates the end of the DVI. - *
- Interactive query of options. dvipng can read options interactively through stdin, and all options are usable. It is even possible to change the input file through this interface.
- *
- Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts (i.e., as used in CJK-LaTeX), color specials, and inclusion of PostScript, PNG, JPEG or GIF images.
- *
- and more…
OPTIONS
Many of the parameterless options listed here can be turned off by suffixing the option with a zero (0); for instance, to turn off page reversal, use -r0. Such options are marked with a trailing *.
–- Read additional options from standard input after processing the command line.
–help- Print a usage message and exit.
–version- Print the version number and exit.
-bdnum-bdcolor_spec-bd ‘numcolor_spec‘- Set the pixel width of the transparent border (default 0). Using this option will make the image edges transparent, but it only affects pixels with the background color. Giving a color_spec will set the fallback color, to be used in viewers that cannot handle transparency (the default is the background color). The color spec should be in TeX color \special syntax, e.g., ‘rgb 1.0 0.0 0.0’. Setting the fallback color makes the default border width 1 px.
–bdpinum- This option only has an effect when using bitmapped (PK) fonts. The option sets the base (Metafont) resolution, both horizontal and vertical, to num dpi (dots per inch). This option is necessary when manually selecting Metafont mode with the –mode option (see below).
-bgcolor_spec- Choose background color for the images. This option will be ignored if there is a background color \special in the DVI. The color spec should be in TeX color \special syntax, e.g., ‘rgb 1.0 0.0 0.0’. You can also specify ‘Transparent’ or ‘transparent’ which will give you a transparent background with the normal background as a fallback color. A capitalized ‘Transparent’ will give a full-alpha transparency, while an all-lowercase ‘transparent’ will give a simple fully transparent background with non-transparent antialiased pixels. The latter would be suitable for viewers who cannot cope with a true alpha channel. GIF images do not support full alpha transparency, so in case of GIF output, both variants will use the latter behaviour.
-dnum- Set the debug flags, showing what dvipng (thinks it) is doing. This will work unless dvipng has been compiled without the "DEBUG" option (not recommended). Set the flags as you need them, use
-d -1as the first option for maximum output. -Dnum- Set the output resolution, both horizontal and vertical, to num dpi (dots per inch).
One may want to adjust this to fit a certain text font size (e.g., on a web page), and for a text font height of font_px pixels (in Mozilla) the correct formula is
<dpi> = <font_px> * 72.27 / 10 [px * TeXpt/in / TeXpt]The last division by ten is due to the standard font height 10pt in your document, if you use 12pt, divide by 12. Unfortunately, some proprietary browsers have font height in pt (points), not pixels. You have to rescale that to pixels, using the screen resolution (default is usually 96 dpi) which means the formula is
<font_px> = <font_pt> * 96 / 72 [pt * px/in / (pt/in)]On some high-res screens, the value is instead 120 dpi. Good luck!
–depth*- Report the depth of the image. This only works reliably when the LaTeX style preview.sty from preview-latex is used with the
activeoption. It reports the number of pixels from the bottom of the image to the baseline of the image. This can be used for vertical positioning of the image in, e.g., web documents, where one would use (Cascading StyleSheets 1)<IMG SRC="<filename.png>" STYLE="vertical-align: -<depth>px">The depth is a negative offset in this case, so the minus sign is necessary, and the unit is pixels (px).
–dvinum*- Set this option to make the output page number be the TeX page numbers rather than the physical page number. See the
-oswitch. -fgcolor_spec- Choose foreground color for the images. This option will be ignored if there is a foreground color \special in the DVI. The color spec should be in TeX color \special syntax, e.g., ‘rgb 1.0 0.0 0.0’.
–follow*- Wait for data at end-of-file. One of the benefits of dvipng is that it does not read the postamble, so it can be started before TeX finishes. This switch makes dvipng wait at end-of-file for further output, unless it finds the POST marker that indicates the end of the DVI. This is similar to
tail -fbut for DVI-to-PNG conversion. –freetype*- Enable/disable FreeType font rendering (default on). This option is available if the FreeType2 font library was present at compilation time. If this is the case, dvipng will have direct support for PostScript Type1 and TrueType fonts internally, rather than using
gsftopkfor rendering the fonts. If you have PostScript versions of Computer Modern installed, there will be no need to generate bitmapped (PK) variants on disk of these. Then, you can render images at different (and unusual) resolutions without cluttering the disk with lots of bitmapped fonts. –gammanum- Control the interpolation of colors in the greyscale anti-aliasing color palette. Default value is 1.0. For 0 < num < 1, the fonts will be lighter (more like the background), and for num > 1, the fonts will be darker (more like the foreground).
–gif*- The images are output in the GIF format, if GIF support is enabled. This is the default for the
dvigifbinary, which only will be available when GIF support is enabled. GIF images are palette images (see the–paletteoption) and does not support true alpha channels (see the–bgoption). See also the–pngoption. –height*- Report the height of the image. This only works reliably when the LaTeX style preview.sty from preview-latex is used with the
activeoption. It reports the number of pixels from the top of the image to the baseline of the image. The total height of the image is obtained as the sum of the values reported from–heightand–depth. -l [=]num- The last page printed will be the first one numbered num. Default is the last page in the document. If num is prefixed by an equals sign, then it (and the argument to the
-poption, if specified) is treated as a physical (absolute) page number, rather than a value to compare with the TeX
