我有两个 .bib 文件,但我似乎无法简单地显示每个参考书目分离。我在几个论坛上搜索过,但要么我无法让建议的解决方案发挥作用,要么它们很快就会变得非常复杂。我只是在想象类似这或者这但我无法让它工作。缺少什么?谢谢。
\documentclass{article}
\usepackage{biblatex}
\addbibresource{bib1.bib}
\addbibresource{bib2.bib}
\begin{document}
\nocite{*}
\printbibliography[title={first bibliography}, resetnumbers=true]
\printbibliography[title={second bibliography}, resetnumbers=true]
\end{document}
答案1
biblatex
已经允许您通过许多属性进行过滤,但不能通过包含.bib
文件的文件名进行过滤。
如果可以从数据中读取区分两个书目的关键属性,那么就可能编写一个解决方案,而不需要依赖于人为地分离到不同的文件中。
仍然,biblatex:按不同的 .bib 文件分类的多个参考书目解释了如何使用 Biber 源映射仅通过引用文件名来分离参考书目。以下内容仅使用新appendstrict
功能来避免与现有的非空keywords
字段发生冲突。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear]{biblatex}
\DeclareSourcemap{
\maps[datatype=bibtex, overwrite]{
\map{
\perdatasource{bib1.bib}
\step[fieldset=keywords, fieldvalue={, }, appendstrict]
\step[fieldset=keywords, fieldvalue=one, append]
}
\map{
\perdatasource{bib2.bib}
\step[fieldset=keywords, fieldvalue={, }, appendstrict]
\step[fieldset=keywords, fieldvalue=two, append]
}
}
}
\begin{filecontents}{bib1.bib}
@article{sigfridsson,
author = {Sigfridsson, Emma and Ryde, Ulf},
title = {Comparison of methods for deriving atomic charges from the
electrostatic potential and moments},
journaltitle = {Journal of Computational Chemistry},
date = 1998,
volume = 19,
number = 4,
pages = {377-395},
doi = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
}
\end{filecontents}
\begin{filecontents}{bib2.bib}
@book{nussbaum,
author = {Nussbaum, Martha},
title = {Aristotle's \mkbibquote{De Motu Animalium}},
date = 1978,
publisher = {Princeton University Press},
location = {Princeton},
keywords = {anotherkey},
}
\end{filecontents}
\addbibresource{bib1.bib}
\addbibresource{bib2.bib}
\begin{document}
Some citations: \autocite{sigfridsson,nussbaum}.
\printbibliography[title={First Bibliography}, keyword=one]
\printbibliography[title={Second Bibliography}, keyword=two]
\end{document}
答案2
类似这样的事情应该可以工作:
\documentclass{article}
\usepackage{biblatex}
\addbibresource{bib1.bib}
\addbibresource{bib2.bib}
\begin{document}
\begin{refsection}[bib1]
\nocite{*}
\printbibliography[title={first bibliography}, resetnumbers=true]
\end{refsection}
\begin{refsection}[bib2]
\nocite{*}
\printbibliography[title={second bibliography}, resetnumbers=true]
\end{refsection}
\end{document}