[luatex] Loading of lua files/modules

Manuel Pégourié-Gonnard mpg at elzevir.fr
Fri Jan 11 11:13:00 CET 2013


On 11/01/2013 09:58, Taco Hoekwater wrote:
> kpathsea can find .lua files within TEXMF (via the LUAINPUTS
> variable), so that should be fine. But I doubt kpathsea is
> able to find lua files using lua sub-module notation.

It does work using require.

% mkdir -p ~/texmf/scripts/lua/foo/bar/
% echo 'texio.write_nl "HELLO"' > ~/texmf/scripts/lua/foo/bar/baz.lua
% echo -E '\directlua{require "foo.bar.baz"}\end' > test.tex
% luatex test.tex
This is LuaTeX, Version beta-0.70.2-2012052410 (TeX Live 2012)
 restricted \write18 enabled.
(./test.tex
HELLO )
No pages of output.
Transcript written on test.log.

This was added by revision 3558, first released with luatex 0.60, in april 2010.

> OTOH, even if it does not work right now, support for that should be fairly
> simple to program with some extra code in kpse_module_loader.
> 
IIRC, luatexbase-loader has such an implementation.

@Heiko: Unless I'm mistaken, luatex-loader.sty, as well as
luatexbase-loader.sty, should be useless with recent versions of LuaTeX.

Manuel.


More information about the luatex mailing list