I am currently doing the following in order to obtain a rule below each section title in a KOMA Article.
\documentclass[]{scrartcl}
% RULE BELOW SECTION TITLES
\makeatletter
\renewcommand{\sectionlinesformat}[4]{%
\ifstr{#1}{section}{%
\parbox[t]{\linewidth}{%
\raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
\kern-1.00\ht\strutbox\rule{\linewidth}{.8pt}%
}%
}{%
\@hangfrom{\hskip #2#3}{#4}}%
}
\makeatother
\begin{document}
\section{Whatever}
\subsection{Whatever else}
\end{document}
This is the output:
I have tried to modify this approach to obtain a dotted rule below every subsection title, but I haven’t succeeded.
Could you please help me generate a dotted rule below every subsection title?