2

I have tried many ways to include a module installed by luarocks in a tex file to be processed by lualatex, but all methods give me

/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua:381: attempt to call 
a nil value (field 'cpath specification')
stack traceback:
        ...0/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua:381: in field '?'
        ...0/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua:403: in function <
...0/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua:395>
        [C]: in function 'require'
        [\directlua]:1: in main chunk.

I've tried Using LuaLaTeX and SQLite3 and the package luapackageloader. I have also played with setting package.path and package.cpath. The goal for me is to load the path module from penlight. And for that, I've tried both

\directlua{
  require("pl")
  path = require("pl.path")
}

and

\directlua{
  path = require("path")
}

Everything gave the same error quoted below. What did I do wrong?

Thanks!

PS. I'm running everything on a clean Ubuntu Bionic installation.

3
  • Maybe you could change the title to "Requiring a dynamic library gives error in lualatex from TeXLive 2020" or similar, because this is what people will look for in the next weeks/months.
    – frafl
    Apr 27 '20 at 8:29
  • Not sure if it's the same problem or not, but I run into similar issue with axessibility package. Fixed by putting file axessibility.lua into one of the folders returned by kpsewhich -show-path=lua, then running texhash (which was a crucial step I forgot to make). Sep 8 '20 at 21:17
  • @IlyaV.Schurov Marcel’s answer to my question yesterday suggests that might no longer be needed. Take a look here tex.stackexchange.com/q/577111/192717
    – reportaman
    Jan 1 '21 at 20:09
2

You will need to compile your document with --shell-escape starting with LuaTeX 1.12, which is shipped with TexLive 2020 (see https://tug.org/pipermail/luatex/2020-March/007333.html).

2
  • Marcel’s answer to my question from yesterday suggests that might no longer be needed. Take a look here tex.stackexchange.com/q/577111/192717
    – reportaman
    Jan 1 '21 at 20:11
  • @reportaman: Are you sure? Requiring a binary module should require --shell-escape otherwise the argument is quite pointless.
    – frafl
    Apr 22 '21 at 19:36

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.