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.
This problem is due to biblatex-apa
's (apa.bbx
's) apaauthor
name format; you might want to notify the author of this small bug.
The string and others
in the author list sets ifmorenames
to true. apaauthor
checks for this case whenever a name is printed, not just at the very end of the list; consequently it prints the andothers
string ("et al.") after each name.
The fix is to add the following lines to your preamble.
\DeclareNameFormat{apaauthor}{%
\ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}}
{\addcomma\addspace\ldots\addspace}
{\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
{}
{\ifthenelse{\iffieldequalstr{doubtfulauthor}{true}}
{\mkbibbrackets{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}?}}
{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}}}}%
\ifthenelse{\value{listcount}=\value{listtotal}}% this test is new
{\ifmorenames{\andothersdelim\bibstring{andothers}}{}}{}}
The MWE
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Article{boker2011,
Author = {Boker, S. and Neale, M. and Maes, H. and Wilde, M. and
Spiegel, M. and Brick, T. and Spies, J. and Estabrook,
R. and Kenny, S. and Bates, T. and others},
Title = {Open{M}x: {A}n open source extended structural
equation modeling framework},
Journal = {Psychometrika},
Volume = {76},
Number = {2},
Pages = {306--317},
year = 2011
}
\documentclass{apa6}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa,maxnames=999,sortcites=true,sorting=nyt,apabackref=true,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareNameFormat{apaauthor}{%
\ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}}
{\addcomma\addspace\ldots\addspace}
{\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
{}
{\ifthenelse{\iffieldequalstr{doubtfulauthor}{true}}
{\mkbibbrackets{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}?}}
{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}}}}%
\ifthenelse{\value{listcount}=\value{listtotal}}
{\ifmorenames{\andothersdelim\bibstring{andothers}}{}}{}}
\shorttitle{IFA}
\begin{document}
OpenMx \parencite{boker2011,aksin,wilde,murray}
\printbibliography
\end{document}
then yields
![enter image description here](https://i.stack.imgur.com/jKP4g.png)
Update 2013-10: This has been corrected in biblatex-apa
version 6.4 according to a comment below the question from user PLK.
Best Answer
biblatex
uses "bibliography strings" for (among other things) the headings of bibliographies, so redefining\bibname
(for thebook
andreport
class) or\refname
(forarticle
) won't work. Try to add the following to your preamble:(And as Mico has noted, you're missing
\printbibliography
.) Compilable example: