Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}{l r r r l}
\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

share|improve this question
    
In short: Take a look on the package savefnmark, alas in MiKTeX without documentation, see mirror.ctan.org/macros/latex/contrib/savefnmark I don’t know, whether it works with cleveref. And defining 5 columns, but using only 3 is odd. See enhanced packages like array. –  Speravir Jan 29 '13 at 21:21
    
thanks for your comments, about the 5 columns, that come up wrong because of fast creating the example. –  karamaz0v Jan 29 '13 at 22:15

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
thanks! this solution is working great, i missed this one in the other question. I don't mind about the linking to the caption, since the table and its foots are always on the same page in my case, there is no problem at all. –  karamaz0v Jan 29 '13 at 22:08
    
I am currently trying to deploy this nice solution to my document ([journal]{IEEEtran}), however, the latex compiler tells me that the reference "1sttablefoot" is undefined. Any ideas what could have gone wrong? –  Emiswelt Dec 11 '13 at 14:07
    
@Emiswelt That means you haven't placed \label{1sttablefoot} anywhere –  cgnieder Dec 11 '13 at 14:27
    
Thank you for your reply. In fact, I have placed the label. The workaround for me, however, was to use \footnotetext[1]{\label{1sttablefoot}...} before the table and \footnotemark[\ref{1sttablefoot}] inside the table. –  Emiswelt Dec 12 '13 at 12:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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