tex >> Get height of stored box

by Peter Jaros » Wed, 28 Apr 2004 11:20:06 GMT

If I've got a box \storedbox, how do I get the height of it?
Specifically, how do I get a \rule to be the same height as a box? I
figured \settoheight{\ruleheight}{\usebox{\storedbox}} would do it, but
it doesn't. Neither does \settoheight{\ruleheight}{\storedbox}.

What's the right way to do this?

Peter

--
-- ---<>--- --
A house without walls cannot fall.
Help build the world's largest encyclopedia at Wikipedia.org
-- ---<>--- --


tex >> Get height of stored box

by Donald Arseneau » Wed, 28 Apr 2004 13:40:53 GMT


Peter Jaros < XXXX@XXXXX.COM > writes:


It does work, so you must have done something else, like...


which is surely wrong.

Maybe you just didn't like the "height" you got, because
you expected height+depth. I don't think there is a
\settototalheight, but there should be.

All \settoheight does is put your box in another box, to
get the height. Since you have a box already, there is no
need for this step, and you can use

\ht\storedbox

directly. (No braces because \ht is not an official LaTeX
command but a TeX primitive.)

Donald Arseneau XXXX@XXXXX.COM



Similar Threads

1. make boxes equal height by first finding the tallest box

2. tabular: store row height for reuse

3. Getting current row height in a table

4. fixed height boxes/text frames?

Greetings -

What I'd like to do is as follows - on each page, have two text frames
(perhaps, minipages), each with a framed box around them. But, I want
them to be the same size, regardless of the text thats actually in the
box (say, each frame is 6 inches wides, 4 inches high). 

Basically, what I've been asked to do is cobble together a program for
a meeting - where individual abstracts are to be printed, two per
page, each in its own 'box'. Some abstracts are longer than others,
but the committee requests (for their own aesthetic reasons, I guess)
that each box be the same height/width, regardless of the length of
the abstract (no abstract is bigger than the box, so no problem
there). 

Should look something like the following (eg. of a single page)


+-----------------------------------------------+
| This is the test for one of the abstracts. It |
| should be right-justified, and all the usual  |
| good stuff...                                 |
|                                               |
|                                               |
|                                               |
+-----------------------------------------------+

+-----------------------------------------------+
| This is the second abstract on this page - it |
| should also be justified, and the box it sits |
| in should be exactly the same length as the   |
| box the preceding abstract sits in, even      |
| though this abstact is longer...              |
|                                               |
+-----------------------------------------------+

I've tried a number of things with minipages, various box approaches -
and while I can set up frames that are a specified width, I haven't
stumbled on the trick to fix the height of the text box, regardless of
the amount of text in the box. 

Suggestions? Pointers to the obvious package I'm missing? 

Thanks...

5. How to determine the height of a box

6. centered box width fixed height and width

Hi!

I'd like to produce a minibook, which is printed an A4 sheets. I'd like
to print full duplex.
On every A4 sheets front will be the front of two minibook sheets,
their 2 backs will be on the back of the a4 sheet - therefore i need
them to be centered correctly.
The other problem is the fixed dimensions of the box containing the
minipage content. How can i create a box with centered position and
fixed width and height, that will not stretch or shrink if the conent
is too big or too small?

thanks for you help!

Christian

7. zero height boxes

8. Determining the height of a box

1. Is there a way in TeX\LaTeX to determine the height of a box?  For
instance, can I draw a dynamically-sized text-filled-box, and then
later on draw some shape with a reference to how tall that original
box was?

2. Same question as #1, except is it possible to reference that same
box-size variable "while" the box is being drawn?  For instance, can I
say something to the effect of "If this box that I am drawing is of
height x, draw it, else don't"?

3. Is there a variable that says how much space is left on the current
page?  Or is it a lot more complicated than that?

Thanks for all your awesome help,
cali