I'm having problems exporting my pgfplots figures to separate files using the externalize command. I get an error, the central point of which seems to be "Please verify that you have enabled system calls.". I have followed the instructions in the pgfplots manual to do this, however. I'm using MiKTeX 2.9 and Windows 7.
(In a related thread, the poster has the same problem as me: Attempt to export EPS figures from TikZ fails . However, in that case the poster is able to successfully export an image using the command "pdflatex -enable-write18 -output-format=dvi", I don't get that far. I have read that thread carefully but still can't figure out how to solve my problem).
My example is the following, taken from the pgfplots manual:
\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{external}
\tikzexternalize[shell escape=-enable-write18] %needed for the MiKTeX compiler
\begin{document}
\begin{figure}
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}
\caption{Our first external graphics example}
\end{figure}
\end{document}
I compile using the command:
pdflatex.exe -shell-escape
This gives the following error:
entering extended mode
===== 'mode=convert with system call': Invoking 'pdflatex -enable-write18 -halt
-on-/b/c9/cerror /b/c0/c-interaction=batchmode -jobname "externalizetest-figure0" "\def\tikze
xternalrealjob{externalizetest}\input{externalizetest}"' ========
! Package tikz /b/c9/cError:/b/c0/c Sorry, the system call 'pdflatex -enable-write18 -halt-on
-/b/c9/cerror /b/c0/c-interaction=batchmode -jobname "externalizetest-figure0" "\def\tikzexte
rnalrealjob{externalizetest}\input{externalizetest}"' did NOT result in a usabl
e output file 'externalizetest-figure0' (expected one of .epsi:.eps:.ps:). Plea
se verify that you have enabled system calls. For pdflatex, this is 'pdflatex -
shell-escape'. Sometimes it is also named 'write 18' or something like that. Or
maybe the command simply failed? /b/c9/cError /b/c0/cmessages can be found in 'externalizete
st-figure0.log'. If you continue now, I'll try to typeset the picture.
See the tikz package documentation for explanation.
As I understand it, the line
\tikzexternalize[shell escape=-enable-write18]
is supposed to replace the command -shell-escape to -enable-write18, which is needed for MiKTeX. Just to make sure that isn't the problem, I tried using the command
pdflatex.exe -enable-write18
instead, and
\tikzexternalize
in the .tex file. But that doesn't work either.
I'd be very thankful for help on how to enable system calls with MiKTeX 2.9, or, if the problem lies somewhere else, for thoughts on what might be wrong.
/Andreas
standaloneclass to be able to compile it by itself. You can then use thestandalonepackage to strip the preamble when you\inputit, or include the resulting image directly. The next version ofstandalonewill allow you to switch between both and even create the PDF automatically. – Martin Scharrer Jul 05 '11 at 13:18latexthen yes. – Martin Scharrer Jul 05 '11 at 15:37externalizetest-figure0.log, the system call has tried to start. If not, you can be sure that the system call did not even start. In that case, the main log fileexternalizetest.logmight indicate a small hint of what went wrong. Perhaps it did not find the "pdflatex" command? – Christian Feuersänger Jul 05 '11 at 16:14pdflatex? Bothstandalonenorexportactually export anything, but use eitherlatexorpdflatex(either automatic or manual) to create a DVI (which can be converted EPS) or PDF file. As said, place thetikzpicturein a own file, add a\documentclass{standalone} \usepackage{tikz,otherpackages}<libs..>preamble and compile it withlatex. Then usedvips -E(IIRC) on the DVI file to get a EPS. – Martin Scharrer Jul 05 '11 at 16:43