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?

1 Answer 1


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.

  • Thank you so much. Oct 3, 2020 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .