# Footnotes or sidenotes in tables with tufte-latex?

It might be extremely simple to solve my problem, but I can't figure it out... I use the tufte-book class and I have a table inside it. In the documentation of the tufte-book class it is written that:

Any \footnotes will automatically be converted to sidenotes.

So, I tied to attach a footnote (NOT a tablenote!), which would amount to a sidenote, to one entry, but the tablefootnote package is no use, I get the error:

No counter 'Hfootnote' defined. \end{table}


This suggests that the hack with \footnotemark and manually setting the counter would not work either. Needless to say that the \sidenote command does not work either. Neither does tabularx.

My code with \sidenote does not compile at all (Minimal Non-Working Example that is...):

\documentclass{tufte-book}%

\usepackage{amsmath}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\usepackage{graphicx}%

\begin{document}

\begin{table}[htb]
\centering
\caption{Principal elementary particles}
\begin{tabular}{c||c|c|c|c} \hline
& electron & proton & neutron & photon \\ \hline \hline
symbol & e$^-$ ($\beta^-$) & p$^+$ (H$^+$) & n$^0$ & $\gamma$ \\ \hline
el. charge [C] & $-1.602176487 \times 10^{-19}$ & $1.602176487 \times 10^{-19}$ & $0$ & $0$ \\ \hline
mass\sidenote{at stand-sill} [kg] & $9.10938215 \times 10^{-31}$ & $1.672621637 \times 10^{-27}$ & $1.67492729 \times 10^{-27}$ & $0$ \\ \hline
\end{tabular}
\label{tab:PrincipalElementaryParticles}
\end{table}

\end{document}

-
The standard advice on footnotes in tables is that they should be part of the table, and not part of the regular footnote apparatus. Given this advice, it would be better to use the threeparttable package. And since you're using tufte you should really also read the booktabs docs on table design. :-). Here's a nice example of how to use both: Add notes under the table. – Alan Munn Nov 27 '11 at 23:06

The expected behavior can be achieved with using \footnotemark and footnotetext similar to other classes.

MWE:

\documentclass{tufte-book}

\usepackage{amsmath}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\usepackage{graphicx}%

\begin{document}
First sidenote.\sidenote{a}

\begin{table}[htb]
\centering
\caption{Principal elementary particles}
\begin{tabular}{c||c|c|c|c} \hline
& electron & proton & neutron & photon \\ \hline \hline
symbol & e$^-$ ($\beta^-$) & p$^+$ (H$^+$) & n$^0$ & $\gamma$ \\ \hline
el. charge [C] & $-1.60 \times 10^{-19}$ & $1.60 \times 10^{-19}$ & $0$ & $0$ \\ \hline
mass\footnotemark{} [kg] & $9.1 \times 10^{-31}$ & $1.67 \times 10^{-27}$ & $1.6 \times 10^{-27}$ & $0$ \\ \hline
\end{tabular}
\label{tab:PrincipalElementaryParticles}
\end{table}
\footnotetext{b}
Third sidenote.\sidenote{c}

\end{document}


Please note that \footnotemark [kg] leads to an error, because [kg] is taken as the optional argument to \footnotemark. I made the table a little smaller to avoid an overfull hbox.

The output is

To preserve the possibility of adding vertical offset (as with \sidenote), a workaround is to replace \footnotetext{b} with \makeatletter \@footnotetext[-15pt]{b} \makeatother.

-
Thanks! Unfortunately this prevents me from adding any vertical offset (optional argument for \sidenote). Do you know a workaround? – Count Zero Nov 28 '11 at 12:37
Off hand, I only know a hack: Replace \footnotetext{}b with \makeatletter \@footnotetext[-15pt]{b} \makeatother  – Andy Nov 28 '11 at 13:20
That produces the desired effect, thanks! I added it to your answer, hope that's ok. :) – Count Zero Nov 28 '11 at 13:54
I've found this works with a maximum of one footnote per table, else all the footnotes created with \footnotetext{text here} take the same footnotemark – mac Dec 3 '12 at 21:57