biblatex
already lets you filter by lots of properties, but not by file name of the containing .bib
file.
If the crucial property that separates the two bibliographies can be read off from the data, it might be possible to code a solution that does not need to rely on the artificial separation into different files.
Still, biblatex: multiple bibliographies categorised by different .bib files explains how you can separate your bibliographies just by reference to the file names with a Biber sourcemap. The following just uses the new appendstrict
feature to avoid clashes with existing noneempty keywords
fields.
\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}
