BibTeX, biblatex and biberstyle=apa in biblatex problem

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
GeoffRussell
Posts: 4
Joined: Wed Nov 26, 2014 1:14 am

style=apa in biblatex problem

Post by GeoffRussell »

I'm new to biblatex and am trying to use it with biblatex-apa

My sample document is:

Code: Select all

\documentclass{article}
   \usepackage[backend=bibtex,style=apa]{biblatex}
   \bibliography{demo}
   \begin{document}
   Book by \textcite{AAA}.
   Book by \parencite{AAA}.
   \printbibliography
   \end{document}
--- demo.bib look like

Code: Select all

@book{AAA,
      title={{This is a long title to see if the hanging indent works or if it fails, I'm guessing it will fail}},
      author={John Smith},      
      publisher={MyPublishing},
      year={2005}
}
Running pdflatex on demo.tex gives me ... (it runs fine without the style=apa)

Code: Select all

! Undefined control sequence.
l.231 \DeclareStyleSourcemap
                            {
? x
I'm using Tex Live on ubuntu 14.04 LTS (texlive-bibtex-extra version 2013.20140215-2)

If I take out the backend=bibtex I'm told to use biber, so I run biber on my .bib file and then pdflatex fails with

! Undefined control sequence.
<argument> \mkbibdateapalongextra


Any ideas what I missing?

Cheers,
Geoff Russell

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

style=apa in biblatex problem

Post by Johannes_B »

Hi and welcome, very very good minimal example.


biblatex-apa is a bit tricky. You have to declare a language mapping additional to loading babel. This loads some language features like the correct date format. You can read more about that Problem with \mkbibdateapalongextra of biblatex-apa.

Code: Select all

\begin{filecontents}{\jobname.bib}
	@book{AAA,
		title={{This is a long title to see if the hanging indent works
			or if it fails, I'm guessing it will fail}},
		author={John Smith},      
		publisher={MyPublishing},
		year={2005}
	}
\end{filecontents}
\documentclass{article}
\usepackage[british]{babel}
\usepackage[backend=biber,style=apa]{biblatex}
\DeclareLanguageMapping{british}{british-apa}
\addbibresource{\jobname.bib}
\begin{document}
Book by \textcite{AAA}.
Book by \parencite{AAA}.
\printbibliography
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
GeoffRussell
Posts: 4
Joined: Wed Nov 26, 2014 1:14 am

Re: style=apa in biblatex problem

Post by GeoffRussell »

Hi Johannes_B and thanks for the help. Your example
certainly works but my real bib
file doesn't play well with biber ... some kind of encoding problem. I have to go back to [natbibapa]{apacite} for now and learn a bit more about what I'm doing before the next project.
Post Reply