# How to have titlesec like behaviour for a Koma Script

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? –  cgnieder Aug 3 at 18:27
@cgnieder Hello, yes that's right! :) –  Molten Ice Aug 3 at 18:29
One way: load the package etoolbox and add \preto\section{\clearpage} to the preamble –  cgnieder Aug 3 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 at 18:43

Add a \clearpage to each section:

\documentclass{scrartcl}
\begin{document}

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

\end{document}

-

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 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 at 8:04
@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. –  cgnieder Aug 5 at 8:13