[luatex] external modules from the (Linux) distro

Manuel Pégourié-Gonnard mpg at elzevir.fr
Thu Aug 11 23:45:27 CEST 2011


Hi again,

Le 09/08/2011 19:20, Manuel Pégourié-Gonnard a écrit :
> I installed a JSON lua module using the tools of my distro (aptitude install
> liblua5.1-json) and it (obviously) works fine with stock lua.
> 
> However, I can't easily use it with LuaTeX (tested in texlua mode, kpse not
> initialised):
> 
On a related note, I just ran some tests with kpse initialised and observed that
the kpse loader completely overrides the standard loader. It is obviously doable
(and easy) to reimplement the standard package.path-based searcher in Lua and
insert it in the package.loaders table, but it's a pity since this loader
already exists in LuaTeX.

In other words, unless I'm mistaken the current logic for package.loaders[2] is
the following:

if (kpse not initialised)
	/* use standard loader and return */
/* try using kpse and return */

May I suggest to change that to:

if (kpse initialised) {
	/* try using kpse */
	if (it worked)
		/* return */
}
/* use standard loader and return */

(And similarly for package.loaders[3] and [4].)

Thanks,
Manuel.


PS: this is sort of orthogonal to my previous post, which was about the value of
package.(c)path, while this one is about whether this value is used or not when
kpse is initialised.


More information about the luatex mailing list