[Tex/LaTex] Multiple references to the same footnote inside a table environment

footnotestables

I followed the steps in this answer to get multiple references to the same footnotes working. As shown in this minimal example, the solution is working great for footnotes in the text, also getting the correct hyper references in the compiled pdf.

But when using multiple footnotes in a table environment the solution doesn't work, for the second reference in the table environment I get "a^0" instead of another "^a". I guess the problem is that numbering consist of (a,b,…) instead of numbers but I'd like to keep that behavior.

How should I adapt the solution to work inside the table environment ??

\documentclass{article}
\usepackage{hyperref}
\usepackage{cleveref}
\crefformat{footnote}{#2\footnotemark[#1]#3}

\begin{document}

This is a paragraph\footnote{\label{first}some footnote}.

This is another paragraph\footnote{\label{second}another footnote}.

This is another paragraph using the first footnote\cref{first}.


\begin{table}
\caption{A table}
\begin{minipage}{\textwidth}
\begin{tabular}{r r r}
\hline
  E\footnote{\label{1sttablefoot}Some table footnote} & F\cref{1sttablefoot} & G \footnote{Another table footnote}  \\  \hline 

  1 & 2 & 3  \\ \hline

\end{tabular}
\end{minipage}
\end{table}

\end{document}

Can't attach the image result because of being new user :S

Best Answer

You could use my answer to the same question and use \footref provided by scrextend (part of the KOMA-Script bundle). This is at least working partially. For reasons I haven't figured out yet the hyperlink from \footref inside the table links to the table caption, though, instead of the footnote. I don't know if that is a failure of scrextend or hyperref

\documentclass{article}
% call `scrextend' before `hyperref'!
\usepackage{scrextend}
\usepackage{hyperref}

\begin{document}

This is a paragraph\footnote{\label{first}some footnote}.

This is another paragraph\footnote{\label{second}another footnote}.

This is another paragraph using the first footnote\footref{first}.


\begin{table}
\caption{A table}
\begin{minipage}{\textwidth}
\begin{tabular}{rrr}
 \hline
  E\footnote{\label{1sttablefoot}Some table footnote} &
  F\footref{1sttablefoot} &
  G \footnote{Another table footnote} \\
 \hline 
  1 & 2 & 3 \\
 \hline
\end{tabular}
\end{minipage}
\end{table}

\end{document}

enter image description here

Related Question