I would like to make footnotes inside a minipage that use the global footnote counters and the hyperref package.
I'm having trouble getting hyperref to make the correct references. I imagine I need to change the Hfootnote counter but I haven't had any luck with that and I'm not sure exactly what's going on. I tried adding a \addtocounter{Hfootnote}{-1} and \stepcounter{Hfootnote} but that didn't help.
Below is a minimal example.
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\noindent\ldots{} main text\footnote{Before minipage} \ldots\par
\fbox{\begin{minipage}{.5\linewidth}
A footnote to use global footnotes.\footnotemark
A second global footnote.\footnotemark
\end{minipage}}
\addtocounter{footnote}{-1}
\footnotetext{First global footnote inside minipage}
\stepcounter{footnote}
\footnotetext{Second global footnote inside minipage}
\par
\noindent\ldots{} main text\footnote{After minipage} \ldots\par
\end{document}
Clicking on the first footnote inside the minipage does not yeild the expected result.