I'm writing a book in two parts, but for some (silly if you ask me) reason whoever designed the book document class in TeX decided part pages needed numbers. How can I remove them?
I tried the following code, which I found here:
\usepackage{epigraph}
\usepackage{lettrine}
\makeatletter
\renewcommand\part{%
\***@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{empty}%
\***@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil
\secdef\@part\@spart}
\makeatother
\setlength{\epigraphwidth}{9.5cm}
(I have no idea what the epigraph and lettrine packages do or whether they're needed.) However, this returns the following error when attempting to compile (XeLaTeX, for compatibility with other preamble code I have):
Extra \else.
(It did seem odd to me when I looked at that bit of code that there are \elses and \fis but no \ifs.)
I've also (perhaps naïvely) tried adding \thispagestyle{empty} immediately before or after the \part{} command in my document, but that didn't work.
MWE:
\documentclass[11pt,oneside=off,chapterprefix=on,appendixprefix=on]{book}
\usepackage{titletoc}
\begin{document}
\part{Teil eins}
\chapter{Kapitel eins}
\end{document}
If possible, I would like to keep the book class. I've read that scrbook and memoir make it easier to achieve what I want, but I have code in my preamble which is incompatible with those classes and I really don't want to start debugging that.
\partinbook.cls, and it leaves out some very important\ifcomponents. It is not at all a good model (aside from its being 15 years old). The page style in the currentbook.clsis\pagestyle{plain}, which can simply be patched (based on what's done in the post https://tex.stackexchange.com/a/19741):\usepackage{etoolbox} \patchcmd{\part}{plain}{empty}{}{}– barbara beeton Nov 08 '22 at 01:05epigraphpackage (don't know aboutletrine); try not using them or anything based on them and see if things improve. – Peter Wilson Nov 08 '22 at 19:55