17

I wanted to make a footnote in a table. So I used tablefootnote http://www.ctan.org/tex-archive/macros/latex/contrib/tablefootnote to do that as was suggested by google search since normal \footnote do not work inside tables.

However, it seems the actual footnote sometimes shows up at the bottom of the previous page, and sometimes it shows up at the bottom of the next page.

I'd like the footnote to show on the same page.

Example 1, footnote shows up at bottom of previous page

\documentclass[12pt,notitlepage]{article}%
\usepackage{float}%
\usepackage{lipsum}
\usepackage{tablefootnote}

\begin{document}
\section{A}
\lipsum[4-10]
\section{B}
\begin{table}[htp]
\begin{center}
\begin{tabular}{|l|l|l|}\hline
$e$                      & 0.97774    & 0.9935      \\ \hline
semimajor axis $a$       & 300000     & 262413      \\ \hline
true anamoly $f$         & 163.76     & 176.08       \\\hline
semimajor axis $a$       & 300000     & 262413  \\ \hline
true anamoly $f$         & 163.76     & 176.08     \\\hline
$r_p$                    & 6678       & 1689
  \tablefootnote{spacecraft will hit earth on way back since $r_p<r_{earth}$} \\\hline
\end{tabular}
\caption{Summary table for non-tangential per and post flyby the moon}
\label{tab:part_3_1_summary}
\end{center}
\end{table}
\end{document}

Mathematica graphics

Example 2, footnote shows up on next page

\documentclass[12pt,notitlepage]{article}%
\usepackage{float}%
\usepackage{lipsum}
\usepackage{tablefootnote}

\begin{document}
\section{A}
\lipsum[4-6]
\section{B}
\begin{table}[htp]
\begin{center}
\begin{tabular}{|l|l|l|}\hline
semimajor axis $a$       & 300000  & 262413    \\ \hline
true anamoly $f$         & 163.76   & 176.08   \\\hline
$r_p$                    & 6678 & 1689
 \tablefootnote{spacecraft will hit earth on way back since $r_p<r_{earth}$} \\\hline
\end{tabular}
\caption{Summary table for non-tangential per and post flyby the moon}
\label{tab:part_3_1_summary}
\end{center}
\end{table}
\section{C}
\lipsum[4-10]

\end{document}

Mathematica graphics

Miktex 2.9, latest.

Nasser
  • 20,220

2 Answers2

17

Footnotes at the bottom of the page to a float will produce this undesired effect since the float might float away to another page. In case footnotes to tables (or floats, in general) are really required, it's better to use footnotes immediately after the float which can be obtained using, for example the threeparttable or ctable packages.

An exampe using threeparttable:

\documentclass[12pt,notitlepage]{article}%
\usepackage{lipsum}
\usepackage{threeparttable}

\begin{document}

\section{A}
\lipsum[4-6]
\section{B}
\begin{table}
\centering
\begin{threeparttable}
\caption{Summary table for non-tangential per and post flyby the moon}
\label{tab:part_3_1_summary}
\begin{tabular}{|l|l|l|}\hline
semimajor axis $a$       & 300000  & 262413    \\ \hline
true anamoly $f$         & 163.76   & 176.08   \\\hline
$r_p$                    & 6678 & 1689\tnote{1} \\ \hline
\end{tabular}
\begin{tablenotes}
\item[1] spacecraft will hit earth on way back since $r_p<r_{earth}$
\end{tablenotes}
\end{threeparttable}
\end{table}
\section{C}
\lipsum[4-10]

\end{document}

enter image description here

And the same table using ctable:

\documentclass[12pt,notitlepage]{article}%
\usepackage{lipsum}
\usepackage{ctable}

\begin{document}

\section{A}
\lipsum[4-6]
\section{B}
\ctable[
caption = Summary table for non-tangential per and post flyby the moon.
label={tab:part_3_1_summary}
]{|l|l|l|}
{\tnote[1]{spacecraft will hit earth on way back since $r_p<r_{earth}$}}
{
\hline
semimajor axis $a$       & 300000  & 262413  \\ \hline
true anamoly $f$         & 163.76   & 176.08   \\ \hline
$r_p$ & 6678 & 1689 \\ 
\hline
}
\section{C}
\lipsum[4-10]

\end{document}

enter image description here

Both packages offer some customization possibilities for the note formatting; please refer to the documentation of the packages

Gonzalo Medina
  • 505,128
  • silly niggle (having nothing to do with the technique recommended): "per flyby" means "every flyby". you really want "pre". also, table captions generally look better ragged right, to avoid over-stretched spacing. – barbara beeton Mar 19 '14 at 12:44
5

I followed the advice in Gonzalo Medina's answer using threeparttable, but I had some trouble centering the caption above my table correctly. It was anchored to the left edge of the table, but because the caption was quite long, it extended beyond the left edge of the table.

My solution was to move \begin{threeparttable} below the caption, before the tabular environment. This way, the caption is centered within the float and uses its full width (which may or may not be what you want). The footnote is beneath the table and extends only the full width of the table, as expected.

\documentclass[12pt,notitlepage]{article}%
\usepackage{threeparttable}

\begin{document}

\begin{table}
\centering
\caption{Here's my long caption text that I want centered on the page.
\label{tab:simulation_parameters}}
\begin{threeparttable}
\begin{tabular}{lp{1.7in}}
\hline
Material & Index of refraction\\ 
\hline
silicon & 3.47772\\
silicon dioxide & 1.54\\
silicon nitride & 2.217\\
HSQ\tnote{a} & 1.39\\ \hline
\end{tabular}
\begin{tablenotes}
\item[a] Here's my footnote.
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}

enter image description here

  • Wrapping threeparttable with a table ensures other formats such as row heights remain unchanged. – Yvon Apr 04 '18 at 21:04