1

For the same author, I want a reference like Doe (1990; 1997) rather than Doe (1990) and Doe (1997), and I want (Doe 1990; 1997) rather than (Doe 1990; Doe 1997).

In other words, my question is very close to this question but I am using biblatex, not natbib.

Is there a straightforward, simple way to do this? Apologies if I am overlooking something.

Here is the MWE:

\documentclass{standalone}
\usepackage[applemac]{inputenc}
\usepackage[backend=biber,style=authoryear,giveninits]{biblatex}
\bibliography{Literature}
\begin{document}

I get \textcite{Doe1996,Doe1990}" but I wantDoe (1990; 1997)". I get \autocite{Doe1996,Doe1990}" but I want(Doe 1990; 1997)" \end{document}

moewe
  • 175,683
NCH32
  • 188
  • 2
    style=authoryear-comp should give you the desired result. From the biblatex documentation: "A compact variant of the authoryearstyle which prints the author only once if subsequent references passed to a single citation command share the same author. ". See also: Biblatex - Combine Papers using citet for a similar question. – leandriis Jul 20 '20 at 08:11
  • This does not work (result unchanged). I am puzzled. It should!? Playing with csquotes, giveninits etc. does seem to not make a difference.

    When I add \addbibresource{biblatex-examples.bib} and \textcite{knuth:ct:a,knuth:ct:b} to my MWE above, I get ``Knuth (1984, 1986)" as desired but the other references remain the same.

    – NCH32 Jul 20 '20 at 11:55
  • 1
    Please prepare a complete and compilable minimal working example with bibliography (MWEB) that contains two sample entries with which you get the desired compressed output and two entries for which the compression deso nt work as expected. Probably the issue is hidden in the entry in the .bib file. – leandriis Jul 20 '20 at 12:17
  • 2
    style=authoryear-comp, as suggested by leandriis should get you pretty far. The only difference is that it uses a comma to separate years and not a semicolon, but that could be changed if desired. If you don't get 'compact' citations despite using style=authoryear-comp,, you need to show us a compilable example complete with .bib entries (you can use biblatex-examples.bib and the two entries knuth:ct:a and knuth:ct:b). The following works for me https://gist.github.com/moewew/4f45ab210f29494406b7b08848d817a1 – moewe Jul 20 '20 at 14:41
  • I am having troubles creating the MWEB (see my question there: https://tex.meta.stackexchange.com/q/4407). filecontents does not seem to work with more than one bib entry for me. – NCH32 Jul 24 '20 at 15:05
  • 1
    By default filecontents will not overwrite an existing file. This is a problem when your are experimenting and adding entries one by one. Of course you could always remove the automatically generated .bib file when you add a new entry, but that is cumbersome. There are ways to allow filecontents to overwrite existing files. In a current LaTeX version write \begin{filecontents}[force]{\jobname.bib} instead of \begin{filecontents}{\jobname.bib} to allow overwriting. In an older LaTeX version load \usepackage{filecontents}. – moewe Jul 24 '20 at 19:36
  • @moewe: Terrific!!! Thanks! – NCH32 Jul 25 '20 at 06:56
  • 1
    Great! Looking forward to the MWE. – moewe Jul 25 '20 at 07:15
  • I solved it! It turns out that Doe, Terence and Doe, Terry are treated as nonidentical people, which seems legit. Renaming one of them yields the desired result. – NCH32 Jul 25 '20 at 07:42
  • 1
    Ahh, the classic uniquename option. If you want to stick with the original names as they are on the publication, you may be interested https://tex.stackexchange.com/q/134535/35864. – moewe Jul 25 '20 at 07:46
  • Since this question is now basically two issues in one (which style and something about uniquename) it probably isn't that useful to close the question as a duplicate. So I suggest you either ask leandriis to turn their comments into an answer (with an added note about uniquename) or you write a self-answer so this can be wrapped up. – moewe Jul 25 '20 at 07:51
  • 1
    Dear moewe and @leandriis, would either of you like to post the answer? Otherwise I am happy to do so. Thanks again for helping me solve this issue. – NCH32 Jul 25 '20 at 08:02

1 Answers1

2

Switching the style from style=authoryear to style=authoryear-comp should result in an output quite close to the desired one.

From the biblatex documentation: "A compact variant of the authoryearstyle which prints the author only once if subsequent references passed to a single citation command share the same author ".

See also: Biblatex - Combine Papers using citet for a similar question.


By default, the separator between subsequent years is a comma, while your example shows a semicolon instead. If you want to change the output accordingly, you could redefine \compcitedelim according to your needs:

\renewcommand*{\compcitedelim}{\addsemicolon\space}

If a single person published using two different versions of their first name, the compression might not work as expected since the author is treated as two different authors who share their last name. To turn off this behaviour without having to alter (homogenize) the first names in the bib file, you can use the package option uniquename = false.

See also: biblatex, authoryear style: In-text citations display first name initials for certain bibliography entries for a related question.

NCH32
  • 188
leandriis
  • 62,593