I am trying to get an equivalent for \usepackage{apalike}
with bibtex, but with the ability to use parencite
etc.
Therefore, I tried to use \usepackage[style=apa]{biblatex}
, but every citation now contains ampersand instead of and
.
For authoryear, defining \finalnamedelim
works (Use ampersand & in citations and bibliography in biblatex), like this:
\newcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\bibstring{and}\space}
and also for for the bibliography (Replace 'and' with ampersand in bibliography and parenthetical citations using BibLaTeX) with
\AtBeginBibliography{%
\renewcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\&\space}%
}
Unfortunately, for apa style I cannot make this work.
The only thing that works for apa is using \DeclareDelimFormat
(https://tex.stackexchange.com/a/590692/85628) like in this mwe:
\documentclass{article}
\usepackage[style=apa]{biblatex}
\DeclareDelimFormat[bib,parencite]{finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\bibstring{and}\space}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A. and Buthor, B. and Cuthor, C.},
year = {2001},
title = {Alpha},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Some text \autocite{A01}.
\printbibliography
\end{document}
Unfortunately, this also only works for the text itself, but not for the bibliography at the end. Additionally, this leads to more than 2 names being written completely (instead of being replaced by et al.
).
Changing the declaration to
\DeclareDelimFormat[bibliography,parencite]{finalnamedelim}{%
\ifnumgreater{\value{liststop}}{1}%
\addspace\bibstring{and}\space}
solves the problem with the 3 authors, but still, ampersand is used in the bibliography instead of and
.
Additionally, references do not have the same format (Alcocer, J. P. S. and Bergel, A. (2015). Tracking down performance variation against source code evolution. In Proceedings of the 11th Symposium on Dynamic Languages, DLS 2015, pages 129–139, New York, NY, USA. ACM.
is apalike and Alcocer, J. P. S., & Bergel, A. (2015). Tracking down performance variation against source code evolution, In Proceedings of the 11th symposium on dynamic languages, Pittsburgh, PA, USA, ACM.
is APA).
Is there any solution, to let biblatex and biber behave exactly like apalike
?