I am writing a thesis report and I am using bibtex to make the bibliography. The problem is that even if I get the references printed in the order as they are cited, I am not able to print the corresponding numbers on my bibliography chapter.
I am running latex,bibtex,latex,latex: I do not get any error, latex is printing my bibliography as a chapter at the end of my document and in the text the citations are numbered correctly, but the numbers do not appear next to the corresponding references in the bibliography chapter:
Any suggestions?
A MWE is the following:
.tex
%main file:
\documentclass[11pt,a4paper,oneside]{book}
\usepackage[section] {placeins}
\usepackage[pdftex]{graphicx}
\usepackage[margin=2.45cm]{geometry}
\usepackage{extramarks}
\usepackage{fancyhdr}
\setlength{\headheight}{21.5pt}
%%%%% HEADER AND FOOTERS
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
\renewcommand{\sectionmark}[1]{\markboth{\MakeUppercase{#1}}{}}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
%%%%% PACKAGES
\usepackage[sort,square,numbers]{natbib}
\usepackage{apalike}
\usepackage[english]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{dcolumn}
\usepackage{appendix}
\usepackage[neverdecrease]{paralist}
\usepackage{graphicx}
\usepackage{supertabular}
\usepackage{longtable}
\usepackage[nottoc]{tocbibind}
\usepackage{hyperref}
\usepackage{cleveref}
\providecommand{\e}[1]{\ensuremath{\cdot 10^{#1}}}
\usepackage{tabulary}
\usepackage{chngpage}
\usepackage{pdfpages}
\usepackage[Gray,squaren,thinqspace,thinspace]{SIunits}
\usepackage{eurosym}
\usepackage[figuresright]{rotating}
\usepackage{subfigure}
\usepackage{epstopdf}
\usepackage{float}
\usepackage{fancyvrb}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{mcode}
\usepackage{color}
\usepackage{url}
\newcommand{\hilight}[1]{\colorbox{yellow}{#1}}
\usepackage{appendix}
\usepackage{pdflscape}
\usepackage{bookmark}
\usepackage{rotating}
\usepackage{pdfpages}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{mcode}
\usepackage{xfrac}
\setlength{\parindent}{0pt}
\usepackage{booktabs}
\usepackage{tabularx}
\renewcommand{\aboverulesep}{0pt}
\renewcommand{\belowrulesep}{0pt}
\epstopdfsetup{outdir=./}
\usepackage{xfrac}
\usepackage{longtable}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{tocdepth}{3}
\begin{document}
%\include{Title}
\frontmatter
%\include{Abstract}
\tableofcontents
\listoffigures \addcontentsline{toc}{chapter}{List of Figures}
\listoftables \addcontentsline{toc}{chapter}{List of Tables}
\mainmatter
%\include{Introduction}
%\include{Objectives}
%\include{literature}
%\include{Results}
As a minimum, Gundlach \cite{designing-unmanned-aircraft} states that a typical UAV...
\backmatter
\bibliographystyle{ieeetr}
\bibliography{Main}
%\renewcommand{\thesection}{A.\arabic{section}}
\renewcommand{\thepage}{\arabic{chapter}.\arabic{page}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
An here the entry example from my .bib file:
@book{designing-unmanned-aircraft,
title="Designing Unmanned Aircraft Systems: A Comprehensive Approach",
author="Gundlach, Jay",
year="2012",
publisher="American Institute of Aeronautics and Astronautics",
}
Hope you can help me!
Best Answer
The preamble of your document loads not one but two LaTeX citation management packages:
natbib
andapalike
. You should load only one of them, but not both. Since you wish to create numeric-style citation call-outs, you should not be loading theapalike
package: it is (a) meant to be used together with theapalike
bibliography style and (b) designed to create authoryear-style citation callouts. Clearly, that's not the case here.By the way, the
apalike
citation management package and theapalike
bibliography style date back to the late 1980s. As such, they no longer represent up-to-date APA formatting requirements for bibliographies and citation call-outs. If your bibliography and the citation call-outs are supposed to conform to current (i.e., 6th ed.) APA guidelines, you should use theapacite
package and theapacite
bibliography style.Finally, you should really make an effort to clean up and simplify your preamble. Ten [10!] packages are loaded twice (two of them with conflicting options...), while other packages shouldn't be loaded to begin with (e.g.,
color
ifxcolor
is loaded). Still other packages, e.g,subfigure
, are just plain obsolete and deprecated -- and hence shouldn't be loaded either. If your preamble were lean and clean, I'm confident you would have noticed on your own that loadingapalike
(in addition tonatbib
) was the cause of the difficulty.