[Dev-luatex] Some questions

Hans Hagen pragma at wxs.nl
Tue Sep 18 13:00:12 CEST 2007


Jonathan Sauer wrote:
> Hello,
> 
> thanks for your quick reply!
> 
>> [...]
>>> - How do I generate an error when inside Lua code? I could use
>>>   tex.write("\\errmessage{...}"), but then the error would only be
>>>   generated after the Lua code has finished executing, and after
>>>   any TeX code created previously using tex.write et.al. has
>>>   been executed.
>> - assert
>> - just print messages using texio.write_nl
>> - os.exit() also works
> 
> The last one is a bit radical ;-)
> 
> I was hoping to be able to say i.e. "error(message,help)" and get TeX's
> error prompt where the user can decide how to proceed.

revamping the eror handling mechanism is on the agenda for next year

> But what about the other way round? What if I do not want to define
> control sequences, but access their meaning from Lua code, just as
> it is possible with registers? Is there a way?

currently not, also a bit tricky because how to deal with expansion and 
such, i can imagine tex.meaning to work

another solution is a tex.macro that gives back a table with tokens 
(like tex.toks) but whatver solution is chose, you then have to parse 
yourself.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-luatex mailing list