Article View: comp.text.tex
Article #2423Re: Finding width of on-going \halign
From: David Carlisle
Date: Tue, 18 Aug 1992 10:38
Date: Tue, 18 Aug 1992 10:38
39 lines
2413 bytes
2413 bytes
>>>>> On 18 Aug 92 02:08:40 GMT, mjm@spekl.as.arizona.edu (Mark McCaughrean) said:
Mark> In the middle of an \halign, I want to use \noalign to set a
Mark> paragraph of text (say). I want this paragraph to have the same
Mark> width as the table I'm setting using \halign. How do I get TeX
Mark> to tell me what the width of the table is, i.e. the width of the
Mark> vertical box I'm currently in the middle of? (I don't want to use
Mark> \multispan, by the way: I want the exact width of the table, and
Mark> I don't want to have to know how many columns to span).
Mark> I figured I could make a \setbox with an \hrule inside it,
Mark> hoping the \hrule would be the width of the table, and that then
Mark> I could use \wd to get the width of the box. I can't get it to
Mark> work. Seems like TeX must know the width though, or does it only
Mark> work it out when it has digested the whole table?
TeX only `knows' the widths when it completes the table. This makes
what you want to do quite tricky, One possibilty is to put the whole
table in a \setbox0=\vbox{ } then you can get the final width of the
table using \wd0. You then `only' have to \lastbox your way back up
the table, removing one row at a time, back to the point where you
want to insert your vertical material, then you can
\unvbox0 % the top half of the table
{\hsize=<saved value of \wd0>
your stuff}
\unvbox<where ever you have saved the bottom of the table>
David
--
David Carlisle
JANET: carlisle@uk.ac.man.cs
Computer Science Department
Manchester University
Oxford Road
Manchester
England
M13 9PL
Technical Details
Message-ID:
<CARLISLE.92Aug18113834@r8d.cs.man.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!mucs!m1!carlisleReferences:
<1992Aug18.020840.20852@organpipe.uug.arizona.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!mucs!m1!carlisle From: carlisle@cs.man.ac.uk (David Carlisle) Newsgroups: comp.text.tex Subject: Re: Finding width of on-going \halign Message-ID: <CARLISLE.92Aug18113834@r8d.cs.man.ac.uk> Date: 18 Aug 92 10:38:34 GMT References: <1992Aug18.020840.20852@organpipe.uug.arizona.edu> Sender: news@cs.man.ac.uk Organization: Department of Computer Science, University of Manchester Lines: 39 In-reply-to: mjm@spekl.as.arizona.edu's message of 18 Aug 92 02:08:40 GMT