Consider the following code:




    \addplot[mark=x] coordinates {


When this compiled using LuaLaTeX,

lualatex -enable-write18 lualatex-externalize-luatodonotes.tex

everything goes OK, with the TikZ image externalized as it should be. However, uncommenting the luatodonotes line, compilation exits with an error and no result is produced.

The lualatex-externalize-luatodonotes.log file ends with:

Package pgfplots Warning: running in backwards compatibility mode (unsuitable t
ick labels; missing features). Consider writing \pgfplotsset{compat=1.11} into 
your preamble.
 on input line 8.

===== 'mode=convert with system call': Invoking 'lualatex -halt-on-error -inter
action=batchmode -jobname "lualatex-externalize-luatodonotes-figure0" "\def\tik
luatodonotes}"' ========
runsystem(lualatex -halt-on-error -interaction=batchmode -jobname "lualatex-ext
ernalize-luatodonotes-figure0" "\def\tikzexternalrealjob{lualatex-externalize-l

!LuaTeX error (file lualatex-externalize-luatodonotes-figure0.pdf): xpdf: readi
ng PDF image failed
 ==> Fatal error occurred, no output PDF file produced!

The lualatex-externalize-luatodonotes-figure-0.log file ends with:

\providecommand \oddpage@label [2]{}
A tikzpicture has been optimized away. Use '/tikz/external/optimize=false' to d
isable this.
! LuaTeX error ...iKTeX 2.9/tex/lualatex/luatodonotes/luatodonotes.lua:350: bad
 argument #1 to 'pairs' (table expected, got nil)
stack traceback:
    [C]: in function 'pairs'
    ...iKTeX 2.9/tex/lualatex/luatodonotes/luatodonotes.lua:350: in function 'clea
    <\directlua >:1: in main chunk.
<argument> ...irectlua {luatodonotes.clearNotes()}
                                                  \EndCatcodeRegime \AtBegSh...
l.21 \end{document}

Here is how much of LuaTeX's memory you used:
 22848 strings out of 495011
 100000,794899 words of node,token memory allocated
 1681 words of node memory still in use:
   avail lists: 2:20,3:240,4:193,7:2,9:76,10:1
 25515 multiletter control sequences out of 65536+200000
 28 fonts using 1112699 bytes
 63i,11n,76p,820b,1808s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!

I have tried this with both MikTeX and TexLive on Windws 7 64 bit with the same outcome.

How can this be resolved? I would like to use luatodonotes in my book. I also need to use LuaLaTeX.

  • You can get around the lua error by adding a \todo. But luatodonotes uses tikzpictures internally so you probably will run into more clashes with externalize. Mar 31, 2015 at 14:53
  • But why does the error occur just by loading the package? It is not even used in the document and it still produces an error? todonotes has similar problem with tikz externalize, but it can be dealt with like it is explained here: tex.stackexchange.com/questions/42486/… However luatodonotes gives an error just by loading it.
    – Vladimir
    Mar 31, 2015 at 17:55
  • I don't know, I hadn't the time to check. But the error message sounds as if luatodonotes tried to clear an empty notes-table and so I added an todo to initialize this table. Mar 31, 2015 at 21:26


You must log in to answer this question.

Browse other questions tagged .