[Tex/LaTex] Align numbered and unnumbered entries in ToC (Koma-Script)

indentationkoma-scripttable of contentstocstyle

In Koma-Script I use \addsec{.} to add section without numbers. However, with respect to my ToC this gives undesirable results, as the unnumbered section-title is aligned with the beginning of the ToC line. How do I make unnumbered section aligned with numbered section in the ToC?

\documentclass{scrartcl}
\usepackage{tocstyle}
\usetocstyle{nopagecolumn}
\selecttocstyleoption{tocflat}

\begin{document}

\tableofcontents{}
\hrulefill
\section{First section}

\section{Second section}

\subsection{A subsection}

\addsec{A section which should not have a number}
\end{document}

output

Best Answer

Add the tocstyle package option toctextentriesindented.

\documentclass{scrartcl}
\usepackage[toctextentriesindented]{tocstyle}
\usetocstyle{nopagecolumn}
\selecttocstyleoption{tocflat}

\begin{document}

\tableofcontents{}
\hrulefill
\section{First section}

\section{Second section}

\subsection{A subsection}

\addsec{A section which should not have a number}
\end{document}

enter image description here