56

Here's a minimal case of the problem:

\documentclass{book}

\pagestyle{empty}

\begin{document}

\chapter{The first}

This page has a page number\ldots

\newpage

\ldots but not this one.

\end{document}

I've surmised (by removing it) that the problem has something to do with the \chapter line. But what caused this issue and how do I correct it?

1
  • 8
    I had to look at \ldots twice, I thought it said \idiots. May 25 '13 at 13:41
48

The page style for the first page of a chapter is set internally (in the book and report document classes) to be plain; you can change this behaviour by adding the following lines to the preamble of your document:

\makeatletter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{empty}% original style: plain
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}
\makeatother

or, using the etoolbox package:

\usepackage{etoolbox}
\patchcmd{\chapter}{plain}{empty}{}{}

If the plain style is not needed elsewhere, then you can redefine it to be the empty page style; this can be done with:

\makeatletter
  \let\ps@plain\ps@empty
\makeatother

Finally, in the scrbook document class (from the KOMA-Script bundle), the style for the first page of chapters can be changed simply by redefining the \chapterpagestyle command, as in:

\renewcommand*\chapterpagestyle{empty}

EDIT: added egreg's remarks.

3
  • 8
    If one doesn't need the plain pagestyle elsewhere, the easiest way is to say \let\ps@plain\ps@empty (surrounded by the usual pair of commands). Your code can be simplified with etoolbox as \patchcmd{\chapter}{plain}{empty}{}{}
    – egreg
    Jun 2 '11 at 21:26
  • 1
    @egreg: yes. I will add theses remarks to my answer. Thank you. Jun 2 '11 at 21:28
  • 3
    It always surprises me how quickly questions are answered (especially when I plan to self-answer). I appreciate knowing other ways to do things, however. So thanks. When I've had this issue in the past, I almost always want to change just one chapter and not every chapter in a document, so \thispagestyle is the usual solution. Jun 2 '11 at 21:38
32

The \chapter command internally uses \thispagestyle{plain}. Add \thispagestyle{empty} immediately after \chapter.

\documentclass{book}

\pagestyle{empty}

\begin{document}

\chapter{The first}
\thispagestyle{empty}

This page has a page number\ldots

\newpage

\ldots but not this one.

\end{document}
3
  • I've had this problem at least twice and probably many more times, so I figured writing (and answering) this question would help me remember. I'll likely accept this answer when I'm able. Thanks. Jun 2 '11 at 21:21
  • @Jon: Actually, I like your answer better.
    – lockstep
    Jun 2 '11 at 21:24
  • This is a good solution for setting the page style to empty for specific chapters, rather than all of them.
    – australis
    Sep 12 '19 at 12:26
12

The reason this happens is that the \chapter macro resets the pagestyle for that page. It makes sense when you think about it since you usually want the first page of a chapter to look different than other pages. For instance, if the page number normally sits on the top of the page, you will want to move it to the bottom of the chapter title page. It would look strange otherwise.

There are a number of fixes for the problem, but the easiest is to put \thispagestyle{empty} immediately after the \chapter macro.

If you'd rather change every chapter page, you could use the memoir class and redefine the chapter pagestyle:

\makepagestyle{chapter}

See also this question or this one.

5

You can use \assignpagestyle from titlesec package :

\assignpagestyle{\chapter}{empty}
3

I find that when styling the caption it ist necessary for \thispagestyle{empty} to be inside of it:

Thus:

\part*{\color[HTML]{636060}{A: Lipsum Caption}\thispagestyle{empty}}\label{sec:Kap01} 

will suppress the page number, whereas

\part*{\color[HTML]{636060}{A: Lipsum Caption}}\thispagestyle{empty}\label{sec:Kap01} 

won't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.