The supertabular environment^{∗}

Johannes Braams and Theo Jurriens

1997/09/27

1 Introduction

The package supertabular offers a new environment, the supertabular environment. As the name indicates it is an extension of the normal tabular environment.

With the original tabular environment a tabular must always fit on one page. If the tabular becomes too large the text overwrites the page’s bottom margin and you get an Overfull vbox message.

The supertabular environment uses the 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 tabular environment and inserts the optional tablehead on the new page continuing the tabular.

2 User interface

The package supertabular has three options, they control the amount of information that is written to the .log file.

1. The option errorshow (the default) doens’t write any extra information.

2. The option pageshow writes information about when and why supertabular decides to break the tabular environment in order to produce a new page.

3. The option debugshow also adds information about each line that is added to the tabular.

Below is a description of the new commands and environments that this package provides.

\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 \\.

\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 \\

∗This file has version number v4.1a, last revised 1997/09/27.

\tabletail The command \tabletail takes one argument, it defines something which

should be inserted before each \end{tabular}, except the last.

\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.

\topcaption These commands all take the same arguments as L^{A}TEX’s standard \caption

\bottomcaption
\tablecaption

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.

supertabular The environments supertabular and supertabular* can be used much like the supertabular* standard L^{A}TEX environments tabular and tabular*. mpsupertabular The environments mpsupertabular and mpsupertabular* work like the supertabmpsupertabular* ular and supertabular* environments but put each page into a minipage first. Thus

it is possible to have footnotes inside a mpsupertabular. The footnotetext is printed at the end of each page.

\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.

3 Weak points

• When the material of a normal entry (not a p-arg) becomes larger than the estimated \ST@lineht, overfull \vboxes will be produced at all.

• 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.

• 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.

• The mpsupertabular environment sometimes has problems with pagesbreaks when footnotes appear in the lower part of the tabular.

4 Examples

Here is an example of a supertabular. You will find the definitions after the table.

3

Number Number^{2} Number^{4}  Number!
1  1  1  1
2  4  16  2
3  9  81  6
4  16  256  24
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

13  169  28561 6.22702080E+9

14  196  38416 8.71782912E+10
15  225  50625 1.30767437E+12
16  256  65536 2.09227899E+13
17  289  83521 3.55687428E+14
18  324  104976 6.40237370E+15
19  361  130321 1.21645100E+17
20  400  160000 2.43290200E+18

Table 1: This table is split across pages

And here is (part of) the user input for the table above:

\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}

Here is another example whith a p column-definition. The tablehead is the same as above. The tabletail is a double \hline; \arraystretch is set to 1.5 and the font size is \small.

Table 2: This table should also be split accross pages.

continued from previous page

Number Number^{2} Number^{4}  Number!
1  1  1 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

continued on next page

continued on next page

continued on next page

continued on next page

continued from previous page

Number Number^{2} Number^{4} Number!

Number Number^{2} Number^{4} Number!

Number Number^{2} Number^{4} Number!