I have a couple of pictures in my work so I started to build them extern in order to increase build speed. But I don't want to externalize all of them, I want a few little pictures to be build on-the-fly.

I found an interesting changelog on sourceforge (maybe the source code for a manual) where it says

how to disable the externalization partially with |\tikzset{external/|\declareandlabel{export}|=false}| or completely with |\tikzexternaldisable|,

but that didn' work for me. I activate externalization with

\tikzexternalize[prefix=figures/,figure list=true] 

so what kind of command could either externalize only flagged graphics or prevent flagged graphics from being externalized?

3 Answers 3


There are a couple of ways to turn on and off the externalisation stuff. To globally switch it off, use


and then to turn it back on again,


An alternative way of doing that is to use




These two methods use slightly different ways of disabling: the second is "lighter" than the first.

To disable externalisation for an individual picture, use

\tikzset{external/export next=false}

One thing to be ware of when enabling/disabling externalisation is that if you don't name the pictures explicitly then they are assigned names in numerical sequence. This means that if you put a new picture in the middle (or enable/disable externalisation for one in the middle) then all the following ones will be out of sequence. But TikZ won't know that so you have to tell it yourself (the easiest way is by deleting the relevant image files).

A quick experiment shows that if you want to externalise most but to switch it off for one or two, then use the \tikzset{external/export next=false} command just before.

If you want to externalise only one or two, then you need to switch it on just before and off again just after (using one of the two methods given above). It seems that if it is disabled using \tikzset{external/export=false} then it cannot be turned back on for a single picture using \tikzset{external/export next=true} (which would have been nice).

  • 7
    The "To globally switch it off, use" is not technically correct, is it? \tikzexternaldisable is locally scoped, isn't it? Commented May 3, 2012 at 22:16

As an alternative to switching TikZ externalization off and on again, I ended up with using

\tikzexternalize % activate!
\tikzset{external/only named=true}

and manually enabling externalization for heavy plots/graphics only using

\tikzsetnextfilename{myfigure}% (use % to avoid additional whitespace)

This is especially helpful in LaTeX beamer if externalization would break \only animations and you don't feel like creating a cache file for every overlay.


IMO the most simple solution to this is hidden in the comment of Martin Scharrer above, stating the scoping of \tikzexternaldisable: Just putting a scope around the image and disabling externalisation within is what i use now.

{\tikzexternaldisable \tikz{
    \draw[<->] (0,-0.15) -- (0,0.35);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .