Alternative classes

Reach for article and LaTeX hands you US letter paper; reach for scrartcl and you get A4. That one mismatched default is the visible edge of why the alternative classes exist — KOMA-Script and memoir, the two families people move to when the standard classes stop cooperating. KOMA-Script started in the early 1990s, when Frank Neukam, having read Jan Tschichold on book design, decided the standard document styles were not good enough and began writing a style family aimed at European and German typography; Markus Kohm rebuilt it for LaTeX2ε and released it as KOMA-Script on 7 July 1994. memoir came from a different instinct entirely: fold whole design packages into a single configurable class. This page covers what each is for, which knobs actually matter, and when switching is worth the trouble.

Why replace article, report and book

One reason: the standard classes offer almost no sanctioned entry point for changing the design. article / report / book are mature and reliable, but the moment you want different margins, headings, or headers and footers, you end up patching internals behind \makeatletter or stacking geometry, fancyhdr, titlesec and tocloft. Paper is one visible symptom: the KOMA-Script manual takes the trouble to state that KOMA-Script defaults to A4 in portrait orientation, in contrast to the standard classes, whose default is American letter. The standard classes themselves are covered on their own page.

KOMA-Script and memoir both answer that frustration, but differently. KOMA-Script is a set of replacement classes plus a configuration mechanism: you keep writing the body as before and change the design through options and dedicated commands. memoir is a monolithic book class: page layout, headers, chapter headings and the table of contents all live inside the class rather than in external packages. That difference shows up directly in how each gets along with helper packages, as we will see.

The KOMA-Script replacement classes: scrartcl, scrreprt, scrbook

KOMA-Script is a bundle of LaTeX2ε classes and packages maintained by Markus Kohm (the copy in TeX Live 2024 is version 3.41, dated 2023-07-07), built mainly around drop-in replacements for the standard classes. scrartcl corresponds to article, scrreprt to report, scrbook to book, with a dedicated scrlttr2 for letters. You write the body much as before (\section, \chapter), but the default typography is more polished and the hooks for configuration are wide open. So the first step of any migration is simply to change \documentclass{article} to \documentclass{scrartcl} and confirm the document still builds with nothing else touched.

KOMA classStandard class it replacesUse
scrartclarticlepapers and general short or medium documents
scrreprtreportreports and theses with chapters
scrbookbookbooks set for two-sided printing
scrlttr2letterletters (several letterheads and layouts can be defined)

There are two ways to pass settings: as class options in \documentclass[...]{scrartcl}, or after loading with \KOMAoptions{...}. KOMA-Script is built so that most options can still be changed after the class is loaded, and \KOMAoptions takes a comma-separated list of option=value pairs at once. Only when one option needs several values simultaneously do you use the singular \KOMAoption{option}{val1,val2}. That “changeable later” property is exactly what makes the type-area recalculation below work.

Calculating the type area: DIV and BCOR

In KOMA-Script you do not give margins in millimetres. The typearea package at the heart of its page design divides the page into a number of strips horizontally and vertically and derives the typeblock and the margins from those proportions. This mechanises the classical page construction popularised by Jan Tschichold, in which the proportions of the margins echo the proportions of the sheet: you decide how to divide the paper, not how many millimetres to leave. When you use a KOMA class, typearea is loaded for you, so you must not write \usepackage{typearea} yourself.

The number of strips is set by DIV=. As the manual explains, DIV=factor specifies how many strips the page is divided into horizontally and vertically while the type area is constructed. The key fact is that the larger the factor, the larger the text block and the smaller the margins — more text fits on a page. Any integer greater than 4 is valid. On A4 the default tracks the body size: 8 for 10pt, 10 for 11pt, 12 for 12pt. To have the value computed for your font, use DIV=calc; to approximate the medieval page canon that Tschichold and others wrote about, use DIV=classic.

The other knob is BCOR= (binding correction — the gutter). Give it the width that disappears into the spine when the book is bound; that amount is first subtracted from the type-area calculation and then added back to the inner (left) margin on output. The value may use any unit TeX understands, such as BCOR=10mm. The two are not independent: changing DIV or BCOR through \KOMAoptions recalculates the type area and the margins together — which is precisely what overwriting numbers with geometry does not do.

