I'm getting the following error message from lualatex:

(/usr/share/texlive/texmf-dist/tex/luatex/luaotfload/luaotfload.sty...ive/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:176: attempt to index global 'luatexbase' (a nil value)
stack traceback:
        ...ive/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:176: in function 'early'
        ...ive/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua:283: in function 'main'
        [\directlua]:1: in main chunk.

The error message is legitimate in my use case, luatexbase is really nil.

How do I get the full filename in the Lua error message, i.e. /usr/share/texlive/ instead of ...ive/ ?

I know that I can look up filenames (e.g. kpsewhich luaotfload-init.lua) afterwards, but in this question I'm interested in including full absolute filnames in error messages.

FYI I'm already using max_print_line=1000 error_line=254 half_error_line=238 lualatex to prevent line breaks within Tex messages.

  • 3
    Won't help for the log file, but if you want to look up the full path afterwards, you can use kpsewhich luaotfload-main.lua – user36296 Jan 11 at 13:33
  • 1
    How did you manage to get a nil luatexbase table? The table is setup by the kernel. Or don't you have a current latex? – Ulrike Fischer Jan 11 at 13:39
  • @UlrikeFischer: I'm running this with lualatex --ini, and luatexbase is nil there. Please note that in this question I'm not interested in fixing this error. – pts Jan 11 at 13:43
  • Well the error messages are from lua, so setting tex options won't help, you probably would have to install some other (lua) error handler. – Ulrike Fischer Jan 11 at 16:11
  • @UlrikeFischer: Could you please advise how? – pts Jan 11 at 16:15

It doesn't look like that is possible even if you use pcall to trap the error and get the message as a Lua string, it has already been truncated, it isn't tuncated by the print routines.

this would apparently require a change in the C code of Lua itself, see for example


  • 1
    Just copying the relevant info from the link in case the link disappears: To make it happen, ar.short_src should be changed to ar.source in the C source code of Lua. – pts Jan 11 at 23:15

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.