Cleveref 使用 svmono 5.6 类时无法获取脚注编号

Cleveref 使用 svmono 5.6 类时无法获取脚注编号

考虑以下输入:

\documentclass{svmono}%%% Version 5.6 from https://www.springer.com/gp/authors-editors/book-authors-editors/resources-guidelines/book-manuscript-guidelines/manuscript-preparation/5636
\pagestyle{empty}
\usepackage{cleveref}
\begin{document}
\begin{theorem}\label[theorem]{exmp:myExample}
  Text.\footnote{\label{ftnt:myFootnoteOne}First footnote.}
  Text.\footnote{\label[footnote]{ftnt:myFootnoteTwo}Second footnote.}
  Text.\footnote{\label{ftnt:myFootnoteThree}Third footnote.}
  Text.\footnote{\label[footnote]{ftnt:myFootnoteFour}Fourth footnote.}
\end{theorem}
References to footnotes 3 and 4 with \texttt{\textbackslash cref}: \cref{ftnt:myFootnoteThree}, \cref{ftnt:myFootnoteFour}.\\
References to footnotes 3 and 4 with \texttt{\textbackslash ref}: \ref{ftnt:myFootnoteThree}, \ref{ftnt:myFootnoteFour}.
\end{document}

将其输入到pdflatexxelatex或中lualatex都会导致无法\cref确定和打印脚注编号:

输出

正如我们所见,而是\cref打印封闭环境的数量(此处为theorem)。

如何解决这个问题?我告诉了作者cleveref,但我试图联系 Springer,但没有成功(自动出现一个答案说texhelp [at] springer [dot] comtexhelp [at] springer [dot] de是死的)。

答案1

svmono 在文档开头覆盖了 cleveref 的脚注定义。因此您应该再次覆盖它。

\documentclass{svmono}%%% Version 5.6 from https://www.springer.com/gp/authors-editors/book-authors-editors/resources-guidelines/book-manuscript-guidelines/manuscript-preparation/5636
\pagestyle{empty}
\usepackage{cleveref}
\makeatletter
\AtBeginDocument{%
\let\cref@old@makefntext\@makefntext%
\long\def\@makefntext{%
  \cref@constructprefix{footnote}{\cref@result}%
  \protected@edef\cref@currentlabel{%
    [footnote][\arabic{footnote}][\cref@result]%
    \p@footnote\@thefnmark}%
  \cref@old@makefntext}%
 } 
\makeatother 
\begin{document}
\begin{theorem}\label[theorem]{exmp:myExample}
  Text.\footnote{\label{ftnt:myFootnoteOne}First footnote.}
  Text.\footnote{\label[footnote]{ftnt:myFootnoteTwo}Second footnote.}
  Text.\footnote{\label{ftnt:myFootnoteThree}Third footnote.}
  Text.\footnote{\label[footnote]{ftnt:myFootnoteFour}Fourth footnote.}
\end{theorem}
References to footnotes 3 and 4 with \texttt{\textbackslash cref}: \cref{ftnt:myFootnoteThree}, \cref{ftnt:myFootnoteFour}.\\
References to footnotes 3 and 4 with \texttt{\textbackslash ref}: \ref{ftnt:myFootnoteThree}, \ref{ftnt:myFootnoteFour}.
\end{document}

相关内容