# Multiple footmark messes with hyperref. Hyperlinks pointing to wrong footnotes or dead

When setting multiple footmarks inside an environment that doesn't allow any (equation), the ids correspond to the correct footnotetexts but not the hyperlinks.

\documentclass{article}

\usepackage{amsmath}
\usepackage{hyperref}

\begin{document}

Text\footnote{text1} Text\footnote{text2}

$$\refstepcounter{equation} J=b a^3 \tag{\theequation\footnotemark{}\footnotemark{}}$$

\#1 links to \#1

\#2 links to \#2

\#3 does not link anywhere

\#4 links to \#3

\addtocounter{footnote}{-2} %3=n
\stepcounter{footnote}\footnotetext{a}
\stepcounter{footnote}\footnotetext{b}

\newpage\null\thispagestyle{empty}\newpage

\end{document}

-
Welcome to TeX.SX! These kind of things are not well handled by hyperref. See this answer of lockstep for a workaround. –  karlkoeller Dec 24 '13 at 8:02