Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 8 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
add comment

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.