Page LayoutPage number layout in \part

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
smoll1
Posts: 5
Joined: Mon May 25, 2015 5:33 pm

Page number layout in \part

Post by smoll1 »

Hello all!
I've written my thesis in the scrbook document class, but my publisher has now asked me to make all page numbers centered. I've done this with the following code:

\deftripstyle{pgnumbottomcenter}{}{}{}{}{\pagemark{}}{}
\pagestyle{pgnumbottomcenter}
\renewcommand{\chapterpagestyle}{pgnumbottomcenter}


This has worked perfectly for all pages EXCEPT the \part pages.
Does anyone know how to also center the page numbers on these?

Thanks!

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 layout in \part

Post by Johannes_B »

I think you are looking for \partpagestyle.

For your information, new and modern package scrlayer-scrpage gives a very easy interface for headers and footers.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
smoll1
Posts: 5
Joined: Mon May 25, 2015 5:33 pm

Re: Page number layout in \part

Post by smoll1 »

Hi!
Thanks for your reply, but I can't seem to make it work anyway.
I tried putting \partpagestyle{plain} in the document itself, and also tried
\renewcommand*{\partpagestyle}{plain} in the preamble, but the page number on the \part page is still not centered like the other pages.
Is there any way to do this without having to fiddle too much with other packages? I tried working with scrlayer-scrpage, but it doesn't seem to work (admittedly, I'm not a very experienced Latex user... ).

Thanks!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Page number layout in \part

Post by Johannes_B »

If you already came up with \renewcommand{\chapterpagestyle}{pgnumbottomcenter}, a quite similar
\renewcommand{\partpagestyle}{pgnumbottomcenter} should help.
If not, we need to see a bit more information in form of a Minimal working example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
smoll1
Posts: 5
Joined: Mon May 25, 2015 5:33 pm

Page number layout in \part

Post by smoll1 »

Hello again!
I gave that a try but strangely enough it also didn't do anything. So here is my MWE:

Code: Select all

\documentclass[twoside, 14pt, a4paper, footinclude=true, headinclude=true]{scrbook}
\usepackage[linedheaders,parts,pdfspacing]{classicthesis}
\deftripstyle{pgnumbottomcenter}{}{}{}{}{\pagemark{}}{}
\pagestyle{pgnumbottomcenter}
\renewcommand{\chapterpagestyle}{pgnumbottomcenter}

\begin{document}
The page number on this page is centered, but not on the part page. 
\part{Introduction \& background}
\end{document}
Thanks again for your help. This tiny little thing is driving me nuts! haha
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Page number layout in \part

Post by Johannes_B »

classicthesis, i hate it. It is one of the most widespread templates that give supporters a regular headache because it does pretty stupid stuff. It kicks KOMA-internals into oblivion by setting stumpy overrides.

You have to copy the definition made by classicthesis and change the empty pagestyle to use your own. A very good example by the way.

Code: Select all

\documentclass[twoside, 14pt, a4paper, footinclude=true,
headinclude=true]{scrbook}
\usepackage[linedheaders,parts,pdfspacing]{classicthesis}
\deftripstyle{pgnumbottomcenter}{}{}{}{}{\pagemark{}}{}
\pagestyle{pgnumbottomcenter}
\renewcommand{\chapterpagestyle}{pgnumbottomcenter}

\makeatletter
    \titleformat{\part}[display]
        {\normalfont\centering\large}%
        {\thispagestyle{pgnumbottomcenter}\partname~\MakeTextUppercase{\thepart}}{1em}%
        {\color{Maroon}\spacedallcaps}[\bigskip\normalfont\normalsize\color{Black}\begin{quote}\ct@parttext\end{quote}]
	\makeatother
\begin{document}
\chapter{test}
The page number on this page is
centered, but not on the part page.
\part{Introduction \& background}
\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.
smoll1
Posts: 5
Joined: Mon May 25, 2015 5:33 pm

Page number layout in \part

Post by smoll1 »

I totally agree. I should never have used classicthesis. Learnt my lesson but its too late to change now...
Thanks for your suggestion. I tried it with my MWE and although it returned the error Undefined control sequence \part{Introduction \& background}, and the same problem occurs when I try to compile with my thesis. I'm assuming it worked for you however so perhaps I'm doing something wrong.
I also tried to change the page style in the classicthesis.sty file, but to no avail. I'm starting to think maybe I should just suck it up and let it go, or take out the \part pages altogether.......

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

Page number layout in \part

Post by Johannes_B »

It is very very likely that you have a bunch of classicthesis.sty on your machine. One coming with the template you are using, one coming with your TeX-distribution. Possibly even different versions.
Rename the one in your document folder to modClassicthesis.sty and make the corresponding change in your tex-file. You know know that exactly this file is used, it also serves licensing issues. Change that renamed file to your likings.


Have you tried my minimal working example? Does it not work? There is no reason that part would be undefined, can you show the log-file of the run?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
smoll1
Posts: 5
Joined: Mon May 25, 2015 5:33 pm

Re: Page number layout in \part

Post by smoll1 »

Yay!! That worked! You're a lifesaver! Thank you so much!!! :D
Post Reply