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.

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

In my document I use todonotes and TikZ/pgfplots. After activating the externalization in TikZ I realized that todonotes are all exported as well (because they are based on TikZ).

This behaviour is inconvenient, it would be much better for me to tell tikz-external to ignore all \todo.

I know I can generally disable the externalization with \tikzset{external/export=false} and turn it on only for selected plots, but the inverse would be more convenient.

share|improve this question
At the start of the document say \tikzexternaldisable, and then wrap the normal figures in \tikzexternalenable {your tikz code} \tikzexternaldisable. I haven't tested it, but that should be possible, no? Or wrap the todo macros in a personal macro using the reverse. I don't use todonotes, so I can't say how that would look. – Psirus Jan 27 '12 at 11:59
@Psirus: I'm not experienced in TikZ, but wrapping the todo macro sounds better because you only have to do it once in the preamble and can easily change it later. – doncherry Jan 27 '12 at 12:08
I agree. Now that I read it again, my first suggestion is already covered in the question... – Psirus Jan 27 '12 at 12:13
Would \newcommand{\xtodo}[1]{{\tikzexternaldisable\todo{#1}}} or similar not do the trick? – Martin Scharrer Jan 27 '12 at 12:25
The documentation of the package now mentions the same solutions suggested here, namely \newcommand{\ruggedtodo}[2][]{\tikzexternaldisable\todo[#1]{#2}\tikzexternalena‌​ble} – papabravo Feb 15 '13 at 10:10
up vote 24 down vote accepted

I had this very problem a while ago, just for the \todo command (I never use \missingfigure). Here's how I fixed it (place this in your preamble, somewhere after todonotes and tikz/pgfplots is called):


Now, \todo will be ignored by the externalization process.

Hence, for the \missingfigure command you need

share|improve this answer
Your redefinition of the \missingfigure command does not work, as there is no \@missingfigure in the package. I am not sure though how to do it differently; trying to use \let\oldmissingfigure\missingfigure causes LaTeX to complain about TeX capacity being exceeded. – mSSM Jul 18 '12 at 15:05
the replacement of \todo works fine, however for \missingfigure the solution provided by @rook (tex.stackexchange.com/a/115095/4419) works fine – kromuchi Sep 16 '15 at 11:48

For me neither of the proposed solutions worked. Maybe it is platform-dependent, taking into consideration the significant number of up-votes in favor of the accepted answer.

However, mSSM's approach with \let was close. The reason for it not to work properly with \missingfigure is that the latter consumes an optional argument. The simple \let fails to copy all required information to a new macro. According to this piece, one should use the letltxmacro package. Eventually, my working version is:



share|improve this answer

I have played around with \missingfigure, but a simple \renewcommand{\missingfigure}... will not work, as given in the answer by @Frits.

The only solution I found was defining a new command:


Working with \let, i.e.:







unfortunately raises an error:

! TeX capacity exceeded, sorry [input stack size=5000].
<to be read again> 
l.18 \missingfigure{Ah!}
share|improve this answer
Finally, I managed to overcome the issues you encountered. You may want to have a look at my answer. – rook May 19 '13 at 15:30

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.