# [tex-live] Where do I put lua scripts for a package?

Ulrike Fischer news3 at nililand.de
Tue Apr 26 10:36:52 CEST 2011

```Am Tue, 26 Apr 2011 02:41:59 +0200 schrieb Reinhard Kotucha:

>  > >  > I'm not sure. "scripts" is certainly the right place for lua file
>  > >  > connected with an executable, e.g. mkluatexfontdb.lua /
>  > >  > mkluatexfontdb.exe.

>  > >  > But the majority of package puts their lua-files in "tex". Look e.g.
>  > >  > a luaotfload or lualibs. And at my opinion this make sense. These
>  > >  > lua-files are similar to the various .tex files e.g. pgf inputs.

>  > > In this case kpathsea falls back to \$TEXINPUTS and has to scan the
>  > > whole \$TEXMF/tex trees, which is rather inefficient and not desirable.

>  > I don't think that this must be the case. Inefficient searches can
>  > be avoided: Packages can always setup the kpathsea search with the
>  > kpse-functions. As far as I know e.g. luaotfload uses
>  > luatexbase-loader.sty which sets up the search pathes "tex" for
>  > lua-files (kpse.find_file(search_name, 'tex')). And context is doing
>  > its own thing anyway and ignores kpathsea.
>
> But then Lua files are searched in the huge trees which contain all
> the tex input files too.

As all files of the pgf package and all files input during a normal
latex compilation are searched this way, where is the problem when a
few more files must be find there?

My main problem with the scripts folder is that it is not meant for
a lot of lua-files like fontspec.lua or the input files of
luaotfload. If you look at the folder you find in it e.g. perl
scripts and bat-files for *external* tools like makeglossaries
called after or between a latex run. It doesn't contain files
inputed during a normal latex or plainTeX compilation. Also scripts
hasn't a substructure differencied by formats, you can't e.g. make a
hyphen.lua for latex and another one of cslatex.

The OP asked where to put "lua scripts" and naturally this
prejudices the scripts folders. But I wouldn't put too much weight
on the word "script". A tex file is a script too, I have seen people
ask "I have written a tex script. Where should I put it?". And the
answer naturally depends on the content and function of the file. A
"document-tex-file" goes to the document folder, the input of a
latex sty to tex\latex or perhaps to tex\generic, and the source of
a documentation to "doc".