1

I am having a wee problem - I'm getting a numbered (with arabic 1) page after list of Tables before Chapter Introduction. No matter if I use oneside or openany book class. What's happening here?

\documentclass[a4paper,11pt,oneside]{book}

\usepackage{amsbsy}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{mathrsfs}
\usepackage{color}
\usepackage[hidelinks]{hyperref}
\usepackage{cite}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{enumitem}
\usepackage{epsfig}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{indentfirst}
\usepackage[strict]{changepage}
%\usepackage{matlab-prettifier}
\usepackage{listings}
\usepackage{color} %red, green, blue, yellow, cyan, magenta, black, white
\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
% Page Margins - Strath Requirement
\usepackage[left=4cm,right=2.5cm,top=2cm,bottom=4cm,includehead,includefoot,headheight=15pt]{geometry}
\newcommand{\specialcell}[2][c]{%
    \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
% Page Headers
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt} % optional
%\fancyhead[L]{\nouppercase{\leftmark} \hfill Section \nouppercase{\rightmark}}
\fancyhead[L]{\nouppercase{\leftmark}}
\cfoot{\thepage}
\pagestyle{fancy}

% Draft Watermark
%\usepackage[draft=true,allpages=true,fontfamily=cmr,angle=90,scale=0.1,mark={\fboxsep=35pt\fboxrule=0pt\relax\fbox{-- DRAFT -- \today~--}},xcoord=-80,ycoord=-20]{draftmark}


% Line Spacing
%\def\baselinestretch{1.5} 
\usepackage{setspace}
\setstretch{1.5}
\setcounter{tocdepth}{3}

% Place uni Logo on Title Page (this package modifies the "\maketitel" command.)
\usepackage{titling}
\pretitle{%
    \begin{flushright}
        \vspace{-9.5cm}
        %\includegraphics[width=5cm,natwidth=472,natheight=531]{logo} \\[7cm]
        \includegraphics[width=5cm]{logo} \\[6cm]
    \end{flushright}
    \begin{center}
        \LARGE
    }
    \posttitle{\end{center}}

\title{Title \\ PhD Thesis}
\author{Name
    \\ \small Institute of Photonics\\[-0.8ex]
    \small Physics\\[-0.8ex]
    \small Uni\\
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

    \maketitle


    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \frontmatter
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


    \chapter{Abstract}
    \input{abstract.tex}

    \chapter{Preface/Acknowledgements}
    I would like to acknowledge... 

    \tableofcontents

    \addcontentsline{toc}{chapter}{List of Figures}
    \listoffigures

    \addcontentsline{toc}{chapter}{List of Tables}
    \listoftables

\mainmatter
\chapter{Introduction}
\input{1_Introduction.tex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{ieeetr}
\bibliography{MyBibFile}

\end{document}
Luk
  • 23
  • You may also find the ToC references (to page numbers) for LoF and LoT are wrong. You need a \clearpage before each \addcontentsline. – Werner Oct 10 '19 at 16:30
  • I didn't check all of them - but I think the pages match the ones in ToC, LoF and LoT - at least some of them

    \clearpage did not work :(

    – Luk Oct 11 '19 at 17:38
  • You're loading hyperref much too early. Load it last unless something definitely needs to be loaded later (e.g. cleveref has to be later). – cfr Oct 11 '19 at 20:41

2 Answers2

1

I ran the code you posted in your question; it did not reproduce the problem. Please post a minimum working example that reproduces the problem.

Una
  • 189
  • You did it with the empty Chapter file ? So confused right now – Luk Oct 15 '19 at 15:48
  • I made a dummy file. Again, to help you we need you to make and post a minimum working example that demonstrates the problem. – Una Oct 16 '19 at 16:13
0

I suspect what is happening is you include lists of tables and figures after the TOC but don't yet have tables or figures. That was my case.

This (non) problem should fix itself. The same is true for wrong page numbers and other format issues due to the content not being there yet. Focus on content first.

That said, if your committee wants format correct from the start, like mine did, then use \clearpage or \newpage. Here is a snippet of my completed dissertation:

\frontmatter
\newpage                                      % hyperref
\pdfbookmark[0]{Table of contents}{toc}       % hyperref
\tableofcontents
\newpage                                      % hyperref
\pdfbookmark[0]{List of figures}{lof}         % hyperref
\listoffigures
\newpage                                      % hyperref
\pdfbookmark[0]{List of tables}{lot}          % hyperref
\listoftables

\include{ap.acks}
\include{ap.glos}

\mainmatter       % TOC entry command is in ch.intr
\pagestyle{headings}
\include{ch.intr} % introduction
Una
  • 189
  • How do you know? 1_Introduction.tex probably includes figures and tables. I'm confident this does not answer the question. – Werner Oct 10 '19 at 18:27
  • Experience. But your immediate solution may well be what is needed. I revised my answer. – Una Oct 10 '19 at 19:58
  • Note that there is a difference between using \include and \input. The former does insert a page break, while the latter inserts the file content in-place. The OP uses the latter, so it's all dependent on what is in 1_Introduction.tex. – Werner Oct 10 '19 at 19:59
  • That's right, and also a tangent, because Luk's problem is between the TOC and the first \chapter. No \input or \include there.

    (I use \include because \chapter{} is in my included file. In Luk's case \input{} is needed after \chapter{} to keep the chapter heading and initial paragraphs together on one page.)

    – Una Oct 10 '19 at 20:09
  • I have my document ready - all of the Figures tables and such are in the included documents. It's all in and ready :) - I omitted other chapters in this example, because I didn't think it was important here. I'll try to use clearpage and all that jazz. If anyone comes up with something lemme know thank you ! – Luk Oct 11 '19 at 17:36
  • 1
    @Luk: Here's the thing. We cannot determine what the problem is with the current code. So you'll have to be more forthcoming with details. – Werner Oct 11 '19 at 17:40
  • So the input files like Introduction just starts with a \label{labelforIntro} followed by the \section{} and text. All my input files look like this.

    Ah yes - clearpage does not work. I put it before each addcontentsline

    – Luk Oct 11 '19 at 17:42