BibTeX, biblatex and biberReferences Numbering in Order of Appearance

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
astronut
Posts: 2
Joined: Tue Dec 10, 2013 4:43 am

References Numbering in Order of Appearance

Post by astronut »

Hello,

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" :shock: Some additional information: I don't want to use bibtex because the references need to be in a style that is not supported, so I manually wrote them as needed. I wouldn't want to rewrite them in bibtex format, since I have so many of them. Also, I hope I'm posting this in the right section ... if not, my apologies!

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 gives:

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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

References Numbering in Order of Appearance

Post by josephwright »

You are using both a \bibliographystyle line and 'hard-coded' bibliography. If you want easy control of sorting, using BibTeX is much easier, so means removing the hard-coded lines.
Joseph Wright
astronut
Posts: 2
Joined: Tue Dec 10, 2013 4:43 am

References Numbering in Order of Appearance

Post by astronut »

Hi josephwright,

Thanks for your reply. I need my references to be in the Council of Science Editors (CSE) style, which doesn't appear to be supported by BibTeX. So, I've manually entered all the references, in that style. Since that was a lot of work, I'd like to be able to keep them like that. Is it not possible to change the ordering if I do it like this?
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

References Numbering in Order of Appearance

Post by josephwright »

If you are inserting the bibliography by hand then ordering is down to you. Order the \bibitem lines as you want them to be numbered (presumably the order the citations appear in the document).
Joseph Wright
Post Reply