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.
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.
\cites[p.~383]{key1}[p.~179]{key2}
. It might be obvious at second look, but I spent some time re-arranging my arguments :-)
\cites
?
Commented
May 19, 2017 at 4:29
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]
\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.
Commented
Apr 26, 2023 at 13:56