I have written a document in which I would like my references to be numbered by order of appearance in the text, and not by order in which they are listed in the bibliography file. However, I can't get this to work.
I've included an example of my code. If anyone knows where I'm going wrong, please let me know! This has been driving me mad. I have over 100 references and I really don't want to have to order them "by hand"

Code: Select all
\documentclass[titlepage,11pt]{article}
\pagestyle{headings}
\pagenumbering{arabic}
\usepackage{booktabs}
\usepackage{array}
\usepackage{longtable}
\usepackage{multirow}
\usepackage[english]{babel}
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{subfig,graphicx}
\usepackage{float}
\usepackage[round,numbers,comma,sort]{natbib}
\usepackage{notoccite}
\usepackage{pdfpages}
\usepackage[acronym, nonumberlist, toc]{glossaries}
\usepackage{wrapfig}
\usepackage{verbatim}
\usepackage{amsmath}
\usepackage{stfloats}
\renewcommand{\bibnumfmt}[1]{#1.}
\makeatletter
\def\tagform@#1{\maketag@@@{[#1]\@@italiccorr}}
\makeatother
\linespread{1.5}
\begin{document}
This is a Minimum Working Document (MWD) \cite{YourCustRef}. Or, a Minimum Working Example (MWE) \cite{HisCustRef, MyCustRef}.
\bibliographystyle{unsrtnat}
\begin{thebibliography}{999}
\bibitem {MyCustRef}My Custom Reference.
\bibitem {YourCustRef}Your Custom Reference.
\bibitem {HisCustRef}His Custom Reference.
\end{thebibliography}
\end{document}
This is a Minimum Working Document (MWD) (2). Or, a Minimum Working Example (MWE)
(1, 3).
References
1. My Custom Reference. 2. Your Custom Reference. 3. His Custom Reference.
Whereas, I would like:
This is a Minimum Working Document (MWD) (1). Or, a Minimum Working Example (MWE)
(2, 3).
References
1. My Custom Reference. 2. Your Custom Reference. 3. His Custom Reference.