Am 13.06.2011 um 14:43 schrieb Christoph Redecker:
Thanks to both of you, all three suggestions work. However, I don't understand all of the code. What does \dowithnextbox do exactly?
It’s a high level version of Luigis example. The content of the box with the text “abc…” is saved in the box nextbox which can be accessed with \flushnextbox, the dimensions of the box are available through the command \nextboxht, \nextboxdp and \nextboxwd.
In your last example, does it define the command \measure just for the next box?
\definemeasure is a alternative to dimension and use a macro to store a length. The first argument is the name of the length and you can access the value with the command \measure{<name>} but i forgot to expand the value of the box in my example and it should be: \dowithnextbox {\expanded{\definemeasure[alphabetlength][\the\nextboxwd]}}% \hbox{abcdefghijklmnopqrstuvwxyz} Wolfgang