[Tex/LaTex] Footnotes in tables

best practicesfootnotestables

I would like to have footnotes in tables, but the \footnote command does not work inside a table environment. Googling one finds that this is a frequently asked question, at least in the UK. That link contains a list of solutions to the problem, but since the author of the FAQ does not believe that this is good style, no comparison is made between the different methods.

I am sure that there are good typographical reasons why in most situations it is undesirable to have footnotes in tables (although I have never come across them), however I have recently felt the need to do just this in a paper I am currently writing.

Therefore I'd like to ask two questions:

  1. What are the arguments against footnotes in tables?

  2. If one really must go against the advice in 1., which method (whether considered in the FAQ above or not) would you recommend?

Thanks in advance.

Added

In response to ShreevatsaR's comment: I do not much care for where the text of the footnote appears. I do however insist on the footnote marks being attached to the relevant entries in the table, so that I can avoid having to reference "the second entry in the eighth line of the table", etc…

Best Answer

I had this kind of problem about 10 years ago, and no package provided any trick at this time. My solution was the following. I managed \footnotemarks and \footnotetexts separately. Semantically it is not really satisfactory, but it works quite well. The only problem may be that the table could be placed in another page than the \footnotetext :-(

footnotes in hostile environments: compilation result

\section{Footnotes in hostile environments}



\begin{table}[h] 
\begin{center}
\begin{tabular}{c|c|c}
O & X\protect\footnotemark & O \\
\hline
X & O\protect\footnotemark & X \\
\hline
X & O & O
\end{tabular}
\end{center}
\caption{Victory for Gilles\protect\footnotemark}
\end{table}
\addtocounter{footnote}{-2}
\footnotetext{X}
\addtocounter{footnote}{1}
\footnotetext{O}
\addtocounter{footnote}{1}
\footnotetext{happy birthday Gilles ;-)}

bla\raisebox{0.8ex}{\addtocounter{footnote}{1}\scriptsize\thefootnote}\footnotetext{forced test}blabla\footnote{footnote test}

and now, more difficult: two footnotes in a \fbox{hostile\footnotemark environment\footnotemark}~... 
\addtocounter{footnote}{-1}
\footnotetext{or very hostile}
\addtocounter{footnote}{1}
\footnotetext{area}