Incompatibilities between KOMA-Script and titlesec
I've never used this combination myself, but a search with your favorite engine should show you that there are some incompatibilities, e.g. (all in German):
Paket
titlesec
und KOMA-Skript-Befehl\setindexpreamble
(it was originally a usenet post, but the archived Google groups version is broken; with an interesting answer of Markus Kohm, the author ofKOMA-Script
)\setpartpreamble
funktioniert nicht mittitlesec
?!titlesec
undscrpage
2 (on Markus Kohm's website with answer of him)Abstand Gliederungsziffer <-> Überschrift (again on komascript.de)
Paket
titlesec
und\dictum
aus KOMA-ScriptPlatz vor und nach Sections anpassen (again on Markus Kohm's website with answer of him)
See this answer of mine for an additional observed incompatibility: Can't shift/position \chapter with titlesec?.
Update in beginning of 2014
With recently published version 3.12 of KOMA-Script one will get a warning when compiling a document with titlesec
:
Class scrartcl Warning: Usage of package `titlesec' together (scrartcl) with a KOMA-Script class is not recommended. (scrartcl) I'd suggest to use the package only (scrartcl) if you really need it, because it breaks several (scrartcl) KOMA-Script features, i.e., option `headings' and (scrartcl) the extended optional argument of the section (scrartcl) commands .
The KOMA-Script
classes provide the commands \addpart
, \addchap
, and \addsec
which will start a new unnumbered part/chapter/section that is nevertheless added to the ToC. If you combine KOMA-Script
, titlesec
, and hyperref
, be sure to add a \phantomsection
in the after
argument of a \section
redefined with \titleformat
-- otherwise, the ToC links of \addsec
will point to the wrong page.
\documentclass{scrartcl}
\usepackage{titlesec}
% Incorrect ToC link to \addsec
% \titleformat{\section}{\Huge\sffamily}{\thesection}{0.5em}{}
% Correct ToC link to \addsec
\titleformat{\section}{\Huge\sffamily}{\thesection}{0.5em}{\phantomsection}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\clearpage
\section{foo}
\clearpage
\addsec{bar}
\end{document}
Currently, titlesec
(in version 2.10.1) is fully incompatible with KOMA script. The following minimal example doesn't even compile anymore:
\documentclass{scrartcl}
\usepackage{titlesec}
\begin{document}
\section{one}
\end{document}
My system shows the following errors:
! Missing number, treated as zero.
<to be read again>
}
l.5 \section{one}
?
! Illegal unit of measure (pt inserted).
<to be read again>
}
l.5 \section{one}
?
! Missing number, treated as zero.
<to be read again>
}
l.5 \section{one}
?
! Illegal unit of measure (pt inserted).
<to be read again>
}
l.5 \section{one}
?