与 footnoteref 和 amsart 类文件冲突

与 footnoteref 和 amsart 类文件冲突

我正在用类文件写一篇文章amsart。(实际上,我使用的是 ASL 类文件的修改版本——请参阅这个问题-- 但amsart阅读此问题的人使用起来需要较少的努力,并且希望足够相似。)我想使用,但由、等footnotebackref生成的未编号脚注导致了问题:我收到错误消息。我推测问题是它们是脚注,但在正文中没有脚注标记,因此不知道链接回哪里。\thanks\keywordsLaTeX Error: \@makefnmark undefinedfootnotebackref

以下是 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

\maketitle处理过程中,\@makefnmark未定义,因此(加载时)\renewcommand完成的操作失败。\@makefntextfootnotebackref

还有另一个地方可以采取行动,否则\thanks就不会出现。

\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}

在此处输入图片描述

相关内容