Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!husc6!yale!leichter From: leichter@CS.YALE.EDU (Jerry Leichter) Newsgroups: comp.text Subject: Re: Framing a figure TeX/LaTeX Message-ID: <67002@yale-celray.yale.UUCP> Date: 20 Jul 89 18:43:17 GMT Sender: root@yale.UUCP Organization: Yale Computer Science Department, New Haven, Connecticut, USA Lines: 36 X-from: leichter@CS.YALE.EDU (Jerry Leichter (LEICHTER-JERRY@CS.YALE.EDU)) In article <18629@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes... >Framing a figure is a nefariously nasty typesetting task. (A little >alliteration there. :-) ) The same problem applies to tables. Both >of these are categories of `insertions' (or what troff calls `floats'). >These are normally not typeset until the last possible moment. If >there is any adjustable vertical glue, TeX wants to be able to use >it to fix up the page height. The frame cannot be set until TeX >knows exactly how big the figure (or table) will be. The question here is, exactly what do you want the frame to enclose? If you want it to enclose the CONTENTS of the figure, with spacing added around it, you can do that by making the contents an object with a frame around it. LaTeX inserts shrinkable/expandable glue between figures and a between them and the main text. On the other hand, if you want the frame to enclose "the space taken up by the figure", in general the only solution would be to modify LaTeX to get it to box up figures as it inserts them. Fortunately, this is not a common requirement. >Anyway, putting it in a box is the right approach. You can make an >`unbreakable' \vbox containing an \hbox that frames the insertion. >The handiest way to do this in LaTeX is to put the figure inside a >`minipage'. This needs to know how wide to set the figure. Alas, >\framebox adds about 10pt of spacing. I faked it out below, but to >do it right requires knowing exactly how much space \framebox adds. > [example omitted] The spaced added around a framebox is given by \fboxsep, which you can change within a group surrounding the \framebox. However, there is a simpler solution: Get the boxedminipage style file from the latex-style collection at Clarkson. A boxedminipage is just like a minipage, except that it is surrounded by a box, with \fboxsep of space separating the enclosed text from the box. -- Jerry