Multiple bibliographies (reference lists) using embedded bibliography database
Under your keyword
filter approach with biblatex
, superficial adjustments to the labelnumber
field (such as adding the suffix a
or b
and resetting the secondary entry count) can be made by redefining the labelnumber
format. Here's an example.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[colorlinks=true,citecolor=red]{hyperref}
\usepackage[defernumbers=true]{biblatex}
\newcounter{bbx:primcount}
\setcounter{bbx:primcount}{0}
% Count number of primary entries; expand labelnumberwidth
% to accommodate suffixes (NB: this might need tweaking when there
% are relatively many more secondary entries)
\makeatletter
\AtDataInput{%
\ifkeyword{secondary}
{}
{\addtocounter{bbx:primcount}{1}%
\blx@setlabwidth{\labelnumberwidth}{%
\csuse{abx@ffd@*@labelnumberwidth}{\thefield{labelnumber}a}}}}
\makeatother
% Print labelnumbers with suffixes, adjust secondary labelnumber
\DeclareFieldFormat{labelnumber}{%
\ifkeyword{secondary}
{{\number\numexpr#1-\value{bbx:primcount}}b}
{#1a}}
\addbibresource{biblatex-examples.bib}
\begin{document}
Filler text \cites[10--15]{aristotle:anima}{aristotle:physics}.
Filler text \cite[23--25]{nussbaum}. Filler text \cite{hyman}.
\printbibheading
\printbibliography[keyword=primary,heading=subbibliography,title={Primary Sources (a)}]
\printbibliography[keyword=secondary,heading=subbibliography,title={Secondary Sources (b)}]
\end{document}
This solution assumes that all entries are assigned one of the keywords primary
or secondary
, but entries without the latter keyword can be treated as primary by replacing the filter keyword=primary
with notkeyword=secondary
.
The same problem but with prefixes to the labelnumber
is relatively easy using the prefixnumbers
option.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[colorlinks=true,citecolor=red]{hyperref}
\usepackage[defernumbers=true]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
Filler text \cites[10--15]{aristotle:anima}{aristotle:physics}.
Filler text \cite[23--25]{nussbaum}. Filler text \cite{hyman}.
\printbibheading
\printbibliography[keyword=primary,heading=subbibliography,title={Primary Sources},prefixnumbers={A}]
\printbibliography[keyword=secondary,heading=subbibliography,title={Secondary Sources},prefixnumbers={B}]
\end{document}
Hmm.. from Re: Biblatex package and multiple biliographies, I got that "Biblatex provides native support for multiple bibliographies.", and in that case multibib
is not needed, and you can still have an inline file.
So, just with using biblatex
(using example in 2905#2922), I managed to get - more or less - what I wanted (all in one file, no bibtex calls, split bibliographies):
... and here is the code:
\documentclass{letter}
\usepackage{biblatex} % tlmgr install biblatex etoolbox logreq
\usepackage{filecontents} % tlmgr install filecontents
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=blue, citecolor=blue, filecolor=blue, urlcolor=blue}
% unicode characters
% note \usepackage[utf8x]{inputenx} breaks biblatex
% with "Package biblatex Error: Incompatible package 'ucs'"
\usepackage[utf8]{inputenx} %
% letter doesn't have \section,\subsection, so:
\def\section*#1{#1}
\def\subsection*#1{#1}
\begin{filecontents}{\jobname.bib}
@article{Bli74,
keywords = {primary},
author = {Blinder, Alan S.},
year = {1974},
title = {The economics of brushing teeth},
journaltitle = {Journal of Political Economy},
volume = {82},
number = {4},
pages = {887--891},
}
@article{audactor2005pflanzen,
keywords = {secondary},
title = {Wie Pflanzen hören... die Geheimnisse der Sonobotanik},
author = {Prof. Dr. Hortensia Audactor},
journal = {Draft: \url{http://www.inventionen.de/vortrag_audactor.html}},
year = {2005}
}
\end{filecontents}
\bibliography{\jobname}
% \usepackage{multibib} % incompatible
\begin{document}
\begin{letter}{Addressee}
Blah, blah - content...
Primary cite: \cite[\nopp a]{Bli74},
Secondary cite: \cite[\nopp b]{audactor2005pflanzen}
\ \\
\hrule
\printbibheading
\hrule
\printbibliography[keyword=primary,heading=subbibliography,%
title={Primary Sources (a)}]
\printbibliography[keyword=secondary,heading=subbibliography,%
title={Secondary Sources (b)}]
\end{letter}
\end{document}
EDIT: note the use of keywords to split the bibliographies; The Biblatex Package pdf notes some other methods too.