If You Use KOMA-Script, Really Do Use KOMA-Script
KOMA-Script is Omakase. If you trust the package, you’re in good hands to get consistent output from compiling LaTeX documents.
I’ve been using Markus Kohm’s KOMA-Script for most of my life with LaTeX in some way or another because the package’s document classes really nail typical German typesetting requirements, e.g. requirements of DIN letter formats (yes, there is a standard for layout and typesetting of letters!). And the scrbook
document class ships with tasteful defaults for book typesetting.
Since I’m not a LaTeX expert, I’m still looking up quick fix solutions to particular problems. “How do I make the chapter titles larger?” or “How do I change the page heading on the left page of a spread?” – and StackOverflow delivers many tips.
But most of them aren’t actually compatible with KOMA-Script. Instead, Markus Kohm and contributors (Frank Neukam and Axel Kielhorn are explicitly mentioned in the manual) introduced almost infinite options to the package itself. These options make a lot of other packages obsolete.
Loading many different packages introduces inconsistencies and incompatibilities unless they were explicitly addressed by package authors. Instead of supporting all these 3rd party packages, KOMA-Script offers important options directly.
I noticed this when I cleaned up the document output and prepared for a final layout, looking at LaTeX log warnings. KOMA-Script would print the following when you combine its document classes with the titlesec
and titleps
, used to customize chapter title formats:
Class scrbook Warning: Usage of package `titlesec' together
(scrbook) with a KOMA-Script class is not recommended.
(scrbook) I'd suggest to use KOMA-Script features
(scrbook) like \setkomafont, \RedeclareSectionCommand, \sectionlinesformat
(scrbook) and several others to re-configure section
(scrbook) headings.
(scrbook) Nevertheless, using requested
(scrbook) package `titlesec' on input line 302.
(/usr/local/texlive/2024/texmf-dist/tex/latex/titlesec/titlesec.sty
Class scrbook Warning: Usage of package `titleps' together
(scrbook) with a KOMA-Script class is not recommended.
(scrbook) I'd suggest to use package `scrlayer-scrpage'.
(scrbook) Nevertheless, using requested
(scrbook) package `titleps' on input line 1422.
(/usr/local/texlive/2024/texmf-dist/tex/latex/titlesec/titleps.sty))
That’s actually very useful information, and going through these messages taught me how to look up topics in the 567 page KOMA-Script manual. It’s huge and intimidating. It’s also well-written. I needed to read it for a while and check things here and there to get a feel for it.
I also noticed how annoying reading a 500+ page manual as a PDF is: you can’t open tabs to look at multiple pages at the same time. Web browsers and HTML manuals broke my expectations for reading large works. PDF is good for sequential reading and narration; hypertext with proper reading tools is much better for manuals.
I’m not used to reading manuals anymore, I noticed. But this one was good. It explains all technical pieces and addresses user needs. Reading parts of the KOMA-Script manual taught me in a cohesive way how to customize typesetting with the package’s options. There is no need to cobble together multiple packages or package alternatives, because the authors really thought of most things. And since the manual is a cohesive piece with cross-references, they do actually offer tips to combine settings and pick up common (and asinine) requests and how to implement them.
You can’t get that kind of learning experience from a narrowly focused package. Its documentation focuses on the one package itself, so the task of combining packages tastefully is left as an exercise for the reader. You find these tips on message boards, StackOverflow, and the occasional tutorial/guide.
That being said, the lstlisting
package is a notable exception. It’s used to typeset code listings, and goes out of its way to mention how to combine its affordances with other packages for commonly desired output, like how to put graphical frames around code. As a reader on a mission to typeset code, that’s exactly what I want to learn. This is great.
Some package manuals focus on listing all their settings without explaining why you’d want to use any of them. So as a newbie, you’re screwed. Technical writing is hard.
Embrace KOMA-Script
Resolving issues like the warning above taught me this:
- If you start with KOMA-Script document classes, stick to KOMA-Script package options.
- Introduce as few packages as possible to avoid conflicts.
And when in doubt, do use a popular solution for non-KOMA-Script documents and then watch the LaTeX output warnings for feedback. Sometimes, KOMA-Script will teach you how to do the same thing without another dependency instead.
The KOMA-Script bundle offers a monolithic approach to typesetting documents, but it’s an approach that reduced surprises in the PDF output for me and made the setup simpler overall. The fewer independent pieces you introduce, the fewer failing combinations you’ll get.