Skip to content

Instantly share code, notes, and snippets.

@matthewfl
Created December 10, 2023 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewfl/52067140a158721df40599f92fd15929 to your computer and use it in GitHub Desktop.
Save matthewfl/52067140a158721df40599f92fd15929 to your computer and use it in GitHub Desktop.
Fix hyperref linking footnotes to the first page
\NewCommandCopy\originalfootnotetext\footnotetext
\NewCommandCopy\originalfootnotemark\footnotemark
\renewcommand{\footnotemark}{%
\stepcounter{footnote}%
\textsuperscript{\hyperref[footnotebody:\thefootnote]{\thefootnote}}}
\renewcommand{\footnotetext}[1]{%
\originalfootnotetext{\phantomsection\label{footnotebody:\thefootnote}#1}}
\renewcommand{\footnote}[1]{\footnotemark\footnotetext{#1}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment