使用 svmano 5.6 類別時,Cleveref 無法取得註腳編號

使用 svmano 5.6 類別時,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}
\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,但我嘗試聯繫施普林格卻無果而終(自動出現的答案是:texhelp [at] springer [dot] comtexhelp [at] springer [點] de是死的)。

答案1

svmono 在開始文件時覆蓋 smartef 的腳註定義。所以你應該再次覆蓋它。

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

相關內容