I am using report document class. When I create a new chapter, it starts it on a new blank page in which only the chapter name appears.
I want to be able to start new chapters on the same page as the old chapter ends. Is there any way to do it?
I am using report document class. When I create a new chapter, it starts it on a new blank page in which only the chapter name appears.
I want to be able to start new chapters on the same page as the old chapter ends. Is there any way to do it?
The \chapter command internally uses \cleardoublepage and \clearpage to add page breaks. Use the etoolbox package to selectively change the definition of \chapter.
\documentclass{book}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother
\begin{document}
\chapter{foo}
Some text.
\chapter{bar}
Some text.
\end{document}
Note: This etoolbox hack also works for the report class.
For KOMA-Script scrbook from version 3.19a (and most likely for other KOMA-Script classes, too), you need to patch \scr@startchapter instead of chapter:
\usepackage{etoolbox}
\makeatletter
\patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother
\documentclass{report}
\begin{document}
\chapter{foo}
{\let\clearpage\relax \chapter{bar}}
\chapter{baz}
\end{document}
use \cleardoublepage instead of \clearpage for a two sided document
\vspace*{\fill} {\let\clearpage\relax\chapter*{Abstract}}
– Naghi
Dec 18 '21 at 09:40
I have used this whenever I needed to add one chapter to the previous page:
\begingroup
\let\clearpage\relax
\chapter{My Chapter}
\endgroup
It doesn't change the rest of the chapters, or anything else in the document.
\includeadds page breaks before and after it. – lockstep Jul 25 '11 at 17:49\inputinstead. See When should I use \input vs \include? for details. – lockstep Jul 25 '11 at 17:56twocolumndocumentclass option results in "Float(s) lost"...?!? – DevSolar Nov 13 '11 at 15:33\chaptercommand is used somewhat different insidetwocolumn, and so another approach may be needed. Please ask a new question so that other users might be able to answer (and to locate the answers.) – lockstep Nov 13 '11 at 15:38\chapterwith\section, but it didn't seem to work. Thanks! – spencerlyon2 Mar 10 '14 at 20:16\par\relaxwould be better. – Ch'en Meng Apr 21 '15 at 02:02\RedeclareSectionCommand[style=section,indent=0pt]{chapter}. See also https://tex.stackexchange.com/q/443736/43317. – esdd Jul 29 '18 at 22:48