[luatex] Accessing external Lua libraries

Hans Hagen j.hagen at xs4all.nl
Thu Mar 25 13:31:29 CET 2021


On 3/25/2021 1:12 PM, Faheem Mitha wrote:

> So, a couple of questions.
> 
> First, is it necessary to add stuff to the search path at the TeX end 
> (kpse or whatever)? My experience is that adding stuff at the Lua end 
> suffices for my needs. But of course my experience does not cover all 
> use cases, and I think I've avoided using luarocks.

you also need to match the lua version (irr luarocks is overkill and can 
interfere badly)

> Second, is there some reason not to include the functionality of 
> luapackageloader by default in LuaTeX? Then the Lua paths would work as 
> expected. It might still make sense to have the functionality as a 
> separate package, in case people wanted to disable that functionality 
> for some reason. Though I can't imagine why they would want to.

see below ... demands differand we don't impose a strategy

> I originally became aware of LuaTeX around 2012, but at that time I 
> could not figure out a way to load external packages, though since I 
> don't recall asking for help at the time, I probably did not pursue it 
> very hard. But if this had worked out of the box for me then (and as 
> stated I can't see any reason why it shouldn't), I would have started 
> using LuaTeX much earlier.
it has always been possible to load libraries, luatex has some 
protection against loading but that's real low level inhibition

dealing with this is upto the macro package because tex has rules about 
where it looks for files and might want to limit choices for all kind of 
reasons (like security or interference); there is a long tradition of 
dealing with files of any kind in tds and that's not going to change; 
much in tex that has to do with files also relates to long term stability

so, for stability you might want to put lua files and binary modules in 
the tex binary tree but lua files can be put elsewhere too; maybe you 
want some specific version over some other; maybe you don't want 
interference with what other programs put in the lua lookup paths; you 
hav eto match the lua version in luatex anyway; there is no universal 
approach to this

there is no need to change anything as a macro package can put whatever 
loader it wants on top of what is already there; of course it also 
depends on what paths are defined in the configuration file (when you 
use kpse); if it doesn't work then it's probably because no one bothered 
  to deal with it (which is an indication of something hardly being 
used) so you can try to get support for your approach in the macro 
package that you use

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the luatex mailing list.