Page Layoutarticle | Remove running Header at Start of new Section

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
swoppa
Posts: 1
Joined: Mon Jul 16, 2012 12:38 pm

article | Remove running Header at Start of new Section

Post by swoppa »

I'm looking for a way to remove running headings at the page where a new section starts.
(I found out this would probably be easier in the book class... but I rather stick with the article class.)

Some of the code I use:

Code: Select all

\documentclass[12pt,a4paper,twoside]{article}

\usepackage{fancyhdr,lastpage,extramarks}
\usepackage{titlesec}
\usepackage[english]{babel}
\usepackage{blindtext}

\newcommand\sectionbreak{\clearpage}

\begin{document}

\pagestyle{fancy}

\fancyfoot{}
\fancyhf{}
\fancyhead[LO,LE]{\nouppercase\firstleftmark}
\fancyhead[RO,RE]{\emph{Page \thepage}}

\blinddocument

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

GerlofVito
Posts: 27
Joined: Wed May 16, 2012 8:24 pm

article | Remove running Header at Start of new Section

Post by GerlofVito »

You're defining a macro called \sectionbreak, and I think if you just add in a \thispagestyle command there, you can get the effect you want. It looks like all the pages (including after \sectionbreak) are going to be "fancy". So if you define a new page style with whatever features you like for that page where a new section starts and call it something like "pssectionbreak", you can define the \sectionbreak command as:

Code: Select all

\newcommand\sectionbreak{\clearpage\thispagestyle{pssectionbreak} }
I think if you look at the fancyhdr documentation, it describes how to define a new page style.
Post Reply