I've edited this post as I've broken the problem down to something smaller than a thesis. I can run the following command in the cmd window:

lualatex file.tex

with the following script no problem:



The golden-crowned sifaka is a medium-sized lemur characterized by mostly white fur, prominent furry ears and a golden-orange crown. 

    \caption{This is the caption}

    \caption{This is the caption}


But when I uncomment the


lines and use the following:

lualatex --shell-escape -interaction=nonstopmode file.tex

it compiles the first figure into file-figure0.pdf no problem but when it gets to teh second, there are problems and it gives a fatal error

sdof.tex is a simple diagram i drew myself in inkscape and the second strain.tikz is matlab2tikz output of lots of data points from a test.

  • Does it work if you don't use a separate folder for the figures? Also, try with a folder name which does not contains the character _ (blind guess here). – JLDiaz Jun 30 '13 at 12:54
  • Just tried both of those, unfortunately the same thing happens – Gerard Jun 30 '13 at 13:05
  • The externalization requires quite a bit of 'magic' behind the scenes to work. I would try to approach it differently and start from a minimal example and not with a large document. Also did you have a look at t_figs/OReilly_Gerard_Thesis-figure2.log to check whether there is any hint to your problem? – Alexander Jun 30 '13 at 15:55
  • 1
    Maybe you need lualatex to compile your second figure? Try this approach. – Juri Robl Jun 30 '13 at 16:11
  • 1
    @Gerard Yes, by default it uses pdflatex for the external figures, because it was made for that. If you want to use it with another engine, you have to change it yourself. – Juri Robl Jun 30 '13 at 16:26

As posted by @JuriRobl the problem was that the externalisation was using pdflatex instead of lualatex that the document was originally compiled with.

This was changed by adding the following lines to the documents preamble

\tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}
  • 1
    I appears as if lualatex does not support the underlying switch to auto-detect if shell-escape is active. Long words, short answer: you (may?) need to replace \tikzexternalcheckshellescape by -shell-escape. This is required if the images need external tools. – Christian Feuersänger Jul 1 '13 at 18:15
  • 1
    Note that since pgfplots 1.11, the driver selection for image externalization has been improved. A document compiled with lualatex will automatically translate externalized images with lualatex as well. – Christian Feuersänger Aug 7 '14 at 11:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.