Newsgroups: comp.text.tex
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!mintaka!news
From: dmjones@theory.lcs.mit.edu (David M. Jones)
Subject: Re: Help on tabular environment
In-Reply-To: dmjones@theory.lcs.mit.edu (David M. Jones)
Message-ID: <1991Jun14.212820.1290@mintaka.lcs.mit.edu>
Sender: news@mintaka.lcs.mit.edu
Reply-To: dmjones@theory.lcs.mit.edu (David M. Jones)
Organization: Laboratory for Computer Science, MIT
References: <009499D5.177367A0.6104@Niord.SHSU.edu> <5434@network.ucsd.edu> <1991Jun14.140857.25984@mintaka.lcs.mit.edu>
Date: Fri, 14 Jun 91 21:28:20 GMT
Lines: 129

I apologize if this goes out more than once.  The local news machine
has been flaky, and I tried to send from another host, but I don't
think it worked.

In article <1991Jun14.140857.25984@mintaka.lcs.mit.edu> I wrote:

>I'm not sure what the correct solution is [...] (Perhaps we should
>just redefine \@mkpream to count the columns while it is constructing
>the preamble?)

After a little thought, I decided that this was relatively painless,
since it involves modifying only the very macro which has been causing
us troubles, namely \@tablcassz.  At least, I think this is true.  Can
someone with a better understanding of the array code confirm (or
deny) that my solution is robust?  Diffs are included below.  I can
also send the entire new file to anyone who would prefer it that way.
------------------------------------------------------------------------------
David M. Jones                             |"I've just come across a fascinat-
17 Simpson Ave #1; Somerville, MA 02144    | ing piece in the Times.  Concerns
ARPANET: dmjones@theory.lcs.mit.edu        | the effects of lack of sleep 
UUCP: ...!mit-eddie!mit-athena!dmjones     | among the marginally sane."
------------------------------------------------------------------------------

*** longtable.sty	Fri Jun 14 14:09:04 1991
--- longtable.sty.ori	Fri Jun 14 14:13:23 1991
***************
*** 33,47 ****
  % The rest of the code is just window dressing to give the whole thing a more
  % LaTeX-like feel.
  
! % 6/14/91  Modifications by David M. Jones (dmjones@theory.lcs.mit.edu)
! %          Attempted to fix incompatbility with Mittelbach and
! %          Schoepf's font selection scheme caused by the redefinition
! %          of \@tabclassz in lfonts.new to add an additional level of
! %          braces inside the \halign preamble.
! 
  
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- 
  \newbox\LT@head%          Box for the table head (maybe not the first page).
  \newbox\LT@firsthead%     Box for the head of the first page of the table.
  \newdimen\LT@head@ht%     Height of the head (= max of \ht of the head boxes).
--- 33,40 ----
  % The rest of the code is just window dressing to give the whole thing a more
  % LaTeX-like feel.
  
! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  \newbox\LT@head%          Box for the table head (maybe not the first page).
  \newbox\LT@firsthead%     Box for the head of the first page of the table.
  \newdimen\LT@head@ht%     Height of the head (= max of \ht of the head boxes).
***************
*** 81,104 ****
    \topskip\z@
    \@ifnextchar[{\LT@array}{\LT@array[x]}}
  
- %% 6/14/91 Redefined \@tabclassz to be consistent with the
- %% redefinition in Mittelbach and Schoepf's lfonts.new and to
- %% automatically count the columns as it is constructing the preamble.
- %% I think this is robust. -- David M. Jones (dmjones@theory.lcs.mit.edu)
- 
- \def\@tabclassz{\ifcase \@lastchclass
-        \@acolampacol \or \@ampacol \or
-        \or \or \@addamp \or
-        \@acolampacol \or
-        \@firstampfalse \@acol \fi
-  \advance\LT@cols\@ne           %% Added by dmjones
-  \edef\@preamble{\@preamble{%
-    \ifcase \@chnum
-      \hfil\ignorespaces\@sharp\unskip\hfil
-     \or \ignorespaces\@sharp\unskip\hfil
-     \or \hfil\hskip\z@
-        \ignorespaces\@sharp\unskip\fi}}}
- 
  \def\LT@array[#1]#2{\refstepcounter{table}%
    \xdef\LT@save@row{%
      \expandafter\noexpand\csname LT@\romannumeral\c@table\endcsname}%
--- 74,79 ----
***************
*** 111,122 ****
    \setbox\@arstrutbox=\hbox{\vrule
       height\arraystretch \ht\strutbox
       depth\arraystretch \dp\strutbox
!      width \z@}%
! %% Following lines modified by David M. Jones to fix incompatibility
! %% with M&S font selection scheme
!    \LT@cols=\z@%
!    \@mkpream{#2}%
! %  \expandafter\LT@nofcols\@preamble\@sharp\end
    \LT@test
    \edef\@preamble{\tabskip\LTleft\halign to \hsize\bgroup
      \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}%
--- 86,94 ----
    \setbox\@arstrutbox=\hbox{\vrule
       height\arraystretch \ht\strutbox
       depth\arraystretch \dp\strutbox
!      width \z@}\@mkpream{#2}%
!   \LT@cols=\z@
!   \expandafter\LT@nofcols\@preamble\@sharp\end
    \LT@test
    \edef\@preamble{\tabskip\LTleft\halign to \hsize\bgroup
      \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}%
***************
*** 172,184 ****
    \LT@get@widths
    \setbox\z@=\vbox\bgroup\@preamble}
  
! %% These macros are no longer needed.
! %% David M. Jones (6/14/91)
  
! %%  \def\LT@nofcols#1\@sharp{\futurelet\next\@LT@nofcols}
! %%  
! %%  \def\@LT@nofcols{\ifx\next\end\let\next\@gobble
! %%    \else\def\next{\advance\LT@cols\@ne\LT@nofcols}\fi\next}
  
  \def\LT@test{\expandafter\ifx\LT@save@row\relax\LT@blank@row\else
    \ifLT@save@row\LT@blank@row\fi\fi}
--- 144,153 ----
    \LT@get@widths
    \setbox\z@=\vbox\bgroup\@preamble}
  
! \def\LT@nofcols#1\@sharp{\futurelet\next\@LT@nofcols}
  
! \def\@LT@nofcols{\ifx\next\end\let\next\@gobble
!   \else\def\next{\advance\LT@cols\@ne\LT@nofcols}\fi\next}
  
  \def\LT@test{\expandafter\ifx\LT@save@row\relax\LT@blank@row\else
    \ifLT@save@row\LT@blank@row\fi\fi}

