78

How can I do multiple citations with page numbers using bibLaTeX/biber?

I have tried \cite[2,3,4]{ref1,ref2,ref3,ref4} but it doesn't work.

Audrey
  • 28,881
SpmP
  • 1,201

2 Answers2

93

You can use the multicite version of \cite:

\cites{ref1}[2]{ref2}[3]{ref3}[4]{ref4}

This will roughly give the following output:

<label1>; <label2>, p. 2; <label3>, p. 3; <label4>, p. 4

In general \cites takes arguments of the form

\cites(<multipre>)(<multipost>)[<pre>][<post>]{key}[<pre>][<post>]{key}...

where the first two arguments (<multipre>)(<multipost>) serve as an "overall" pre- and post-notes and the remaining arguments can be repeated as necessary. Citations are printed in the order given with compressed citation labels depending on the style.

For further details refer to material on "qualified citation lists" in the biblatex manual.

Audrey
  • 28,881
  • 6
    No problem. About your search - I am not surprised. The pertinent sections in the manual unfortunately use the term "multicite" and never "multiple citations". – Audrey May 24 '11 at 03:02
  • 3
    cool, works also for \parencites 8) – ptikobj May 16 '13 at 17:29
  • 6
    Just to clarify, the case of OP is a bit special, for there is no prenote (e.g. like "p.~x" or "Thm.~Y") for his/her first entry. To get something like "[16, p. 383, 5, p. 179]" where 16 and 5 are two keys,one should use \cites[p.~383]{key1}[p.~179]{key2}. It might be obvious at second look, but I spent some time re-arranging my arguments :-) – Clément Jan 28 '15 at 23:48
  • 6
    I know this is an old thread, but what is the relevant package for \cites? – jamesh625 May 19 '17 at 04:29
  • 5
    @ jamesh625 biblatex package. – Hadi Safi aghdam Jun 14 '17 at 08:26
9

For those looking for the same feature, but in regular BibTex here's a working solution:

\usepackage{cite}
\makeatletter
\newcommand{\citecomment}[2][]{\citen{#2}#1\citevar}
\newcommand{\citeone}[1]{\citecomment{#1}}
\newcommand{\citetwo}[2][]{\citecomment[,~#1]{#2}}
\newcommand{\citevar}{\@ifnextchar\bgroup{;~\citeone}{\@ifnextchar[{;~\citetwo}{]}}}
\newcommand{\citefirst}{\@ifnextchar\bgroup{\citeone}{\@ifnextchar[{\citetwo}{]}}}
\newcommand{\cites}{[\citefirst}
\makeatother

Which you can use like this

\cites[p.1]{ref1}{ref2}[chap.3]{ref3}

to get an output similar to

[<label1>, p.1; <label2>; <label3>, chap.3]
  • 3
    Puuuh, somthing that works for me. Takes me around 2 hours to find it. but thank you! – user3352632 Sep 10 '21 at 11:43
  • 1
    This! Note that \citen will not update according to the citation style but always print the number. Thus, the solution will not work for similar problems like this one. Anyway, by replacing \citen with \citenum in the above code, the solution can be reused for natbib as well. – Christoph Thiede Apr 26 '23 at 13:56