# The commands \wd, \tp and \ht in TikZ/PGF

What does these commands, \wd, \tp and \ht stand for? I assumed that they are from TikZ and PGF, because I haven't seen them elsewhere.

I think the \wd stands for "width" and the \ht stands for "height", and they somehow obtain the width and the height of the shape that comes after.

I would like to know if I am right about that. Then I would like to know what \tp stands for, and finally I want to ask, if there is any other such commands out there.

I looked for them in the manual to no avail, then also on Google, but the phrase is just too short, probably.

• I think you mean \wd, \ht and \dp (not \tp) which are TeX primitives for getting the width, height and depth of a box. See chapter 5 "Boxes" in "TeX by Topic" by Victor Eijkhout for some suitably gory details. You can get it here. – Mark Wibrow May 7 '15 at 13:57
• @MarkWibrow An answer? – egreg Aug 1 '15 at 21:52
• @egreg Should be... – ThoAppelsin Aug 3 '15 at 18:31

\wd, \ht and \dp (not \tp) are TeX primitives for getting the width, height and depth of a box (respectively).

So, for example,

\newbox\mybox
\setbox\mybox=\hbox{\vrule width10pt height20pt depth 30pt}
\typeout{width=\the\wd\mybox, height=\the\ht\mybox, depth=\the\dp\mybox}


will produce

width=10.0pt, height=20.0pt, depth=30.0pt


Somewhere in the log-file.

More details on boxes can be found in chapter 5 ("Boxes") from TeX by Topic by Victor Eijkhout.