GeneralAnnotate Table, inserting footnotes to Tables

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
BMAcox
Posts: 40
Joined: Sun Dec 23, 2007 12:07 am

Annotate Table, inserting footnotes to Tables

Post by BMAcox »

Hello:

I went thru the help files looking for typeset to add footnotes to particular entries in my table:
\begin{table}
\centering
\caption{My caption}
\small\addtolength{\tabcolsep}{-5pt}
\begin{tabular}{c||c|c|c||c|c||c}
X& x1 & $x2$ & x3 & x4 & x5&x6\\\hline
I & 1& 2& 3 & 4 & 5& 6\\
& (.46) & & & (.16)&&\\
II&1&2&3 & 4&5&6\\
& (.82) & & & (.28)&&\\
III &1&2 &3& 4&5&6\\
& (.63) & & & (.24)&&\\
IV & 1& 2& 3& 4&5& 6\\
& (.39) & & & (.14)&&\\
V & 1& 2& 3& 4&5& 6\\
& (.82) & & & (.39)&&\\
VI & 1& 2& 3& 4&5& 6\\
& (1.15) & & & (2.65)&&\\
\end{tabular}
\label{tab:mytab}
\end{table}

Inserting \footnote{} next to the values did not show the footnote at the end of the table.

Thank you!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Annotate Table, inserting footnotes to Tables

Post by balf »

Use the threeparttable or the ctable package.

B.A.
BMAcox
Posts: 40
Joined: Sun Dec 23, 2007 12:07 am

Re: Annotate Table, inserting footnotes to Tables

Post by BMAcox »

Are \threeparttable and \ctable packages in the base installation of MikTex? How do we check? Does anyone have sample code on how to use these packages to insert footnotes in the table at the bottom of the table? Thank you!
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Annotate Table, inserting footnotes to Tables

Post by balf »

Threeparttable is part of the basic distribution: it's a small package included in ltxmisc. The doc consists of (commented) plain text at the beginning of threeparttable.sty. As for ctable, I don't know if it's in the base distribution, but you can check that point using MiKTeX package manager. It includes a doc with examples in pdf format.

Regards,
B.A.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Annotate Table, inserting footnotes to Tables

Post by Juanjo »

At least the ctable package seems well documented. See its manual.

A direct approach to get footnotes in tables is to include them in a minipage. Try this:

Code: Select all

\documentclass{article}
\begin{document}

\begin{table}
  \centering 
  \fbox{% Remove this line to delete the frame
  \begin{minipage}{4.1cm}
    \caption{My caption} \label{tab:mytab}\smallskip
    \small\addtolength{\tabcolsep}{-5pt}
    \begin{tabular}{c||c|c|c||c|c||c}
      X\footnote{A footnote}& x1 & $x2$ & x3 & x4 & x5&x6\\ \hline
      I & 1& 2& 3 & 4 & 5& 6\\
      & (.46) & & & (.16)&&\\
      II&1&2&3 & 4&5&6\\
      & (.82) & & & (.28)&&\\
      III &1&2 &3& 4&5&6\\
      & (.63) & & & (.24)\footnote{Other footnote}&&\\
      IV & 1& 2& 3& 4&5& 6\\
      & (.39) & & & (.14)&&\\
      V & 1& 2& 3& 4&5& 6\\
      & (.82) & & & (.39)&&\\
      VI & 1& 2\footnote{The third one}& 3& 4&5& 6\\
      & (1.15) & & & (2.65)&&\\ \hline
    \end{tabular} 
  \end{minipage}%
  } % Remove this line to delete the frame
\end{table}
\end{document}


This looks better:

Code: Select all

\documentclass{article}
\begin{document}

\begin{table}
  \centering 
  \fbox{% Remove this line to delete the frame
  \begin{minipage}{4.9cm}
    \centering
    \caption{My caption} \label{tab:mytab}\smallskip
    \small\addtolength{\tabcolsep}{-5pt}
    \begin{tabular}{c||c|c|c||c|c||c}
      X\footnote{A footnote}& x1 & $x2$ & x3 & x4 & x5&x6\\ \hline
      I & 1& 2& 3 & 4 & 5& 6\\
      & (.46) & & & (.16)&&\\
      II&1&2&3 & 4&5&6\\
      & (.82) & & & (.28)&&\\
      III &1&2 &3& 4&5&6\\
      & (.63) & & & (.24)\footnote{Other footnote}&&\\
      IV & 1& 2& 3& 4&5& 6\\
      & (.39) & & & (.14)&&\\
      V & 1& 2& 3& 4&5& 6\\
      & (.82) & & & (.39)&&\\
      VI & 1& 2\footnote{The third one}& 3& 4&5& 6\\
      & (1.15) & & & (2.65)&&\\ \hline
    \end{tabular}%
    \vspace{-7pt}\renewcommand{\footnoterule}{}
  \end{minipage}%
  } % Remove this line to delete the frame
\end{table}
\end{document}
ijc
Posts: 25
Joined: Mon Feb 04, 2008 4:26 pm

Annotate Table, inserting footnotes to Tables

Post by ijc »

I've been trying to sort out the same problem...

I worked out a dirty fix without using minipages.

Code: Select all

\begin{table}
\begin{center}
\begin{tabular}{|r|r|}
\hline
x & x \\
\hline
x & x \\
x & x \\
\hline
\end{tabular}
\label{tbl:runtime}
\caption{blah $^1$.}
\end{center}
\end{table}

\footnotetext[1]{foot note blah.}
Obviously you need to have a good idea where your table is going to be...
darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

Re: Annotate Table, inserting footnotes to Tables

Post by darckhart »

I've been using the ctable package and it seems to be working very well so far. My only complaint is that its linespacing is wider and the gap between the bottom of the table and the page text is also wider than for tables you've created the regular way. I haven't figured out which vars to tweak yet, but it's a relatively minor setback for such a handy feature.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Annotate Table, inserting footnotes to Tables

Post by Juanjo »

You may find useful this thread about the same subject.
Post Reply