我正在用类文件写一篇文章amsart
。(实际上,我使用的是 ASL 类文件的修改版本——请参阅这个问题-- 但amsart
阅读此问题的人使用起来需要较少的努力,并且希望足够相似。)我想使用,但由、等footnotebackref
生成的未编号脚注导致了问题:我收到错误消息。我推测问题是它们是脚注,但在正文中没有脚注标记,因此不知道链接回哪里。\thanks
\keywords
LaTeX Error: \@makefnmark undefined
footnotebackref
以下是 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
完成的操作失败。\@makefntext
footnotebackref
还有另一个地方可以采取行动,否则\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}