22

I am using \bibliographystyle{ieeetr} to ensure citations are numbered by their appearance in the paper. With multiple citations however, the numbers can be out or order because of the order they appeared somewhere earlier in the paper:

\cite{paper1, paper2, paper3} ==> [5, 3, 10]

Is there a way to ensure that the numbers appear in order with multiple citations?

Andrew Swann
  • 95,762
Samaursa
  • 323

2 Answers2

23

This functionality is provided by the cite package. By default it will also compress lists of citations so [1,2,3] becomes [1-3], however a document stating with

\documentclass{article}

\usepackage[nocompress]{cite}
\bibliographystyle{ieeetr}

will produce the effect you wish. Sorting can be turned off by using the [nosort] option.

Incidentally, I notice that there are alternative bibliography styles for IEEE Transactions, called ieeetrans which include a variant ieeetranS that sorts citations by default. These styles seem to be newer. May be you should consider using those instead.

Andrew Swann
  • 95,762
  • Does not work with biblatex, but may not be necessary for biblatex. See https://tex.stackexchange.com/a/295138/99001 – Socowi Oct 07 '19 at 18:42
6

For anyone wondering how this works in biblatex, you need to specify sortcites=true option.

E.g. when loading the package:

\usepackage[sortcites=true]{biblatex}

For more details, see this question.

Iizuki
  • 161