LaTeX forum ⇒ Page Layoutintrusive page number on Part page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
jjramsden
Posts: 2
Joined: Mon Aug 15, 2022 4:03 pm

intrusive page number on Part page

Postby jjramsden » Mon Aug 15, 2022 11:06 pm

Page numbers should never appear on a Part page but they are there by default, even if the \part command is preceded by \thispagestyle{empty}. Any way to resolve this?

\documentclass[12pt]{book}
\begin{document}
\mainmatter
\chapter{first}
Some text.
\newpage\thispagestyle{empty}
\thispagestyle{empty}
\part{one}
\chapter{2nd}
Some more text.
\end{document}

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook
Bartman
Posts: 304
Joined: Fri Jan 03, 2020 2:39 pm

intrusive page number on Part page

Postby Bartman » Tue Aug 16, 2022 12:57 am

Please mark your code so we can test it.

You can find the definition of the \part command in the book.cls file.
There the page style is set to plain. A possible solution would be to load the etoolbox package and replace the style in the preamble using the following command.

\patchcmd{\part}{plain}{empty}{}{}

User avatar
MjK
Posts: 47
Joined: Fri Jan 28, 2022 6:09 pm

intrusive page number on Part page

Postby MjK » Tue Aug 16, 2022 8:58 am

With a more configurable document class, you would not need to patch anything, i. e., using KOMA-Script class scrbook:
\documentclass[12pt,emulatestandardclasses]{scrbook}
% You may use:
\RedeclareSectionCommand[pagestyle=empty]{part}
% or:
\renewcommand*{\partpagestyle}{empty}
% or both. ;-)
\begin{document}
\mainmatter
\chapter{first}
Some text.
\part{one}
\chapter{2nd}
Some more text.
\end{document}

Note: Option emulatestandardclasses has only been set to make the example more comparable with the original one. I would not recommend to use it, but use only those changes to the lookalike of the standard classes, you really want. For example, most users do not want headings and page numbers at interleaf pages like page 2 of the example but maybe the headings of the standard classes and maybe the letter paper size. So
\documentclass[12pt,paper=letter,headings=standardclasses]{scrbook}
% You may use:
\RedeclareSectionCommand[pagestyle=empty]{part}
% or:
\renewcommand*{\partpagestyle}{empty}
% or both. ;-)
\begin{document}
\mainmatter
\chapter{first}
Some text.
\part{one}
\chapter{2nd}
Some more text.
\end{document}

would be better. I would also recommend to try it without option headings=standardclasses to see the headings default of KOMA-Script classes.

See the manual (either the English one or the German one) for more information about the shown commands and options and the lots of features of the KOMA-Script classes.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests