# Footnotes not appearing in makecell used in longtable [duplicate]

I am using a footnote inside makecell inside a longtable and while the footnote's counter is displayed, the text does not appear at the end of the page. Here's a MWE

\documentclass{article}

\usepackage{longtable}
\usepackage{makecell}

\title{A longtable example}

\begin{document}

\begin{center}
\begin{longtable}{|l|l|l|}
\caption{A sample long table.} \label{tab:long} \\

\hline \multicolumn{1}{|c|}{\textbf{First column}} & \multicolumn{1}{c|}{\textbf{Second column}} & \multicolumn{1}{c|}{\textbf{Third column}} \\ \hline

One & \makecell{abcdef\footnote{Test2} \\ ghjijklmn} & 123.456778 \\

\end{longtable}
\end{center}

\end{document}


## marked as duplicate by TeXnician, Stefan Pinnow, Zarko, Henri Menke, Mike RenfroJun 28 '17 at 23:21

• I can verify the problem. – Dr. Manuel Kuehner Jun 28 '17 at 18:59
• Replace \footnote{Test} with \footnotemark and write outside the longtable (after \end{longtable}) \footnotetext{Test}. – Bobyandbob Jun 28 '17 at 19:20
• @Bobyandbob I considered that but the issue is I need multiple footnotes in the makecell. Multiple footnotemarks/footnotetext does not yield correct numbering for the footnotes. – Pdksock Jun 28 '17 at 19:30
• The makecell package documentation states that I can use \footnote inside \makecell so there must be something else that is wrong. Also doing it in the way suggested in your comment does not preserve hyperlinks in pdftex. – Pdksock Jun 28 '17 at 19:51
• @Samidh T: Yes, but maybe not in a longtable, which has its own management of footnotes. I guess the problem comes from this. Please see my workaround. – Bernard Jun 28 '17 at 20:36

The problem comes from \makecell: it seems that, for some reason, it behaves like the cells before \endhead or \endfoot in long table. The workaround consists, as explained in the longtable documentation, in using \footnotemark, and \footnotetext in any other ‘normal’ cell that will fall in the same page.

Since you load makecell,I took the opportunity to simplify the code for your column heads, using the \thead command. I also added some padding for the footnote with the \gape command. \documentclass{article}

\usepackage{longtable}
\usepackage{makecell}
\title{A longtable example}

\begin{document}
\vspace*{12cm}

\setlength\extrarowheight{3pt}
\begin{longtable}{|l|l|l|}
\caption{A sample long table.} \label{tab:long} \\


• If it's a long tabularx, you can try the ltablex package. – Bernard Jun 28 '17 at 21:22