latex
\documentclass[DIV=12,BCOR=10mm]{scrartcl}
% DIV=12    wider text block (same divisor as the A4/12pt default)
% BCOR=10mm reserve 10mm of gutter for the binding
\usepackage[T1]{fontenc}
\usepackage{microtype}

\title{A Short Report}
\author{Ada Lovelace}

\begin{document}
\maketitle
\section{Introduction}
KOMA-Script keeps the body markup of article
while giving you DIV and BCOR for the page layout.
\end{document}

There is a pitfall if you load a font package later. Writing DIV=calc as a class option fixes the layout for the standard font, before yours is loaded — a KOMA class loads typearea itself, so by the time your \usepackage{...} changes the font the calculation is already done. After switching fonts, call \KOMAoptions{DIV=last} (or DIV=current) in the preamble and the layout is recomputed for the new font.

Reworking element fonts and headings

KOMA-Script lets you set the font for each document element — headings, captions and so on — in one place. \setkomafont{element}{commands} replaces that element’s font definition outright, while \addtokomafont{element}{commands} merely extends the existing one (and \usekomafont{element} switches the current font to that element’s). Keep commands to things that only change font attributes, such as \sffamily, \bfseries or \Large, and declare both in the preamble. Slip a typesetting command such as \centering in there and it fires in unexpected places every time the element is used.

To rework the design of a sectioning command itself — the space before and after, the font, how the number appears — use \RedeclareSectionCommand[attributes]{name}. It is the sanctioned entry point for redefining the attributes of an existing \section or \chapter through a comma-separated list of key=value settings. For headers and footers the recommended companion is scrlayer-scrpage, whose \lehead, \cohead and \rohead let you fill each “left/centre/right” × “even/odd page” slot independently. Running heads in general are covered on the headers and footers page.

Why KOMA warns about fancyhdr but says nothing about geometry

Stacking a standard-class helper package on top collides with KOMA-Script’s own interfaces. For fancyhdr the class says so in the log, in plain words: Class scrartcl Warning: Usage of package 'fancyhdr' together with a KOMA-Script class is not recommended. It then recommends scrlayer or scrlayer-scrpage and spells out the reason — with fancyhdr in play, options such as headsepline and footsepline, and the use of \setkomafont and \addtokomafont on page-style elements, stop working without manual intervention.

Add geometry, however, and KOMA-Script says nothing at all. Write \usepackage[margin=2cm]{geometry} after \documentclass{scrartcl} and the document compiles while the type area typearea computed is quietly overwritten. The silent case is the more dangerous one. So when you want different margins under a KOMA class, first see whether DIV and BCOR get you there; reach for geometry only when they cannot, and do so knowing you have given up the typearea calculation. By the same logic titlesec overlaps with \RedeclareSectionCommand, and tocloft with KOMA’s own table-of-contents options.

memoir — the book class that swallowed the packages

memoir was released by Peter Wilson in 2001 and has been maintained by Lars Madsen since 2013 (the copy in TeX Live 2024 is v3.8.2, dated 2024-01-26, and describes itself as a configurable book, report and article class). It does not extend the standard book by loading it — memoir.cls contains no \LoadClass at all — but is written as a self-contained class that replaces book and report. Its defining trait is how much it absorbs: according to its manual the class itself provides functions similar to crop, fancyhdr, geometry, sidecap, subfigure and titlesec, and it incorporates line-spacing control equivalent to setspace (under different command names). On top of that it automatically loads array, dcolumn, delarray, tabularx, booktabs, nameref and shortvrb, among others.

Why build it that way? Lars Madsen, who took over maintenance, explains it himself in the manual’s opening remarks: back in 2001, updating a package outside the yearly distribution had to be done by hand, and CTAN did not even require a manual with a package. Embedding the functionality of several packages in the class and documenting all of it in one book therefore made sense. Now that the situation has changed, he is unwinding that embedding — in the summer of 2023, for instance, he moved booktabs from being embedded to simply being loaded. From version 3.8 memoir requires a LaTeX kernel released 2021/06/01 or later and halts the compilation if it finds an older one, so that users notice rather than ignore it.

The page layout is assembled with dedicated commands. \setlrmarginsandblock{spine}{edge}{ratio} sets the left and right (spine and fore-edge) margins and \setulmarginsandblock{upper}{lower}{ratio} the upper and lower ones; the page width stays fixed and the typeblock follows from them. The third argument is a ratio, and you may put * for a value you would rather have computed. Here is memoir’s biggest trap: these declarations do nothing on their own. Only when you call \checkandfixthelayout after them does the layout take effect (internally it checks the specification with \checkthelayout and then applies it with \fixthelayout). Most reports of “I set the values but the page did not change” are that missing line.

