Page LayoutPage Numbers lost

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

Page Numbers lost

Post by math8 »

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

Code: Select all

\documentclass{article}
\usepackage[all]{xy}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amscd}
\usepackage{eucal}
%\usepackage[dvips]{epsfig}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{subfigure}
\usepackage{ulem}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{wrapfig}
\usepackage{lipsum}

\addtolength{\hoffset}{-2cm} \addtolength{\topmargin}{-2.8cm}
\addtolength{\textwidth}{3 cm} \addtolength{\textheight}{6.2 cm}

\newtheorem{thm}{Theorem}
\newtheorem{lem}{Lemma}
\newtheorem{prop}{Proposition}
\newtheorem{cor}{Corollary}
\newtheorem{defn}{Definition}

\newcommand\blfootnote[1]{%
  \begingroup
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \endgroup
}

\begin{document}
\lipsum
\end{document}
And I am compiling using PDFLaTeX. Any idea on how to get LaTeX to show the page numbers again?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Page Numbers lost

Post by Stefan Kottwitz »

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
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Page Numbers lost

Post by localghost »

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.

Code: Select all

\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.

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry{
  hmargin=3cm,
  vmargin=2cm,
  includeheadfoot
}
\usepackage{blindtext}

\newcommand\blfootnote[1]{%
  \begingroup
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \endgroup
}

\begin{document}
  \Blinddocument
\end{document}
For details please refer to the package manual.


Thorsten
math8
Posts: 9
Joined: Fri Oct 05, 2012 11:19 pm

Re: Page Numbers lost

Post by math8 »

Thanks! It is working fine now :)
Post Reply