I tried the following which seems to work in the MWE. I don't know what will happen in an other document.
\documentclass[12pt,oneside]{book}
\usepackage[super,sort&compress]{natbib}
\bibpunct{[}{]}{,}{s}{}{}
\bibliographystyle{unsrtnat}
\usepackage{hyperref}
\usepackage[demo]{graphicx}
\usepackage{lipsum}
\usepackage{filecontents}
\usepackage{caption}
\begin{filecontents}{\jobname.bib}
@incollection{Baauw2001,
Address = {Somerville, MA},
Author = {Sergio Baauw},
Booktitle = {Proceedings of the 25th Annual Boston University Conference on Language Development},
Editor = {A. H.-J. Do and L. Dom{\'\i}nguez and A. Johansen},
Pages = {82-93},
Publisher = {Cascadilla Press},
Title = {Expletive determiners in child Dutch and Spanish},
Year = {2001}}
@article{barker1998,
Author = {Chris Barker},
Journal = {Natural Language \& Linguistic Theory},
Pages = {679-717},
Title = {Partitives, Double Genitives and Anti-Uniqueness},
Volume = {16},
Year = {1998}}
@book{Berwick1985,
Address = {Cambridge, MA},
Author = {Berwick, Robert C.},
Publisher = {MIT Press},
Title = {Acquisition of syntactic knowledge},
Year = {1985}}
@phdthesis{Carlson1977,
Author = {Carlson, Gregory N.},
School = {University of Massachusetts, Amherst},
Title = {Reference to Kinds in {E}nglish},
Year = {1977}}
\end{filecontents}
\makeatletter
\renewcommand\NAT@sort@cites[1]{%
\let\NAT@cite@list\@empty
\@for\@citeb:=#1\do{\expandafter\NAT@star@cite\@citeb\@@}%
\if@filesw
\expandafter\write\expandafter\@auxout
\expandafter{\expandafter\string\expandafter\citation\expandafter{\NAT@cite@list}}%
\fi
\@ifnum{\NAT@sort>\z@}{%
\expandafter\NAT@sort@cites@\expandafter{\NAT@cite@list}%
}{}%
}%
\makeatother
\begin{document}
\listoffigures
\chapter{A chapter}
\lipsum
Some text.\cite{Carlson1977}
\lipsum[3]
\cite{Barker1998,Baauw2001}
\begin{figure}[tbp]
\centering
\includegraphics[width=.5\textwidth]{demo.jpg}
\caption[A figure from]{A figure from \cite{Berwick1985}}
\end{figure}
\lipsum[2]
\bibliography{\jobname}
\end{document}
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:
Best Answer
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
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 variantieeetranS
that sorts citations by default. These styles seem to be newer. May be you should consider using those instead.