1

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}
Martin Scharrer
  • 262,582
Dobu
  • 51
  • 4
  • 1
    I get the error also with older latex and pgf, so it is not related to the newest update. Why do you use standalone and externalize together? – Ulrike Fischer Oct 03 '20 at 21:24
  • This is definitely unrelated to the update and looks like a duplicate of https://tex.stackexchange.com/questions/492981/compile-error-improper-prevdepth-from-epstopdf-when-trying-tikzcode-which-must/492987#492987 – David Carlisle Oct 03 '20 at 21:37
  • You are right my MWE was to simplified. The new one with two files should be better. The same code works on another machine with TL2020 but not updated recently. – Dobu Oct 03 '20 at 22:25
  • As explained in Edit2, it seems to be related to standalone and not externalize. I did not dare updating my other machine so I'm still not sure if the update somehow just broke the tex setup on this machine. – Dobu Oct 04 '20 at 08:58
  • Please don't use "Edit" markers on the site. Old versions of the post is available in the history anyway. Please always edit your post to show the latest version, not a series of edits. Also, use code blocks not quotes for log messages. – Martin Scharrer Oct 04 '20 at 08:59
  • 2
    it fails only with luatex, and it is related to standalone. – Ulrike Fischer Oct 04 '20 at 09:07
  • I removed the Edit markers and updated the post to reflect the whole problem. The title might need to be changed. – Dobu Oct 04 '20 at 09:16
  • 1
    @MartinScharrer I think \aftergroup\endinput in \sa@enddocument is too early now, it interrupts the hook code. – Ulrike Fischer Oct 04 '20 at 09:37
  • 1
    @MartinScharrer I added also an issue at latex3: https://github.com/latex3/latex3/issues/813 – Ulrike Fischer Oct 04 '20 at 09:57
  • 1
    Thanks @UlrikeFischer, this helps me a lot. I will try to update standalone to use the new hooks if possible. – Martin Scharrer Oct 04 '20 at 10:33
  • Works now after updating texlive – Dobu Oct 06 '20 at 19:10
  • 4
    I’m voting to close this question because it was caused by a bug which has been fixed in current versions. – Marcel Krüger Oct 06 '20 at 19:12

0 Answers0