3

I'm using biblatex-apa to format citations and reference list. I would like to change & separator to and when using parencite citation command, e.g.:

  • \parencite{ref1} --> (author and author, 2013)
  • \parencite{ref2} --> (author, author and author, 2014)

I already successfully re-declare delimiter in the reference list using the commands:

\AtBeginBibliography{\renewcommand*{\finalnamedelim}{%
    \ifthenelse{\value{listcount}>\maxprtauth}
      {}
      {\ifthenelse{\value{liststop}>2}
         {\finalandcomma\addspace{}and\space}
         {\addspace{}and\space}}}}

but have no idea how to change separator for citations. Any ideas or pointers would be greatly appreciated.

MWE:

\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage[babel]{csquotes}
\usepackage{filecontents}
\usepackage[backend=biber,style=apa,hyperref]{biblatex}
\DeclareLanguageMapping{american}{american-apa}

\begin{filecontents}{mybib.bib}
@article{ref1,
    author    = {Guyon, Isabelle and Elisseeff, Andr\'{e}},
    journal   = {The Journal of Machine Learning Research},
    pages     = {1157--1182},
    title     = {{An introduction to variable and feature selection}},
    volume    = {3},
    year      = {2003}
}
@book{ref2,
    author    = {Michel Goossens and Frank Mittelbach and Alexander Samarin},
    title     = {The LaTeX Companion},
    year      = {1993},
    publisher = {Addison-Wesley},
    address   = {Reading, Massachusetts}
}
\end{filecontents}

\addbibresource{mybib.bib}

\begin{document}
Lorem ipsum dolor sit amet \parencite{ref1}, consectetur adipiscing elit \parencite{ref2}.

\printbibliography
\end{document}
4
  • Is it only for \parencite citations or all citations? Also, an MWE would be greatly appreciated, so we can just try away our ideas for solutions, and don't have to set up a new document ourselves. Am I right in thinking you want "and" in citations and the bibliography as well?
    – moewe
    Sep 10, 2014 at 10:36
  • Actually, for all citations, but especially for \parencite command. I'm working on MWE.
    – Andrej
    Sep 10, 2014 at 10:43
  • OK, my point was that \parencite is not to be treated differently from the other cite commands.
    – moewe
    Sep 10, 2014 at 10:44
  • I posted the MWE.
    – Andrej
    Sep 10, 2014 at 10:51

1 Answer 1

3

Newer versions of biblatex/biblatex-apa have a more sophisticated delimiter mechanism. This solution won't work there any more, please see author separator with biblatex.

biblatex-apa changes the \finalnamedelim quite often, so the best solution seems to be to restore the wanted delimiter definition for each citation and at the beginning of the bibliography.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage[babel]{csquotes}
\usepackage[backend=biber,style=apa,hyperref]{biblatex}
\DeclareLanguageMapping{american}{american-apa}

\addbibresource{biblatex-examples.bib}

\DefineBibliographyExtras{english}{\renewcommand*{\finalandcomma}{}}

\AtEveryCitekey{%
  \renewcommand*{\finalnamedelim}{%
    \ifthenelse{\value{listcount}>\maxprtauth}
      {}
      {\ifthenelse{\value{liststop}>2}
         {\finalandcomma\addspace\bibstring{and}\space}
         {\addspace\bibstring{and}\space}}}}

\AtBeginBibliography{%
  \renewcommand*{\finalnamedelim}{%
    \ifthenelse{\value{listcount}>\maxprtauth}
      {}
      {\ifthenelse{\value{liststop}>2}
         {\finalandcomma\addspace\bibstring{and}\space}
         {\addspace\bibstring{and}\space}}}}

\begin{document}
Lorem ipsum dolor sit amet \parencite{companion}, consectetur adipiscing elit \parencite{baez/article}.

\printbibliography
\end{document}

enter image description here

4
  • Works like a charm.
    – Andrej
    Sep 10, 2014 at 11:08
  • Not working for me... I still get the ampersands. Compiled with pdflatex and using updated texlive 2018. Your code with the OP's references here: pastebin.com/yQvcbQAX
    – PatrickT
    Jul 5, 2018 at 20:39
  • @PatrickT biblatex has gotten a new context-sensitive delimiter interface in the meantime. Things work differently now. Maybe you should ask a new question about that.
    – moewe
    Jul 5, 2018 at 20:42
  • Oh I see, thanks moewe. Here is my question: tex.stackexchange.com/questions/439434/…
    – PatrickT
    Jul 5, 2018 at 21:29

You must log in to answer this question.

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