# [Dev-luatex] dofile, require and kpathsea

Hans Hagen pragma at wxs.nl
Tue Aug 21 10:49:09 CEST 2007

Jonathan Sauer wrote:
> Hello,
>
> during the weekend, I wrote a little bit of code using external
> Lua files (since \directlua requires matching braces in the
> Lua code). I loaded this code using dofile or require.
>
> This worked perfectly when the .lua file was in the same
> (even though kpsewhich could find it).
>
> I know that Lua's require uses its own search path, and I
> assume from my results that LuaTeX does not change this
> behaviour to use kpathsea.
>
> I now wonder if there are plans to change that. IMO this
> should be done, since LuaTeX embeds Lua in a very specific
> environment which searches for files using kpathsea, not
> a simple path set as an environment variable.
>
> What do you think?

there will be a LUAINPUTS variable in texmf.cnf and then you can use
that to specify paths

since those lua files are tex relates, you can just put 'm in the tex
path and use the tex related kpse lookup