Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to be able to convert a TikZ picture written in LaTeX, into an SVG file which I could load up in Inkscape, for some "tweaking". I have read the threads

How can I produce a .svg file from a TikZ diagram?

Maintaining layout of Tikz diagrams with TeX4ht (converting as single pictures)

but I have been unable to get a solution working. In particular, the following solution code to get TikZ to produce an svg file itself via the "tex4ht" option doesn't work for me:

\documentclass{article}
\def\pgfsysdriver{pgfsys-tex4ht.def}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path (0,0) node[draw] (A) {A};
\path (2,0) node[draw] (B) {B};
\draw (A) -- (B) node[midway,above = 0 em] {via};
\end{tikzpicture}
\end{document}

I get the following error from pdfLaTeX:

Undefined control sequence.  
\pgfsys@beginicture -> EndP \HtmlParOff ...
share|improve this question
2  
You can compile your tikz command to produce a pdf file and then you can open it with Inkscape. –  Sigur Feb 1 at 15:01
    
Ok, but this mangles up the text, and math. –  Bruce Bartlett Feb 1 at 16:08
    
Well, if you have the fonts installed on your system to be used within Inkscape, no problem. I do this here. I can use, for example, cmr (Computer Modern Roman). –  Sigur Feb 1 at 16:14
    
Ok thanks, how can I do that? Specifically, for Computer Modern Roman and the math fonts? –  Bruce Bartlett Feb 1 at 18:15
1  
Here's my answer to a similar question. This approach converts to .ps which I think Inkscape should open just fine. –  jlv Feb 2 at 4:15

1 Answer 1

You cannot compile this document with pdflatex, you have to use some of tex4ht tools, like htlatex, for example.

Try this:

htlatex filename
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.