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:

\tikzexternalize[shell escape=-enable-write18] %needed for the MiKTeX compiler


\addplot {x^2};
\caption{Our first external graphics example}


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


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.


  • You can always do it the other way around: Place you plot/diagram in an external file with a full preamble and use the standalone class to be able to compile it by itself. You can then use the standalone package to strip the preamble when you \input it, or include the resulting image directly. The next version of standalone will allow you to switch between both and even create the PDF automatically. Commented Jul 5, 2011 at 13:18
  • Thanks for the tip! I understand you are the author of standalone. Is the package also able to export eps images?
    – andreasdr
    Commented Jul 5, 2011 at 15:26
  • If you compile the standalone files with normal latex then yes. Commented Jul 5, 2011 at 15:37
  • 1
    I see two possible reasons for the failure: the first is that the system did not allow the system call and the second is that the system call has been started, but failed. In general, if there exists a log file externalizetest-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 file externalizetest.log might indicate a small hint of what went wrong. Perhaps it did not find the "pdflatex" command? Commented Jul 5, 2011 at 16:14
  • 1
    Why do you want to export EPS when you use pdflatex? Both standalone nor export actually export anything, but use either latex or pdflatex (either automatic or manual) to create a DVI (which can be converted EPS) or PDF file. As said, place the tikzpicture in a own file, add a \documentclass{standalone} \usepackage{tikz,otherpackages}<libs..> preamble and compile it with latex. Then use dvips -E (IIRC) on the DVI file to get a EPS. Commented Jul 5, 2011 at 16:43

3 Answers 3


Reinstalling and updating MiKTeX 2.9 (avoiding the update of hyph-utf8, which seems to be having some problems since the new version came out on June 23) solved the problem. The above code (using either of the command lines mentioned) now correctly exports the figure to a separate pdf file.


I used to have the same problem. In my environment (Eclipse with Texlipse), the problem was that I specified a temporary output directory. By disabling this, the externalization works. Moreover, I had problem getting my bibliography updated. This was solved, too. The disadvantage is only that the directory looks messy. Cheers, Roman


I came across this error 11+ years later and I'm posting this solution I eventually figured out for anyone else that runs into it.

  • MiKTeX 4.9
  • Windows 10, 22H2
  1. After installation, open TeXworks. Go to the "Edit" menu and select the "Preferences" listing
  2. When the "TeXworks Preferences" window opens, go to the "Typsetting" tab
  3. On the "Typesetting" tab, go to the "Processing tools" section
  4. In the "Processing tools" section select the text compiler you are using (example: "pdfLaTeX+MakeIndex+BibTeX") and then click the "Edit..." button
  5. In the "Tool Configuration" window that opens, go to the "Arguments" section and click the "+" button
  6. In the new listing that appears (usually NewArgument) delete the current text and paste --tex-option=--shell-escape in its place
  7. Use the 'up' and 'down' arrows to move this new listing above the $fullname listing
  8. Click the "OK" button on the "Tool Configuration" window, then click the "OK" button on the "TeXworks Preferences" window

External graphs using pgfplots should now work.

You must log in to answer this question.

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