# Footnotes in subtables

I am having two tables, that I would like to have as subtables, in which part of the data have footnotes. The code that I found to have properly the captions of the subtables and the global caption is like this:

\begin{table*}[h]
\subfloat[Caption1.\label{tab:subtable1}]{
\centering
\begin{tabular}{|c|c|c|}
\hline
A1 & B1 & C1 \\
\hline
a11\footnote{\label{fn1}Footnote1} & b11\textsuperscript{\ref{fn1}} & c11 \\
\hline
a12 & b12 & c12 \\
\hline
\end{tabular}
}
\subfloat[Caption2.\label{tab:subtable2}]{
\centering
\begin{tabular}{|c|c|c|}
\hline
A2 & B2 & C2 \\
\hline
a21\footnote{\label{fn2}Footnote2} & b21\textsuperscript{\ref{fn2}} & c21 \\
\hline
a22 & b22 & c22 \\
\hline
\end{tabular}
}

\caption{Global caption.}
\end{table*}


This code works well for the captions (the captions of the subtables start with "(a)" and "(b)", and the global caption starts with "Table 5.1"), but the footnotes (e.g. "Footnote1" and "Footnote2" above) do not appear anywhere.

For the footnotes, I saw the option of using "minipage", but it has to be used instead of the "subfloat" thing above. In this case, the list of footnotes appear properly below the two tables, but the captions are not as expected: the captions of the subtables start with "Table 5.1" and "Table 5.2", the footnotes appear below this second caption, and below the footnotes, there is the global caption that starts with "Table 5.3".

If someone knows how to have properly have both the proper captions and the list of footnotes at the same one, I really thank you for it. Also, is there a way to display the footnotes on two (or more) colums, instead of a single column (as "minipage" display them)? Thank you in advance for your help.

• Welcome to Tex.sx! Please provide a MWE that is complete. So in this case a MWE that includes the subfig and tabularx package. Regarding your question, I think this can only be done by using \footnotemark[] and \footnotetext. However, you do have to add the numbers by hand and change these on the go. Unfortunately sepfootnotes package doesn't work in this environment, I am not aware of any other workaround. You might want to consider the subcaption package over which is much more recent. However the same problem arises. – JohanFit Oct 16 '18 at 16:48

You can't create a footnote inside a float. You could move the \footnotetext outside the float, but the float may be moved to another page. You can however put footnotes in a minipage.

It should be noted that \footnotemark uses \stepcounter instead of \refstepcounter, so \ref{fn1} will actually grab \thesubfigure. Also, minipage changes the definition of \thefootnote to use \alph instead of \arabic, while tabular apparently changes it back again.

\documentclass[twocolumn]{article}
\usepackage{subfig}
%\usepackage{tablefootnote}

\newcommand{\footnotelabel}[1]% #1 = label
{\refstepcounter{footnote}%
\label{#1}%
\footnotemark[\value{footnote}]}

\begin{document}
\begin{table*}[h]
\begin{minipage}{\linewidth}
\def\thempfn{\arabic{footnote}}% normal
\centering
\subfloat[Caption1.\label{tab:subtable1}]{

\begin{tabular}{|c|c|c|}
\hline
A1 & B1 & C1 \\
\hline
a11\footnotelabel{fn1} & b11\textsuperscript{\ref{fn1}} & c11 \\
\hline
a12 & b12 & c12 \\
\hline
\end{tabular}
}\footnotetext[\ref{fn1}]{Footnote1}
\subfloat[Caption2.\label{tab:subtable2}]{
\centering
\begin{tabular}{|c|c|c|}
\hline
A2 & B2 & C2 \\
\hline
a21\footnotelabel{fn2} & b21\textsuperscript{\ref{fn2}} & c21 \\
\hline
a22 & b22 & c22 \\
\hline
\end{tabular}
}\footnotetext[\ref{fn2}]{Footnote2}

\caption{Global caption.}
\end{minipage}
\end{table*}
\end{document}


A workaround is putting the tabulars nested in another tabular in a table float and use the tablefootnote package.

Footnotes will work then.

Then add the captions under the tables in parboxes. The captions will be a bit lower positioned then usual, you might be able to optimize this code.

Output

MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{subcaption}
\usepackage{tablefootnote}

\begin{document}

\begin{table}[h!]
\begin{tabular}{p{0.5\columnwidth}  p{0.5\columnwidth} }
\centering
\begin{tabular}{|c|c|c|}
\hline
A1 & B1 & C1 \\
\hline
a11\tablefootnote{\label{fn1}Footnote1} & b11 & c11 \\
\hline
a12 & b12 & c12 \\
\hline
\end{tabular}\par
&
\centering
\begin{tabular}{|c|c|c|}
\hline
A2 & B2 & C2 \\
\hline
a21\tablefootnote{\label{fn1}Footnote1} & b21 & c21 \\
\hline
a22 & b22 & c22 \\
\hline
\end{tabular}\\
\end{tabular}
\end{table}
\parbox[b]{0.5\columnwidth}{
\centering
\captionsetup[subtable]{labelformat=parens}
\captionsetup{type=subtable}
\caption{Caption1.\label{tab:subtable1}}
}
\parbox[b]{0.5\columnwidth}{
\centering
\captionsetup[subtable]{labelformat=parens}
\captionsetup{type=subtable}
\caption{Caption2.\label{tab:subtable2}}
}

\captionof{table}{Global caption.}

\end{document}