I have troubles using TikZ externalize and standalone. It seems that the required PDF is not generated. First, I suspected the recent PFG update (https://github.com/pgf-tikz/pgf/issues/932) but after some tests it seems to be related to standalone.
In my MWE I have four files.
file2:
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass[class=report,11pt,a4paper,tikz,]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (1,1);
\end{tikzpicture}%
\end{document}
file1:
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass[]{report}
\usepackage{tikz}
\usepackage{shellesc}
\usetikzlibrary{external}
\tikzexternalize[prefix=tikzfiles/]
\usepackage{standalone}
\begin{document}
\input{file2.tex}
\end{document}
File3:
\begin{tikzpicture}
\draw (0,0) -- (1,1);
\end{tikzpicture}%
File0:
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass[]{report}
\usepackage{tikz}
\usepackage{standalone}
\begin{document}
\input{file2.tex}
\end{document}
File2 works while file1 results in errors:
Output from main log:
! Package tikz Error: Sorry, the system call 'lualatex -shell-escape
-halt-on-e rror -interaction=batchmode -jobname "tikzfiles/file1-figure0" "\def\tikzextern
alrealjob{file1}\input{file1}"' did NOT result in a usable output file
'tikzfil es/file1-figure0' (expected one of .pdf:.jpg:.jpeg:.png:).
Please verify that y ou have enabled system calls. For pdflatex, this
is 'pdflatex -shell-escape'. S ometimes it is also named 'write 18' or
something like that. Or maybe the comma nd simply failed? Error
messages can be found in 'tikzfiles/file1-figure0.log'. If you
continue now, I'll try to typeset the picture.
Output from the log in the tikzfiles folder:
\providecommand \oddpage@label [2]{} ]
! Missing number, treated as
zero. <to be read again>
= l.11 \end{document}
However, calling file3 from file1 works, so the problem does not seem to be related to externalize (alone).
file0 on the other hand errors without using externalize so I suspect standalone.
And the log:
(./file2.tex ! Missing number, treated as zero. <to be read again> = l.11 \end{document}
\aftergroup\endinputin\sa@enddocumentis too early now, it interrupts the hook code. – Ulrike Fischer Oct 04 '20 at 09:37standaloneto use the new hooks if possible. – Martin Scharrer Oct 04 '20 at 10:33