Page LayoutPage number centered on footer with book class

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
outofband
Posts: 1
Joined: Tue Jul 07, 2015 7:17 pm

Page number centered on footer with book class

Post by outofband »

Hello and first of all sorry if this is the wrong forum section for this question.
I'm writing a document with the book document class, parameters are [a4paper, 11pt, oneside, titlepage, openany]. Page number is centered in the footer for title pages, and top right corner for the other pages. Is there an easy way to place it centered in the footer for every page?

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Page number centered on footer with book class

Post by Johannes_B »

Hi and welcome,

there are several packages that take care of this. One of them is package scrlayer-scrpage, from the KOMA-bundle (up-to-date).

You can use the following code:

Code: Select all

\documentclass[a4paper, 11pt, oneside, titlepage, 
%openany%since there are no left and right pages in a oneside
%document, you can leave that out.
]{book}
\usepackage[automark,
markcase=noupper
]{scrlayer-scrpage}
\setlength{\headheight}{13.6pt}%Found in the log file
\clearpairofpagestyles
\cfoot*{\pagemark}
\ihead{\leftmark}%chead better?
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply