[Tex/LaTex] Move page numbering to top left

page-numbering

I want the number of the page was at the top of the page and in the left corner. How do I achieve that?

Best Answer

Here's a solution that doesn't rely on a specialized package. It does assume, though, that either the article document class or one of the other "standard" document classes is in use. (Specifically, the document class in use has to provide, at a minimum, the macros \pagestyle and \ps@headings...) You need to insert the following code in the document's preamble:

\usepackage{etoolbox} % provides \patchcmd macro
\makeatletter % modify the "headings" page style
\patchcmd{\ps@headings}{{\slshape\rightmark}\hfil\thepage}{\thepage\hfil}{}{}
\makeatother
\pagestyle{headings}  % load the (re-defined) "headings" page style (default: "plain")