Debian Codegraph @

texk/dvipng/dvipng-src/dvipng.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "DVIPNG 1"
58 .TH DVIPNG 1 2025-02-02 "dvipng 1.18" "User commands"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 dvipng \- A DVI\-to\-PNG translator
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 dvipng [options] filename
68 .PP
69 dvipng [options] [filename] \-
70 .SH DESCRIPTION
71 .IX Header "DESCRIPTION"
72 This program makes PNG and/or GIF graphics from DVI files as obtained
73 from TeX and its relatives.
74 .PP
75 If GIF support is enabled, GIF output is chosen by using the
76 \&\fBdvigif\fR binary or with the \fB\-\-gif\fR option.
77 .PP
78 The benefits of \fBdvipng\fR/\fBdvigif\fR include
79 .IP * 4
80 Speed. It is a very fast bitmap-rendering code for DVI files, which
81 makes it suitable for generating large amounts of images on-the-fly,
82 as needed in preview-latex, WeBWorK and others.
83 .IP * 4
84 It does not read the postamble, so it can be started before TeX
85 finishes. There is a \fB\-\-follow\fR switch that makes dvipng wait at
86 end-of-file for further output, unless it finds the POST marker that
87 indicates the end of the DVI.
88 .IP * 4
89 Interactive query of options. dvipng can read options interactively
90 through stdin, and all options are usable. It is even possible to change
91 the input file through this interface.
92 .IP * 4
93 Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts (i.e.,
94 as used in CJK-LaTeX), color specials, and inclusion of PostScript,
95 PNG, JPEG or GIF images.
96 .IP * 4
97 and more...
98 .SH OPTIONS
99 .IX Header "OPTIONS"
100 Many of the parameterless options listed here can be turned off by
101 suffixing the option with a zero (\fB0\fR); for instance, to turn off
102 page reversal, use \fB\-r0\fR. Such options are marked with a trailing
103 \&\fB*\fR.
104 .IP \fB\-\fR 4
105 .IX Item "-"
106 Read additional options from standard input after processing the command
107 line.
108 .IP \fB\-\-help\fR 4
109 .IX Item "--help"
110 Print a usage message and exit.
111 .IP \fB\-\-version\fR 4
112 .IX Item "--version"
113 Print the version number and exit.
114 .IP "\fB\-bd\fR \fInum\fR" 4
115 .IX Item "-bd num"
116 .PD 0
117 .IP "\fB\-bd\fR \fIcolor_spec\fR" 4
118 .IX Item "-bd color_spec"
119 .IP "\fB\-bd '\fR\fInum\fR\fB \fR\fIcolor_spec\fR\fB'\fR" 4
120 .IX Item "-bd 'num color_spec'"
121 .PD
122 Set the pixel width of the transparent border (default 0). Using this
123 option will make the image edges transparent, but it only affects pixels
124 with the background color. Giving a \fIcolor_spec\fR will set the
125 fallback color, to be used in viewers that cannot handle transparency
126 (the default is the background color). The color spec should be in
127 TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. Setting the
128 fallback color makes the default border width 1 px.
129 .IP "\fB\-\-bdpi\fR \fInum\fR" 4
130 .IX Item "--bdpi num"
131 This option only has an effect when using bitmapped (PK) fonts. The
132 option sets the base (Metafont) resolution, both horizontal and
133 vertical, to \fInum\fR dpi (dots per inch). This option is necessary
134 when manually selecting Metafont mode with the \-\-mode option (see
135 below).
136 .IP "\fB\-bg\fR \fIcolor_spec\fR" 4
137 .IX Item "-bg color_spec"
138 Choose background color for the images. This option will be ignored if
139 there is a background color \especial in the DVI. The color spec should
140 be in TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. You can
141 also specify 'Transparent' or 'transparent' which will give you a
142 transparent background with the normal background as a fallback color. A
143 capitalized 'Transparent' will give a full-alpha transparency, while an
144 all-lowercase 'transparent' will give a simple fully transparent
145 background with non-transparent antialiased pixels. The latter would be
146 suitable for viewers who cannot cope with a true alpha channel. GIF
147 images do not support full alpha transparency, so in case of GIF output,
148 both variants will use the latter behaviour.
149 .IP "\fB\-d\fR \fInum\fR" 4
150 .IX Item "-d num"
151 Set the debug flags, showing what dvipng (thinks it) is doing. This will
152 work unless dvipng has been compiled without the \f(CW\*(C`DEBUG\*(C'\fR option
153 (not recommended). Set the flags as you need them, use \fB\-d \-1\fR as
154 the first option for maximum output.
155 .IP "\fB\-D\fR \fInum\fR" 4
156 .IX Item "-D num"
157 Set the output resolution, both horizontal and vertical, to \fInum\fR
158 dpi (dots per inch).
159 .Sp
160 One may want to adjust this to fit a certain text font size (e.g., on
161 a web page), and for a text font height of \fIfont_px\fR pixels (in
162 Mozilla) the correct formula is
163 .Sp
164 .Vb 1
165 \& <dpi> = <font_px> * 72.27 / 10 [px * TeXpt/in / TeXpt]
166 .Ve
167 .Sp
168 The last division by ten is due to the standard font height 10pt in
169 your document, if you use 12pt, divide by 12. Unfortunately, some
170 proprietary browsers have font height in pt (points), not pixels. You
171 have to rescale that to pixels, using the screen resolution (default
172 is usually 96 dpi) which means the formula is
173 .Sp
174 .Vb 1
175 \& <font_px> = <font_pt> * 96 / 72 [pt * px/in / (pt/in)]
176 .Ve
177 .Sp
178 On some high-res screens, the value is instead 120 dpi. Good luck!
179 .IP \fB\-\-depth*\fR 4
180 .IX Item "--depth*"
181 Report the depth of the image. This only works reliably when the
182 LaTeX style \fIpreview.sty\fR from preview-latex is used with
183 the \fBactive\fR option. It reports the number of pixels from the
184 bottom of the image to the baseline of the image. This can be used for
185 vertical positioning of the image in, e.g., web documents, where one
186 would use (Cascading StyleSheets 1)
187 .Sp
188 .Vb 1
189 \& <IMG SRC="<filename.png>" STYLE="vertical\-align: \-<depth>px">
190 .Ve
191 .Sp
192 The depth is a negative offset in this case, so the minus sign is
193 necessary, and the unit is pixels (px).
194 .IP \fB\-\-dvinum*\fR 4
195 .IX Item "--dvinum*"
196 Set this option to make the output page number be the TeX page
197 numbers rather than the physical page number. See the \fB\-o\fR switch.
198 .IP "\fB\-fg\fR \fIcolor_spec\fR" 4
199 .IX Item "-fg color_spec"
200 Choose foreground color for the images. This option will be ignored if
201 there is a foreground color \especial in the DVI. The color spec should
202 be in TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'.
203 .IP \fB\-\-follow*\fR 4
204 .IX Item "--follow*"
205 Wait for data at end-of-file. One of the benefits of dvipng is that it
206 does not read the postamble, so it can be started before TeX
207 finishes. This switch makes dvipng wait at end-of-file for further
208 output, unless it finds the POST marker that indicates the end of the
209 DVI. This is similar to \fBtail \-f\fR but for DVI-to-PNG conversion.
210 .IP \fB\-\-freetype*\fR 4
211 .IX Item "--freetype*"
212 Enable/disable FreeType font rendering (default on). This option is
213 available if the FreeType2 font library was present at compilation time.
214 If this is the case, dvipng will have direct support for PostScript
215 Type1 and TrueType fonts internally, rather than using \fBgsftopk\fR
216 for rendering the fonts. If you have PostScript versions of Computer
217 Modern installed, there will be no need to generate bitmapped (PK)
218 variants on disk of these. Then, you can render images at different (and
219 unusual) resolutions without cluttering the disk with lots of bitmapped
220 fonts.
221 One reason to disable FreeType font rendering would be to generate
222 identical output on different platforms, since FreeType uses the native
223 renderer and therefore can give slightly different output on each platform.
224 .IP "\fB\-\-gamma\fR \fInum\fR" 4
225 .IX Item "--gamma num"
226 Control the interpolation of colors in the greyscale anti-aliasing
227 color palette. Default value is 1.0. For 0 < \fInum\fR < 1, the
228 fonts will be lighter (more like the background), and for \fInum\fR >
229 1, the fonts will be darker (more like the foreground).
230 .IP \fB\-\-gif*\fR 4
231 .IX Item "--gif*"
232 The images are output in the GIF format, if GIF support is enabled.
233 This is the default for the \fBdvigif\fR binary, which only will be
234 available when GIF support is enabled. GIF images are palette images
235 (see the \fB\-\-palette\fR option) and does not support true alpha
236 channels (see the \fB\-\-bg\fR option). See also the \fB\-\-png\fR
237 option.
238 .IP \fB\-\-height*\fR 4
239 .IX Item "--height*"
240 Report the height of the image. This only works reliably when the
241 LaTeX style \fIpreview.sty\fR from preview-latex is used with
242 the \fBactive\fR option. It reports the number of pixels from the top
243 of the image to the baseline of the image. The total height of the
244 image is obtained as the sum of the values reported from
245 \&\fB\-\-height\fR and \fB\-\-depth\fR.
246 .IP "\fB\-l [=]\fR\fInum\fR" 4
247 .IX Item "-l [=]num"
248 The last page printed will be the first one numbered \fInum\fR. Default
249 is the last page in the document. If \fInum\fR is prefixed by an equals
250 sign, then it (and the argument to the \fB\-p\fR option, if specified)
251 is treated as a physical (absolute) page number, rather than a value to
252 compare with the TeX \fB\ecount0\fR values stored in the DVI file.
253 Thus, using \fB\-l =9\fR will end with the ninth page of the document,
254 no matter what the pages are actually numbered.
255 .IP "\fB\-\-mode\fR \fImode\fR" 4
256 .IX Item "--mode mode"
257 This option only has an effect when using bitmapped (PK) fonts. Use
258 \&\fImode\fR as the Metafont device name for the PK fonts (both for path
259 searching and font generation). This needs to be augmented with the base
260 device resolution, given with the \fB\-\-bdpi\fR option. See the file
261 <\fBftp://ftp.tug.org/tex/modes.mf\fR> for a list of resolutions and mode
262 names for most devices.
263 .IP \fB\-M*\fR 4
264 .IX Item "-M*"
265 This option only has an effect when using bitmapped (PK) fonts. It turns
266 off automatic PK font generation (\fImktexpk\fR).
267 .IP \fB\-\-nogs*\fR 4
268 .IX Item "--nogs*"
269 This switch prohibits the internal call to GhostScript for displaying
270 PostScript specials. \fB\-\-nogs0\fR turns the call back on.
271 .IP \fB\-\-nogssafer*\fR 4
272 .IX Item "--nogssafer*"
273 Normally, if GhostScript is used to render PostScript specials, the
274 GhostScript interpreter is run with the option \fB\-dSAFER\fR. The
275 \&\fB\-\-nogssafer\fR option runs GhostScript without \fB\-dSAFER\fR. The
276 \&\fB\-dSAFER\fR option in Ghostscript disables PostScript operators such
277 as deletefile, to prevent possibly malicious PostScript programs from
278 having any effect.
279 .IP \fB\-\-norawps*\fR 4
280 .IX Item "--norawps*"
281 Some packages generate raw PostScript specials, even non-rendering such
282 specials. This switch turns off the internal call to GhostScript
283 intended to display these raw PostScript specials. \fB\-\-norawps0\fR
284 turns the call back on.
285 .IP "\fB\-o\fR \fIname\fR" 4
286 .IX Item "-o name"
287 Send output to the file \fIname\fR. A single occurrence of \fR\f(CB%d\fR\fB\fR or
288 \&\fB\fR\f(CB%01d\fR\fB\fR, ..., \fB\fR\f(CB%09d\fR\fB\fR will be exchanged for the physical
289 page number (this can be changed, see the \fB\-\-dvinum\fR switch). The
290 default output filename is \fIfile\fR\fB\fR\f(CB%d\fR\fB.png\fR where the input DVI
291 file was \fIfile\fR\fB.dvi\fR.
292 .IP "\fB\-O\fR \fIx\-offset\fR\fB,\fR\fIy\-offset\fR" 4
293 .IX Item "-O x-offset,y-offset"
294 Move the origin by \fIx\-offset\fR,\fIy\-offset\fR, a comma-separated
295 pair of dimensions such as \fB.1in,\-.3cm\fR.
296 The origin of the page is shifted from the default position
297 (of one inch down, one inch to the right from the upper left corner of
298 the paper) by this amount.
299 .IP "\fB\-p [=]\fR\fInum\fR" 4
300 .IX Item "-p [=]num"
301 The first page printed will be the first one numbered \fInum\fR. Default
302 is the first page in the document. If \fInum\fR is prefixed by an
303 equals sign, then it (and the argument to the \fB\-l\fR option, if
304 specified) is treated as a physical (absolute) page number, rather than
305 a value to compare with the TeX \fB\ecount0\fR values stored in the
306 DVI file. Thus, using \fB\-p =3\fR will start with the third page of
307 the document, no matter what the pages are actually numbered.
308 .IP \fB\-\-palette*\fR 4
309 .IX Item "--palette*"
310 When an external image is included, \fBdvipng\fR will automatically
311 switch to truecolor mode, to avoid unnecessary delay and quality
312 reduction, and enable the EPS translator to draw on a transparent
313 background and outside of the boundingbox. This switch will force
314 palette (256\-color) output and make \fBdvipng\fR revert to opaque
315 clipped image inclusion. This will also override the \fB\-\-truecolor\fR
316 switch if present.
317 .IP \fB\-\-picky*\fR 4
318 .IX Item "--picky*"
319 No images are output when a warning occurs. Normally, dvipng will
320 output an image in spite of a warning, but there may be something
321 missing in this image. One reason to use this option would be if you
322 have a more complete but slower fallback converter. Mainly, this is
323 useful for failed figure inclusion and unknown \especial occurrences,
324 but warnings will also occur for missing or unknown color specs and
325 missing PK fonts.
326 .IP \fB\-\-png*\fR 4
327 .IX Item "--png*"
328 The images are output in the PNG format. This is the default for the
329 \&\fBdvipng\fR binary. See also the \fB\-\-gif\fR option.
330 .IP "\fB\-pp\fR \fIfirstpage\fR\fB\-\fR\fIlastpage\fR" 4
331 .IX Item "-pp firstpage-lastpage"
332 Print pages \fIfirstpage\fR through \fIlastpage\fR; but not quite
333 equivalent to \fB\-p\fR \fIfirstpage\fR \fB\-l\fR \fIlastpage\fR. For example,
334 when rendering a book, there may be several instances of a page in the
335 DVI file (one in \f(CW\*(C`\efrontmatter\*(C'\fR, one in \f(CW\*(C`\emainmatter\*(C'\fR, and one
336 in \f(CW\*(C`\ebackmatter\*(C'\fR). In case of several pages matching, \fB\-pp\fR
337 \&\fIfirstpage\fR\fB\-\fR\fIlastpage\fR will render \fIall\fR pages that
338 matches the specified range, while \fB\-p\fR \fIfirstpage\fR \fB\-l\fR
339 \&\fIlastpage\fR will render the pages from the \fIfirst\fR occurrence
340 of \fIfirstpage\fR to the \fIfirst\fR occurrence of \fIlastpage\fR.
341 This is the (undocumented) behaviour of dvips. In dvipng you can give
342 both kinds of options, in which case you get all pages that matches the
343 range in \fB\-pp\fR between the pages from \fB\-p\fR to \fB\-l\fR. Also
344 multiple \fB\-pp\fR options accumulate, unlike \fB\-p\fR and \fB\-l\fR.
345 The \fB\-\fR separator can also be \fB:\fR. Note that \fB\-pp \-1\fR
346 will be interpreted as "all pages up to and including 1", if you want a
347 page numbered \-1 (only the table of contents, say) put \fB\-pp \-1\-\-1\fR,
348 or more readable, \fB\-pp \-1:\-1\fR.
349 .IP \fB\-q*\fR 4
350 .IX Item "-q*"
351 Run quietly. Don't chatter about pages converted, etc. to standard
352 output; report no warnings (only errors) to standard error.
353 .IP "\fB\-Q\fR \fInum\fR" 4
354 .IX Item "-Q num"
355 Set the quality to \fInum\fR. That is, choose the number of antialiasing
356 levels for bitmapped fonts (PK), to be
357 \&\fInum\fR*\fInum\fR+1. The default value is 4 which gives 17 levels of
358 antialiasing for antialiased fonts from these two. If FreeType is
359 available, its rendering is unaffected by this option.
360 .IP \fB\-r*\fR 4
361 .IX Item "-r*"
362 Toggle output of pages in reverse/forward order. By default, the first
363 page in the DVI is output first.
364 .IP \fB\-\-strict*\fR 4
365 .IX Item "--strict*"
366 The program exits when a warning occurs. Normally, dvipng will output
367 an image in spite of a warning, but there may be something missing in
368 this image. One reason to use this option would be if you have a more
369 complete but slower fallback converter. See the \fB\-\-picky\fR option
370 above for a list of when warnings occur.
371 .IP "\fB\-T\fR \fIimage_size\fR" 4
372 .IX Item "-T image_size"
373 Set the image size to \fIimage_size\fR which can be either of
374 \&\fBbbox\fR, \fBtight\fR, or a comma-separated pair of dimensions
375 \&\fIhsize\fR,\fIvsize\fR such as \fB.1in,.3cm\fR. The default is
376 \&\fBbbox\fR which produces a PNG that includes all ink put on the page
377 and in addition the DVI origin, located 1in from the top and 1in from
378 the left edge of the paper. This usually gives whitespace above and to
379 the left in the produced image. The value \fBtight\fR will make dvipng
380 only include all ink put on the page, producing neat images.
381 .IP \fB\-\-truecolor*\fR 4
382 .IX Item "--truecolor*"
383 This will make \fBdvipng\fR generate truecolor output. Note that
384 truecolor output is automatic if you include an external image in your
385 DVI, e.g., via a PostScript special (i.e., the \fBgraphics\fR or
386 \&\fBgraphicx\fR package). This switch is overridden by the
387 \&\fB\-\-palette\fR switch.
388 .IP \fB\-v*\fR 4
389 .IX Item "-v*"
390 Enable verbose operation. This will currently indicate what fonts is
391 used, in addition to the usual output.
392 .IP \fB\-\-width*\fR 4
393 .IX Item "--width*"
394 Report the width of the image. See also \fB\-\-height\fR and
395 \&\fB\-\-depth\fR.
396 .IP "\fB\-x\fR \fInum\fR" 4
397 .IX Item "-x num"
398 This option is deprecated; it should not be used. It is much better to
399 select the output resolution directly with the \fB\-D\fR option. This
400 option sets the magnification ratio to \fInum\fR/1000 and
401 overrides the magnification specified in the DVI file. Must be between
402 10 and 100000. It is recommended that you use standard magstep values
403 (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the
404 total number of PK files generated. \fInum\fR may be a real number, not
405 an integer, for increased precision.
406 .IP "\fB\-z\fR \fInum\fR" 4
407 .IX Item "-z num"
408 Set the PNG compression level to \fInum\fR. This option is enabled if
409 your \fBlibgd\fR is new enough. The default compression level is 1,
410 which selects maximum speed at the price of slightly larger PNGs. For an
411 older \fBlibgd\fR, the hard-soldered value 5 is used. The include file
412 \&\fBpng.h\fR says
413 "Currently, valid values range from 0 \- 9, corresponding directly to
414 the zlib compression levels 0 \- 9 (0 \- no compression, 9 \- "maximal"
415 compression). Note that tests have shown that zlib compression levels
416 3\-6 usually perform as well as level 9 for PNG images, and do
417 considerably fewer calculations. In the future, these values may not
418 correspond directly to the zlib compression levels."
419 .SH NOTES
420 .IX Header "NOTES"
421 The full manual is accessible in info format, on most systems by typing
422 .PP
423 .Vb 1
424 \& info dvipng
425 .Ve
426 .SH COPYRIGHT
427 .IX Header "COPYRIGHT"
428 This program is released under the GNU Lesser General Public License
429 version 3, see the COPYING file in the dvipng distribution or
430 <\fBhttp://www.gnu.org/licenses/gpl.html\fR>.
431 .PP
432 Copyright (c) 2002\-2015, 2019 Jan-AAke Larsson