REVTex 4.2 setting reference to title footnote

cross-referencingfootnotesrevtex

I'm using REVTex 4.2, without the footnotes in the bibliography, and making use of the \homepage[<text>]{URL} macro, which allows me to set a footnote in my title linked to the bottom of the page, which activates every time I click on it, in this case to indicate the source code repository for my paper.

Later on my document I want to make a reference to this exact footnote, however if I add a \label{<label>} to it, when I click on it, instead of going to the bottom of the page where to footnote is, it leads to the title instead.

Adding a label was the recommended way of referencing the same footnote, and currently I see no other than that. How am I going to be able of achieving such behavior?

Best Answer

I've found a solution which relies on the usage of \phantomsection. Here's a minimal working example of such solution:

\documentclass[%
reprint,
nofootinbib,
amsmath,amssymb,
aps,
]{revtex4-2}

\usepackage{hyperref}  % Add hypertext capabilities
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=cyan,
}

\begin{document}

\title{Title}

% footnote(s) to article title
\homepage[Website:\phantomsection\label{lb:homepage} ]{https://example.org}

\author{Author}

\date{\today}

\maketitle

sample text

\clearpage

sample text2 and reference: Footnote \ref{lb:homepage} on \autopageref{lb:homepage}

\end{document}

This solution was provided by the user Ijon Tichy over at Latex.org - link to forum thread.

Related Question