1

I know there are lots of similar questions, but I have problems with my particular code:

\documentclass[12pt]{report}
\usepackage[sorting=none,backend=bibtex]{biblatex}
\addbibresource{references2.bib}
\usepackage[nottoc]{tocbibind}
\nocite{*} 

\begin{document}

Hello \cite{a}. Goodbye \cite{b}.
\printbibliography

\end{document}

The references are sorted by order of appearance in the .bib file, and I want them to be sorted by order of citation in the text. What can I do? I tried \bibliographystyle{unsrt} but it gives me error. The only solution I see is manually ordering the .bib file.

  • 2
    Don't issue \nocite{*} in the preamble, only issue it directly before \printbibliography. – moewe Sep 8 at 12:17
  • Great, thanks a lot. – MBolin Sep 8 at 12:20
1

Make sure to issue \nocite{*} as late as possible, otherwise the \nocite'd entries take precedence (according to their order in the .bib file because sorting=none can consider no other properties and needs some way to break ties) over the entries that are explicitly cited in the document. (Hopefully https://github.com/plk/biblatex/commit/a988fa1e3bfabf4efac5bb9af6fed2b69f1e055f makes that a bit clearer in the documentation.)

\documentclass{article}
\usepackage[sorting=none, backend=bibtex]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{worman,
  author       = {Worman, Nancy},
  title        = {The Cast of Character},
  date         = 2002,
  publisher    = {University of Texas Press},
  location     = {Austin},
}
@book{nussbaum,
  author       = {Nussbaum, Martha},
  title        = {Aristotle's \mkbibquote{De Motu Animalium}},
  date         = 1978,
  publisher    = {Princeton University Press},
  location     = {Princeton},
}
@article{sigfridsson,
  author       = {Sigfridsson, Emma and Ryde, Ulf},
  title        = {Comparison of methods for deriving atomic charges from the
                  electrostatic potential and moments},
  journaltitle = {Journal of Computational Chemistry},
  date         = 1998,
  volume       = 19,
  number       = 4,
  pages        = {377-395},
  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
}
\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
Hello \cite{sigfridsson}.
Goodbye \cite{nussbaum}.

\printbibliography
\nocite{*}
\end{document}

Hello [1]. Goodbye [2].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.