[luatex] How to pass a box from TeX to lua

Andreas Matthias andreas.matthias at gmail.com
Fri Jan 13 21:52:08 CET 2012


Paul Isambert wrote:

> Andreas Matthias <andreas.matthias at gmail.com> a écrit:
>> 
>> \def\bar#1{%
>>   \directlua {
>>     out(#1)
>>   }}
>> \bar{\hbox{a}}
>> 
>> 
>> How can this be done?
> 
> Use a box register, assign your box to it, and retrieve it in Lua:
> 
>       \newbox\mybox
>       \def\bar#1{%
>         \setbox\mybox=#1%
>         \directlua {
>           out(tex.box.mybox)
>         }}
> 
>       \bar{\hbox{a}}

Oh, I see. Thanks.

Ciao
Andreas



More information about the luatex mailing list