## LaTeX forum ⇒ Page Layout ⇒ Page Numbers lost Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
math8
Posts: 9
Joined: Fri Oct 05, 2012 11:19 pm

### Page Numbers lost

For some reason, my document is no longer showing page numbers (it used to). I have no idea what happened. Here is my header:

And I am compiling using PDFLaTeX. Any idea on how to get LaTeX to show the page numbers again?

Tags:

Stefan Kottwitz
Posts: 9513
Joined: Mon Mar 10, 2008 9:44 pm
It's ver good that you posted a complete compilable example. Next time just try to remove non-relevant packages. Otherwise we would have to install all used packages just for testing, and it makes the problem unnecessary long. If you are not sure, remove a package, test if the problem persists, repeat.

The problem here is caused by your manual margin changes. Remove \addtolength{\textheight}{6.2 cm} to see that the page numbers would return. Better use the geometry package for setting the margins, it takes care that mistakes don't happen so easily.

Stefan

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Please always check your examples for minimal content to give an adequate problem description. Nearly all the packages that you are loading are absolutely superfluous to reproduce the problem (except for lipsum to create the dummy text).

Regarding the problem, let's have a look at the lines 19 and 20 of your sample code.
\addtolength{\hoffset}{-2cm} \addtolength{\topmargin}{-2.8cm}\addtolength{\textwidth}{3 cm} \addtolength{\textheight}{6.2 cm}

Setting the page dimensions in this way is an absolute taboo. For an appropriate type area use the geometry package.

For details please refer to the package manual.

Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

math8
Posts: 9
Joined: Fri Oct 05, 2012 11:19 pm
Thanks! It is working fine now