17

I got biblatex working with the authoryear style in Texlipse:

\documentclass{article} 
\usepackage[canadian]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear,backend=biber]{biblatex} 
\addbibresource{references.bib}
\begin{document} 
This statement is true \parencite[5-8]{Ref}.
\printbibliography 
\end{document}

references.bib:

@BOOK
{Ref,
AUTHOR = "Doe, Jane and Smith, John",
TITLE = "A Book",
PUBLISHER = "Books, Inc.",
YEAR = 1999
}

However, when I try to change the style to apa (\usepackage[style=apa,backend=biber]{biblatex}), an empty bibliography is produced. I have texlive 2012, which has biblatex-apa. Why doesn't it work?

6
  • 1
    Welcome to TeX.sx! Your example compiles fine.
    – hpesoj626
    Nov 4, 2012 at 23:44
  • 1
    Are you sure that TeXlipse is set for using Biber rather than BibTeX?
    – egreg
    Nov 4, 2012 at 23:57
  • I think that biber is set. I've read that pdflatex has to be run twice to work correctly; however, so far I've been hitting ctrl-s to save and "build". How am I to pdflatex twice in TeXlipse?
    – user21760
    Nov 5, 2012 at 0:13
  • 3
    Have you tried to rerun biber after you changed from authoryear to apa? Not sure about TeXlipse, but you can remove the .bbl file to force rebuild (run again biber).
    – Guido
    Nov 5, 2012 at 8:46
  • 1
    That solves the problem. It's seems there should be a better way to do it in TeXlipse, but removing the .bbl forces TeXlipse to rerun biber. Thanks!
    – user21760
    Nov 5, 2012 at 23:50

1 Answer 1

13

On Miktex your example with apa doesn't work due to two reasons:

  1. There is the language mapping commands missing which loads an xxx-apa.lbx which contains some apa specific settings.
  2. You are using canadian as language and the necessary canadian-apa.lbx doesn't exist here.

To solve 1. I used the following example (test.bib is the name of my bib-files for tests):

\documentclass{article}
\usepackage[canadian]{babel}
\usepackage{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}
\DeclareLanguageMapping{canadian}{canadian-apa}
\addbibresource{test.bib}
\begin{document}
This statement is true \parencite[5-8]{Ref}.
\printbibliography
\end{document}

To solve 2. I used one existing xxx-apa.lbx (e.g. british-apa.lbx or american-apa.lbx I have no idea which is better suited as starting point) and made a copy called canadian-apa.lbx. Then I changed in the file in two places the language to "canadian":

  1. In the first line: \ProvidesFile{canadian-apa.lbx}
  2. In \DefineBibliographyExtras{canadian}...

and stored the file in a place where latex can find it.

An alternative way is to use e.g. the language american for the bibliography:

\documentclass{article}
\usepackage[canadian]{babel}
\usepackage{csquotes}
\usepackage[style=apa,backend=biber,language=american]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{test.bib}
\begin{document}
This statement is true \parencite[5-8]{Ref}.
\printbibliography
\end{document}
2
  • It seems that Miktex is more picky than TeXLive. Perhaps these are still good habits to pick up?
    – user21760
    Nov 5, 2012 at 23:53
  • @user21760 I get the same error (undefined \mkbibdateapalongextra when the language is not set up correctly) with texlive 2012. And if the systems were really different it would be due to different biblatex-apa versions. Nov 6, 2012 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .