0

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}

%adjust your page margins here
\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
bookmarks,  colorlinks=false]{hyperref} %for creating links in the pdf version and other additional pdf attributes, no effect on the printed document
\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}

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

\pagestyle{fancy}

\fancyfoot[L]{\emph{Hardware RISC-V Processor Learning Tool and Online SoC Training Platform}}
\cfoot{}
\rhead{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\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
\loadglsentries{project/glossaries}

%GLOBAL SETTINGS OVER, DOCUMENT BEGINS
\begin{document}
\renewcommand\bibname{References}
\lhead{}
%FROM HERE YOUR PAGES START GETTING ADDED
% includes the cover page
\input{project/cover.tex}
\newpage
% includes the title page
\input{project/title.tex}
\newpage

%TABLE OF CONTENTS AND LIST OF FIGURES ARE AUTOMATICALLY ADDED BY FOLLOWING COMMANDS
%ADD FIGURE OF TABLES IF YOU NEED TO, CHECK DOCUMENTATION
\doublespacing
\pagestyle{fancy}
\pagenumbering{roman}

% includes the acknowledgements page
\clearpage
\input{project/acknowledgements.tex} 
\addcontentsline{toc}{chapter}{\numberline{}Acknowledgements}%
\newpage

\clearpage
\input{project/abstract.tex} % adds the Research Methodology page
\addcontentsline{toc}{chapter}{\numberline{}Abstract}
\newpage

%To reset the Header & Footer for TOC and LOF
\clearpage
\tableofcontents % adds Index Page
\newpage

 % adds the glossaries page
\addcontentsline{toc}{chapter}{\numberline{}Glossary}%
\printglossary
\newpage

\addcontentsline{toc}{chapter}{\numberline{}\listfigurename}%
\listoffigures % adds List of Figures
\cleardoublepage

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

\clearpage
\pagenumbering{arabic} %reset numbering to normal for the main content

\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: Latex Output

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.