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}
In my case I am using a Spanish Thesis. To use it I downloaded a sample thesis. Checking the documents in the sample I found one named ezspanish.bst. The rear thing is that I couldn't find where this bst was called.
So I change the name of my unsrt.bst to ezspanish.bst and now it is working fine.
Thanks for the comments.
Best Answer
This question is much easier than the other.
You can get the bibliography in order of appearance with
if not using
biblatex
, or with the optionsorting=none
tobiblatex
. Say that your main document issebastianmain.tex
. Compile it and runbibtex
(orbiber
).Don't load any package for the bibliography in the secondary document and say
where the bibliography should appear; or
if you don't want the bibliography to appear. In the secondary document you can use the same keys as in the main one.