11

I am using \documentclass{scrartcl} which I believe is a KOMA-Script type.

I now wish to have each \section{} start in a new page, similar to what \usepackage{titlesec} offers, as shown on this question.

How can I do so?

Currently, I get this warning which is why I asked this question:

Class scrartcl Warning: Usage of package `titlesec' together
(scrartcl) with a KOMA-Script class is not recommended. 
(scrartcl) I'd suggest to use the package only 
(scrartcl) if you really need it, because it breaks several
(scrartcl) KOMA-Script features, i.e., option `headings' and
(scrartcl) the extended optional argument of the section
(scrartcl) commands .
(scrartcl) Nevertheless, using requested
(scrartcl) package `titlesec' on input line 7.
  • Welcome to TeX.sx! So your real question is how to have new sections always start on a new page with KOMA-Script? – clemens Aug 3 '14 at 18:27
  • @cgnieder Hello, yes that's right! :) – Molten Ice Aug 3 '14 at 18:29
  • 3
    One way: load the package etoolbox and add \preto\section{\clearpage} to the preamble – clemens Aug 3 '14 at 18:40
  • @cgnieder That worked! Please post that as the answer and I will mark it as correct. I could answer my own question with this but you deserve the credit! – Molten Ice Aug 3 '14 at 18:43
14

Add a \clearpage to each section:

\documentclass{scrartcl}
\addtokomafont{section}{\clearpage}
\begin{document}

\section{foo}foo
\section{bar}bar
\subsection{foooo} foooo
\section{baz}baz
\section{foobar}foobar

\end{document}
  • What if I wanted to reduce the white space below a section header? \addtokomafont{element }{command} seems to execute whatever instructions command contains before printing the section title. – Casimir Feb 4 '16 at 15:55
  • 1
    Use \ReDeclareSectionCommand – user2478 Feb 4 '16 at 17:25
  • Thanks for the tip. \RedeclareSectionCommand[afterskip=<length>,beforeskip=<length>]{section} worked great. – Casimir Feb 4 '16 at 18:24
2

All credit goes to cgnieder for this solution.

\usepackage{etoolbox}

\preto\section{\clearpage}

\begin{document}
\section{Section One}
\section{Section Two Should Start On Another Page}
\end{document}
  • I don't understand your comment. Herbert's solution is for all intents an purposes identical to this, except that it uses the built-in KOMA hook for modifying the section code (and so is probably to be preferred; it also doesn't require an extra package). There is nothing added each time you make a new section with his code either. – Alan Munn Aug 4 '14 at 23:59
  • @AlanMunn I think it got edited, previously I was under the impression that we had to manually add \clearpage after every section. – Molten Ice Aug 5 '14 at 8:04
  • 1
    @Herbert's solution is better for at least one reason: the KOMA font “section” is also used by \addsec so the addition works for it, too. With etoolbox you'd need to patch it, too. – clemens Aug 5 '14 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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