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.

  • 6
    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. Commented May 7, 2015 at 13:57
  • @MarkWibrow An answer?
    – egreg
    Commented Aug 1, 2015 at 21:52
  • @egreg Should be... Commented Aug 3, 2015 at 18:31
  • Updated version (revision 1.5, 2019) of Eijkhout's TeX by Topic: web.corral.tacc.utexas.edu/CompEdu/pdf/TeX/TeXbyTopic.pdf Commented Jun 5, 2022 at 5:40

1 Answer 1


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

So, for example,

\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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .