[comp.text.tex] Tables in LaTEX?

ppalmer@oskar.uchicago.edu (Patrick Palmer) (04/24/91)

I am trying to make footnotes in a table in LaTEX, and having no luck.
I am using the table environment, and tried to put in footnotes just
as one would in text.  The numbers denoting footnotes appear in the
right places, but the footnotes do not appear.  (Since I want the table
on a separate page, I am making it float, but it the footnotes don't
footnotes don't come out even if I forget about float.)  The little bit
on footnotes in tables on Page 99 of the Lamport book is enough to
indicate that it is possible, but not enough to help me figure out
how.

Second, I don't want to use numbers for the footnote symbol anyway.
(Numbers make the meaning ambiguous.)  I thought one could choose the
symbol, but it seems you can only do so in mathmode?

Third, how does one control the size of type in caption of the table?
It comes out smaller than the text and the contents of the table.

I would be very grateful for any tips.

tvz@zandtwerk.Princeton.EDU (Timothy Van Zandt) (04/24/91)

In article <1991Apr23.200105.14819@midway.uchicago.edu>
ppalmer@oskar.uchicago.edu (Patrick Palmer) writes:

>I am trying to make footnotes in a table in LaTEX, and having no luck.
>I am using the table environment, and tried to put in footnotes just
>as one would in text.  The numbers denoting footnotes appear in the
>right places, but the footnotes do not appear.  (Since I want the table
>on a separate page, I am making it float, but it the footnotes don't
>footnotes don't come out even if I forget about float.)  The little bit
>on footnotes in tables on Page 99 of the Lamport book is enough to
>indicate that it is possible, but not enough to help me figure out
>how.

The bit about footnotes in tables on page 99 is for putting the footnote
at the bottom of the table, rather than at the bottom of the page. This
is the correct style according to the Chicago Manual of Style. The
procedure is to put the contents of the table in a minipage. I.e., you
should have

\begin{table}
\begin{minipage}{\textwidth}
<stuff, including footnotes>
\end{minipage}
\caption{blah blah}
\end{table}

Since you are likely to be making boxes in the table, you should read
Section C.2.3 about how to put footnotes in boxes. This is also how you
would put a footnote in a table and have the footnote appear at the bottom
of the page, although you will have trouble keeping the footnote and the
table on the same page if the table floats, and this really is not standard
style. (It would look especially wierd if you are using special footnote
symbols, rather than the regular sequence of symbols.)


>Second, I don't want to use numbers for the footnote symbol anyway.
>(Numbers make the meaning ambiguous.)  I thought one could choose the
>symbol, but it seems you can only do so in mathmode?

The footnote symbol is usually the value of \thefootnote, but in the
minipage environment, it is the value of \thempfootnote. This is set
by default to \alph{mpfootnote}, so that small letters a, b, ... are
used as footnote markers. If you want to use a succession of asterisks,
daggers and so forth, put

\def\thempfootnote{\fnsymbol{mpfootnote}}

at the beginning of the minipage environment, or put it in the preamble
so that it applies to all minipage environments.

If you want to put some other symbol, then put

\def\markedmpfootnote#1#2{{\def\thempfootnote{#1}\footnote[1]{#2}}}

in the preamble, and to use @ as a footnote symbol, use

blah blah\markedmpfootnote{@}{See also column 5 above.} blah blah

(I haven't tried this in the minipage environment, but I think it
will work.)

If you are putting the footnotes at the bottom of the page, then eliminate
mp from each of the commands given above.


>Third, how does one control the size of type in caption of the table?
>It comes out smaller than the text and the contents of the table.

You need to put some font or size changing commands in the definition of
\@makecaption. I put the following in a style file

\long\def\@makecaption#1#2{%
 \vskip 10pt 
 \setbox\@tempboxa\hbox{{\captionfontone #1:}
  {\captionfonttwo #2}}
 \ifdim \wd\@tempboxa >\hsize {\captionfontone #1:}
  {\captionfonttwo #2}\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil} 
 \fi}

so that I can set the caption fonts freely. For example:

\def\captionfontone{\large}
\def\captionfonttwo{\large}


Hope this helps.

Tim Van Zandt
tvz@princeton.edu

Andrew Gilmartin (04/24/91)

In article <1991Apr23.200105.14819@midway.uchicago.edu>
ppalmer@oskar.uchicago.edu (Patrick Palmer) writes:

>I am trying to make footnotes in a table in LaTEX, and having no luck.

The following example tables don't answer all your questions but they might be
usefull.

-- Andrew Gilmartin
   Computing & Information Services
   Brown University
   (401) 863-7305
   andrew@brownvm.brown.edu


\documentstyle{article}
\begin{document}

\begin{table}[h]
%
   \begin{center}
%
      \begin{tabular}{cccc}
         aA & eE & iI & mM \\
         bB & fF & jJ & nN \\
         cC & gG & kK & oO \\
         dD & hH & lL & pP \\
      \end{tabular}
%
   \end{center}
%
   \caption{Starter}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
      \begin{tabular}{|cccc|} \hline
         aA & eE & iI & mM \\
         bB & fF & jJ & nN \\
         cC & gG & kK & oO \\
         dD & hH & lL & pP \\ \hline
      \end{tabular}
%
   \end{center}
%
   \caption{Boxing the tables with a bar and hline}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
      \begin{tabular}{|c|c|c|c|} \hline
         aA & eE & iI & mM \\ \hline
         bB & fF & jJ & nN \\ \hline
         cC & gG & kK & oO \\ \hline
         dD & hH & lL & pP \\ \hline
      \end{tabular}
%
   \end{center}
%
   \caption{Using more hline}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
      \renewcommand{\arraystretch}{1.5}
%
      \begin{tabular}{|c|c|c|c|} \hline
         aA & eE & iI & mM \\ \hline
         bB & fF & jJ & nN \\ \hline
         cC & gG & kK & oO \\ \hline
         dD & hH & lL & pP \\ \hline
      \end{tabular}
%
   \end{center}
%
   \caption{Changing the height of cells by renewing arraystretch}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
      \begin{tabular}{|c|cccc|} \hline
         \bf One  & aA & eE & iI & mM \\ \cline{2-5}
                  & bB & fF & jJ & nN \\ \hline
         \bf Two  & cC & gG & kK & oO \\ \cline{2-5}
                  & dD & hH & lL & pP \\ \hline
      \end{tabular}
%
   \end{center}
%
   \caption{Using cline to visually group rows}
%
\end{table}


\begin{table}[h]
%
   \begin{center}
%
      \begin{tabular}{|c|l|p{3in}|} \hline
%
         \bf Symbol
         & \bf Function
         & \bf Description \\ \hline
%
         \tt\&
         & Concatenate
         & Appends the text on the right of the end of the text string 
         on the left.\\ \hline
%      
         \tt""
         & Text Constant
         & Marks the beginning and the end of characters to be considered 
         a text constant. If you enter text into a formula without using 
         quotes, FileMaker Pro interprets the text as a field or function 
         name.\\ \hline
%      
         \tt\P
         & Return Marker
         & Used wherever you want to insert a text constant containing a 
         paragraph return.\\ \hline
%
      \end{tabular}
%
   \end{center}
%
   \caption{Using cols' p}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
      \begin{tabular}{|c|c|c|c|}\hline
         \multicolumn{2}{|c|}{One} & \multicolumn{2}{|c|}{Two} \\ \hline
         aA & eE & iI & mM \\ \hline
         bB & fF & jJ & nN \\ \hline
         cC & gG & kK & oO \\ \hline
         dD & hH & lL & pP \\ \hline
      \end{tabular}
%
   \end{center}
%
   \caption{Using multicolumn to visually group columns}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
      \begin{tabular}{|c|c|c|c|}\hline
         \multicolumn{4}{|c|}{One} \\ \hline
         \multicolumn{3}{|c|}{Two} & Three \\ \cline{1-3}
         Four & Five & Six & \null \\ \hline
         aA & eE & iI & mM \\ \hline
         bB & fF & jJ & nN \\ \hline
         cC & gG & kK & oO \\ \hline
         dD & hH & lL & pP \\ \hline
      \end{tabular}
%
   \end{center}
%
   \caption{Using more multicolumn}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
%     You create footnoted tables by placing the tabular environment
%     inside a minipage. Use the width of the table (when printed) as
%     the width of the minipage---1.5in in the example below. 
%
%     To determine the width of your table print one copy with a 
%     minipage width of \textwidth; Then replace \textwidth with the 
%     measured width the the printed table. I wish I know of a better 
%     way...
%
%     \begin{minipage}{\textwidth}
%
      \begin{minipage}{1.5in}
%
         \renewcommand{\footnoterule}{}
%
         \begin{tabular}{|c|c|c|c|} \hline
            aA & eE & iI & mM \\ \hline
            bB & fF & jJ & nN \\ \hline
            cC & gG & kK 
               & oO\footnote{Footnote for Table~\ref{tab:foot}}\\ \hline
            dD & hH & lL & pP \\ \hline
         \end{tabular}
%
      \end{minipage}
%
   \end{center}
%
   \caption{Using footnotes}\label{tab:foot}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
      \begin{tabular}{|r|r|r|} \hline
         \multicolumn{1}{|c|}{One}
         & \multicolumn{1}{|c|}{Two}
         & \multicolumn{1}{|c|}{Three} \\ \hline
          1.23   &  3.4   &   5.678    \\
          9.0123 &  4.567 & 890.1      \\
         23.45   & 67.8   &   9        \\ \hline
      \end{tabular}
%
   \end{center}
%
   \caption{Unaligned decimal points.}
%
\end{table}

\begin{table}[h]
%
   \begin{center}
%
%     To align decimals, pad each number with ? so that each number 
%     has the same precission. For example, "1.0" and "45.945" are coded
%     as "1.0??" and "45.945".
%
%     Make ? act like a non-printing zero

      \catcode`?=\active
      \def?{\phantom{0}}
%
      \begin{tabular}{|r|r|r|} \hline
         \multicolumn{1}{|c|}{One}
         & \multicolumn{1}{|c|}{Two}
         & \multicolumn{1}{|c|}{Three} \\ \hline
          1.23?? &  3.4?? &   5.678    \\
          9.0123 &  4.567 & 890.1??    \\
         23.45?? & 67.8?? &   9.0??    \\ \hline
      \end{tabular}
%
   \end{center}
%
   \caption{Aligning decimal points.}
%
\end{table}

\end{document}

walden@ready.eng.ready.com (Eugene Walden) (04/24/91)

In article <1991Apr23.200105.14819@midway.uchicago.edu> ppalmer@oskar.uchicago.edu (Patrick Palmer) writes:
>
>I am trying to make footnotes in a table in LaTEX, and having no luck.
>I am using the table environment, and tried to put in footnotes just
>as one would in text.  The numbers denoting footnotes appear in the
>right places, but the footnotes do not appear.  (Since I want the table

 I had a similar problem. Here is what I first tried to do:

   \begin{tabbing}
   xxxx\=xxxx\=\kill
   \>foo \>bar \footnote{blah blah blah} \\
   \>bar \>foo 
   \end{tabbing}

I fixed it by using:

   \begin{tabbing}
   xxxx\=xxxx\=\kill
   \>foo \>bar \footnotemark\ \\
   \>bar \>foo 
   \end{tabbing}

   \footnotetext{blah blah blah}

   - Eugene Walden (walden@gate.ready.com)