🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #1316

Re: Explanation needed for \multispan behavior

#1316
From: David Carlisle
Date: Tue, 11 Aug 1992 11:18
64 lines
3125 bytes
In article <15up48INN51r@point.mps.ohio-state.edu> overman@point.mps.ohio-state.edu (Ed Overman) writes:


Ed> I am experiencing strange behavior (at least to me) when using \multispan
......
Ed> \newcount\CC \CC = 2
Ed> \count37 = 2
Ed> \tabskip=0pt
Ed> \halign{&#\hfil\cr
Ed>         xxx&yyy&zzz&uuu\cr               %1
Ed>         x&\multispan{\CC}z&u\cr          %2
Ed>         x&\multispan{\count37 }z&u\cr    %3
Ed>         x&\multispan{\count37}z&u\cr     %4
Ed>         x&\multispan{\the\CC}z&u\cr      %5
Ed>         x&\multispan{2}z&u\cr            %6
Ed>         x&\multispan{\the\CC} z&u\cr     %7
Ed>         x&\multispan{\the\CC}\ z\ &u\cr} %8

Ed> I do not understand the behavior of \multispan in lines 7 and 8 of \halign
Ed> (see below).  I do not understand why 1 space on the left causes the 'z' to be
Ed> moved all the way to the right and why 1 space on each side causes the 'z' to
Ed> be centered.  Why then is the 'z' left justified if there are NO spaces on
Ed> either side.  \multispan is discussed on page 243 where it says that "that
Ed> hbox will be preceded by glue of width $g_0$ and it will be followed by glue
Ed> of width $g_3$ ..."  However, I have explicitly set the tabskip glue to 0pt.
Ed> So what is going on.  Any explanations will be greatly appreciated.
 ....


In all cases, the \hbox containg the z has a width spanning the width
of the two columns. The white space around the z is not from tabskip
glue, which goes *between* the hboxes containing the entries. It is
space *inside* the hbox.

all the lines equivalent to
        x&\multispan{2}z&u\cr            %6

actually produce an underfull box, as the hbox only contains `z', TeX
fills this up with some white space on the right. 

The line
        x&\multispan{\the\CC} z&u\cr     %7
produces an hbox containing ` z'. As the box is underfull, TeX
stretches the only available glue to fill up the hbox, this puts the z
flush right.

The line 
        x&\multispan{\the\CC}\ z\ &u\cr} %8
produces ` z ' which is still underfull, but now there is glue on both
side of the Z, so TeX stretches this glue equally, centering the z.

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.92Aug11121804@r8d.cs.man.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!mucs!m1!carlisle
References: <15up48INN51r@point.mps.ohio-state.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: Explanation needed for \multispan behavior
Message-ID: <CARLISLE.92Aug11121804@r8d.cs.man.ac.uk>
Date: 11 Aug 92 11:18:04 GMT
References: <15up48INN51r@point.mps.ohio-state.edu>
Sender: news@cs.man.ac.uk
Organization: Department of Computer Science, University of Manchester
Lines: 64
In-reply-to: overman@point.mps.ohio-state.edu's message of 7 Aug 92 21:14:48 GMT