Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Works for me, so you'll have to add a minimal working example (MWE) that illustrates your problem. –  lockstep Feb 15 '12 at 6:46
    
@lockstep: Sorry, I now added it to the question above. –  Anja Feb 15 '12 at 7:37

1 Answer 1

up vote 2 down vote accepted

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}
share|improve this answer
    
Thanks, this works perfectly! Is it actually possible to keep the heading with the chapter title? (in case of several chapters on one page it would be the first one) –  Anja Feb 15 '12 at 8:33
1  
Try \renewcommand*{\chapterpagestyle}{headings}. –  lockstep Feb 15 '12 at 8:38
    
Thanks, it works! –  Anja Feb 15 '12 at 8:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.