[Tex/LaTex] Page number top left on all pages

page-numbering

I want to put the page number on the left corner of the pages. I've already achieved it using fancyhdr:

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear all header and footers
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\lfoot{\thepage}

The problem is that the first page remains with the page number on center. Can anyone solve this? Thanks in advance.

Best Answer

Please always provide a minimal example which can be used to reproduce the issue. You can always edit your question to include further information. Code pasted in comments is essentially unreadable by human beings.

The reason the problem doesn't show up in a minimal completion of your fragment is the lack of any document element which triggers the plain page style. In article this is activated by \maketitle. In other classes it may be triggered by other commands such as \chapter.

To change the page number on plain pages, just read the fancyhdr documentation and redefine the plain style with the commands it provides.

\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % clear all header and footers
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\lfoot{\thepage}
\fancypagestyle{plain}{%
  \fancyhf{}%
  \fancyhf[lf]{\thepage}%
}
\usepackage{kantlipsum}
\author{me}
\title{this}
\begin{document}
\maketitle
\kant[1-10]
\end{document}

bottom left numbering on <code>plain</code> plage

Related Question