Page LayoutDifferent headers on different pages

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
lukaszskowron96
Posts: 36
Joined: Tue Oct 09, 2018 1:01 pm

Different headers on different pages

Post by lukaszskowron96 »

Hi, I am trying do to the following:

No header on the cover page(I know how to do that)
Header for pages 1-12
Different header for pages 13-19
Different header for pages 20-25

and so on

How to do this? I was reading online but couldn't find a helpful tutorial how to approach it.

Thank you in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Different headers on different pages

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

You use a command for making the header for pages 1-12, right? Then on page 13, within the document, just make again that header command with the new value you would like to appear in the header. And on 20 again, with the new value.

Stefan
LaTeX.org admin
lukaszskowron96
Posts: 36
Joined: Tue Oct 09, 2018 1:01 pm

Different headers on different pages

Post by lukaszskowron96 »

Hi Stefan,

No, I don't. I specify the header in the preamble as:

\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{My name}
\lhead{ }
\thispagestyle{empty} - to make the first page without header

How to create a header with a command within the document?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Different headers on different pages

Post by Stefan Kottwitz »

Well in the middle of the document, you could simply write

\rhead{A different header}

Would you like to try it?

Stefan
LaTeX.org admin
lukaszskowron96
Posts: 36
Joined: Tue Oct 09, 2018 1:01 pm

Different headers on different pages

Post by lukaszskowron96 »

Thank you Stefan, it works! I hope somebody in the future will find this post helpful! :)
Post Reply