2

I have LoF and LoT before my ToC. For some reason ToC present Chapter 1 before LoF, even though in the report it is the opposite. And the page number is wrong, the LoT in on iii, just after ToC.

\documentclass[10 pt, a4paper, leqno, oneside] {report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lscape}
\usepackage{caption}
\usepackage{subfig}
\usepackage[section]{placeins}
\usepackage{listings}
\usepackage{url}
\usepackage{longtable}
\usepackage{multirow}
%\usepackage{geometry}
\usepackage{graphicx}
%\usepackage[export]{adjustbox}
\usepackage[table]{xcolor}
\usepackage[swedish, english]{babel}
\usepackage[tmargin=1cm]{geometry}
%\usepackage{blindtext}

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% The title page %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \input{titlepage}
 \cleardoublepage \pagenumbering {roman}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The Abstract Page %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter*{Abstract} 
\addcontentsline{toc}{chapter}{Abstract} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TOC %%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tableofcontents{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% List of Tables %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\include{ListofTables} 
\addcontentsline{toc}{chapter}{List of Tables} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% List of Figures %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\include{ListofFigures} 
\addcontentsline{toc}{chapter}{List of Figures} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Chapters %%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{page}{1}
\cleardoublepage \pagenumbering{arabic}
\include{chapter1}  %Background
\include{chapter2}  %Theory
\include{chapter3}  %Results
\include{chapter4}  %Analysis and conclusions
\include{chapter5}  %Discussions

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bibliography %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
\bibliographystyle{unsrtnat} %{amsplain}
\bibliography{Bibliography}
\addcontentsline{toc}{chapter}{Bibliography}
\include{Bibliography}  %Bibliography

\end{document}

enter image description here

Orongo
  • 113

1 Answers1

2

I'm not sure about using \include in general; just in order to do \listoffigures it's certainly too much.

However, you solve all of your issues at once by removing those \addcontentsline commands (except the one for the abstract) and adding

\usepackage[nottoc]{tocbibind}

What's the problem with your approach? That if the list of figures occupies two pages, \addcontentsline will refer to the second page. Also the \include after the list of figures has a part in the issue. With tocbibind, that makes LaTeX perform the \addcontentsline commands (automatically) at the right time, the problem is solved.

egreg
  • 1,121,712
  • tocbibind is new, I will use that. I suppose that the list will automatically update as I add figures and tables to the report? – Orongo Nov 13 '15 at 20:22
  • Unfortunately with tocbibind, I still have page numbering issue for LoF. I t is technically on iv, but the numbering restart so it has i instead. – Orongo Nov 13 '15 at 20:24
  • @Orongo Not in my test. – egreg Nov 13 '15 at 20:45
  • Strange... I've changed my code accordingly – Orongo Nov 13 '15 at 21:34
  • \documentclass[10 pt, a4paper, leqno, oneside] {report} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lscape} \usepackage{caption} \usepackage{subfig} \usepackage[section]{placeins} \usepackage{listings} \usepackage{url} \usepackage{longtable} \usepackage{multirow} \usepackage{graphicx} \usepackage[table]{xcolor} \usepackage[swedish, english]{babel} \usepackage[tmargin=1cm]{geometry} \usepackage[nottoc]{tocbibind} – Orongo Nov 13 '15 at 21:37
  • \begin{document}

    \input{titlepage} \cleardoublepage \pagenumbering {roman}

    \chapter*{Abstract} \addcontentsline{toc}{chapter}{Abstract}

    \tableofcontents{} \listoftables \listoffigures

    \setcounter{page}{1} \cleardoublepage \pagenumbering{arabic} \include{chapter1} %Background

    \bibliographystyle{unsrtnat} \bibliography{Bibliography} \end{document}

    – Orongo Nov 13 '15 at 21:37
  • @Orongo Get rid of the \pagenumbering, it is not needed as you should habe read in How to use pagenumbering in the document? – Johannes_B Nov 14 '15 at 12:59