Table of Contents

Converting images from TikZ to SVG

The route from TikZ to SVG helps to programmatically draw images which can then be given to the boss for further perusal.

the easy way

\documentclass{minimal}

\usepackage{tikz}
\begin{document}
\centering
\begin{tikzpicture}
  \foreach \x/\y/\color in {1/2/red,3/4/green,5/6/blue}
    \shade [ball color=\color] (\x,\y) circle (\x/\y);
\end{tikzpicture}
\end{document}

the hard way

The hard way actually looks much easier, but in my experience doesn't always work, expecially for complicated figures. One advantage is that the resulting .svg-files are much nicer (e.g. shading fully works…)

\documentclass{minimal}
\def\pgfsysdriver{pgfsys-tex4ht.def}
\usepackage{tikz}
\begin{document}
\centering
\begin{tikzpicture}
  \foreach \x/\y/\color in {1/2/red,3/4/green,5/6/blue}
  \shade [ball color=\color] (\x,\y) circle (\x/\y);
\end{tikzpicture}
\end{document}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.png} % I prefer .png to .eps...
1)
taken from here, which was linked from the PGF-mailing list [if I remember correctly…]