BibTeX, biblatex and biber ⇒ Sort Citations by Reference Number
Sort Citations by Reference Number
I'm just finalizing my thesis and have a minor design question. If I reference some papers multiple times in different combinations, I cannot keep track of their order in the bibliography. That means, some references will occur in the document like this [43,12,23,13,14]. Is there a way that the order is automatically adjusted to read [12,13,14,23,43], or even better [12-14,23,43]?
Thanks!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Sort Citations by Reference Number
Welcome to the LaTeX coummunity!
Please provide us with a

Regards
Sort Citations by Reference Number
since it includes a bibliography file, I made this example, explaining my problem at the same time:
Code: Select all
\documentclass{book}
\usepackage{filecontents}
\begin{filecontents}{bibfile.bib}
@article{Nobody01,
author = "Nobody A",
title = "My Article A",
journal="J1",
year = "2002"
}
@article{Nobody02,
author = "Nobody B",
title = "My Article B",
journal="J1",
year = "2001"
}
@article{Nobody03,
author = "Nobody C",
title = "My Article C",
journal="J1",
year = "2006"
}
\end{filecontents}
\begin{document}
First I introduce some citations from here \cite{Nobody01,Nobody02} and here \cite{Nobody03}. But then I just talk about \cite{Nobody03} and \cite{Nobody01}, not taking care of the order \cite{Nobody03,Nobody01}, which switches the order. Especially if I do this \cite{Nobody03,Nobody01,Nobody02}, it doesn't write [1-3]. In article the reordering works though! Maybe just in my bib-style or so?
\bibliographystyle{vancouver}
\bibliography{bibfile}
\end{document}
André
Sort Citations by Reference Number

You can add
Code: Select all
\usepackage[numbers,sort]{natbib}
Code: Select all
\usepackage[numbers,sort&compress]{natbib}
[1--3]
while the former gives [1, 2, 3]
.Code: Select all
\documentclass{book}
\usepackage[numbers,sort]{natbib}
\usepackage{filecontents}
\begin{filecontents}{bibfile.bib}
@article{Nobody01,
author = "Nobody A",
title = "My Article A",
journal="J1",
year = "2002"
}
@article{Nobody02,
author = "Nobody B",
title = "My Article B",
journal="J1",
year = "2001"
}
@article{Nobody03,
author = "Nobody C",
title = "My Article C",
journal="J1",
year = "2006"
}
\end{filecontents}
\begin{document}
First I introduce some citations from here \cite{Nobody01,Nobody02} and here
\cite{Nobody03}. But then I just talk about \cite{Nobody03} and
\cite{Nobody01}, not taking care of the order \cite{Nobody03,Nobody01}, which
switches the order. Especially if I do this \cite{Nobody03,Nobody01,Nobody02},
it doesn't write [1-3]. In article the reordering works though! Maybe just in
my bib-style or so?
\bibliographystyle{vancouver}
\bibliography{bibfile}
\end{document}
Re: Sort Citations by Reference Number
Thanks a lot Clemens!!!
André