11

I would like multiple citations to be sorted with respect to the order that they appear in the references, no matter the order in which I write them.

Please see the following MWE. It produces

First: [1,2] Second: [2,1]

whereas I would like it to produce:

First: [1,2] Second: [1,2]

with the same code.


main.tex

% main.tex
\documentclass[]{article}

\usepackage[
    hyperref=true,  
    backend=bibtex,
    firstinits=true,
    maxbibnames=99,
    ]{biblatex} 

\bibliography{references}
\begin{document}


First: \cite{first,second} 
Second: \cite{second,first} 

\end{document}

references.bib

% references.bib
@misc{first,
  title={Reference A}
  author={Alice}
  year={1980}
}

@misc{second,
  title={Reference B}
  author={Bob}
  year={2000}
}
geo909
  • 790

2 Answers2

16

By the way, you should use the more modern biber with biblatex!

The option you are looking for is named sortcites:

\documentclass[]{article}

\begin{filecontents*}{references.bib}
@misc{first,
  title={Reference A},
  author={Alice},
  year={1980},
}

@misc{second,
  title={Reference B},
  author={Bob},
  year={2000},
}
\end{filecontents*}

\usepackage[
    sortcites,
    backend=biber,
    hyperref=true,
    firstinits=true,
    maxbibnames=99,
    ]{biblatex} 

\addbibresource{references.bib}
\begin{document}


First: \cite{first,second} 
Second: \cite{second,first}

\printbibliography

\end{document}

Result:result

MaxNoe
  • 6,136
0

The best solution for me was to use the sort option for natbib (see here).

The references.bib file:

@misc{first,
title={Reference A},
author={Alice},
year={1980}
}
@misc{second,
title={Reference B},
author={Bob},
year={2000}
}

And the main file should be:

\documentclass[]{article}

\usepackage[numbers,sort]{natbib}

\begin{document} First: \cite{first,second} Second: \cite{second,first} \bibliography{references} \bibliographystyle{plainnat} \end{document}