I am trying to set up tikz externalisation so I can save individual images as .pdfs (and eventually .png's).

I am trying to run the following code in TeX works, W7, MikTex 2.9. I have changed the options such that pdflatex in the commands options of TeX works is pdflatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex .



\immediate\write18{echo "hallo"}
\draw (0,0) circle (1cm);


When I run this, I get Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-error in the log file, and it suggests I enable -shell-escape. The \immediate\write18{echo "hallo"} is from Can't enable shell-escape , there it suggests I can check whether -shell-escape is actually enabled by seeing whether runsystem(echo "hallo")...executed is reported, which it is. If I remove the -shell-escape from the command options, it says runsystem(echo "hallo")...failed, or something similiar, so it seems like that is a sensitive test.

Things I have tried:

  • Compiling from the compiling line with pdflatex -shell-escape mweext.tex - gives same errors
  • Using TeXStudio and TexWorks with appropritate options applied, same issues.
  • Using -enable-write18 instead of -shell-escape
  • Changing pdflatex.ini and adding EnableWrite18=t from How can I enable write 18 on a MikTeX installation
  • Commenting out \tikzsetnextfilename{roundincircles}. This stops the error, but no external file is produced.
  • Running with this via the cmd line pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "roundincircles" "\def\tikzexternalrealjob{mweext}\input{mweext}" - this works, but I don't want to have to run from the command line every time!

Can other people run this code with the options specified? Is there anything else I need to enable this to work? When I compile the above it produces a circle, so I must have tikz properly installed.

Here is the entire log file.

    This is pdfTeX, Version 3.14159265-2.6-1.40.15 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2015.4.6)  6 APR 2015 19:06
entering extended mode
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 68 languages loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\frontendlayer\tikz.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\basiclayer\pgf.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\utilities\pgfrcs.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfutil-common.tex"

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfutil-common-lists.te
x")) ("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfutil-latex.def"
("C:\Program Files\MiKTeX 2.9\tex\latex\ms\everyshi.sty"
Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfrcs.code.tex"
Package: pgfrcs 2013/12/20 v3.0.0 (rcs-revision 1.28)
Package: pgf 2013/12/18 v3.0.0 (rcs-revision 1.14)

("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\basiclayer\pgfcore.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg"
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
Package graphics Info: Driver file: pdftex.def on input line 91.

("C:\Program Files\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\systemlayer\pgfsys.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\systemlayer\pgfsys.code.tex"
Package: pgfsys 2013/11/30 v3.0.0 (rcs-revision 1.47)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfkeys.code.tex"

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfkeysfiltered.code.te
 ("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\systemlayer\pgf.cfg"
File: pgf.cfg 2008/05/14  (rcs-revision 1.7)
Driver file for pgf: pgfsys-pdftex.def

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\systemlayer\pgfsys-pdftex.def"
File: pgfsys-pdftex.def 2013/07/18  (rcs-revision 1.33)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\systemlayer\pgfsys-common-pdf.def
File: pgfsys-common-pdf.def 2013/10/10  (rcs-revision 1.13)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\systemlayer\pgfsyssoftpath.code.t
File: pgfsyssoftpath.code.tex 2013/09/09  (rcs-revision 1.9)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\systemlayer\pgfsysprotocol.code.t
File: pgfsysprotocol.code.tex 2006/10/16  (rcs-revision 1.4)
)) ("C:\Program Files\MiKTeX 2.9\tex\latex\xcolor\xcolor.sty"
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)

("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\color.cfg"
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
Package xcolor Info: Driver file: pdftex.def on input line 225.
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcore.code.tex"
Package: pgfcore 2010/04/11 v3.0.0 (rcs-revision 1.7)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmath.code.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathcalc.code.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathutil.code.tex")
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathparser.code.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.code.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.basic.code.
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.trigonometr
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.random.code
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.comparison.
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.base.code.t
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.round.code.
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.misc.code.t
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfunctions.integerarit
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmathfloat.code.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorepoints.code.tex
File: pgfcorepoints.code.tex 2013/10/07  (rcs-revision 1.27)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorepathconstruct.c
File: pgfcorepathconstruct.code.tex 2013/10/07  (rcs-revision 1.29)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorepathusage.code.
File: pgfcorepathusage.code.tex 2013/12/13  (rcs-revision 1.23)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorescopes.code.tex
File: pgfcorescopes.code.tex 2013/10/09  (rcs-revision 1.44)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcoregraphicstate.co
File: pgfcoregraphicstate.code.tex 2013/09/19  (rcs-revision 1.11)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcoretransformations
File: pgfcoretransformations.code.tex 2013/10/10  (rcs-revision 1.17)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorequick.code.tex"
File: pgfcorequick.code.tex 2008/10/09  (rcs-revision 1.3)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcoreobjects.code.te
File: pgfcoreobjects.code.tex 2006/10/11  (rcs-revision 1.2)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorepathprocessing.
File: pgfcorepathprocessing.code.tex 2013/09/09  (rcs-revision 1.9)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorearrows.code.tex
File: pgfcorearrows.code.tex 2013/11/07  (rcs-revision 1.40)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcoreshade.code.tex"
File: pgfcoreshade.code.tex 2013/07/15  (rcs-revision 1.15)
) ("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcoreimage.code.te
File: pgfcoreimage.code.tex 2013/07/15  (rcs-revision 1.18)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcoreexternal.code.t
File: pgfcoreexternal.code.tex 2013/07/15  (rcs-revision 1.20)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorelayers.code.tex
File: pgfcorelayers.code.tex 2013/07/18  (rcs-revision 1.7)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcoretransparency.co
File: pgfcoretransparency.code.tex 2013/09/30  (rcs-revision 1.5)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorepatterns.code.t
File: pgfcorepatterns.code.tex 2013/11/07  (rcs-revision 1.5)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\modules\pgfmoduleshapes.code.tex"
File: pgfmoduleshapes.code.tex 2013/10/31  (rcs-revision 1.34)
) ("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\modules\pgfmoduleplot.code.tex"
File: pgfmoduleplot.code.tex 2013/07/31  (rcs-revision 1.12)
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\compatibility\pgfcomp-version-0-65.
Package: pgfcomp-version-0-65 2007/07/03 v3.0.0 (rcs-revision 1.7)
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\compatibility\pgfcomp-version-1-18.
Package: pgfcomp-version-1-18 2007/07/23 v3.0.0 (rcs-revision 1.1)
)) ("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\utilities\pgffor.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\utilities\pgfkeys.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgfkeys.code.tex"))
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\math\pgfmath.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmath.code.tex"))
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\utilities\pgffor.code.tex"
Package: pgffor 2013/12/13 v3.0.0 (rcs-revision 1.25)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\math\pgfmath.code.tex")
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\frontendlayer\tikz\tikz.code.tex"
Package: tikz 2013/12/13 v3.0.0 (rcs-revision 1.142)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\libraries\pgflibraryplothandlers.
File: pgflibraryplothandlers.code.tex 2013/08/31 v3.0.0 (rcs-revision 1.20)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\modules\pgfmodulematrix.code.tex"
File: pgfmodulematrix.code.tex 2013/09/17  (rcs-revision 1.8)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\frontendlayer\tikz\libraries\tikz
File: tikzlibrarytopaths.code.tex 2008/06/17 v3.0.0 (rcs-revision 1.2)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\frontendlayer\tikz\libraries\tikz
File: tikzlibrarypositioning.code.tex 2008/10/06 v3.0.0 (rcs-revision 1.7)
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\frontendlayer\tikz\libraries\tikz
File: tikzlibraryshapes.geometric.code.tex 2008/01/09 v3.0.0 (rcs-revision 1.1)

