![摆脱定理注释中关于脚注的限制](https://linux22.com/image/330598/%E6%91%86%E8%84%B1%E5%AE%9A%E7%90%86%E6%B3%A8%E9%87%8A%E4%B8%AD%E5%85%B3%E4%BA%8E%E8%84%9A%E6%B3%A8%E7%9A%84%E9%99%90%E5%88%B6.png)
如以下 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
)定理正确处理脚注:
\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}