table of contents
DVISVGM(1) | dvisvgm Manual | DVISVGM(1) |
NAME¶
dvisvgm - converts DVI, EPS, and PDF files to the XML-based SVG format
SYNOPSIS¶
dvisvgm [options] file[.dvi]
dvisvgm --eps [options] file1[.eps] file2[.eps] ...
dvisvgm --pdf [options] file[.pdf]
DESCRIPTION¶
The command-line utility dvisvgm converts DVI files, as generated by TeX/LaTeX, to the XML-based scalable vector graphics format SVG. It supports the classic DVI version 2 as well as version 3 (created by pTeX in vertical mode), and the XeTeX versions 5 to 7 which are also known as XDV. Besides the basic DVI commands, dvisvgm also evaluates many so-called specials which heavily extend the capabilities of the plain DVI format. For a more detailed overview, see section Supported Specials below.
Since the current SVG standard 1.1 doesn’t specify multi-page graphics, dvisvgm creates separate SVG files for each DVI page. Because of compatibility reasons, only the first page is converted by default. In order to select a different page or arbitrary page sequences, use option -p which is described below.
SVG is a vector-based graphics format and therefore dvisvgm tries to convert the glyph outlines of all fonts referenced in a DVI page section to scalable path descriptions. The fastest way to achieve this is to extract the path information from vector-based font files available in PFB, TTF, or OTF format. If dvisvgm is able to find such a file, it extracts all necessary outline information about the glyphs from it.
However, TeX’s main source for font descriptions is Metafont, which produces bitmap output (GF files). That’s why not all obtainable TeX fonts are available in a scalable format. In these cases, dvisvgm tries to vectorize Metafont’s output by tracing the glyph bitmaps. The results are not as perfect as most (manually optimized) PFB or OTF counterparts, but are nonetheless really nice in most cases.
When running dvisvgm without option --no-fonts, it creates font elements (<font>...</font>) to embed the font data into the SVG files. Unfortunately, only few SVG renderers support these elements yet. Most web browsers and vector graphics applications don’t evaluate them properly so that the text components of the resulting graphics might look strange. In order to create more compatible SVG files, command-line option --no-fonts can be given to replace the font elements by plain graphics paths. Most web browsers (but only few external SVG renderers) also support WOFF and WOFF2 fonts that can be used instead of the default SVG fonts. Option --font-format offers the functionality to change the format applied to the fonts being embedded. This, however, only works when converting DVI files. Text present in PDF and PostScript files is always converted to path elements.
OPTIONS¶
dvisvgm provides a POSIX-compliant command-line interface with short and long option names. They may be given before and/or after the name of the file to be converted. Also, the order of specifying the options is not significant, i.e. you can add them in any order without changing dvisvgm’s behavior. Certain options accept or require additional parameters which are directly appended to or separated by whitespace from a short option (e.g. -v0 or -v 0). Long options require an additional equals sign (=) between option name and argument but without any surrounding whitespace (e.g. --verbosity=0). Multiple short options that don’t expect a further parameter can be combined after a single dash (e.g. -ejs rather than -e -j -s).
Long option names may also be shortened by omitting trailing characters. As long as the shortened name is unambiguous, it’s recognized and applied. For example, option --exact-bbox can be shortened to --exact, --exa, or --ex. In case of an ambiguous abbreviation, dvisvgm prints an error message together with all matching option names.
-b, --bbox=fmt
Parameter fmt takes either one of the format specifiers listed below, or a sequence of four comma- or whitespace-separated length values x1, y1, x2 and y2. The latter define the absolute coordinates of two diagonal corners of the bounding box. Each length value consists of a floating point number and an optional length unit (pt, bp, cm, mm, in, pc, dd, cc, or sp). If the unit is omitted, TeX points (pt) are assumed.
It’s also possible to give only one length value l. In this case, the minimal bounding box is computed and enlarged by adding (-l,-l) to the upper left and (l,l) to the lower right corner.
Additionally, dvisvgm also supports the following format specifiers:
International DIN/ISO paper sizes
North American paper sizes
Special bounding box sizes
dvi | page size stored in the DVI file |
min | computes the minimal/tightest bounding box |
none | no bounding box is assigned |
papersize | box sizes specified by papersize specials present in the DVI file |
preview | bounding box data computed by the preview package (if present in the DVI file) |
Page orientation
Note
Option -b, --bbox only affects the bounding box and does not transform the page content. Hence, if you choose a landscape format, the page won’t be rotated.
-B, --bitmap-format=fmt
none | disable processing of bitmap images |
jpeg | color JPEG format |
jpeggray | grayscale JPEG format |
png | grayscale or 24-bit color PNG format depending on current color space |
pnggray | grayscale PNG format |
pngmono | black-and-white PNG format |
pngmonod | dithered black-and-white PNG format |
png16 | 4-bit color PNG format |
png256 | 8-bit color PNG format |
png16m | 24-bit color PNG format |
Since the collection of supported output devices can vary among local Ghostscript installations, not all formats may be available in some environments. dvisvgm quits with a PostScript error message if the selected output format requires a locally unsupported output device.
The two JPEG format specifiers accept an optional parameter to set the IJG quality level which must directly follow the format specifier separated by a colon, e.g. --bitmap-format=jpeg:50. The quality value is an integer between 0 and 100. Higher values result in better image quality but lower compression rates and therefore larger files. The default quality level is 75 which is applied if no quality parameter is given or if it’s set to 0.
-C, --cache[=dir]
-j, --clipjoin
--color
--colornames
--comments
--currentcolor[=color]
The optional argument of --currentcolor specifies the RGB color value to be replaced and must be given as either six or three digit hex color value (https://www.w3.org/TR/css-color/#typedef-hex-color) preceded by character #, e.g. #0000ff or #00f for blue. If the optional argument is omitted, black is assumed.
--embed-bitmaps
This option only affects bitmaps referenced in DVI/XDV files, e.g. by \includegraphics or special command dvisvgm:img (see below). Bitmaps present in PostScript or PDF files are always embedded. Also see option bitmap-format.
-E, --eps
-e, --exact-bbox
This option only affects the processing of DVI files. When converting EPS or PDF files, the bounding box information stored in these files are used to derive the SVG bounding box.
-f, --font-format=format
Following formats are supported: SVG (that’s the default), TTF (TrueType), WOFF, and WOFF2 (Web Open Font Format version 1 and 2). By default, dvisvgm creates unhinted fonts that might look bad on low-resolution devices. In order to improve the display quality, the generated TrueType, WOFF, or WOFF2 fonts can be autohinted. The autohinter is enabled by appending ,autohint or ,ah to the font format, e.g. --font-format=woff,autohint or --fwoff,ah. This functionality requires the ttfautohint library (https://freetype.org/ttfautohint). If it’s not available or can’t be found, dvisvgm issues a corresponding warning message.
Option --font-format is only available if dvisvgm was built with WOFF support enabled.
-m, --fontmap=filenames
By default, redefined mappings do not replace previous ones. However, each filename can be preceded by an optional mode specifier (+, -, or =) to change this behavior:
+mapfile
-mapfile
=mapfile
If the first filename in the filename sequence is preceded by a mode specifier, dvisvgm loads the default font map (see above) and applies the other map files afterwards. Otherwise, none of default map files will be loaded automatically.
Examples: --fontmap=myfile1.map,+myfile2.map loads myfile1.map followed by myfile2.map where all redefinitions of myfile2.map are ignored. --fontmap==myfile1.map,-myfile2.map loads the default map file followed by myfile1.map and myfile2.map where all redefinitions of myfile1.map replace previous entries. Afterwards, all definitions for the fonts given in myfile2.map are removed from the font map tree.
For further information about the map file formats and the mode specifiers, see the manuals of dvips (https://tug.org/texinfohtml/dvips.html) and dvipdfm (https://ctan.org/tex-archive/dviware/dvipdfm).
dvisvgm supports both the dvips and the dvipdfm map file formats. It extends both variants by two include statements that allow for loading other map files inside a map file. The syntax is as follows:
#include [<modechar>] <filename|filepath> #includefirst [<modechar>] <filename|filepath>
They must be placed on a separate line and start at the first column of that line. Otherwise, they are ignored. While the first variant always tries to include the specified file, #includefirst is only executed once, i.e. once a file was successfully included by this statement, all subsequent #includefirst lines are skipped. This can be used to include one of several alternative files, whereby the first one found is loaded and all others are ignored.
The optional parameter <modechar> (which can be +, -, or =) determines how to integrate the data read from the included file into the already present mapping data. They work the same way as the mode specifiers described above. If <modechar> parameter is omitted, it defaults to +.
The following filename or file path specifies the file to include. In case of plain filenames (without path indicators), the files are looked up using the TeX file search functionality, i.e. files in the TeX directory tree can easily be added. Relative paths are relative to the location of the file containing the #include statement. Path components must be separated by forward slashes (/), also on Windows systems.
Examples: #include pdftex.map looks for pdftex.map in the current working directory and in the TeX directory tree. #include ./pdftex.map, on the other hand, looks for pdftex.map only in the directory where the including file is located.
--grad-overlap
--grad-segments=number
Currently, dvisvgm supports free- and lattice-form triangular patch meshes as well as Coons and tensor-product patch meshes. They are approximated by subdividing the area of each patch into a n×n grid of smaller segments. The maximal number of segments per column and row can be changed with option --grad-segments.
--grad-simplify=delta
-h, --help[=mode]
A values in brackets after the description text indicate the default parameter of the option. They are applied if an option with a mandatory parameter is not used or if an optional parameter is omitted. For example, option --bbox requires a size parameter which defaults to min if --bbox is not used. Option --zip, which isn’t applied by default, accepts an optional compression level parameter. If it’s omitted, the stated default value 9 is used.
--keep
--libgs=path
Alternatively, it’s also possible to assign the path to environment variable LIBGS, e.g. export LIBGS=/usr/local/lib/libgs.so.9 or set LIBGS=\gs\gs9.25\bin\gsdll63.dll. LIBGS has less precedence than the command-line option, i.e. dvisvgm ignores variable LIBGS if --libgs is given.
-L, --linkmark=style
Moreover, argument style can take a single color specifier to highlight the linked region by a frameless box filled with that color. An optional second color specifier separated by a colon selects the frame color.
Examples: box:red or box:#ff0000 draws red boxes around the linked areas. yellow:blue creates yellow filled rectangles with blue frames.
-l, --list-specials
-M, --mag=factor
--message=text
The output of option --message is not affected by the specified verbosity level, i.e. it prints the text even with --verbosity=0.
--no-merge
--no-mktexmf
-n, --no-fonts[=variant]
-c, --scale=sx[,sy]
-S, --no-specials[=names]
--no-styles
-O, --optimize[=modules]
The following list describes the currently available optimizer modules.
list
none
all
collapse-groups
group-attributes
reassign-clippaths
remove-clippaths
simplify-text
simplify-transform
-o, --output=pattern
An optional number (0-9) specified directly after the percent sign of a variable holding a numeric value denotes the minimal number of digits to be created. If a particular value consists of less digits, the number is padded with leading zeros. Example: %3p enforces 3 digits for the current page number (001, 002, etc.). Without an explicit width specifier, %p gets the same number of digits as %P.
If you need more control over the numbering, you can use arithmetic expressions as part of the pattern. The syntax is %(expr) where expr may contain additions, subtractions, multiplications, and integer divisions with common precedence. The variables p and P contain the current page number and the total number of pages, respectively. For example, --output="%f-%(p-1)" creates filenames where the numbering starts with 0 rather than 1.
The variables %hX contain different hash values computed from the DVI page data and the options given on the command-line. %hd and %hc are only set if option --page-hashes is present. Otherwise, they are empty. For further information, see the description of option --page-hashes below.
The default pattern is %f-%p.svg if the DVI file consists of more than one page, and %f.svg otherwise. That means, a DVI file foo.dvi is converted to foo.svg if foo.dvi is a single-page document. Otherwise, multiple SVG files foo-01.svg, foo-02.svg, etc. are produced. In Windows environments, the percent sign indicates dereferenced environment variables, and must therefore be protected by a second percent sign, e.g. --output=%%f-%%p.
-p, --page=ranges
In order to stay compatible with previous versions, the default page sequence is 1. dvisvgm therefore converts only the first page and not the whole document if option --page is omitted. Usually, page ranges consist of two numbers denoting the first and last page to be converted. If the conversion should start at page 1, or if it should continue up to the last DVI page, the first or second range number can be omitted, respectively. Example: --page=-10 converts all pages up to page 10, --page=10- converts all pages starting with page 10. Please consider that the page values don’t refer to the page numbers printed on the corresponding page. Instead, the physical page count is expected, where the first page always gets number 1.
At the end of the range sequence an optional filter specifier can be added. Currently, the two filters :even and :odd are supported which restrict the preceding values to even or odd numbers. For example, --page=1-11,20:even is equivalent to --page=2,4,6,8,10,20.
-H, --page-hashes[=params]
Alternatively, the output pattern may contain the variables %ho and %hc. %ho expands to a 32-bit hash representing the given command-line options that affect the generated SVG output, like --no-fonts and --precision. Different combinations of options and parameters lead to different hashes. Thus pattern %f-%hd-%ho creates filenames that change depending on the DVI data and the given command-line options. Variable %hc provides a combined hash computed from the DVI data and the command-line options. It has the same length as %hd.
Since the page number isn’t part of the file name by default, different DVI pages with identical contents get the same file name. Therefore, only the first one is converted while the others are skipped. To create separate files for each page, you can add the page number to the output pattern, e.g. --output="%f-%p-%hc".
By default, dvisvgm uses the fast XXH64 hash algorithm to compute the values provided through %hd and %hc. 64-bit hashes should be sufficient for most documents with an average size of pages. Alternatively, XXH32 and MD5 can be used as well. The desired algorithm is specified by argument params of option --page-hashes. It takes one of the strings MD5, XXH32, and XXH64, where the names can be given in lower case too, like --page-hashes=md5. Since version 0.7.1, xxHash provides an experimental 128-bit hash function whose algorithm has been stabilized as of version 0.8. When using a version prior to 0.8, the 128-bit hash values can vary depending on the used xxHash version. If the corresponding API is available, dvisvgm supports the new hash function, and option --page-hashes additionally accepts the algorithm specifier XXH128.
Finally, option --page-hashes can take a second argument that must be separated by a comma. Currently, only the two parameters list and replace are evaluated, e.g. --page-hashes=md5,list or --page-hashes=replace. When list is present, dvisvgm doesn’t perform any conversion but just lists the hash values %hd and %hc of the pages specified by option --page. Parameter replace forces dvisvgm to convert a DVI page even if a file with the target name already exists.
-P, --pdf
If a Ghostcript version < 10.01.0 is found, dvisvgm uses Ghostscript to process the PDF file. In this case, the conversion is realized by creating a single pdffile special command which is forwarded to dvisvgm’s PostScript special handler. Therefore, this option is only available if dvisvgm was built with PostScript support enabled, and requires Ghostscript to be accessible. See option --libgs for further information.
As of Ghostscript 10.01.0, this will no longer work due to the introduction of a new PDF interpreter. Therefore, an alternative conversion module based on mutool, a utility which is part of the MuPDF (https://mupdf.com) package, has been introduced. It’s automatically invoked if Ghostscript can’t be used and if a working mutool executable is present in a directory which is part of the system’s search path.
Alternatively, environment variable DVISVGM_PDF_PROC can be used to select the PDF processor. The currently supported values are gs and mutool.
-d, --precision=digits
--progress[=delay]
-r, --rotate=angle
-R, --relative
--stdin
-s, --stdout
--tmpdir[=path]
In order to prevent colliding files caused by parallel calls of dvisvgm, the program doesn’t write the files directly in the specified directory but furthermore creates a uniquely named subfolder in there, where the temporary files will be placed. This can be prevented by appending // or \\ (on Windows) to the specified directory name. For example, --tmpdir=.// creates the temporary files directly in the current working directory, while --tmpdir=. places them in a dedicated subfolder of the current working directory.
If the optional parameter path of option --tmpdir is omitted, dvisvgm prints the location of the system’s temp folder and exits.
-a, --trace-all=[retrace]
Note
This option only takes effect if font caching is active. Therefore, --trace-all cannot be combined with option --cache=none.
-T, --transform=commands
T tx[,ty]
S sx[,sy]
R angle[,x,y]
KX angle
KY angle
FH [y]
FV [x]
M m1,...,m6
Note
All transformation commands of option -T, --transform are applied in the order of their appearance. Multiple commands can optionally be separated by spaces. In this case the whole transformation string has to be enclosed in double quotes to keep them together. All parameters are expressions of floating point type. You can either give plain numbers or arithmetic terms combined by the operators + (addition), - (subtraction), * (multiplication), / (division) or % (modulo) with common associativity and precedence rules. Parentheses may be used as well.
Additionally, some pre-defined constants are provided:
ux | horizontal position of upper left page corner in TeX point units |
uy | vertical position of upper left page corner in TeX point units |
h | page height in TeX point units (0 in case of -bnone) |
w | page width in TeX point units (0 in case of -bnone) |
Furthermore, you can use the 9 length constants pt, bp, cm, mm, in, pc, dd, cc, and sp, e.g. 2cm or 1.6in. Thus, option -TT1in,0R45 moves the page content 1 inch to the right and rotates it by 45 degrees around the page center afterwards.
For single transformations, there are also the short-hand options -c, -t and -r available. In contrast to the --transform commands, the order of these options is not significant, so that it’s not possible to describe transformation sequences with them.
-t, --translate=tx[,ty]
-v, --verbosity=level
0 | no message output at all |
1 | error messages only |
2 | warning messages only |
4 | informational messages only |
8 | user messages only (e.g. created by special dvisvgm:message) |
Note
By adding these values you can combine the categories. The default level is 15, i.e. all messages are printed.
-V, --version[=extended]
-z, --zip[=level]
-Z, --zoom=factor
SUPPORTED SPECIALS¶
dvisvgm supports several special commands that enrich the DVI command set with additional instructions for features, like color, graphics, and hyperlinks. The term special command, or just special, originates from the TeX command \special{...} which does almost nothing. TeX only forwards the argument of this command to the DVI file using the corresponding xxx opcode, thus delegating its execution to the DVI driver. The driver can then decide to either process or ignore it, depending on the supported statements. The parameter of TeX’s \special command is given in curly braces and may consist of an arbitrary character sequence representing the actual instruction, for example color Red.
It might be worth mentioning that specials are only evaluated when processing DVI files. PS/EPS and PDF don’t know anything about the concept of specials and therefore don’t provide means to represent them.
In order to evaluate the special commands, dvisvgm implements several dedicated handlers. Each handler is responsible for all special statements belonging to the same command set, i.e. commands usually – but not necessarily – beginning with a common prefix. For example, all PDF specials start with the prefix pdf:, while the TPIC special set consists of 13 different commands without common identifier. The PDF specials are processed by dvisvgm’s pdf handler, the TPIC ones by the tpic handler. To get a list of the actually provided special handlers, use option --list-specials (see above). The following list gives an overview of the special sets currently supported. The names of the handlers can also be used to disable the processing of individual sets of specials. For further information on this, see option --no-specials.
bgcolor
color
dvisvgm extends the dvips syntax of the color specials by two optional modifiers to enable the differentiation between fill and stroke colors, i.e. colors used to fill enclosed areas and to draw lines, respectively. If one of the color specifiers, like a color name or a color model followed by a sequence of color components, is preceded by fill or stroke, only the corresponding color is changed. Without these modifiers both colors are affected. Example: color push fill rgb 1 0 1 pushes a new color pair onto the color stack whereby the fill color is set to magenta and the stroke color retains its current value. color push rgb 1 0 1 pushes a color pair with both colors set to magenta.
Additionally, the new special color set is introduced. Its syntax is the same as the one of color push including the optional fill and stroke modifiers. Instead of pushing a new color pair it modifies the topmost one on the stack. If the color stack is empty, the default (black) fill/stroke color is changed.
dvisvgm
dvisvgm:raw text
Parameter text may also contain the expressions {?x}, {?y}, {?color}, {?fillcolor}, {?strokecolor}, {?matrix}, {?pageno}, {?svgfile}, and {?svgpath} that respectively expand to the current x and y coordinate, an RGB hex string of the current active fill and stroke color, the current transformation matrix, the current page number, and the relative and absolute path of the SVG file being created. {?color} expands to the same string as {?fillcolor} and is still available for compatibility with older dvisvgm versions that didn’t distinguish between fill and stroke colors (see information about color specials below).
As SVG doesn’t support CMYK colors, e.g. in fill and stroke attributes, dvisvgm provides macro {?cmyk(c,m,y,k)} to create an RGB hex string from a CMYK color. It can be used instead of a combination of color/PostScript specials and color macros to directly insert a CMYK color value.
Character sequence {?nl} expands to a newline character. Finally, constructions of the form {?(expr)} enable the evaluation of mathematical expressions which may consist of basic arithmetic operations including modulo. Like above, the variables x and y represent the current coordinates. Example: {?(-10*(x+2y)-5)}.
dvisvgm:rawdef text
dvisvgm:rawset name ... dvisvgm:endrawset
dvisvgm:rawput name
dvisvgm:img width height file
Parameter file can be a plain filename or a relative or absolute path of a file. By default, dvisvgm just creates links referencing the image file so that the SVG renderer will evaluate the filename or path relative to the location of the generated SVG file. If option --embed-bitmaps is given, JPEG and PNG images are embedded into the SVG document. As this requires base64-encoding of the image data, the resulting SVG files can become quite big.
dvisvgm:bbox lock
dvisvgm:bbox unlock
dvisvgm:bbox n[ew] name
dvisvgm:bbox width height [depth] [transform]
dvisvgm:bbox a[bs] x1 y1 x2 y2 [transform]
dvisvgm:bbox f[ix] x1 y1 x2 y2 [transform]
The following TeX snippet adds two raw SVG elements to the output and updates the bounding box accordingly:
\special{dvisvgm:raw <circle cx='{?x}' cy='{?y}' r='10' stroke='black' fill='red'/>}% \special{dvisvgm:bbox 10bp 10bp 10bp transform}% \special{dvisvgm:bbox -10bp 10bp 10bp transform} \special{dvisvgm:raw <path d='M50 200 L10 250 H100 Z' stroke='black' fill='blue'/>}% \special{dvisvgm:bbox abs 10bp 200bp 100bp 250bp transform}
dvisvgm:currentcolor [on|off]
dvisvgm:message msg
em
html
papersize
pdf:pagesize is similar to the papersize special (see above) which specifies the size of the current and all following pages. In order to actually apply the extents to the generated SVG files, option --bbox=papersize must be given.
pdf:mapfile and pdf:mapline allow for modifying the font map tree while processing the DVI file. They are used by CTeX, for example. dvisvgm supports both, the dvips and dvipdfm font map format. For further information on the command syntax and semantics, see the documentation of \pdfmapfile in the pdfTeX user manual (https://ctan.org/pkg/pdftex).
ps
Since PostScript is a rather complex language, dvisvgm does not implement its own PostScript interpreter but relies on Ghostscript (https://ghostscript.com) instead. If the Ghostscript library was not linked to the dvisvgm binary, it is looked up and loaded dynamically during runtime. In this case, dvisvgm looks for libgs.so.X on Unix-like systems (supported ABI versions: 7,8,9), for libgs.X.dylib on macOS, and for gsdll32.dll or gsdll64.dll on Windows. You can override the default file names with environment variable LIBGS or the command-line option --libgs. The library must be reachable through the ld search path (*nix) or the PATH environment variable (Windows). Alternatively, the absolute file path can be specified. If the library cannot be found, dvisvgm disables the processing of PostScript specials and prints a warning message. Use option --list-specials to check whether PostScript support is available, i.e. entry ps is present.
The PostScript handler also recognizes and evaluates bounding box data generated by the preview package (https://ctan.org/pkg/preview) with option tightpage. If such data is present in the DVI file and if dvisvgm is called with option --bbox=preview, dvisvgm sets the width and total height of the SVG file to the values derived from the preview data. Additionally, it prints a message showing the width, height, and depth of the box in TeX point units to the console. Especially, the depth value can be read by a post-processor to vertically align the SVG graphics with the baseline of surrounding text in HTML or XSL-FO documents, for example. Please note that SVG bounding boxes are defined by a width and (total) height. In contrast to TeX, SVG provides no means to differentiate between height and depth, i.e. the vertical extents above and below the baseline, respectively. Therefore, it is generally not possible to retrieve the depth value from the SVG file itself.
If you call dvisvgm with option --bbox=min (the default) and preview data is present in the DVI file, dvisvgm doesn’t apply the preview extents but computes a bounding box that tightly encloses the page contents. The height, depth and width values written to console are adapted accordingly.
tpic
EXAMPLES¶
dvisvgm file
dvisvgm -p1-5 file
dvisvgm -p1- file
dvisvgm -p1,3 -O file
dvisvgm - < file.dvi
dvisvgm -z file
dvisvgm -p5 -z3 -ba4-l -o newfile file
dvisvgm --transform="R20,w/3,2h/5 T1cm,1cm S2,3" file
ENVIRONMENT¶
dvisvgm uses the kpathsea library for locating the files that it opens. Hence, the environment variables described in the library’s documentation influence the converter.
If dvisvgm was linked without the Ghostscript library, and if PostScript support has not been disabled, the shared Ghostscript library is looked up during runtime via dlopen(). The environment variable LIBGS can be used to specify path and file name of the library.
The pre-compiled Windows versions of dvisvgm require a working installation of MiKTeX 2.9 or above. dvisvgm does not work together with the portable edition of MiKTeX because it relies on MiKTeX’s COM interface that is only accessible in a local installation. To enable the evaluation of PostScript specials, the original Ghostscript DLL gsdll32.dll must be present and reachable through the search path. 64-bit Windows builds require the 64-bit Ghostscript DLL gsdll64.dll. Both DLLs come with the corresponding Ghostscript installers available from https://ghostscript.com.
The environment variable DVISVGM_COLORS specifies the colors used to highlight various parts of dvisvgm’s message output. It is only evaluated if option --color is given. The value of DVISVGM_COLORS is a list of colon-separated entries of the form gg=BF, where gg denotes one of the color group indicators listed below, and BF are two hexadecimal digits specifying the background (first digit) and foreground/text color (second digit). The color values are defined as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=gray, 8=bright red, 9=bright green, A=bright yellow, B=bright blue, C=bright magenta, D=bright cyan, E=bright gray, F=white. Depending on the terminal, the colors may differ. Rather than changing both the text and background color, it’s also possible to change only one of them: An asterisk (*) in place of a hexadecimal digit indicates the default text or background color of the terminal.
All malformed entries in the list are silently ignored.
er | error messages |
wn | warning messages |
pn | messages about page numbers |
ps | page size messages |
fw | information about the files written |
sm | state messages |
tr | messages of the glyph tracer |
pi | progress indicator |
Example: er=01:pi=*5 sets the colors of error messages (er) to red (1) on black (0), and those of progress indicators (pi) to cyan (5) on default background (*).
Variable DVISVGM_PDF_PROC allows you to select the desired PDF processor. dvisvgm requires either Ghostscript (version < 10.01.0) or mutool to process PDF files. IF DVISVGM_PDF_PROC is not set, dvisvgm tries to detect the available processors. See option --pdf for further information. To select a specific PDF processor, you can set DVISVGM_PDF_PROC to gs or mutool which forces the use of Ghostscript and mutool respectively.
FILES¶
The location of the following files is determined by the kpathsea library. To check the actual kpathsea configuration you can use the kpsewhich utility.
*.enc | Font encoding files |
*.fgd | Font glyph data files (cache files created by dvisvgm) |
*.map | Font map files |
*.mf | Metafont input files |
*.pfb | PostScript Type 1 font files |
*.pro | PostScript header/prologue files |
*.tfm | TeX font metric files |
*.ttf | TrueType font files |
*.vf | Virtual font files |
SEE ALSO¶
tex(1), mf(1), mktexmf(1), grodvi(1), potrace(1), and the kpathsea library info documentation.
RESOURCES¶
Project home page
Code repository
BUGS¶
Please report bugs using the bug tracker at GitHub (https://github.com/mgieseki/dvisvgm/issues).
AUTHOR¶
Written by Martin Gieseking <martin.gieseking@uos.de>
COPYING¶
Copyright © 2005-2024 Martin Gieseking. Free use of this software is granted under the terms of the GNU General Public License (GPL) version 3 or, (at your option) any later version.
2024-04-30 | dvisvgm 3.4.1 |