[Tex/LaTex] natbib: combining chicago style and sorting by appearance

bibtexnatbibsorting

I would like my citations to be formatted according to the Chicago style, and at the same time numbered by order of appearance.

The sort&compress option does work as expected using unsrt bibliography style, with citations numbered by order of appearance. However, they get automatically sorted alphabetically as soon as I replace unsrt with chicago for the bibliography style:

\usepackage[numbers, sort&compress]{natbib}

... document...

\bibliographystyle{chicago}


\bibliography{main}

Is it possible to get citations styled according to chicago but sorted according to unsrt (that is, by order of appearance)?

Best Answer

Good news: You need to make only two small changes to the file chicago.bst to suppress the alphabetical sorting of the referenced items and, instead, to get them listed in the order they are first cited in the document.

  • Find the file chicago.bst in your TeX distribution and make a copy of this file. Name the copy, say, mychicago.bst. (Do not edit an original file of the TeX distribution directly.)

  • Open the file mychicago.bst in your favorite text editor; the editor you use to edit your TeX files will do fine.

  • Locate the two lines that start with SORT -- uppercase is important. In the copy of chicago.bst I found in my TeX distribution, the two lines in question are numbered 1565 and 1629.

  • Comment out these two lines, e.g., by inserting a % sign at the start of each of the two lines.

  • Save the file mychicago.bst, either to the directory that contains your main .tex file or to a directory that's searched by your TeX distribution. If you choose the latter method, be sure to update the TeX filename database in a way that's appropriate for your TeX distribution. If you don't understand the preceding sentence, you should probably go with the first option.

  • Start using the new bibliography style file by replacing the instruction \bibliographystyle{chicago} with \bibliographystyle{mychicago}.

  • As always after changing the bibliography style, be sure to run LaTeX, BibTeX, and LaTeX twice more on your document in order to fully propagate all changes.

The following example illustrates the effects of making use of the unsorted "chicago" style:

enter image description here

\documentclass{article}
\usepackage[numbers]{natbib}
\bibliographystyle{mychicago} % <-- new bib style is in use
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{aa,
  author = "A. Author",
  title  = "Thoughts",
  journal= "Various Communications",
  year   = 3001,
  volume = 1,
  issue  = 1,
  pages  = "1-10",
}
@article{bb,
  author = "B. Buthor",
  title  = "Further thoughts",
  journal= "Various Communications",
  year   = 3002,
  volume = 2,
  issue  = 1,
  pages  = "11-20",
}
@article{cc,
  author = "C. Cuthor",
  title  = "Still more thoughts",
  journal= "Various Communications",
  year   = 3003,
  volume = 3,
  issue  = 1,
  pages  = "21-30",
}
\end{filecontents*}
\begin{document}
\cite{cc}, \cite{bb}, \cite{aa}
\bibliography{\jobname}
\end{document}
Related Question