I would like to print a bibliography which includes all entries with a certain keyword (and possibly some additional entries).
I know that I can filter by keyword when I print the bibliography using
\printbibliography[keyword=<keyword>]
but this will only print entries which I have cited. I could, of course, use
\nocite{*}
to add all entries to the bibliography and then print just those I want.
However, this will make my .bbl
file huge as my database is enormous.
Another possibility is to use Biber or another tool to prepare a document-specific .bib
file containing only those entries with the keyword. However, this would need to be recreated if additional entries with the keyword are added to my main database files.
Here's an MWE to play with, annotated to indicate the way I'd like it to work ;), and the disadvantages of the way it (almost) works.
The issue of excluding explicitly cited entries is less of an issue for me. The thing I'd really like to work around is adding the entire database contents to the .bbl
.
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{new-stuff,
author = {Watt, Brian},
title = {Happy Times with Penguins},
publisher = {Harvard University Press},
address = {Cambridge, MA},
year = 1995,
pagination = {section},
keywords = {happy}}
@book{den-coll,
author = {Till, Jr., Dennis E.},
booktitle = {Penguin Land and Further North: Human Influence},
title = {Penguin Land and Further North: Human Influence},
publisher = {Oxford University Press},
year = 2008,
address = {Oxford and New York},
keywords = {penguin, human}}
@book{old-stuff,
author = {Harvey, Jr., Dennis E.},
booktitle = {Penguin Land and Further North: Human Influence},
title = {Penguin Land and Further North: Human Influence},
publisher = {Someone \& Daughters},
year = 1567,
address = {Oxford},
bookpagination = {paragraph},
keywords = {penguin}}
\end{filecontents}
\documentclass{article}
\usepackage[defernumbers=true]{biblatex}
\bibliography{\jobname}
\begin{document}
\cite{old-stuff}
% what I would like to work
% \nocite[keyword=happy]
% \printbibliography
% what does work - except that \cite{old-stuff} is ignored and, more importantly, den-coll is added to the .bbl
\nocite{*}
\printbibliography[keyword=happy]
\end{document}
keyword
filtering can only work if the entry is actually in the.bbl
file, otherwisebiblatex
has no way to know about the presence or absence of akeyword
. Using Biber, we can simply ignore all entries without (or with) a certain keyword (seeentrynull
), of course previous\cite
commands cannot help us here.biblatex
bug report #228.\cite{*}
and then a second round where you include a no cite for the entries with the appropriate keywords.\cite{*}
will produce an enormous.bbl
, just as\nocite{*}
would. (It would let me then include additional entries, so it would have that advantage. But the main downside would be the same.).bib
files and I don't want to end up with a.bbl
with 3,000+ entries just so I can filter out a couple of handfuls. I would think that keyword filtering would be very useful at the document level but perhaps I'm wrong and there's just no real demand for it.