What is the right way within a script to measure the content of a node tree? #1599
-
I see there's a I hope it will return a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you just have a node, say an hbox or a vbox or something you should just be able to ask it for the measurement you want. All nodes have width and length properties that are measurements and (at least once they are shaped) should tell you about their sizes. An exact use case might shed some light on how/when to grab that info. You might look at the definition of
That typeset a tree of content into an hbox, kept the result in a variable but nuked it from the actual output queue so it wouldn't appear anywhere. It then goes on to use |
Beta Was this translation helpful? Give feedback.
If you just have a node, say an hbox or a vbox or something you should just be able to ask it for the measurement you want. All nodes have width and length properties that are measurements and (at least once they are shaped) should tell you about their sizes. An exact use case might shed some light on how/when to grab that info.
You might look at the definition of
float()
inpackages/frametricks.lua
for an example that also is an example of an "undo" (see #925):That typeset a tree of content into an hbox, kept the result in a variable but nuked it from the actual output queue so it wou…