# Incompatibilities between KOMA-Script and titlesec

This is a complementary question to About memoir and titlesec incompatibility. The titlesec manual states (p. 2) that the package

[...] works with the standard classes and with many others, including the AMS ones [...] Unfortunately, it is not compatible with memoir[...]

The manual does not mention the KOMA-Script classes. So, can titlesec and KOMA-Script be used together without problems, or are there some incompatibilities (or at least situations where special care must be taken)?

-
In general: What packages are incompatible with KOMA-Script?. – Speravir Feb 17 '14 at 23:37

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):

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 .

-
Months later … a short explanation: When I read lockstep’s question, I could darkly remember that there was some months ago a question in the usenet in de.comp.text.tex with an remarkable answer of Markus Kohm. By searching for that I found the linked questions and answers. – Speravir Mar 16 '12 at 21:02

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}
% \titleformat{\section}{\Huge\sffamily}{\thesection}{0.5em}{}
\titleformat{\section}{\Huge\sffamily}{\thesection}{0.5em}{\phantomsection}

\usepackage{hyperref}

\begin{document}

\tableofcontents

\clearpage

\section{foo}

\clearpage