4

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}

1 Answer 1

3

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
\xpretocmd{\@adminfootnotes}{\let\@makefntext\BHFN@OldMakefntext}{}{}
% 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}

enter image description here

3
  • 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, 2017 at 19:16
  • 1
    @DanielWolf For asl.cls, it should be \xpretocmd{\@maketitle} instead of \xpretocmd{\@adminfootnotes}.
    – egreg
    Aug 9, 2017 at 19:26
  • Nothing short of amazing. Many thanks indeed. This issue had been bugging me for some time.
    – dwolfeu
    Aug 9, 2017 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .