[Tex/LaTex] Latex TOC page number position all to top center

page-numberingtable of contentstocstyle

I have one problem with the page number in Table of Content.
My settings are:

\documentclass[12pt,a4paper]{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[C]{\thepage}
\pagestyle{fancy}

\begin{document}


\begingroup
%\hypersetup{hidelinks}
\cleardoublepage
  \pagestyle{fancy}
\clearpage\setcounter{page}{3}
\tableofcontents
 \cleardoublepage
\endgroup

\newpage
\addcontentsline{tableofcontents}{chapter}{\listfigurename}
\listoffigures
\newpage
\addcontentsline{tableofcontents}{chapter}{\listtablename}
\listoftables


\end{document}

But the page number in TOC and List of Figure and tables are like: odd page in the bottom center, and even page in top center. What I want is all page numbers in top center. Can anyone tell me what is wrong here, why it does not work. Thanks a lot.

Best Answer

This changes the plain page style globally (since this is applied by \tableofcontents etc.)

I additionally removed some strange grouping/unnecessary \clearpage commands and added \usepackage{tocbibind} for clean addition to ToC

\documentclass[a4paper,12pt]{report}
\usepackage{fancyhdr}
\usepackage[nottoc]{tocbibind}

\fancypagestyle{plain}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[C]{\thepage}
}

\usepackage{blindtext}

\begin{document}


\setcounter{page}{3}  %% Why??????
\tableofcontents
\listoffigures
\listoftables

\blinddocument


\end{document}

enter image description here enter image description here

Edit Dotted toc line for LoF and LoT -- I don't recommend this!!

\documentclass[a4paper,12pt]{report}
\usepackage{fancyhdr}
%\usepackage[nottoc]{tocbibind}  

\fancypagestyle{plain}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[C]{\thepage}
}

\usepackage{blindtext}

\makeatletter
\newcommand*\l@fakesection{\@dottedtocline{1}{0em}{2.3em}}
\makeatother

\usepackage{hyperref}


\begin{document}


\setcounter{page}{3}  %% Why??????
\tableofcontents

\clearpage
\phantomsection
\addcontentsline{toc}{fakesection}{\bfseries\listfigurename}
\listoffigures

\clearpage
\phantomsection
\addcontentsline{toc}{fakesection}{\bfseries\listtablename}
\listoftables

\clearpage
\pagestyle{fancy}
\blinddocument


\end{document}