BibLaTeX: How to do to combine APA, numeric citations and German language options? (\apashortdash error)

biblatex

I am writing a text in German and I would like to use an APA-style bibliography with numeric citations in the text. (I know, biblatex-apa is not to be messed with, but both APA and numerics are explicitely required for the assignment.) Using the english option for babel, that works exactly as expected. As soon as I change to ngerman though, I get the known "\apashortdash undefined" error and TexMaker refuses to compile.
What can I do to combine APA, numeric citations and German?

Here is my MWE:

@Inbook{redei2008fish,
title="FISH (fluorescence in situ hybridization)",
bookTitle="Encyclopedia of Genetics, Genomics, Proteomics and Informatics",
year="2008",
publisher="Springer Netherlands",
address="Dordrecht",
pages="689--689",
doi="10.1007/978-1-4020-6754-9_6006"
}

@article{volpi2008fish,
  title={FISH glossary: an overview of the fluorescence in situ hybridization technique},
  author={Volpi, Emanuela V and Bridger, Joanna M},
  journal={Biotechniques},
  volume={45},
  number={4},
  pages={385--409},
  year={2008},
  publisher={Future Science}
}



\documentclass{scrartcl} 

\usepackage[ngerman]{babel} 
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 

\usepackage[
    bibstyle=apa,
    citestyle=numeric-comp,
    backend=biber
    ]{biblatex}
    
\makeatletter
\RequireBibliographyStyle{numeric}
\makeatother

\addbibresource{fishbib.bib}

\usepackage[german=guillemets]{csquotes}
\usepackage[breaklinks=true]{hyperref}
    
\begin{document}
Beispieltext mit Bezug auf Text 1 \cite{redei2008fish}.
Beispieltext mit Bezug auf Text 2 \cite{volpi2008fish}.

\printbibliography

\end{document}

Best Answer

biblatex-apa is supposed to be used both as citation and bibliography style at the same time (i.e. style=apa,). No care has been taken to allow you to use the citation and bibliography style separately or independently of each other. This means that the bibliography and citation styles may define or redefine macros in a way that assumes the other file is loaded as well.

Specifically your example never loads the citation style apa.cbx, which defines the command \apashortdash that is redefined by the localisation files. You can avoid this error by providing \apashortdash.

There is absolutely no guarantee that everything will look as you want, but the example compiles without error for me.

\documentclass{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german=guillemets]{csquotes}
\usepackage[
  backend=biber,
  bibstyle=apa,
  citestyle=numeric-comp,
]{biblatex}
\usepackage[breaklinks=true]{hyperref}

\makeatletter
\RequireBibliographyStyle{numeric}
\makeatother

\providecommand{\apashortdash}{-}

\addbibresource{biblatex-examples.bib}

\begin{document}
Beispieltext mit Bezug auf Text 1 \cite{sigfridsson}.
Beispieltext mit Bezug auf Text 2 \cite{worman}.

\printbibliography
\end{document}

Beispieltext mit Bezug auf Text 1 [1]. Beispieltext mit Bezug auf Text 2 [2].

Related Question