# Export/convert/externalize tikzpicture as LaTeX (picture) code?

I have seen "32.4 Externalizing Graphics" in the Tikz manual, which explains how Tikz images can easily be exported as PDF images using pdfLaTeX.

However, I am persuaded I saw somewhere a way to export a Tikz picture to 'raw' (primitive?) Latex code in `picture` environment syntax (i.e. using `\put`, `\line`, etc.) - but I may have mixed this up with `dpic`/M4 Circuit macros :)

In any case - if `tikz` images get 'compiled' to (La)Tex code as an intermediate step - is it somehow possible to export/externalize/convert Tikz picture code to (plain?) LaTeX code?

-
Tikz uses driver specials, not the LaTeX `picture` environment, to work. So you can't do what you ask for here, I'm afraid. – Joseph Wright May 2 '11 at 6:26
Thanks @Joseph Wright - nice to have that confirmed... – sdaau May 2 '11 at 7:37

## 1 Answer

TikZ commands are TeX code. Because of this, TikZ pictures are very portable and can be used in plain TeX, LaTeX or ConTeXt. The "primitive" system that TikZ is built on is a set of TeX macros called PGF.

If I understand your question correctly, it sounds like you are trying to export TikZ into a form that can be used without loading the PGF package. As far as I know, this is not possible.

The best bet for sharing TikZ images with people who can't install the PGF package (such as journals) is to externalize the code, compile it to a static file like PDF and then replace the `tikzpicture` environments in your document with `\includegraphics`.

-
Thanks @Sharpie - yes, you understood my question correctly; I wanted 'plain Tex' code instead of an image, because I wanted to reuse this resulting 'plain Tex' code as a macro.. And nice to have this confirmed. Cheers! – sdaau May 2 '11 at 7:38