GeneralCustomizing \part

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
amyelmo
Posts: 1
Joined: Wed Jan 23, 2008 2:07 pm

Customizing \part

Post by amyelmo »

Dear all,

I am trying to customize the format of the Part page. For each of my chapters I have:

\chapter{Chapter_Name}
\thispagestyle{empty}
\thispagestyle{fancy}
followed by my 'fancyheader' settings.

However regardless of me setting the \part{Part_Name} preamble to:

\part{Part_Name}
\thispagestyle{empty}

it always gives me the default 'plain' style with the numbers centred at the bottom of the page. Which looks nice, but unfortunately my guidelines state that each page must be numbered in the centre at the top of the page.

I'd be very grateful for any assistance!
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

balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Customizing \part

Post by balf »

I've heard that parts can't be customised in the same way as chapters, sections and the like.

Try the titlesec package, which lets you customise parts, chapters, etc. Btw, unless you have to do very special things with fancyheader, you should know that titlesec also has tools for customising headers and footers, and has a companion package called titletoc for customising table of contents, list of figures, .... Take a look at the doc.

Regards,
B.A.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Customizing \part

Post by Juanjo »

It seems that you simply have to redefine the plain style. Look the code at p. 7-8 in the fancyhdr manual, which, once adapted to your needs, can be something like

Code: Select all

\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyhead[C]{\bfseries \thepage} % except the center
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
This code should go in the preamble, as the remaining header settings.
Of course, all the \thispagesyle commands after \chapter and \part become superfluous and should be removed.
Post Reply