General ⇒ Box height from given width (TeX?)
Box height from given width (TeX?)
I am interested in developing a package for a specific type of tabular layout which cannot be implemented on top of existing table packages. I expect to start with perlTeX and perhaps eventually remove the dependency if I feel masochistic enough to learn TeX internals.
Central to this plan is the need to determine the height of a (fixed-width) parbox for a given text block, as the number is needed for further dimensional calculations - ideally without actually outputting anything as multiple iterations are necessary. I expect this is fairly low level TeX - does anyone know how to do this?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Box height from given width (TeX?)
Anything which is boxed up can in principle be measured using the \ht, \wd and \dp primitives:
Code: Select all
\newbox\tempbox
\tempbox=\hbox{abc}
\newdimen\tempdimen
\tempdimen\ht\tempbox\relax