Generate SVG Graphics

There are three popular approaches to synthesizing technical drawings: asymptote, TikZ/PGF, and PSTricks. None of them are perfect; each has its own strengths and weaknesses. asymptote is known for its 2D and 3D capabilities while the other two has better integration with LaTex. However, 3D support can be added through packages like tikz-3dplot, pst-3dplot, and pst-solides3d. The following will focus on asymptote due to the author’s background in computer graphics.

Asymptote makes use of font styles in the TeX Live packages and outputs Encapsulated PostScript (eps). In order to convert these files into Scalable Vector Graphics (svg), one can use epstopdf followed by pdf2svg. Although the documentation is sparse, there are lots of accompanying examples: tutorial, piprime, marris, and gallery.

sudo apt-get install asymptote
sudo apt-get install texlive texlive-pictures texlive-latex-extra
sudo apt-get install texlive-font-utils #solely for epstopdf
sudo apt-get install pdf2svg

The following examples are attempts at trying to use TikZ/PGF before switching to asymptote.

../../../../_images/grid.svg

Fig. 6 Grid [asy] [tikz]

  • Cylindrical Coordinates [asy] [tikz]

  • Spherical Coordinates [asy] [tikz]