## LaTeX forum ⇒ BibTeX, biblatex and biber ⇒ Bibliography sort on appearance

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
bulbanos
Posts: 13
Joined: Fri Apr 24, 2009 10:25 pm

### Bibliography sort on appearance

Hey,

I'm using
\bibliographystyle{unsrt}
but I want my items to be sorted on their appearance in the text. Now it's displayed in the order it appears in my .bib file where I enter it manually. Is there a trick for that?

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Exactly this bibliography style should work as desired. Consider the following example.
\begin{filecontents*}{xmpl.bib}@BOOK{knuth84,   author={Donald Ervin Knuth},   title={The \TeX book},   year={1984},   publisher={Addison-Wesley}}@BOOK{lamport94,   author={Leslie Lamport},   title={\LaTeX\ - A Document Preparation System},   note={User's Guide and Reference Manual},   year={1994},   publisher={Addison-Wesley},   edition={Second}}\end{filecontents*}\documentclass[11pt,a4paper]{article}\usepackage[T1]{fontenc}\usepackage[latin1]{inputenc}\usepackage[includeheadfoot,margin=2cm]{geometry}\usepackage{lmodern} \begin{document}   \LaTeX\ was done by L.\ Lamport~\cite{lamport94}. \TeX\ has been programmed by Donald E.\ Knuth~\cite{knuth84}.    \bibliographystyle{unsrt}   \bibliography{xmpl}\end{document}

As you can see, references are sorted by appearance in the text. Show the effect you described by means of a minimal working example (MWE).

Best regards
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

flip1995
Posts: 1
Joined: Fri Feb 14, 2020 2:08 pm
Even though this thread is 11 years old, it appeared as the 3rd result in my google search for this problem.

My solution to this was pretty simple:

\usepackage[citestyle=numeric,style=numeric,backend=bibtex,sorting=none]{biblatex}\nocite{*}...\cite{..}\cite{..}...\backmatter\printbibliography[heading=bibintoc]

in my document. The
\nocite{*}
command already counted as a citation to some of the references and therefore the sorting was weird.

Moving the
\nocite{*}
\backmatter\nocite{*}\printbibliography[heading=bibintoc]