XeTeXProblem with polyglossia and biblatex (xelatex related)

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
elingeniero
Posts: 12
Joined: Mon Feb 13, 2012 12:30 pm

Problem with polyglossia and biblatex (xelatex related)

Post by elingeniero »

I switched to XeLatex because I needed to write bits of Arabic in a thesis. I get the following error when using biblatex and polyglossia. The error is:

Code: Select all

 Undefined control sequence.
<argument> \mkbibdateapalongextra 
                                  {year}{month}{day}\iffieldundef {endyear}{...
A google search suggest that it is not a new problem!. Here is an MWE:

Code: Select all

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage[variant=british]{english}
\setotherlanguage{arabic}
\usepackage[backend=biber,sorting=nyt,style=apa,natbib=true,uniquename=false]{biblatex}
\DeclareLanguageMapping{english}{english} %english.lbx is available with biblatex-apa
\usepackage{csquotes}
\begin{filecontents}{samplebib.bib}
@BOOK{Ramsden1992,
  author = {Ramsden, P.},
  title = {Learning to Teach in Higher Education},
  year = {1992},
  publisher = {Routledge},
  address = {London, UK},
  owner = {Saffia},
  timestamp = {2012.09.24}
}
\end{filecontents}

\addbibresource{./samplebib.bib}

\begin{document}

\textcite{Ramsden1992}

\printbibliography 
\end{document}
Compiling:1- xelatex, 2- biber, 3- xelatex >>> error

Ignoring the error, the reference appears in the main text and also in the bibliography but with the year missing.

According to this, the problem the OP had was british-apa.lbx did not exist. As you see from the code above, I declared English mapping to have english.lbx which was added to biblatex-apa but it still doesn't work!

How can I solve this issue?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Problem with polyglossia and biblatex (xelatex related)

Post by cgnieder »

The answer given at the link you posted works for me:
  • copy british-apa as english-apa in a local folder where TeX can find it, maybe the project directory itself
  • change the first line (=> \ProvidesFile{english-apa.lbx}) and where it says \DefineBibliographyExtras{british} (=> \DefineBibliographyExtras{english})
  • use \DeclareLanguageMapping{english}{english-apa} in the main file.
Regards
site moderator & package author
elingeniero
Posts: 12
Joined: Mon Feb 13, 2012 12:30 pm

Re: Problem with polyglossia and biblatex (xelatex related)

Post by elingeniero »

Thanks, this worked perfectly. I didn't follow the instructions after seeing the comment from biblatex-apa author.
Post Reply