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

Suppose some text is put inside a fixed width box. The text will then continue in vertical direction. How can you measure the total height of that text?

Original text:

text text text text text 

Text in a box constrained to width of text text

text text
text text
text

How long is this?

+
|
+
share|improve this question
    
See also the recent question Why doesn't \settoheight of \parbox work?. – Martin Scharrer Feb 24 '11 at 15:40
up vote 10 down vote accepted

You can make such a box and measure it directly.

\documentclass{article}
\usepackage{calc}
\newlength\foo
\begin{document}
\settototalheight\foo{\parbox{3cm}{text text text text text text text text text}}
\the\foo
\end{document}
share|improve this answer

Your Answer

 
discard

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.