GeneralFixing displaced page numbers in footer

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Marei
Posts: 4
Joined: Tue May 29, 2007 2:01 pm

Fixing displaced page numbers in footer

Post by Marei »

I just switched from the plain pagestyle to fancyhdr and the fancy pagestyle. Now my page numbers are displaced, and I can't change them. If I use the \cfoot command (or \rfoot og \lfoot) I only obtain several page numbers. My page numbers are now -- apparently -- centered according to the page and not my text, which I placed a little to the left by changing the margins. What did I do wrong? Can I make the fancyhdr package only concentrate on my headers and not my footers so that my page numbers aren't touched? On the pages with a new chapter where latex switches to the plain pagestyle, my page numbers are correct, centered according to my text.

This is my preamble:

Code: Select all

\documentclass[a4paper,11pt,norsk]{report}
\pdfpagewidth 210mm
\pdfpageheight 297mm
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{lmodern}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{url}
\usepackage{epigraph}
\usepackage{setspace}
\doublespacing
\usepackage{graphicx}
\DeclareGraphicsExtensions{.eps}
\usepackage{rotating}
\usepackage{color}
\usepackage{fancyhdr}
\pagestyle{fancy}

\lhead{\nouppercase\leftmark}
\rhead{}

\renewcommand{\chaptermark}[1]{\markboth{\footnotesize{\chaptername\ \thechapter.\ #1}}{}}

\addtolength{\oddsidemargin}{-.25in}
\addtolength{\evensidemargin}{-.875in}
\addtolength{\textwidth}{1.125in}

\addtolength{\topmargin}{-.875in}
\addtolength{\textheight}{1.75in}

\pagenumbering{roman}

\tableofcontents

\pagenumbering{arabic}
Thanx!

Recommended reading 2024:

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

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

balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Page numbers problem

Post by balfonsi »

Maybe you should modify your margins by using the geometry package: all those lengths are more or less interdependent, and your modifications did not necessarily take everything into account. Geometry does all the computations for you.

Also look at fancyhdr's documentation to learn how to redefine the fancy page style.

Regards,
B.A.
Post Reply