I am out of my depths to understand what could be going wrong here. I am using luatex (TL 2018) to compile a simple pgfplot example.

This is the error message I get

example_surf.tikz:8: Package tikz Error: Sorry, the system call 'lualatex -shell-escape -halt-on-error -interaction=batchmode -jobname "main-figure0" "\def\tikzexternalrealjob{main}\input{main}"' did NOT result in a usable output file 'main-figure0' (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 also named 'write 18' or something like that. Or maybe the command simply failed?

This is strange, because in my latexmkrc I have

$pdflatex = 'lualatex %O %S --shell-escape';
$pdf_mode = 1;
$postscript_mode = $dvi_mode = 0;

Clearly, we can see that shell-escape is enabled.

Here is a MNWE.

\RequirePackage{luatex85,shellesc}  % not sure if this is required
\tikzset{external/force remake}




The file example_surf.tikz is a simple 3D surface plot from the pgfplots manual.

        \addplot3 [
        ] {x+y};

What am I doing wrong?

  • 2
    You can't combine standalone class and externalization (and it doesn't make much sense anyway). See e.g. tex.stackexchange.com/questions/23587/… – Ulrike Fischer Jun 7 '18 at 15:04
  • @UlrikeFischer thank you very much. Sorry that I could not figure out it was due to class mismatch. What happened was I generated some figure from matlab2tikz, which uses this document class. Later on, I tried to convert this to an externalised setup. Your pointer helps to solve the issue. – Krishna Jun 7 '18 at 15:25