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!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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é