[luatex] void box
Andreas Matthias
andreas.matthias at gmail.com
Tue Feb 7 23:53:08 CET 2012
Patrick Gundlach wrote:
> Am 07.02.2012 um 18:48 schrieb Andreas Matthias:
>
>>
>> Actually I was just looking for a simple node as a starting point
>> for a list of nodes which are generated in some kind of loop.
>> I think an hlist node is very suitable for this:
>>
>>
>> list = node.new(node.id('hlist'))
>
> you can say: node.new("hlist")
>
>
>> curr = list
>>
>> for i=0,5 do
>> n = node.new(node.id('glyph'))
>> n.font=1
>> n.char=97+i
>>
>> curr.next = n
>> curr = n
>> end
>
> that's fine, but you don't use 'list', right?
You mean the very first node of the list. Yes, it's just the head
of the list with no special meaning.
> you can create a node chain and use node.hpack(mychain) to get a hbox. You don't need one from start.
Well, if the first node is missing, I have to check inside the
loop for each created node whether or not it becomes the head
of the list. I think the code is much clearer without additional
if-clauses. And one can always remove the very first node
afterwards. -- Okay, maybe not a big advantage. But this was
the reason why I started to look for a suitable header of a
node list, i.e. an empty or void box. And I was astonished to
realize that I didn't know what a \voidb at x really was.
Ciao
Andreas
More information about the luatex
mailing list