[Tex/LaTex] Footnote in table appears on wrong page

footnotestables

I have a tabular in a floating table environment and want to place a footnote in that table, whereas the footnotetext should appear at the bottom of the page where the table is on. I tried the following:

  • \footnotemark inside the table and \footnotetext{...} after \end{table}
  • \tablefootnote with the tablefootnote package
  • Surround the table environment by \begin{savenotes} and \begin{savenotes} with the footnote package

All these solutions produced a footnotemark and corresponding text, however, none of the solutions placed the text of the footnote on the appropriate page.

EDIT: For smaller tables (e.g. only the first 4 rows in my MWN), the table appears beneath the footnote which seems even worse…

MWN with \footnotemark and \footnotetext{...}

\documentclass[12pt,a4paper,fleqn]{scrreprt}
\usepackage{booktabs}
\usepackage{amsmath}

\begin{document}

\chapter{A sample chapter}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet,
\begin{table}
\centering
\begin{tabular}{l l} \toprule
column 1    &   column 2 \\ \midrule
main entry 1        & \\
\; sub  &   yes \\
\; sub2 &   yes \\
\; sub3&    (yes)\footnotemark \\
main entry 2        & \\
\; sub  &   yes \\
\; sub2 &   no  \\
\; sub3&    (yes)\\
main entry 3        & \\
\; sub  &   yes \\
\; sub2 &   yes \\
\; sub3&    (yes)\\
\bottomrule
\end{tabular}
\caption{A table with a footnotemark}
\end{table}
\footnotetext{Some footnote}

\end{document}

MWN with \tablefootnote:

\documentclass[12pt,a4paper,fleqn]{scrreprt}
\usepackage{booktabs}
\usepackage{tablefootnote}
\usepackage{amsmath}

\begin{document}

\chapter{A sample chapter}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet,
\begin{table}
\centering
\begin{tabular}{l l} \toprule
column 1    &   column 2 \\ \midrule
main entry 1        & \\
\; sub  &   yes \\
\; sub2 &   yes \\
\; sub3&    (yes)\tablefootnote{Some footnote} \\
main entry 2        & \\
\; sub  &   yes \\
\; sub2 &   no  \\
\; sub3&    (yes)\\
main entry 3        & \\
\; sub  &   yes \\
\; sub2 &   yes \\
\; sub3&    (yes)\\
\bottomrule
\end{tabular}
\caption{A table with a footnotemark}
\end{table}

\end{document}

MWN with \begin{savenotes} and \end{savenotes}:

\documentclass[12pt,a4paper,fleqn]{scrreprt}
\usepackage{booktabs}
\usepackage{footnote}
\usepackage{amsmath}

\begin{document}

\chapter{A sample chapter}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet,
\begin{savenotes}
\begin{table}
\centering
\begin{tabular}{l l} \toprule
column 1    &   column 2 \\ \midrule
main entry 1        & \\
\; sub  &   yes \\
\; sub2 &   yes \\
\; sub3&    (yes)\footnote{Some footnote} \\
main entry 2        & \\
\; sub  &   yes \\
\; sub2 &   no  \\
\; sub3&    (yes)\\
main entry 3        & \\
\; sub  &   yes \\
\; sub2 &   yes \\
\; sub3&    (yes)\\
\bottomrule
\end{tabular}
\caption{A table with a footnotemark}
\end{table}
\end{savenotes}

\end{document}

Best Answer

This problem has no standard solution. Footnotes in floating environments in general belong inside the floating environment. Some ideas how to achieve this are:

  • enclose the inside of the table in minipage:

    \begin{table}
    \begin{minipage}
    \begin{tabular}{ll}\hrule
    A & B \\\hrule
    C\footnotemark & D\\\hrule
    \end{tabular}
    \footnotetext{This is a `C', you see?}
    \end{minipage}
    \caption{This is a table.}
    \end{table}
    
  • not let the table float at all, using \captionof from caption package

  • use threeparttable package