%   supertab.sty
%
%       c't 4/91                            S.  8
%       LaTeX Erweiterungsm”glichkeiten     S. 24


\def\@tablehead{\ }
\def\tablehead#1{\gdef\@tablehead{#1}}
\def\@tabletail{\ }
\def\tabletail#1{\gdef\@tabletail{#1}}
\newcount\numline
\newcount\maxline


\def\calmaxline
{
  \global\maxline=\textheight
  \global\divide\maxline by \baselineskip
  \global\multiply\maxline by 9
  \global\divide\maxline by 10
}


\newenvironment{supertabular}[1]{
  \edef\tableformat{\string#1}
  \numline=0
  \calmaxline

  \begin{tabular}{\tableformat}\@tablehead}{\@tabletail \end{tabular}}


\def\nextline
{
  \global\advance\numline by 1 \\
  \ifnum\numline=\maxline
    \@tabletail
    \end{tabular}
    \clearpage
    \begin{tabular}{\tableformat}
    \@tablehead
    \global\numline=0
  \fi
}

