[Tex/LaTex] Page number resets on Table of Contents

page-numberingtable of contents

I am using Roman page numbering for the abstract / ToC / list of figures etc before the main body of my thesis. The number seems to reset at the table of contents page (i.e. back to the roman numeral 'i', even if the previous page is numbered 'iv'). Here's my code:

\documentclass[11pt,a4paper]{report}

\begin{document}

\title{This is the Title}
\author{Author}
\maketitle

\pagenumbering{roman}

\begin{abstract} 
\thispagestyle{plain}
Abstract goes here... \newpage
page 2
\end{abstract}

\tableofcontents
\thispagestyle{plain}

\clearpage
\pagenumbering{arabic}

\chapter{Chapter 1}
\section{Unhelpful content 1}
\section{Unhelpful content 2}

\end{document}

I have tried patching the \tableofcontents command using the following code in the preamble

\makeatletter
\xpatchcmd{\tableofcontents}{\pagenumbering{arabic}}{}{}{}
\makeatother

but to no avail. Can anyone tell me how I can stop the page number resetting? Thanks!

Best Answer

If you are depending on report and want to use the abstract environment, you will have to redefine that environment.

% arara: pdflatex
% arara: pdflatex

\documentclass[11pt,a4paper]{report}
\makeatletter
\renewenvironment{abstract}{%
    \if@twocolumn
    \section*{\abstractname}%
    \else
    \small
    \begin{center}%
        {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
    \end{center}%
    \quotation
    \fi}
{\if@twocolumn\else\endquotation\fi}
\makeatother

\begin{document}    
    \title{This is the Title}
    \author{Author}
    \maketitle  
    \pagenumbering{roman}   
    \begin{abstract} 
        \thispagestyle{plain}
        Abstract goes here... \newpage
        page 2
    \end{abstract}  
    \tableofcontents
    \clearpage
    \pagenumbering{arabic}  
    \chapter{Chapter 1}
    \section{Unhelpful content 1}
    \section{Unhelpful content 2}   
\end{document}

This will set the abstract to the top of the second page. Maybe it looks nicer to have the abstract on the first page. Use \documentclass[notitlepage]{report} then.