Page Layouthow to create a different header for all pages after the first

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
wjfeeney
Posts: 9
Joined: Sun Aug 06, 2023 9:02 am

how to create a different header for all pages after the first

Post by wjfeeney »

I used {fancyhdr} to set up a header for the first page of my document called \fancypagestyle{firstpage}. I inserted \thispagestyle{firstpage} after \begin{document}. The first page header is rendered as designed. All subsequent pages have a different header.

I created another pagestyle for these subsequent pages called \fancypagestyle{otherpages}. Using \usepackage{afterpage}, I inserted \afterpage{\thispagestyle{otherpages}} after \begin{document} thinking all the subsequent pages would be rendered in the {otherpages} style. However, only the second page had the new style; page three and beyond were unaffected.

What do I have to do in order to apply the {otherpages} style to all the subsequent pages?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

how to create a different header for all pages after the first

Post by rais »

no, \thispagestyle only affects the page it's called on. Use \pagestyle, instead.

You don't even need the afterpage package for that, just declare

Code: Select all

\pagestyle{otherpages}
% before your call
\thispagestyle{firstpage}
KR
Rainer
Post Reply