How can I generate an SVG image from a LaTeX file - more precisely, a tikz diagram? I'm working in Windows.
One method is (assuming you have a working LaTeX installation) to compile the LaTeX diagram to produce a pdf output file (usually using
This can then be opened using the vector graphics editor Inkscape. Inkscape can import a range of files, including pdf (using the poppler libraries) and can save them as SVG files. (Inkscape also provides command-line conversion capabilities but I don't know whether this is available on a Microsoft Windows system).
The simplest way to do so would be to first generate a PDF or DVI with just the said diagram/equation and then convert it to a vector format.
If small page-size PDFs work fine for you, then you can use * Use ghostscript:
Otherwise, use any of the methods described at: http://stackoverflow.com/questions/10288065/convert-pdf-to-clean-svg
Also, this answer for multiple pages: http://stackoverflow.com/a/4502030
This resource is useful as well: svgkit.sourceforge.net/SVGLaTeX.html
Of course, some of the mentioned commands would work fine with using MinGW implementations or will have native Windows implementations, which you'll have to download. And of course, then add the executable file's directory to the PATH variable environment (available in the advanced settings in the computer properties). For inkscape, see this link: http://kaioa.com/node/42#inkcl_bat_usage Here,you just place a batch file (InkCL.bat)in the inkscape directory. and use it instead of typing inkscape in the command-line. inkcl
To sum it up, it is generally requires just 3 commands
I'm using Linux but I think this will work on any platform with TeX and TikZ/PGF. I've only used it to create SVG of a TikZ picture in an otherwise empty document but it looks like you could use this to make html with SVG graphics of a large document. This solution comes from page 110 of the pgfmanual.
If you have more TikZ pictures I assume they would become logoname-2.svg and so on.
I'm able to look at the SVG output in firefox and inkscape so it seems to produce good results
You might want to check out a tool I just wrote: tikz2svg.
I recommend the process mentioned by @Rohan. Create a dosbatchfile first, "miktex_path.bat" as:
Then edit a .tex file with some equation with your favourite editor like Texmaker or Notepad2. Save it like Sample.tex. Double-click the batch and on the console
do as follows:
The job is done.
Here is a collection of some equation contained in one page: