[Tex/LaTex] Polyglossia and biblatex-apa

apa-stylebiblatexpolyglossia

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},
    url={http://google.com/},
    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.

Best Answer

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.