summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/supertabular
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/supertabular
Initial commit
Diffstat (limited to 'macros/latex/contrib/supertabular')
-rw-r--r--macros/latex/contrib/supertabular/CATALOG28
-rw-r--r--macros/latex/contrib/supertabular/ChangeLog233
-rw-r--r--macros/latex/contrib/supertabular/MANIFEST8
-rw-r--r--macros/latex/contrib/supertabular/README21
-rw-r--r--macros/latex/contrib/supertabular/supertabular.dtx1582
-rw-r--r--macros/latex/contrib/supertabular/supertabular.ins71
-rw-r--r--macros/latex/contrib/supertabular/supertabular.pdfbin0 -> 159124 bytes
7 files changed, 1943 insertions, 0 deletions
diff --git a/macros/latex/contrib/supertabular/CATALOG b/macros/latex/contrib/supertabular/CATALOG
new file mode 100644
index 0000000000..d23ab1e389
--- /dev/null
+++ b/macros/latex/contrib/supertabular/CATALOG
@@ -0,0 +1,28 @@
+Name: supertabular (also called supertab)
+Problems-To: texniek@braams.cistron.nl
+Author: J.L. Braams and T. Jurriens
+Version: 4.1d
+
+Description:
+
+The supertabular bundle defines the environments supertabular,
+supertabular*, mpsupertabular and mpsupertabular*.
+They make it possible to have a tabular that spans multiple pages.
+Each page is its own tabular environment, thus the various parts
+may have different widths.
+The mp-variants put the tabulars that make up the supertabular in
+minipage environments to make it easy to add footnotes to the tabular
+and have them printed on the same page as where the footnotemarker
+occurs.
+
+Keywords: latex, long tables
+
+See-Also: the array package (longtable.sty);
+The LaTeX Companion, by Goossens, Mittelbach and Samarin,
+ISBN 0-201-54199-8.
+
+Address:
+TeXniek
+Kersengaarde 33
+2723 BP Zoetermeer
+The Netherlands
diff --git a/macros/latex/contrib/supertabular/ChangeLog b/macros/latex/contrib/supertabular/ChangeLog
new file mode 100644
index 0000000000..cadcb72935
--- /dev/null
+++ b/macros/latex/contrib/supertabular/ChangeLog
@@ -0,0 +1,233 @@
+2001-08-21 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : The macro \ST@next needs to be defined when
+ \ST@skippage was called. Therefore I moved the default definition
+ to earlier in the code; just before the \if clause after which it
+ is called; possibly defined by \ST@newpage. This problem was
+ reported by Andrew Dorrell (dorrell@research.canon.com.au).
+
+1999-08-08 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : No longer re-initialize the internal variable
+ \@table@first@head and \@table@last@tail. This made it impossible
+ to have more than one supertabular in the same document with the
+ exact same appearance of the heads and tail without repeatedly
+ redeclaring the firsthead and/or lasttail. Reported by Christian
+ Matuszewski (matuszew at informatik.uni-halle.de).
+
+Fri Nov 7 20:27:27 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : For standard LaTeX we need to change
+ \@@startpbox not \@startpbox. Found by Peter R Wilson
+ (Peter.Wilson@PSS.Boeing.com)
+
+Wed Oct 8 22:35:40 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx: Running the documentation revealed a loop;
+ inside the table tail and head \\ was reset to \@tabularcr instead
+ of to \@@tabularcr (now: \org@tabularcr). First found by Thomas
+ Esser (te at informatik.uni-hannover.de)
+
+Sat Sep 27 21:35:29 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx: Added the mpsupertabular and mpsupertabular*
+ environments provided by Axel Kielhorn (A.Kielhorn at tu-bs.de);
+ added \noindent in front of all the starts of tabulars and
+ minipages as it seems senseles to have a paragraph indent in front
+ of a large tabularl; fixed a few documentation bugs.
+ The calculation of the available height still missed the case
+ where TeX has already begun the second column.
+
+Thu Sep 18 00:31:55 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : The \tablehead and \tabletail commands reset
+ the command \\; they used \cr for it. That should have been
+ \@tabularcr to properly deal with it's optional argument.
+ Found by Axel Kielhorn (A.Kielhorn at tu-bs.de)
+
+Wed Sep 17 23:59:13 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : In two column mode the parameters that
+ determine how much space is left on the page were not correctly
+ initialised when TeX hasn't yet filled up the first column
+ completely.
+ Found by Jeffrey Spielberg (jspielberg at infinet-software.com)
+
+Tue May 20 23:46:08 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : \shrinkheight didn't shrink the available
+ height for a part of the tabular (as documented); it just *set* it
+ to the value given. Made it perform as documented and added
+ \setSTheight for the former functionality
+ At the end of a supertabular \@table@first@head and
+ \@table@last@tail are undefined; this shoud be done globally.
+ Found by Axel Kielhorn (A.Kielhorn at tu-bs.de)
+
+Sat Apr 12 23:37:33 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : Added \ST@stretchht and \ST@prevht to improve
+ decision process. \estimate@lineht now also computes the
+ difference between a normal line height and when \arraystretch is
+ in effect.
+
+Thu Apr 10 23:33:07 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx: Had to repaire some documentation errors.
+ (found by Thomas Esser (te at informatik.uni-hannover.de))
+
+Wed Apr 9 00:29:36 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : Only the first part of a supertabular can be
+ moved to the next page. Therefore we need to change the definition
+ of \ST@skippage in the middle of processing the supertabular data.
+
+
+Thu Mar 6 21:56:18 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx : Using a tabular environment in the cells of a
+ supertabular gives `interesting' results when the algorithm
+ decides to split the supertabular down the middle of an inner
+ tabular. A number of changes were necessary to make this work.
+ Found by Axel Kielhorn (i0080108 at ws.rz.tu-bs.de)
+
+Thu Feb 20 23:29:18 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx: Renamed \tableformat into \ST@tableformat
+ because the KOPMA-packages also use \tableformat and therefore
+ clashed with babel.
+ Found by Axel Kielhorn (i0080108 at ws.rz.tu-bs.de)
+
+Tue Feb 4 23:50:50 1997 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx (section{The Implementation}): Removed the use
+ of the page height correction for p-columns; the current algorithm
+ no longer needs this correction.
+ Fixed the fact that the height of the head and/or tail of a
+ supertabular were counted *twice* when they contain tabular
+ material.
+ Base the decision whether to start a new supertabular on the next
+ page on a calculated minimum height of the table. The minimum is
+ the head, the tail and 1 line of tabular data.
+
+Thu Nov 28 20:38:53 1996 Johannes Braams (texniek at braams.cistron.nl)
+
+ * supertabular.dtx: Started a cleanup of the code, made source
+ file a full fledged .dtx file
+
+ Old change notes from supertabular.doc are saved here:
+%
+%
+% supertabular sty
+% original idea: Theo Jurriens 1988
+% jurriens at fwn.rug.nl P.O Box 800, 9700 AV Groningen
+%
+% revised by: Johannes Braams
+% texniek at braams.cistron.nl TeXniek (NL)
+% \def\fileversion{3.7c}
+% \def\filename{supertabular sty}
+% \def\filedate{1995/10/16}
+%
+% \changes{v3.7c}{1995/10/16}{No space after the argument of
+% supertabular led to a `mysterious' error because of the space
+% delemiting the argument}
+% \changes{v3.7b}{1994/05/16}{Rewrote the page break deciding
+% algorithm again}
+% \changes{v3.7b}{1994/05/16}{Started to convert to dtx format}
+%
+% 05.04.93 - Supertabular didn't work correctly in twocolumn mode.
+% V 3.7a Rewrote the mechanism for establishing the amount of
+% space that supertabular can use. This still needs further
+% thought. The algorithm to compute the places to break
+% the table is still a bit fragile, especially when p{}
+% columns are used.
+% 10.07.92 - Still a problem in the combination of supertabular with array.sty
+% V 3.6h I overlooked the fact that array doesn't use \@tabulacr anymore
+% and it behaves differently with respect to \@startparbox.
+% 03.07.92 - A problem in the combination of supertabular with array.sty
+% V 3.6g It can be solved by removing the \string from \def\tableformat
+% and passing \tableformat expanded to \tabular.
+% 11.02.92 - Bug found by Michael Heissmeier when p{...} is used.
+% V 3.6f A change in LaTeX.tex didn't find its way into supertabular.
+% 11/03/92 JB: The following change didn't find its way into the
+% \@sendpbox command. This caused a difference in linespacing
+% between a supertabular and a normal tabular.
+% \def\@endpbox{\unskip\strut\par\egroup\hfil}
+% % 14 Jan 89: Def of \@endpbox changed from
+% % \def\@endpbox{\par\vskip\dp\@arstrutbox\egroup\hfil}
+% % so vertical spacing works out right if the last line of a `p' entry
+% % has a descender.
+%
+% 01.08.91 - Take height of tabletail into account when computing the
+% V 3.6e maximum tableheight; add tolerance on first (partial) page
+% of the supertabular.
+% 27.06.91 - Cured bug that made the first part of the table one line
+% V 3.6d shorter than the others. Appeared when supertabular was
+% used in a twocolumn environment.
+% 26.06.91 - Made \@process@tablecaption a global macro. Previous caption
+% V 3.6c turned up on a table without one.
+% 27.05.91 - Replaced \clearpage with \newpage to make supertabulars work
+% V 3.6b in a twocolumn environment. This also prevents all floats
+% from being printed.
+% 15.02.91 - Because of the check for the use of tablefirsthead the
+% V 3.6a combination of an \hline in the head and an \hline as the first
+% thing in the data went wrong. The \futurelet in the definition
+% of \hline found \fi instead of \hline, so no \doublerulesep
+% was added.
+% Also had to modify the way the environments were defined.
+% The blank space (from the CR after the argument of \supertabular)
+% has to be gobbled. This can only be done using a construction
+% like \def\command#1 {...}. So removed the use of \newenvironment
+% 04.02.91 - Added the commands \topcaption, \bottomcaption and \tablecaption
+% V 3.6 to include a caption within the supertabular environment. The
+% default behaviour is to put the caption before the actual start
+% of the table.
+% - Also added \tablefirsthead and \tablelasttail to let the
+% user specify a different head for the first page of the table
+% and for consecutive pages as well as different tails for first
+% pages and the last one. If these commands are not used, the
+% default behaviour will be to use the value of \tablehead end
+% \tabletail
+% - Removed the need for the \noalign{\global\let\\=\@stabularcr}
+% commands by storing and resetting \@stabularcr
+%
+% 16.10.90 Added the supertabular* environment that was in an earlier
+% V 3.5 version (2.0) by the original author
+% Reintroduced the version numbering
+%
+% revised by: Gabriele Kruljac
+% kruljac at ds0mpi11 Max-Planck-Institute Stuttgart
+%
+%
+% 06.06.89 Correction: now care is taken of probably existing onecolumn
+% head (title or tables ...) in twocolumn sty.
+%
+% 10.05.89 Correction: the new \\ definition has been added to the
+% begin of each `sub'-tabular
+% Added: algorithm to produce the tabulars in twocolumn style
+%
+% 06.04.89 Correction: put \global statement in \end{supertabular}
+% into \noalign
+%
+% 22.02.89 Correction: restore the original meaning of \\ with
+% \end{supertabular}
+%
+% (Feb 89) The whole algorithm has been changed, so that I can use
+% the most features of a normal tabular:
+% \\ for new line, including \\[#1]
+% p{...} in the preamble ...
+% Account is taken to \baselinestretch and \arraystretch
+% -I'm not counting the lines because of too much rounding errors
+% but instead I add the (estimated) used space in pt.
+% -The tablehead is taken into this algorithm of proofing, so
+% I really know how much space the head uses.
+% -When no p-arg is given I add a variable \midlineheight to
+% calculate the used space. To calculate \midlineheight I
+% take the \baselineskip, which is active when the supertabular
+% starts (\baselineskip includes the \value of \baselinestretch)
+% and multiply it with \arraystretch.
+% -When a p-arg is given the text will be stored in a box. So
+% I know the height I have to add. Also I reduce the maximum
+% pagesize, so that the last parbox on a page can get up to
+% max 4 lines without producing an overfull vbox.
+% -To do so I had to make some additions to LaTeX's tabular
+% commands. These new commands got a leading `s'.
diff --git a/macros/latex/contrib/supertabular/MANIFEST b/macros/latex/contrib/supertabular/MANIFEST
new file mode 100644
index 0000000000..a80fe1b209
--- /dev/null
+++ b/macros/latex/contrib/supertabular/MANIFEST
@@ -0,0 +1,8 @@
+README - A short introduction
+MANIFEST - A list of files
+CATALOG - An entry for the macro catalog
+supertabular.dtx - The documented version of the code, including a couple
+ of examples of how to use it. Needs supertabular.sty
+ to be available (run latex supertabular.ins first).
+supertabular.dtx - The `printed version´ of supertabular.dtx
+supertabular.ins - A docstrip file to produce the stripped code
diff --git a/macros/latex/contrib/supertabular/README b/macros/latex/contrib/supertabular/README
new file mode 100644
index 0000000000..b17b79ee2f
--- /dev/null
+++ b/macros/latex/contrib/supertabular/README
@@ -0,0 +1,21 @@
+This is the supertabular bundle. It defines the supertabular and
+supertabular* environments. They make it possible to have a tabular
+that spans multiple pages. Each page is its own tabular environment,
+thus the various parts may have different widths. If that is not what
+you want you should check out longtable.sty, written by David
+Carlisle. It is part of the array bundle.
+
+For a more elaborate description of supertabular and a comparison with
+longtable, see The LaTeX Companion, by Goossens, Mittelbach and
+Samarin, ISBN 0-201-54199-8.
+
+The files contained in this bundle are listed in the file MANIFEST
+
+Supertabular can be used with LaTeX2e as a package.
+
+Copyright (C) 2004 Johannes L. Braams texniek at braams.cistron.nl
+
+This program can be redistributed and/or modified under the terms
+of the LaTeX Project Public License Distributed from CTAN
+archives in directory macros/latex/base/lppl.txt; either
+version 1 of the License, or any later version.
diff --git a/macros/latex/contrib/supertabular/supertabular.dtx b/macros/latex/contrib/supertabular/supertabular.dtx
new file mode 100644
index 0000000000..130ad13dd0
--- /dev/null
+++ b/macros/latex/contrib/supertabular/supertabular.dtx
@@ -0,0 +1,1582 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2004 Johannes L. Braams. All rights reserved.
+%
+% This file is part of the supertabular package.
+% ---------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the supertabular package is
+% given in the file `MANIFEST.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%
+% \CheckSum{1025}
+% \iffalse
+%% Sourcefile `supertabular.dtx'.
+%%
+%% Copyright (C) 1988 by Theo Jurriens
+%% Copyright (C) 1990-2004 by Johannes Braams texniek at braams.cistron.nl
+%% Kersengaarde 33
+%% 2723 BP Zoetermeer NL
+%% all rights reserved.
+%%
+%%
+%<*dtx>
+\ProvidesFile{supertabular.dtx}
+%</dtx>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{supertabular}
+%<driver>\ProvidesFile{supertabular.drv}
+%\ProvidesFile{supertabular.dtx}
+ [2004/02/20 v4.1e the supertabular environment]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{supertabular}
+\newcommand{\tbsp}{\rule{0pt}{18pt}}
+\begin{document}
+\providecommand{\Lenv}[1]{\textsf{#1}}
+\providecommand{\pkg}[1]{\texttt{#1}}
+\providecommand{\cls}[1]{\texttt{#1}}
+\providecommand{\file}[1]{\texttt{#1}}
+\DocInput{supertabular.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{v4.0a}{1996/11/28}{Cleanup of the code, now a \file{.dtx}
+% source file}
+% \changes{v4.0c}{1997/02/20}{Replace \cs{tableformat} by
+% \cs{ST@tableformat} to prevent a clash with the \pkg{KOMA}
+% pacakage}
+% \changes{v4.0f}{1997/04/10}{Repaired a few typos in the
+% documentation}
+% \changes{v4.1a}{1997/09/18}{Repaired a number of typos and added
+% contributed mpsupertabular environemnts}
+% \changes{v4.1b}{1997/10/08}{Renamed \cs{@@tabularcr} to
+% \cs{org@tabularcr}}
+%
+% \GetFileInfo{supertabular.dtx}
+% \title{The \texttt{supertabular} environment\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{Johannes Braams and Theo Jurriens}
+% \date{\filedate}
+% \maketitle
+%
+% \section{Introduction}
+%
+% The package \pkg{supertabular} offers a new environment, the
+% \Lenv{supertabular} environment. As the name indicates it is an
+% extension of the normal \Lenv{tabular} environment.
+%
+% With the original \Lenv{tabular} environment a tabular must
+% always fit on \emph{one} page. If the tabular becomes too large
+% the text overwrites the page's bottom margin and you get an
+% \texttt{Overfull vbox} message.
+%
+% The \Lenv{supertabular} environment uses the \Lenv{tabular}
+% environment internally, but it evaluates the used space every
+% time it gets a |\\| command. If the tabular reaches the
+% textheight, it automatically inserts an optional tabletail, an
+% |\end{tabular}| command, starts a new page, a new
+% \Lenv{tabular} environment and inserts the optional tablehead on
+% the new page continuing the tabular.
+%
+% \section{User interface}
+%
+% The package \pkg{supertabular} has three options, they control
+% the amount of information that is written to the \file{.log}
+% file.
+% \begin{enumerate}
+% \item The option \textsf{errorshow} (the default) doens't write
+% any extra information.
+% \item The option \textsf{pageshow} writes information about when
+% and why \pkg{supertabular} decides to break the tabular
+% environment in order to produce a new page.
+% \item The option \textsf{debugshow} also adds information about
+% each line that is added to the tabular.
+% \end{enumerate}
+%
+% Below is a description of the new commands and environments that
+% this package provides.
+%
+% \DescribeMacro{\tablefirsthead}
+% The command |\tablefirsthead| takes one argument, it defines the
+% contents of the first occurence of the tabular head.\\
+% The use of this command is optional. Don't forget to close the
+% head by a |\\|.
+%
+% \DescribeMacro{\tablehead}
+% The command |\tablehead| takes one argument, it defines the
+% contents of all subsequent ocurrences of the tabular head.\\
+% Don't forget to close the head by a |\\|
+%
+% \DescribeMacro{\tabletail}
+% The command |\tabletail| takes one argument, it defines something
+% which should be inserted before each |\end{tabular}|, except
+% the last.
+%
+% \DescribeMacro{\tablelasttail}
+% The command |\tablelasttail| takes one argument, it defines
+% something which should be inserted before the last
+% |\end{tabular}|.\\
+% The use of this command is optional.
+%
+% \DescribeMacro{\topcaption}
+% \DescribeMacro{\bottomcaption}
+% \DescribeMacro{\tablecaption}
+% These commands all take the same arguments as \LaTeX's standard
+% |\caption| command. They provide a caption for the super-table,
+% either at the top or at the bottom of the table. When
+% |\tablecaption| is used the caption will be placed at the
+% default location, which is at the top.
+%
+% \DescribeEnv{supertabular}
+% \DescribeEnv{supertabular*}
+% The environments \Lenv{supertabular} and \Lenv{supertabular*}
+% can be used much like the standard \LaTeX\ environments
+% \Lenv{tabular} and \Lenv{tabular*}.
+%
+% \DescribeEnv{mpsupertabular}
+% \DescribeEnv{mpsupertabular*}
+% The environments \Lenv{mpsupertabular} and
+% \Lenv{mpsupertabular*} work like the \Lenv{supertabular} and
+% \Lenv{supertabular*} environments but put each page into a
+% \Lenv{minipage} first. Thus it is possible to have footnotes
+% inside a \Lenv{mpsupertabular}. The footnotetext is printed at
+% the end of each page.
+%
+% \DescribeMacro{\shrinkheight}
+% The allowed maximimum height of a part of the supertabular on a
+% page can be adjusted using the command |\shrinkheight|. It takes
+% one argument, the length with which to shrink (positive value) or
+% grow (negative value) the allowed height.
+%
+% \section{Weak points}
+%
+% \begin{itemize}
+% \item When the material of a normal entry (not a p-arg) becomes
+% larger than the estimated |\ST@lineht|, overfull |\vbox|es
+% will be produced at all.
+% \item When the last p-arg on a page gets more than 4 lines
+% (probably even more than 3 lines) it will result in an overfull
+% |\vbox|. Also some combinations of |\baselinestretch|
+% |\arraystretch| and a large font may lead to one line too much.
+% \item if accidentally the last line of the tabular produces a
+% newpage, on the next page the tabletail will be written
+% immediately after the tablehead. Depending on the contents this
+% may result in an error message regarding misplaced |\noalign|.
+%
+% A quick but not very elegant solution: shrink the allowed height
+% of the table with the command |\shrinkheight{...pt}| after the
+% first |\\| of the supertabular.
+% \item The \Lenv{mpsupertabular} environment sometimes has problems
+% with pagesbreaks when footnotes appear in the lower part of the
+% tabular.
+% \end{itemize}
+%
+% \section{Examples}
+%
+% \DeleteShortVerb{\|}
+% Here is an example of a \Lenv{supertabular}. You will find the
+% definitions after the table.
+%
+% \begin{center}
+% \tablefirsthead{%
+% \hline
+% \multicolumn{1}{|c}{\tbsp Number} &
+% \multicolumn{1}{c}{Number$^2$} &
+% Number$^4$ &
+% \multicolumn{1}{c|}{Number!} \\
+% \hline}
+% \tablehead{%
+% \hline
+% \multicolumn{4}{|l|}{\small\sl continued from previous page}\\
+% \hline
+% \multicolumn{1}{|c}{\tbsp Number} &
+% \multicolumn{1}{c}{Number$^2$} &
+% Number$^4$ &
+% \multicolumn{1}{c|}{Number!} \\
+% \hline}
+% \tabletail{%
+% \hline
+% \multicolumn{4}{|r|}{\small\sl continued on next page}\\
+% \hline}
+% \tablelasttail{\hline}
+% \bottomcaption{This table is split across pages}
+%
+% \begin{supertabular}{|r@{\hspace{6.5mm}}|r@{\hspace{5.5mm}}|r|r|}
+% 1\tbsp & 1 & 1 & 1 \\
+% 2 & 4 & 16 & 2 \\
+% 3 & 9 & 81 & 6 \\
+% 4 & 16 & 256 & 24 \\[5mm]
+% 5 & 25 & 625 & 120 \\
+% 6 & 36 & 1296 & 720 \\
+% 7 & 49 & 2401 & 5040 \\
+% 8 & 64 & 4096 & 40320 \\
+% 9 & 81 & 6561 & 362880 \\
+% 10 & 100 & 10000 & 3628800 \\
+% 11 & 121 & 14641 & 39916800 \\
+% 12 & 144 & 20736 & 479001600 \\[.5cm]
+% \hline & & & \\
+% 13 & 169 & 28561 & 6.22702080E+9 \\[1cm]
+% 14 & 196 & 38416 & 8.71782912E+10\\
+% 15 & 225 & 50625 & 1.30767437E+12\\
+% 16 & 256 & 65536 & 2.09227899E+13\\
+% 17 & 289 & 83521 & 3.55687428E+14\\[5mm]
+% 18 & 324 & 104976 & 6.40237370E+15\\
+% 19 & 361 & 130321 & 1.21645100E+17\\
+% 20 & 400 & 160000 & 2.43290200E+18\\
+% \end{supertabular}
+% \end{center}
+%
+% And here is (part of) the user input for the table above:
+%\begin{verbatim}
+% \begin{center}
+% \tablefirsthead{%
+% \hline
+% \multicolumn{1}{|c}{\tbsp Number} &
+% \multicolumn{1}{c}{Number$^2$} &
+% Number$^4$ &
+% \multicolumn{1}{c|}{Number!} \\
+% \hline}
+% \tablehead{%
+% \hline
+% \multicolumn{4}{|l|}{\small\sl continued from previous page}\\
+% \hline
+% \multicolumn{1}{|c}{\tbsp Number} &
+% \multicolumn{1}{c}{Number$^2$} &
+% Number$^4$ &
+% \multicolumn{1}{c|}{Number!} \\
+% \hline}
+% \tabletail{%
+% \hline
+% \multicolumn{4}{|r|}{\small\sl continued on next page}\\
+% \hline}
+% \tablelasttail{\hline}
+% \bottomcaption{This table is split across pages}
+%
+% \begin{supertabular}{|r@{\hspace{6.5mm}}|r@{\hspace{5.5mm}}|r|r|}
+% 1 & 1 & 1 & 1 \\
+% 2 & 4 & 16 & 2 \\
+% 3 & 9 & 81 & 6 \\
+% 4 & 16 & 256 & 24 \\[5mm]
+% ...
+% 19 & 361 & 130321 & 1.21645100E+17\\
+% 20 & 400 & 160000 & 2.43290200E+18\\
+% \end{supertabular}
+% \end{center}
+%\end{verbatim}
+%
+% Here is another example whith a \texttt{p} column-definition. The
+% tablehead is the same as above. The tabletail is a double
+% \verb|\hline|; \verb|\arraystretch| is set to \texttt{1.5} and
+% the font size is \verb|\small|.
+%
+% \begin{center}
+% \tablelasttail{\hline\hline}
+% \topcaption{This table should also be split accross pages.}
+% \renewcommand{\arraystretch}{1.5}
+% \small
+% \begin{supertabular}{| r@{\hspace{6.5mm}}|%
+% r@{\hspace{5.5mm}}| r p{5cm}|}
+% 1 & 1 & 1 & \tbsp here is a relative short entry \\
+% 2 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 3 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 4 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 5 & 1 & 1 & here is a relative short entry \\
+% 6 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 7 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 8 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 9 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 10 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 11 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 12 & 1 & 1 & here is a relative short entry \\
+% 13 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 14 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 15 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 16 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 17 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 18 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% \end{supertabular}
+% \end{center}
+%
+% Here is the same table again, but this time using the
+% \Lenv{supertabular*} environment and stretching the table to the
+% full width of the text.
+%
+% \begin{center}
+% \tablelasttail{\hline\hline}
+% \topcaption{This table should also be split accross pages.}
+% \renewcommand{\arraystretch}{1.5}
+% \small
+% \begin{supertabular*}{\textwidth}%
+% {| r@{\extracolsep{6.5mm plus 1fil}}|%
+% r@{\extracolsep{5.5mm plus 0.5fil}}|%
+% r@{\extracolsep{0mm plus 0.1fil}}%
+% p{5cm}|}
+% 1 & 1 & 1 & \tbsp here is a relative short entry \\
+% 2 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 3 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 4 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 5 & 1 & 1 & here is a relative short entry \\
+% 6 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 7 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 8 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 9 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 10 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 11 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 12 & 1 & 1 & here is a relative short entry \\
+% 13 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 14 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 15 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 16 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 17 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% 18 & 1 & 1 & and here is a long entry, where line breaks
+% and line breaks and line breaks have to occur\\
+% \end{supertabular*}
+% \end{center}
+%
+% \MakeShortVerb{\|}
+%
+% \section{Known problems}
+%
+% \begin{itemize}
+% \item When a float occurs on the same page as the start of a
+% supertabular you can expect unexpected results.
+%
+% When the float was defined on the same page you might end up
+% with the first part of the supertabular on a page by its own.
+%
+% \item You should not use the supertabular \emph{inside} a
+% floating-environment such as \texttt{table} as this will result
+% in \TeX\ trying to put the whole supertabular on \emph{one}
+% page.
+%
+% \item In some instances you might still end up with overfull
+% |\vbox| messages.
+%
+% \item Sometimes the last page of the supertabular contains just
+% an empty head an tail.
+% \end{itemize}
+% \StopEventually{}
+%
+% \section{The Implementation}
+%
+% \begin{macrocode}
+%<*package>
+\newcount\c@tracingst
+\DeclareOption{errorshow}{\c@tracingst\z@}
+\DeclareOption{pageshow}{\c@tracingst\tw@}
+\DeclareOption{debugshow}{\c@tracingst5\relax}
+\ProcessOptions
+% \end{macrocode}
+%
+% \begin{macro}{\topcaption}
+% \begin{macro}{\bottomcaption}
+% The user-commands |\topcaption| and |\bottomcaption| set the
+% flag |@topcaption| to determine where to put the
+% tablecaption. The default is to put the caption on the top of
+% the table
+% \begin{macrocode}
+\newif\if@topcaption \@topcaptiontrue
+\def\topcaption{\@topcaptiontrue\tablecaption}
+\def\bottomcaption{\@topcaptionfalse\tablecaption}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tablecaption}
+% This command has to function exactly like |\caption| does, except
+% it has to store its argument (and the optional argument) for
+% later processing \emph{within} the supertabular environment.
+%
+% \begin{macrocode}
+\long\def\tablecaption{%
+ \refstepcounter{table}\@dblarg{\@xtablecaption}}
+\long\def\@xtablecaption[#1]#2{%
+ \long\gdef\@process@tablecaption{\ST@caption{table}[#1]{#2}}}
+\global\let\@process@tablecaption\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifST@star}
+% This switch is used in the internal macros to remember which
+% kind of environment was started.
+% \begin{macrocode}
+\newif\ifST@star
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifST@mp}
+% This switch is used in the internal macros to remember if the
+% tabular should be put into a minipage.
+% \changes{v4.1a}{1997/09/18}{Added \cs{ifST@mp} switch}
+% \begin{macrocode}
+\newif\ifST@mp
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@wd}
+% For the \Lenv{supertabular*} environment it is necessary to
+% store the intended width of the tabular.
+% \begin{macrocode}
+\newdimen\ST@wd
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@rightskip}
+% \changes{v4.1a}{1997/09/18}{Dimen register added}
+% \begin{macro}{\ST@leftskip}
+% \changes{v4.1a}{1997/09/18}{Dimen register added}
+% \begin{macro}{\ST@parfillskip}
+% \changes{v4.1a}{1997/09/18}{Dimen register added}
+% For the \Lenv{mpsupertabular} environments we need special
+% versions of |\leftskip|, |\rightskip| and |\parfillskip|.
+% \begin{macrocode}
+\newskip\ST@rightskip
+\newskip\ST@leftskip
+\newskip\ST@parfillskip
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ST@caption}
+% This is a redefinition of LaTeX's |\@caption|, |\@makecaption| is
+% called within a group so as not to return to |\normalsize|
+% globally. also a fix is made for the `feature' of the
+% |\@makecaption| of the document class \cls{article} and friends
+% that a caption \textbf{always} gets a |\vskip 10pt| at the top
+% and \textbf{none} at the bottom. If a user wants to precede his
+% table with a caption this results in a collision.
+%
+% \begin{macrocode}
+\long\def\ST@caption#1[#2]#3{\par%
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{%
+ \csname the#1\endcsname}{\ignorespaces #2}}
+ \begingroup
+ \@parboxrestore
+ \normalsize
+ \if@topcaption \vskip -10\p@ \fi
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \if@topcaption \vskip 10\p@ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tablehead}
+% \changes{v4.0a}{1996/11/28}{Locally reset \cs{}\cs{} to \cs{cr}}
+% \begin{macro}{\tablefirsthead}
+% |\tablehead| activates the new tabular |\cr| commands.
+% \changes{v4.0i}{1997/09/18}{Don't reset \cs{}\cs{} to \cs{cr}, but
+% to \cs{@tabularcr}}
+% \changes{v4.1b}{1997/10/08}{Not \cs{@tabularcr} but
+% \cs{org@tabularcr}}
+% \begin{macrocode}
+\newcommand\tablehead[1]{%
+ \gdef\@tablehead{%
+ \noalign{%
+ \global\let\@savcr=\\
+ \global\let\\=\org@tabularcr}%
+ #1%
+ \noalign{\global\let\\=\@savcr}}}
+\tablehead{}
+\newcommand\tablefirsthead[1]{\gdef\@table@first@head{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tabletail}
+% \begin{macro}{\tablelasttail}
+% If the user uses an extra amount of tabular-data (like
+% |\multicolumn|) in |\tabletail| \TeX\ starts looping because of
+% the definition of |\ST@cr|. So make |\\| act just like a
+% |\@tabularcr| inside this tail to prevent the loop. Save and
+% restore the value of |\\|
+%
+% \changes{v4.0i}{1997/09/18}{Don't reset \cs{}\cs{} to \cs{cr}, but
+% to \cs{@tabularcr}}
+% \changes{v4.1b}{1997/10/08}{Not \cs{@tabularcr} but
+% \cs{org@tabularcr}}
+% \begin{macrocode}
+\newcommand\tabletail[1]{%
+ \gdef\@tabletail{%
+ \noalign{%
+ \global\let\@savcr=\\
+ \global\let\\=\org@tabularcr}%
+ #1%
+ \noalign{\global\let\\=\@savcr}}}
+\tabletail{}
+\newcommand\tablelasttail[1]{\gdef\@table@last@tail{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\sttraceon}
+% \changes{v3.7b}{1994/05/16}{Added macro}
+% \begin{macro}{\sttraceoff}
+% \changes{v3.7b}{1994/05/16}{Added macro}
+% There now is a possiblity to follow the decisions supertabular
+% makes about breaking the tabular. This has to be enabled when
+% converting this file with \texttt{docstrip} to a \texttt{.sty}
+% file.
+% \begin{macrocode}
+\newcommand\sttraceon{\c@tracingst5\relax}
+\newcommand\sttraceoff{\c@tracingst\z@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ST@trace}
+% A macro that gets the trace message as its argument
+% \begin{macrocode}
+\newcommand\ST@trace[2]{%
+ \ifnum\c@tracingst>#1\relax
+ \GenericWarning
+ {(supertabular)\@spaces\@spaces}
+ {Package supertabular: #2}%
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@pageleft}
+% \changes{v3.7b}{1994/05/16}{Renamed from \cs{maxsize}}
+% \changes{v4.0a}{1996/11/28}{Renamed from \cs{page@left}}
+% This register holds the estimate of the amount of space left over
+% on the current page. This is used in the decision when to start a
+% new page.
+% \begin{macrocode}
+\newdimen\ST@pageleft
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\shrinkheight}
+% \changes{v4.0a}{1996/11/28}{New command}
+% \changes{v4.0h}{1997/05/20}{This command should use \cs{advance} but
+% didn't...}
+% A command to diminish the value of |\ST@pageleft| if necessary.
+% \begin{macrocode}
+\newcommand*\shrinkheight[1]{%
+ \noalign{\global\advance\ST@pageleft-#1\relax}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setSTheight}
+% \changes{v4.0h}{1997/05/10}{New command}
+% A command to set the value of |\ST@pageleft| if necessary.
+% \begin{macrocode}
+\newcommand*\setSTheight[1]{%
+ \noalign{\global\ST@pageleft=#1\relax}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@headht}
+% \begin{macro}{\ST@tailht}
+% The register |ST@headht| will hold the height of the first head
+% of a \Lenv{supertabular} environment; the register |\ST@tailht|
+% will hold the height of table tail (if any)
+% \begin{macrocode}
+\newdimen\ST@headht
+\newdimen\ST@tailht
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ST@pagesofar}
+% The register |\ST@pagesofar| is used to store the estimate of the
+% amount of page already filled up.
+% \begin{macrocode}
+\newdimen\ST@pagesofar
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@pboxht}
+% The measured (total) height of a parbox-argument
+% \begin{macrocode}
+\newdimen\ST@pboxht
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v4.0b}{1997/02/04}{Removed the use of \cs{ST@pboxcorr},
+% correction seems to be no longer necessary}
+%
+% \begin{macro}{\ST@lineht}
+% \begin{macro}{\ST@stretchht}
+% \changes{v4.0g}{1997/04/12}{Dimension register added}
+% \begin{macro}{\ST@prevht}
+% \changes{v4.0g}{1997/04/12}{Dimension register added}
+% The estimated height of a normal line is stored in
+% |\ST@lineht|. The dimension register |\ST@stretchht| is used to
+% store the difference between the `normal' line height and the
+% line height when |\arraystretch| has a non-standard value. This
+% is used in the case where p-box entries are added to the
+% tabular. The dimension register |\ST@prevht| is use to store the
+% height of the previous line to use it as an estimate for the
+% height of the next line. This is needed for a better estimate of
+% when to break the tabular.
+% \begin{macrocode}
+\newdimen\ST@lineht
+\newdimen\ST@stretchht
+\newdimen\ST@prevht
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ST@toadd}
+% When a tabular row is ended with |\\[...]| we need to temporarily
+% store the optional argument in |\ST@toadd|.
+% \begin{macrocode}
+\newdimen\ST@toadd
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@dimen}
+% A private scratch dimension register.
+% \begin{macrocode}
+\newdimen\ST@dimen
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@pbox}
+% A box register to temporarily store the contents of a parbox.
+% \begin{macrocode}
+\newbox\ST@pbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@tabularcr}
+% \begin{macro}{\ST@xtabularcr}
+% \begin{macro}{\ST@argtabularcr}
+% These are redefinitions of |\@tabularcr| and |\@xtabularcr|. This
+% is needed to include |\ST@cr| in the definition of
+% |\@xtabularcr|.
+%
+% All redefined macros have names that are similar to the original
+% names, except with a leading 'ST'
+% \begin{macrocode}
+\def\ST@tabularcr{%
+ {\ifnum0=`}\fi
+ \@ifstar{\ST@xtabularcr}{\ST@xtabularcr}}
+\def\ST@xtabularcr{%
+ \@ifnextchar[%]
+ {\ST@argtabularcr}%
+ {\ifnum0=`{\fi}\cr\ST@cr}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\ST@argtabularcr[#1]{%
+ \ifnum0=`{\fi}%
+ \ifdim #1>\z@
+ \unskip\ST@xargarraycr{#1}
+ \else
+ \ST@yargarraycr{#1}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@xargarraycr}
+% \begin{macro}{\ST@yargarraycr}
+% In this case we need to copy the value of the optional argument
+% of |\\| in our private register |\ST@toadd|.
+% \begin{macrocode}
+\def\ST@xargarraycr#1{%
+ \@tempdima #1\advance\@tempdima \dp \@arstrutbox
+ \vrule \@height\z@ \@depth\@tempdima \@width\z@ \cr
+ \noalign{\global\ST@toadd=#1}\ST@cr}
+% \end{macrocode}
+% \end{macro}
+%
+% Here we need to insert |\ST@cr|
+% \begin{macrocode}
+\def\ST@yargarraycr#1{%
+ \cr\noalign{\vskip #1\global\ST@toadd=#1}\ST@cr}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@startpbox}
+% The macros that deal with parbox columns need to be redefined,
+% because we need to know the size of the parbox.
+% \changes{v4.0b}{1997/02/04}{Removed use of \cs{ST@pboxcorr}}
+% \begin{macrocode}
+\def\ST@startpbox#1{%
+% \end{macrocode}
+% To achieve our goal we need to save the text in box.
+% \begin{macrocode}
+ \setbox\ST@pbox\vtop\bgroup\hsize#1\@arrayparboxrestore}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@astartpbox}
+% Our version of |\@astartpbox|.
+% \changes{v4.0b}{1997/02/04}{Removed use of \cs{ST@pboxcorr}}
+% \begin{macrocode}
+\def\ST@astartpbox#1{%
+ \bgroup\hsize#1%
+ \setbox\ST@pbox\vtop\bgroup\hsize#1\@arrayparboxrestore}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@endpbox}
+% \begin{macro}{\ST@aendpbox}
+% \changes{v4.0a}{1996/11/30}{Made definitions up to date with
+% \file{latex.ltx} (1996/06/01)}
+% Our version of |\@endpbox| and |\@aendpbox|.
+% \begin{macrocode}
+\def\ST@endpbox{%
+ \@finalstrut\@arstrutbox\par\egroup
+ \ST@dimen=\ht\ST@pbox
+ \advance\ST@dimen by \dp\ST@pbox
+ \ifnum\ST@pboxht<\ST@dimen
+ \global\ST@pboxht=\ST@dimen
+ \fi
+ \ST@dimen=\z@
+ \box\ST@pbox\hfil}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\ST@aendpbox{%
+ \@finalstrut\@arstrutbox\par\egroup
+ \ST@dimen=\ht\ST@pbox
+ \advance\ST@dimen by \dp\ST@pbox
+ \ifnum\ST@pboxht<\ST@dimen
+ \global\ST@pboxht=\ST@dimen
+ \fi
+ \ST@dimen=\z@
+ \unvbox\ST@pbox\egroup\hfil}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\estimate@lineht}
+% Estimates the height of normal line taking |\arraystretch| into
+% account. Also computes the difference between a normal line and a
+% `stretched' one.
+% \changes{v4.0b}{1997/02/04}{Removed use of \cs{ST@pboxcorr}}
+% \changes{v4.0g}{1997/04/12}{Added the computation of
+% \cs{ST@stretchht}}
+% \begin{macrocode}
+\def\estimate@lineht{%
+ \ST@lineht=\arraystretch \baslineskp
+ \global\advance\ST@lineht by 1\p@
+ \ST@stretchht\ST@lineht\advance\ST@stretchht-\baslineskp
+ \ifdim\ST@stretchht<\z@\ST@stretchht\z@\fi
+ \ST@trace\tw@{Average line height: \the\ST@lineht}%
+ \ST@trace\tw@{Stretched line height: \the\ST@stretchht}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@calfirstpageht}
+% \changes{v3.7a}{1993/04/05}{Renamed from \cmd\calpage}
+% Estimates the space left on the current page and decides whether
+% the tabular can be started on this page or on a new page.
+% \begin{macrocode}
+\def\@calfirstpageht{%
+ \ST@trace\tw@{Calculating height of tabular on first page}%
+% \end{macrocode}
+% The \TeX\ register |\pagetotal| contains the height of the page
+% sofar, the \LaTeX\ register |\@colroom| contains the height of
+% the column.
+% \begin{macrocode}
+ \global\ST@pagesofar\pagetotal
+ \global\ST@pageleft\@colroom
+ \ST@trace\tw@{Height of text = \the\pagetotal; \MessageBreak
+ Height of page = \the\ST@pageleft}%
+% \end{macrocode}
+% When we are in twocolumn mode \TeX\ may still be collecting
+% material for the first column although there seems to be no space
+% left. In this case we have to check against two times |\ST@pageleft|.
+% \begin{macrocode}
+ \if@twocolumn
+ \ST@trace\tw@{two column mode}%
+ \if@firstcolumn
+ \ST@trace\tw@{First column}%
+ \ifnum\ST@pagesofar > \ST@pageleft
+ \global\ST@pageleft=2\ST@pageleft
+ \ifnum\ST@pagesofar > \ST@pageleft
+ \newpage\@calnextpageht
+ \ST@trace\tw@{starting new page}%
+ \else
+% \end{macrocode}
+% In this case we're in the second column, so we have to compensate
+% for the material in the first column.
+% \begin{macrocode}
+ \ST@trace\tw@{Second column}%
+ \global\advance\ST@pageleft -\ST@pagesofar
+ \global\advance\ST@pageleft -\@colroom
+ \fi
+% \end{macrocode}
+% When |\ST@pagesofar| is smaller than |\ST@pageleft| \TeX\ is
+% still collecting material for the first column, so we can start a
+% new tabular environment like we do on a single column page.
+% \changes{v4.0i}{1997/09/17}{Added initialisation for the case where
+% the first column isn't full yet}
+% \begin{macrocode}
+ \else
+ \global\advance\ST@pageleft by -\ST@pagesofar
+ \global\ST@pagesofar\z@
+ \fi
+ \else
+% \end{macrocode}
+% When we end up here, \TeX\ has already decided it had enough
+% material for the first column and is building the second column.
+% \changes{v4.1a}{1997/09/27}{Added initialisation for 2nd column of
+% twocolumn mode}
+% \begin{macrocode}
+ \ST@trace\tw@{Second column}
+ \ifnum\ST@pagesofar > \ST@pageleft
+ \ST@trace\tw@{starting new page}%
+ \newpage\@calnextpageht
+ \else
+ \global\advance\ST@pageleft by -\ST@pagesofar
+ \global\ST@pagesofar\z@
+ \fi
+ \fi
+ \else
+% \end{macrocode}
+% In one column mode there is a simple decision.
+% \begin{macrocode}
+ \ST@trace\tw@{one column mode}%
+ \ifnum\ST@pagesofar > \ST@pageleft
+ \ST@trace\tw@{starting new page}%
+ \newpage\@calnextpageht
+% \end{macrocode}
+% When we are not starting a new page subtract the size of the
+% material already on it from the available space.
+% \begin{macrocode}
+ \else
+ \global\advance\ST@pageleft by -\ST@pagesofar
+ \global\ST@pagesofar\z@
+ \fi
+ \fi
+ \ST@trace\tw@{Available height: \the\ST@pageleft}%
+% \end{macrocode}
+% Now we need to know the height of the head of the table. In order
+% to measure this we typeset it in a normal \Lenv{tabular}
+% environment.
+% \begin{macrocode}
+ \ifx\@@tablehead\@empty
+ \ST@headht=\z@
+ \else
+ \setbox\@tempboxa=\vbox{\@arrayparboxrestore
+ \ST@restore
+ \expandafter\tabular\expandafter{\ST@tableformat}%
+ \@@tablehead\endtabular}%
+ \ST@headht=\ht\@tempboxa\advance\ST@headht\dp\@tempboxa
+ \fi
+ \ST@trace\tw@{Height of head: \the\ST@headht}%
+% \end{macrocode}
+% To decide when to start a new page, we need to know the vertical
+% size of the tail of the table.
+% \begin{macrocode}
+ \ifx\@tabletail\@empty
+ \ST@tailht=\z@
+ \else
+ \setbox\@tempboxa=\vbox{\@arrayparboxrestore
+ \ST@restore
+ \expandafter\tabular\expandafter{\ST@tableformat}
+ \@tabletail\endtabular}
+ \ST@tailht=\ht\@tempboxa\advance\ST@tailht\dp\@tempboxa
+ \fi
+% \end{macrocode}
+% We add the average height of a line to this because when we
+% decide to continue the tabular we need to have enough space left
+% for one line and the tail.
+% \begin{macrocode}
+ \advance\ST@tailht by \ST@lineht
+ \ST@trace\tw@{Height of tail: \the\ST@tailht}%
+ \ST@trace\tw@{Maximum height of tabular: \the\ST@pageleft}%
+ \@tempdima\ST@headht
+% \end{macrocode}
+% \changes{v4.0b}{1997/02/04}{Base the decision whether to start on a
+% new page on the total of headheight, tailht and lineht}
+% Now we decide whether we can continue on the current page or
+% whether we need to start on a new page. We assume that the
+% minimum height of a tabular is the height of the head, the tail
+% and one line of data. If that doesn't fit a new page is started.
+% \begin{macrocode}
+ \advance\@tempdima\ST@lineht
+ \advance\@tempdima\ST@tailht
+ \ST@trace\tw@{Minimum height of tabular: \the\@tempdima}%
+ \ifnum\@tempdima>\ST@pageleft
+ \ST@trace\tw@{starting new page}%
+ \newpage\@calnextpageht
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@calnextpageht}
+% \changes{v3.7a}{1993/04/05}{Macro added}
+% \changes{v4.0b}{1997/02/04}{Removed use of \cs{ST@pboxcorr}}
+% This calculates the maximum height of the tabular on all
+% subsequent pages of the supertabular environment.
+% \begin{macrocode}
+\def\@calnextpageht{%
+ \ST@trace\tw@{Calculating height of tabular on next page}%
+ \global\ST@pageleft\@colroom
+ \global\ST@pagesofar=\z@
+ \ST@trace\tw@{Maximum height of tabular: \the\ST@pageleft}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\x@supertabular}
+% The body of the beginning of both environments is stored in a
+% single macro as the code is shared.
+% \begin{macrocode}
+\def\x@supertabular{%
+% \end{macrocode}
+% First save the original definition of |\tabular| and then make it
+% point to |\inner@tabular|. This is done to enable supertabular
+% cells to contain a \Lenv{tabular} environment without getting
+% unexpected results when the \Lenv{supertabular} would be split
+% accross this inner \Lenv{tabular} environment.
+% \changes{v4.0d}{1997/03/06}{Save definition of \cs{tabular} and
+% \cs{tabular*}}
+% \begin{macrocode}
+ \let\org@tabular\tabular
+ \let\tabular\inner@tabular
+% \end{macrocode}
+% The same needs to be done for the \Lenv{tabular*}
+% environment. The coding is slightly more verbose.
+% \begin{macrocode}
+ \expandafter\let
+ \csname org@tabular*\expandafter\endcsname
+ \csname tabular*\endcsname
+ \expandafter\let\csname tabular*\expandafter\endcsname
+ \csname inner@tabular*\endcsname
+% \end{macrocode}
+% If the caption should come at the top we insert it here.
+% \begin{macrocode}
+ \if@topcaption \@process@tablecaption \fi
+% \end{macrocode}
+% Save the original definition of |\\|.
+% \begin{macrocode}
+ \global\let\@oldcr=\\
+% \end{macrocode}
+% Save the current value of |\baselineskip|, as we need it in the
+% calculation of the average height of a line.
+% \begin{macrocode}
+ \def\baslineskp{\baselineskip}%
+% \end{macrocode}
+% We have to check whether \texttt{array.sty} was loaded, because
+% some of the internal macros have different names.
+% \begin{macrocode}
+ \ifx\undefined\@classix
+% \end{macrocode}
+% Save old |\@tabularcr| and insert the definition of
+% \changes{v4.1c}{1997/11/07}{For standard \LaTeX\ we need to change
+% \cs{@@startpbox}, \emph{not} \cs{@startpbox}}
+% |\@stabularcr|.
+% \begin{macrocode}
+ \let\org@tabularcr\@tabularcr
+ \let\@tabularcr\ST@tabularcr
+% \end{macrocode}
+% Activate the new parbox algorithm.
+% \begin{macrocode}
+ \let\org@startpbox=\@startpbox
+ \let\org@endpbox=\@endpbox
+ \let\@@startpbox=\ST@startpbox
+ \let\@@endpbox=\ST@endpbox
+ \else
+% \end{macrocode}
+% When \texttt{array.sty} was loaded things are a bit different.
+% \begin{macrocode}
+ \let\org@tabularcr\@arraycr
+ \let\@arraycr\ST@tabularcr
+ \let\org@startpbox=\@startpbox
+ \let\org@endpbox=\@endpbox
+ \let\@startpbox=\ST@astartpbox
+ \let\@endpbox=\ST@aendpbox
+ \fi
+% \end{macrocode}
+%
+% Check if the head of the table should be different for the first
+% and subsequent pages.
+% \begin{macrocode}
+ \ifx\@table@first@head\undefined
+ \let\@@tablehead=\@tablehead
+ \else
+ \let\@@tablehead=\@table@first@head
+ \fi
+% \end{macrocode}
+% The first part of a supertabular may be moved on to the next page
+% if it doesn't fit on the current page afterall. Subsequent parts
+% can not be moved; therefore we will have to switch the definition
+% of |\ST@skippart| around.
+% \changes{v4.0e}{1997/04/09}{Make sure that only the first part of a
+% supertabular can be moved to the next page.}
+% \begin{macrocode}
+ \let\ST@skippage\ST@skipfirstpart
+% \end{macrocode}
+% Now we can estimate the average line height and the height of the
+% first page of the \Lenv{supertabular}.
+% \changes{v4.0i}{1997/09/18}{Added \cs{noindent}}
+% \begin{macrocode}
+ \estimate@lineht
+ \@calfirstpageht
+ \noindent
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\supertabular}
+% We start by looking for an optional argument, which will be duly
+% ignored as it seems to make no sense to try to align a multipage
+% table in the middle...
+% \begin{macrocode}
+\def\supertabular{%
+ \@ifnextchar[{\@supertabular}%]
+ {\@supertabular[]}}
+% \end{macrocode}
+% We can now save the preamble of the tabular in a macro.
+% \begin{macrocode}
+\def\@supertabular[#1]#2{%
+ \def\ST@tableformat{#2}%
+ \ST@trace\tw@{Starting a new supertabular}%
+% \end{macrocode}
+% Then remember that this is not a \textsf{supertabular*}
+% environment.
+% \begin{macrocode}
+ \global\ST@starfalse
+% \end{macrocode}
+% Don't use minipages.
+% \changes{v4.1a}{1997/09/18}{Added setting of \cs{ST@mp}}
+% \begin{macrocode}
+ \global\ST@mpfalse
+% \end{macrocode}
+%
+% Most of the following code is shared between the
+% \Lenv{supertabular} and \Lenv{supertabular*} environments. So to
+% avoid duplication it is stored in a macro.
+% \begin{macrocode}
+ \x@supertabular
+% \end{macrocode}
+% Finally start a normal \textsf{tabular} environment.
+% \changes{v4.0d}{1997/03/06}{Use \cs{org@tabular} instead of
+% \cs{tabular}}
+% \begin{macrocode}
+ \expandafter\org@tabular\expandafter{\ST@tableformat}%
+ \@@tablehead}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\supertabular*}
+% We start by looking for the optional argument of the tabular
+% environment.
+% \begin{macrocode}
+\@namedef{supertabular*}#1{%
+ \@ifnextchar[{\@nameuse{@supertabular*}{#1}}%
+ {\@nameuse{@supertabular*}{#1}[]}%]
+ }
+% \end{macrocode}
+% We start by saving the intended width and the preamble of the
+% \textsf{tabular*}.
+% \begin{macrocode}
+\@namedef{@supertabular*}#1[#2]#3{%
+ \ST@trace\tw@{Starting a new supertabular*}%
+ \def\ST@tableformat{#3}%
+ \ST@wd=#1\relax
+ \global\ST@startrue
+ \global\ST@mpfalse
+% \end{macrocode}
+% Now we can call the common code for both environments.
+% \begin{macrocode}
+ \x@supertabular
+% \end{macrocode}
+% And we can start a normal \textsf{tabular*} environment.
+% \changes{v4.0f}{1997/04/11}{Use \cs{org@tabular*} instead of
+% \cs{tabular*}}
+% \begin{macrocode}
+ \expandafter\csname org@tabular*\expandafter\endcsname
+ \expandafter{\expandafter\ST@wd\expandafter}%
+ \expandafter{\ST@tableformat}%
+ \@@tablehead}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mpsupertabular}
+% \changes{v4.1a}{1997/09/18}{Added \cs{mpsupertabular}}
+%
+% This version of the supertabular environment puts each tabular
+% into a minipage, thus making footnotes possible.
+% We start by looking for an optional argument, which will be duly
+% ignored as it seems to make no sense to try to align a multipage
+% table in the middle\dots
+% \begin{macrocode}
+\def\mpsupertabular{%
+ \@ifnextchar[{\@mpsupertabular}%]
+ {\@mpsupertabular[]}}
+% \end{macrocode}
+% We can now save the preamble of the tabular in a macro.
+% \begin{macrocode}
+\def\@mpsupertabular[#1]#2{%
+ \def\ST@tableformat{#2}%
+ \ST@trace\tw@{Starting a new mpsupertabular}%
+% \end{macrocode}
+% Then remember that this is not a \textsf{mpsupertabular*}
+% environment.
+% \begin{macrocode}
+ \global\ST@starfalse
+% \end{macrocode}
+%
+% And remember to close the minipage later.
+% \begin{macrocode}
+ \global\ST@mptrue
+% \end{macrocode}
+%
+% Since we are about to start a minipage of |\columnwidth| the
+% horizontal alignment will no longer work. We have to remember the
+% values and restore them inside the minipage.
+% \begin{macrocode}
+ \ST@rightskip \rightskip
+ \ST@leftskip \leftskip
+ \ST@parfillskip \parfillskip
+% \end{macrocode}
+%
+% Most of the following code is shared between the
+% \Lenv{mpsupertabular} and \Lenv{mpsupertabular*} environments. So
+% to avoid duplication it is stored in a macro.
+% \begin{macrocode}
+ \x@supertabular
+% \end{macrocode}
+% Finally start a normal \textsf{tabular} environment.
+% \changes{v4.1a}{1997/09/18}{Open minipage and adjust skips}
+% \begin{macrocode}
+ \minipage{\columnwidth}%
+ \parfillskip\ST@parfillskip
+ \rightskip \ST@rightskip
+ \leftskip \ST@leftskip
+ \noindent\expandafter\org@tabular\expandafter{\ST@tableformat}%
+ \@@tablehead}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mpsupertabular*}
+% \changes{v4.1a}{1997/09/18}{Added \cs{mpsupertabular*}}
+%
+% We start by looking for the optional argument of the tabular
+% environment.
+% \begin{macrocode}
+\@namedef{mpsupertabular*}#1{%
+ \@ifnextchar[{\@nameuse{@mpsupertabular*}{#1}}%
+ {\@nameuse{@mpsupertabular*}{#1}[]}%]
+ }
+% \end{macrocode}
+% Now we can save the intended width and the preamble of the
+% \textsf{tabular*}.
+% \begin{macrocode}
+\@namedef{@mpsupertabular*}#1[#2]#3{%
+ \ST@trace\tw@{Starting a new mpsupertabular*}%
+ \def\ST@tableformat{#3}%
+ \ST@wd=#1\relax
+ \global\ST@startrue
+ \global\ST@mptrue
+ \ST@rightskip \rightskip
+ \ST@leftskip \leftskip
+ \ST@parfillskip \parfillskip
+% \end{macrocode}
+%
+% Then we can call the common code for both environments.
+% \begin{macrocode}
+ \x@supertabular
+% And we can start a normal \textsf{tabular*} environment.
+% \begin{macrocode}
+ \minipage{\columnwidth}%
+ \parfillskip\ST@parfillskip
+ \rightskip \ST@rightskip
+ \leftskip \ST@leftskip
+ \noindent\expandafter\csname org@tabular*\expandafter\endcsname
+ \expandafter{\expandafter\ST@wd\expandafter}%
+ \expandafter{\ST@tableformat}%
+ \@@tablehead}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endsupertabular}
+% \begin{macro}{\endsupertabular*}
+% This closes the environments \Lenv{supertabular} and
+% \Lenv{supertabular*}.
+% \begin{macrocode}
+\def\endsupertabular{%
+ \ifx\@table@last@tail\undefined
+ \@tabletail
+ \else
+ \@table@last@tail
+ \fi
+ \csname endtabular\ifST@star*\fi\endcsname
+% \end{macrocode}
+% Restore the original definition of |\@tabularcr|
+% \begin{macrocode}
+ \ST@restore
+% \end{macrocode}
+% Check if we have to insert a caption and restore to default
+% behaviour of putting captions at the top.
+% \begin{macrocode}
+ \if@topcaption
+ \else
+ \@process@tablecaption
+ \@topcaptiontrue
+ \fi
+% \end{macrocode}
+%
+% Restore the meaning of |\\| to the one it had before the start
+% of this environment. Also re-initialize some control-sequences
+%
+% \changes{v4.0h}{1997/05/20}{Added missing \cs{global} commands}
+% \changes{v4.1d}{1999/08/07}{No longer make \cs{@table@first@head}
+% and \cs{@table@last@tail} undefined}
+% \begin{macrocode}
+ \global\let\\\@oldcr
+ \global\let\@process@tablecaption\relax
+ \ST@trace\tw@{Ended a supertabular\ifST@star*\fi}%
+ }
+% \end{macrocode}
+%
+% The definition of the ending of the \Lenv{supertabular*}
+% environment is simple:
+% \begin{macrocode}
+\expandafter\let\csname endsupertabular*\endcsname\endsupertabular
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\endmpsupertabular}
+% \begin{macro}{\endmpsupertabular*}
+% This closes the environments \Lenv{mpsupertabular} and
+% \Lenv{mpsupertabular*}.
+% \begin{macrocode}
+\def\endmpsupertabular{%
+ \ifx\@table@last@tail\undefined
+ \@tabletail
+ \else
+ \@table@last@tail
+ \fi
+ \csname endtabular\ifST@star*\fi\endcsname
+ \endminipage
+% \end{macrocode}
+% Restore the original definition of |\@tabularcr|
+% \begin{macrocode}
+ \ST@restore
+% \end{macrocode}
+% Check if we have to insert a caption and restore to default
+% behaviour of putting captions at the top.
+% \begin{macrocode}
+ \if@topcaption
+ \else
+ \@process@tablecaption
+ \@topcaptiontrue
+ \fi
+% \end{macrocode}
+%
+% Restore the meaning of |\\| to the one it had before the start
+% of this environment. Also re-initialize some control-sequences
+% \changes{v4.1d}{1999/08/07}{No longer make \cs{@table@first@head}
+% and \cs{@table@last@tail} undefined}
+% \begin{macrocode}
+ \global\let\\\@oldcr
+ \global\let\@process@tablecaption\relax
+ \ST@trace\tw@{Ended a mpsupertabular\ifST@star*\fi}%
+ }
+% \end{macrocode}
+%
+% The definition of the ending of the \Lenv{supertabular*}
+% environment is simple:
+% \begin{macrocode}
+\expandafter\let\csname endmpsupertabular*\endcsname\endmpsupertabular
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ST@restore}
+% This macro restores the original definitions of the macros that
+% handle parbox entries and the macros that handle the end of the
+% row.
+% \begin{macrocode}
+\def\ST@restore{%
+ \ifx\undefined\@classix
+ \let\@tabularcr\org@tabularcr
+ \else
+ \let\@arraycr\org@tabularcr
+ \fi
+ \let\@startpbox\org@startpbox
+ \let\@endpbox\org@endpbox
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\inner@tabular}
+% \begin{macro}{\inner@tabular*}
+% In order to facilitate complete \Lenv{tabular} environments to be
+% in a cell of a \Lenv{supertabular} environment we need to adapt
+% the definition of the orginal environments somewhat. For the
+% inner \Lenv{tabular} a number of definitions needs to be
+% restored.
+% \changes{v4.0i}{1997/09/18}{Added \cs{noindent}}
+% \begin{macrocode}
+\def\inner@tabular{%
+ \ST@restore
+ \let\\\@oldcr
+ \noindent
+ \org@tabular}
+\@namedef{inner@tabular*}{%
+ \ST@restore
+ \let\\\@oldcr
+ \noindent
+ \csname org@tabular*\endcsname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ST@cr}
+% This macro is called by each |\\| inside the tabular environment.
+% It updates the estimate of the amount of space left on the
+% current page and starts a new page if necessary.
+% \begin{macrocode}
+\def\ST@cr{%
+ \noalign{%
+ \ifnum\ST@pboxht<\ST@lineht
+% \end{macrocode}
+% If there is a non-empty line, but an empty parbox, then
+% |\ST@pboxht| might be non-zero, but too small thereby breaking
+% the algorithm. Therefore we estimate the height of the line to be
+% |\ST@lineht| in this case.
+% \begin{macrocode}
+ \global\advance\ST@pageleft -\ST@lineht
+% \end{macrocode}
+% And we store that fact in |\ST@prevht|.
+% \changes{v4.0g}{1997/04/12}{store the height of the previous line in
+% \cs{ST@prevht}}
+% \begin{macrocode}
+ \global\ST@prevht\ST@lineht
+ \else
+% \end{macrocode}
+% When the parbox was not empty we take into account its height
+% (plus a bit extra).
+% \changes{v4.0g}{1997/04/12}{Also take \cs{ST@stretchht} into
+% account and store the height of the parbox in \cs{ST@prevht}}
+% \begin{macrocode}
+ \ST@trace\thr@@{Added par box with height \the\ST@pboxht}%
+ \global\advance\ST@pageleft -\ST@pboxht
+ \global\advance\ST@pageleft -0.1\ST@pboxht
+ \global\advance\ST@pageleft -\ST@stretchht
+ \global\ST@prevht\ST@pboxht
+ \global\ST@pboxht\z@
+ \fi
+% \end{macrocode}
+% |\ST@toadd| is the value of the optional argument of |\\|.
+% \begin{macrocode}
+ \global\advance\ST@pageleft -\ST@toadd
+ \global\ST@toadd=\z@
+ \ST@trace\thr@@{Space left for tabular: \the\ST@pageleft}%
+ }
+% \end{macrocode}
+% This line is necessary because the tablehead has to be inserted
+% *after* the following |\if\else\fi|-clause. For this purpose
+% |\ST@next| is used by |\ST@newpage|. But we need to make sure
+% that |\ST@next| is not undefined when |\ST@newpage| is \emph{not}
+% called. In the middle of tableprocessing it shoud be an *empty*
+% macro (*not* |\relax|).% (15.2.91)
+% \changes{v4.1e}{2001/08/21}{Moved the default definition of
+% \cs{ST@next} out of the \cs{if} clause}
+% \begin{macrocode}
+ \noalign{\global\let\ST@next\@empty}%
+% \end{macrocode}
+% When the |\ST@pageleft| has become negative, the last row was so
+% high that the supertabular doesn't fit on the current page after
+% all. In this case we will skip the current page and start at the
+% top of the next one; otherwise \TeX\ will move this part of the
+% table to a new page anyway, probably with a message about an
+% overfull |\vbox|.
+% \begin{macrocode}
+ \ifnum\ST@pageleft<\z@
+ \ST@skippage
+ \else
+% \end{macrocode}
+% When there is not enough space left on the current page, we start
+% a new page. To compute the amount of space needed we use the
+% height of the previous line (|\ST@prevht|) as an estimation of
+% the height of the next line. If we are processing a
+% \Lenv{mpsupertabular} we need to take the height of the footnotes
+% into account.
+% \changes{v4.0g}{1997/04/12}{Leave room for both \cs{ST@tailht}
+% \emph{and} \cs{ST@prevht}}
+% \changes{v4.1a}{1997/09/19}{Take care of space needed for
+% footnotes and footnoterule}
+% \begin{macrocode}
+ \noalign{\global\@tempdima\ST@tailht
+ \global\advance\@tempdima\ST@prevht
+ \ifST@mp
+ \ifvoid\@mpfootins\else
+ \global\advance\@tempdima\ht\@mpfootins
+ \global\advance\@tempdima 3pt
+ \fi
+ \fi}
+ \ifnum\ST@pageleft<\@tempdima
+ \ST@newpage
+ \fi
+ \fi
+ \ST@next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@skipfirstpart}
+% \changes{v4.0d}{1997/03/06}{Added new macro.}
+% \changes{v4.0e}{1997/04/09}{Renamed from \cs{ST@skippage}}
+% This macro skips the current page and moves the entire
+% supertabular that has been built up sofar to the next page.
+% \begin{macrocode}
+\def\ST@skipfirstpart{%
+ \noalign{%
+ \ST@trace\tw@{Tabular too high, moving to next page}%
+% \end{macrocode}
+% In order for this to work properly we need to adapt the value of
+% |\ST@pageleft|. When this macro is called it has a negative
+% value. We should add the height of the next page to that
+% (|\@colroom|). From the result the `normal' height of the
+% supertabular should be substracted (|\@colroom| -
+% |\pagetotal|). This could be coded as follows:
+%\begin{verbatim}
+% \ST@dimen\@colroom
+% \advance\ST@dimen-\pagetotal
+% \global\advance\ST@pageleft\@colroom
+% \global\advance\ST@pageleft-\ST@dimen
+%\end{verbatim}
+% When you examine the code you will note that |\@colroom| is added
+% \emph{and} subtracted. Therefore the code above can be simplified
+% to:
+% \begin{macrocode}
+ \global\advance\ST@pageleft\pagetotal
+% \end{macrocode}
+% Then we can set |\ST@pagesofar| to $0$ and start the new page.
+% \begin{macrocode}
+ \global\ST@pagesofar\z@
+ \newpage
+% \end{macrocode}
+%
+% Finally we make sure that this macro can only be executed once
+% for each supertabular by changing the definition of
+% |\ST@skippage|.
+% \changes{v4.0e}{1997/04/09}{Make sure that only the first part of a
+% supertabular can be moved to the next page.}
+% \begin{macrocode}
+ \global\let\ST@skippage\ST@newpage
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ST@newpage}
+% \changes{v3.7b}{1994/05/16}{Added macro, split off from
+% \cmd\ST@cr}
+% This macro performs the actions necessary to start a new page.
+% \begin{macrocode}
+\def\ST@newpage{%
+ \noalign{\ST@trace\tw@{Starting new page, writing tail}}%
+% \end{macrocode}
+% Output |\tabletail|, close the tabular environment, close a
+% \Lenv{mnipage} if necessary, output all material and start a
+% fresh new page.
+% \changes{v4.1a}{1997/09/19}{Close minipage if we are in
+% \Lenv{mpsupertabular}}
+% \begin{macrocode}
+ \@tabletail
+ \ifST@star
+ \csname endtabular*\endcsname
+ \else
+ \endtabular
+ \fi
+ \ifST@mp
+ \endminipage
+ \fi
+% \end{macrocode}
+%
+% Then we make sure that the macro |\ST@skippage| can no longer be
+% executed for this supertabular by changing the definition of it.
+% \changes{v4.0d}{1997/03/06}{Use \cs{org@tabular} instead of
+% \cs{tabular}}
+% \changes{v4.0e}{1997/04/09}{Make sure that only the first part of a
+% supertabular can be moved to the next page.}
+% \changes{v4.0f}{1997/04/11}{Use \cs{org@tabular*} instead of
+% \cs{tabular*}}
+% \changes{v4.0i}{1997/09/18}{Added \cs{noindent}}
+% \changes{v4.1a}{1997/09/19}{Open new minipage if we are in
+% \Lenv{mpsupertabular}}
+% \begin{macrocode}
+ \global\let\ST@skippage\ST@newpage
+ \newpage\@calnextpageht
+ \let\ST@next\@tablehead
+ \ST@trace\tw@{writing head}%
+ \ifST@mp
+ \noindent\minipage{\columnwidth}%
+ \parfillskip\ST@parfillskip
+ \rightskip \ST@rightskip
+ \leftskip \ST@leftskip
+ \fi
+ \noindent
+ \ifST@star
+ \expandafter\csname org@tabular*\expandafter\endcsname
+ \expandafter{\expandafter\ST@wd\expandafter}%
+ \expandafter{\ST@tableformat}%
+ \else
+ \expandafter\org@tabular\expandafter{\ST@tableformat}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/supertabular/supertabular.ins b/macros/latex/contrib/supertabular/supertabular.ins
new file mode 100644
index 0000000000..a233addd62
--- /dev/null
+++ b/macros/latex/contrib/supertabular/supertabular.ins
@@ -0,0 +1,71 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2004 Johannes L. Braams. All rights reserved.
+%%
+%% This file is part of the supertabular package.
+%% ----------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the supertabular package is
+%% given in the file `MANIFEST'.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2004/02/20}
+\def\batchfile{supertabular.ins}
+\input docstrip.tex
+\keepsilent
+
+\preamble
+Copyright (C) 1989-2004 Johannes Braams. All rights reserved.
+
+This file was generated from file(s) of the supertabular package.
+-----------------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the
+supertabular package. You may however distribute the supertabular package
+without such generated files.
+
+The list of all files belonging to the supertabular package is
+given in the file `manifest.txt.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\generateFile{supertabular.sty}{f}{\from{supertabular.dtx}{package}}
+
+\endinput
+%%
+%% end of file supertab.ins
diff --git a/macros/latex/contrib/supertabular/supertabular.pdf b/macros/latex/contrib/supertabular/supertabular.pdf
new file mode 100644
index 0000000000..5567cc7ee0
--- /dev/null
+++ b/macros/latex/contrib/supertabular/supertabular.pdf
Binary files differ