Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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
add comment

1 Answer

up vote 11 down vote accepted

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.

share|improve this answer
    
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
1  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.