🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #918

Re: Strange (incorrect??) tabular behaviour in LaTeX

#918
From: Rainer Schoepf
Date: Thu, 06 Aug 1992 09:10
62 lines
2817 bytes
In article <1992Aug6.042914.24864@newshost.anu.edu.au> sjm@merlin.anu.edu.au (Stephen Meatheringham) writes:

   I am running LaTeX Version 2.09 <7 Dec 1989>, with TeX, C Version 3.14t3 on
   a Sun SPARCstation.

   I have the following LaTeX file which is a very stripped down version of a 
   table, and the alignment of the columns is extremely weird - and as far as I am concerned is
   wrong (well at least it is not what I'd expect!).

   The file is :

   \documentstyle{article}

   \begin{document}

   \begin{tabular}{ccc}
   \multicolumn{3}{c}{this-is-a-very-long-word}\\
   I   & V   & H  \\
   2.2 & 1.9 & 5.2 \\
   1.7 & 2.0 & 2.8 \\
   \end{tabular}

   \end{document}

   Now, what I see is that the 3 output columns (I, V and H) are not spread 
   evenly under the heading, but there is a lot more space between the V and H
   columns than between the I and V columns.    It makes no difference if the
   multicolumn above is one word or a number of words.

   Does anyone have any ideas how to force equal spacing between the columns?
   And can anyone tell me why it doesn't do what I expect it should??

That's a feature of TeX, not of LaTeX. To understand why this happens
you have to carefully read the section in the TeXbook where the
calculation of column widths is explained. In short, in a situation
like yours, where there is material spanning more than one column, all
the excess width is assigned to the last column.

You might try the following:

   \documentstyle{article}

   \begin{document}

   \begin{tabular}{cccc}
   \multicolumn{4}{c}{this-is-a-very-long-word}\\
   I   & V   & H  \\
   2.2 & 1.9 & 5.2 \\
   1.7 & 2.0 & 2.8 \\
   \end{tabular}

   \end{document}

--

   Rainer Schoepf
   Konrad-Zuse-Zentrum                       ,,Ich mag es nicht, wenn
    fuer Informationstechnik Berlin            sich die Dinge so frueh
   Heilbronner Strasse 10                      am Morgen schon so
   W-1000 Berlin 31                            dynamisch entwickeln!''
   Federal Republic of Germany
   <Schoepf@sc.ZIB-Berlin.de> or <Schoepf@sc.ZIB-Berlin.dbp.de>
Technical Details
Message-ID: <SCHOEPF.92Aug6101032@quattro.sc.ZIB-Berlin.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!math.fu-berlin.de!gibb.math.fu-berlin.de!Schoepf
References: <1992Aug6.042914.24864@newshost.anu.edu.au>

Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!math.fu-berlin.de!gibb.math.fu-berlin.de!Schoepf
From: Schoepf@sc.ZIB-Berlin.de (Rainer Schoepf)
Subject: Re: Strange (incorrect??) tabular behaviour in LaTeX
In-Reply-To: sjm@merlin.anu.edu.au's message of Thu, 6 Aug 92 04:29:14 GMT
Message-ID: <SCHOEPF.92Aug6101032@quattro.sc.ZIB-Berlin.de>
Sender: news@math.fu-berlin.de (Math Department)
Reply-To: Schoepf@sc.ZIB-Berlin.de
Organization: Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
References: <1992Aug6.042914.24864@newshost.anu.edu.au>
Date: Thu, 6 Aug 1992 09:10:32 GMT
Lines: 62