0

I'm working with the book document class for the first time and I noticed that the page numbering is different for the table of content and the first page of each chapter: instead of being placed on the top of the page, the number is placed on the bottom in these cases.

Why is this the case? I think it is very inconvenient to have to look for the page numbering at a different location in some cases...

So, the second question is: how can I change this? I would like to stick with the default page numbering options but have them consistent for all pages.

This is my minimal example, I am using xelatex in case that is relevant:

\documentclass{book}

\usepackage[british]{babel}
\usepackage{lipsum}

\author{Max}
\title{Test page numbering}

\begin{document}

\frontmatter    
\maketitle

\lipsum

\tableofcontents

\mainmatter 

\chapter{First chapter}
\section{A section}
\lipsum
\section{Another section}
\lipsum[1-10]

\end{document}
4
  • 1
    In conventional book printing, pages that contain a chapter header are generally formatted differently from "ordinary" pages. E.g., while the page numbers and some kind of running header are displayed in the top line on "ordinary" pages, running headers are suppressed and the page number is placed at the bottom center on pages with chapter headers. What is "very inconvenient" about this? The book document class seeks to emulate some of these typographic conventions. If you cannot stand these conventions, you may need to ask yourself why you're using the book document class to begin with.
    – Mico
    Nov 23, 2021 at 14:12
  • I understand your point, but still, personally, I find it inconvenient to have the page numberings at a completely different location. I am using the book document class becuase other attributes, e.g., openright and frontmatter versus mainmatter, are very convenient for the document I'm writing.
    – Max
    Nov 23, 2021 at 15:06
  • 2
    @Max: On the first page of a chapter, the plain page style is used. You may redefine this page style in the preamble of your document, so that it places the page number in the header.
    – Bernard
    Nov 23, 2021 at 15:11
  • 1
    Simon Dispa's answer gives you want you want. To me it looks bad. If you want all pages to look similar then just use \pagestyle{plain} which will make all pages look like chapter pages --- page numbers at the bottom and no headers. Nov 23, 2021 at 18:13

1 Answer 1

1

As suggested in the comments, you can redefine the plain style that \chapter invokes.

W ithout using additional packages this code will work with 2-sided printing (chapters starting on odd pages, adding a blank page if necessary) or single-sided printing (chapter starting on the next page, odd or even)

See the Chapter 2 page (and the page before) using \documentclass[oneside]{book}

Two side

a

One side

b

\documentclass{book}

%\documentclass[oneside]{book}% try it <<<<<<<<

\makeatletter % added <<<<<<<<<<<<<<
\def\ps@plain{%
    \let\@oddfoot\@empty
    \def\@oddhead{\normalfont\hfil\thepage}}%
\makeatother

\usepackage[british]{babel}
\usepackage{lipsum}

\author{Max}
\title{Test page numbering}

\begin{document}
    
    \frontmatter    
    \maketitle
    
    \lipsum
    
    \tableofcontents
    
    \mainmatter 
    
    \chapter{First chapter}
    \section{A section}
    \lipsum
    \section{Another section}
    \lipsum[1-6]
    \chapter{Second chapter}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .