4

I am using biblatex to format my references.
Document is book and is written in greek.
References are mainly english but I have some in greek as well.

While the authoryear style works very well, the apa style is not working for me. Here is a minimum working example:

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{test.bib} 
@article{article01,
    Author = {LastName FirstName},
    Journal = {A journal name},
    Pages = {311--314},
    Title = {A title in greek (όπως αυτός)},
    Volume = {311},
    Number = {2},
    Year = {2011}}
\end{filecontents}
\usepackage[style=apa,backend=biber]{biblatex}
\usepackage{xgreek}
\usepackage{xltxtra}
\DeclareLanguageMapping{english}{greek} 

\setmainfont[Mapping=tex-text,Ligatures=Common]{Courier New}  
\setsansfont[Mapping=tex-text,Scale=MatchLowercase]{Courier New} 
\setmonofont[Scale=MatchLowercase]{Courier New} 
\def\refname{Βιβλιογραφία}


\bibliography{test.bib}
\begin{document}

I want to use  \fullcite{article01} as well.

\printbibliography
\end{document}

produces:

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

and the output looks like:

FirstName, L. (yearmonthday). A title in greek (όπως αυτός). A journal name, 311 (2), 311—314.

Any help is appreciated!

PS: Note that if I replace style=apa with style=authoryear everything runs smoothly.

lockstep
  • 250,273
gkotsis
  • 83
  • This sort of error is normally cause by not loading babel but I guess if you're using XeLaTeX, you should load... the XeTeX version of babel, whatever it's called. polyglossia? – Seamus Apr 18 '11 at 17:43
  • 1
    This has nothing to do with XeLaTeX; the same error happens with pdflatex, even loading babel. – egreg Apr 18 '11 at 19:57

2 Answers2

4

This is because biblatex-apa has no greek .lbx. If you'd like to provide one by copying the american-apa.lbx in the package, please mail me (I'm the biblatex-apa author). Meanwhile, add this to your preamble after the DeclareLanguageMapping line:

\DefineBibliographyExtras{english}{%
  \protected\def\mkbibdateapalong#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\thefield{#1}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#1}%
        {}%
        {\addcomma\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}%
        {}%
        {\addspace}%
       \stripzeros{\thefield{#3}}}}%
  \protected\def\mkbibdateapalongextra#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\thefield{#1}\printfield{extrayear}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#1}%
        {}%
        {\addcomma\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}%
        {}%
        {\addspace}%
       \stripzeros{\thefield{#3}}}}%
  \protected\def\mkbibdateapalongdmy#1#2#3{%
    \iffieldundef{#3}%
      {}%
      {\stripzeros{\thefield{#3}}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#3}%
        {}%
        {\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#1}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#3}}%
        {}%
        {\addspace}%
       \thefield{#1}}}}
PLK
  • 22,776
  • This was very helpful, I am now producing apa-style references. Only thing missing is month field. I get the error: <argument> ...{}{\addcomma \addspace }\mkbibmonth {\thefield {month} – gkotsis Apr 20 '11 at 07:40
  • 1
    For info, the OP sent me a greek localisation file which was incorporated into the style. – PLK Jun 22 '12 at 10:22
2

This solution suppresses "Original work published" and prints "origyear" in bold in the references. Here's a modified MWE.

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{test.bib} 
@Book{aristotle1523b,
  title        = {{Parva naturalia Augustini Niphi Medices Philosophi
                  Suessani}},
  year         = 1550,
  origdate     = 1523,
  address      = {Venice},
  publisher    = {Scoto},
  author       = {Aristotle}} 
\end{filecontents}
\usepackage[style=apa,backend=biber]{biblatex}
\usepackage{xgreek}
\usepackage{xltxtra}
\DeclareLanguageMapping{english}{greek} 
\DefineBibliographyExtras{english}{%
  \protected\def\mkbibdateapalong#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\thefield{#1}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#1}%
        {}%
        {\addcomma\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}%
        {}%
        {\addspace}%
       \stripzeros{\thefield{#3}}}}%
  \protected\def\mkbibdateapalongextra#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\thefield{#1}\printfield{extrayear}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#1}%
        {}%
        {\addcomma\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}%
        {}%
        {\addspace}%
       \stripzeros{\thefield{#3}}}}%
  \protected\def\mkbibdateapalongdmy#1#2#3{%
    \iffieldundef{#3}%
      {}%
      {\stripzeros{\thefield{#3}}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#3}%
        {}%
        {\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#1}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#3}}%
        {}%
        {\addspace}%
       \thefield{#1}}}}

\setmainfont[Mapping=tex-text,Ligatures=Common]{Courier New}  
\setsansfont[Mapping=tex-text,Scale=MatchLowercase]{Courier New} 
\setmonofont[Scale=MatchLowercase]{Courier New} 
\def\refname{Βιβλιογραφία}


\bibliography{test.bib}
\begin{document}

\textcite{aristotle1523b} says  \dots\ 

\printbibliography
\end{document}