[tex-live] kpse don't find files under $TEXMF/scripts

Manuel Pégourié-Gonnard mpg at elzevir.fr
Sun Mar 28 11:57:50 CEST 2010


Khaled Hosny a écrit :
> The lua_altopt module installed under texmf-dist/scripts/ is not seen by
> kpse,

This statement is too imprecise to be true. Kpse will or will not see the file
depending on the options you pass to it.

> If this is the expected behaviour, then we either need to special case
> lua modules (e.g. have a searchable scripts/lua/ subdir) or move lua
> modules somewhere else.
Currently LUAINPUTS is .;$TEXMF/scripts/{$progname,$engine,}/lua//;$TEXINPUTS
which means that with format = 'lua' (and I guess this is what require() is
using), lua scripts in texmfscripts will be found only if their path contains a
directory named lua. (By the way, we may remove this restriction in the near

So I'd recommend to follow Reinhard's advice: locate the script using kpse an
load it using dofile(). More precisely,

local f = kpse.find_file('lua_altgetopt.lua', 'lua')
    or kpse.find_file('lua_altgetopt.lua', 'texmfscripts')
dofile(assert(f, 'lua_altgetopt not found'))

should do the trick.

I agree that it is suboptimal, and we'll see to fix this one way or another
(either by changing LUAINPUTS or by installing the files in a lua subdirectory)


More information about the tex-live mailing list