Page Layout ⇒ Page number centered on footer with book class
Page number centered on footer with book class
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?
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
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}