1 The Supertabular

Here is the description of a new style file called supertab. This new style offers a new environment, the supertabular environment. As the name says 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 \end{tabular} command, starts a new page and inserts the tablehead on the new page continuing the tabular.

New commands to use with supertabular are:

\tablefirsthead{...} 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 \\ or

                            \newline.

\tablehead{...} defines the contents of all subsequent ocurrences of the tabular head. Don’t forget to close the

                            head by a \\ or \newline.

\tabletail{...} defines something which should be inserted be-

fore each \end{tabular}, except the last.

\tablelasttail{...} defines something which should be inserted before the last \end{tabular}. The use of this command is optional.

      \topcaption{...}
      \bottomcaption{...}

\tablecaption{...} 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.

Note that you define new lines inside the supertabular as normal by \\ or \\[...pt]. All column definition commands can be used, including @{...} and p{...}. You can not use the optional positioning argument and the width argument which are possible with the

\begin{tabular} command.

Here is an example of a supertabular. You will find the definitions at the end of the supertabular.

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

continued on next page

continued from previous page

Number Number^{2} Number^{4}  Number!
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 are the definitions:

\newcommand{\tbsp}{\rule{0pt}{18pt}}
                  % I use \tbsp to get a vertical distance after \hline
\tablefirsthead{\hline  \multicolumn{1}{|c}{\tbsp Number}
                       & \multicolumn{1}{c}{Number$^2$}
                       & Number$^4$
                       & \multicolumn{1}{c|}{Number!} \\ \hline\tbsp  }
\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\tbsp  }
\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}

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 font size is

\small.

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

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 here is also a long entry, where

also a line break should occur

4 1 1 here is also a long entry, where

also a line break should occur

5  1  1 here is a relative short entry
6  1  1 here is also a long entry, where

also a line break should occur

7 1 1 here is also a long entry, where

also a line break should 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 here is also a long entry, where

also a line break should occur

11 1 1 here is also a long entry, where

also a line break should occur

12  1  1 here is a relative short entry
13  1  1 here is also a long entry, where

also a line break should 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

continued on next page

Number Number^{2} Number^{4}  Number!
16  1  1 here is also a long entry, where

also a line break should 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

Here is the same table again, but this time using the supertabular* environment and stretching the table to the full width of the text.

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 here is also a long entry, where

also a line break should occur

4  1  1 here is also a long entry, where

also a line break should occur

5  1  1 here is a relative short entry
6  1  1 here is also a long entry, where

also a line break should occur

7  1  1 here is also a long entry, where

also a line break should 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 here is also a long entry, where

also a line break should occur

11  1  1 here is also a long entry, where

also a line break should occur

12  1  1 here is a relative short entry
13  1  1 here is also a long entry, where

also a line break should occur

continued on next page

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

2 Known problems

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

• You should not use the supertabular inside a floating-environment such as table as this will result in TEX trying to put the whole supertabular on one page.

• In some instances you might still end up with overfull \vbox messages. These instances are described in the (documented version of) the style file itself.

• Sometimes the last page of the supertabular contains just an empty head an tail.