This question is more or less a duplicate of this similarly named question, but is not exactly the same. I also want to place a horizontal rule below each section title (exactly like in the linked question). The answer to this existing question only shows how to achieve this using the titlesec
package.
However I am using the KOMA-Script class scrreprt
, and it is not recommended to use titlesec
and KOMA-Script together, as titlesec
breaks several KOMA-Script features and KOMA-Script complains about that in a warning.
It appears that \DeclareSectionCommand
can only change the vertical skip before / after the section title. Finally there exist commands like \At@startsection
to add something before the section title, but nothing to add anything after the section title.
Is there any way to make KOMA-Script print a rule after the section title without using the titlesec
package?
A small MWE:
\documentclass{scrreprt}
\begin{document}
\chapter{The first chapter}
\section{A nice section}
Some text
\end{document}
Desired result (rule doesn't have to be red):