The following code from the pgf manual compiles fine with lualatex --shell-escape
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
A simple image is \tikz \fill (0,0) circle(5pt);.
\end{document}
But, if I write some luacode (for example $\pi = \directlua{tex.sprint(math.pi)}$) I have the following error message :
===== 'mode=convert with system call': Invoking 'pdflatex -halt-on-error -inter
action=batchmode -jobname "test-figure0" "\def\tikzexternalrealjob{test}\input{
test}"' ========
runsystem(pdflatex -halt-on-error -interaction=batchmode -jobname "test-figure0
" "\def\tikzexternalrealjob{test}\input{test}")...executed.
./test.tex:7: Package tikz Error: Sorry, the system call 'pdflatex -halt-on-err
or -interaction=batchmode -jobname "test-figure0" "\def\tikzexternalrealjob{tes
t}\input{test}"' did NOT result in a usable output file 'test-figure0' (expecte
d one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system cal
ls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named
'write 18' or something like that. Or maybe the command simply failed? Error me
ssages can be found in 'test-figure0.log'. If you continue now, I'll try to typ
eset the picture.
See the tikz package documentation for explanation.
Type H <return> for immediate help.
...
l.7 ...ple image is \tikz \fill (0,0) circle(5pt);
The question is: what's wrong? And subsidiarily, why is pdflatex invoked?
N.B. The compilation with lua code fails only if I deleted the aux files before.
lualatex --helpshows that it uses double-hyphen for options, but even fixing that doesn't help. Any extra troubleshooting steps needed? I have TexWorks and MiKTeX 2.9. – Ben Voigt Jan 01 '14 at 22:46