TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a document consisting of several pages of text and a series of full-page figures. Since the figures are larger than the normal text width, I've used the geometry package's \newgeometry command to change the margins on the pages they're on. So far, so good.

The problem arises when I try to give the document fancy headers and footers with the fancyhdr package. My fancy page styles (unlike LaTeX's default page styles) don't adjust to the \newgeometry: the header moves to respect the new left margin, but doesn't change its width to reach the right margin.

The following example should show what I mean. The first page, with a fancy page style but no \newgeometry is fine. The second page invokes \newgeometry and the fancy page style has not adjusted. The third page has the same \newgeometry but uses a non-fancy page style; note that the header in this case does extend all the way to the right margin.

    \lhead{Fancy page style}    \chead{}            \rhead{}
    \lfoot{}                    \cfoot{}            \rfoot{\thepage}


\newgeometry{left=1.5cm, right=1.5cm}


I've tried everything I can think of, including defining my fancy page style after the \newgeometry declaration, but the behaviour is still the same. Is there any way I can put fancy headers on a page with altered margins?

share|improve this question
up vote 13 down vote accepted

A fix is using \fancyhfoffset after \newgeometry, so the widths are recalculated, such as

\newgeometry{left=1.5cm, right=1.5cm}

After I added \fancyhfoffset[E,O]{0pt} to your code, both header and footer are adjusted to the new margin.

share|improve this answer
That worked like a charm. Thanks! – Ross Churchley Nov 7 '11 at 3:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.