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 \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.
share|improve this question
    
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
3  
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

2 Answers 2

up vote 9 down vote accepted

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}
share|improve this answer

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}
share|improve this answer
    
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
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. –  cgnieder Aug 5 at 8:13

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.