[luatex] invoking a lua script in TeX

Paul Isambert zappathustra at free.fr
Tue Apr 12 13:39:51 CEST 2011


Le 12/04/2011 13:33, Bob Tennent a écrit :
> Dirk:
>
> I've added
>
> \ifx\undefined\directlua \else \directlua {
>     musixflx = kpse.find_file("musixflx.lua")
>     dofile(musixflx)}%
> \fi%
>
> to the definition of \endmuflex and it basically works. But when I add
> an assignment to the lua code as follows:
>
> \ifx\undefined\directlua \else \directlua {
>     name_of_file = \jobname
>     musixflx = kpse.find_file("musixflx.lua")
>     dofile(musixflx)}%
> \fi%

Here you'd better use the Lua equivalent of \jobname:
name_of_file = tex.jobname

Otherwise, you could have added a space by hand:
\def\space{ }
...
name_of_file = \jobname\space

Changing catcodes is part of a larger strategy that wouldn't work in the 
definition of a macro.

Best,
Paul




More information about the luatex mailing list