0

MWE

\documentclass[a4paper,11pt]{book}
\usepackage{tabularx}
\usepackage[svgnames]{xcolor}
\usepackage{footnote}
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
\makesavenoteenv{tabular}
\makesavenoteenv{table}

\begin{document}
FIRST PAGE
\newpage

\begin{tabular}{|l|c|c|l|c|c|}
    \hline
    A & 1 & 2\footnote{Go to 1. page}& 1 & 2\footnote{Go to 1. page} \\ \hline
    B & 2 & 1 & 1 & 2\footnote{Go to 1. page} \\ \hline
    C & 3 & 3 & 1 & 2\footnote{Go to 2. page}\\ \hline
\end{tabular}

\begin{tabular}{|l|c|c|}
    \hline
    A & 1 & 2\footnote{Go to 2. Page} \\ \hline
    B & 2 & 1 \\ \hline
    C & 3 & 3 \\ \hline
\end{tabular}

\begin{tabular}{|l|c|c|}
    \hline
    A & 1 & 2\footnote{Go to 1. Page} \\ \hline
    B & 2\footnote{Go to 2. Page} & 1 \\ \hline
    C & 3 & 3 \\ \hline
\end{tabular}

\begin{tabular}{|l|c|c|}
    \hline
    A & 1 & 2\footnote{Go to 1. Page} \\ \hline
    B & 2\footnote{Go to 1. Page} & 1 \\ \hline
    C\footnote{Go to 2. Page} & 3 & 3 \\ \hline
\end{tabular}
\end{document}

And output

compilation result

As a matter of fact, whole footnotes are written Go to 2. page in mouse message. How will I correct my MWE? Maybe threeparttable?

Related: Footnote in table appears on wrong page

[ EDITED ] for @JohnKormylo's answer

\documentclass[a4paper,11pt]{book}
\usepackage{tabularx}
\usepackage[svgnames]{xcolor}
\usepackage{footnote}
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
\makesavenoteenv{tabular}
\makesavenoteenv{table}
\usepackage{blindtext}
\begin{document}
FIRST PAGE

\newpage

\begin{tabular}{|l|c|c|l|c|c|}
\hline
A & 1 & 2\footnote{Go to 1. page}& 1\hyperlink{z}{\ \color{magenta}{$^{2}$}}%
  \addtocounter{footnote}{1}\footnotetext{\hypertarget{z}{\blindtext}} & 2\\ \hline
B & 2 & 1 & 1 & 2 \\ \hline
C & 3 & 3 & 1 & 2\footnote{Go to 2. page}\\ \hline
\end{tabular}

\newpage

FIRST PAGE

\newpage

FIRST PAGE

\end{document}

And, second footnote click output

enter image description here

and, third footnote click output

enter image description here

As can be seen, second footnote is starting half. Third footnote is starting exactly line. Does anyone know how to fix it?

5
  • 1
    Why not use \hyperlink{targetname}{2} for example and link the table entry directly to \hypertarget{targetname}{some text here}? Sep 17, 2015 at 14:50
  • @JohnKormylo, I did used it. I changed your answer. Please see my question has been edited
    – Özgür
    Sep 18, 2015 at 16:03
  • 1
    Actually, I thought you wanted to link directly to the page, not the footnotes. Sep 18, 2015 at 20:09
  • @JohnKormylo, Ok.
    – Özgür
    Sep 18, 2015 at 20:44
  • Anyway, it seems hyperref and footnote are out of sync. Jumping to the first page is the default for an unknown target. The last links to the first, no matter ow many footnotes are used. The problem is that hyperref and footnote (mdwtools) use a lot of the same names and may just be plain incompatible. Sep 18, 2015 at 21:14

1 Answer 1

1

With the tablefootnote package and additionally \spewtabnotes you should be able to get the desired footnotes/links:

\documentclass[a4paper,11pt]{book}
\usepackage{tabularx}
\usepackage[svgnames]{xcolor}
\usepackage{footnote}
\usepackage{tablefootnote}
\makeatletter%
\newcommand{\spewtabnotes}{%
\tfn@tablefootnoteprintout%
\global\let\tfn@tablefootnoteprintout\relax%
\gdef\tfn@fnt{0}}%
\makeatother%
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
\makesavenoteenv{tabular}
\makesavenoteenv{table}
\usepackage{blindtext}
\begin{document}
FIRST PAGE    
\newpage
\phantomsection\label{interesting}SECOND PAGE    

\begin{tabular}{|l|c|c|l|c|c|}
\hline
A & 1 & 2\tablefootnote{Go to 1. page}& 1\tablefootnote{\blindtext} & 2\\ \hline
B & 2 & 1& 1 & 2 \\ \hline
C & 3 & 3 & 1 & 2 \tablefootnote{Go to \protect\pageref{interesting}. page}\\ \hline
\end{tabular}
\spewtabnotes

\newpage THIRD PAGE
\newpage FOURTH PAGE
\end{document}

And when you use hyperref anyway, you can also link to the targeted page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .