# Latex TOC page number position all to top center

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

\documentclass[12pt,a4paper]{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\pagestyle{fancy}

\begin{document}

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

\newpage
\listoffigures
\newpage
\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.

• Welcome to TeX.SX! Please add \documentclass{yourclass} to your code. You can use tocbibind package for the addition to the toc and the ToC/LoF/Lot commands use an implicit \thispagestyle{plain} – user31729 Jul 2 '15 at 9:01

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{}
}

\usepackage{blindtext}

\begin{document}

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

\blinddocument

\end{document}


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{}
}

\usepackage{blindtext}

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

\usepackage{hyperref}

\begin{document}

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

\clearpage
\phantomsection
\listoffigures

\clearpage
\phantomsection
\listoftables

\clearpage
\pagestyle{fancy}
\blinddocument

\end{document}

• Thanks a lot Christian Hupfer ...This really works...you saved me from many days of working....thanks a lot – user2307344 Jul 2 '15 at 9:22
• @user2307344: If you want to keep the page headings for sections/chapters, we've to reenable them of course. Happy TeXing! – user31729 Jul 2 '15 at 9:25
• @ Christian Hupfer , in fact I need this for my whole document. I managed with other parts, the TOC is the only part left. now they are all solved , thanks again – user2307344 Jul 2 '15 at 9:29
• @ Christian Hupfer Do you know how can I add dot after List of Table and Figures? Also delete the first small contents ..it is not needed here. thanks – user2307344 Jul 2 '15 at 9:47
• @user2307344: Those are other questions. With dot you mean the dotted line? The ToC can be removed from ToC with the nottoc option -- see my edited answer – user31729 Jul 2 '15 at 10:24