9

Is there a way to put a footnote in longtable caption?

\documentclass{book}
\usepackage{longtable}

\begin{document}

  \begin{longtable}{|c|}
    \caption{Table 
    %    \footnote{Footnote}    % Uncommenting results in error.
    } \\   
    \hline      
    Something \\
    \hline      
  \end{longtable}

\end{document}
10

From longtable documentation:

Note however that \footnote will not work in the ‘head’ or ‘foot’ sections of the table. In order to put a footnote in those sections (e.g., inside a caption), use \footnotemark at that point, and \footnotetext anywhere in the table body that will fall on the same page.

Hence the MWE will be

\documentclass{article}
\usepackage{longtable}
\begin{document}
\begin{longtable}{|c|}
    \caption[Table is very long]{Table is very long\protect\footnotemark}\\ %<------footnote mark here
    \hline
    Something \footnotetext{This is a caption} \\ %<------footnote text here
    \hline
\end{longtable}
\end{document}

Edit: Added short caption as per Gonzalo's suggestion. With short caption added, \protect won't be necessary.

enter image description here

  • 4
    It could be sensible to use the optional argument of \caption, as in \caption[Table is very long]{Table is very long\protect\footnotemark} to prevent the mark from having a wrong numbering in the text and from appearing also in a possible list of figures – Gonzalo Medina Mar 30 '12 at 23:52
  • @GonzaloMedina, Thanks, I have made the changes. – user11232 Mar 30 '12 at 23:57
  • With the changes made, \protect is unnecessary. – Ivan Bychkov Apr 1 '12 at 21:50
  • I am trying this as well. My documentclass is report. It returns errors if I don't use \protect. It does not produce any notes either with \protect\footnotetext or with \protect\footnotemark. – Cost Aug 24 '12 at 8:49
  • 1
    @Costi: Refer How do I update my TeX distribution? – user11232 Aug 24 '12 at 14:09
0

You can keep the normal \footnote command by using the footnotehyper package:

\documentclass{book}
\usepackage{longtable}
\usepackage{footnotehyper}
\makesavenoteenv{longtable}

\begin{document}

\begin{longtable}{|c|}
  \caption[tab]{Table\footnote{Footnote}} \\   
  \hline
  Something \\
  \hline
\end{longtable}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.