Are you supposed not to use biblatex as a package?
Otherwise I strongly advise you to do so, since it is quite easy to choose the sorting option of the bibliography, whatever the style of bibliography you are using.
This problem crops up all the time when you have citations in your captions, or probably less commonly in document division titles. By default, LaTeX uses the citations in the List of Figures, List of Tables, or Table of Contents as the "first" citation, since it occurs before the main body text.
Options to fix this include:
- Adding the
notoccite
package to your preamble.
- The
\ignorecitefornumbering
command as shown in Get BibTeX to ignore citation numbering in a figure caption does largely the same thing as notoccite.
- Modifying the offending captions to have the form
\caption[Caption without citation that appears in the List of Figures or Tables]{Caption with citation that appears with the figure or table itself}
If it were up to me, I'd go with option 1. Some editors or thesis committees may be happier with option 2. Example of option 1 (including natbib
for \citeauthor
command) follows:
\documentclass{article}
\usepackage[numbers]{natbib}
\usepackage{notoccite}
% If you have \cite commands in \section-like commands, or in \caption, the
% citation will also appear in the table of contents, or list of whatever.
% If you are also using an unsrt-like bibliography style, these citations
% will come at the very start of the bibliography, which is confusing. This
% package suppresses the effect.
\begin{filecontents}{\jobname.bib}
@misc{foo,
author = {Foo},
title = {Title of Foo},
}
@misc{bar,
author = {Bar},
title = {Title of Bar},
}
@misc{baz,
author = {Baz},
title = {Title of Baz},
}
\end{filecontents}
\begin{document}
\listoffigures
%\chapter{Introduction}
\section{The Beginning}
Here we cite \citeauthor{foo} \cite{foo}.
Now we cite \citeauthor{bar} \cite{bar}.
Finally, we cite \citeauthor{baz} \cite{baz}.
\begin{figure}[htbp]
\centering
\framebox[0.5\textwidth]{Here's a figure.}
\caption{Figure from \cite{bar}, which should most definitely \textbf{not}
be numbered [1] in the LoF}
\end{figure}
\bibliographystyle{unsrtnat}
\bibliography{\jobname}
\end{document}
Best Answer
Assuming you're using the
IEEEtran
bibliography style, there is a very simple method.Add
\nocite{*}
just after\begin{document}
and you will have all entries sorted according to their position in the.bib
file.MWE:
Output: