[Tex/LaTex] Customize page numbering so all pages are equally formatted in book class

fancyhdrheader-footerpage-numbering

The title says it all. A friend is working on her thesis and we cannot figure out how to ensure that the page numbering is equally formatted on all the pages that display page numbers.

Default positioning has the page numbers altering left and right on even and odd pages, and at the bottom of the first page of every chapter.

Ideally she wants the the page numbers on every page printed on the top right corner of her book with no special formatting added for the first page of a chapter.

Any experience with this kind of customization?


Edit:

An MWE was requested and is therefore supplied.

\documentclass{book}
\begin{document}
\chapter{foo}
Special chapter title page. Page number positioned at bottom of page


\pagebreak
Normal body text. Page number positioned at top left corner of page.
\end{document}

Best Answer

To get all pages formatted with a page number in the center of the footer is quite simple with fancyhdr.

MWE 1

\documentclass{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE]{}
\fancyhead[RO]{}
\fancyhead[RE]{}
\fancyhead[LO]{}
\cfoot{\thepage}
\begin{document}
\chapter{foo}
Special chapter title page. Page number positioned at bottom of page.


\pagebreak
Normal body text. Page number positioned at bottom of page again.
\end{document}

If you want all pages to have the number in the upper right, it's a tiny bit more complicated but still quite doable, see Section 7 of the fancyhdr manual.

MWE 2

\documentclass{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE]{}
\fancyhead[RO]{}
\fancyhead[RE]{}
\fancyhead[LO]{}
\fancyfoot[C]{}
\rhead{\thepage}

\fancypagestyle{plain}{%
\fancyhf{}
\rhead{\thepage}
}

\begin{document}
\chapter{foo}
Special chapter title page. Page number positioned at top right.

\pagebreak
Normal body text. Page number positioned at top right again.
\end{document}
Related Question