There is a question with the same title, Installing Lua Modules for use in LuaLaTeX, that apparently went unresolved. I'm having similar issues and at this point am out of ideas.

I'm running Debian Testing and have installed lua's xmlrpc library through the package manager. The files are installed in


and are found alright by the system's lua installation.

I have determined that the package.path parameter differs between the system's lua installation and luatex. System:

mpalmer@holzkopf:~$ lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print(package.path)

In luatex, /usr/share/lua and subdirectories are missing from the path. When I set the LUA_PATH environmental variable to the system's path, /usr/share/lua and subdirectories show up in luatex's package.path also, but the xmlrpc module still isn't found. I have also tried to make /usr/local/share/lua (which didn't actually exist) a symlink to /usr/share/lua, again without success.

On the other hand, luatex does not give me an error, so presumably succeeds, with require "socket.http"

That module lives in /usr/share/lua/5.1/socket/http.lua and is found even when /usr/share/lua is neither symlinked nor in package.path. So it almost seems as if package.path is completely ignored by luatex.

Does anyone know what I'm missing here?


See this answer where LuaTeX searches for files loaded by require. require ("socket.http") works, because LuaTeX has this built in (mentioned in the reference manual in section 3.3 "Lua Modules").

  • OK thanks, that was helpful. I'm still a bit foggy about why it is a good idea for luatex to depart from lua's regular module loading protocol, but at least I know now where to start. – Michael Palmer Jan 31 '12 at 19:37
  • LuaTeX uses (if initialized, but this is true if you use LuaLaTeX) kpathsea to locate the lua modules. That's just the way TeX is (web2c based distributions, to be exact). – topskip Jan 31 '12 at 19:44

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.