I'm working on a large document which exceeded the memory capacity of TexLive 2011 so I tried to externalize the tikz images by using it's external
library, as described in pgfmanual. I compiled using
pdflatex -shell-escape foo.tex
which resulted in an error like this:
! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-e rror -interaction=batchmode -jobname "foo-figure0" "\def\tikzexternal realjob{foo}\input{foo}"' did NOT result in a usable output file 'foo-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please v erify that you have enabled system calls. For pdflatex, this is 'pdflatex -shel l-escape'. Sometimes it is also named 'write 18' or something like that. Or may be the command simply failed? Error messages can be found in 'ktikztemplate-fig ure0.log'. If you continue now, I'll try to typeset the picture.
I managed to narrow down the problem and came up with the following MWE which produces the same error:
\documentclass{article}
\usepackage{optional}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
\begin{tikzpicture}
\draw(0,0)--(1,1);
\end{tikzpicture}
\end{document}
Comment out the \usepackage{optional}
line and the error is gone. I could somewhat easily manage without that package, but it would be nice if there is some solution for this.
I use TexLive 2011 on Ubuntu 11.10 (both freshly installed few day ago).