With KOMA-Script classes you do not need nor should use an extra package to redefine sectioning commands or define new sectioning levels. And you don't need and should not use low level code.
These classes provide command \RedeclareSectionCommand
to reconfigure existing sectioning commands. For example to have a \paragraph
that does not produce a title at the beginning of the paragraph (a so called catch phrase or runin title) but a displayed title, you can use:
\RedeclareSectionCommand[runin=false,afterskip=1ex,afterindent=false]{paragraph}
Option runin=false
is used to make it a displayed instead of a runin title. afterskip=1ex
makes a vertical skip of 1ex after the heading. afterindent=false
prevents the following paragraph to be indented.
So the result would be something like:
If you need a paragraph number, just add
\setcounter{secnumdepth}{\paragraphnumdepth}
very ease with KOMA-Script. You don't need to remember the numeric value.
You can do a similar change for \subparagraph
:
\RedeclareSectionCommand[indent=0pt,runin=false,afterskip=1ex,afterindent=false]{subparagraph}
Here additionally indent=0pt
is used to remove the default indent of subparagraph titles.
If this is not enough, you can even define a \subsubparagraph
very easily:
\DeclareNewSectionCommand[style=section,level=\numexpr \subparagraphnumdepth+1\relax,runin=false,beforeskip=1ex,afterskip=0pt,afterindent=false]{subsubparagraph}
See the KOMA-Script manual for the meaning of all the options and how to use them and all the other available options.
BTW: After defining \subsubparagraph
there is also a \subsubparagraphnumdepth
(and even a \subsubparagraphtocdepth
) that can be used to change secnumdepth
.
\newsectionstyle[\subsubsection][4]{\subsubsubsection}
\renewsectionstyle[\subsubsection]{\paragraph}
or something along those lines. I understand that more powerful commands exist, but this specific feature seems to have gotten a large number of views and may be something to which a very basic user would like easy access.