[luatex] luatex manpage not quite the status quo

luigi scarso luigi.scarso at gmail.com
Sun Mar 8 12:09:46 CET 2015


On Sun, Mar 8, 2015 at 6:50 AM, Dirk Laurie <dirk.laurie at gmail.com> wrote:

> It says: "Run the luaTeX typesetter on TEXNAME, usually creating
> TEXNAME.pdf. ... If  called  as texlua it acts as lua interpreter."
>
> There are two gotchas here.
>
> 1. The clear implication is that if called as `luatex` it treats the input
> file as TeX. In fact, if the filename ends in `.lua`, it treats it as Lua.
> This is good, it is what the user would expect — but the manpage
> does not say so.
>
> 2. Input cannot come from STDIN, a filename must be given,
> but `texlua myfile.lua` does not give the same behaviour as
> `lua myfile.lua` would have. The difference is subtle.
>
> The behaviour is as if the lines of `myfile.lua` were entered one
> by one in interactive mode. That is to say, the scope of all local
> variables ends at the end of the line they are defined on, unless
> they are inside an unclosed block. This causes a perfectly valid
> Lua script to fail when run by texlua.
>
> I cannot think of a good reason why this behaviour might be
> desirable. It IHMO would be preferable to make `texlua` behave
> exactly like `lua`. But if there is some subtle reason for it, maybe
> the manpage could warn the user about it.
>
>
hm, could be...can you give an example ?

-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20150308/57633f9d/attachment.html>


More information about the luatex mailing list