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}
}
1
  • 2
    the option is \usepackage[sortcites]{biblatex}
    – MaxNoe
    Jun 8, 2015 at 18:54

2 Answers 2

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

1
  • Wow, very useful. Thank you! Aug 20, 2022 at 17:35
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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .