1

I'm using the documentclass ttthesis based on book from here. I really like it, but I don't want to have a new page for each chapter. Sadly every approach I tried failed, and now I noticed it's because there is no clearpage or cleardoublepage at the chapters (that's why redefining or ignoring these like described in all answers regarding this topic didn't work out).

Here is the part that redefines the chapters (not my code, just a snippet from the template):

\newlength{\chapnolen}
\newlength{\chapparlen}
\newsavebox{\chapno}
%% Kein ``Kapitel'' bei Kapitelüberschrift
% \renewcommand{\@chapapp}{} allein reicht nicht!
%% \chapter{...}
\renewcommand{\@makechapterhead}[1]{%
  \vspace*{0.2\textheight}%
  %\hrule
  \vskip 15\p@
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \savebox{\chapno}{\chapterheadfont\huge\bfseries \thechapter.}
        \settowidth{\chapnolen}{\usebox{\chapno}}
        \parbox[t]{\chapnolen}{\usebox{\chapno}}\nobreak\leavevmode
%        \par\nobreak
%        \vskip 20\p@
      \fi
    \fi
    \interlinepenalty\@MM
    \setlength{\chapparlen}{\textwidth}
    \addtolength{\chapparlen}{-1.0\chapnolen}
    \addtolength{\chapparlen}{-2ex}
    \leavevmode\nobreak
    \parbox[t]{\chapparlen}{\raggedright\chapterheadfont\huge \bfseries #1\par\nobreak}
    %\the\textwidth
    %\the\chapparlen
    %\the\chapnolen
    %\vskip 20\p@
    %\rule{\textwidth}{1pt}
    \vskip 40\p@
  }}

I just can't find out why there even is a pagebreak for each chapter. I also searched the other parts of the template, but didn't find anything.

Has anyone an idea where these pagebreaks come from or, more importantly, how I can prevent them?

  • The macro \chapter is defined in the book class, where it starts with\clear(double)page and after a few other things it calls \@makechapterhead, which you are redefining here. You may want to give a look here – campa Mar 22 '16 at 13:46
  • but I tried this, this and similar things and it didn't work, there is still a pagebreak – TheFlow0360 Mar 22 '16 at 13:50
  • Sorry, I can't reproduce the problem with the class and the answers you linked. You may want to provide a full MWE. – campa Mar 22 '16 at 13:58
  • I'll try, but atm my document is kinda messy, this will take me some minutes – TheFlow0360 Mar 22 '16 at 14:03
  • oh well, just noticed while cleaning up that i was missing something from the answer with etoolbox, I have to use input instead of included, that solved it - would you create an answer so I can accept it? or do we want to close as duplicate? – TheFlow0360 Mar 22 '16 at 14:15
  • Please be advised that you could run into much much more trouble with that class. – Johannes_B Mar 26 '16 at 10:05
  • @Johannes_B I used it a few times already and till now was always able to modfiy it to suit my needs - do you have any specific criric points? – TheFlow0360 Mar 26 '16 at 10:07
  • To start with, the class introduces itself as tex/ttthesis and is loaded as such to avoid a warning. The class does quite a bit of other strange stuff as well. Look at all the language conditionals that shouldn't be in any modern document. – Johannes_B Mar 26 '16 at 10:10
  • sorry but I'm not really an "advanced" tex user, so I can't really tell whether the template is good or not... For me it was the fastest way to get a template that fits for my use cases in university, that's why I used it. If you have a recommendation for a better template pls let me know – TheFlow0360 Mar 26 '16 at 10:12
  • That is ok, you can savely ignore my comment. I just wanted to stated the fact for future readers. ;-) – Johannes_B Mar 26 '16 at 10:14
  • ok, anyways, thx for the advise (: – TheFlow0360 Mar 26 '16 at 10:15

1 Answers1

2

If you want a \chapter level heading that isn't at the top of the page, apart from stopping the page break you would want a much less flamboyant setting mid-page, so just copy the setting from \section and adjust accordingly.

So...

enter image description here

\documentclass{book}

\makeatletter
% section from book
%\newcommand\section{\@startsection {section}{1}{\z@}%
%                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
%                                   {2.3ex \@plus.2ex}%
%                                   {\normalfont\Large\bfseries}}
\renewcommand\chapter{\@startsection {chapter}{0}{\z@}%
                                   {-4.5ex \@plus -1ex \@minus -.2ex}%
                                   {3.3ex \@plus.2ex}%
                                   {\normalfont\LARGE\bfseries}}
\makeatletter

\begin{document}

\chapter{Zzzz}
\section{Aaaa}
aa
\section{Bbbbbb}
bb
\chapter{Zzzz}
\section{Aaaa}
aa
\section{Bbbbbb}
bb

\end{document}
David Carlisle
  • 757,742
  • I just used the template because it's from someone at my faculty and it's recommended to use it, I don't even really want the space on top ^^ The general style and titlepage are nice so I didn't want to do it entirely by myself just because I don't like the chapters – TheFlow0360 Mar 22 '16 at 14:12
  • @TheFlow0360 I did not suggest that you changed your template I just showed you a one-line definition of \chapter that did what you asked. I used book in the example because I don't have ttthesis but you said it is based on book so the definition should work. – David Carlisle Mar 22 '16 at 14:16
  • yeah, your answer is totally correct, I just wanted to express that I could also use book directly because I don't need the space, the real problem was removing pagebreaks while still using the ttthesis, but I'm closing this question as duplicate anyways since the problem wasn't related to the template – TheFlow0360 Mar 22 '16 at 14:51