("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\libraries\shapes\pgflibraryshapes
File: pgflibraryshapes.geometric.code.tex 2008/06/26 v3.0.0 (rcs-revision 1.1)
("C:\Program Files\MiKTeX 2.9\tex\latex\pgf\frontendlayer\libraries\tikzlibrary
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty"
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
("C:\Program Files\MiKTeX 2.9\tex\generic\pgf\frontendlayer\tikz\libraries\tikz
externalshared.code.tex")) (mweext.aux)
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
 ABD: EveryShipout initializing macros
("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
runsystem(echo "hallo")...executed.

===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o
n-error -interaction=batchmode -jobname "roundincircles" "\def\tikzexternalreal
job{mweext}\input{mweext}"' ========
runsystem(pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname
 "roundincircles" "\def\tikzexternalrealjob{mweext}\input{mweext}")...executed.

! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-e
rror -interaction=batchmode -jobname "roundincircles" "\def\tikzexternalrealjob
{mweext}\input{mweext}"' did NOT result in a usable output file 'roundincircles
' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled 
system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is a
lso named 'write 18' or something like that. Or maybe the command simply failed
? Error messages can be found in 'roundincircles.log'. If you continue now, I'l
l try to typeset the picture.

See the tikz package documentation for explanation.
Type  H <return>  for immediate help.

l.14 \end{tikzpicture}

This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

[1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}] (mweext.aux) ) 
Here is how much of TeX's memory you used:
 11794 strings out of 493698
 247679 string characters out of 3144384
 282407 words of memory out of 3000000
 14933 multiletter control sequences out of 15000+200000
 3640 words of font info for 14 fonts, out of 3000000 for 9000
 1025 hyphenation exceptions out of 8191
 55i,5n,62p,571b,442s stack positions out of 5000i,500n,10000p,200000b,50000s
am Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on mweext.pdf (1 page, 8728 bytes).
PDF statistics:
 13 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 13 words of extra memory for PDF output out of 10000 (max. 10000000)
  • Your code works fine for me in miktex. Where is your file stored? What is the name of your file? – Ulrike Fischer Apr 6 '15 at 16:28
  • My file is called mweext.tex and it is located on a flash drive, 4 folders deep. Same problems if I move to my documents and call it asda.tex. – George Vousden Apr 6 '15 at 16:41
  • Just to check, should "hallo" be printed anywhere on the output file? It is not on mine. – George Vousden Apr 6 '15 at 17:03
  • Compile your document and show the log-file. – Ulrike Fischer Apr 6 '15 at 17:05
  • 1
    Try to compile on the command line pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "roundincircles" "\def\tikzexternalrealjob{mweext}\input{mweext}" – Ulrike Fischer Apr 6 '15 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.