no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | latex:tikz:svg [2020/06/10 21:43] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 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 ===== | ||
+ | * generate an image, an small example (balls.tex) is shown below | ||
+ | | ||
+ | \documentclass{minimal} | ||
+ | \usepackage{tikz} | ||
+ | \begin{document} | ||
+ | \centering | ||
+ | \begin{tikzpicture} | ||
+ | \foreach \x/ | ||
+ | \shade [ball color=\color] (\x,\y) circle (\x/\y); | ||
+ | \end{tikzpicture} | ||
+ | \end{document} | ||
+ | | ||
+ | |||
+ | * compile this document to {{: | ||
+ | * import said pdf into [[http:// | ||
+ | * save as {{: | ||
+ | * import document.svg into [[http:// | ||
+ | * save as {{: | ||
+ | |||
+ | ===== the hard way ===== | ||
+ | The hard way actually looks much easier, but in my experience doesn' | ||
+ | |||
+ | * use a special pgfsysdriver in the preamble of the document((taken from [[http:// | ||
+ | |||
+ | \documentclass{minimal} | ||
+ | \def\pgfsysdriver{pgfsys-tex4ht.def} | ||
+ | \usepackage{tikz} | ||
+ | \begin{document} | ||
+ | \centering | ||
+ | \begin{tikzpicture} | ||
+ | \foreach \x/ | ||
+ | \shade [ball color=\color] (\x,\y) circle (\x/\y); | ||
+ | \end{tikzpicture} | ||
+ | \end{document} | ||
+ | |||
+ | * if you're using graphics with TikZ (for example for [[scalebar|scale bars]], then also declare the graphics-extension. | ||
+ | |||
+ | \usepackage{graphicx} | ||
+ | \DeclareGraphicsExtensions{.png} % I prefer .png to .eps... | ||
+ | |||
+ | * use [[http:// | ||
+ | * open resulting {{: | ||
+ | | ||
+ | |||