I recently switched to BibLaTeX to realize a multilanguage bibliography. Everything worked out fine -- however I get the error "Can be used only in preamble." when using the command \DeclareLanguageMapping{english}{english-apa} to declare the respective apa-file as the language file for english. Strangly enough it works if I compile the file without the line in question and compile it a second time with the command. Does anyone know how to fix this?
Here is my MWE:
\begin{filecontents}{\jobname.bib}
@article{Grimberg.2012,
author = {Grimberg, Steffen},
year = {2012},
title = "{Sherlock Holmes in der ARD: Gefährliche Gefühle}",
journal = {taz.de \textnormal{am 17.05.2012}},
url = {http://www.taz.de/!5093806/},
urldate = {2015-06-06},
hyphenation = {english}
}
@book{Weller.1994,
author = {Philip Weller},
year = {1994},
title = "{Alphabetically, My Dear Watson. A Compilation of Canonical Characters. Sherlock Holmes from A to Z}",
edition = {3},
address = {Portsmouth},
publisher = {Sherlock Publications},
}
@incollection{Moriarty.2011,
author = {Moriarty, James},
title = "{The Role of Supervillains in Modern Democracy.}",
pages = {79-107},
publisher = {{Villainy Press}},
editor = {Moriarty, James},
booktitle = {Supervillainy in the 21st Century},
volume = {5},
edition = {3},
year = {2011},
address = {London},
hyphenation = {english},
}
\end{filecontents}
\documentclass[12pt,parskip=half]{scrartcl}
\usepackage[english,ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{csquotes}
\usepackage[
backend=biber,
style=apa,
natbib=true,
autolang=other]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\DeclareLanguageMapping{english}{english-apa}
\addbibresource{\jobname.bib}
\begin{document}
\citet{Grimberg.2012, Weller.1994, Moriarty.2011}
\printbibliography
\end{document}