我想使用 BibTeX 在文档文本中包含一些完整引文。该bibentry
软件包提供了此功能。但是,我不希望这些项目也出现在参考书目中。
这是一个最小但不工作的例子:
\begin{filecontents}{mytestbib.bib}
@book{test1,
author = "A. Scientist",
title = "Science in Action",
year = "1967"
}
@book{test2,
author = "T. Testing",
title = "This is a test",
year = "1234"
}
\end{filecontents}
\documentclass{article}
\usepackage{filecontents}
\usepackage{natbib}
\usepackage{bibentry}
\nobibliography*
\begin{document}
A full in-text citation: \bibentry{test1}.
A normal citation: \cite{test2}.
\bibliographystyle{plainnat}
\bibliography{mytestbib}
\end{document}
这让我
我想要的是文档主体看起来与实际一致,但参考书目部分仅包含“T. Testing”,而不包含“A. Scientist”。我该如何实现这一点?
答案1
您可以使用biblatex
类别。通过手动添加类别(如下所示),您可以隐藏参考书目中的某些条目:
\DeclareBibliographyCategory{nobibliography}
\addtocategory{nobibliography}{test1}
尝试一下这个(注意我使用 biber 而不是 bibtex 作为引擎):
\begin{filecontents}{mytestbib.bib}
@book{test2,
author = "T. Testing",
title = "This is a test",
year = "1234"
}
@book{test1,
author = "A. Scientist",
title = "Science in Action",
year = "1967"
}
\end{filecontents}
\documentclass{article}
\usepackage{filecontents}
\usepackage[backend=biber,defernumbers=true,style=authoryear-comp]{biblatex}
\DeclareBibliographyCategory{nobibliography}
\addtocategory{nobibliography}{test1}
\addbibresource{mytestbib.bib}
\begin{document}
A full in-text citation: \fullcite{test1}.
% \printbibliography[keyword=presentations,heading=subbibliography,type=inproceedings,title={Conference without external review process}]
A normal citation: \parencite{test2}.
\printbibliography[notcategory=nobibliography]
\end{document}
我得到: