[luatex] print versus tex.print

luigi scarso luigi.scarso at gmail.com
Mon Jan 23 14:18:21 CET 2012


2012/1/23 Herbert Voss <Herbert.Voss at fu-berlin.de>

> this works with Lua
>
> table.foreach(os.date("!*t"),**print)
>
> but when I replace print with tex.print I'll get
> an error because tex.print doesn't know how to
> handle the last boolean value of the date table.
>
> \directlua{table.foreach(os.**date("!*t"),tex.print)}
> \bye
>
> ! LuaTeX error no string to print
> stack traceback:
>        [C]: ?
>        [C]: in function 'foreach'
>        <\directlua >:1: in main chunk.
> l.1 ...ua{table.foreach(os.date("!***t"),tex.print)}
>
>
> I can handle the last table entry as a special case, no problem.
> But is there an easy way to catch a boolean value?
>
> Herbert
>

\directlua{table.foreach(os.date("!*t"),function(...)
tex.print(tostring(...) end)}
\bye
untested
-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20120123/79da1a57/attachment.html>


More information about the luatex mailing list