### Standard Build from Source Source: https://context7.com/mgieseki/dvisvgm/llms.txt Build dvisvgm from source using autotools. Ensure prerequisites like a C++11 compiler and necessary libraries are installed. ```bash # Prerequisites: C++11 compiler, autoconf, automake, pkg-config # Required libraries: FreeType, kpathsea, zlib # Optional: Ghostscript, potrace, brotli, woff2, xxhash # Generate configure script (if not present) autoreconf -fi # Configure with system libraries ./configure # Configure with bundled libraries (brotli, potrace, woff2, xxhash) ./configure --enable-bundled-libs # Build make # Run tests make check # Install (as root) make install # Or with sudo sudo make install ``` -------------------------------- ### Display version and help information Source: https://context7.com/mgieseki/dvisvgm/llms.txt Access version details and categorized help documentation. ```bash # Show version dvisvgm --version # Show extended version with library info dvisvgm --version=yes # Output includes: clipper, freetype, potrace, xxhash, zlib, # Ghostscript, mutool, brotli, kpathsea versions # Show help dvisvgm --help # Show help organized by categories dvisvgm --help=0 # Show help sorted by short options dvisvgm --help=1 # Show help sorted by long options dvisvgm --help=2 ``` -------------------------------- ### Configure dvisvgm execution options Source: https://context7.com/mgieseki/dvisvgm/llms.txt Basic command-line flags for tracing, progress tracking, and font magnification. ```bash dvisvgm --trace-all=yes document.dvi dvisvgm --progress document.dvi dvisvgm --progress=1.0 document.dvi # 1 second delay before showing dvisvgm --mag=10 document.dvi ``` -------------------------------- ### Standard Build Source: https://context7.com/mgieseki/dvisvgm/llms.txt Build dvisvgm from source using the autotools build system. ```APIDOC ## Building from Source: Standard Build ### Description Build dvisvgm from source using the autotools build system. ### Prerequisites C++11 compiler, autoconf, automake, pkg-config Required libraries: FreeType, kpathsea, zlib Optional: Ghostscript, potrace, brotli, woff2, xxhash ### Steps 1. Generate configure script (if not present): ```bash autoreconf -fi ``` 2. Configure with system libraries: ```bash ./configure ``` Or configure with bundled libraries: ```bash ./configure --enable-bundled-libs ``` 3. Build: ```bash make ``` 4. Run tests: ```bash make check ``` 5. Install: ```bash make install ``` Or with sudo: ```bash sudo make install ``` ``` -------------------------------- ### Configuration Options Source: https://context7.com/mgieseki/dvisvgm/llms.txt Customize the build with various configure options. ```APIDOC ## Building from Source: Configuration Options ### Description Customize the build with various configure options. ### Options - Specify library locations: ```bash ./configure --with-kpathsea=/usr/local ./configure --with-freetype=/opt/freetype ./configure --with-zlib=/usr/local ``` - Enable ttfautohint support for font hinting: ```bash ./configure --with-ttfautohint ./configure --with-ttfautohint=/path/to/ttfautohint ``` - Disable WOFF support: ```bash ./configure --disable-woff ``` - Disable manual page generation: ```bash ./configure --disable-manpage ``` - Use bundled libraries: ```bash ./configure --enable-bundled-libs ``` - Show all options: ```bash ./configure --help ``` ``` -------------------------------- ### Runtime Configuration via Environment Variables Source: https://context7.com/mgieseki/dvisvgm/llms.txt Configure dvisvgm behavior through environment variables. ```APIDOC ## Environment Variables: Runtime Configuration ### Description Configure dvisvgm behavior through environment variables. ### Variables - **LIBGS**: Specify Ghostscript library location. ```bash # Linux/macOS export LIBGS=/usr/local/lib/libgs.so.9 export LIBGS=/opt/gs/lib/libgs.so.10 # Windows set LIBGS=C:\gs\gs9.50\bin\gsdll64.dll ``` - **DVISVGM_PDF_PROC**: Select PDF processor (gs or mutool). ```bash export DVISVGM_PDF_PROC=mutool export DVISVGM_PDF_PROC=gs ``` - **DVISVGM_COLORS**: Colorize console output. Format: `group=BF` where B=background, F=foreground. Groups: `er`=error, `wn`=warning, `pn`=page number, `ps`=page size, `fw`=file written, `sm`=state, `tr`=tracer, `pi`=progress. Colors: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=gray, 8-F=bright variants. Use `*` for default color. ```bash export DVISVGM_COLORS="er=01:wn=03:pn=*2:ps=*4" ``` - **XDG_CACHE_HOME**: Set cache directory. The cache will be located at: `$XDG_CACHE_HOME/dvisvgm/`. ```bash export XDG_CACHE_HOME=/custom/cache/path ``` ``` -------------------------------- ### Manage incremental conversion with page hashing Source: https://context7.com/mgieseki/dvisvgm/llms.txt Use page hashing to skip unchanged pages or force reconversion during builds. ```bash # Enable page hashing (skips unchanged pages) dvisvgm --page-hashes document.dvi # Output: document-.svg # Include page number in output filename dvisvgm --page-hashes --output="%f-%p-%hc" document.dvi # List page hashes without converting dvisvgm --page-hashes=list document.dvi dvisvgm --page-hashes=md5,list document.dvi # Force reconversion even if file exists dvisvgm --page-hashes=replace document.dvi # Select hash algorithm dvisvgm --page-hashes=xxh32 document.dvi # 32-bit xxHash dvisvgm --page-hashes=xxh64 document.dvi # 64-bit xxHash (default) dvisvgm --page-hashes=xxh128 document.dvi # 128-bit xxHash dvisvgm --page-hashes=md5 document.dvi # MD5 hash ``` -------------------------------- ### Convert DVI to SVG Source: https://context7.com/mgieseki/dvisvgm/llms.txt Basic commands for converting DVI files to SVG, including output naming and stdin/stdout usage. ```bash # Convert first page of a DVI file to SVG dvisvgm document.dvi # Output: document.svg # Convert with explicit output filename dvisvgm -o output.svg document.dvi # Read from stdin and output to stdout dvisvgm --stdin -s < document.dvi > output.svg ``` -------------------------------- ### Configure Build Options Source: https://context7.com/mgieseki/dvisvgm/llms.txt Customize the dvisvgm build using various configure options. This includes specifying library locations, enabling/disabling features, and using bundled libraries. ```bash # Specify library locations ./configure --with-kpathsea=/usr/local ./configure --with-freetype=/opt/freetype ./configure --with-zlib=/usr/local ``` ```bash # Enable ttfautohint support for font hinting ./configure --with-ttfautohint ./configure --with-ttfautohint=/path/to/ttfautohint ``` ```bash # Disable WOFF support ./configure --disable-woff ``` ```bash # Disable manual page generation ./configure --disable-manpage ``` ```bash # Use bundled libraries ./configure --enable-bundled-libs ``` ```bash # Show all options ./configure --help ``` -------------------------------- ### Convert Multiple Pages Source: https://context7.com/mgieseki/dvisvgm/llms.txt Commands for selecting specific page ranges or patterns during DVI to SVG conversion. ```bash # Convert pages 1-5 to separate SVG files dvisvgm -p1-5 document.dvi # Output: document-1.svg, document-2.svg, ..., document-5.svg # Convert all pages dvisvgm -p1- document.dvi # Convert specific pages (1, 3, 5-10) dvisvgm -p1,3,5-10 document.dvi # Convert only even pages from range 1-20 dvisvgm -p1-20:even document.dvi # Convert only odd pages dvisvgm -p1-20:odd document.dvi # Use custom output pattern with page numbers dvisvgm -p1- --output="output/page-%3p.svg" document.dvi # Output: output/page-001.svg, output/page-002.svg, ... # Use arithmetic expressions in page selection dvisvgm --page="%(P-2)-" document.dvi # Convert last 3 pages ``` -------------------------------- ### Configure Runtime via Environment Variables Source: https://context7.com/mgieseki/dvisvgm/llms.txt Set environment variables to configure dvisvgm's runtime behavior, such as specifying library paths, PDF processors, color output, and cache directories. ```bash # Specify Ghostscript library location export LIBGS=/usr/local/lib/libgs.so.9 export LIBGS=/opt/gs/lib/libgs.so.10 ``` ```bash # Windows set LIBGS=C:\gs\gs9.50\bin\gsdll64.dll ``` ```bash # Select PDF processor (gs or mutool) export DVISVGM_PDF_PROC=mutool export DVISVGM_PDF_PROC=gs ``` ```bash # Colorize console output export DVISVGM_COLORS="er=01:wn=03:pn=*2:ps=*4" # Format: group=BF where B=background, F=foreground # Groups: er=error, wn=warning, pn=page number, ps=page size, # fw=file written, sm=state, tr=tracer, pi=progress # Colors: 0=black, 1=red, 2=green, 3=yellow, 4=blue, # 5=magenta, 6=cyan, 7=gray, 8-F=bright variants # Use * for default color ``` ```bash # Set cache directory export XDG_CACHE_HOME=/custom/cache/path # Cache will be at: $XDG_CACHE_HOME/dvisvgm/ ``` -------------------------------- ### Configure font mapping Source: https://context7.com/mgieseki/dvisvgm/llms.txt Specify map files and modes for font resolution during conversion. ```bash # Use default map files (dvisvgm.map, ps2pk.map, pdftex.map, etc.) dvisvgm document.dvi # Use specific map file dvisvgm --fontmap=myfonts.map document.dvi # Use multiple map files dvisvgm --fontmap=file1.map,file2.map document.dvi # Mode specifiers for map files: # + Add entries (don't override existing) - default # = Replace existing entries # - Remove entries # Add to default maps dvisvgm --fontmap=+myfonts.map document.dvi # Replace entries from default maps dvisvgm --fontmap==myfonts.map document.dvi # Remove entries after loading defaults dvisvgm --fontmap=-unwanted.map document.dvi ``` -------------------------------- ### Caching and Performance Options Source: https://context7.com/mgieseki/dvisvgm/llms.txt Configure font caching behavior, including setting custom cache directories, disabling caching, and tracing glyphs to populate the cache. ```bash dvisvgm --cache ``` ```bash dvisvgm --cache=/path/to/cache document.dvi ``` ```bash dvisvgm --cache=none document.dvi ``` ```bash dvisvgm --trace-all document.dvi ``` -------------------------------- ### Bounding Box Control Specials Source: https://context7.com/mgieseki/dvisvgm/llms.txt Control the bounding box computation programmatically using special commands. ```APIDOC ## Bounding Box Control Specials ### Description Control the bounding box computation programmatically. ### Method Special Commands ### Endpoint N/A ### Parameters N/A ### Request Example ```latex % Lock bounding box (stop updating) \special{dvisvgm:bbox lock} % Unlock bounding box (resume updating) \special{dvisvgm:bbox unlock} % Define a named local bounding box \special{dvisvgm:bbox new mybox} % Update bounding box with dimensions (at current position) \special{dvisvgm:bbox 50bp 30bp} % width, height \special{dvisvgm:bbox 50bp 30bp 10bp} % width, height, depth % Apply transformation to bbox update \special{dvisvgm:bbox 50bp 30bp transform} % Set absolute bounding box coordinates \special{dvisvgm:bbox abs 10bp 10bp 100bp 200bp} % Set fixed/final bounding box \special{dvisvgm:bbox fix 0bp 0bp 200bp 300bp} % Access local bounding box in raw special \special{dvisvgm:raw } ``` ### Response N/A ``` -------------------------------- ### SVG Optimization with dvisvgm Source: https://context7.com/mgieseki/dvisvgm/llms.txt Optimize SVG output for reduced file size and improved structure using various modules. Use -O as a shorthand for --optimize. ```bash dvisvgm --optimize document.dvi ``` ```bash dvisvgm -O document.dvi ``` ```bash dvisvgm --optimize=list ``` ```bash dvisvgm --optimize=collapse-groups document.dvi ``` ```bash dvisvgm --optimize=group-attributes,simplify-transform document.dvi ``` ```bash dvisvgm --optimize=all,-collapse-groups document.dvi ``` ```bash dvisvgm -O-collapse-groups document.dvi ``` ```bash dvisvgm --optimize=none document.dvi ``` -------------------------------- ### Color and Styling Options in SVG Source: https://context7.com/mgieseki/dvisvgm/llms.txt Customize color representation and add comments to the SVG output. Embed bitmaps directly instead of using references. ```bash dvisvgm --colornames document.dvi ``` ```bash dvisvgm --currentcolor document.dvi ``` ```bash dvisvgm --currentcolor=#ff0000 document.dvi ``` ```bash dvisvgm --currentcolor=#00f document.dvi ``` ```bash dvisvgm --comments document.dvi ``` ```bash dvisvgm --embed-bitmaps document.dvi ``` -------------------------------- ### Configure Font Handling Source: https://context7.com/mgieseki/dvisvgm/llms.txt Options for embedding fonts in SVG, including format selection and path conversion. ```bash # Default: embed fonts as SVG fonts dvisvgm document.dvi # Convert fonts to paths (no font elements) dvisvgm --no-fonts document.dvi # Use path elements with USE elements for efficiency dvisvgm --no-fonts=0 document.dvi # Use path elements without USE elements dvisvgm --no-fonts=1 document.dvi # Embed fonts as TrueType dvisvgm --font-format=ttf document.dvi # Embed fonts as WOFF (Web Open Font Format) dvisvgm --font-format=woff document.dvi # Embed fonts as WOFF2 (compressed) dvisvgm --font-format=woff2 document.dvi # Enable font autohinting for better rendering dvisvgm --font-format=woff,autohint document.dvi dvisvgm --font-format=woff2,ah document.dvi # Disable CSS styles (inline font references) dvisvgm --no-styles document.dvi ``` -------------------------------- ### Apply Transformations to DVI Source: https://context7.com/mgieseki/dvisvgm/llms.txt Control geometric transformations like rotation, scaling, and translation. Transformations can be combined sequentially. ```bash dvisvgm --rotate=45 document.dvi ``` ```bash dvisvgm --scale=2 document.dvi ``` ```bash dvisvgm --scale=1.5,2 document.dvi ``` ```bash dvisvgm --translate=1cm,2cm document.dvi ``` ```bash dvisvgm --transform="R20,w/3,2h/5 T1cm,1cm S2,3" document.dvi ``` ```bash dvisvgm --transform="R45 T10,10 S0.5" document.dvi ``` -------------------------------- ### Control SVG Output and Compression Source: https://context7.com/mgieseki/dvisvgm/llms.txt Generate compressed SVGZ files and direct output to stdout. Control compression level and zoom factor. ```bash dvisvgm --zip document.dvi ``` ```bash dvisvgm --zip=6 document.dvi ``` ```bash dvisvgm --stdout document.dvi > output.svg ``` ```bash dvisvgm --stdout --zip document.dvi > output.svgz ``` ```bash dvisvgm --zoom=2 document.dvi ``` ```bash dvisvgm --zoom=-1 document.dvi ``` -------------------------------- ### Configure Bounding Box Source: https://context7.com/mgieseki/dvisvgm/llms.txt Options for controlling the bounding box of the generated SVG output. ```bash # Use minimal/tight bounding box (default) dvisvgm --bbox=min document.dvi # Use DIN/ISO paper sizes dvisvgm --bbox=a4 document.dvi # A4 portrait dvisvgm --bbox=a4-landscape document.dvi # A4 landscape dvisvgm --bbox=letter document.dvi # US Letter # Use exact coordinates (x1,y1,x2,y2 in TeX points) dvisvgm --bbox="0,0,300,400" document.dvi # Enlarge minimal bounding box by margin dvisvgm --bbox=5mm document.dvi # Add 5mm margin # Use bounding box from DVI file dvisvgm --bbox=dvi document.dvi # Use preview package data dvisvgm --bbox=preview document.dvi # No bounding box dvisvgm --bbox=none document.dvi ``` -------------------------------- ### Message Output Specials Source: https://context7.com/mgieseki/dvisvgm/llms.txt Print custom messages during conversion. ```APIDOC ## Message Output Specials ### Description Print custom messages during conversion. ### Method Special Commands ### Endpoint N/A ### Parameters N/A ### Request Example ```latex % Print message to console \special{dvisvgm:message Converting page {?pageno}...} % Use with other macros \special{dvisvgm:message Output file: {?svgfile}} ``` ### Response N/A ``` -------------------------------- ### Output Custom Messages Source: https://context7.com/mgieseki/dvisvgm/llms.txt Print custom messages to the console during the conversion process. These can be used for debugging or providing information. ```latex % Print message to console \special{dvisvgm:message Converting page {?pageno}...} ``` ```latex % Use with other macros \special{dvisvgm:message Output file: {?svgfile}} ``` -------------------------------- ### Convert EPS to SVG Source: https://context7.com/mgieseki/dvisvgm/llms.txt Commands for converting Encapsulated PostScript files to SVG using Ghostscript. ```bash # Convert single EPS file dvisvgm --eps figure.eps # Output: figure.svg # Convert multiple EPS files dvisvgm --eps figure1.eps figure2.eps figure3.eps # Output: figure1.svg, figure2.svg, figure3.svg # Convert EPS with custom output dvisvgm --eps -o converted.svg figure.eps ``` -------------------------------- ### PostScript Special Handling and Graphics Source: https://context7.com/mgieseki/dvisvgm/llms.txt Manage the processing of PostScript specials, including disabling specific handlers and configuring gradient approximation. Set bitmap formats for embedded images. ```bash dvisvgm document.dvi ``` ```bash dvisvgm --no-specials document.dvi ``` ```bash dvisvgm --no-specials=ps document.dvi ``` ```bash dvisvgm --no-specials=color document.dvi ``` ```bash dvisvgm --no-specials=ps,html document.dvi ``` ```bash dvisvgm --list-specials ``` ```bash dvisvgm --grad-segments=50 document.dvi ``` ```bash dvisvgm --grad-overlap document.dvi ``` ```bash dvisvgm --grad-simplify=0.5 document.dvi ``` ```bash dvisvgm --bitmap-format=png document.dvi ``` ```bash dvisvgm --bitmap-format=jpeg:90 document.dvi ``` -------------------------------- ### Convert PDF to SVG Source: https://context7.com/mgieseki/dvisvgm/llms.txt Commands for converting PDF documents to SVG, with options to specify the PDF processor. ```bash # Convert first page of PDF dvisvgm --pdf document.pdf # Output: document.svg # Convert all pages of PDF dvisvgm --pdf -p1- document.pdf # Convert specific pages from PDF dvisvgm --pdf -p1,3,5 document.pdf # Force specific PDF processor export DVISVGM_PDF_PROC=mutool dvisvgm --pdf document.pdf ``` -------------------------------- ### Control Bounding Box Computation Source: https://context7.com/mgieseki/dvisvgm/llms.txt Use special commands to lock, unlock, define, update, or set bounding boxes programmatically. These commands are inserted directly into LaTeX or DVI files. ```latex % Lock bounding box (stop updating) \special{dvisvgm:bbox lock} ``` ```latex % Unlock bounding box (resume updating) \special{dvisvgm:bbox unlock} ``` ```latex % Define a named local bounding box \special{dvisvgm:bbox new mybox} ``` ```latex % Update bounding box with dimensions (at current position) \special{dvisvgm:bbox 50bp 30bp} % width, height ``` ```latex \special{dvisvgm:bbox 50bp 30bp 10bp} % width, height, depth ``` ```latex % Apply transformation to bbox update \special{dvisvgm:bbox 50bp 30bp transform} ``` ```latex % Set absolute bounding box coordinates \special{dvisvgm:bbox abs 10bp 10bp 100bp 200bp} ``` ```latex % Set fixed/final bounding box \special{dvisvgm:bbox fix 0bp 0bp 200bp 300bp} ``` ```latex % Access local bounding box in raw special \special{dvisvgm:raw } ``` -------------------------------- ### Embed Images with Bounding Box Updates Source: https://context7.com/mgieseki/dvisvgm/llms.txt Insert images into the document, which will automatically update the bounding box. Supported formats include PNG, JPEG, and SVG. ```latex % Insert image at current position \special{dvisvgm:img 5cm 3cm myimage.png} ``` -------------------------------- ### Define and use named SVG fragments Source: https://context7.com/mgieseki/dvisvgm/llms.txt Create reusable SVG fragments that can be inserted multiple times in the document. ```latex % Define a named fragment \special{dvisvgm:rawset myshape} \special{dvisvgm:raw } \special{dvisvgm:raw } \special{dvisvgm:raw } \special{dvisvgm:endrawset} % Use the fragment later (can be called multiple times) \special{dvisvgm:rawput myshape} ``` -------------------------------- ### Image Embedding Specials Source: https://context7.com/mgieseki/dvisvgm/llms.txt Insert images with automatic bounding box updates. ```APIDOC ## Image Embedding Specials ### Description Insert images with automatic bounding box updates. ### Method Special Commands ### Endpoint N/A ### Parameters N/A ### Request Example ```latex % Insert image at current position \special{dvisvgm:img 5cm 3cm myimage.png} % Image parameters: width height filename % Supported formats: PNG, JPEG, SVG % Position: lower-left corner at current graphic position ``` ### Response N/A ``` -------------------------------- ### Color Specials Source: https://context7.com/mgieseki/dvisvgm/llms.txt Use extended color specials with fill/stroke differentiation. ```APIDOC ## Color Specials ### Description Use extended color specials with fill/stroke differentiation. ### Method Special Commands ### Endpoint N/A ### Parameters N/A ### Request Example ```latex % Standard color push \special{color push rgb 1 0 0} % Push red for both fill and stroke % Extended: set only fill color \special{color push fill rgb 0 1 0} % Push green fill only % Extended: set only stroke color \special{color push stroke rgb 0 0 1} % Push blue stroke only % Set color without pushing (modify current) \special{color set rgb 1 1 0} % Set yellow \special{color set fill cmyk 0 1 1 0} % Set fill to red (CMYK) % Pop color \special{color pop} % Enable currentColor replacement \special{dvisvgm:currentcolor on} \special{dvisvgm:currentcolor off} ``` ### Response N/A ``` -------------------------------- ### Hyperlink Styling in SVG Source: https://context7.com/mgieseki/dvisvgm/llms.txt Control the visual appearance of hyperlinks in the generated SVG. Options range from no marker to boxes, lines, or filled backgrounds with custom colors. ```bash dvisvgm document.dvi ``` ```bash dvisvgm --linkmark=none document.dvi ``` ```bash dvisvgm --linkmark=line document.dvi ``` ```bash dvisvgm --linkmark=box:red document.dvi ``` ```bash dvisvgm --linkmark=box:#00ff00 document.dvi ``` ```bash dvisvgm --linkmark=yellow document.dvi ``` ```bash dvisvgm --linkmark=yellow:blue document.dvi ``` -------------------------------- ### Embed raw SVG via TeX specials Source: https://context7.com/mgieseki/dvisvgm/llms.txt Insert raw SVG elements or definitions directly into the output using LaTeX special commands. ```latex % In your LaTeX document: % Insert raw SVG element at current position \special{dvisvgm:raw } % Available macros in raw specials: % {?x} - Current x coordinate % {?y} - Current y coordinate % {?color} - Current fill color (RGB hex) % {?fillcolor} - Current fill color % {?strokecolor} - Current stroke color % {?matrix} - Current transformation matrix % {?pageno} - Current page number % {?svgfile} - Relative path to SVG file % {?svgpath} - Absolute path to SVG file % {?nl} - Newline character % {?(expr)} - Evaluate math expression % Example: Draw a rectangle with computed position \special{dvisvgm:raw } % Add to SVG defs section \special{dvisvgm:rawdef } % Use CMYK color conversion \special{dvisvgm:raw } ``` -------------------------------- ### Extended Color Specials Source: https://context7.com/mgieseki/dvisvgm/llms.txt Manage colors for fill and stroke independently using extended color specials. Colors can be pushed onto a stack or set directly. ```latex % Standard color push \special{color push rgb 1 0 0} % Push red for both fill and stroke ``` ```latex % Extended: set only fill color \special{color push fill rgb 0 1 0} % Push green fill only ``` ```latex % Extended: set only stroke color \special{color push stroke rgb 0 0 1} % Push blue stroke only ``` ```latex % Set color without pushing (modify current) \special{color set rgb 1 1 0} % Set yellow ``` ```latex \special{color set fill cmyk 0 1 1 0} % Set fill to red (CMYK) ``` ```latex % Pop color \special{color pop} ``` ```latex % Enable currentColor replacement \special{dvisvgm:currentcolor on} ``` ```latex \special{dvisvgm:currentcolor off} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.