1DVIPNG(1)                        User commands                       DVIPNG(1)
2
3
4

NAME

6       dvipng - A DVI-to-PNG translator
7

SYNOPSIS

9       dvipng [options] filename
10
11       dvipng [options] [filename] -
12

DESCRIPTION

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
24           on-the-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

OPTIONS

42       Many of the parameterless options listed here can be turned off by suf‐
43       fixing 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 fall‐
77           back color. A capitalized 'Transparent' will give a full-alpha
78           transparency, while an all-lowercase 'transparent' will give a sim‐
79           ple fully transparent background with non-transparent antialiased
80           pixels. The latter would be suitable for viewers who cannot cope
81           with a true alpha channel.  GIF images do not support full alpha
82           transparency, so in case of GIF output, both variants will use the
83           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 num‐
126           bers 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 display‐
197           ing PostScript specials. --noghostscript0 turns the call back on.
198
199       --nogssafer*
200           Normally, if GhostScript is used to render PostScript specials, the
201           GhostScript interpreter is run with the option -dSAFER. The
202           --nogssafer option runs GhostScript without -dSAFER. The -dSAFER
203           option in Ghostscript disables PostScript operators such as delete‐
204           file, to prevent possibly malicious PostScript programs from having
205           any effect.
206
207       -o name
208           Send output to the file name. A single occurrence of %d or %01d,
209           ..., %09d will be exchanged for the physical page number (this can
210           be changed, see the --dvinum switch). The default output filename
211           is file%d.png where the input DVI file was file.dvi.
212
213       -O x-offset,y-offset
214           Move the origin by x-offset,y-offset, a comma-separated pair of
215           dimensions such as .1in,-.3cm.  The origin of the page is shifted
216           from the default position (of one inch down, one inch to the right
217           from the upper left corner of the paper) by this amount.
218
219       -p [=]num
220           The first page printed will be the first one numbered num. Default
221           is the first page in the document.  If num is prefixed by an equals
222           sign, then it (and the argument to the -l option, if specified) is
223           treated as a physical (absolute) page number, rather than a value
224           to compare with the TeX \count0 values stored in the DVI file.
225           Thus, using -p =3 will start with the third page of the document,
226           no matter what the pages are actually numbered.
227
228       --palette*
229           Starting from dvipng 1.8, the output PNG will be a truecolor png
230           when an external image is included, to avoid unnecessary delay and
231           quality reduction, and enable the EPS translator to draw on a
232           transparent background and outside of the boundingbox. This switch
233           will force palette (256-color) output and make dvipng revert to the
234           old behaviour, where included images were opaque and always clipped
235           to the boundingbox. This will also override the --truecolor switch
236           if present.
237
238       --picky*
239           No images are output when a warning occurs. Normally, dvipng will
240           output an image in spite of a warning, but there may be something
241           missing in this image. One reason to use this option would be if
242           you have a more complete but slower fallback converter. Mainly,
243           this is useful for failed figure inclusion and unknown \special
244           occurrences, but warnings will also occur for missing or unknown
245           color specs and missing PK fonts.
246
247       --png*
248           The images are output in the PNG format. This is the default for
249           the dvipng binary. See also the --gif option.
250
251       -pp firstpage-lastpage
252           Print pages firstpage through lastpage; but not quite equivalent to
253           -p firstpage -l lastpage. For example, when rendering a book, there
254           may be several instances of a page in the DVI file (one in "\front‐
255           matter", one in "\mainmatter", and one in "\backmatter"). In case
256           of several pages matching, -pp firstpage-lastpage will render all
257           pages that matches the specified range, while -p firstpage -l last‐
258           page will render the pages from the first occurrence of firstpage
259           to the first occurrence of lastpage.  This is the (undocumented)
260           behaviour of dvips. In dvipng you can give both kinds of options,
261           in which case you get all pages that matches the range in -pp
262           between the pages from -p to -l. Also multiple -pp options accumu‐
263           late, unlike -p and -l.  The - separator can also be :. Note that
264           -pp -1 will be interpreted as "all pages up to and including 1", if
265           you want a page numbered -1 (only the table of contents, say) put
266           -pp -1--1, or more readable, -pp -1:-1.
267
268       -q* Run quietly.  Don't chatter about pages converted, etc. to standard
269           output; report no warnings (only errors) to standard error.
270
271       -Q num
272           Set the quality to num. That is, choose the number of antialiasing
273           levels for PK and T1lib rendering to be num*num+1. The default
274           value is 4 which gives 17 levels of antialiasing for antialiased
275           fonts from these two. If FreeType is available, its rendering is
276           unaffected by this option.
277
278       -r* Toggle output of pages in reverse/forward order. By default, the
279           first page in the DVI is output first.
280
281       --strict*
282           The program exits when a warning occurs. Normally, dvipng will out‐
283           put an image in spite of a warning, but there may be something
284           missing in this image. One reason to use this option would be if
285           you have a more complete but slower fallback converter. See the
286           --picky option above for a list of when warnings occur.
287
288       -T image_size
289           Set the image size to image_size which can be either of bbox,
290           tight, or a comma-separated pair of dimensions hsize,vsize such as
291           .1in,.3cm. The default is bbox which produces a PNG that includes
292           all ink put on the page and in addition the DVI origin, located 1in
293           from the top and 1in from the left edge of the paper. This usually
294           gives whitespace above and to the left in the produced image. The
295           value tight will make dvipng only include all ink put on the page,
296           producing neat images.
297
298       --t1lib*
299           Enable/disable T1lib font rendering (default on). This option is
300           available if the T1lib font library was present at compilation
301           time. If this is the case, dvipng will have direct support for
302           PostScript Type1 fonts internally, rather than using gsftopk for
303           rendering the fonts. If you have PostScript versions of Computer
304           Modern installed, there will be no need to generate bitmapped vari‐
305           ants on disk of these.  Then, you can render images at different
306           (and unusual) resolutions without cluttering the disk with lots of
307           bitmapped fonts. Note that if you have both FreeType and T1lib on
308           your system FreeType will be preferred by dvipng, and if you for
309           some reason rather want to use T1lib, give the option --freetype0
310           (see above).
311
312       --truecolor*
313           This will make dvipng generate truecolor output. Note that true‐
314           color output is automatic if you include an external image in your
315           DVI, e.g., via a PostScript special (i.e., the graphics or graphicx
316           package). This switch is overridden by the --palette switch.
317
318       -v* Enable verbose operation. This will currently indicate what fonts
319           is used, in addition to the usual output.
320
321       -x num
322           Set the x magnification ratio to num/1000. Overrides the magnifica‐
323           tion specified in the DVI file.  Must be between 10 and 100000.  It
324           is recommended that you use standard magstep values (1095, 1200,
325           1440, 1728, 2074, 2488, 2986, and so on) to help reduce the total
326           number of PK files generated.  num may be a real number, not an
327           integer, for increased precision.
328
329       -z num
330           Set the PNG compression level to num. This option is enabled if
331           your libgd is new enough. The default compression level is 1, which
332           selects maximum speed at the price of slightly larger PNGs. For an
333           older libgd, the hard-soldered value 5 is used. The include file
334           png.h says "Currently, valid values range from 0 - 9, corresponding
335           directly to the zlib compression levels 0 - 9 (0 - no compression,
336           9 - "maximal" compression). Note that tests have shown that zlib
337           compression levels 3-6 usually perform as well as level 9 for PNG
338           images, and do considerably fewer calculations. In the future,
339           these values may not correspond directly to the zlib compression
340           levels."
341

NOTES

343       The full manual is accessible in the info format, on most systems by
344       typing
345
346               info dvipng
347
349       This program is released under the GNU Lesser General Public License
350       version 3, see the COPYING file in the dvipng distribution or
351       <http://www.gnu.org/licenses/gpl.html>.
352
353       Copyright (c) 2002-2008 Jan-AAke Larsson
354
355
356
357dvipng 1.11                       2008-05-14                         DVIPNG(1)
Impressum