Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.text Subject: Framing a figure TeX/LaTeX Message-ID: <18629@mimsy.UUCP> Date: 19 Jul 89 15:37:08 GMT References: <955@diemen.cc.utas.oz> <9600@alice.UUCP> <810@csv.viccol.edu.au> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 51 >In article <957@diemen.cc.utas.oz>, ben@tasis.utas.oz.au@munnari.oz >(Ben Lian) writes: >>And here's another question: How can I draw a box around a figure? Tried >>\framebox but it keeps keeling over with a message about not being in outer >>par mode, or something like that. In article <810@csv.viccol.edu.au> dougcc@csv.viccol.edu.au (Douglas Miller) writes: >I would think you need to put your figure into a box before you frame it. 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. 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. \documentstyle{article} \newdimen\mpwidth \begin{document} \section foo \begin{figure} \framebox{%\vbox{ \mpwidth=\textwidth \advance\mpwidth -10pt \begin{minipage}{\mpwidth} Here is some stuff to be inserted in a figure. Now is the time for all good men to come to the aid of their computers. Now is the time for all good men to come to the aid of their computers. Now is the time for all good men to come to the aid of their computers. Now is the time for all good men to come to the aid of their computers. Now is the time for all good men to come to the aid of their computers. Now is the time for all good men to come to the aid of their computers. Now is the time for all good men to come to the aid of their computers. Now is the time for all good men to come to the aid of their computers. Now is the time for all good men to come to the aid of their computers. \end{minipage} } %} \end{figure} \end{document} -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris