0

I am using the following to insert page numbers in my footer:

\pagestyle{fancy}
    \fancyhf{} % clear all header and footer fields
    \fancyfoot{}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}

However, it is inserting them a little bit left-aligned and not in the perfect center of the page like this:

enter image description here

How do I align things properly?

4
  • 2
    \fancyfoot{C}{\thepage} should do it.
    – Bernard
    Commented Apr 20, 2020 at 20:21
  • Welcome to TeX - LaTeX! Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.`` Commented Apr 20, 2020 at 20:59
  • Did you change the page geometry after loading fancyhdr? Once created, fancyhdr never changes the width. You can however fake it using \makebox. Commented Apr 21, 2020 at 3:03
  • This question may be helpful: [geometry, fancyhdr: \fancyfoot[C]{\thepage} is not really centered](tex.stackexchange.com/q/33874) Commented Apr 21, 2020 at 16:32

0

You must log in to answer this question.

Browse other questions tagged .