I have just started typesetting my PhD thesis. I am using the book
class. I have a parent file where I define style, chapter header styling, page numbering, etc., and I include every chapter using \include{}
. When compiled I have one single PDF file. However, I have a problem with page numbering on preliminary pages such as Abstract, List of Contents, List of Figures, etc. Page numbers restart on every preliminary page. Here is how my TeX file looks like
%Page number formatting for preliminary pages.
\fancypagestyle{preliminary}{
\fancyhf{}
\fancyfoot[C]{\thepage}
\pagenumbering{roman}
\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{\pagestyle{preliminary}}}
%Page number formatting for main matter.
\fancypagestyle{mainmatter}{
\fancyhf{}
\fancyfoot[C]{\thepage}
\pagenumbering{arabic}
\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{\pagestyle{mainmatter}}
\onehalfspacing
\newenvironment{abstract}{\chapter*{Abstract}}{}
\begin{document}
\pagestyle{preliminary}
\setcounter{page}{2}
\begin{abstract}...\end{abstract}
\tableofcontents
\listoffigures
\listoftables
\mainmatter
\pagestyle{mainmatter}
\include{chapter1}
\end{document}
Am I doing something wrong? I have a suspicion that pre-defined page number formatting at the very beginning is causing this but I am not sure. What do you guys think?
Best Answer
You define the two page styles
preliminary
andmainmatter
to be the same, except for the numbering (roman
in the former,arabic
in the latter). So, for now, the following setup is what you're after:Another common way of copying a page style into another is to use