![暂时删除脚注以提高可读性](https://linux22.com/image/269037/%E6%9A%82%E6%97%B6%E5%88%A0%E9%99%A4%E8%84%9A%E6%B3%A8%E4%BB%A5%E6%8F%90%E9%AB%98%E5%8F%AF%E8%AF%BB%E6%80%A7.png)
在文档中,我使用\autocite
和\footnote
(和 biblatex,这可能不是重要的信息)。我重新定义了\footnote
(\renewcommand{\footnote}[1]{}
)以生成没有个人评论的文档。不幸的是,该\autocite
命令似乎受到影响,根本没有显示脚注。如何避免这种影响?
注意:我知道我可以切换到内联模式。
答案1
保罗·斯坦利的解决方案也有效,但是是鱼与熊掌兼得biblatex
,您只需告诉biblatex
在其自动引用命令中使用脚注的原始定义。幸运的是,正如 Audrey 在评论中指出的那样,这可以通过提供的\AtEveryCite
钩子来完成biblatex
。此代码在每个引用的开头执行。
\documentclass{article}
\begin{filecontents}{\jobname.bib}
@book{Chomsky1981,
Address = {Dordrecht},
Author = {Noam Chomsky},
Booktitle = {Lectures on Government and Binding},
Publisher = {Foris Publications},
Title = {Lectures on Government and Binding},
Year = {1981}}
@book{Chomsky1986,
Address = {Cambridge, MA},
Author = {Chomsky, Noam},
Booktitle = {Barriers},
Publisher = {{MIT} Press},
Title = {Barriers},
Year = {1986}}
@book{Chomsky1982,
Address = {Cambridge, MA},
Author = {Noam Chomsky},
Booktitle = {Some Concepts and Consequences of the Theory of Government and Binding},
Publisher = {{MIT} Press},
Title = {Some Concepts and Consequences of the Theory of Government and Binding},
Year = {1982}}
\end{filecontents}
\usepackage[backend=biber,style=authortitle]{biblatex}
\usepackage{kantlipsum}
\let\origfootnote\footnote % save the original definition of footnote
% Tell biblatex to use the original definition
\AtEveryCite{\let\footnote\origfootnote}
% make regular footnotes empty
\renewcommand{\footnote}[1]{}
\addbibresource{\jobname.bib}
\begin{document}
In these books \autocite{Chomsky1981, Chomsky1982} Chomsky did lots of syntax.\footnote{This is a footnote.} \kant[1]
In this book\autocite{Chomsky1986} he revised a bunch of things and made them better.\footnote{This is another footnote.} \kant[2]
\printbibliography
\end{document}
(这是答案的一个更简单的版本,它以前重新定义了一些低级biblatex
宏。)
答案2
如果您没有脚注,biblatex
就不能将引文放入脚注中!\autocite
所做的就是将引文放入\footnote
,而您的重新定义正在努力将它们全部删除。
如果您想创建一个可以关闭的“个人”脚注命令,您能否定义自己的命令来代替\footnote
:
\newcommand{\myfootnote}[1]{\footnote{#1}}
然后,当您想要关闭脚注时,您可以重新定义此命令,同时保持底层\footnote
命令不变。(正如您所指出的,另一种方法是在关闭脚注时切换到内联引用。)