[Tex/LaTex] LaTeX: outputting a “tight” svg

svg

Concise Problem Statement

Given an input of a *.tex (LaTeX) file, I want to output a "tight" *.svg file.
By "tight", I mean a svg file that does not show the full page — rather, just the rendered TeX file with a minimal border around it.

Context

I have some LaTeX math equations that I would like to convert into svg. I do not want the svg files to be full 8.5×11 pages. I want my svg files to be the size of the bounding box of my math equations.

I would prefer a full automated, command line solution (i.e. no interactive editing in an external program.)

Thanks!

Best Answer

I think dvisvgm does exactly what you're looking for. It converts DVI files to SVG with tight bounding boxes. The tool is also part of TeX Live 2010 and above.