2

I am trying to cancel the pagenumber in content pages. I haved tried command \thispagestyle{empty},but it didn't work! Another way I have tried is as following, but there is always a '2' showing on the first content page,which annoys me so much! Could anyone help me with this problem?

\documentclass[12pt,a4paper,openany,twoside]{book}
\usepackage{fancyhdr}
\begin{document}  
\title{Functional Analysis}
\author{333}
\maketitle

\pagestyle{plain} 
\pagestyle{empty}
\tableofcontents
\newpage
\pagestyle{fancy}
\setcounter{page}{1}

\chapter{BalaBalaBala}  
\section{BalaBalaBala}      
\section{BalaBalaBala}      
\section{BalaBalaBala}  
\section{BalaBalaBala}  
\chapter{BalaBalaBala}  
\section{BalaBalaBala}  
\section{BalaBalaBala}  
\section{BalaBalaBala}  
\section{BalaBalaBala}  
\chapter{BalaBalaBala}  
\section{BalaBalaBala}
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}
\subsection{BalaBalaBala}   
\section{BalaBalaBala}  
\subsection{BalaBalaBala}   
\section{BalaBalaBala}  
\chapter{BalaBalaBala}
\section{BalaBalaBala}
\section{BalaBalaBala}
\section{BalaBalaBala}  
\section{BalaBalaBala}
\subsection{BalaBalaBala}
\subsection{BalaBalaBala}
\subsection{BalaBalaBala}
\section{BalaBalaBala}
\chapter{BalaBalaBala}
\section{BalaBalaBala}
\subsection{BalaBalaBala}
\subsection{BalaBalaBala}
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}
\section{BalaBalaBala}
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}   
\section{BalaBalaBala}
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}   
\section{BalaBalaBala}  
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}   
\subsection{BalaBalaBala}
\subsection{BalaBalaBala}
\subsection{BalaBalaBala}
\chapter{BalaBalaBala}
\section{BalaBalaBala}
\subsection{BalaBalaBala}
\section{BalaBalaBala}
\section{BalaBalaBala}
\section{BalaBalaBala}
\section{BalaBalaBala}
\chapter{BalaBalaBala}
\section{BalaBalaBala}
\end{document}

enter image description here

enter image description here

1

You could load the tocloft package and issue the directive \tocloftpagestyle{empty} in the preamble.

A full MWE (minimum working example):

\documentclass[12pt,a4paper,openany,twoside]{book}
\usepackage{fancyhdr}

\usepackage{tocloft}
\tocloftpagestyle{empty}

\begin{document}  
\frontmatter
\title{Functional Analysis}
\author{333}
\maketitle

\pagestyle{empty}
\tableofcontents

\mainmatter
\pagestyle{fancy}

\chapter{BalaBalaBala}  
\section{BalaBalaBala} 
...
\end{document}
2

You could use

\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}}

in the preamble.

Example:

\documentclass[12pt,a4paper,openany,twoside]{book}
\usepackage{fancyhdr}
\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}}

\usepackage{blindtext}% only for dummy text
\begin{document}
\frontmatter
\pagestyle{empty}
\title{Functional Analysis}
\author{333}
\maketitle
\tableofcontents
\mainmatter
\pagestyle{fancy}
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.