0

Consider the scenario: I'd like to subdivide the bibliography in my document into subbibliographies. I find the idea of categories particularly appealing. Thus I have annotated my .bib files with keywords. However, I'm extremely reluctant to add single keys to categories. To do this, I'd have to reference every citation twice: once in the \cite command and once more in the preamble of the document with \addtocategory. This seems redundant and also very risky in case I forget one or the other.

Since the category information is already present in the .bib files, is it possible to add items to a category via keywords?

1

On first glance what you describe sounds like you want to filter your bibliography with keyword/notkeyword directly.

Categories are supposed to offer a way to categories your bibliography dynamically from within the current document, keywords are supposed to be static and attach to an entry in the .bib file.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\begin{filecontents}[force]{\jobname.bib}
@book{aristotle:anima,
  author       = {Aristotle},
  title        = {De Anima},
  date         = 1907,
  editor       = {Hicks, Robert Drew},
  publisher    = {Cambridge University Press},
  location     = {Cambridge},
  keywords     = {primary},
}
@book{nussbaum,
  author       = {Nussbaum, Martha},
  title        = {Aristotle's \mkbibquote{De Motu Animalium}},
  date         = 1978,
  publisher    = {Princeton University Press},
  location     = {Princeton},
  keywords     = {secondary},
}
@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}
\addbibresource{\jobname.bib}


\begin{document}
\cite{sigfridsson,aristotle:anima,nussbaum}
\printbibliography[keyword=primary, title=Primary Sources]
\printbibliography[keyword=secondary, title=Secondary Sources]
\printbibliography[notkeyword=primary,notkeyword=secondary]
\end{document}

It is possible to combine category and keyword filtering options and - if more complex logic is required - in bibliography filters (\defbibfilter) or bibliography checks (\defbibcheck).

| improve this answer | |
  • That is of course a viable solution and if nothing else turns up I'll eventually resort to this. However, I quite like the way biblatex treats categories: The subheadings are very cleanly defined and \bibbycategory seems very intriguing. Ideally, I would define the categories in a preamble shared (with \input) by several documents. In the individual documents, I'd print the bibliography with \bibbycategory and would not even have care which categories are used in the individual documents. – Alexander Krumeich Jan 25 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.