Search code examples
overleafbiblatex

Bibliographystyle {unsrt} fails to sort citations properly


I'm importing my references from Mendeley under 'references.bib'. I want to sort them to match the order in which the citations are used. Adding 'unsrt' as the bibliographystyle doesn't change anything however... Any tips on why this is the case? Here's the content of the .tex file:

\documentclass[whitelogo,table]{tu-report}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{amsmath}
\usepackage[sort&compress,numbers]{natbib}
\usepackage{changes}
\usepackage{float}
\usepackage{enumerate}
\usepackage{amsmath} 
\usepackage{amssymb} 
\usepackage{dirtytalk}
\usepackage{pdfpages}
\usepackage{multirow}
\usepackage{romannum}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\usepackage{todonotes}
\usepackage{longtable}
\usepackage{microtype}
\usepackage{wrapfig,lipsum,booktabs}
\usepackage{calc}  
\usepackage{etoolbox}
\usepackage{pdfpages}
\usepackage[toc,page]{appendix}
\usepackage{etoolbox}
\apptocmd{\sloppy}{\hbadness 10000\relax}{}{}

\usepackage[utf8]{inputenc}
\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{caption}
\usepackage[flushleft]{threeparttable}
\usepackage{outlines}
\interfootnotelinepenalty=10000 %% Completely prevent breaking of footnotes
\raggedbottom
\usepackage{rotating}
\usepackage{tikz}
\usepackage{hyperref}
\usepackage[toc, acronym, nonumberlist]{glossaries}
\makenoidxglossaries

\bibliographystyle{unsrt}

\input{001Acronyms}

\begin{document}

\input{_01title}
\input{_02preface}
\input{_03Abstract}
\tableofcontents
\printnoidxglossaries

\mainmatter
\input{01introduction}
\input{02materialsandmethods}
\input{03results}
\input{04discussion}
\input{05conclusion}

\appendix
\input{06appendix}


\bibliography{references}

\end{document}

Solution

  • Typically this is caused by having citations within figure or table captions. The bad numbering is caused by the fact that the first occurrence of the citations end up being in the list of figures or the list of tables, instead of where you are expecting them to occur.

    The solution is to provide a short optional caption to be used in the LOF or LOT that does not include the citation: \caption[My caption]{My caption \cite{foo}}.

    However, there's no way to know for sure if this is indeed the problem without a more complete example.

    See for example: https://tex.stackexchange.com/questions/552054/citation-order-is-corrupted-by-figures-and-tables