[luatex] lua equivalent of vbox...ht

luigi scarso luigi.scarso at gmail.com
Mon Sep 14 10:33:54 CEST 2009


On Mon, Sep 14, 2009 at 10:18 AM, Patrick Gundlach <patrick at gundla.ch> wrote:
> Another related question:
Does the example before work for you ?

>
>> what would be the lua equivalent of
>>
>> \setbox0\vbox{hello world}
>> \the\ht0
>>
>> ? That is, what would I write inside \directlua{ ... } to get the same
>> effect?
>
> Is it even possible to write this in Lua? I need to invoke the line breaking
> algorithm at some time, how do I do this in Lua?

Write "what" ?
Yes, it's possible to write lua code for this
\setbox0\vbox{hello world}
\the\ht0

but it's longer than the two lines before -- AFAIK  you must build
each node by hands
and pack into a vbox (I don't remember how to pack nodes in vlist )
and then print.

I don't know how to invoke line break algo.
In my opinion
\setbox100=\vbox{\hsize=5cm \input tufte }
is much clearer then basic lua code
You  need some lua layer -- maybe there is something in context base folder.


-- 
luigi


More information about the luatex mailing list