[comp.text] multiple small tables per page

mikew@wheeler (Mike Whitbeck) (02/06/90)

I asked here (a while back) about putting multiple small tables
per page in LaTeX and also in getting the captions to fold
(wrap) beneath the tables.

I got a couple of replies. Here is what I hacked up in case
someone  is interested (or can improve).

I put the tabular environment in a savebox, get the width, build
a minipage and put the caption in there. Here is an example that
puts 4 small tables on one page with the captions wrapped
underneath:
------------------
\documentstyle{article}

\begin{document}
%
% THIS SAMPLE TEMPLATE WILL PUT TWO small TABLES SIDE BY SIDE
%
\newdimen\mpwidth
\newdimen\owidt
\newlength{\Tfil}
\newsavebox{\Temp}
\newsavebox{\Other}

\sbox{\Temp}
{%                           Insert tabular environment here
\begin{tabular}{|c|c|c|}\hline
24 & bladder & Initial \\ 
hour & pump & value \\ 
\hline
\hline
   0.783 &            0.788 &            0.794 \\
    0.788 &            0.783 &            0.788 \\
    0.788 &            0.788 &            0.788 \\
    0.788 &            0.783 &            0.788 \\
    0.794 &            0.783 &            0.788 \\
\hline
\hline
\multicolumn{3}{|c|}{ $19 < (W=)21.5 < 36$ }  \\   
\hline
\end{tabular}
}%
\sbox{\Other}
{%                           Insert tabular environment here
\begin{tabular}{|c|c|c|}\hline
24 & bladder & Initial \\ 
hour & pump & value \\ 
\hline
\hline
  0.079 &           0.081 &           0.074 \\
   0.082 &           0.078 &           0.076 \\
   0.081 &           0.078 &           0.076 \\
   0.082 &           0.079 &           0.074 \\
   0.078 &           0.079 &           0.079 \\
\hline
\hline
\multicolumn{3}{|c|}{ $19 < (W=)21.5 < 36$ }  \\   
\hline
\end{tabular}
}%

\settowidth{\mpwidth}{\usebox{\Temp}} 
\settowidth{\owidt}{\usebox{\Other}} 
\setlength{\Tfil}{0.5in}

\begin{table}
\begin{center}
\begin{minipage}{\mpwidth}
\usebox{\Temp}
%
% Caption goes here for the table in Temp
\caption{Cu recovery (mg/l) from run 16863PL.dat}
%
\end{minipage} \makebox[\Tfil]{} \begin{minipage}{\owidt} 
\usebox{\Other}
%
% Caption goes here for the table in Other
\caption{Cr recovery (mg/l) from run 16863PL.dat}
%
\end{minipage}
\end{center}
\end{table}
%
% You may now reuse the saveboxes for another pair of tabulars
%
\sbox{\Temp}
{%                           Insert tabular environment here
\begin{tabular}{|c|c|c|}\hline
24 & bladder & Initial \\ 
hour & pump & value \\ 
\hline
\hline
0.00185 &         0.00172 &         0.00185 \\
 0.00187 &         0.00163 &         0.00204 \\
 0.00178 &         0.00163 &         0.00202 \\
 0.00165 &         0.00168 &         0.00208 \\
 0.00176 &         0.00174 &         0.00195 \\
\hline
\hline
\multicolumn{3}{|c|}{ $19 \not\leq (W=)18 < 36$ }  \\   
\hline
\end{tabular}
}%
\sbox{\Other}
{%                           Insert tabular environment here
\begin{tabular}{|c|c|c|}\hline
24 & bladder & Initial \\ 
hour & pump & value \\ 
\hline
\hline
  1.029 &           1.045 &           1.045 \\
   1.042 &           1.051 &           1.042 \\
   1.038 &           1.113 &           1.036 \\
   1.038 &           1.026 &           1.036 \\
   1.042 &           1.023 &           1.029 \\
\hline
\hline  
\multicolumn{3}{|c|}{ $19 < (W=)30 < 36$ }  \\   
\hline
\end{tabular}
}%

\settowidth{\mpwidth}{\usebox{\Temp}} 
\settowidth{\owidt}{\usebox{\Other}} 
\setlength{\Tfil}{0.5in}

\begin{table}
\begin{center}
\begin{minipage}{\mpwidth}
\usebox{\Temp}
%
% Caption goes here for the table in Temp
\caption{Hg recovery (mg/l) from run 16863PL.dat}
%
\end{minipage} \makebox[\Tfil]{} \begin{minipage}{\owidt} 
\usebox{\Other}
%
% Caption goes here for the table in Other
\caption{K recovery (mg/l) from run 16863PL.dat}
%
\end{minipage}
\end{center}
\end{table}

\end{document}
------------------
 ~ ___________________________________________________________
 ~ |Mike Whitbeck             | mikew@wheeler.wrc.unr.edu    |
 ~ |__________________________|__RENO___NEVADA_______________|