[Dev-luatex] [luatex] lua module search behaviour

Élie Roux elie.roux at telecom-bretagne.eu
Sat Apr 13 12:56:45 CEST 2013

> Yes. But package.searchers[2] is quite trivial. In lua code, it would
> look like this:
> function search (name)
> altname = string.gsub(file,'.','/')
> filename = kpse.find_file(altname, 'lua')
> if not filename then
> filename = kpse.find_file(name, 'lua')
> end
> if not filename then
> return string.format("[kpse lua searcher] file not found: %s", name)
> else
> return loadfile(filename)
> end
> end

Ok, I see. Just out of curiosity, what would the package.searchers[3] 
look like? Well, a pointer to the source file would be enough (I have to 
say I'm a bit lost in LuaTeX sources)...

> Just write a thin wrapper to replace '.' with '/', as above.


> That is not possible. It has to return either an error string, or a
> loader function (the result of loadfile()).


Thank you!

More information about the dev-luatex mailing list