The command
\printbibliography[heading=<heading>,...]
doesn't print anything when the bbl
file contains no entries. If it's cited entries in the bbl
file you want to consider, then use a category. The command
\printbibliography[heading=<heading>,category=<category>,...]
won't print anything provided that <category>
is empty and the additional options settings in ...
exclude check
and filter
. The example below considers the article
document class. Its default bibliography
heading doesn't issue a page break, but we can redefine it using \defbibheading
. Default heading definitions for the standard, KOMA-script and memoir document classes can be found in biblatex.def
.
\documentclass{article}
\usepackage[defernumbers]{biblatex}
% add every cited article to a category
% (nb: this excludes entries accessed via \nocite)
\DeclareBibliographyCategory{cited}
\AtEveryCitekey{\addtocategory{cited}{\thefield{entrykey}}}
% define bibliography heading that issues a page break
\defbibheading{bibliography}[\refname]{%
\clearpage
\section*{#1}%
\markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
\addbibresource{biblatex-examples.bib}
\begin{document}
Filler text.
% More filler text \parencite{companion}.
\printbibliography[heading=bibliography,title={Works cited},category=cited]
\end{document}
Use of \AtEveryCitekey
prints a bibliography only for explicitly cited entries, excluding those accessed via \nocite
. To consider all entries in the bbl
file that would otherwise be printed use:
\makeatletter
\AtDataInput{\iftoggle{blx@skipbib}{}{\addtocategory{cited}{\thefield{entrykey}}}}
\makeatother
An empty \printbibliography
generates a warning in the log. To avoid this you can use a boolean flag to indicate citations.
\documentclass{article}
\usepackage[defernumbers]{biblatex}
\newbool{anycited}
\AtEveryCitekey{%
\ifbool{anycited}{}{\global\booltrue{anycited}}}
\newrobustcmd*{\printworkscited}{%
\ifbool{anycited}{\printbibliography}{\printnothing}}
\def\printnothing[#1]{}
\defbibheading{bibliography}[\refname]{%
\clearpage
\section*{#1}%
\markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
\addbibresource{biblatex-examples.bib}
\begin{document}
Filler text.
% More filler text \parencite{companion}.
\printworkscited[heading=bibliography,title={Works cited}]
\end{document}
With this document, biber will issue a warning about no citations. There isn't much you can do about that. Hooking \printbibliography
into \end{document}
might seem convenient, but you are forcing a biber run onto your users. This wouldn't make much sense to me when writing an essay that doesn't use any bibliographic data. You can probably side-step some of these issues with BibTeX, at the cost of many biblatex features.
To print a list of references that have not been cited you can create a check
that filters out the cited one (you have to enable the citetracker
feature, e.g., \usepackage[citetracker=true]{biblatex}
).
The check
can be created as follows
\defbibcheck{uncited}{
\ifciteseen
{\skipentry}
{}
}
and then put a \nocite{*}
in the document, and use
\printbiblipgraphy[check=uncited]
PS I think this has been asked before, but I was not able to locate it.
Best Answer
Most probably you have
\nocite{*}
somewhere in the body of your document; this command will cause all entries of the chosen bibliographical database to be included in the list of references.Simply delete
\nocite{*}
and re-compile your document (using, for example,pdflatex+bibtex+pdflatex+pdflatex
).The
\nocite
command can also be used with a key-list as its argument; in this case, it will write the bibliographical information associated to the key-list (even if the publication(s) is(are) otherwise not cited) into the list of references.