[Tex/LaTex] How to configure Table of contents itself

fancyhdrtable of contents

The aim is to manually configure the page(s) the TOC itself.
The font size of TOC name.
Also I need to configure pagestyle of this(these) page(s)

The components by using \titlecontents I've already did.
The next code in .cls doesnt't works

\renewcommand\tableofcontents{\newpage \fontsize{16}{16}
                               \thispagestyle{fancy}
                             }

Similar declaration for chapters works perfectly

\renewcommand\chapter{\newpage
                    \thispagestyle{fancy}%
                    \global\@topnum 0 %
                    \@afterindenttrue% 
                    \secdef{\@chapter}{\@schapter}}

Best Answer

You can use the tocloft package to easily do this; redefining \cfttoctitlefont you can change the font attributes for the title, and using \tocloftpagestyle{<style>} you select the page style. A simple example with some settings just for the example:

\documentclass{report}
\usepackage{tocloft}
\usepackage{fancyhdr}
\pagestyle{fancy}

\fancyhf{}
\fancyhead[C]{Center}
\fancyfoot[C]{\thepage}

\renewcommand\cfttoctitlefont{\fontsize{12}{15}\selectfont\bfseries}
\tocloftpagestyle{fancy}

\begin{document}

\tableofcontents
\section{test section}

\end{document}