Chapter-heading design is switched with \chapterstyle{style}, which works like \pagestyle: it sets the style of subsequent chapter headings. The copy of memoir.cls in TeX Live 2024 defines about thirty styles with \makechapterstyledefault (the familiar book look), section (number and title on one line), hangnum (chapter number hung in the margin), companion (the look of The LaTeX Companion), plus bringhurst, madsen, komalike and others whose names give away their origin. To build your own, add it with \makechapterstyle{name}{definition}. Most of memoir’s popularity in book design comes from exactly this: you can start by choosing from thirty ready-made designs.

latex
\documentclass[11pt,a4paper,twoside]{memoir}

% page layout -- nothing takes effect until \checkandfixthelayout
\setlrmarginsandblock{30mm}{25mm}{*}  % spine, fore-edge
\setulmarginsandblock{30mm}{35mm}{*}  % upper, lower
\checkandfixthelayout

\chapterstyle{hangnum}

\begin{document}
\chapter{Beginnings}
memoir bundles page layout, headers and chapter styles
into one configurable book class.
\end{document}

KOMA-Script or memoir: which to choose

The deciding question is whether the document needs a coherent design of its own. For a natural step up from the standard classes — papers, reports — where you want polished default typography and the clear page control of DIV and BCOR, take KOMA-Script. For designing a single book down to the details, take memoir, where layout, running heads, chapter styles and the table of contents all live inside the class. Their philosophies genuinely differ, so do not mix them; pick one per document. And switching pays off when the design changes keep coming rather than happening once. If all you want is to shave a centimetre off the margins one time, adding geometry to a standard class finishes faster. And if what you are making is slides, neither of these applies: that is the territory of the separate beamer class.

What to use for Japanese documents

For documents that are mostly Japanese, use neither KOMA-Script nor memoir but a class specialised for Japanese typesetting. Line spacing, kinsoku (line-break prohibition) and the spacing between Japanese and Latin characters are the province of dedicated classes; the design philosophies of KOMA-Script and memoir do not extend that far. There are two lines to choose from. jsarticle / jsbook (the jsclasses) declare \NeedsTeXFormat{pLaTeX2e} and therefore require a pLaTeX-family format, with ltjsarticle / ltjsbook as the LuaLaTeX counterparts. The other is jlreq, which implements the W3C document “Requirements for Japanese Text Layout” and runs on standard LaTeX2ε. Each has its own page here.

How to migrate from a standard class

The one trick when moving an existing manuscript is not to redesign everything at once. First change only the class name — article to scrartcl, book to memoir — and confirm the body still compiles untouched. If it fails at this stage the cause is not the design but a helper package you left in. Once it builds, adjust margins, then running heads, then headings, then the table of contents, one at a time, comparing the PDF after each step. Observe the four points below and the migration usually ends quietly.

  • KOMA-Script — before reaching for geometry, see whether DIV and BCOR solve it; for running heads use scrlayer-scrpage, not fancyhdr.
  • memoir — always end the layout declarations with \checkandfixthelayout. Without it the declarations are ignored.
  • Both — do not stack standard-class helper packages such as titlesec, fancyhdr or tocloft on top; the class has its own entry point for the same job.
  • Japanese manuscripts — do not apply Western design assumptions to Japanese body text; consider jsclasses or jlreq first.
latex
% Keep every design knob in one place, with a reason next to it
\KOMAoptions{DIV=12,BCOR=8mm}   % 12pt-like text block, 8mm gutter
% \RedeclareSectionCommand[beforeskip=-2ex]{section}

% For memoir, set every layout knob BEFORE the check
% \setlrmarginsandblock{30mm}{25mm}{*}
% \setulmarginsandblock{30mm}{35mm}{*}
% \checkandfixthelayout

One last habit, unglamorous but effective. In a manuscript using KOMA-Script or memoir you will try margins and headings repeatedly while writing. Keep those adjustments out of the body and gather them into small preamble sections — “page layout”, “headings”, “running heads” — with a one-line comment saying why each value is what it is. When a publisher or a conference later demands specific dimensions, the time you would have spent hunting for the responsible line disappears entirely.