[Tex/LaTex] Citations in order of appearance

biblatexnatbib

I am currently writing my thesis and using the class file provided by my university. Everything is fine and compiles well except for the citations and references.

The default setting is order the references alphabetically, but I want them ordered numerically….that is in the order in which I cited the references.

I have tried using

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

and then

\begin{document}
\bibliographystyle{unsrtnat}
\bibfiles{chap1,chap2,chap3,chap4,chap5}
\bibpunct{[}{]}{,}{s}{}{} 

It does not work….I can see it modifying my references in some way. The first citation is [1] and then [2], but the third citation is [39]!

I also tried biblatex.

\pdfoptionpdfminorversion=6
\documentclass[12pt,hyperref]{gatech-thesis}
\usepackage{amsmath,amssymb,latexsym,float,epsfig,subfigure,textcomp}
\usepackage[style=numeric-comp]{biblatex}
\bibliography{chap1,chap2,chap3,chap4,chap5,chap6}
\usepackage[]{hyperref}

\begin{document}
\printbibliography

This one gives me a Latex error "Can only be used in preamble"….I tried reordering the location of the \usepackage[style=numeric-comp]{biblatex} command, but I still cannot get it to work.

But I did notice that a test file that I created to check biblatex (below) runs perfectly without any issues.

\documentclass{article}
\usepackage[style=numeric-comp]{biblatex}
\bibliography{examples}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

So, I am not sure I understand why it won't work with the original class file. I would appreciate your help.

I think this is further complicated by the fact that I have citations within Figure captions.

\caption{blah blah...\cite{xyz}}

This might also be responsible for the problem.

Best Answer

The following minimal example compiles correctly and produces the right reference number ordering. (Numbers begin at 1 and bibliography is in citation order rather than alphabetical.) If this works properly for you, then there is some other interaction with your document which will need some detective work to find out. If you have switched between biblatex and natbib in the course of figuring this out, make sure you delete all auxiliary files associated to your thesis and then try again.

\documentclass[hyperref]{gatech-thesis}
\usepackage[super,sort&compress]{natbib}
\usepackage{hyperref}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{Baauw2001,
    Address = {Somerville, MA},
    Author = {Sergio Baauw},
    Booktitle = {Proceedings of the 25th Annual Boston University Conference on Language Development},
    Editor = {A. H.-J. Do and L. Dom{\'\i}nguez and A. Johansen},
    Pages = {82-93},
    Publisher = {Cascadilla Press},
    Title = {Expletive determiners in child Dutch and Spanish},
    Year = {2001}}

@article{barker1998,
    Author = {Chris Barker},
    Journal = {Natural Language \& Linguistic Theory},
    Pages = {679-717},
    Title = {Partitives, Double Genitives and Anti-Uniqueness},
    Volume = {16},
    Year = {1998}}

@book{Berwick1985,
    Address = {Cambridge, MA},
    Author = {Berwick, Robert C.},
    Publisher = {MIT Press},
    Title = {Acquisition of syntactic knowledge},
    Year = {1985}}

@phdthesis{Carlson1977,
    Author = {Carlson, Gregory N.},
    School = {University of Massachusetts, Amherst},
    Title = {Reference to Kinds in {E}nglish},
    Year = {1977}}

\end{filecontents}

\begin{document}
\bibpunct{[}{]}{,}{s}{}{} 
\bibfiles{\jobname}


\bibliographystyle{unsrtnat}

\chapter{A chapter}
Some text.\cite{Carlson1977} Some text  \cite{Berwick1985} Some text \cite{Barker1998,Baauw2001}
\references
\end{document}

The gatech-thesis class is not designed to work with biblatex, and redefines the bibliography command to conform with the formatting requirements of your school. Although it might be possible to make it work with biblatex it would require quite a bit of modification.