LaTeX forum ⇒ BibTeX, biblatex and biberBibliography 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

Postby bulbanos » Wed May 27, 2009 10:32 am

Hey,

I'm using
  1. \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?

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Wed May 27, 2009 4:46 pm

Exactly this bibliography style should work as desired. Consider the following example.
  1. \begin{filecontents*}{xmpl.bib}
  2. @BOOK{knuth84,
  3. author={Donald Ervin Knuth},
  4. title={The \TeX book},
  5. year={1984},
  6. publisher={Addison-Wesley}
  7. }
  8. @BOOK{lamport94,
  9. author={Leslie Lamport},
  10. title={\LaTeX\ - A Document Preparation System},
  11. note={User's Guide and Reference Manual},
  12. year={1994},
  13. publisher={Addison-Wesley},
  14. edition={Second}
  15. }
  16. \end{filecontents*}
  17. \documentclass[11pt,a4paper]{article}
  18. \usepackage[T1]{fontenc}
  19. \usepackage[latin1]{inputenc}
  20. \usepackage[includeheadfoot,margin=2cm]{geometry}
  21. \usepackage{lmodern}
  22.  
  23. \begin{document}
  24. \LaTeX\ was done by L.\ Lamport~\cite{lamport94}. \TeX\ has been programmed by Donald E.\ Knuth~\cite{knuth84}.
  25.  
  26. \bibliographystyle{unsrt}
  27. \bibliography{xmpl}
  28. \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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ 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

Postby flip1995 » Fri Feb 14, 2020 2:16 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:

I had

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \usepackage[citestyle=numeric,style=numeric,backend=bibtex,sorting=none]{biblatex}
  2. \nocite{*}
  3. ...
  4. \cite{..}
  5. \cite{..}
  6. ...
  7. \backmatter
  8. \printbibliography[heading=bibintoc]


in my document. The
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \nocite{*}
command already counted as a citation to some of the references and therefore the sorting was weird.

Moving the
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \nocite{*}
down solved this problem:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \backmatter
  2. \nocite{*}
  3. \printbibliography[heading=bibintoc]


Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 6 guests