Update
KOMA-Script version 3.26 introduces two new keys to \RedeclareSectionCommand
and \RedeclareSectionCommands
: runin
and afterindent
. Possible values for both keys are bysign
, true
and false
.
runin
:
This key is only defined for sectioning commands with style=section
, eg section
, subsection
, subsubsection
, paragraph
, subparagraph
.
By default runin=bysign
is set. Then the sign of afterskip
decides if the heading is a runin heading (negative sign) or not (positive value) and the absolute value of afterskip
is used for the horizontal or vertical skip after the heading. This is the same behavior as explained in the original answer below.
With runin=true
it is a runin heading and the sign of afterskip
has no meaning anymore. Note that the absolute value of afterskip
is used as the horizontal skip. So even a negative value of afterskip
will result in positive horizontal skip.
With runin=false
it is a freestanding heading and the value of afterskip
is used as vertical skip. Note that with runin=false
a negative value of afterskip
results in a negative vertical skip.
afterindent
:
By default
afterindent=bysign
is set for style=section
and style=chapter
afterindent=true
is set for style=part
and class scrartcl
afterindent=false
is set for style=part
and class scrbook
With afterindent=bysign
the sign of beforeskip
determines if the first line after the heading uses the paragraph indentation or not. With afterskip=bysign
the absolute value of beforeskip
is used as vertical skip above the heading. This is the same behavior as explained in the original answer below.
With afterindent=true
the paragraph indentation is used for the first line following a freestanding heading. With afterindent=false
this first line is not indented. With both afterindent=true
or afterindent=false
the value of beforeskip
is used as the skip above the heading. So a negative value of beforeskip
results in a negative skip, even for a runin heading.
Example:
\documentclass{scrreprt}
\RedeclareSectionCommand[
%runin=false,
afterindent=false,
beforeskip=0pt,
afterskip=2\baselineskip]{chapter}
\RedeclareSectionCommand[
%runin=false,
afterindent=false,
beforeskip=\baselineskip,
afterskip=.5\baselineskip]{section}
\RedeclareSectionCommand[
%runin=false,
afterindent=false,
beforeskip=.75\baselineskip,
afterskip=.5\baselineskip]{subsection}
\RedeclareSectionCommand[
%runin=false,
afterindent=false,
beforeskip=.5\baselineskip,
afterskip=.25\baselineskip]{subsubsection}
\RedeclareSectionCommand[
runin=true,
%afterindent=false,
beforeskip=.5\baselineskip,
afterskip=1em]{paragraph}
\RedeclareSectionCommand[
runin=true,
%afterindent=false,
beforeskip=.5\baselineskip,
afterskip=1em]{subparagraph}
\begin{document}
\chapter{Erde}
Der eigentliche Text.\par
Test
\section{Europa}
Der eigentliche Text.
\subsection{Italien}
Der eigentliche Text.
\subsubsection{Toskana}
Der eigentliche Text.
\paragraph{Florenz}
Der eigentliche Text.
\subparagraph{Dom}
Der eigentliche Text
\end{document}
Original answer
It is easy with the new macros \RedeclareSectionCommand
and \RedeclareSectionCommands
of the KOMA-Script version 3.15.
\documentclass{scrreprt}
\RedeclareSectionCommand[
beforeskip=-1sp,
afterskip=2\baselineskip]{chapter}
\RedeclareSectionCommand[
beforeskip=-\baselineskip,
afterskip=.5\baselineskip]{section}
\RedeclareSectionCommand[
beforeskip=-.75\baselineskip,
afterskip=.5\baselineskip]{subsection}
\RedeclareSectionCommand[
beforeskip=-.5\baselineskip,
afterskip=.25\baselineskip]{subsubsection}
\RedeclareSectionCommand[
beforeskip=.5\baselineskip,
afterskip=-1em]{paragraph}
\RedeclareSectionCommand[
beforeskip=-.5\baselineskip,
afterskip=-1em]{subparagraph}
\usepackage{blindtext}
\begin{document}
\chapter{Erde}
Der eigentliche Text.\par
Test
\section{Europa}
Der eigentliche Text.
\subsection{Italien}
Der eigentliche Text.
\subsubsection{Toskana}
Der eigentliche Text.
\paragraph{Florenz}
Der eigentliche Text.
\subparagraph{Dom}
Der eigentliche Text
\end{document}
beforeskip
: The absolute value is the vertical space before the heading. If the value is negative the paragraph indent of the text following this heading is suppressed.
afterskip
: A positive value is a vertical skip below the heading. A negative value activates a run-in heading. Then the absolute value is the horizontal skip.
There is also a command \RedeclareSectionCommands
to change several section-like commands at once:
\documentclass{scrreprt}
\renewcommand*{\chapterheadstartvskip}{\vspace*{0cm}}
\renewcommand*{\chapterheadendvskip}{\vspace*{2\baselineskip}}
\RedeclareSectionCommands[
beforeskip=-.5\baselineskip,
afterskip=.25\baselineskip
]{section,subsection,subsubsection}
\RedeclareSectionCommands[
beforeskip=.5\baselineskip,
afterskip=-1em]{paragraph,subparagraph}
\begin{document}
\chapter{Erde}
Der eigentliche Text.\par
Test
\section{Europa}
Der eigentliche Text.
\subsection{Italien}
Der eigentliche Text.
\subsubsection{Toskana}
Der eigentliche Text.
\paragraph{Florenz}
Der eigentliche Text.
\subparagraph{Dom}
Der eigentliche Text
\end{document}
The result is the same as in the original answer.
With KOMA-Script version 3.14 you have to redefine the original commands (based on a suggestion by Markus Kohm). Note that the original definitions of this commands differ from KOMA-Script version to KOMA-Script version.
\documentclass[headings=small]{scrreprt}
\renewcommand*{\chapterheadstartvskip}{\vspace*{0cm}}
\renewcommand*{\chapterheadendvskip}{\vspace*{2\baselineskip}}
\makeatletter
%% check if this are the original definitions
\CheckCommand\section{%
\scr@startsection{section}{\sectionnumdepth}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
\setlength{\parfillskip}{\z@ plus 1fil}\fi
\raggedsection\normalfont\sectfont\nobreak\size@section}%
}
\CheckCommand\subsection{%
\scr@startsection{subsection}{\subsectionnumdepth}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
\setlength{\parfillskip}{\z@ plus 1fil}\fi
\raggedsection\normalfont\sectfont\nobreak\size@subsection
}%
}
\CheckCommand\subsubsection{%
\scr@startsection{subsubsection}{\subsubsectionnumdepth}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
\setlength{\parfillskip}{\z@ plus 1fil}\fi
\raggedsection\normalfont\sectfont\nobreak\size@subsubsection
}%
}
%% redefine
\renewcommand\section{%
\scr@startsection{section}{\sectionnumdepth}{\z@}%
{-.5\baselineskip}%
{.25\baselineskip}%
{\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
\setlength{\parfillskip}{\z@ plus 1fil}\fi
\raggedsection\normalfont\sectfont\nobreak\size@section}%
}
\renewcommand\subsection{%
\scr@startsection{subsection}{\subsectionnumdepth}{\z@}%
{-.5\baselineskip}%
{.25\baselineskip}%
{\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
\setlength{\parfillskip}{\z@ plus 1fil}\fi
\raggedsection\normalfont\sectfont\nobreak\size@subsection
}%
}
\renewcommand\subsubsection{%
\scr@startsection{subsubsection}{\subsubsectionnumdepth}{\z@}%
{-.5\baselineskip}%
{.25\baselineskip}%
{\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
\setlength{\parfillskip}{\z@ plus 1fil}\fi
\raggedsection\normalfont\sectfont\nobreak\size@subsubsection
}%
}
\makeatother
\begin{document}
\chapter{Erde}
Der eigentliche Text.\par
Test
\section{Europa}
Der eigentliche Text.
\subsection{Italien}
Der eigentliche Text.
\subsubsection{Toskana}
Der eigentliche Text.
\paragraph{Florenz}
Der eigentliche Text.
\subparagraph{Dom}
Der eigentliche Text
\end{document}
Second Update
Since version 3.20 you can use option tocbreakafternumber
in \RedeclareSectionCommands
to get a break after the sectioning numbers TOC.
\documentclass{scrreprt}[2016/04/09]
\RedeclareSectionCommands[
tocbreakafternumber,% <-
tocindent=0pt
]{chapter,section,subsection,subsubsection}
\renewcommand\chapterlinesformat[3]{\ifstr{#2}{}{}{#2\\*}#3}
\renewcommand*{\sectionlinesformat}[4]{%
\hspace*{#2}%
\parbox{\dimexpr\linewidth-#2\relax}{\raggedsection
\ifstr{#3}{}{}{#3\\}%
#4}%
}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\listoffigures
\Blinddocument
\begin{figure}%
Figure
\caption{A Figure}%
\end{figure}
\end{document}
The result is the same as in the pictures below.
Update
Since version 3.19 the recommended way to change the order or the layout of the sectioning numbers and text is redefining commands \chapterlinesformat
, \chapterlineswithprefixformat
, \sectionlinesformat
and \sectioncatchphraseformat
.
Additional I have tested the hack/workaround in my original answer for the TOC with the pre-release of the next KOMA-Script version (3.20). With this upcoming version simple redefining \numberline
has no effect. You could appended code to \numberline
but at the moment I would suggest to redefine \addtocentrydefault
. Maybe in the future there will be a special tocstyle
that defines your needed style for the toc entries automatically.
\documentclass[toc=flat]{scrreprt}[2015/10/03]
\renewcommand\chapterlinesformat[3]{\ifstr{#2}{}{}{#2\\*}#3}
\renewcommand*{\sectionlinesformat}[4]{%
\hspace*{#2}%
\parbox{\dimexpr\linewidth-#2\relax}{\raggedsection
\ifstr{#3}{}{}{#3\\}%
#4}%
}
\renewcommand\addtocentrydefault[3]{%
\ifstr{#2}{}{%
\addcontentsline{toc}{#1}{\protect\nonumberline#3}%
}{%
\addcontentsline{toc}{#1}{\protect\nonumberline#2\\*#3}%
}%
}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\listoffigures
\Blinddocument
\begin{figure}%
Figure
\caption{A Figure}%
\end{figure}
\end{document}
Original answer:
Somebody has asked Markus Kohm a similar question. So there is now a suggestion for the headings on the KOMA-Script website (German):
\documentclass[chapterprefix]{scrreprt}
\renewcommand*{\chapterformat}{\thechapter\autodot}
\RedeclareSectionCommand[innerskip=0pt]{chapter}
\makeatletter
\renewcommand*{\raggedsection}{\raggedright\renewcommand*{\@hangfrom}[1]{##1\\*}}
\makeatother
\usepackage{mwe}
\begin{document}
\Blinddocument
\end{document}
Note: This code is a workaround and uses KOMA-Script internals. It works with the current version 3.18 But maybe it will not work with future releases.
Additionally here is a workaround/hack for the table of contents also based on an idea of Markus:
\documentclass[chapterprefix,
toc=flat
]{scrreprt}
\renewcommand*{\chapterformat}{\thechapter\autodot}
\RedeclareSectionCommand[innerskip=0pt]{chapter}
\makeatletter
\renewcommand*{\raggedsection}{\raggedright\renewcommand*{\@hangfrom}[1]
{##1\\*}}
\makeatother
\BeforeStartingTOC[toc]{\renewcommand*{\numberline}[1]{#1\\*}}
\RedeclareSectionCommands[tocnumwidth=0pt]{chapter,section,subsection}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\listoffigures
\Blinddocument
\begin{figure}%
Figure
\caption{A Figure}%
\end{figure}
\end{document}
Or without toc=flat
:
Best Answer
The
parskip=half
option results in additional space after a section heading. So you have to useafterskip=1sp
together withparskip=half
.In addition the
\flushcolumns
command (used by themulticolumns
environment) may also insert additional white space. Thats why there is still a distance when I remove theparskip=half
option:To avoid this you can use
\raggedcolumns
.Code:
Update: You can change the
afterskip
for sections only inside themulticols
Environment. And maybe you can use there a parindent instead the parskip.Or you can use
parskip=full
insidemulticols