[luatex] node.vpack question

Henri Menke henri at henrimenke.de
Wed Feb 17 08:55:15 CET 2021


On Wed, 2021-02-17 at 03:04 +0000, Robert Krug wrote:
> Greetings,
> 
> I may be missing something fundamental, but I find this behaviour surprising:
> 
> This will cause an error:
> 
> node.vpack(node.new("glyph"))
> 
> ! This can't happen (vpack).
> 
> This will not:
> 
> node.hpack(node.new("glyph"))
> 
> Is this intended?  I had thought of vpack and hpack as analogous operations,
> just differing in how they stacked items.

A vlist is a vertical list of hboxes.  You have to use

   node.vpack(node.hpack(node.new("glyph")))

I guess you are asking why \vbox{A} works, but node.vpack(node.new("glyph"))
does not and the answer is that the "A" will trigger an implicit hbox.  You can
see that if you do

   \setbox0=\vbox{A}
   \showbox0

and then take a look in the log file

   > \box0=
   \vbox(6.83331+0.0)x469.75499, direction TLT
   .\hbox(6.83331+0.0)x469.75499
   , glue set 442.25497fil, direction TLT
   ..\localpar
   ...\localinterlinepenalty=0
   ...\
   localbrokenpenalty=0
   ...\localleftbox=null
   ...\localrightbox=null
   ..\hbox(0.0+0.0)x
   20.0, direction TLT
   ..\tenrm A
   ..\penalty 10000
   ..\glue(\parfillskip) 0.0 plus
   1.0fil
   ..etc.

You see that there is an implicit hbox nested inside the vbox.

Cheers, Henri 

> 
> I am using LuaTeX as shipped with TeXLive 2020.
> 
> Thanks,
> Robert
> 



More information about the luatex mailing list.