[Tex/LaTex] Tikz Externalize, Lualatex through pdflatex and big data

luatexpgfplotstikz-external

I am plotting data from an infrared camera with pgfplots in an image as discribed and solved under this topic. A 194×194 data matrix is the input.

I am compiling the document with lualatex through pdflatex with in my header file through:

\tikzset{external/system call={lualatex
        \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode
        -jobname "\image" "\texsource"}}

I also added

--enable-write-18

in the command for pdflatex.

This all works pretty well and the result from above link shows up. However, if I want to include another such picture with different data (or also with same), I'm running into errors

Syntax Error: Couldn't finf trailer dictionary
Syntax Error: Couldn't read xref table

In my tikz-folder, where the externalized data are stored, all the files including the pdf are created. However, when trying to open the pdf-file, I get an error from Acrobat Reader that the file is damaged.

In the log file of the picture I find the following message:

("X:/Dropbox/2015 Dissertation/02
Documents/Dissertation_Template/pictures/temp 1c50DOD.tikz.tex" A
tikzpicture has been optimized away. Use
'/tikz/external/optimize=false' to di sable this. ) ("X:/Dropbox/2015
Dissertation/02 Documents/Dissertation_Template/pictures/temp
1c0DOD.tikz.tex" PGFPlots: reading {pictures/test2.txt}
\tikzexternal@dep@file=\write9 [6

Best Answer

After discussions with Christian (many thanks!!) and many different error messages that I received, two things helped finally to solve the problem:

  • Update ALL packages
  • inputenc doesn't work together with lualatex and leads to not compiling the external files. Removing this package helped.
Related Question