# Table in footnotes

I would like to include tables in footnotes

\footnotetext{SOME TEXT

TABLE

SOME TEXT}


I can use the tabular environment, but the begin{table} with the caption and the label doesn't work.

-
You cannot have floats inside floats. I do not think this is a good idea in any case, will just annoy the reader. You can use the caption package to access a non-floating cation called \captionof – daleif May 14 '14 at 12:41
Welcome to TeX.SX. Often times when LaTeX won't let you do something, there is a good reason for it. This is one of those times. What overall problem are you trying to solve? What idea are you trying to get across to your reader? There must be a better way to go about this. – Sean Allred May 14 '14 at 12:50

This can be achieved by defining a mytable environment, as shown below.

\makeatletter
\newenvironment{mytable}
{\def\@captype{table}}
{}
\makeatother


Updated: New Code to include List of Table and label reference.

\documentclass[12pt]{article}
\usepackage[justification=justified,singlelinecheck=false,justification=justified]{caption}
\usepackage[hang,flushmargin]{footmisc}
\makeatletter
\newenvironment{mytable}
{\def\@captype{table}}
{}
\makeatother
\captionsetup{font=footnotesize} % for proper caption fontsize
\begin{document}
\listoftables

\section{section A}

Creating a footnote with table is easy in Table \ref{tab1} below.\footnote{
\begin{mytable}
\begin{tabular}{|c|c|} \hline
A & B\\ \hline
C & D\\ \hline
\end{tabular}
\caption{caption}\label{tab1}
\end{mytable}
}

\end{document}


Old Code without List of Tables

\documentclass[12pt]{article}

\makeatletter
\newenvironment{mytable}
{\def\@captype{table}}
{}
\makeatother

\begin{document}
Creating a footnote with table is east.\footnote{
\begin{mytable}
\begin{tabular}{|c|c|} \hline
A & B\\ \hline
C & D\\ \hline
\end{tabular}
%\caption{caption}
\end{mytable}
}

\end{document}

-
Do you need to wrap the tabular environment in a custom environment in order to typeset it in a footnote? – Mico May 14 '14 at 14:21
Oh, if caption is desired and shows up in LOT then the new environment is required. So if NO caption, then tabular is sufficient. – Jesse May 14 '14 at 15:36
I had posted the comment because your MWE doesn't actually feature a caption to go with the tabular material. – Mico May 14 '14 at 16:26
On your remark, I added the caption and label to show it will work, answering OP's concerns. Thanks. – Jesse May 14 '14 at 16:52

You may achieve your objective by loading the caption package and using its \captionof macro to create a non-floating table-like environment in a footnote. Since the font size in footnotes is, well, given by \footnotesize, it's necessary to issue the command \captionsetup{font=footnotesize} to assure that the font size in use in the caption matches that of the footnote material.

The captions generated by \captionof{table}{...} can be assigned \labels, which can be cross-referenced anywhere in the body of the document. The footnote that contains a table can, of course, also be cross-referenced directly.

\documentclass{article}
\usepackage{caption,lipsum} % lipsum for filler text
\setlength\textheight{7cm} % just for this example
\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum
gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate
a, magna. Donec vehicula augue eu neque.\footnote{%
\label{fn:first}
\lipsum[2]
\medskip
\centering
\begin{tabular}{|c|c|}
\hline
a & b \\
\hline
c & d \\
\hline
\end{tabular}
\captionsetup{font=footnotesize} % use \footnotesize for caption
\captionof{table}{A table in a footnote}\label{tab:fn}
}

Here's a cross-reference to \autoref{tab:fn}, and here's a cross-reference to \autoref{fn:first}.
\end{document}

-