TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider the following code:



    \parbox[t]{\textwidth}{Line 1\\Line 2\\Line 3\\Line 4}



Address box height: \printlength{\fooboxheight} \uselengthunit{mm} \printlength{\fooboxheight}


\fooboxheight is 7pt / 2mm, much smaller than the height of the \parbox! Why is this? What should I do to get the real height of the \parbox?

Interestingly, if the \parbox is surrounded by a \frame, everything works.

share|improve this question
up vote 16 down vote accepted

Insert the lines


and all will be clear: The height of \foobox is indeed 6.83331pt just as you have found. The depth, on the other hand, is 36pt. Notice that boxes have height and depth both, as measured from the baseline of the box. In this case, this happens because you use \parbox[t]. If you switch to \parbox[b] things might work more like you expect, at least as far as the height calculation goes. But then, of course, the baseline of the box may not be where you need it to be.

share|improve this answer

The calc package also provides the commands \totalheightof and \settototalheight, "totalheight" being the sum of height and depth.

share|improve this answer

It's because of the [t] option. It's sets the official parbox baseline to the baseline of the first line. Therefore the height of the box is the height of the first line. The rest is now part of the official depth.

What you need is the so called totalheight which is height+width. There is no primitive for this, therefore there isn't a \settototalheight. However, if you already have the material inside a savebox you don't need to use these macros anyway, but can use \ht, \dp and \wd to get the height, depth and width of the saved box.

The totalheight can be calculated using the 'calc' package:


or using the eTeX primitive \dimexpr:

share|improve this answer
Actually, the calc package defines \settototalheight. – lockstep Feb 24 '11 at 15:01
@lockstep: Thanks, I didn't know that. I rarely use it since I know about the eTeX primitives and pgfmath. – Martin Scharrer Feb 24 '11 at 15:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.