[Tex/LaTex] How to add Frontmatter pages to ToC

table of contents

I am writing my thesis and am trying to add the table of contents. The \tableofcontents provides all the contents of the chapters but I want to display the preliminary elements such as Title page and Abstract page. The code is given below:

%title page
\thispagestyle{plain}
\begin{center}
\begin{minipage}{0.8\linewidth}
\centering
%Thesis title
{\uppercase{\Large Title of thesis\par}}
\end{minipage}
\end{center}
%abstract page
\newpage
\thispagestyle{plain}
\begin{center}
\textbf{Abstract}
\end{center}
\tableofcontents
%\addcontentsline{toc}{chapter}{Title}
\listoffigures
\listoftables

I have tried to use addcontentsline but it outputs the contents page number as the title page number. I cannot seem to figure this out. Your help is appreciated.

Best Answer

A suggestion (omit the \phantomsection, if hyperref isn't needed)

Using the titlepage and abstract features is recommended.

\documentclass{report}

\usepackage{blindtext}
\usepackage{hyperref}

\newcommand{\mydoctitle}{Theory of Brontosaurs}
\title{\mydoctitle}

\begin{document}


%title page
\thispagestyle{plain}
\addcontentsline{toc}{chapter}{\mydoctitle}
\begin{center}
\begin{minipage}{0.8\linewidth}   % Why????
\centering
%Thesis title
{\Large \MakeUppercase{\mydoctitle}\par}
\end{minipage}
\end{center}
\thispagestyle{plain}
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{\abstractname}
\begin{center}
\textbf{\abstractname}
\end{center}
\blindtext
\clearpage
\tableofcontents
\listoffigures
\listoftables

\chapter{Introduction}
\blindtext

\end{document}

enter image description here