1DVISVGM(1) dvisvgm Manual DVISVGM(1)
2
3
4
6 dvisvgm - converts DVI and EPS files to the XML-based SVG format
7
9 dvisvgm [options] file[.dvi]
10
11 dvisvgm --eps [options] file1[.eps] file2[.eps] ...
12
13 dvisvgm --pdf [options] file[.pdf]
14
16 The command-line utility dvisvgm converts DVI files, as generated by
17 TeX/LaTeX, to the XML-based scalable vector graphics format SVG. It
18 supports the classic DVI version 2 as well as version 3 (created by
19 pTeX in vertical mode), and the XeTeX versions 5 to 7 which are also
20 known as XDV. Besides the basic DVI commands, dvisvgm also evaluates
21 many so-called specials which heavily extend the capabilities of the
22 plain DVI format. For a more detailed overview, see section Supported
23 Specials below.
24
25 Since the current SVG standard 1.1 doesn’t specify multi-page graphics,
26 dvisvgm creates separate SVG files for each DVI page. Because of
27 compatibility reasons, only the first page is converted by default. In
28 order to select a different page or arbitrary page sequences, use
29 option -p which is described below.
30
31 SVG is a vector-based graphics format and therefore dvisvgm tries to
32 convert the glyph outlines of all fonts referenced in a DVI page
33 section to scalable path descriptions. The fastest way to achieve this
34 is to extract the path information from vector-based font files
35 available in PFB, TTF, or OTF format. If dvisvgm is able to find such a
36 file, it extracts all necessary outline information about the glyphs
37 from it.
38
39 However, TeX’s main source for font descriptions is Metafont, which
40 produces bitmap output (GF files). That’s why not all obtainable TeX
41 fonts are available in a scalable format. In these cases, dvisvgm tries
42 to vectorize Metafont’s output by tracing the glyph bitmaps. The
43 results are not as perfect as most (manually optimized) PFB or OTF
44 counterparts, but are nonetheless really nice in most cases.
45
46 When running dvisvgm without option --no-fonts, it creates font
47 elements (<font>...</font>) to embed the font data into the SVG files.
48 Unfortunately, only few SVG renderers support these elements yet. Most
49 web browsers and vector graphics applications don’t evaluate them
50 properly so that the text components of the resulting graphics might
51 look strange. In order to create more compatible SVG files,
52 command-line option --no-fonts can be given to replace the font
53 elements by plain graphics paths. Most web browsers (but only few
54 external SVG renderers) also support WOFF and WOFF2 fonts that can be
55 used instead of the default SVG fonts. Option --font-format offers the
56 functionality to change the format applied to the fonts being embedded.
57 This, however, only works when converting DVI files. Text present in
58 PDF and PostScript files is always converted to path elements.
59
61 dvisvgm provides a POSIX-compliant command-line interface with short
62 and long option names. They may be given before and/or after the name
63 of the file to be converted. Also, the order of specifying the options
64 is not significant, i.e. you can add them in any order without changing
65 dvisvgm’s behavior. Certain options accept or require additional
66 parameters which are directly appended to or separated by whitespace
67 from a short option (e.g. -v0 or -v 0). Long options require an
68 additional equals sign (=) between option name and argument but without
69 any surrounding whitespace (e.g. --verbosity=0). Multiple short options
70 that don’t expect a further parameter can be combined after a single
71 dash (e.g. -ejs rather than -e -j -s).
72
73 Long option names may also be shortened by omitting trailing
74 characters. As long as the shortened name is unambiguous, it’s
75 recognized and applied. For example, option --exact-bbox can be
76 shortened to --exact, --exa, or --ex. In case of an ambiguous
77 abbreviation, dvisvgm prints an error message together with all
78 matching option names.
79
80 -b, --bbox=fmt
81 Sets the bounding box of the generated SVG graphic to the specified
82 format. This option only affects the conversion of DVI files. SVG
83 documents generated from PDF and PostScript always inherit the
84 bounding boxes of the input files.
85
86 Parameter fmt takes either one of the format specifiers listed
87 below, or a sequence of four comma- or whitespace-separated length
88 values x1, y1, x2 and y2. The latter define the absolute
89 coordinates of two diagonal corners of the bounding box. Each
90 length value consists of a floating point number and an optional
91 length unit (pt, bp, cm, mm, in, pc, dd, cc, or sp). If the unit is
92 omitted, TeX points (pt) are assumed.
93
94 It’s also possible to give only one length value l. In this case,
95 the minimal bounding box is computed and enlarged by adding (-l,-l)
96 to the upper left and (l,l) to the lower right corner.
97
98 Additionally, dvisvgm also supports the following format
99 specifiers:
100
101 International DIN/ISO paper sizes
102 An, Bn, Cn, Dn, where n is a non-negative integer, e.g. A4 or
103 a4 for DIN/ISO A4 format (210mm × 297mm).
104
105 North American paper sizes
106 invoice, executive, legal, letter, ledger
107
108 Special bounding box sizes
109
110 dvi page size stored in the
111 DVI file
112 min computes the
113 minimal/tightest bounding
114 box
115 none no bounding box is
116 assigned
117 papersize box sizes specified by
118 papersize specials present
119 in the DVI file
120 preview bounding box data computed
121 by the preview package (if
122 present in the DVI file)
123
124
125 Page orientation
126 The default page orientation for DIN/ISO and American paper
127 sizes is portrait, i.e. width < height. Appending -landscape
128 or simply -l to the format string switches to landscape mode
129 (width > height). For symmetry reasons you can also explicitly
130 add -portrait or -p to indicate the default portrait format.
131 Note that these suffixes are part of the size string and not
132 separate options. Thus, they must directly follow the size
133 specifier without additional blanks. Furthermore, the
134 orientation suffixes can’t be used with dvi, min, and none.
135
136 Note
137 Option -b, --bbox only affects the bounding box and does
138 not transform the page content. Hence, if you choose a
139 landscape format, the page won’t be rotated.
140
141 -B, --bitmap-format=fmt
142 This option sets the image format used to embed bitmaps extracted
143 from PostScript or PDF data. By default, dvisvgm embeds all bitmaps
144 as JPEG images because it’s the most compact of the two formats
145 supported by SVG. To select the alternative lossless PNG format,
146 --bitmap-format=png can be used. There are some more format
147 variants dvisvgm currently supports even though jpeg and png should
148 be sufficient in most cases. The following list gives an overview
149 of the known format names which correspond to names of Ghostscript
150 output devices.
151
152 none disable processing of
153 bitmap images
154 jpeg color JPEG format
155 jpeggray grayscale JPEG format
156 png grayscale or 24-bit color
157 PNG format depending on
158 current color space
159 pnggray grayscale PNG format
160 pngmono black-and-white PNG format
161 pngmonod dithered black-and-white
162 PNG format
163 png16 4-bit color PNG format
164 png256 8-bit color PNG format
165 png16m 24-bit color PNG format
166
167 Since the collection of supported output devices can vary among
168 local Ghostscript installations, not all formats may be available
169 in some environments. dvisvgm quits with a PostScript error message
170 if the selected output format requires a locally unsupported output
171 device.
172
173 The two JPEG format specifiers accept an optional parameter to set
174 the IJG quality level which must directly follow the format
175 specifier separated by a colon, e.g. --bitmap-format=jpeg:50. The
176 quality value is an integer between 0 and 100. Higher values result
177 in better image quality but lower compression rates and therefore
178 larger files. The default quality level is 75 which is applied if
179 no quality parameter is given or if it’s set to 0.
180
181 -C, --cache[=dir]
182 To speed up the conversion process of bitmap fonts, dvisvgm saves
183 intermediate conversion information in cache files. By default,
184 these files are stored in $XDG_CACHE_HOME/dvisvgm/ or
185 $HOME/.cache/dvisvgm if XDG_CACHE_HOME is not set. If you prefer a
186 different location, use option --cache to overwrite the default.
187 Furthermore, it is also possible to disable the font caching
188 mechanism completely with option --cache=none. If argument dir is
189 omitted, dvisvgm prints the path of the default cache directory
190 together with further information about the stored fonts.
191 Additionally, outdated and corrupted cache files are removed.
192
193 -j, --clipjoin
194 This option tells dvisvgm to compute all intersections of clipping
195 paths itself rather than delegating this task to the SVG renderer.
196 The resulting SVG files are more portable because some SVG viewers
197 don’t support intersecting clipping paths which are defined by
198 clipPath elements containing a clip-path attribute.
199
200 --color
201 Enables colorization of messages printed during the conversion
202 process. The colors can be customized via environment variable
203 DVISVGM_COLORS. See the Environment section below for further
204 information.
205
206 --colornames
207 By default, dvisvgm exclusively uses RGB values of the form #RRGGBB
208 or #RGB to represent colors in the SVG file. The latter is a short
209 form for colors whose RGB components each consist of two identical
210 hex digits, e.g. #123 equals #112233. According to the SVG
211 standard, it’s also possible to use color names (like black and
212 darkblue) for a limited number of predefined colors
213 (https://www.w3.org/TR/SVG11/types.html#ColorKeywords). In order to
214 apply these color names rather than their RGB values, call dvisvgm
215 with option --colornames. All colors without an SVG color name will
216 still be represented by RGB values.
217
218 --comments
219 Adds comments with further information about selected data to the
220 SVG file. Currently, only font elements and font CSS rules related
221 to native fonts are annotated.
222
223 -E, --eps
224 If this option is given, dvisvgm does not expect a DVI but a single
225 or multiple EPS input files, and tries to convert them to SVG. In
226 order to do so, a single psfile special command is created and
227 forwarded to the PostScript special handler. This option is only
228 available if dvisvgm was built with PostScript support enabled, and
229 requires Ghostscript to be available. See option --libgs for
230 further information.
231
232 -e, --exact-bbox
233 This option tells dvisvgm to compute the precise bounding box of
234 each character. By default, the values stored in a font’s TFM file
235 are used to determine a glyph’s extent. As these values are
236 intended to implement optimal character placements and are not
237 designed to represent the exact dimensions, they don’t necessarily
238 correspond with the bounds of the visual glyphs. Thus, width and/or
239 height of some glyphs may be larger (or smaller) than the
240 respective TFM values. As a result, this can lead to clipped
241 characters at the bounds of the SVG graphics. With option
242 --exact-bbox given, dvisvgm analyzes the actual shape of each
243 character and derives a usually tight bounding box.
244
245 -f, --font-format=format
246 Selects the file format used to embed font data into the generated
247 SVG output when converting DVI files. It has no effect when
248 converting PDF or PostScript files. Text fragments present in these
249 files are always converted to path elements.
250
251 Following formats are supported: SVG (that’s the default), TTF
252 (TrueType), WOFF, and WOFF2 (Web Open Font Format version 1 and 2).
253 By default, dvisvgm creates unhinted fonts that might look bad on
254 low-resolution devices. In order to improve the display quality,
255 the generated TrueType, WOFF, or WOFF2 fonts can be autohinted. The
256 autohinter is enabled by appending ,autohint or ,ah to the font
257 format, e.g. --font-format=woff,autohint or --fwoff,ah.
258
259 Option --font-format is only available if dvisvgm was built with
260 WOFF support enabled.
261
262 -m, --fontmap=filenames
263 Loads and evaluates a single font map file or a sequence of font
264 map files. These files are required to resolve font file names and
265 encodings. dvisvgm does not provide its own map files but tries to
266 read available ones coming with dvips or dvipdfm. If option
267 --fontmap is omitted, dvisvgm looks for the default map files
268 ps2pk.map, pdftex.map, dvipdfm.map, and psfonts.map (in this
269 order). Otherwise, the files given as option arguments are
270 evaluated in the given order. Multiple filenames must be separated
271 by commas without leading and/or trailing whitespace.
272
273 By default, redefined mappings do not replace previous ones.
274 However, each filename can be preceded by an optional mode
275 specifier (+, -, or =) to change this behavior:
276
277 +mapfile
278 Only those entries in the given map file that don’t redefine a
279 font mapping are applied, i.e. fonts already mapped keep
280 untouched. That’s also the default mode if no mode specifier is
281 given.
282
283 -mapfile
284 Ensures that none of the font mappings defined in the given map
285 file are used, i.e. previously defined mappings for the
286 specified fonts are removed.
287
288 =mapfile
289 All mappings defined in the map file are applied. Previously
290 defined settings for the same fonts are replaced.
291
292 If the first filename in the filename sequence is preceded by a
293 mode specifier, dvisvgm loads the default font map (see above)
294 and applies the other map files afterwards. Otherwise, none of
295 default map files will be loaded automatically.
296
297 Examples: --fontmap=myfile1.map,+myfile2.map loads myfile1.map
298 followed by myfile2.map where all redefinitions of myfile2.map
299 are ignored. --fontmap==myfile1.map,-myfile2.map loads the
300 default map file followed by myfile1.map and myfile2.map where
301 all redefinitions of myfile1.map replace previous entries.
302 Afterwards, all definitions for the fonts given in myfile2.map
303 are removed from the font map tree.
304
305 For further information about the map file formats and the mode
306 specifiers, see the manuals of dvips
307 (https://tug.org/texinfohtml/dvips.html) and dvipdfm
308 (https://ctan.org/tex-archive/dviware/dvipdfm).
309
310 --grad-overlap
311 Tells dvisvgm to create overlapping grid segments when
312 approximating color gradient fills (also see option --grad-segments
313 below). By default, adjacent segments don’t overlap but only touch
314 each other like separate tiles. However, this alignment can lead to
315 visible gaps between the segments because the background color
316 usually influences the color at the boundary of the segments if the
317 SVG renderer uses anti-aliasing to create smooth contours. One way
318 to avoid this and to create seamlessly touching color regions is to
319 enlarge the segments so that they extend into the area of their
320 right and bottom neighbors. Since the latter are drawn on top of
321 the overlapping parts, the visible size of all segments keeps
322 unchanged. Just the former gaps disappear as the background is now
323 completely covered by the correct colors. Currently, dvisvgm
324 computes the overlapping segments separately for each patch of the
325 mesh (a patch mesh may consist of multiple patches of the same
326 type). Therefore, there still might be visible gaps at the seam of
327 two adjacent patches.
328
329 --grad-segments=number
330 Determines the maximal number of segments per column and row used
331 to approximate gradient color fills. Since SVG 1.1 only supports a
332 small subset of the shading algorithms available in PostScript,
333 dvisvgm approximates some of them by subdividing the area to be
334 filled into smaller, monochromatic segments. Each of these segments
335 gets the average color of the region it covers. Thus, increasing
336 the number of segments leads to smaller monochromatic areas and
337 therefore a better approximation of the actual color gradient. As a
338 drawback, more segments imply bigger SVG files because every
339 segment is represented by a separate path element.
340
341 Currently, dvisvgm supports free- and lattice-form triangular patch
342 meshes as well as Coons and tensor-product patch meshes. They are
343 approximated by subdividing the area of each patch into a n×n grid
344 of smaller segments. The maximal number of segments per column and
345 row can be changed with option --grad-segments.
346
347 --grad-simplify=delta
348 If the size of the segments created to approximate gradient color
349 fills falls below the given delta value, dvisvgm reduces their
350 level of detail. For example, Bézier curves are replaced by
351 straight lines, and triangular segments are combined to tetragons.
352 For a small delta, these simplifications are usually not noticeable
353 but reduce the size of the generated SVG files significantly.
354
355 -h, --help[=mode]
356 Prints a short summary of all available command-line options. The
357 optional mode parameter is an integer value between 0 and 2. It
358 selects the display variant of the help text. Mode 0 lists all
359 options divided into categories with section headers. This is also
360 the default if dvisvgm is called without parameters. Mode 1 lists
361 all options ordered by the short option names, while mode 2 sorts
362 the lines by the long option names.
363
364 A values in brackets after the description text indicate the
365 default parameter of the option. They are applied if an option with
366 a mandatory parameter is not used or if an optional parameter is
367 omitted. For example, option --bbox requires a size parameter which
368 defaults to min if --bbox is not used. Option --zip, which isn’t
369 applied by default, accepts an optional compression level
370 parameter. If it’s omitted, the stated default value 9 is used.
371
372 --keep
373 Disables the removal of temporary files as created by Metafont
374 (usually .gf, .tfm, and .log files) or the TrueType/WOFF module.
375
376 --libgs=path
377 This option is only available if the Ghostscript library is not
378 directly linked to dvisvgm and if PostScript support was not
379 completely disabled during compilation. In this case, dvisvgm tries
380 to load the shared GS library dynamically during runtime. By
381 default, it expects the library’s name to be libgs.so.X (on
382 Unix-like systems, where X is the ABI version of the library) or
383 gsdll32.dll/gsdll64.dll (Windows). If dvisvgm doesn’t find the
384 library, option --libgs can be used to specify the correct path and
385 filename, e.g. --libgs=/usr/local/lib/libgs.so.9 or
386 --libgs=\gs\gs9.25\bin\gsdll64.dll.
387
388 Alternatively, it’s also possible to assign the path to environment
389 variable LIBGS, e.g. export LIBGS=/usr/local/lib/libgs.so.9 or set
390 LIBGS=\gs\gs9.25\bin\gsdll63.dll. LIBGS has less precedence than
391 the command-line option, i.e. dvisvgm ignores variable LIBGS if
392 --libgs is given.
393
394 -L, --linkmark=style
395 Selects the method how to mark hyperlinked areas. The style
396 argument can take one of the values none, box, and line, where box
397 is the default, i.e. a rectangle is drawn around the linked region
398 if option --linkmark is omitted. Style argument line just draws the
399 lower edge of the bounding rectangle, and none tells dvisvgm not to
400 add any visible objects to hyperlinks. The lines and boxes get the
401 current text color selected. In order to apply a different,
402 constant color, a colon followed by a color specifier can be
403 appended to the style string. A color specifier is either a
404 hexadecimal RGB value of the form #RRGGBB, or a dvips color name
405 (https://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips).
406
407 Moreover, argument style can take a single color specifier to
408 highlight the linked region by a frameless box filled with that
409 color. An optional second color specifier separated by a colon
410 selects the frame color.
411
412 Examples: box:red or box:#ff0000 draws red boxes around the linked
413 areas. yellow:blue creates yellow filled rectangles with blue
414 frames.
415
416 -l, --list-specials
417 Prints a list of registered special handlers and exits. Each
418 handler processes a set of special statements belonging to the same
419 category. In most cases, these categories are identified by the
420 prefix of the special statements which is usually a leading string
421 followed by a colon or a blank, e.g. color or ps. The listed
422 handler names, however, don’t need to match these prefixes, e.g. if
423 there is no common prefix or if functionality is split into
424 separate handlers in order to allow them to be disabled separately
425 using option --no-specials. All special statements not covered by
426 one of the special handlers are silently ignored.
427
428 -M, --mag=factor
429 Sets the magnification factor applied in conjunction with Metafont
430 calls prior tracing the glyphs. The larger this value, the better
431 the tracing results. Nevertheless, large magnification values can
432 cause Metafont arithmetic errors due to number overflows. So, use
433 this option with care. The default setting usually produces nice
434 results.
435
436 --no-merge
437 Puts every single character in a separate text element with
438 corresponding x and y attributes. By default, new text or tspan
439 elements are only created if a string starts at a location that
440 differs from the regular position defined by the characters'
441 advance values.
442
443 --no-mktexmf
444 Suppresses the generation of missing font files. If dvisvgm can’t
445 find a font file through the kpathsea lookup mechanism, it calls
446 the external tools mktextfm or mktexmf. This option disables these
447 calls.
448
449 -n, --no-fonts[=variant]
450 If this option is given, dvisvgm doesn’t create SVG font elements
451 but uses paths instead. The resulting SVG files tend to be larger
452 but are concurrently more compatible with most applications that
453 don’t support SVG fonts. The optional argument variant selects the
454 method how to substitute fonts by paths. Variant 0 creates path and
455 use elements in order to avoid lengthy duplicates. Variant 1
456 creates path elements only. Option --no-fonts implies --no-styles.
457
458 -c, --scale=sx[,sy]
459 Scales the page content horizontally by sx and vertically by sy.
460 This option is equivalent to -TSsx,sy.
461
462 -S, --no-specials[=names]
463 Disable processing of special commands embedded in the DVI file. If
464 no further parameter is given, all specials are ignored. To disable
465 a selected set of specials, an optional comma-separated list of
466 names can be appended to this option. A name is the unique
467 identifier referencing the intended special handler as listed by
468 option --list-specials.
469
470 --no-styles
471 By default, dvisvgm creates CSS styles and class attributes to
472 reference fonts. This variant is more compact than adding the
473 complete font information to each text element over and over again.
474 However, if you prefer direct font references, the default behavior
475 can be disabled with option --no-styles.
476
477 -O, --optimize[=modules]
478 Applies several optimizations on the generated SVG tree to reduce
479 the file size. The optimizations are performed by running separate
480 optimizer modules specified by optional argument modules. It may
481 consist of a single module name or a comma-separated list of
482 several module names. The corresponding modules are executed one by
483 one in the given order and thus transform the XML tree gradually.
484
485 The following list describes the currently available optimizer
486 modules.
487
488 list
489 Lists all available optimizer modules and exits.
490
491 none
492 If this argument is given, dvisvgm doesn’t apply any
493 optimization. none can’t be combined with other module names.
494
495 all
496 Performs all optimizations listed below. This is also the
497 default if option --optimize is used without argument. The
498 modules are executed in a predefined order that usually leads
499 to the best results. all can’t be combined with other module
500 names.
501
502 collapse-groups
503 Combines nested group elements (<g>...</g>) that contain only a
504 single group each. If possible, the group attributes are moved
505 to the outermost element of the processed subtree. This module
506 also unwraps group elements that have no attributes at all.
507
508 group-attributes
509 Creates groups (<g>...</g>) for common attributes around
510 adjacent elements. Each attribute is moved to a separate group
511 so that multiple common attributes lead to nested groups. They
512 can be combined by applying optimizer module collapse-groups
513 afterwards. The algorithm only takes inheritable properties,
514 such as fill or stroke-width, into account and only removes
515 them from an element if none of the other attributes, like id,
516 prevents this.
517
518 reassign-clippaths
519 Collects all clipPath elements that differ only by their IDs.
520 Afterwards, the duplicates are removed so that only one
521 remains. All clip-path attributes referencing one of the
522 duplicates are updated accordingly.
523
524 remove-clippaths
525 Removes all redundant clipPath elements. This optimization was
526 already present in former versions of dvisvgm and was always
527 applied by default. This behavior is retained, i.e. dvisvgm
528 executes this module even if option --optimize is not given.
529 You can use argument none to prevent that.
530
531 simplify-text
532 If a text element only contains whitespace nodes and tspan
533 elements, all common inheritable attributes of the latter are
534 moved to the enclosing text element. All tspan elements without
535 further attributes are unwrapped.
536
537 simplify-transform
538 Tries to shorten all transform attributes. This module combines
539 the transformation commands of each attribute and decomposes
540 the resulting transformation matrix into a sequence of basic
541 transformations, i.e. translation, scaling, rotation, and
542 skewing. If this sequence is shorter than the equivalent matrix
543 expression, it’s assigned to the attribute. Otherwise, the
544 matrix expression is used.
545
546 -o, --output=pattern
547 Sets the pattern that determines the names of the generated SVG
548 files. The required parameter pattern may consist of an arbitrary
549 sequence of characters which make up the filenames. With the
550 exception of the following mentioned variables and expressions, all
551 characters are treated as static parts of the filenames and are
552 therefore identical for all pages processed during a run of
553 dvisvgm. The strings %f, %p, %P, %n, %N, %hd, %ho, and %hc are
554 variables that can be used as part of the pattern. %f expands to
555 the base name of the DVI file, i.e. the filename without suffix, %p
556 is the current page number, and %P the total number of pages in the
557 DVI file. The variables %n and %N expand to the number of the
558 current file being converted (starting at 1) and the total number
559 of files given, respectively.
560
561 An optional number (0-9) specified directly after the percent sign
562 of a variable holding a numeric value denotes the minimal number of
563 digits to be created. If a particular value consists of less
564 digits, the number is padded with leading zeros. Example: %3p
565 enforces 3 digits for the current page number (001, 002, etc.).
566 Without an explicit width specifier, %p gets the same number of
567 digits as %P.
568
569 If you need more control over the numbering, you can use arithmetic
570 expressions as part of a pattern. The syntax is %(expr) where expr
571 may contain additions, subtractions, multiplications, and integer
572 divisions with common precedence. The variables p and P contain the
573 current page number and the total number of pages, respectively.
574 For example, --output="%f-%(p-1)" creates filenames where the
575 numbering starts with 0 rather than 1.
576
577 The variables %hX contain different hash values computed from the
578 DVI page data and the options given on the command-line. %hd and
579 %hc are only set if option --page-hashes is present. Otherwise,
580 they are empty. For further information, see the description of
581 option --page-hashes below.
582
583 The default pattern is %f-%p.svg if the DVI file consists of more
584 than one page, and %f.svg otherwise. That means, a DVI file foo.dvi
585 is converted to foo.svg if foo.dvi is a single-page document.
586 Otherwise, multiple SVG files foo-01.svg, foo-02.svg, etc. are
587 produced. In Windows environments, the percent sign indicates
588 dereferenced environment variables, and must therefore be protected
589 by a second percent sign, e.g. --output=%%f-%%p.
590
591 -p, --page=ranges
592 This option selects the pages to be processed. Parameter ranges
593 consists of a comma-separated list of single page numbers and/or
594 page ranges. A page range is a pair of numbers separated by a
595 hyphen, e.g. 5-12. Thus, a page sequence might look like this:
596 2-4,6,9-12,15. It doesn’t matter if a page is given more than once
597 or if page ranges overlap. dvisvgm always extracts the page numbers
598 in ascending order and converts them only once. In order to stay
599 compatible with previous versions, the default page sequence is 1.
600 dvisvgm therefore converts only the first page and not the whole
601 document if option --page is omitted. Usually, page ranges consist
602 of two numbers denoting the first and last page to be converted. If
603 the conversion should start at page 1, or if it should continue up
604 to the last DVI page, the first or second range number can be
605 omitted, respectively. Example: --page=-10 converts all pages up to
606 page 10, --page=10- converts all pages starting with page 10.
607 Please consider that the page values don’t refer to the page
608 numbers printed on the corresponding page. Instead, the physical
609 page count is expected, where the first page always gets number 1.
610
611 -H, --page-hashes[=params]
612 If this option is given, dvisvgm computes hash values of all pages
613 to be processed. As long as the page contents don’t change, the
614 hash value of that page stays the same. This property can be used
615 to determine whether a DVI page must be converted again or can be
616 skipped in consecutive runs of dvisvgm. This is done by propagating
617 the hash value to variable %hd which can be accessed in the output
618 pattern (see option --output). By default, dvisvgm changes the
619 output pattern to %f-%hd if option --page-hashes is given. As a
620 result, all SVG file names contain the hash value instead of the
621 page number. When calling dvisvgm again with option --page-hashes
622 with the same output pattern, it checks the existence of the SVG
623 file to be created and skips the conversion if it’s already
624 present. This also applies for consecutive calls of dvisvgm with
625 different command-line parameters. If you want to force another
626 conversion of a DVI file that hasn’t changed, you must remove the
627 corresponding SVG files beforehand or add the parameter replace
628 (see below). If you manually set the output pattern to not contain
629 a hash value, the conversion won’t be skipped.
630
631 Alternatively, the output pattern may contain the variables %ho and
632 %hc. %ho expands to a 32-bit hash representing the given
633 command-line options that affect the generated SVG output, like
634 --no-fonts and --precision. Different combinations of options and
635 parameters lead to different hashes. Thus pattern %f-%hd-%ho
636 creates filenames that change depending on the DVI data and the
637 given command-line options. Variable %hc provides a combined hash
638 computed from the DVI data and the command-line options. It has the
639 same length as %hd.
640
641 Since the page number isn’t part of the file name by default,
642 different DVI pages with identical contents get the same file name.
643 Therefore, only the first one is converted while the others are
644 skipped. To create separate files for each page, you can add the
645 page number to the output pattern, e.g. --output="%f-%p-%hc".
646
647 By default, dvisvgm uses the fast XXH64 hash algorithm to compute
648 the values provided through %hd and %hc. 64-bit hashes should be
649 sufficient for most documents with an average size of pages.
650 Alternatively, XXH32 and MD5 can be used as well. The desired
651 algorithm is specified by argument params of option --page-hashes.
652 It takes one of the strings MD5, XXH32, and XXH64, where the names
653 can be given in lower case too, like --page-hashes=md5. Since
654 version 0.7.1, xxHash provides an experimental 128-bit hash
655 function whose algorithm has been stabilized as of version 0.8.
656 When using a version prior to 0.8, the 128-bit hash values can vary
657 depending on the used xxHash version. If the corresponding API is
658 available, dvisvgm supports the new hash function, and option
659 --page-hashes additionally accepts the algorithm specifier XXH128.
660
661 Finally, option --page-hashes can take a second argument that must
662 be separated by a comma. Currently, only the two parameters list
663 and replace are evaluated, e.g. --page-hashes=md5,list or
664 --page-hashes=replace. When list is present, dvisvgm doesn’t
665 perform any conversion but just lists the hash values %hd and %hc
666 of the pages specified by option --page. Parameter replace forces
667 dvisvgm to convert a DVI page even if a file with the target name
668 already exists.
669
670 -P, --pdf
671 If this option is given, dvisvgm does not expect a DVI but a PDF
672 input file, and tries to convert it to SVG. Similar to the
673 conversion of DVI files, only the first page is processed by
674 default. Option --page can be used to select different pages, page
675 ranges, and/or page sequences. The conversion is realized by
676 creating a single pdffile special command which is forwarded to the
677 PostScript special handler. Therefore, this option is only
678 available if dvisvgm was built with PostScript support enabled, and
679 requires Ghostscript to be accessible. See option --libgs for
680 further information.
681
682 -d, --precision=digits
683 Specifies the maximal number of decimal places applied to
684 floating-point attribute values. All attribute values written to
685 the generated SVG file(s) are rounded accordingly. The parameter
686 digits accepts integer values from 0 to 6, where 0 enables the
687 automatic selection of significant decimal places. This is also the
688 default value if dvisvgm is called without option --precision.
689
690 --progress[=delay]
691 Enables a simple progress indicator shown when time-consuming
692 operations like PostScript specials are processed. The indicator
693 doesn’t appear before the given delay (in seconds) has elapsed. The
694 default delay value is 0.5 seconds.
695
696 -r, --rotate=angle
697 Rotates the page content clockwise by angle degrees around the page
698 center. This option is equivalent to -TRangle.
699
700 -R, --relative
701 SVG allows you to define graphics paths by a sequence of absolute
702 and/or relative path commands, i.e. each command expects either
703 absolute coordinates or coordinates relative to the current drawing
704 position. By default, dvisvgm creates paths made up of absolute
705 commands. If option --relative is given, relative commands are
706 created instead. This slightly reduces the size of the SVG files in
707 most cases.
708
709 --stdin
710 Tells dvisvgm to read the DVI or EPS input data from stdin instead
711 from a file. Alternatively to option --stdin, a single dash (-) can
712 be given. The default name of the generated SVG file is stdin.svg
713 which can be changed with option --output.
714
715 -s, --stdout
716 Don’t write the SVG output to a file but redirect it to stdout.
717
718 --tmpdir[=path]
719 In some cases, dvisvgm needs to create temporary files to work
720 properly. These files go to the system’s temporary folder by
721 default, e.g. /tmp on Linux systems. Option --tmpdir can be used
722 to specify a different location. Please note that dvisvgm does not
723 create this folder if it doesn’t exist. Therefore, you must ensure
724 that it’s actually present before running dvisvgm.
725
726 If the optional parameter path is omitted, dvisvgm prints the
727 location of the system’s temp folder and exits.
728
729 -a, --trace-all=[retrace]
730 This option forces dvisvgm to vectorize not only the glyphs
731 actually required to render the SVG file correctly – which is the
732 default –, but processes all glyphs of all fonts referenced in the
733 DVI file. Because dvisvgm stores the tracing results in a font
734 cache, all following conversions of these fonts will speed up
735 significantly. The boolean option retrace determines how to handle
736 glyphs already stored in the cache. By default, these glyphs are
737 skipped. Setting argument retrace to yes or true forces dvisvgm to
738 retrace the corresponding bitmaps again.
739
740 Note
741 This option only takes effect if font caching is active.
742 Therefore, --trace-all cannot be combined with option
743 --cache=none.
744
745 -T, --transform=commands
746 Applies a sequence of transformations to the SVG content. Each
747 transformation is described by a command beginning with a capital
748 letter followed by a list of comma-separated parameters. Following
749 transformation commands are supported:
750
751 T tx[,ty]
752 Translates (moves/shifts) the page in direction of vector
753 (tx,ty). If ty is omitted, ty=0 is assumed. The expected unit
754 length of tx and ty are TeX points (1pt = 1/72.27in). However,
755 there are several constants defined to simplify the unit
756 conversion (see below).
757
758 S sx[,sy]
759 Scales the page horizontally by sx and vertically by sy. If sy
760 is omitted, sy=sx is assumed.
761
762 R angle[,x,y]
763 Rotates the page clockwise by angle degrees around point (x,y).
764 If the optional arguments x and y are omitted, the page will be
765 rotated around its center depending on the chosen page format.
766 When option -bnone is given, the rotation center is origin
767 (0,0).
768
769 KX angle
770 Skews the page along the x-axis by angle degrees. Argument
771 angle can take any value except 90+180k, where k is an integer.
772
773 KY angle
774 Skews the page along the y-axis by angle degrees. Argument
775 angle can take any value except 90+180k, where k is an integer.
776
777 FH [y]
778 Mirrors (flips) the page at the horizontal line through point
779 (0,y). Omitting the optional argument leads to y=h/2, where h
780 denotes the page height (see pre-defined constants below).
781
782 FV [x]
783 Mirrors (flips) the page at the vertical line through point
784 (x,0). Omitting the optional argument leads to x=w/2, where w
785 denotes the page width (see pre-defined constants below).
786
787 M m1,...,m6
788 Applies a transformation described by the 3×3 matrix
789 ((m1,m2,m3),(m4,m5,m6),(0,0,1)), where the inner triples denote
790 the rows.
791
792 Note
793 All transformation commands of option -T, --transform are
794 applied in the order of their appearance. Multiple commands
795 can optionally be separated by spaces. In this case the
796 whole transformation string has to be enclosed in double
797 quotes to keep them together. All parameters are
798 expressions of floating point type. You can either give
799 plain numbers or arithmetic terms combined by the operators
800 + (addition), - (subtraction), * (multiplication), /
801 (division) or % (modulo) with common associativity and
802 precedence rules. Parentheses may be used as well.
803
804 Additionally, some pre-defined constants are provided:
805
806 ux horizontal position of
807 upper left page corner in
808 TeX point units
809 uy vertical position of upper
810 left page corner in TeX
811 point units
812 h page height in TeX point
813 units (0 in case of
814 -bnone)
815 w page width in TeX point
816 units (0 in case of
817 -bnone)
818
819 Furthermore, you can use the 9 length constants pt, bp, cm,
820 mm, in, pc, dd, cc, and sp, e.g. 2cm or 1.6in. Thus,
821 option -TT1in,0R45 moves the page content 1 inch to the
822 right and rotates it by 45 degrees around the page center
823 afterwards.
824
825 For single transformations, there are also the short-hand
826 options -c, -t and -r available. In contrast to the
827 --transform commands, the order of these options is not
828 significant, so that it’s not possible to describe
829 transformation sequences with them.
830
831 -t, --translate=tx[,ty]
832 Translates (moves) the page content in direction of vector (tx,ty).
833 This option is equivalent to -TTtx,ty.
834
835 -v, --verbosity=level
836 Controls the type of messages printed during a dvisvgm run:
837
838 0 no message output at all
839 1 error messages only
840 2 warning messages only
841 4 informational messages
842 only
843
844
845 Note
846 By adding these values you can combine the categories. The
847 default level is 7, i.e. all messages are printed.
848
849 -V, --version[=extended]
850 Prints the version of dvisvgm and exits. If the optional argument
851 is set to yes, the version numbers of the linked libraries are
852 printed as well.
853
854 -z, --zip[=level]
855 Creates a compressed SVG file with suffix .svgz. The optional
856 argument specifies the compression level. Valid values are in the
857 range of 1 to 9 (default value is 9). Larger values cause better
858 compression results but may take slightly more computation time.
859
860 -Z, --zoom=factor
861 Multiplies the values of the width and height attributes of the SVG
862 root element by argument factor while the coordinate system of the
863 graphic content is retained. As a result, most SVG viewers zoom the
864 graphics accordingly. If a negative zoom factor is given, the width
865 and height attributes are omitted.
866
868 dvisvgm supports several special commands that enrich the DVI command
869 set with additional instructions for features, like color, graphics,
870 and hyperlinks. The term special command, or just special, originates
871 from the TeX command \special{...} which does almost nothing. TeX only
872 forwards the whole command to the DVI file and delegates its execution
873 to the DVI driver. The DVI driver can then decide to either process or
874 ignore it, depending on the supported statements. The parameter of
875 TeX’s \special command is given in curly braces and may consist of an
876 arbitrary character sequence representing the actual instruction, for
877 example color Red.
878
879 + dvisvgm delegates the evaluation of special commands to dedicated
880 handlers. Each handler is responsible for all special statements of the
881 same command set, i.e. commands usually – but not necessarily –
882 beginning with a common prefix. For example, all PDF specials start
883 with the prefix pdf:, while the TPIC special set consists of 13
884 different commands without common identifier. The PDF specials are
885 processed by dvisvgm’s pdf handler, the TPIC ones by the tpic handler.
886 To get a list of the actually provided special handlers, use option
887 --list-specials (see above). The following list gives an overview of
888 the special sets currently supported. The names of the handlers can
889 also be used to disable the processing of individual sets of specials.
890 For further information on this, see option --no-specials.
891
892 bgcolor
893 Special statements for changing the background/page color.
894 Currently, dvisvgm only supports the background statement as
895 specified in the dvips manual
896 (https://tug.org/texinfohtml/dvips.html#Color-specifications).
897 Since SVG 1.1 doesn’t support background colors, dvisvgm inserts a
898 rectangle of the chosen color into the generated SVG document. This
899 rectangle always gets the same size as the selected or computed
900 bounding box. This background color command is part of the color
901 special set but is handled separately in order to let the user turn
902 it off.
903
904 color
905 Statements of this command set provide instructions to change the
906 text/paint color. For an overview of the exact syntax, see the
907 documentation of dvips, for instance.
908
909 dvisvgm
910 dvisvgm offers its own small set of specials. The following list
911 gives a brief overview.
912
913 dvisvgm:raw text
914 Adds an arbitrary sequence of XML nodes to the page section of
915 the SVG document. dvisvgm checks syntax and proper nesting of
916 the inserted elements but does not perform any validation, thus
917 the user has to ensure that the resulting SVG is still valid.
918 Opening and closing tags may be distributed among different raw
919 specials. The tags themselves can also be split but must be
920 continued with the immediately following raw special. Both
921 syntactically incorrect and wrongly nested tags lead to error
922 messages. Parameter text may also contain the expressions {?x},
923 {?y}, {?color}, and {?matrix} that expand to the current x or y
924 coordinate, the current color, and current transformation
925 matrix, respectively. Character sequence {?nl} expands to a
926 newline character. Finally, constructions of the form {?(expr)}
927 enable the evaluation of mathematical expressions which may
928 consist of basic arithmetic operations including modulo. Like
929 above, the variables x and y represent the current coordinates.
930 Example: {?(-10*(x+2y)-5)}.
931
932 dvisvgm:rawdef text
933 This command is similar to dvisvgm:raw, but puts the XML nodes
934 into the <defs> section of the SVG document currently being
935 generated.
936
937 dvisvgm:rawset name ... dvisvgm:endrawset
938 This pair of specials marks the begin and end of a definition
939 of a named raw SVG fragment. All dvisvgm:raw and dvisvgm:rawdef
940 specials enclosed by dvisvgm:rawset and dvisvgm:endrawset are
941 not evaluated immediately but stored together under the given
942 name for later use. Once defined, the named fragment can be
943 referenced throughout the DVI file by dvisvgm:rawput (see
944 below). The two commands dvisvgm:rawset and dvisvgm:endrawset
945 must not be nested, i.e. each call of dvisvgm:rawset has to be
946 followed by a corresponding call of dvisvgm:endrawset before
947 another dvisvgm:rawset may occur. Also, the identifier name
948 must be unique throughout the DVI file. Using dvisvgm:rawset
949 multiple times together with the same name leads to warning
950 messages.
951
952 dvisvgm:rawput name
953 Inserts raw SVG fragments previously stored under the given
954 name. dvisvgm distinguishes between fragments that were
955 specified with dvisvgm:raw or dvisvgm:rawdef, and handles them
956 differently: It inserts all dvisvgm:raw parts every time
957 dvisvgm:rawput is called, whereas the dvisvgm:rawdef portions
958 go to the <defs> section of the current SVG document only once.
959
960 dvisvgm:img width height file
961 Creates an image element at the current graphic position
962 referencing the given file. JPEG, PNG, and SVG images can be
963 used here. However, dvisvgm does not check the file format or
964 the file name suffix. The lengths width and height can be given
965 together with a unit specifier (see option --bbox) or as plain
966 floating point numbers. In the latter case, TeX point units are
967 assumed (1in = 72.27pt).
968
969 dvisvgm:bbox lock
970 Locks the bounding box of the current page and prevents it from
971 further updating, i.e. graphics elements added after calling
972 this special are not taken into account in determining the
973 extent of the bounding box.
974
975 dvisvgm:bbox unlock
976 Unlocks the previously locked bounding box of the current page
977 so that it gets updated again when adding graphics elements to
978 the page.
979
980 dvisvgm:bbox n[ew] name
981 Defines or resets a local bounding box called name. The name
982 may consist of letters and digits. While processing a DVI page,
983 dvisvgm continuously updates the (global) bounding box of the
984 current page in order to determine the minimal rectangle
985 containing all visible page components (characters, images,
986 drawing elements etc.) Additionally to the global bounding box,
987 the user can request an arbitrary number of named local
988 bounding boxes. Once defined, these boxes are updated together
989 with the global bounding box starting with the first character
990 that follows the definition. Thus, the local boxes can be used
991 to compute the extent of parts of the page. This is useful for
992 scenarios where the generated SVG file is post-processed. In
993 conjunction with special dvisvgm:raw, the macro {?bbox name}
994 expands to the four values x, y, w, and h (separated by spaces)
995 specifying the coordinates of the upper left corner, width, and
996 height of the local box name. If box name wasn’t previously
997 defined, all four values equal to zero.
998
999 dvisvgm:bbox width height [depth] [transform]
1000 Updates the bounding box of the current page by embedding a
1001 virtual rectangle (x, y, width, height) where the lower left
1002 corner is located at the current DVI drawing position (x,y). If
1003 the optional parameter depth is specified, dvisvgm embeds a
1004 second rectangle (x, y, width, -depth). The lengths width,
1005 height, and depth can be given together with a unit specifier
1006 (see option --bbox) or as plain floating point numbers. In the
1007 latter case, TeX point units are assumed (1in = 72.27pt).
1008 Depending on size and position of the virtual rectangle, this
1009 command either enlarges the overall bounding box or leaves it
1010 as is. It’s not possible to reduce its extent. This special
1011 should be used together with dvisvgm:raw in order to update the
1012 viewport of the page properly. By default, the box extents are
1013 assigned unchanged and, in particular, are not altered by
1014 transformation commands. In order to apply the current
1015 transformation matrix, the optional modifier transform can be
1016 added at the end of the special statement.
1017
1018 dvisvgm:bbox a[bs] x1 y1 x2 y2 [transform]
1019 This variant of the bbox special updates the bounding box by
1020 embedding a virtual rectangle (x1,y1,x2,y2). The points (x1,y1)
1021 and (x2,y2) denote the absolute coordinates of two diagonal
1022 corners of the rectangle. As with the relative special variant
1023 described above, the optional modifier transform allows for
1024 applying the current transformation matrix to the bounding box.
1025
1026 dvisvgm:bbox f[ix] x1 y1 x2 y2 [transform]
1027 This variant of the bbox special assigns an absolute (final)
1028 bounding box to the resulting SVG. After executing this
1029 command, dvisvgm doesn’t further alter the bounding box
1030 coordinates, except this special is called again later. The
1031 points (x1,y1) and (x2,y2) denote the absolute coordinates of
1032 two diagonal corners of the rectangle. As with the relative
1033 special variant described above, the optional modifier
1034 transform allows for applying the current transformation matrix
1035 to the bounding box.
1036
1037 The following TeX snippet adds two raw SVG elements to the
1038 output and updates the bounding box accordingly:
1039
1040 \special{dvisvgm:raw <circle cx='{?x}' cy='{?y}' r='10' stroke='black' fill='red'/>}%
1041 \special{dvisvgm:bbox 10bp 10bp 10bp transform}%
1042 \special{dvisvgm:bbox -10bp 10bp 10bp transform}
1043
1044 \special{dvisvgm:raw <path d='M50 200 L10 250 H100 Z' stroke='black' fill='blue'/>}%
1045 \special{dvisvgm:bbox abs 10bp 200bp 100bp 250bp transform}
1046
1047 em
1048 These specials were introduced with the emTeX distribution by
1049 Eberhard Mattes. They provide line drawing statements, instructions
1050 for embedding MSP, PCX, and BMP image files, as well as two PCL
1051 commands. dvisvgm supports only the line drawing statements and
1052 ignores all other em specials silently. A description of the
1053 command syntax can be found in the DVI driver documentation coming
1054 with emTeX (https://ctan.org/pkg/emtex).
1055
1056 html
1057 The hyperref specification defines several variants on how to mark
1058 hyperlinked areas in a DVI file. dvisvgm supports the plain
1059 HyperTeX special constructs as created with hyperref package option
1060 hypertex. By default, all linked areas of the document are marked
1061 by a rectangle. Option --linkmark allows you to change this
1062 behavior. See above for further details. Information on syntax and
1063 semantics of the HyperTeX specials can be found in the hyperref
1064 manual (https://ctan.org/pkg/hyperref).
1065
1066 papersize
1067 The papersize special, which is an extension introduced by dvips,
1068 can be used to specify the widths and heights of the pages in the
1069 DVI file. It affects the page it appears on as well as all
1070 following pages until another papersize special is found. If there
1071 is more than one papersize special present on a page, dvisvgm
1072 applies the last one. However, in order to stay compatible with
1073 previous versions of dvisvgm that did not evaluate these specials,
1074 their processing must be explicitly enabled by adding option
1075 --bbox=papersize on the command-line. Otherwise, dvisvgm ignores
1076 them and computes tight bounding boxes.
1077
1078 pdf
1079 pdfTeX and dvipdfmx introduced several special commands related to
1080 the generation of PDF files. Currently, only pdf:mapfile,
1081 pdf:mapline, pdf:pagesize, and PDF hyperlink specials are supported
1082 by dvisvgm. The latter are the PDF pendants to the HTML HyperTeX
1083 specials generated by the hyperref package in PDF mode.
1084
1085 pdf:pagesize is similar to the papersize special (see above) which
1086 specifies the size of the current and all folowing pages. In order
1087 to actually apply the extents to the generated SVG files, option
1088 --bbox=papersize must be given.
1089
1090 pdf:mapfile and pdf:mapline allow for modifying the font map tree
1091 while processing the DVI file. They are used by CTeX, for example.
1092 dvisvgm supports both, the dvips and dvipdfm font map format. For
1093 further information on the command syntax and semantics, see the
1094 documentation of \pdfmapfile in the pdfTeX user manual
1095 (https://ctan.org/pkg/pdftex).
1096
1097 ps
1098 The famous DVI driver dvips
1099 (https://www.tug.org/texinfohtml/dvips.html) introduced its own set
1100 of specials in order to embed PostScript code into DVI files, which
1101 greatly improves the capabilities of DVI documents. One aim of
1102 dvisvgm is to completely evaluate all PostScript fragments and to
1103 convert as many of them as possible to SVG. In contrast to dvips,
1104 dvisvgm uses floating point arithmetics to compute the precise
1105 position of each graphic element, i.e. it doesn’t round the
1106 coordinates. Therefore, the relative locations of the graphic
1107 elements may slightly differ from those computed by dvips.
1108
1109 Since PostScript is a rather complex language, dvisvgm does not
1110 implement its own PostScript interpreter but relies on Ghostscript
1111 (https://ghostscript.com) instead. If the Ghostscript library was
1112 not linked to the dvisvgm binary, it is looked up and loaded
1113 dynamically during runtime. In this case, dvisvgm looks for
1114 libgs.so.X on Unix-like systems (supported ABI versions: 7,8,9),
1115 for libgs.X.dylib on macOS, and for gsdll32.dll or gsdll64.dll on
1116 Windows. You can override the default file names with environment
1117 variable LIBGS or the command-line option --libgs. The library must
1118 be reachable through the ld search path (*nix) or the PATH
1119 environment variable (Windows). Alternatively, the absolute file
1120 path can be specified. If the library cannot be found, dvisvgm
1121 disables the processing of PostScript specials and prints a warning
1122 message. Use option --list-specials to check whether PostScript
1123 support is available, i.e. entry ps is present.
1124
1125 The PostScript handler also recognizes and evaluates bounding box
1126 data generated by the preview package
1127 (https://ctan.org/pkg/preview) with option tightpage. If such data
1128 is present in the DVI file and if dvisvgm is called with option
1129 --bbox=preview, dvisvgm sets the width and total height of the SVG
1130 file to the values derived from the preview data. Additionally, it
1131 prints a message showing the width, height, and depth of the box in
1132 TeX point units to the console. Especially, the depth value can be
1133 read by a post-processor to vertically align the SVG graphics with
1134 the baseline of surrounding text in HTML or XSL-FO documents, for
1135 example. Please note that SVG bounding boxes are defined by a width
1136 and (total) height. In contrast to TeX, SVG provides no means to
1137 differentiate between height and depth, i.e. the vertical extents
1138 above and below the baseline, respectively. Therefore, it is
1139 generally not possible to retrieve the depth value from the SVG
1140 file itself.
1141
1142 If you call dvisvgm with option --bbox=min (the default) and
1143 preview data is present in the DVI file, dvisvgm doesn’t apply the
1144 preview extents but computes a bounding box that tightly encloses
1145 the page contents. The height, depth and width values written to
1146 console are adapted accordingly.
1147
1148 tpic
1149 The TPIC special set defines instructions for drawing simple
1150 geometric objects. Some LaTeX packages, like eepic and tplot, use
1151 these specials to describe graphics.
1152
1154 dvisvgm file
1155 Converts the first page of file.dvi to file.svg.
1156
1157 dvisvgm -p1-5 file
1158 Converts the first five pages of file.dvi to
1159 file-1.svg,...,file-5.svg.
1160
1161 dvisvgm -p1- file
1162 Converts all pages of file.dvi to separate SVG files.
1163
1164 dvisvgm -p1,3 -O file
1165 Converts the first and third page of file.dvi to optimized SVG
1166 files.
1167
1168 dvisvgm - < file.dvi
1169 Converts the first page of file.dvi to stdin.svg where the contents
1170 of file.dvi is read from stdin.
1171
1172 dvisvgm -z file
1173 Converts the first page of file.dvi to file.svgz with default
1174 compression level 9.
1175
1176 dvisvgm -p5 -z3 -ba4-l -o newfile file
1177 Converts the fifth page of file.dvi to newfile.svgz with
1178 compression level 3. The bounding box is set to DIN/ISO A4 in
1179 landscape format.
1180
1181 dvisvgm --transform="R20,w/3,2h/5 T1cm,1cm S2,3" file
1182 Converts the first page of file.dvi to file.svg where three
1183 transformations are applied.
1184
1186 dvisvgm uses the kpathsea library for locating the files that it opens.
1187 Hence, the environment variables described in the library’s
1188 documentation influence the converter.
1189
1190 If dvisvgm was linked without the Ghostscript library, and if
1191 PostScript support has not been disabled, the shared Ghostscript
1192 library is looked up during runtime via dlopen(). The environment
1193 variable LIBGS can be used to specify path and file name of the
1194 library.
1195
1196 The pre-compiled Windows versions of dvisvgm require a working
1197 installation of MiKTeX 2.9 or above. dvisvgm does not work together
1198 with the portable edition of MiKTeX because it relies on MiKTeX’s COM
1199 interface that is only accessible in a local installation. To enable
1200 the evaluation of PostScript specials, the original Ghostscript DLL
1201 gsdll32.dll must be present and reachable through the search path.
1202 64-bit Windows builds require the 64-bit Ghostscript DLL gsdll64.dll.
1203 Both DLLs come with the corresponding Ghostscript installers available
1204 from https://ghostscript.com.
1205
1206 The environment variable DVISVGM_COLORS specifies the colors used to
1207 highlight various parts of dvisvgm’s message output. It is only
1208 evaluated if option --color is given. The value of DVISVGM_COLORS is a
1209 list of colon-separated entries of the form gg=BF, where gg denotes one
1210 of the color group indicators listed below, and BF are two hexadecimal
1211 digits specifying the background (first digit) and foreground/text
1212 color (second digit). The color values are defined as follows: 0=black,
1213 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=gray, 8=bright
1214 red, 9=bright green, A=bright yellow, B=bright blue, C=bright magenta,
1215 D=bright cyan, E=bright gray, F=white. Depending on the terminal, the
1216 colors may differ. Rather than changing both the text and background
1217 color, it’s also possible to change only one of them: An asterisk (*)
1218 in place of a hexadecimal digit indicates the default text or
1219 background color of the terminal.
1220
1221 All malformed entries in the list are silently ignored.
1222
1223
1224 er error messages
1225
1226 wn warning messages
1227
1228 pn messages about page
1229 numbers
1230
1231 ps page size messages
1232
1233 fw information about the
1234 files written
1235
1236 sm state messages
1237
1238 tr messages of the glyph
1239 tracer
1240
1241 pi progress indicator
1242
1243
1244 Example: er=01:pi=*5 sets the colors of error messages (er) to red (1)
1245 on black (0), and those of progress indicators (pi) to cyan (5) on
1246 default background (*).
1247
1249 The location of the following files is determined by the kpathsea
1250 library. To check the actual kpathsea configuration you can use the
1251 kpsewhich utility.
1252
1253
1254
1255
1256 *.enc Font encoding files
1257
1258 *.fgd Font glyph data files
1259 (cache files created by
1260 dvisvgm)
1261
1262 *.map Font map files
1263
1264 *.mf Metafont input files
1265
1266 *.pfb PostScript Type 1 font
1267 files
1268
1269 *.pro PostScript header/prologue
1270 files
1271
1272 *.tfm TeX font metric files
1273
1274 *.ttf TrueType font files
1275
1276 *.vf Virtual font files
1277
1278
1280 tex(1), mf(1), mktexmf(1), grodvi(1), potrace(1), and the kpathsea
1281 library info documentation.
1282
1284 Project home page
1285 https://dvisvgm.de
1286
1287 Code repository
1288 https://github.com/mgieseki/dvisvgm
1289
1291 Please report bugs using the bug tracker at GitHub
1292 (https://github.com/mgieseki/dvisvgm/issues).
1293
1295 Written by Martin Gieseking <martin.gieseking@uos.de>
1296
1298 Copyright © 2005-2022 Martin Gieseking. Free use of this software is
1299 granted under the terms of the GNU General Public License (GPL) version
1300 3 or, (at your option) any later version.
1301
1302
1303
1304dvisvgm 2.13.3 2022-02-26 DVISVGM(1)