0

First, I'm really bad at Latex and only interacting with it to format some things for a bookdown project. I was trying to change the afterskip for chapter, section and subsection and the only thing that worked for me was this thread that I rewrote with some trial and error like this:

\makeatletter
\renewcommand\chapter{\@startsection {chapter}{0}{\z@}%
  {5ex \@plus -1ex \@minus -.2ex}% <beforeskip>
  {1ex \@plus.2ex}% <afterskip>
  {\normalfont\Huge\bfseries\SS@chapnumfont}}
\renewcommand\section{\@startsection {section}{1}{\z@}%
  {-5ex \@plus -1ex \@minus -.2ex}% <beforeskip>
  {1ex \@plus.60ex}% <afterskip>
  {\normalfont\Large\bfseries\SS@sectfont}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
  {-4ex\@plus -1ex \@minus -.2ex}% <beforeskip>
  {1ex \@plus .2ex}% <afterskip>
  {\normalfont\large\bfseries\SS@subsectfont}}
\makeatother

The afterskip is fine but now other behaviour of chapter is gone, like a new page before every new chapter. Where can I find how it is defined? Tried to download the sectsty package but didn't understand anything really. Or is there an easier way to set afterskip without loosing other behaviours?

  • Currently we do not know the class you are using, nor how you've used it. However, \chapter usually is not defined using \@startsection. Maybe you should consider to either use a package like titlesec to change the chapters, section etc. or use a class like memoir or scrbook that provides configuration of such commands. Please also read the manuals of the packages. – cabohah Sep 01 '23 at 12:34
  • Thanks for pointing me in the right direction. Tried scrbook before with \RedeclareSectionCommand but then my colors changed, since they were set using sectsty. Realized I also could set them using \addtokomafont, so problem solved. Been a lot of shooting in the dark as to avoid to go down the LaTex rabbit hole. – wasserslasken Sep 01 '23 at 13:36

0 Answers0