3

I'm figuring out how to include a table in a footnote. My search results only come up with the solution for the other way around, i.e., "how to include footnotes in a table environment".

I've tried the following:

\documentclass[12pt]{article}
\begin{document}

\section{Introduction}
This is time for all good men to come to the aid of their party!\footnote{This is a footnote.

And it includes a table:

\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabular}{cc}
    Column 1 & Column 2 \\
    Blah  & More blah \\
    \bottomrule
    \end{tabular}%
\end{table}%

}
\end{document}

The error message is

! LaTeX Error: Not in outer par mode.

Any help is much appreciated.

2
  • 1
    It's impossible to have a table inside a \footnote, because it's an \insert inside another \insert. You can have a tabular inside a \footnote (likely to be very ugly unless it's smaaaall—i.e., probably not a table in the common sense), but a tabular is what it is: a box. It won't float.
    – frougon
    Jul 29, 2019 at 7:38
  • @frougon: Thanks for the nice suggestion. Inserting a tabular environment addresses some of my issue!
    – Long Vo
    Jul 29, 2019 at 7:51

2 Answers 2

6

You can't have a floating environment, such as figure and table, in a footnote.

Solution: Don't use a table environment. Instead, load the caption package and use its \captionof macro to create the equivalent of a table caption.

Do ask yourself, though, if the tabular material in the footnote really requires a numbered caption.

enter image description here

\documentclass[12pt]{article}
\usepackage{caption} % for \captionsetup and \captionof macros
\captionsetup{skip=0.333\baselineskip}

\usepackage{booktabs}
\begin{document}

\section{Introduction}
This is time for all good men to come to the aid of their party!\footnote{This 
is a footnote which includes a table with a caption:
\begin{center}
  \captionsetup{font=footnotesize}
  \captionof{table}{Add caption}
    \begin{tabular}{@{}cc@{}}
    \toprule
    Column 1 & Column 2 \\
    Blah  & More blah \\
    \bottomrule
    \end{tabular}
\end{center}%
} % end of footnote
And here is some more text.
\end{document}
1
  • Thank you for your answer. I think this is what I need.
    – Long Vo
    Jul 29, 2019 at 7:49
4

Although Mico already showed how it can be done (+1), and well pointed about the sense of have a numbered caption here, it hasn't been said yet whether if you should do it or not. Ask yourself what the purpose of a footnote is, and if a note with tables serves that purpose. IMHO, accessory texts are not enough important to have detailed data in tables. If some data are enough important, then it should be referenced in the main text as a normal table. (In fact, some people even doubt of the usefulness of footnotes themselves, following a similar reasoning, but that is another history ...)

BTW, even in case that doing that could have some sense, please note that a bottom float is placed by default below the footers, so if there is only one note, putting the table inside the footnote and use caption package could be not necessary. It is enough with change the float options to [b]. Even if there are more footnotes in the same page, as the table appear after the last footnote, that could be acceptable (?) since you can use cross-references in foot notes without problems:

mwe

\documentclass[12pt]{article}
\usepackage{booktabs}
\begin{document}
\section{Introduction}
This is time for all good men to come to the aid of their 
party!\footnote{This is a footnote. And it includes the table
\ref{foottable}:}
\begin{table}[b]
\centering
% \footnotesize % if match footnote font is needed
  \caption{
% \footnotesize % if match footnote font is needed
Add caption\label{foottable}}
    \begin{tabular}{cc}\toprule
    Column 1 & Column 2 \\\midrule
    Blah  & More blah \\\bottomrule
    \end{tabular}%
\end{table}%
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .