CTAN Comprehensive TeX Archive Network

Directory support/tikztosvg

README.md

tikztosvg(1)

The tikztosvg(1) command renders TikZ diagrams to SVG, using Live and pdf2svg.

Usage

$ tikztosvg [OPTION]... INPUT_PATH

If INPUT_PATH is set to - the input will be read from stdin.

Options

-o, --output=OUTPUT_PATH Write output to file OUTPUT_PATH. If set to - the output will be written to stdout. Defaults to the base name of the input file suffixed with the .svg extension. The file is resolved relative to the working directory.

-p, --package=+PACKAGE Include \usepackage{PACKAGE} when rendering the diagram. The tikz, tikz-cd, pgfplots, amsmath and amssymb packages are always included by default.

-l, --library=+LIBRARY Include \usetikzlibrary{LIBRARY} when rendering the diagram.

-q, --quiet Silence application log messages and script warnings.

--lualatex Use Lua as the engine. Lua is already the default, so this option doesn't really do much.

--xelatex Use as the engine.

--pdflatex Use pdf as the engine.

-h, --help Print a help message.

-v, --version Print version information.

Example

Let’s say you want to convert the file example.tikz to SVG

\begin{tikzcd}
                  G \arrow{r}{\varphi} \arrow[two heads]{d} & H \\
  \mathlarger{\sfrac{G}{\ker \varphi}} \arrow[dotted]{ru}   &
\end{tikzcd}

You could achieve this by running

$ # xfrac and relsize are only there so that we can 
$ # call \sfrac and \mathlarger
$ tikztosvg -p xfrac -p relsize example.tikz

The results will be stored in the file example.svg.

Dependencies

  • A regular Live installation: you'll need Lua and optionally and pdf
  • pdf2svg

Installation

The tikztosvg(1) command and it’s man page can be installed in Unix systems via Git by running

$ git clone https://git.sr.ht/~pablo-pie/tikztosvg
$ cd tikztosvg
$ sudo make install

The BIN_TARGET Make variable (defaults to /usr/bin/) controls the directory the binary is installed in, while the MAN_TARGET Make variable (defaults to /usr/share/man/man1/) controls the directory the man page is installed in.

Resources

Git source repository on sourcehut: https://git.sr.ht/~pablo-pie/tikztosvg

Bug tracker: https://todo.sr.ht/~pablo-pie/tikztosvg

CTAN package: https://www.ctan.org/pkg/tikztosvg

Live https://tug.org/texlive/

Lua http://luatex.org/

http://xetex.sourceforge.net/

pdf https://www.tug.org/applications/pdftex/

Authors

tikztosvg was written by Pablo.

pdf2svg was written by David Barton and Matthew Flaschen.

License

© 2021 Pablo.

Free use of this software is granted under the terms of the GPL-3.0 License.

Download the contents of this package in one zip archive (190.9k).

tikztosvg – A utility for rendering TikZ diagrams to SVG

This package provides a shell script that calls and pdf2svg to convert TikZ environments to SVG files.

Packagetikztosvg
Home pagehttps://git.sr.ht/~pablo-pie/tikztosvg
Supporthttps://todo.sr.ht/~pablo-pie/tikztosvg
Bug trackerhttps://lists.sr.ht/~pablo-pie/tikztosvg
Announcementshttps://lists.sr.ht/~pablo-pie/tikztosvg
Repositoryhttps://git.sr.ht/~pablo-pie/tikztosvg
Developershttps://lists.sr.ht/~pablo-pie/tikztosvg
Version0.3.0
LicensesGNU General Public License, version 3
Copyright2021 Pablo
Maintainerpablo
Contained inTeX Live as tikztosvg
MiKTeX as tikztosvg
TopicsConvert other
Graphics
PGF TikZ
...
Guest Book Sitemap Contact Contact Author