Structuring the bibliography by headings and subheadings
Well, you could do the following to put both sectioning commands in one \defbibheading
:
\documentclass[12pt]{article}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\defbibheading{multilevel}{%
\section*{Primary Sources}
\subsection*{Manuscripts}}
\begin{document}
\nocite{knuth:ct}
\printbibliography[heading=multilevel]
\end{document}
A fuller example would be:
\documentclass[12pt]{article}
\usepackage[backend=biber,style=authortitle]{biblatex}
\addbibresource{biblatex-examples.bib}
\defbibheading{multilevel}{%
\section*{Primary Sources}
\subsection*{Manuscripts}}
\defbibheading{published}{%
\subsection*{Published Works}}
\defbibheading{secondary}{%
\section*{Secondary Sources}}
\DeclareBibliographyCategory{mss}
\DeclareBibliographyCategory{pri}
\DeclareBibliographyCategory{sec}
\addtocategory{mss}{knurth:ct}
\addtocategory{pri}{knuth:ct:a}
\addtocategory{sec}{knuth:ct:b}
\begin{document}
\nocite{knuth:ct,knuth:ct:a,knuth:ct:b}
\printbibliography[heading=multilevel, notcategory={pri}, notcategory={sec}]
% \printbibliography[heading=multilevel, category={mss}]
\printbibliography[heading=published, category={pri}]
\printbibliography[heading=secondary, category={sec}]
\end{document}
But for some reason it does not work correctly if you use three bibliography categories, though it will work if you use notcategory
.... However, it does work fine with three different keyword
s (e.g., keyword={mss}
, keyword={pri}
, keyword={sec}
) as long as your .bib
file entries have the appropriate keywords
field. (Unfortunately, the biblatex-examples.bib
that ships with biblatex
only has two categories of keywords
: primary and secondary.)
Necro'ing after four years because I had a similar problem and found a better solution. Biblatex 3.5 allows to improve the solution a tad. From the manual:
\defbibheading{name}[title]{code}
This command defines bibliography headings. The name is an identifier to be passed to the heading option of \printbibliography or \printbibheading and \printbiblist when selecting the heading. The code should be LaTeX code generating a fully-fledged heading, including page headers and an entry in the table of contents, if desired. If \printbibliography or \printbiblist are invoked with a title option, the title will be passed to the heading definition as #1. If not, the default title specified by the optional title argument is passed as #1 instead. The title argument will typically be \bibname, \refname, or \biblistname (see § 4.9.2.1).
OK, that is not very clear, but what it means is that you can write a macro to produce the bibliographic heading. In the above case, one could do something like:
\defbibheading{firstlevel}[]{%
\section*{#1}
\addcontentsline{toc}{section}{#1}}
\defbibheading{secondlevel}[]{%
\subsection*{#1}
\addcontentsline{toc}{subsection}{#1}}
(...)
\section*{Primary Sources}
\addcontentsline{toc}{section}{Primary Sources}
\printbibliography[keyword=published, heading=secondlevel, title={Published Works}]
\printbibliography[keyword=manuscripts, heading=secondlevel, title={Manuscripts}]
\printbibliography[keyword=secondary, heading=firstlevel, title = {Secondary Sources}]
You still need an explicit call to create the second section; maybe a LateX-guru could refine the code definitions to avoid this. But I would argue this solution is cleaner.
I know, I could use something like this:
\printbibheading
\section*{Primary Sources}
\subsection*{Manuscripts}
\printbibliography[keyword={Manuscripts}, heading=none]
\subsection*{Published Works}
\printbibliography[keyword={Primary Source}, heading=none]
\section*{Secondary Sources}
\printbibliography[keyword={Secondary Source}, heading=none]
Maybe, however, there are other, i.e., more elegant, solutions possible.