[Tex/LaTex] Change Page Size Mid-Document: Fancy Header and Footer Horizontal Width

fancyhdrpaper-size

When changing the paper size within a document, the fancyhdr package does not recognize the alteration of the layout width.

This page details how to change page size mid-document.
An answer has been given which uses \pdfpagewidth.
An answer has been given which uses \KOMAoptions.
Neither solves fancyhdr horizontal justification.

MWE

\documentclass{scrartcl}

\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{lipsum}

% Margin Settings:
\geometry{letterpaper}
\geometry{vmargin    = 0.50in,
          hmargin    = 0.50in,
          headheight = 0.50in,
          headsep    = 0.15in,
          footskip   = 0.60in}
\usepackage{showframe}


%Initialize headers and footers
\pagestyle{fancy}
\fancyhf{}                           % Clears out artifacts from default header
\fancyhead[C]{Header}
\fancyfoot[C]{Footer}
\fancyfoot[R]{ Page \thepage}        % Begin footer page number
\renewcommand{\headrulewidth}{0pt}   % Removes default horizontal line

\begin{document}
{\Huge \textbf{Original}}
\lipsum[1]

\clearpage
\newgeometry{layoutwidth  = 04.25in,
             layoutheight = 11.00in}
\pdfpagewidth  = 04.25in 
\pdfpageheight = 11.00in
\lipsum[1]

\clearpage
\newgeometry{layoutwidth  = 04.25in,
             layoutheight = 11.00in, 
             vmargin      = 00.50in, 
             hmargin      = 00.50in,
             headheight   = 00.50in,
             headsep      = 00.15in,
             footskip     = 00.60in}
\pdfpagewidth  = 04.25in 
\pdfpageheight = 11.00in
\lipsum[1]

\clearpage
\newgeometry{layoutwidth  = 11.00in,
             layoutheight = 04.25in,
             vmargin      = 00.50in, 
             hmargin      = 00.50in,
             headheight   = 00.50in,
             headsep      = 00.15in,
             footskip     = 00.60in}
\pdfpagewidth  = 11.00in 
\pdfpageheight = 04.25in
\lipsum[1]

\clearpage 
\newgeometry{layoutwidth  = 17.00in,
             layoutheight = 11.00in,
             vmargin      = 00.50in, 
             hmargin      = 00.50in,
             headheight   = 00.50in,
             headsep      = 00.15in,
             footskip     = 00.60in}
\pdfpagewidth  = 17.00in
\pdfpageheight = 11.00in
\lipsum[1]

\clearpage
\newgeometry{layoutwidth  = 08.50in,
             layoutheight = 11.00in,
             vmargin      = 00.50in, 
             hmargin      = 00.50in,
             headheight   = 00.50in,
             headsep      = 00.15in,
             footskip     = 00.60in}
\pdfpagewidth  = 08.50in 
\pdfpageheight = 11.00in
{\Huge \textbf{Original}}
\lipsum[1]

\clearpage 
\KOMAoptions{paper=17in:11in,pagesize}
\recalctypearea
\lipsum[1]

\clearpage 
\KOMAoptions{paper=17in:11in,pagesize}
\recalctypearea
\newgeometry{layoutwidth  = 17.00in,
             layoutheight = 11.00in,
             vmargin      = 00.50in, 
             hmargin      = 00.50in,
             headheight   = 00.50in,
             headsep      = 00.15in,
             footskip     = 00.60in}
\lipsum[1]

\end{document}

Also: Can a user create and append a mid-document tag?
I feel that some users receive preamble advice when seeking in-document advice.

Best Answer

I would replace fancyhdr and use the package that is developed to work with KOMA-classes (and standard classes), called scrlayer-scrpage. The package officially replaced the older scrpage2 last year. Currently, the author of KOMA-script adds functionality regularly, so a fairly up to date distribution is recommenden.

\documentclass{scrartcl}

\usepackage{geometry}
\usepackage{lipsum}

% Margin Settings:
\geometry{letterpaper}
\geometry{vmargin    = 0.50in,
    hmargin    = 0.50in,
    headheight = 0.50in,
    headsep    = 0.15in,
footskip   = 0.60in}
\usepackage{showframe}

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\chead{Header}
\cfoot{footer}
\ofoot{\pagemark}

\begin{document}
{\Huge \textbf{Original}}\par
\lipsum[1]

\clearpage
\newgeometry{layoutwidth  = 04.25in,
layoutheight = 11.00in}
\pdfpagewidth  = 04.25in 
\pdfpageheight = 11.00in
\lipsum[1]

\clearpage
\newgeometry{layoutwidth  = 04.25in,
    layoutheight = 11.00in, 
    vmargin      = 00.50in, 
    hmargin      = 00.50in,
    headheight   = 00.50in,
    headsep      = 00.15in,
footskip     = 00.60in}
\pdfpagewidth  = 04.25in 
\pdfpageheight = 11.00in
\lipsum[1]

\clearpage
\newgeometry{layoutwidth  = 11.00in,
    layoutheight = 04.25in,
    vmargin      = 00.50in, 
    hmargin      = 00.50in,
    headheight   = 00.50in,
    headsep      = 00.15in,
footskip     = 00.60in}
\pdfpagewidth  = 11.00in 
\pdfpageheight = 04.25in
\lipsum[1]

\clearpage 
\newgeometry{layoutwidth  = 17.00in,
    layoutheight = 11.00in,
    vmargin      = 00.50in, 
    hmargin      = 00.50in,
    headheight   = 00.50in,
    headsep      = 00.15in,
footskip     = 00.60in}
\pdfpagewidth  = 17.00in
\pdfpageheight = 11.00in
\lipsum[1]

\clearpage
\newgeometry{layoutwidth  = 08.50in,
    layoutheight = 11.00in,
    vmargin      = 00.50in, 
    hmargin      = 00.50in,
    headheight   = 00.50in,
    headsep      = 00.15in,
footskip     = 00.60in}
\pdfpagewidth  = 08.50in 
\pdfpageheight = 11.00in
{\Huge \textbf{Original}}
\lipsum[1]

\clearpage 
\KOMAoptions{paper=17in:11in,pagesize}
\recalctypearea
\lipsum[1]

\clearpage 
\KOMAoptions{paper=17in:11in,pagesize}
\recalctypearea
\newgeometry{layoutwidth  = 17.00in,
    layoutheight = 11.00in,
    vmargin      = 00.50in, 
    hmargin      = 00.50in,
    headheight   = 00.50in,
    headsep      = 00.15in,
footskip     = 00.60in}
\lipsum[1]

\end{document}

As you can see, the header are where they are supposed to be.