擺脫ntheorem對定理註釋中腳註的限制

擺脫ntheorem對定理註釋中腳註的限制

正如下面的 MWE 所示,定理註釋中的腳註對於amsthm的定理效果很好:

\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}[Foo\footnote{Bar.}]
Baz.
\end{theorem}
\end{document}

但是,如下圖M所示我們並根據這個答案,不適用於ntheorem腳註文字遺失且需要\footnotemark/技巧的定理:\footnotetext

\documentclass{article}
\usepackage{ntheorem}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}[Foo\footnote{Bar.}]
Baz.
\end{theorem}
\begin{theorem}[Foo\footnotemark]
  \footnotetext{Bar.}
Baz.
\end{theorem}
\end{document}

雖然在定理可選參數中添加腳註可能不是一個很好的做法,但在某些情況下它可能很有用,例如對於腳註中的引用,如以下 MWE 所示:

\documentclass{article}
\usepackage{amsthm}
% \usepackage{ntheorem}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}[\citeauthor{knuth:ct}\footcite{knuth:ct}]
Baz.
\end{theorem}
\printbibliography
\end{document}

由於某些原因,我堅持使用ntheorem並且無法更改它amsthm。有希望解決這個ntheorem限制嗎?

答案1

載入footnote包就足夠了,並且由於它的\makesavenoteenv命令,要求 ( ntheorem's) 定理來正確處理腳註:

\documentclass{article}
\usepackage{ntheorem}
\usepackage{footnote}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\makesavenoteenv{theorem}
\makesavenoteenv{lemma}
\begin{document}
\begin{theorem}[\citeauthor{knuth:ct}\footcite{knuth:ct}]
Baz.
\end{theorem}
\begin{lemma}[\citeauthor{knuth:ct}\footcite{knuth:ct}]
Baz.
\end{lemma}
\printbibliography
\end{document}

相關內容