0

I am using biblatex with style=authoryear and maxcitenames=2. For a reference with more than two authors \cite command produces

Erkus et al. 2010

and \textcite command produces

Erkus et al. (2010)

I would like to add a comma between et al. and the year only for the \cite command (but not for the \textcite command), i.e.,

Erkus et al., 2010

Erkus et al. (2010)

\renewcommand*{\nameyeardelim}{\addcomma\space}

Works only for single author references ( see this question), but does not work with the shorthand use of et al. for references with more than two authors. I do not want to use \DefineBibliographyStrings to redefine andothers and add comma after et al. since it also adds comma to \textcite citation, which I don't want.

I tried the following (see this question) but did not work:

\renewcommand*{\nameyeardelim}{%
     \ifnumgreater{\value{listcount}}{2}{\nameyeardelim}{\addcomma\space}%
     \ifnumequal{\value{listcount}}{1}{\nameyeardelim}{\addcomma\space}%
}
  • @moewe: Thanks very much for the responses. If the renew command is expected to work, maybe some other adjustment I did creates and issue. I have customized the bibliography and citation format a lot, so there is a possibility that I messed up smtg. I will look into this and post here the results. – berkus Aug 3 at 13:00
  • @Alex: natbib changes many of my customized bibliography settings. So maybe I should not use it. – berkus Aug 3 at 13:01
  • Since Alex and I haven't commented under this post we won't receive notifications for comments you write here, even if you use @<usrername>. Comment directly under our answers instead. That way you can make sure that we are pinged. – moewe Aug 4 at 10:35
  • Indeed I suspect that something else is going on at your end. Since \renewcommand*{\nameyeardelim}{\addcomma\space} should work (as I write in my answer, \DeclareDelimFormat{nameyeardelim}{\addcomma\space} would be preferred, but both work in essentially the same way). I guess the best thing would be to come up with an MWE (tex.meta.stackexchange.com/q/228/35864, tex.meta.stackexchange.com/q/4407/35864) that shows your current bibliography/citation setup. (Incompatibilities like this are the reason why we always like MWEs very much even if the question is simple.) – moewe Aug 4 at 10:38
1

You can achieve this by setting the natbib=true option in the \usepackage for biblatex.

MWE:

\begin{filecontents*}{database.bib}
@inproceedings{erkus_2010,
  title = {Title},
  booktitle = {Book Title},
  date = {2010},
  author = {Erkus, Firstname and Lastname, Firstname and Lastname Anotherfirstname}
}
\end{filecontents*}

\documentclass[]{article}

\usepackage{filecontents}

\usepackage[style=authoryear, maxcitenames=2, backend=biber, natbib=true] {biblatex}

\addbibresource{database.bib}

\begin{document}

Cite: \cite{erkus_2010}

Textcite: \textcite{erkus_2010}

\end{document}

Which produces:

Cite with comma between 'et al.' and year, and textcite without said comma.

0

\renewcommand*{\nameyeardelim}{\addcomma\space}should work for regardless of whether you cite one or more authors. In recent versions of biblatex nameyeardelim is a context-sensitive delimiter, which means you should use \DeclareDelimFormat to modify it

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, maxcitenames=2, backend=biber]{biblatex}

\DeclareDelimFormat{nameyeardelim}{\addcomma\space}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,aksin,herrmann,nussbaum}

\textcite{sigfridsson,aksin,herrmann,nussbaum}

\printbibliography
\end{document}

Sigfridsson and Ryde, 1998; Aksın et al., 2006; Herrmann et al., 2006; Nussbaum, 1978//Sigfridsson and Ryde (1998), Aksın et al. (2006), Herrmann et al. (2006) and Nussbaum (1978)

If you take a look at blx-natbib.def, you'll see that it uses exactly the same command as suggested here. That's why natbib=true (as suggested in Alex' answer) also produces the desired comma.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.