## LaTeX forum ⇒ Page Layout ⇒ Moving page number to top center

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
mexiscool
Posts: 2
Joined: Wed Feb 20, 2019 10:02 pm

### Moving page number to top center

Hi, I'm new to LaTeX and my university gave me an example latex document (https://www.overleaf.com/read/hqkwvxsvynxg). However, their guidelines state that all page numbers (Arabic and roman) should be at the top, I tried several things including fancyhdr but I was only partially successful. I would like some help.

Stefan Kottwitz
Posts: 9513
Joined: Mon Mar 10, 2008 9:44 pm
Welcome to the forum!

This is a common way with `fancyhdr`:

`\usepackage{fancyhdr}\fancyhf{}\fancyhead[C]{\thepage}\renewcommand{\headrulewidth}{0pt}\pagestyle{fancy}`

Put that code into `preamble.tex`. And I would remove this line in `preamble.tex`:

`\usepackage{fullpage}`

That's because that package is not recommendable and kind of clashes with `geometry` and would cause the header line to overlap with text or headings.

Stefan

mexiscool
Posts: 2
Joined: Wed Feb 20, 2019 10:02 pm
Thank you it worked and it looks beautiful.
For any other that have the same issue that is new to LaTeX, I want to add that to get the table of contents page number also on top you can add
`\tocloftpagestyle{fancy}`
`\tableofcontents`