我希望能够使用诸如和 之.bib
类的命令引用文本中的条目,而该条目不会出现在最后的参考书目中。我该怎么做?在以下 MWE 中,应从参考书目中删除该条目。\citeauthor
\citetitle
Lennon, John (1972)
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{lennon1972,
AUTHOR = "John Lennon",
TITLE = "Who did what in the Beatles",
YEAR = "1972"}
@book{starkey1994,
AUTHOR = "Richard Starkey",
TITLE = "I'm the drummer",
YEAR = "1994"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citeauthor{lennon1972} once wrote a book \citetitle{lennon1972}. You can read about it in \textcite{starkey1994}.
\printbibliography
\end{document}
(我确信我之前问过这个问题,但现在我无法在这个网站上找到这样的问题)
答案1
最简单的选择是在文件dataonly
中添加.bib
options = {dataonly},
这将使该条目跳过参考书目(它设置skipbib
),并确保该条目不会干扰extradate
和其他与标签相关的事项。(如果您想要此条目的标签相关功能,请使用options = {skipbib,skipbiblist},
)。
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\begin{filecontents}{\jobname.bib}
@book{lennon1972,
author = {John Lennon},
title = {Who did what in the Beatles},
year = {1972},
options = {dataonly},
}
@book{starkey1994,
author = {Richard Starkey},
title = {I'm the drummer},
year = {1994},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citeauthor{lennon1972} once wrote a book \citetitle{lennon1972}.
You can read about it in \textcite{starkey1994}.
\printbibliography
\end{document}
不过,如果您想从文档中动态决定是否打印条目,这可能不是理想的选择。在这种情况下,您可以使用类别来过滤条目。标签数据将在此时创建,因此您无法摆脱条目对extradate
其他与唯一性相关的功能的影响。
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\DeclareBibliographyCategory{skipbib}
\addtocategory{skipbib}{lennon1972}
\begin{filecontents}{\jobname.bib}
@book{lennon1972,
author = {John Lennon},
title = {Who did what in the Beatles},
year = {1972},
}
@book{starkey1994,
author = {Richard Starkey},
title = {I'm the drummer},
year = {1994},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citeauthor{lennon1972} once wrote a book \citetitle{lennon1972}.
You can read about it in \textcite{starkey1994}.
\printbibliography[notcategory=skipbib]
\end{document}
可以实现自动化,但并非完全容易。在下面的 MWE 中,所有使用\cite...
未关闭命令引用的条目citetracker
都显示在参考书目中。此时再想放弃独特性效应就太晚了。
\documentclass{article}
\usepackage[style=authoryear, citetracker]{biblatex}
\DeclareBibliographyCategory{showinbib}
\AtEveryCitekey{%
\ifbool{citetracker}
{\addtocategory{showinbib}{\thefield{entrykey}}}
{}}
\begin{filecontents}{\jobname.bib}
@book{lennon1972,
author = {John Lennon},
title = {Who did what in the Beatles},
year = {1972},
}
@book{starkey1994,
author = {Richard Starkey},
title = {I'm the drummer},
year = {1994},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citeauthor{lennon1972} once wrote a book \citetitle{lennon1972}.
You can read about it in \textcite{starkey1994}.
\printbibliography[category=showinbib]
\end{document}