If a lualatex compilation breaks with/at this terminal output:

ode.tex))[\directlua]:1: attempt to call a nil value (field 'get_functions_tabl
l.1738   }

Does it mean the failing \directlua is in /usr/local/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex?

Thing is, that file does not contain a directlua. OTOH this error only started o appear after I got lualatex to read and parse an additional Lua file within my personal document infrastructure -- but I don't see anything suspicious of being related in that additional file either.

  • 2
    the fragment of log you show, shows the error is not in pgfkeysfiltered.code.tex (the ) shows that file has been read to the end), but you have not shown which file the error is in. Apr 24 at 13:30

1 Answer 1


You provided no example, but given a guessed example





The relevant part of the terminal output is


The penultimate ) shows that pgfkeysfiltered.code.tex has been read to the end, so the final ) shown shows that pgfkeys.code.tex has been read to the end, so any line number in an error message at this point refers to the file at the top of the stack of open files, which is pgfsys.code.tex, line 1738 of which is the closing } of this \directlua call

  local lft = lua.get_functions_table()
  lft[\string#lft+1] = function()
      local lhs = token.scan_string()
      local rhs = token.scan_string()
      if lhs < rhs then
          tex.sprint(-2, "-1")
      elseif lhs == rhs then
          tex.sprint(-2, "0")
          tex.sprint(-2, "1")
  token.set_lua("pgfsys@strcmp", \string#lft, "global")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.