[Tex/LaTex] labbook/scrbook new chapter not on separate page

chapterskoma-scriptlabbookpage-breakingsectioning

I am using labbook document class which relies on scrbook. It starts a new page for each chapter, which I don't want to happen. Is there a way to force it to procede with a new chapter on the same page where the previous ends?

I tried

\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother

but it did not work.

Here is the MWE:

\documentclass[oneside]{labbook}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother

\begin{document}

\labday{Monday}
First day in the lab.
\labday{Tuesday}
Second day in the lab.

\end{document}

Any suggestions?

Best Answer

Because \labday uses \addchap (KOMA-Script's unnumbered version of \chapter), you have to patch this command. I added a \par at the start of the changed definition in case (as in your example) no \par or blank line is added before \labday in the document body.

\documentclass[oneside]{labbook}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\addchap}{\if@openright\cleardoublepage\else\clearpage\fi}{\par}{}{}
\makeatother

\begin{document}

\labday{Monday}
First day in the lab.
\labday{Tuesday}
Second day in the lab.

\end{document}
Related Question