# [luatex] lua scripts

Reinhard Kotucha reinhard.kotucha at web.de
Wed Apr 20 19:22:16 CEST 2011

On 2011-04-20 at 12:20:25 -0400, Bob Tennent wrote:

>  >|
>  >|  #! /usr/bin/env texlua
>  >|
>  >|  put them under scripts, and create a symlink in bin.
>  >|
>  >|Yes, but what I do for Windows? I can create a bat script but apparently
>  >|the full path to the lua script is needed and that would depend on where
>  >|the user installs the latter.
>
> > cd bin\win32
>   copy /b runscript.exe script.exe
>
>   At least if your script is called script.lua and you have TeX Live.
>
> But not if the user has MikTeX.

In this case you have to put it into a directory which is in PATH and
assign the extension .lua to the texlua binary in the registry.  I'm
wondering whether MiKTeX does this already.  You can check with the
programs assoc and ftype.

BTW, this might cause trouble if you have Lua intalled too, thus TeX
Live supports the extensions .tlu and .texlua too.

> Lua scripts seem to fall between the executable PATH and the kpse
> system.

No, they don't fall between anything.  They are scripts end their
interpreter has kpathsea built in.

> Why shouldn't lua scripts be treated as data for texlua?

Because they are scripts and have to be treated so.  I don't want to
specify the interpreter on the command line each time I run my
scripts.  But you can call the scripts from .tex files.  I this case
they are found in TEXMF.

Regards,
Reinhard

--
----------------------------------------------------------------------------
Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------