The following minimal working example is not giving me the desired results. I would like to keep the chapter titles layout, but without using the titlesec
package. The titlesec
package is interfering with the option headings=optiontotoc
. This becomes visible in the table of contents by showing empty entries instead of leaving them away.
Unfortunately my koma-script skills are strongly limited. Does anybody have an idea how to create the desired chapter titles layout with code only?
I also tried the loadonly
option provided by the titlesec package, which is producing errors.
Here is the minimal working example:
\documentclass[11pt,numbers=noenddot,headings=optiontotoc]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\renewcommand{\sffamily}{\rmfamily}
\usepackage{titlesec}
\titleformat{\chapter}[display]{\usekomafont{chapter}\bfseries\raggedleft}{\vspace{-3em} \textsc{Kapitel} \thechapter \vspace{1.5em}}{.5 em}{\vspace{-1em} \titlerule \vspace{.5em}}[\vspace{.5em} \titlerule]
\begin{document}
\tableofcontents
\chapter{Chapter}
\section{Section}
Hier folgt dann der Text
\subsection{Subsection}
Hier folgt dann der Text
\subsection{Subsection 2}
Hier folgt dann der Text
\chapter[]{Nullchapter}
Und hier folgt dann der Text
\section[]{Nullsection}
Und hier folgt dann der Text
\subsection[]{Nullsubsection}
Und hier folgt dann der Text
\end{document}
Desired Chapter Title Layout:
Empty Entries in TOC because of the titlesec package:
\chapter*{Title}
,\section*{Title}
and\subsection*{Title}
instead of\chapter[]{Nullchapter}
etc.titlesec
package and only use koma-script commands instead. Do you know a way to get the posted chapter title style with koma-script code?\chapterformat
command within KOMA classes, that sets up the style how the chapter title is formatted. Unfortunately, I am not an expert with KOMA :-(