LaTeX forum ⇒ Page LayoutPage 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

Postby math8 » Sun Mar 17, 2013 6:20 am

For some reason, my document is no longer showing page numbers (it used to). I have no idea what happened. Here is my header:
  1. \documentclass{article}
  2. \usepackage[all]{xy}
  3. \usepackage{amssymb}
  4. \usepackage{amsmath}
  5. \usepackage{amsfonts}
  6. \usepackage{amsthm}
  7. \usepackage{amscd}
  8. \usepackage{eucal}
  9. %\usepackage[dvips]{epsfig}
  10. \usepackage{graphicx}
  11. \usepackage{epstopdf}
  12. \usepackage{subfigure}
  13. \usepackage{ulem}
  14. \usepackage{algorithm}
  15. \usepackage{algorithmic}
  16. \usepackage{wrapfig}
  17. \usepackage{lipsum}
  18.  
  19. \addtolength{\hoffset}{-2cm} \addtolength{\topmargin}{-2.8cm}
  20. \addtolength{\textwidth}{3 cm} \addtolength{\textheight}{6.2 cm}
  21.  
  22. \newtheorem{thm}{Theorem}
  23. \newtheorem{lem}{Lemma}
  24. \newtheorem{prop}{Proposition}
  25. \newtheorem{cor}{Corollary}
  26. \newtheorem{defn}{Definition}
  27.  
  28. \newcommand\blfootnote[1]{%
  29. \begingroup
  30. \renewcommand\thefootnote{}\footnote{#1}%
  31. \addtocounter{footnote}{-1}%
  32. \endgroup
  33. }
  34.  
  35. \begin{document}
  36. \lipsum
  37. \end{document}


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

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 9513
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Mar 17, 2013 11:25 am

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
Site admin

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sun Mar 17, 2013 11:27 am

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.
  1. \addtolength{\hoffset}{-2cm} \addtolength{\topmargin}{-2.8cm}
  2. \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.
  1. \documentclass{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{geometry}
  4. \geometry{
  5. hmargin=3cm,
  6. vmargin=2cm,
  7. includeheadfoot
  8. }
  9. \usepackage{blindtext}
  10.  
  11. \newcommand\blfootnote[1]{%
  12. \begingroup
  13. \renewcommand\thefootnote{}\footnote{#1}%
  14. \addtocounter{footnote}{-1}%
  15. \endgroup
  16. }
  17.  
  18. \begin{document}
  19. \Blinddocument
  20. \end{document}

For details please refer to the package manual.


Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ 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

Postby math8 » Sun Mar 17, 2013 7:29 pm

Thanks! It is working fine now :)


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests