Footnote in Longtable

Maybe many of you have such problem. You have a table and want to have a reference inside, but it doesn’t work. Propably you get this or similar error:

name{Hfootnote.7} has been referenced but does not exist, replaced by a fixed one

This happens, because hyperref has problems with its counters, when they are inside of a table environment.

I searched the net for a couple of hours with no real solution. Mostly it says, don’t use footnote in table. But it’s much more nice to have. With some inspiration from some boards I came up with this solution which works fine for me.


% center data in paragraph column

  %start a new counter
  %set value to the actual value of the footnote counter

  %increase counter by one

  \begin{longtable}{c | C}
    my custom & footnote\footnotemark[\value{manualFootnote}]\\
    \hline \stepcounter{manualFootnote}
    another custom & footnote\footnotemark[\value{manualFootnote}]\\
  %decrease counter again to get number for first counter
  %print the text for the reference, \textcite{} is from biblatex and takes a reference from the biliography
  %increase counter for the second footnote
  %print the second footnote text
  %increase the real footnote counter by 2 for the two footnotes in the table

Hyperref will not mark these created footnotes as links, but I think it’s not a big deal.

I’m just a beginner with latex, so if you think you have a better solution leave me a comment.

  • badmash

    I just signed up to your blogs rss feed. Will you post more on this subject?

  • Matthias Tylkowski

    latex in general or which topic?