# Polyglossia and biblatex-apa

I am trying to typeset a document in British English, using XeLaTeX, Polyglossia and BibLaTeX, with APA-style references.

Unfortunately, I get the following error:

! Undefined control sequence.
<argument> \mkbibdateapalongextra


Below is a minimal working example:

\begin{filecontents}{mwe.bib}
@online{test2012,
author={John Doe},
title={It is not working},
date={2012-02-03},
urldate={2012-03-18}
}
\end{filecontents}

\documentclass[12pt,a4paper]{article}

\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{british}{british-apa}

\bibliography{mwe.bib}

\begin{document}

This is a reference. \cite{test2012}

\clearpage
\printbibliography

\end{document}


After appending the commands in this solution, I get a different error:

! Undefined control sequence.
<argument> \mkbibdateapalongmdy


The problem seems to be related to the question mentioned above, although British English is a common language, and the lbx files are present.

-
possible duplicate of Mimic BibTeX "apalike" with BibLaTeX - (biblatex-apa broken?) –  lockstep Mar 19 '12 at 9:05
I looked at that question indeed, but it seems he is trying to replicate the APA-style without using biblatex-apa. –  Ruud v A Mar 19 '12 at 9:26
I replicated the apalike style without using biblatex-apa as I was not able to get it to work with polyglossia. I am quite surprised how "easy" it is given Ulrikes answer below. This is something the biblatex-apa package author should take into consideration. –  Jörg Mar 19 '12 at 21:16

The problem is not directly related to polyglossia. The problem is that that there is no english-apa.lbx. The existing british-apa.lbx defines extras for british. And as mentioned in the biblatex documentation "\DeclareLanguageMapping is not intended to handle language variants (e. g., American English vs. British English) or babel language aliases (e. g., USenglish vs. american)."

So this would break too:

\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{english}{british-apa}


While this here works fine:

\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{british}{british-apa}


One solution is to make a copy of british-apa.lbx and to name it e.g. english-apa.lbx and to change at least the british after \DefineBibliographyExtras and in the \ProvidesFile to english. Then this here works:

\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\DeclareLanguageMapping{english}{english-apa}


It is probably possible to write a shorter lbx which reuses most of the definitions of british-apa.lbx, but I don't know enough of biblatex to write this file directly.

Another solution of the problem could be to write a gloss-british.ldf for polyglossia.

-
Copying the british-apa.lbx did the trick for me, but XeLaTeX did not find it in the same directory as the other biblatex-apa lbx files. When I copied the file to the same directory as my tex file, it worked. Thank you very much! –  Ruud v A Mar 19 '12 at 15:25
You probably didn't update the filename database correctly (texhash with texlive). But the directory of the other biblatex-apa.lbx files is not a good idea anyway. local files should go in local texmf trees. –  Ulrike Fischer Mar 19 '12 at 16:48
Biblatex-apa now includes an english.lbx. Also, remember that biblatex doesn't really support polyglossia, only babel –  PLK Apr 27 '12 at 8:18