TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 7 down vote accepted

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").

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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