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 ] file [.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 suppport 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 an EPS
225 input file, and tries to convert it to SVG. In order to do so, a
226 single psfile special command is created and forwarded to the
227 PostScript special handler. This option is only available if
228 dvisvgm was built with PostScript support enabled, and requires
229 Ghostscript to be available. See option --libgs for further
230 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, the categories are identified by the
420 prefix of the special statements. It’s 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 to disable them separately with
425 option --no-specials. All special statements not covered by one of
426 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 remove-clippath
519 Removes all redundant clipPath elements. This optimization was
520 already present in former versions of dvisvgm and was always
521 applied by default. This behavior is retained, i.e. dvisvgm
522 executes this module even if option --optimize is not given.
523 You can use argument none to prevent that.
524
525 simplify-text
526 If a text element only contains whitespace nodes and tspan
527 elements, all common inheritable attributes of the latter are
528 moved to the enclosing text element. All tspan elements without
529 further attributes are unwrapped.
530
531 simplify-transform
532 Tries to shorten all transform attributes. This module combines
533 the transformation commands of each attribute and decomposes
534 the resulting transformation matrix into a sequence of basic
535 transformations, i.e. translation, scaling, rotation, and
536 skewing. If this sequence is shorter than the equivalent matrix
537 expression, it’s assigned to the attribute. Otherwise, the
538 matrix expression is used.
539
540 -o, --output=pattern
541 Sets the pattern specifying the names of the generated SVG files.
542 Parameter pattern is a string that may contain static character
543 sequences as well as the variables %f, %p, %P, %hd, %ho, and %hc.
544 %f expands to the base name of the DVI file, i.e. the filename
545 without suffix, %p is the current page number, and %P the total
546 number of pages in the DVI file. An optional number (0-9) given
547 directly after the percent sign specifies the minimal number of
548 digits to be written. If a particular value consists of less
549 digits, the number is padded with leading zeros. Example: %3p
550 enforces 3 digits for the current page number (001, 002, etc.).
551 Without an explicit width specifier, %p gets the same number of
552 digits as %P.
553
554 If you need more control over the numbering, you can use arithmetic
555 expressions as part of a pattern. The syntax is %(expr) where expr
556 may contain additions, subtractions, multiplications, and integer
557 divisions with common precedence. The variables p and P contain the
558 current page number and the total number of pages, respectively.
559 For example, --output="%f-%(p-1)" creates filenames where the
560 numbering starts with 0 rather than 1.
561
562 The variables %hX contain different hash values computed from the
563 DVI page data and the options given on the command-line. %hd and
564 %hc are only set if option --page-hashes is present. Otherwise,
565 it’s empty. For further information, see the description of option
566 --page-hashes below.
567
568 The default pattern is %f-%p.svg if the DVI file consists of more
569 than one page, and %f.svg otherwise. That means, a DVI file foo.dvi
570 is converted to foo.svg if foo.dvi is a single-page document.
571 Otherwise, multiple SVG files foo-01.svg, foo-02.svg, etc. are
572 produced. In Windows environments, the percent sign indicates
573 dereferenced environment variables, and must therefore be protected
574 by a second percent sign, e.g. --output=%%f-%%p.
575
576 -p, --page=ranges
577 This option selects the pages to be processed. Parameter ranges
578 consists of a comma-separated list of single page numbers and/or
579 page ranges. A page range is a pair of numbers separated by a
580 hyphen, e.g. 5-12. Thus, a page sequence might look like this:
581 2-4,6,9-12,15. It doesn’t matter if a page is given more than once
582 or if page ranges overlap. dvisvgm always extracts the page numbers
583 in ascending order and converts them only once. In order to stay
584 compatible with previous versions, the default page sequence is 1.
585 dvisvgm therefore converts only the first page and not the whole
586 document if option --page is omitted. Usually, page ranges consist
587 of two numbers denoting the first and last page to be converted. If
588 the conversion should start at page 1, or if it should continue up
589 to the last DVI page, the first or second range number can be
590 omitted, respectively. Example: --page=-10 converts all pages up to
591 page 10, --page=10- converts all pages starting with page 10.
592 Please consider that the page values don’t refer to the page
593 numbers printed on the corresponding page. Instead, the physical
594 page count is expected, where the first page always gets number 1.
595
596 -H, --page-hashes[=params]
597 If this option is given, dvisvgm computes hash values of all pages
598 to be processed. As long as the page contents don’t change, the
599 hash value of that page stays the same. This property can be used
600 to determine whether a DVI page must be converted again or can be
601 skipped in consecutive runs of dvisvgm. This is done by propagating
602 the hash value to variable %hd which can be accessed in the output
603 pattern (see option --output). By default, dvisvgm changes the
604 output pattern to %f-%hd if option --page-hashes is given. As a
605 result, all SVG file names contain the hash value instead of the
606 page number. When calling dvisvgm again with option --page-hashes
607 with the same output pattern, it checks the existence of the SVG
608 file to be created and skips the conversion if it’s already
609 present. This also applies for consecutive calls of dvisvgm with
610 different command-line parameters. If you want to force another
611 conversion of a DVI file that hasn’t changed, you must remove the
612 corresponding SVG files beforehand or add the parameter replace
613 (see below). If you manually set the output pattern to not contain
614 a hash value, the conversion won’t be skipped.
615
616 Alternatively, the output pattern may contain the variables %ho and
617 %hc. %ho expands to a 32-bit hash representing the given
618 command-line options that affect the generated SVG output, like
619 --no-fonts and --precision. Different combinations of options and
620 parameters lead to different hashes. Thus pattern %f-%hd-%ho
621 creates filenames that change depending on the DVI data and the
622 given command-line options. Variable %hc provides a combined hash
623 computed from the DVI data and the command-line options. It has the
624 same length as %hd.
625
626 Since the page number isn’t part of the file name by default,
627 different DVI pages with identical contents get the same file name.
628 Therefore, only the first one is converted while the others are
629 skipped. To create separate files for each page, you can add the
630 page number to the output pattern, e.g. --output="%f-%p-%hc".
631
632 By default, dvisvgm uses the fast XXH64 hash algorithm to compute
633 the values provided through %hd and %hc. 64-bit hashes should be
634 sufficient for most documents with an average size of pages.
635 Alternatively, XXH32 and MD5 can be used as well. The desired
636 algorithm is specified by argument params of option --page-hashes.
637 It takes one of the strings MD5, XXH32, and XXH64, where the names
638 can be given in lower case too, like --page-hashes=md5. Since
639 version 0.7.1, xxHash provides an experimental 128-bit hash
640 function whose algorithm has been stabilized as of version 0.8.
641 When using a version prior to 0.8, the 128-bit hash values can vary
642 depending on the used xxHash version. If the corresponding API is
643 available, dvisvgm supports the new hash function, and option
644 --page-hashes additionally accepts the algorithm specifier XXH128.
645
646 Finally, option --page-hashes can take a second argument that must
647 be separated by a comma. Currently, only the two parameters list
648 and replace are evaluated, e.g. --page-hashes=md5,list or
649 --page-hashes=replace. When list is present, dvisvgm doesn’t
650 perform any conversion but just lists the hash values %hd and %hc
651 of the pages specified by option --page. Parameter replace forces
652 dvisvgm to convert a DVI page even if a file with the target name
653 already exists.
654
655 -P, --pdf
656 If this option is given, dvisvgm does not expect a DVI but a PDF
657 input file, and tries to convert it to SVG. Similar to the
658 conversion of DVI files, only the first page is processed by
659 default. Option --page can be used to select different pages, page
660 ranges, and/or page sequences. The conversion is realized by
661 creating a single pdffile special command which is forwarded to the
662 PostScript special handler. Therefore, this option is only
663 available if dvisvgm was built with PostScript support enabled, and
664 requires Ghostscript to be accessible. See option --libgs for
665 further information.
666
667 -d, --precision=digits
668 Specifies the maximal number of decimal places applied to
669 floating-point attribute values. All attribute values written to
670 the generated SVG file(s) are rounded accordingly. The parameter
671 digits accepts integer values from 0 to 6, where 0 enables the
672 automatic selection of significant decimal places. This is also the
673 default value if dvisvgm is called without option --precision.
674
675 --progress[=delay]
676 Enables a simple progress indicator shown when time-consuming
677 operations like PostScript specials are processed. The indicator
678 doesn’t appear before the given delay (in seconds) has elapsed. The
679 default delay value is 0.5 seconds.
680
681 -r, --rotate=angle
682 Rotates the page content clockwise by angle degrees around the page
683 center. This option is equivalent to -TRangle.
684
685 -R, --relative
686 SVG allows to define graphics paths by a sequence of absolute
687 and/or relative path commands, i.e. each command expects either
688 absolute coordinates or coordinates relative to the current drawing
689 position. By default, dvisvgm creates paths made up of absolute
690 commands. If option --relative is given, relative commands are
691 created instead. This slightly reduces the size of the SVG files in
692 most cases.
693
694 --stdin
695 Tells dvisvgm to read the DVI or EPS input data from stdin instead
696 from a file. Alternatively to option --stdin, a single dash (-) can
697 be given. The default name of the generated SVG file is stdin.svg
698 which can be changed with option --output.
699
700 -s, --stdout
701 Don’t write the SVG output to a file but redirect it to stdout.
702
703 --tmpdir[=path]
704 In some cases, dvisvgm needs to create temporary files to work
705 properly. These files go to the system’s temporary folder by
706 default, e.g. /tmp on Linux systems. Option --tmpdir allows to
707 specify a different location if necessary for some reason. Please
708 note that dvisvgm does not create this folder, so you must ensure
709 that it actually exists before running dvisvgm.
710
711 If the optional parameter path is omitted, dvisvgm prints the
712 location of the system’s temp folder and exits.
713
714 -a, --trace-all=[retrace]
715 This option forces dvisvgm to vectorize not only the glyphs
716 actually required to render the SVG file correctly – which is the
717 default –, but processes all glyphs of all fonts referenced in the
718 DVI file. Because dvisvgm stores the tracing results in a font
719 cache, all following conversions of these fonts will speed up
720 significantly. The boolean option retrace determines how to handle
721 glyphs already stored in the cache. By default, these glyphs are
722 skipped. Setting argument retrace to yes or true forces dvisvgm to
723 retrace the corresponding bitmaps again.
724
725 Note
726 This option only takes effect if font caching is active.
727 Therefore, --trace-all cannot be combined with option
728 --cache=none.
729
730 -T, --transform=commands
731 Applies a sequence of transformations to the SVG content. Each
732 transformation is described by a command beginning with a capital
733 letter followed by a list of comma-separated parameters. Following
734 transformation commands are supported:
735
736 T tx[,ty]
737 Translates (moves/shifts) the page in direction of vector
738 (tx,ty). If ty is omitted, ty=0 is assumed. The expected unit
739 length of tx and ty are TeX points (1pt = 1/72.27in). However,
740 there are several constants defined to simplify the unit
741 conversion (see below).
742
743 S sx[,sy]
744 Scales the page horizontally by sx and vertically by sy. If sy
745 is omitted, sy=sx is assumed.
746
747 R angle[,x,y]
748 Rotates the page clockwise by angle degrees around point (x,y).
749 If the optional arguments x and y are omitted, the page will be
750 rotated around its center depending on the chosen page format.
751 When option -bnone is given, the rotation center is origin
752 (0,0).
753
754 KX angle
755 Skews the page along the x-axis by angle degrees. Argument
756 angle can take any value except 90+180k, where k is an integer.
757
758 KY angle
759 Skews the page along the y-axis by angle degrees. Argument
760 angle can take any value except 90+180k, where k is an integer.
761
762 FH [y]
763 Mirrors (flips) the page at the horizontal line through point
764 (0,y). Omitting the optional argument leads to y=h/2, where h
765 denotes the page height (see pre-defined constants below).
766
767 FV [x]
768 Mirrors (flips) the page at the vertical line through point
769 (x,0). Omitting the optional argument leads to x=w/2, where w
770 denotes the page width (see pre-defined constants below).
771
772 M m1,...,m6
773 Applies a transformation described by the 3×3 matrix
774 ((m1,m2,m3),(m4,m5,m6),(0,0,1)), where the inner triples denote
775 the rows.
776
777 Note
778 All transformation commands of option -T, --transform are
779 applied in the order of their appearance. Multiple commands
780 can optionally be separated by spaces. In this case the
781 whole transformation string has to be enclosed in double
782 quotes to keep them together. All parameters are
783 expressions of floating point type. You can either give
784 plain numbers or arithmetic terms combined by the operators
785 + (addition), - (subtraction), * (multiplication), /
786 (division) or % (modulo) with common associativity and
787 precedence rules. Parentheses may be used as well.
788
789 Additionally, some pre-defined constants are provided:
790
791
792
793 ux horizontal position of
794 upper left page corner in
795 TeX point units
796 uy vertical position of upper
797 left page corner in TeX
798 point units
799 h page height in TeX point
800 units (0 in case of
801 -bnone)
802 w page width in TeX point
803 units (0 in case of
804 -bnone)
805
806 Furthermore, you can use the 9 length constants pt, bp, cm,
807 mm, in, pc, dd, cc, and sp, e.g. 2cm or 1.6in. Thus,
808 option -TT1in,0R45 moves the page content 1 inch to the
809 right and rotates it by 45 degrees around the page center
810 afterwards.
811
812 For single transformations, there are also the short-hand
813 options -c, -t and -r available. In contrast to the
814 --transform commands, the order of these options is not
815 significant, so that it’s not possible to describe
816 transformation sequences with them.
817
818 -t, --translate=tx[,ty]
819 Translates (moves) the page content in direction of vector (tx,ty).
820 This option is equivalent to -TTtx,ty.
821
822 -v, --verbosity=level
823 Controls the type of messages printed during a dvisvgm run:
824
825 0 no message output at all
826 1 error messages only
827 2 warning messages only
828 4 informational messages
829 only
830
831
832 Note
833 By adding these values you can combine the categories. The
834 default level is 7, i.e. all messages are printed.
835
836 -V, --version[=extended]
837 Prints the version of dvisvgm and exits. If the optional argument
838 is set to yes, the version numbers of the linked libraries are
839 printed as well.
840
841 -z, --zip[=level]
842 Creates a compressed SVG file with suffix .svgz. The optional
843 argument specifies the compression level. Valid values are in the
844 range of 1 to 9 (default value is 9). Larger values cause better
845 compression results but may take slightly more computation time.
846
847 -Z, --zoom=factor
848 Multiplies the values of the width and height attributes of the SVG
849 root element by argument factor while the coordinate system of the
850 graphic content is retained. As a result, most SVG viewers zoom the
851 graphics accordingly. If a negative zoom factor is given, the width
852 and height attributes are omitted.
853
855 dvisvgm supports several sets of special commands that can be used to
856 enrich DVI files with additional features, like color, graphics, and
857 hyperlinks. The evaluation of special commands is delegated to
858 dedicated handlers provided by dvisvgm. Each handler is responsible for
859 all special statements of the same command set, i.e. commands beginning
860 with the same prefix. To get a list of the actually provided special
861 handlers, use option --list-specials (see above). This section gives an
862 overview of the special commands currently supported.
863
864 bgcolor
865 Special statement for changing the background/page color. Since SVG
866 1.1 doesn’t support background colors, dvisvgm inserts a rectangle
867 of the chosen color into the generated SVG document. This rectangle
868 always gets the same size as the selected or computed bounding box.
869 This background color command is part of the color special set but
870 is handled separately in order to let the user turn it off. For an
871 overview of the command syntax, see the documentation of dvips, for
872 instance.
873
874 color
875 Statements of this command set provide instructions to change the
876 text/paint color. For an overview of the exact syntax, see the
877 documentation of dvips, for instance.
878
879 dvisvgm
880 dvisvgm offers its own small set of specials. The following list
881 gives a brief overview.
882
883 dvisvgm:raw text
884 Adds an arbitrary sequence of XML nodes to the page section of
885 the SVG document. dvisvgm checks syntax and proper nesting of
886 the inserted elements but does not perform any validation, thus
887 the user has to ensure that the resulting SVG is still valid.
888 Opening and closing tags may be distributed among different raw
889 specials. The tags themselves can also be split but must be
890 continued with the immediately following raw special. Both
891 syntactically incorrect and wrongly nested tags lead to error
892 messages. Parameter text may also contain the expressions {?x},
893 {?y}, {?color}, and {?matrix} that expand to the current x or y
894 coordinate, the current color, and current transformation
895 matrix, respectively. Character sequence {?nl} expands to a
896 newline character. Finally, constructions of the form {?(expr)}
897 enable the evaluation of mathematical expressions which may
898 consist of basic arithmetic operations including modulo. Like
899 above, the variables x and y represent the current coordinates.
900 Example: {?(-10*(x+2y)-5)}.
901
902 dvisvgm:rawdef text
903 This command is similar to dvisvgm:raw, but puts the XML nodes
904 into the <defs> section of the SVG document currently being
905 generated.
906
907 dvisvgm:rawset name ... dvisvgm:endrawset
908 This pair of specials marks the begin and end of a definition
909 of a named raw SVG fragment. All dvisvgm:raw and dvisvgm:rawdef
910 specials enclosed by dvisvgm:rawset and dvisvgm:endrawset are
911 not evaluated immediately but stored together under the given
912 name for later use. Once defined, the named fragment can be
913 referenced throughout the DVI file by dvisvgm:rawput (see
914 below). The two commands dvisvgm:rawset and dvisvgm:endrawset
915 must not be nested, i.e. each call of dvisvgm:rawset has to be
916 followed by a corresponding call of dvisvgm:endrawset before
917 another dvisvgm:rawset may occur. Also, the identifier name
918 must be unique throughout the DVI file. Using dvisvgm:rawset
919 multiple times together with the same name leads to warning
920 messages.
921
922 dvisvgm:rawput name
923 Inserts raw SVG fragments previously stored under the given
924 name. dvisvgm distinguishes between fragments that were
925 specified with dvisvgm:raw or dvisvgm:rawdef, and handles them
926 differently: It inserts all dvisvgm:raw parts every time
927 dvisvgm:rawput is called, whereas the dvisvgm:rawdef portions
928 go to the <defs> section of the current SVG document only once.
929
930 dvisvgm:img width height file
931 Creates an image element at the current graphic position
932 referencing the given file. JPEG, PNG, and SVG images can be
933 used here. However, dvisvgm does not check the file format or
934 the file name suffix. The lengths width and height can be given
935 together with a unit specifier (see option --bbox) or as plain
936 floating point numbers. In the latter case, TeX point units are
937 assumed (1in = 72.27pt).
938
939 dvisvgm:bbox lock
940 Locks the bounding box of the current page and prevents it from
941 further updating, i.e. graphics elements added after calling
942 this special are not taken into account in determining the
943 extent of the bounding box.
944
945 dvisvgm:bbox unlock
946 Unlocks the previously locked bounding box of the current page
947 so that it gets updated again when adding graphics elements to
948 the page.
949
950 dvisvgm:bbox n[ew] name
951 Defines or resets a local bounding box called name. The name
952 may consist of letters and digits. While processing a DVI page,
953 dvisvgm continuously updates the (global) bounding box of the
954 current page in order to determine the minimal rectangle
955 containing all visible page components (characters, images,
956 drawing elements etc.) Additionally to the global bounding box,
957 the user can request an arbitrary number of named local
958 bounding boxes. Once defined, these boxes are updated together
959 with the global bounding box starting with the first character
960 that follows the definition. Thus, the local boxes can be used
961 to compute the extent of parts of the page. This is useful for
962 scenarios where the generated SVG file is post-processed. In
963 conjunction with special dvisvgm:raw, the macro {?bbox name}
964 expands to the four values x, y, w, and h (separated by spaces)
965 specifying the coordinates of the upper left corner, width, and
966 height of the local box name. If box name wasn’t previously
967 defined, all four values equal to zero.
968
969 dvisvgm:bbox width height [depth] [transform]
970 Updates the bounding box of the current page by embedding a
971 virtual rectangle (x, y, width, height) where the lower left
972 corner is located at the current DVI drawing position (x,y). If
973 the optional parameter depth is specified, dvisvgm embeds a
974 second rectangle (x, y, width, -depth). The lengths width,
975 height, and depth can be given together with a unit specifier
976 (see option --bbox) or as plain floating point numbers. In the
977 latter case, TeX point units are assumed (1in = 72.27pt).
978 Depending on size and position of the virtual rectangle, this
979 command either enlarges the overall bounding box or leaves it
980 as is. It’s not possible to reduce its extent. This special
981 should be used together with dvisvgm:raw in order to update the
982 viewport of the page properly. By default, the box extents are
983 assigned unchanged and, in particular, are not altered by
984 transformation commands. In order to apply the current
985 transformation matrix, the optional modifier transform can be
986 added at the end of the special statement.
987
988 dvisvgm:bbox a[bs] x1 y1 x2 y2 [transform]
989 This variant of the bbox special updates the bounding box by
990 embedding a virtual rectangle (x1,y1,x2,y2). The points (x1,y1)
991 and (x2,y2) denote the absolute coordinates of two diagonal
992 corners of the rectangle. As with the relative special variant
993 described above, the optional modifier transform allows for
994 applying the current transformation matrix to the bounding box.
995
996 dvisvgm:bbox f[ix] x1 y1 x2 y2 [transform]
997 This variant of the bbox special assigns an absolute (final)
998 bounding box to the resulting SVG. After executing this
999 command, dvisvgm doesn’t further alter the bounding box
1000 coordinates, except this special is called again later. The
1001 points (x1,y1) and (x2,y2) denote the absolute coordinates of
1002 two diagonal corners of the rectangle. As with the relative
1003 special variant described above, the optional modifier
1004 transform allows for applying the current transformation matrix
1005 to the bounding box.
1006
1007 The following TeX snippet adds two raw SVG elements to the
1008 output and updates the bounding box accordingly:
1009
1010 \special{dvisvgm:raw <circle cx='{?x}' cy='{?y}' r='10' stroke='black' fill='red'/>}%
1011 \special{dvisvgm:bbox 10bp 10bp 10bp transform}%
1012 \special{dvisvgm:bbox -10bp 10bp 10bp transform}
1013
1014 \special{dvisvgm:raw <path d='M50 200 L10 250 H100 Z' stroke='black' fill='blue'/>}%
1015 \special{dvisvgm:bbox abs 10bp 200bp 100bp 250bp transform}
1016
1017 em
1018 These specials were introduced with the emTeX distribution by
1019 Eberhard Mattes. They provide line drawing statements, instructions
1020 for embedding MSP, PCX, and BMP image files, as well as two PCL
1021 commands. dvisvgm supports only the line drawing statements and
1022 ignores all other em specials silently. A description of the
1023 command syntax can be found in the DVI driver documentation coming
1024 with emTeX (https://ctan.org/pkg/emtex).
1025
1026 html
1027 The hyperref specification defines several variants on how to mark
1028 hyperlinked areas in a DVI file. dvisvgm supports the plain
1029 HyperTeX special constructs as created with hyperref package option
1030 hypertex. By default, all linked areas of the document are marked
1031 by a rectangle. Option --linkmark allows to change this behavior.
1032 See above for further details. Information on syntax and semantics
1033 of the HyperTeX specials can be found in the hyperref manual
1034 (https://ctan.org/pkg/hyperref).
1035
1036 papersize
1037 The papersize special, which is an extension introduced by dvips,
1038 can be used to specify the widths and heights of the pages in the
1039 DVI file. It affects the page it appears on as well as all
1040 following pages until another papersize special is found. If there
1041 is more than one papersize special present on a page, dvisvgm
1042 applies the last one. However, in order to stay compatible with
1043 previous versions of dvisvgm that did not evaluate these specials,
1044 their processing must be explicitly enabled by adding option
1045 --bbox=papersize on the command-line. Otherwise, dvisvgm ignores
1046 them and computes tight bounding boxes.
1047
1048 pdf
1049 pdfTeX and dvipdfmx introduced several special commands related to
1050 the generation of PDF files. Currently, only pdf:mapfile,
1051 pdf:mapline, pdf:pagesize, and PDF hyperlink specials are supported
1052 by dvisvgm. The latter are the PDF pendants to the HTML HyperTeX
1053 specials generated by the hyperref package in PDF mode.
1054
1055 pdf:pagesize is similar to the papersize special (see above) which
1056 specifies the size of the current and all folowing pages. In order
1057 to actually apply the extents to the generated SVG files, option
1058 --bbox=papersize must be given.
1059
1060 pdf:mapfile and pdf:mapline allow for modifying the font map tree
1061 while processing the DVI file. They are used by CTeX, for example.
1062 dvisvgm supports both, the dvips and dvipdfm font map format. For
1063 further information on the command syntax and semantics, see the
1064 documentation of \pdfmapfile in the pdfTeX user manual
1065 (https://ctan.org/pkg/pdftex).
1066
1067 ps
1068 The famous DVI driver dvips
1069 (https://www.tug.org/texinfohtml/dvips.html) introduced its own set
1070 of specials in order to embed PostScript code into DVI files, which
1071 greatly improves the capabilities of DVI documents. One aim of
1072 dvisvgm is to completely evaluate all PostScript fragments and to
1073 convert as many of them as possible to SVG. In contrast to dvips,
1074 dvisvgm uses floating point arithmetics to compute the precise
1075 position of each graphic element, i.e. it doesn’t round the
1076 coordinates. Therefore, the relative locations of the graphic
1077 elements may slightly differ from those computed by dvips.
1078
1079 Since PostScript is a rather complex language, dvisvgm does not
1080 implement its own PostScript interpreter but relies on Ghostscript
1081 (https://ghostscript.com) instead. If the Ghostscript library was
1082 not linked to the dvisvgm binary, it is looked up and loaded
1083 dynamically during runtime. In this case, dvisvgm looks for
1084 libgs.so.X on Unix-like systems (supported ABI versions: 7,8,9),
1085 for libgs.X.dylib on macOS, and for gsdll32.dll or gsdll64.dll on
1086 Windows. You can override the default file names with environment
1087 variable LIBGS or the command-line option --libgs. The library must
1088 be reachable through the ld search path (*nix) or the PATH
1089 environment variable (Windows). Alternatively, the absolute file
1090 path can be specified. If the library cannot be found, dvisvgm
1091 disables the processing of PostScript specials and prints a warning
1092 message. Use option --list-specials to check whether PostScript
1093 support is available, i.e. entry ps is present.
1094
1095 The PostScript handler also recognizes and evaluates bounding box
1096 data generated by the preview package
1097 (https://ctan.org/pkg/preview) with option tightpage. If such data
1098 is present in the DVI file and if dvisvgm is called with option
1099 --bbox=preview, dvisvgm sets the width and total height of the SVG
1100 file to the values derived from the preview data. Additionally, it
1101 prints a message showing the width, height, and depth of the box in
1102 TeX point units to the console. Especially, the depth value can be
1103 read by a post-processor to vertically align the SVG graphics with
1104 the baseline of surrounding text in HTML or XSL-FO documents, for
1105 example. Please note that SVG bounding boxes are defined by a width
1106 and (total) height. In contrast to TeX, SVG provides no means to
1107 differentiate between height and depth, i.e. the vertical extents
1108 above and below the baseline, respectively. Therefore, it is
1109 generally not possible to retrieve the depth value from the SVG
1110 file itself.
1111
1112 If you call dvisvgm with option --bbox=min (the default) and
1113 preview data is present in the DVI file, dvisvgm doesn’t apply the
1114 preview extents but computes a bounding box that tightly encloses
1115 the page contents. The height, depth and width values written to
1116 console are adapted accordingly.
1117
1118 tpic
1119 The TPIC special set defines instructions for drawing simple
1120 geometric objects. Some LaTeX packages, like eepic and tplot, use
1121 these specials to describe graphics.
1122
1124 dvisvgm file
1125 Converts the first page of file.dvi to file.svg.
1126
1127 dvisvgm -p1-5 file
1128 Converts the first five pages of file.dvi to
1129 file-1.svg,...,file-5.svg.
1130
1131 dvisvgm -p1- file
1132 Converts all pages of file.dvi to separate SVG files.
1133
1134 dvisvgm -p1,3 -O file
1135 Converts the first and third page of file.dvi to optimized SVG
1136 files.
1137
1138 dvisvgm - < file.dvi
1139 Converts the first page of file.dvi to stdin.svg where the contents
1140 of file.dvi is read from stdin.
1141
1142 dvisvgm -z file
1143 Converts the first page of file.dvi to file.svgz with default
1144 compression level 9.
1145
1146 dvisvgm -p5 -z3 -ba4-l -o newfile file
1147 Converts the fifth page of file.dvi to newfile.svgz with
1148 compression level 3. The bounding box is set to DIN/ISO A4 in
1149 landscape format.
1150
1151 dvisvgm --transform="R20,w/3,2h/5 T1cm,1cm S2,3" file
1152 Converts the first page of file.dvi to file.svg where three
1153 transformations are applied.
1154
1156 dvisvgm uses the kpathsea library for locating the files that it opens.
1157 Hence, the environment variables described in the library’s
1158 documentation influence the converter.
1159
1160 If dvisvgm was linked without the Ghostscript library, and if
1161 PostScript support has not been disabled, the shared Ghostscript
1162 library is looked up during runtime via dlopen(). The environment
1163 variable LIBGS can be used to specify path and file name of the
1164 library.
1165
1166 The pre-compiled Windows versions of dvisvgm require a working
1167 installation of MiKTeX 2.9 or above. dvisvgm does not work together
1168 with the portable edition of MiKTeX because it relies on MiKTeX’s COM
1169 interface that is only accessible in a local installation. To enable
1170 the evaluation of PostScript specials, the original Ghostscript DLL
1171 gsdll32.dll must be present and reachable through the search path.
1172 64-bit Windows builds require the 64-bit Ghostscript DLL gsdll64.dll.
1173 Both DLLs come with the corresponding Ghostscript installers available
1174 from https://ghostscript.com.
1175
1176 The environment variable DVISVGM_COLORS specifies the colors used to
1177 highlight various parts of dvisvgm’s message output. It is only
1178 evaluated if option --color is given. The value of DVISVGM_COLORS is a
1179 list of colon-separated entries of the form gg=BF, where gg denotes one
1180 of the color group indicators listed below, and BF are two hexadecimal
1181 digits specifying the background (first digit) and foreground/text
1182 color (second digit). The color values are defined as follows: 0=black,
1183 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=gray, 8=bright
1184 red, 9=bright green, A=bright yellow, B=bright blue, C=bright magenta,
1185 D=bright cyan, E=bright gray, F=white. Depending on the terminal, the
1186 colors may differ. Rather than changing both the text and background
1187 color, it’s also possible to change only one of them: An asterisk (*)
1188 in place of a hexadecimal digit indicates the default text or
1189 background color of the terminal.
1190
1191 All malformed entries in the list are silently ignored.
1192
1193
1194 er error messages
1195
1196 wn warning messages
1197
1198 pn messages about page
1199 numbers
1200
1201 ps page size messages
1202
1203 fw information about the
1204 files written
1205
1206 sm state messages
1207
1208 tr messages of the glyph
1209 tracer
1210
1211 pi progress indicator
1212
1213
1214 Example: er=01:pi=*5 sets the colors of error messages (er) to red (1)
1215 on black (0), and those of progress indicators (pi) to cyan (5) on
1216 default background (*).
1217
1219 The location of the following files is determined by the kpathsea
1220 library. To check the actual kpathsea configuration you can use the
1221 kpsewhich utility.
1222
1223
1224 *.enc Font encoding files
1225
1226 *.fgd Font glyph data files
1227 (cache files created by
1228 dvisvgm)
1229
1230 *.map Font map files
1231
1232 *.mf Metafont input files
1233
1234 *.pfb PostScript Type 1 font
1235 files
1236
1237 *.pro PostScript header/prologue
1238 files
1239
1240 *.tfm TeX font metric files
1241
1242 *.ttf TrueType font files
1243
1244 *.vf Virtual font files
1245
1246
1248 tex(1), mf(1), mktexmf(1), grodvi(1), potrace(1), and the kpathsea
1249 library info documentation.
1250
1252 Project home page
1253 https://dvisvgm.de
1254
1255 Code repository
1256 https://github.com/mgieseki/dvisvgm
1257
1259 Please report bugs using the bug tracker at GitHub
1260 (https://github.com/mgieseki/dvisvgm/issues).
1261
1263 Written by Martin Gieseking <martin.gieseking@uos.de>
1264
1266 Copyright © 2005-2021 Martin Gieseking. Free use of this software is
1267 granted under the terms of the GNU General Public License (GPL) version
1268 3 or, (at your option) any later version.
1269
1270
1271
1272dvisvgm 2.11.1 2021-01-03 DVISVGM(1)