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

Heiko Oberdiek heiko.oberdiek at googlemail.com
Sun Mar 28 15:39:39 CEST 2010


On Sun, Mar 28, 2010 at 07:48:39AM +0200, Khaled Hosny wrote:

> The lua_altopt module installed under texmf-dist/scripts/ is not seen by
> kpse, and since luatex's "require()" use kpse to find files, I can't
> require the texlive installed module.

The search algorithm for require can be extended, see
luatex-loader.sty/oberdiek.luatex.lua:

-- oberdiek.luatex.lua
module("oberdiek.luatex", package.seeall)
function kpse_module_loader(module)
  local script = module .. ".lua"
  local file = kpse.find_file(script, "texmfscripts")
  if file then
    local loader, error = loadfile(file)
    if loader then
      texio.write_nl("(" .. file .. ")")
      return loader
    end
    return "\n\t[oberdiek.luatex.kpse_module_loader] Loading error:\n\t"
           .. error
  end
  return "\n\t[oberdiek.luatex.kpse_module_loader] Search failed"
end
table.insert(package.loaders, kpse_module_loader)
-- end of file

However I haven't solved the problem with submodules yet.

Yours sincerely
  Heiko Oberdiek


More information about the tex-live mailing list