1DVIPNG(1) User commands DVIPNG(1)
2
3
4
6 dvipng - A DVI-to-PNG translator
7
9 dvipng [options] filename
10
11 dvipng [options] [filename] -
12
14 This program makes PNG and/or GIF graphics from DVI files as obtained
15 from TeX and its relatives.
16
17 If GIF support is enabled, GIF output is chosen by using the dvigif
18 binary or with the --gif option.
19
20 The benefits of dvipng/dvigif include
21
22 · Speed. It is a very fast bitmap-rendering code for DVI files, which
23 makes it suitable for generating large amounts of images on-the-
24 fly, as needed in preview-latex, WeBWorK and others.
25
26 · It does not read the postamble, so it can be started before TeX
27 finishes. There is a --follow switch that makes dvipng wait at end-
28 of-file for further output, unless it finds the POST marker that
29 indicates the end of the DVI.
30
31 · Interactive query of options. dvipng can read options interactively
32 through stdin, and all options are usable. It is even possible to
33 change the input file through this interface.
34
35 · Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts
36 (i.e., as used in CJK-LaTeX), color specials, and inclusion of
37 PostScript, PNG, JPEG or GIF images.
38
39 · and more...
40
42 Many of the parameterless options listed here can be turned off by
43 suffixing the option with a zero (0); for instance, to turn off page
44 reversal, use -r0. Such options are marked with a trailing *.
45
46 - Read additional options from standard input after processing the
47 command line.
48
49 --help
50 Print a usage message and exit.
51
52 --version
53 Print the version number and exit.
54
55 -bd num
56 -bd color_spec
57 -bd 'num color_spec'
58 Set the pixel width of the transparent border (default 0). Using
59 this option will make the image edges transparent, but it only
60 affects pixels with the background color. Giving a color_spec will
61 set the fallback color, to be used in viewers that cannot handle
62 transparency (the default is the background color). The color spec
63 should be in TeX color \special syntax, e.g., 'rgb 1.0 0.0 0.0'.
64 Setting the fallback color makes the default border width 1 px.
65
66 --bdpi num
67 Set the base (Metafont) resolution, both horizontal and vertical,
68 to num dpi (dots per inch). This option is necessary when manually
69 selecting Metafont mode with the --mode option (see below).
70
71 -bg color_spec
72 Choose background color for the images. This option will be ignored
73 if there is a background color \special in the DVI. The color spec
74 should be in TeX color \special syntax, e.g., 'rgb 1.0 0.0 0.0'.
75 You can also specify 'Transparent' or 'transparent' which will give
76 you a transparent background with the normal background as a
77 fallback color. A capitalized 'Transparent' will give a full-alpha
78 transparency, while an all-lowercase 'transparent' will give a
79 simple fully transparent background with non-transparent
80 antialiased pixels. The latter would be suitable for viewers who
81 cannot cope with a true alpha channel. GIF images do not support
82 full alpha transparency, so in case of GIF output, both variants
83 will use the latter behaviour.
84
85 -d num
86 Set the debug flags, showing what dvipng (thinks it) is doing. This
87 will work unless dvipng has been compiled without the "DEBUG"
88 option (not recommended). Set the flags as you need them, use -d -1
89 as the first option for maximum output.
90
91 -D num
92 Set the output resolution, both horizontal and vertical, to num dpi
93 (dots per inch).
94
95 One may want to adjust this to fit a certain text font size (e.g.,
96 on a web page), and for a text font height of font_px pixels (in
97 Mozilla) the correct formula is
98
99 <dpi> = <font_px> * 72.27 / 10 [px * TeXpt/in / TeXpt]
100
101 The last division by ten is due to the standard font height 10pt in
102 your document, if you use 12pt, divide by 12. Unfortunately, some
103 proprietary browsers have font height in pt (points), not pixels.
104 You have to rescale that to pixels, using the screen resolution
105 (default is usually 96 dpi) which means the formula is
106
107 <font_px> = <font_pt> * 96 / 72 [pt * px/in / (pt/in)]
108
109 On some high-res screens, the value is instead 120 dpi. Good luck!
110
111 --depth*
112 Report the depth of the image. This only works reliably when the
113 LaTeX style preview.sty from preview-latex is used with the active
114 option. It reports the number of pixels from the bottom of the
115 image to the baseline of the image. This can be used for vertical
116 positioning of the image in, e.g., web documents, where one would
117 use (Cascading StyleSheets 1)
118
119 <IMG SRC="<filename.png>" STYLE="vertical-align: -<depth>px">
120
121 The depth is a negative offset in this case, so the minus sign is
122 necessary, and the unit is pixels (px).
123
124 --dvinum*
125 Set this option to make the output page number be the TeX page
126 numbers rather than the physical page number. See the -o switch.
127
128 -fg color_spec
129 Choose foreground color for the images. This option will be ignored
130 if there is a foreground color \special in the DVI. The color spec
131 should be in TeX color \special syntax, e.g., 'rgb 1.0 0.0 0.0'.
132
133 --follow*
134 Wait for data at end-of-file. One of the benefits of dvipng is that
135 it does not read the postamble, so it can be started before TeX
136 finishes. This switch makes dvipng wait at end-of-file for further
137 output, unless it finds the POST marker that indicates the end of
138 the DVI. This is similar to tail -f but for DVI-to-PNG conversion.
139
140 --freetype*
141 Enable/disable FreeType font rendering (default on). This option is
142 available if the FreeType2 font library was present at compilation
143 time. If this is the case, dvipng will have direct support for
144 PostScript Type1 and TrueType fonts internally, rather than using
145 gsftopk for rendering the fonts. If you have PostScript versions of
146 Computer Modern installed, there will be no need to generate
147 bitmapped variants on disk of these. Then, you can render images at
148 different (and unusual) resolutions without cluttering the disk
149 with lots of bitmapped fonts. Note that if you have both FreeType
150 and T1lib on your system, FreeType will be preferred by dvipng. If
151 you for some reason would want to use T1lib rendering, use this
152 option.
153
154 --gamma num
155 Control the interpolation of colors in the greyscale anti-aliasing
156 color palette. Default value is 1.0. For 0 < num < 1, the fonts
157 will be lighter (more like the background), and for num > 1, the
158 fonts will be darker (more like the foreground).
159
160 --gif*
161 The images are output in the GIF format, if GIF support is enabled.
162 This is the default for the dvigif binary, which only will be
163 available when GIF support is enabled. GIF images are palette
164 images (see the --palette option) and does not support true alpha
165 channels (see the --bg option). See also the --png option.
166
167 --height*
168 Report the height of the image. This only works reliably when the
169 LaTeX style preview.sty from preview-latex is used with the active
170 option. It reports the number of pixels from the top of the image
171 to the baseline of the image. The total height of the image is
172 obtained as the sum of the values reported from --height and
173 --depth.
174
175 -l [=]num
176 The last page printed will be the first one numbered num. Default
177 is the last page in the document. If num is prefixed by an equals
178 sign, then it (and the argument to the -p option, if specified) is
179 treated as a physical (absolute) page number, rather than a value
180 to compare with the TeX \count0 values stored in the DVI file.
181 Thus, using -l =9 will end with the ninth page of the document, no
182 matter what the pages are actually numbered.
183
184 --mode mode
185 Use mode as the Metafont device name for the PK fonts (both for
186 path searching and font generation). This needs to be augmented
187 with the base device resolution, given with the --bdpi option. See
188 the file <ftp://ftp.tug.org/tex/modes.mf> for a list of resolutions
189 and mode names for most devices.
190
191 -M* Turns off automatic PK font generation (mktexpk). This will have no
192 effect when using PostScript fonts, since no PK font generation
193 will be done anyway.
194
195 --noghostscript*
196 This switch prohibits the internal call to GhostScript for
197 displaying PostScript specials. --noghostscript0 turns the call
198 back on.
199
200 --nogssafer*
201 Normally, if GhostScript is used to render PostScript specials, the
202 GhostScript interpreter is run with the option -dSAFER. The
203 --nogssafer option runs GhostScript without -dSAFER. The -dSAFER
204 option in Ghostscript disables PostScript operators such as
205 deletefile, to prevent possibly malicious PostScript programs from
206 having any effect.
207
208 -o name
209 Send output to the file name. A single occurrence of %d or %01d,
210 ..., %09d will be exchanged for the physical page number (this can
211 be changed, see the --dvinum switch). The default output filename
212 is file%d.png where the input DVI file was file.dvi.
213
214 -O x-offset,y-offset
215 Move the origin by x-offset,y-offset, a comma-separated pair of
216 dimensions such as .1in,-.3cm. The origin of the page is shifted
217 from the default position (of one inch down, one inch to the right
218 from the upper left corner of the paper) by this amount.
219
220 -p [=]num
221 The first page printed will be the first one numbered num. Default
222 is the first page in the document. If num is prefixed by an equals
223 sign, then it (and the argument to the -l option, if specified) is
224 treated as a physical (absolute) page number, rather than a value
225 to compare with the TeX \count0 values stored in the DVI file.
226 Thus, using -p =3 will start with the third page of the document,
227 no matter what the pages are actually numbered.
228
229 --palette*
230 Starting from dvipng 1.8, the output PNG will be a truecolor png
231 when an external image is included, to avoid unnecessary delay and
232 quality reduction, and enable the EPS translator to draw on a
233 transparent background and outside of the boundingbox. This switch
234 will force palette (256-color) output and make dvipng revert to the
235 old behaviour, where included images were opaque and always clipped
236 to the boundingbox. This will also override the --truecolor switch
237 if present.
238
239 --picky*
240 No images are output when a warning occurs. Normally, dvipng will
241 output an image in spite of a warning, but there may be something
242 missing in this image. One reason to use this option would be if
243 you have a more complete but slower fallback converter. Mainly,
244 this is useful for failed figure inclusion and unknown \special
245 occurrences, but warnings will also occur for missing or unknown
246 color specs and missing PK fonts.
247
248 --png*
249 The images are output in the PNG format. This is the default for
250 the dvipng binary. See also the --gif option.
251
252 -pp firstpage-lastpage
253 Print pages firstpage through lastpage; but not quite equivalent to
254 -p firstpage -l lastpage. For example, when rendering a book, there
255 may be several instances of a page in the DVI file (one in
256 "\frontmatter", one in "\mainmatter", and one in "\backmatter"). In
257 case of several pages matching, -pp firstpage-lastpage will render
258 all pages that matches the specified range, while -p firstpage -l
259 lastpage will render the pages from the first occurrence of
260 firstpage to the first occurrence of lastpage. This is the
261 (undocumented) behaviour of dvips. In dvipng you can give both
262 kinds of options, in which case you get all pages that matches the
263 range in -pp between the pages from -p to -l. Also multiple -pp
264 options accumulate, unlike -p and -l. The - separator can also be
265 :. Note that -pp -1 will be interpreted as "all pages up to and
266 including 1", if you want a page numbered -1 (only the table of
267 contents, say) put -pp -1--1, or more readable, -pp -1:-1.
268
269 -q* Run quietly. Don't chatter about pages converted, etc. to standard
270 output; report no warnings (only errors) to standard error.
271
272 -Q num
273 Set the quality to num. That is, choose the number of antialiasing
274 levels for PK and T1lib rendering to be num*num+1. The default
275 value is 4 which gives 17 levels of antialiasing for antialiased
276 fonts from these two. If FreeType is available, its rendering is
277 unaffected by this option.
278
279 -r* Toggle output of pages in reverse/forward order. By default, the
280 first page in the DVI is output first.
281
282 --strict*
283 The program exits when a warning occurs. Normally, dvipng will
284 output an image in spite of a warning, but there may be something
285 missing in this image. One reason to use this option would be if
286 you have a more complete but slower fallback converter. See the
287 --picky option above for a list of when warnings occur.
288
289 -T image_size
290 Set the image size to image_size which can be either of bbox,
291 tight, or a comma-separated pair of dimensions hsize,vsize such as
292 .1in,.3cm. The default is bbox which produces a PNG that includes
293 all ink put on the page and in addition the DVI origin, located 1in
294 from the top and 1in from the left edge of the paper. This usually
295 gives whitespace above and to the left in the produced image. The
296 value tight will make dvipng only include all ink put on the page,
297 producing neat images.
298
299 --t1lib*
300 Enable/disable T1lib font rendering (default on). This option is
301 available if the T1lib font library was present at compilation
302 time. If this is the case, dvipng will have direct support for
303 PostScript Type1 fonts internally, rather than using gsftopk for
304 rendering the fonts. If you have PostScript versions of Computer
305 Modern installed, there will be no need to generate bitmapped
306 variants on disk of these. Then, you can render images at
307 different (and unusual) resolutions without cluttering the disk
308 with lots of bitmapped fonts. Note that if you have both FreeType
309 and T1lib on your system FreeType will be preferred by dvipng, and
310 if you for some reason rather want to use T1lib, give the option
311 --freetype0 (see above).
312
313 --truecolor*
314 This will make dvipng generate truecolor output. Note that
315 truecolor output is automatic if you include an external image in
316 your DVI, e.g., via a PostScript special (i.e., the graphics or
317 graphicx package). This switch is overridden by the --palette
318 switch.
319
320 -v* Enable verbose operation. This will currently indicate what fonts
321 is used, in addition to the usual output.
322
323 -x num
324 Set the x magnification ratio to num/1000. Overrides the
325 magnification specified in the DVI file. Must be between 10 and
326 100000. It is recommended that you use standard magstep values
327 (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help
328 reduce the total number of PK files generated. num may be a real
329 number, not an integer, for increased precision.
330
331 -z num
332 Set the PNG compression level to num. This option is enabled if
333 your libgd is new enough. The default compression level is 1, which
334 selects maximum speed at the price of slightly larger PNGs. For an
335 older libgd, the hard-soldered value 5 is used. The include file
336 png.h says "Currently, valid values range from 0 - 9, corresponding
337 directly to the zlib compression levels 0 - 9 (0 - no compression,
338 9 - "maximal" compression). Note that tests have shown that zlib
339 compression levels 3-6 usually perform as well as level 9 for PNG
340 images, and do considerably fewer calculations. In the future,
341 these values may not correspond directly to the zlib compression
342 levels."
343
345 The full manual is accessible in the info format, on most systems by
346 typing
347
348 info dvipng
349
351 This program is released under the GNU Lesser General Public License
352 version 3, see the COPYING file in the dvipng distribution or
353 <http://www.gnu.org/licenses/gpl.html>.
354
355 Copyright (c) 2002-2008 Jan-AAke Larsson
356
357
358
359dvipng 1.12 2009-02-23 DVIPNG(1)