[Tex/LaTex] Page numbering at the top centre

fancyhdrheader-footerpage-numbering

I'm trying to place page numbering at the top centre (as required by submission guidelines at my university).

It should be a very easy thing to do, but it seems impossible… I spent a day familiarising with fancyhdr package but it adds up way too many useless things on the header (title of the chapter, section, etc.)… whilst I just need the page numbering.

Can somebody illuminate me on this issue?


this below is the updated MWE (as suggested by cmhughes). At the moment page numbering is all centred in the header, except for TOC, LOF, LOT and the first page of each chapter. Here, page numbering does not appear at all. Thanks a lot for you help guys! much appreciated

\documentclass[12pt, a4paper]{report}

\linespread{1.6}

\usepackage{natbib}

\usepackage{geometry}

\geometry{includeheadfoot,
  headheight=14pt,
  left=4cm,
  right=2cm,
  top=2.5cm,
  bottom=2.5cm}

\usepackage{fancyhdr}

\fancyhf{}

\fancyhead[C]{\thepage}

\pagestyle{fancy}

\fancypagestyle{plain}

\fancyhf{} % clear all header and footer fields

\fancyhead[C]{\thepage}

\renewcommand{\headrulewidth}{0pt}

\begin{document}

\pagenumbering{gobble}

\title{}

\author{}

\date{}

\maketitle

\renewcommand{\abstractname}{}

\begin{abstract}

lipsum

\end{abstract}

\chapter*{Acknowledgments}

lipsum

\tableofcontents

\cleardoublepage

\pagenumbering{roman}

\listoffigures 

\addcontentsline{toc}{chapter}{List of figures}

\listoftables 

\addcontentsline{toc}{chapter}{List of tables}

\newpage

\pagenumbering{arabic}

\chapter{}

lipsum

\clearpage

\addcontentsline{toc}{chapter}{Bibliography}

\bibliographystyle{apsr}

\bibliography{biblio}

\end{document}

Best Answer

The following should do the trick

\fancyhf{}
\fancyhead[C]{\thepage}
\pagestyle{fancy}

but in the absence of a complete MWE, it's hard to tell :)

The command \fancyhf{} clears all current headers and footers, and the \fancyhead[C]{<stuff>} command puts a header in the center.

If you want it to apply to the pages with the lof, lot, and toc as well, then you can redefine the plain pagestyle as detailed in the documentation of the fancyhdr package

% redefine the plain pagestyle
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyhead[C]{\thepage} % except the center
}

For reference, the following is a complete MWE.

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

\fancyhf{}
\fancyhead[C]{\thepage}
\pagestyle{fancy}

% redefine the plain pagestyle
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyhead[C]{\thepage} % except the center
}

\begin{document}

\tableofcontents
\listoftables
\listoffigures
\chapter{}
\lipsum

\end{document}