# Clash with footnoteref and amsart class file

I'm writing an article with the class file amsart. (Well, I'm actually using a modified version of the ASL class file -- see this question -- but amsart requires less effort for people reading this question to use and is hopefully similar enough.) I want to use footnotebackref but the unnumbered footnotes generated by \thanks, \keywords, etc. are causing an issue: I get the error message LaTeX Error: \@makefnmark undefined. I presume the issue is that they're foonotes but without footnote markers in the main body of text and so footnotebackref doesn't know where to link back to.

Here's a MWE:

\documentclass{amsart}

\usepackage{hyperref}
\usepackage{footnotebackref}

\title{A problem with footnotebackref and amsart}
\author{Foo T.\ Note}
\thanks{My heartfelt thanks go to the TeX Stack Exchange.} % If you comment out this line, ...
\keywords{footnotebackref, amsart} % ... this line and ...
\subjclass{001} % ... this line, then the error no longer occurs.

\begin{document}

\maketitle

This is a great place for a footnote.\footnote{Where did this footnote come from? Click on the footnote number to see!}

\end{document}


During \maketitle processing, \@makefnmark is undefined, so the \renewcommand done by \@makefntext (when footnotebackref is loaded) fails.

There is another place to act on, otherwise the \thanks would not appear.

\documentclass{amsart}

\usepackage{xpatch}
\usepackage{hyperref}
\usepackage{footnotebackref}

\makeatletter
% this can be done with xpatch
% this would be harder, so better copying the code from footnotebackref
\renewcommand\@makefntext[1]{%
\@ifundefined{@makefnmark}
{}
{%
\renewcommand\@makefnmark{%
\mbox{%
\textsuperscript{%
\normalfont
\hyperref[\BackrefFootnoteTag]{\@thefnmark}%
}%
}\,%
}%
\BHFN@OldMakefntext{#1}%
}%
}
\makeatother

\title{A problem with footnotebackref and amsart}
\author{Foo T. Note}
\thanks{My heartfelt thanks go to the TeX Stack Exchange.}
\keywords{footnotebackref, amsart}
\subjclass{001}

\begin{document}
\maketitle

This is a great place for a footnote.\footnote{Where did this
footnote come from? Click on the footnote number to see!}

\end{document}


• That works wonderfully with amsart! But alas my hope that amsart.cls and asl.cls are similar enough with regard to footnotebackref was too optimistic: If you try the modfied MWE with asl-mod.cls from @Mico in the motivating question then unnumbered footnotes do not appear. – dwolfeu Aug 9 '17 at 19:16
• @DanielWolf For asl.cls, it should be \xpretocmd{\@maketitle} instead of \xpretocmd{\@adminfootnotes}. – egreg Aug 9 '17 at 19:26
• Nothing short of amazing. Many thanks indeed. This issue had been bugging me for some time. – dwolfeu Aug 9 '17 at 19:38