[Tex/LaTex] How to remove page break after \part in report/book

chapterspage-breakingpartssectioning

I have tried to look through, but I couldn't find a clear solution on this.

I have a document that uses report with multiple \chapters in multiple \parts as:

\part{foo}
\chapter{uno}
\chapter{dos}
\part{bar}...

This results in an entire page that is "Part I Uno". I would like to remove the page break, and have both part foo, and chapter uno on the same page as:

Part I foo
Chapter 1 Uno

How do I do that?

Best Answer

With the titlesec package, you could define a "title class" without pagebreak:

\titleclass{\part}{top}
\titleclass{\chapter}{straight}

Title classes are:

  • page: a single page like a book part page
  • top: starts a page and places the heading at the top
  • straight: titles in the text, such as by \section

A full example:

\documentclass{book}
\usepackage{titlesec}
\titleclass{\part}{top}
\titleformat{\part}[display]
  {\normalfont\huge\bfseries}{\centering\partname\ \thepart}{20pt}{\Huge\centering}
\titlespacing*{\part}{0pt}{50pt}{40pt}
\titleclass{\chapter}{straight}
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter} {0pt}{50pt}{40pt}
\begin{document}
\part{foo}
\chapter{uno}
\end{document}

part and chapter heading