TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
up vote 3 down vote accepted

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.

share|improve this answer
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

Your Answer


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.