1

MWE:

\documentclass{amsart}
\usepackage{footnotebackref}
\begin{document}
\begin{equation}\label{eq:1}
    1=1\footnote{1}
\end{equation}
\ref{eq:1}
\end{document}

This produces an error because the label of the equation is overwritten: enter image description here

How can I fix this?

Edit:

\documentclass{amsart}
\usepackage{xpatch}
\usepackage{hyperref}
%\usepackage{cleveref} %I get wrong hyperlinks with and without cleveref
\usepackage{footnotebackref}

\makeatletter
\edef\BackrefFootnoteTag{bhfn:\theBackrefHyperFootnoteCounter}
\xpretocmd{\@adminfootnotes}{\let\@makefntext\BHFN@OldMakefntext}{}{}
\renewcommand\@makefntext[1]{%
  \@ifundefined{@makefnmark}
    {}
    {%
     \renewcommand\@makefnmark{%
       \mbox{%
         \textsuperscript{%
           \normalfont
           \hyperref[\BackrefFootnoteTag]{\@thefnmark}%
         }%
       }\,%
     }%
     \BHFN@OldMakefntext{#1}%
  }%
}
\makeatother
\begin{document}

\footnote{Test1}

\begin{align}\label{eq:1}
    1=1\protect\footnotemark
\end{align}

Test\footnotetext{\label{fn2}This is footnote} eq.~\ref{eq:1}
%\cref{fn2}
\end{document}

gives an output that LOOKS alright, but the backref from the second footnote hyperlinks to the first footnote :( How can this be fixed? Did I implement MadyYuvi's answer wrong?

1
  • I'm not familiar with this package, and am sure it's never been tested with the AMS document classes. But it's rather unusual to use a footnote within display math, and not generally recommended. (Of course, if it's on \text in a display, that makes more sense, but ...) Anyhow, this is something that should be reported to tech-support@ams.org so that they know about it. – barbara beeton Jan 9 '20 at 3:10
1

Hope the below MWE will help you:

\documentclass{amsart}
\usepackage{xpatch}
\usepackage{hyperref}
\usepackage{footnotebackref}

\makeatletter
\edef\BackrefFootnoteTag{bhfn:\theBackrefHyperFootnoteCounter}
\xpretocmd{\@adminfootnotes}{\let\@makefntext\BHFN@OldMakefntext}{}{}
\renewcommand\@makefntext[1]{%
  \@ifundefined{@makefnmark}
    {}
    {%
     \renewcommand\@makefnmark{%
       \mbox{%
         \textsuperscript{%
           \normalfont
           \hyperref[\BackrefFootnoteTag]{\@thefnmark}%
         }%
       }\,%
     }%
     \BHFN@OldMakefntext{#1}%
  }%
}
\makeatother
\begin{document}

\begin{align}\label{eq:1}
    1=1\protect\footnotemark
\end{align}

\footnotetext{This is footnote}\ref{eq:1}
\end{document}

PS: Ideas borrowed from one of egreg post...

Output

enter image description here

EDIT

\documentclass{amsart}
\usepackage{xpatch}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{footnotebackref}

\makeatletter
\edef\BackrefFootnoteTag{bhfn:\theBackrefHyperFootnoteCounter}
\xpretocmd{\@adminfootnotes}{\let\@makefntext\BHFN@OldMakefntext}{}{}
\renewcommand\@makefntext[1]{%
  \@ifundefined{@makefnmark}
    {}
    {%
     \renewcommand\@makefnmark{%
       \mbox{%
         \textsuperscript{%
           \normalfont
           \hyperref[\BackrefFootnoteTag]{\@thefnmark}%
         }%
       }\,%
     }%
     \BHFN@OldMakefntext{#1}%
  }%
}
\makeatother
\begin{document}

\begin{align}\label{eq:1}
    1=1\protect\footnotemark
\end{align}

Test\footnotetext{\label{fn1}This is footnote} eq.~\ref{eq:1}
\cref{fn1}
\end{document}

enter image description here

6
  • When I want to refer to a footnote using cleveref with your code, it doesn't work. Do you know how to fix this? When I write \cref{footnote:1} it produces "?? 1" instead of "footnote 1" – Jakob Jan 13 '20 at 19:55
  • 1
    If you follow the package order, like \usepackage{cleveref} \usepackage{footnotebackref} then the said error won't happen... – MadyYuvi Jan 14 '20 at 6:06
  • Refer edits for better understanding... – MadyYuvi Jan 14 '20 at 6:15
  • for every \protect\footnotemark the backref is hyperlinked to another footnote? – Jakob Jan 14 '20 at 13:10
  • Can you provide your MWE? As I didn't face such issue... – MadyYuvi Jan 21 '20 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.