I frequently try out stuff and do a little introspection to find out why things (don't) work the way they do. Using boxes and obtaining their width, height and depth is an integral part of this.
As this is temporary hacky stuff I wonder, do I have go the long way of \newsavebox{\blah}\setbox{\blah}{content}
. IIRC boxes are like registeres and they are numbered. So I think I can skip \newsavebox
and just \savebox{16}{content}
.
Is the above guess correct?
If it does work this way, what's a relatively save number to use, i.e.
How does latex give out box numbers?
0-255 or 255-0. I noticed the other day that boxes 0 and 255 have some special meaning and are better left alone.
Are there predefined boxes for such purposes, where it is never save to put content you want to reuse later on?
\def\declarebox#1#2{\newsavebox{#1}\setbox{#1}{#2}}
? But then suddenly you want something else in the main question? Heh. * Or\long\def
*. Anyway,\newsavebox
can be seen in theLaTeX
source:\def\newsavebox#1{\@ifdefinable{#1}{\newbox#1}}
-\newbox
still has to be used seperately, e.g.\newbox\blah \savebox\blah{content}
(see tex.stackexchange.com/questions/76224/…), so if I understand you correctly I'd say the answer is: no. (to that question)\setbox0={content}
. These boxes are seperate from\newsavebox
in the sense that they are already allocated and they have a numerical ID, rather than alphabetic.\setbox0=\hbox
(or\vbox
or ...)\savebox?{...}
is essentially\setbox?=\hbox{...}
plus some other irrelevant things. Here?
is any number or control sequence representing a number (like what happens when you say\newsavebox{\foo}
. No difference.