[luatex] lua scripts

Reinhard Kotucha reinhard.kotucha at web.de
Thu Apr 21 02:56:53 CEST 2011

On 2011-04-20 at 23:03:32 +0100, T T wrote:

 > On 20 April 2011 21:26, Bob Tennent <rdt at cs.queensu.ca> wrote:
 > >
 > >> Ask on the MikTeX list.
 > >
 > > I did. They sent me here.
 > Who did?  Odd advice.  We are not developing MikTeX.  I can tell you
 > all about script wrapping in TeX Live, but not in MikTeX.  This is not
 > something standardized, like TDS.
 > >
 > >> AFAIR, MikTeX automatically creates exe stubs
 > >  for perl and batch scripts located under <TEXMF>/scripts.  I wouldn't
 > >  be surprised if the same is done for (TeX)Lua scripts.
 > >
 > > That would seem sensible. But it doesn't happen if you just put a lua
 > > script under <TEXMF>/scripts and hit "Refresh FNDB"; perhaps it happens
 > > when a MikTeX package is being put together.
 > I just tried, it doesn't seem to work even for perl / batch scripts.
 > Maybe I remember it wrong.
 > Anyway, on MikTeX 2.9 the following batch works (should be a single
 > line in case it gets broken):
 >   @for /f "delims=" %%I in ('kpsewhich --format=texmfscripts
 > %~n0.lua') do texlua %%I %*
 > (If you save it as foo.bat, it will search and launch foo.lua script.)

Bob, is your question related to the texlua scripts you just uploaded
to CTAN?

It's great that you ported the system-dependent programs to texlua.  
I suppose that musixflex can only be replaced when TeX Live is frozen
because the binaries have to be removed.

Regarding MiKTeX, I recommend to ask Christian Schenk directly.
I don't think that MiKTeX users can be convinced to install the
scripts and create wrappers themselves.

BTW, in musixtex.lua:

 print("This is musixtex.lua.")

I would add the version number here.

 tex = "etex "  -- can replace etex by epdftex if not using Postscript slurs


If you want encourage people to modify the source code, it's better
not to rely on the space in the tex variable.  It's better to write

os.execute(tex .. " " .. basename)

It would be better to allow people to specify an alternative engine on
the command line instead of changing the code.

Is it necessary to disallow users to enter the file name properly?
IMO it's bad enough that TeX allows to omit the extension.

Instead of 

  basename = arg[1]
  io.open(basename .. ".tex", "r")
  os.execute(tex .. basename)
you can simply write:

  io.open(arg[1], "r")
  os.execute(tex .. " " .. arg[1])
In order to create the .ps and .pdf names, you can strip the extension
".tex" if it exists.

BTW, there is a manual page for musixflx in TeX Live.  I fear that it
gets lost if you don't copy it to the CTAN package.


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.

More information about the luatex mailing list