# Final Year Thesis - TOC offset by 1

Like most final year reports, an acknowledgements and abstract section is required before the TOC. Adding these sections into the TOC with roman numerals as the page numbers worked fine. However, in the TOC the page number is one more than it should be for all entries.

\documentclass[12pt,a4paper]{report}

\usepackage[top=0.70in, bottom=0.70in, left=1in,right=0.80in]{geometry} % setting the page alignment with this package
\usepackage[pdftex]{graphicx} %for embedding images
\usepackage[%dvips, % commented for pdflatex
\hypersetup{%
pdfborder = {0 0 0}
}
\usepackage[final]{pdfpages} %for embedding another pdf, remove if not required
\usepackage{float} %used for figure placement with H as a parameter
\usepackage{hyperref}
\usepackage{pslatex} % for times new roman, old package, but works
\usepackage{array} % for making text bold in table
\usepackage{setspace}
\usepackage{float}
\usepackage{enumerate}
\usepackage{longtable}
\usepackage{glossaries}
\usepackage[toc,page]{appendix}

\usepackage[font=small,labelfont=bf]{caption}
\def\figurename{\textbf{Figure }}

\usepackage{listings}
\usepackage{color}

\usepackage{fancyhdr}
\fancypagestyle{plain}{%
\fancyfoot[L]{\emph{Hardware RISC-V Processor Learning Tool and Online SoC Training Platform}} % except the center
\renewcommand{\footrulewidth}{0.4pt}
}

\pagestyle{fancy}

\fancyfoot[L]{\emph{Hardware RISC-V Processor Learning Tool and Online SoC Training Platform}}
\cfoot{}
\renewcommand{\footrulewidth}{0.4pt}
%For the header and footer Over

%Page Border
\usepackage{pgf}
\usepackage{pgfpages}

\pgfpagesdeclarelayout{boxed}
{
\edef\pgfpageoptionborder{0pt}
}
{
\pgfpagesphysicalpageoptions
{%
logical pages=1,%
}
\pgfpageslogicalpageoptions{1}
{
border code=\pgfsetlinewidth{2pt}\pgfstroke,%
border shrink=\pgfpageoptionborder,%
resized width=.95\pgfphysicalwidth,%
resized height=.95\pgfphysicalheight,%
center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
}%
}
\pgfpagesuselayout{boxed}
\setlength{\parindent}{1cm}

\makeglossaries

%GLOBAL SETTINGS OVER, DOCUMENT BEGINS
\begin{document}
\renewcommand\bibname{References}
% includes the cover page
\input{project/cover.tex}
\newpage
% includes the title page
\input{project/title.tex}
\newpage

%ADD FIGURE OF TABLES IF YOU NEED TO, CHECK DOCUMENTATION
\doublespacing
\pagestyle{fancy}
\pagenumbering{roman}

% includes the acknowledgements page
\clearpage
\input{project/acknowledgements.tex}
\newpage

\clearpage
\input{project/abstract.tex} % adds the Research Methodology page
\newpage

%To reset the Header & Footer for TOC and LOF
\clearpage
\newpage

\printglossary
\newpage

\listoffigures % adds List of Figures
\cleardoublepage

%And reset back the settings we choose for Header and Footer
\pagestyle{fancy}

\clearpage

\input{project/introduction.tex} % adds the introduction page
\input{project/background.tex} % adds the background page
\input{project/design.tex}
\input{project/learning.tex}
\input{project/health.tex}
\input{project/conclusion.tex} % adds the Scheduling and Planning page
\input{project/ref.tex} % adds the References page

\end{document}


The output is as follows:

My understanding is that the TOC is numbering differently to the actual document itself. But I don't understand how to manage the pages correctly.

• Just a guess: maybe remove the \clearpage befor the \pagenumbering{arabic}? – Marijn Mar 21 at 15:18
• Allmost all your \addcontentsline command are at the wrong place. They should be at the begin of the input files, not at the end. – Ulrike Fischer Mar 21 at 15:23
• I've removed the \clearpage before the \pagenumbering{arabic} and changed the order of the \addcontentsline but the numbering in the TOC is still the same. – Joseph Clancy Mar 21 at 16:42
• In the screenshot the List of Figures already has arabic numbering in the TOC. Is that also the case on the page of the LoF itself? It might be possible (although not very likely) that something in the Glossary or the LoF changes the numbering. Does the issue still occur if you remove either one or both from the document? – Marijn Mar 22 at 12:52