[luatex] Dimensions of sub-boxes?

Eduardo Ochs eduardoochs at gmail.com
Thu Mar 7 04:56:27 CET 2019


Perfect!
Thanks! =) =)
  E.

On Thu, 7 Mar 2019 at 00:38, Henri Menke <henrimenke at gmail.com> wrote:

>
>
> On 7/03/19 4:15 PM, Eduardo Ochs wrote:
> > Hi list,
> >
> > sorry, I know that this _should_ be trivial but I can't figure out how
> > to do it from the manual...
> >
> > Suppose that I set the box 0 by running this:
> >
> >   \setbox0\hbox{%
> >     \hbox{a}%
> >     \hbox{bcde}%
> >     \hbox{fg}%
> >   }
> >
> > How do I get - from Lua - number of sub-boxes of box0 and the width,
> > the height and the depth of each one?
>
> Units are sp.  To get pt, divide by 2^16.
>
> \setbox0\hbox{%
>   \hbox{a}%
>   \hbox{bcde}%
>   \hbox{fg}%
> }
>
> \directlua{
> for hlist in node.traverse_id(node.id"hlist", tex.box[0].list) do
>     print(hlist.width, hlist.height, hlist.depth)
> end
> }
>
> \bye
>
> >
> >   Thanks!
> >     Eduardo Ochs
> >     http://angg.twu.net/dednat6.html
> >     http://angg.twu.net/math-b.html
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20190307/8ddab4bf/attachment.html>


More information about the luatex mailing list