0

Cannot include Tikz Externalize in existing large Overleaf project

Hi community,

Since I cannot compile my paper with out a timeout anymore due to the large amount of tikz plots (and data for these plots) I want to use tikz externalize. I followed the guide by Overleaf and on a minimal project it also works the way it should. However, if I try to include it in my big project, I always run into the same error (at the first tikz picture). All my tikz code is stored in separate files and folders and then inlcuded with \input in a figure environment.

The error message I get is:

Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "tikz/output-figure0" "\def\tikzexternalrealjob{output}\input{output}"' did NOT result in a usable output file 'tikz/output-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? Error messages can be found in 'tikz/output-figure0.log'. If you continue now, I'll try to typeset the picture.

The log file says:

! I can't write on file `tikzext/output-figure0.md5'. \relax l.42 \end{tikzpicture}

(Press Enter to retry, or Control-D to exit; default file extension is `.tex') Please type another output file name ! Emergency stop. \relax l.42 \end{tikzpicture}

*** (job aborted, file error in nonstop mode)

I checked that I have a folder called tikz and that the packages

\usetikzlibrary{external} \tikzexternalize[prefix=tikz/]

are included.

I checked some posts that dealt with shell escape etc. but didn't find one with an easy explanation on what to do.

Really hope that someone can help me here!

Thanks! Me

Mav
  • 11
  • There are a few reasons why this might go wrong. Some include (1) the problem could be due to errors in your project (fix all errors by first switching to Stop on Error mode), (2) could be due to your project structure (your main tex file cannot be in a folder for the generated PDFs to be found), or (3) could be due to not following the instructions exactly as they are presented. Please check each of those, and if you remain stuck, consider asking Overleaf support for help. – Dan MacKinnon May 29 '23 at 13:13
  • Thanks for your hints Dan! Non of your suspected error sources caused the problem, but I did contact the Overleaf support (which answered super fast!) My project includes several \includepdf commands with caused the troubles. Solution: \tikzexternalize[prefix=tikz/,optimize command away=\includepdf] Hope this might help someone else as well – Mav May 30 '23 at 10:16

0 Answers0