[Tex/LaTex] “yearmonthday” added to bibliography when using apa6 with biblatex and biber backend

apa6biberbiblatex

I am trying to use the apa6 package with a more extensive version of this document:

\documentclass[man,a4paper, english]{apa6}
\usepackage{babel}

\usepackage{csquotes}
\usepackage[style=apa,sortcites=true,sorting=nyt,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\begin{filecontents}{ref.bib}
@ARTICLE{bradley1990startle,
  author = {Bradley, Margaret M and Cuthbert, Bruce N and Lang, Peter J},
  title = {Startle reflex modification: Emotion or attention?},
  journal = {Psychophysiology},
  year = {1990},
  month = {11},
  day = {3},
  volume = {27},
  pages = {513--522},
  number = {5},
  publisher = {Wiley Online Library}
}
\end{filecontents}

\AtEveryBibitem{\clearfield{month}}
\AtEveryBibitem{\clearfield{day}}

\addbibresource{ref.bib}

\title{MWE}
\shorttitle{MWE}
\author{Me}
\affiliation{SO}

\leftheader{Me}

\begin{document}

\maketitle

Some more text before the bibliograpy and a citation \parencite{bradley1990startle} of course.

\printbibliography
\end{document}

However when compiling with latex I get this error:

! Undefined control sequence.
<argument> \mkbibdateapalongextra 
                                  {year}{month}{day}\iffieldundef {endyear}{...

When I continue compiling with biber main Biber this error pops up:

INFO - No sort tailoring available for locale 'nl_NL.UTF-8'

After the last compile with pdflatex I do get output, however some strange text appears in the bibliography:

The Bibliography with the (yearmonthday) text.

Following the topic (Xelatex, Biblatex: biber.exe not working properly (IPC::Run) error) I have tried to compile with biber -f main, which didn't help either.

I also tried adding:

\AtEveryBibitem{\clearfield{month}}
\AtEveryBibitem{\clearfield{day}}

which didn't help either. I also tried filling out the day and month fields, but even if those are present the text (yearmonthday) still shows up in the bibliography. How do I get rid of that (yearmonthday) text in the bibliography? What does the error about the undefined control sequence \mkbibdataapalongextra mean?

All files including the complete log can be found here.

Best Answer

The macro \mkbibdataapalongextra is defined in the language specific files american-apa.lbx, austrian-apa.lbx, etc., so if these are not loaded correctly then that macro is not defined, which leads to the issue you observed.

Be default, biblatex does not know to load american-apa, which is why you need \DeclareLanguageMapping{american}{american-apa}. However, it seems that you also need to tell babel to load american explicitly . I wrote "it seems" because I have not investigated in-depth, so I cannot say I fully understand the interdependence. However, the following code fixes your problem (I took the liberty of simplifying your MWE):


\documentclass{article}
\usepackage[english, american]{babel}

\usepackage{csquotes}

\usepackage[style=apa,sortcites=true,sorting=nyt,backend=biber]{biblatex}
\DeclareLanguageMapping{english}{american-apa}


\begin{filecontents}{ref.bib}
@ARTICLE{bradley1990startle,
  author = {Bradley, Margaret M and Cuthbert, Bruce N and Lang, Peter J},
  title = {Startle reflex modification: Emotion or attention?},
  journal = {Psychophysiology},
  year = {1990},
  month = {11},
  day = {3},
  volume = {27},
  pages = {513--522},
  number = {5},
  publisher = {Wiley Online Library}
}
\end{filecontents}

\addbibresource{ref.bib}

\begin{document}


Some more text before the bibliograpy and a citation \parencite{bradley1990startle} of course.

\printbibliography

\end{document}
Related Question