0% found this document useful (0 votes)
175 views567 pages

Koma Script

Uploaded by

Anders
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
175 views567 pages

Koma Script

Uploaded by

Anders
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 567

KOMA - Script

a versatile LATEX 2ε bundle

Note: This document is a translation of the German KOMA-Script manual. Several


authors have been involved to this translation. Some of them are native English speakers.
Others, like me, are not. Improvements of the translation by native speakers or experts are
welcome at all times!
The Guide

KOMA - Script

Markus Kohm

2021-11-09

Authors of the KOMA - Script Bundle: Frank Neukam, Markus Kohm, Axel Kielhorn
Legal Notes:
There is no warranty for any part of the documented software. The authors have taken
care in the preparation of this guide, but make no expressed or implied warranty of any kind
and assume no responsibility for errors or omissions. No liability is assumed for incidental
or consequential damages in connection with or arising out of the use of the information or
programs contained here.
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and the authors were
aware of a trademark claim, the designations have been printed with initial capital letters or
in all capitals.

English translation of this manual by: Markus Kohm, Karl Hagen, DeepL, Kevin Pfeif-
fer, Gernot Hassenpflug, Krickette Murabayashi, Jens-Uwe Morawski, Jana Schubert, Jens
Hühne, Harald Bongartz, Georg Grandke, Raimund Kohl, Stephan Hennig, Alexander Wil-
land, Melvin Hendrix, and Arndt Schubert.

Free screen version without any optimization of paragraph and page breaks
This guide is part of KOMA-Script, which is free under the terms and conditions of LATEX
Project Public License Version 1.3c. A version of this license, which is valid for KOMA-
Script, is part of KOMA-Script (see lppl.txt). Distribution of this manual — even if it is
printed — is allowed provided that all parts of KOMA-Script are distributed with it. Distri-
bution without the other parts of KOMA-Script requires an explicit, additional authorization
by the authors.
To all my friends all over the world!
Preface to KOMA - Script 3.28 7

Preface to KOMA - Script 3.28

The KOMA-Script 3.28 manual, — not only the German version — once again benefits from
the fact that a new edition of the print version [Koh20a] and the eBook version [Koh20b] will
be published at almost the same time as this version. This has led to many improvements
which also affect the free manual, in both the German and the English version.
In KOMA-Script 3.28 there are also some significant changes. In some cases, compatibility
with earlier versions has been waived. Thus a recommendation from the ranks of The LaTeX
Project Team regarding \if... statements is complied with. If you use such statements, you
should refer to the manual again.
It is not just about the manual that I now receive little criticism. I conclude from this
fact that KOMA - Script has reached the level that it fulfils all desires. At the same time, the
project has — not only starting with the current release — reached a scale that makes it almost
impossible for a single person to accomplish

• the search for and elimination of errors,

• the development and implementation of new functions,

• the observation of changes in other packages and the LATEX kernel with regard to effects
on KOMA - Script,

• the rapid response to such changes,

• the maintenance of the guides in two languages,

• help for beginners far beyond the functions of KOMA - Script down to the basic operation
of a computer,

• assistance in the implementation of tricky solutions for advanced users and experts,

• moderation and participation in the maintenance of a forum for all kind of help around
KOMA- Script.

While I am personally have most fun with the development of new functions, I consider
troubleshooting in existing features, compatibility with new LATEX kernel versions, and above
all instructing users for the most important tasks. Therefore I will focus in the future on
and new functions will be available only in exceptional cases. Therefore already in KOMA -
Script 3.28 some experimental functions and packages have been removed. In future releases
this should be continued.
This, of course, also reduces the effort for the documentation of new functions. Readers
of this free, screen version, however, still have to live with some restrictions. So some infor-
mation — mainly intended for advanced users or capable of turning an ordinary user into an
Preface to KOMA - Script 3.28 8

advanced one — is reserved for the printed book, which currently exists only in German. As a
result, some links in this manual lead to a page that simply mentions this fact. In addition, the
free version is scarcely suitable for making a hard-copy. The focus, instead, is on using it on
screen, in parallel with the document you are working on. It still has no optimized wrapping
but is almost a first draft, in which both the paragraph and page breaks are in some cases
quite poor. Corresponding optimizations are reserved for the German book editions.
Another important improvement to the English guide has been accomplished by Karl Ha-
gen, who has continued the translation of the entire manual. Many, many thanks to him!
Everything that is fine in this English manual is because of him. Everything that is not good
in this manual — like the translation of this preface — is because of me. Additional editors or
translators, however, would still be welcome!
But the biggest thanks go to my family and above all to my wife. They absorb all my
unpleasant experiences on the Internet. They have also tolerated it for more than 25 years,
when I am again not approachable, because I am completely lost in KOMA - Script or some
LATEX problems. The fact that I can afford to invest an incredible amount of time in such a
project is entirely thanks to my wife.

Markus Kohm, Neckarhausen in the foggy December of 2019.


Contents 9

Contents

Preface to KOMA - Script 3.28 7

1. Introduction 21
1.1. Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.2. Structure of the Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.3. History of KOMA - Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.4. Special Thanks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.5. Legal Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.6. Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.7. Bug Reports and Other Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.8. Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Part I:
KOMA - Script for Authors 27

2. Calculating the Page Layout with typearea 28


2.1. Fundamentals of Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.2. Constructing the Type Area by Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.3. Constructing the Type Area by Describing a Circle . . . . . . . . . . . . . . . . . . . . 31
2.4. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.5. Compatibility with Earlier Versions of KOMA - Script . . . . . . . . . . . . . . . . . . . 33
2.6. Adjusting the Type Area and Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.7. Selecting the Paper Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.8. Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

3. The Main Classes: scrbook, scrreprt, and scrartcl 54


3.1. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.2. Compatibility with Earlier Versions of KOMA - Script . . . . . . . . . . . . . . . . . . . 56
3.3. Draft Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.4. Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.5. Choosing the Document Font Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.6. Text Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.7. Document Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.8. Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.9. Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.10. Marking Paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.11. Detecting Odd and Even Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Contents 10

3.12. Headers and Footers Using Predefined Page Styles . . . . . . . . . . . . . . . . . . . . . 80


3.13. Interleaf Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.14. Footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.15. Book Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.16. Document Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.17. Dicta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.18. Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
3.19. Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
3.20. Floating Environments for Tables and Figures . . . . . . . . . . . . . . . . . . . . . . . . 127
3.21. Marginal Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
3.22. Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
3.23. Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
3.24. Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

4. Letters with the scrlttr2 Class or the scrletter Package 152


4.1. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
4.2. Compatibility with Earlier Versions of KOMA - Script . . . . . . . . . . . . . . . . . . . 153
4.3. Draft Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
4.4. Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
4.5. Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
4.6. Pseudo-lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
4.7. General Structure of Letter Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
4.8. Choosing the Document Font Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
4.9. Text Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
4.10. Letterhead Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
4.10.1. Fold Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
4.10.2. Letterhead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
4.10.3. Addressee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
4.10.4. Extra Sender Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
4.10.5. Reference Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
4.10.6. Subject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
4.10.7. Closing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
4.10.8. Letterhead Page Footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
4.11. Marking Paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
4.12. Detecting Odd and Even Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
4.13. Headers and Footers with the Default Page Style . . . . . . . . . . . . . . . . . . . . . . 228
4.14. Interleaf Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
4.15. Footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
4.16. Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
4.17. Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Contents 11

4.18. Floating Environments for Tables and Figures . . . . . . . . . . . . . . . . . . . . . . . . 241


4.19. Marginal Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
4.20. Letter Class Option Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
4.21. Address Files and Form Letters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

5. Headers and Footers with scrlayer-scrpage 254


5.1. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
5.2. Header and Footer Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
5.3. Text Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
5.4. Using Predefined Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.5. Manipulating Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268

6. The Day of the Week with scrdate 279

7. The Current Time with scrtime 284

8. Accessing Address Files with scraddr 286


8.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
8.2. Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
8.3. Package Warning Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288

9. Creating Address Files from an Address Database 290

10. KOMA - Script Features for Other Classes with scrextend 291
10.1. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
10.2. Compatibility with Earlier Versions of KOMA - Script . . . . . . . . . . . . . . . . . . . 293
10.3. Optional, Extended Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
10.4. Draft Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
10.5. Choosing the Document Font Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
10.6. Text Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
10.7. Document Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
10.8. Detecting Odd and Even Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
10.9. Choosing a Predefined Page Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
10.10. Interleaf Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
10.11. Footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
10.12. Dicta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
10.13. Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
10.14. Marginal Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

11. Support for the Law Office with scrjura 310


11.1. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Contents 12

11.2. Text Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311


11.3. Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
11.4. Environment for Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
11.4.1. Clauses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
11.4.2. Paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
11.4.3. Sentences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
11.5. Cross-References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
11.6. Additional Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
11.7. Support for Different Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
11.8. A Detailed Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
11.9. State of Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330

Part II:
KOMA - Script for Advanced Users and Experts 332

12. Basic Functions in the scrbase Package 333


12.1. Loading the Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
12.2. Keys as Attributes of Families and Their Members . . . . . . . . . . . . . . . . . . . . 333
12.3. Conditional Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
12.4. Defining Language-Dependent Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
12.5. Identifying KOMA - Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
12.6. Extensions to the LATEX Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
12.7. Extensions to the Mathematical Features of ε-TEX . . . . . . . . . . . . . . . . . . . . . 356
12.8. General Mechanism for Multi-Level Hooks . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
12.9. Obsolete Options and Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

13. Controlling Package Dependencies with scrlfile 361


13.1. About Package Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
13.2. Actions Before and After Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
13.3. Replacing Files at Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
13.4. Preventing File Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

14. Economising and Replacing Files with scrwfile 372


14.1. Fundamental Changes to the LATEX Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
14.2. The Single-File Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
14.3. The File Cloning Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
14.4. Note on the State of Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
14.5. Known Package Incompatibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Contents 13

15. Managing Content Lists with tocbasic 376


15.1. Basic Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
15.2. Creating a Content List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
15.3. Configuring Content-List Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
15.4. Internal Commands for Class and Package Authors . . . . . . . . . . . . . . . . . . . . 402
15.5. A Complete Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
15.6. Everything with Only One Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
15.7. Obsolete Befehle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413

16. Improving Third-Party Packages with scrhack 414


16.1. Development Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
16.2. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
16.3. Using tocbasic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
16.4. Incorrect Assumptions about \@ptsize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
16.5. Older Versions of hyperref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
16.6. Inconsistent Handling of \textwidth and \textheight . . . . . . . . . . . . . . . . . 417
16.7. Special Case for nomencl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
16.8. Special Case for Section Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417

17. Defining Layers and Page Styles with scrlayer 419


17.1. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
17.2. Generic Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
17.3. Declaring Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
17.4. Declaring and Managing Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
17.5. Header and Footer Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
17.6. Manipulating Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
17.7. Defining and Managing Interfaces for End Users . . . . . . . . . . . . . . . . . . . . . . 448

18. Additional Features of scrlayer-scrpage 449


18.1. Manipulating Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
18.2. Defining New Pairs of Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
18.3. Defining Complex Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
18.4. Defining Simple Page Styles with a Tripartite Header and Footer . . . . . . . . . 456
18.5. Legacy Features of scrpage2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457

19. Note Columns with scrlayer-notecolumn 458


19.1. Note about the State of Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
19.2. Early or Late Selection of Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
19.3. Text Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
19.4. Declaring New Note Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
19.5. Making a Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Contents 14

19.6. Forced Output of Note Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469

20. Additional Information about the typearea package 472


20.1. Experimental Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
20.2. Expert Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
20.3. Local Settings with the typearea.cfg File . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
20.4. More or Less Obsolete Options and Commands . . . . . . . . . . . . . . . . . . . . . . . 475

21. Additional Information about the Main Classes and scrextend 476
21.1. Extensions to User Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
21.2. KOMA - Script’s Interaction with Other Packages . . . . . . . . . . . . . . . . . . . . . . 476
21.3. Detection of KOMA - Script Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
21.4. Entries to the Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
21.5. Font Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
21.6. Paragraph Indention or Gap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
21.7. Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
21.8. Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
21.9. Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
21.10. More or Less Obsolete Options and Commands . . . . . . . . . . . . . . . . . . . . . . . 504

22. Additional Information about the scrlttr2 Class and the scrletter Package 505
22.1. Variables for Experienced Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
22.2. Additional Information about Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
22.3. lco Files for Experienced Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
22.4. Language Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
22.5. Obsolete Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515

A. Japanese Letter Support for scrlttr2 516


A.1. Japanese standard paper and envelope sizes . . . . . . . . . . . . . . . . . . . . . . . . . . 516
A.1.1. Japanese paper sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
A.1.2. Japanese envelope sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
A.2. Provided lco files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
A.3. Examples of Japanese Letter Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
A.3.1. Example 1: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
A.3.2. Example 2: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524

Change Log 525

Bibliography 538
Contents 15

Index 543
General Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Index of Commands, Environments, and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 547
Index of Lengths and Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Index of Elements Capable of Adjusting Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
Index of Files, Classes, and Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Index of Class and Package Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Index of Do-Hooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
List of Figures 16

List of Figures

2.1. Two-sided layout with the box construction of the classical nine-part division,
after subtracting a binding correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

3.1. Parameters that control the footnote layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92


3.3. Example: Using \captionaboveof inside another floating environment . . . . . . 134
3.2. Example: A rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
3.4. Example: Figure beside description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
3.5. Example: Description centered beside figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
3.6. Example: Figure title top beside . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
3.7. Example: Default caption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
3.8. Example: Caption with partially hanging indention . . . . . . . . . . . . . . . . . . . . . . 139
3.9. Example: Caption with hanging indention and line break . . . . . . . . . . . . . . . . . 139
3.10. Example: Caption with indention in the second line . . . . . . . . . . . . . . . . . . . . . 139

4.1. Schematic of the pseudo-lengths for a letter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166


4.2. General structure of a letter document containing several individual letters . . . 168
4.3. General structure of a single letter within a letter document . . . . . . . . . . . . . . . 169
4.4. Example: letter with recipient and salutation . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
4.5. Example: letter with recipient, opening, text, and closing . . . . . . . . . . . . . . . . . 174
4.6. Example: letter with recipient, opening, text, closing, and postscript . . . . . . . . 175
4.7. Example: letter with recipient, opening, text, closing, postscript, and distribu-
tion list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
4.8. Example: letter with recipient, opening, text, closing, postscript, distribution
list, and enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
4.9. Example: letter with address, salutation, text, closing phrase, postscript, en-
closures, distribution list, and noxiously large font size . . . . . . . . . . . . . . . . . . . 181
4.10. schematic display of the letterhead page outlining the most important com-
mands and variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
4.11. Example: letter with recipient, opening, text, closing, postscript, distribution
list, enclosure, and hole-punch mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
4.12. Example: letter with sender, recipient, opening, text, closing, postscript, dis-
tribution list, and enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
4.13. Example: letter with sender, rule, recipient, opening, text, closing, signature,
postscript, distribution list, enclosure, and hole-punch mark . . . . . . . . . . . . . . . 196
4.14. Example: letter with extra sender information, rule, recipient, opening, text,
closing, signature, postscript, distribution list, enclosure, and hole-punch mark;
standard vs. extended letterhead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
List of Figures 17

4.15. Example: letter with extra sender information, rule, recipient, opening, text,
closing, signature, postscript, distribution list, enclosure, and hole-punch mark;
left- vs. right-aligned letterhead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
4.16. Example: letter with extra sender information, logo, rule, recipient, opening,
text, closing, signature, postscript, distribution list, enclosure, and hole-punch
mark; left-aligned vs. right-aligned vs. centred sender information . . . . . . . . . . 203
4.17. Example: letter with extended sender, logo, recipient, extra sender informa-
tion, opening, text, closing, signature, postscript, distribution list, enclosure,
and hole-punch mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
4.18. Example: letter with extended sender, logo, recipient, extra sender informa-
tion, location, date, opening, text, closing, signature, postscript, distribution
list, enclosure, and hole-punch mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
4.19. Example: letter with extended sender, logo, recipient, extra sender informa-
tion, place, date, subject, opening, text, closing, signature, postscript, distri-
bution list, enclosure, and hole-punch mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
4.20. Example: letter with extended sender, logo, recipient, extra sender informa-
tion, place, date, subject, opening, text, closing, modified signature, postscript,
distribution list, enclosure, and hole-punch mark . . . . . . . . . . . . . . . . . . . . . . . . 223
4.21. Example: letter with extended sender, logo, recipient, extra sender informa-
tion, place, date, subject, opening, text, closing, modified signature, postscript,
distribution list, enclosure, and hole-punch mark using an lco file . . . . . . . . . . 245

5.1. Commands for setting the page header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261


5.2. Commands for setting the page footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263

11.1. Example: First three pages of the example club by-laws of section 11.8 . . . . . . 331

15.1. Illustrations of some attributes of a TOC entry with the dottedtocline style . 389
15.2. Illustrations of some attributes of a TOC entry with style largetocline . . . . . 390
15.3. Illustrations of some attributes of a TOC entry with the tocline style . . . . . . . 390
15.4. Illustration of some attributes of the undottedtocline style with the example
of a chapter title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391

19.1. A sample page for the example in chapter 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . 471


List of Tables 18

List of Tables

2.1. Type area dimensions dependent on DIV for A4 . . . . . . . . . . . . . . . . . . . . . . . . . 36


2.2. DIV defaults for A4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.3. Symbolic values for the DIV option and the DIV argument to \typearea . . . . . 39
2.4. Symbolic BCOR arguments for \typearea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.5. Standard values for simple switches in KOMA - Script . . . . . . . . . . . . . . . . . . . . . 42
2.6. Output driver for option pagesize=output driver . . . . . . . . . . . . . . . . . . . . . 51

3.1. Class correspondence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54


3.2. Elements whose font style can be changed in scrbook, scrreprt or scrartcl with
\setkomafont and \addtokomafont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.3. Font defaults for the elements of the title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.4. Main title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.5. Available values for the toc option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.6. Default font styles for the elements of the table of contents . . . . . . . . . . . . . . . . 76
3.7. Available values of option parskip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.8. Default values for page style elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.9. Macros to set up the page style of special pages . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.10. Available numbering styles of page numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.11. Available values for the footnotes option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.12. Available values for the open option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.13. Available values for the headings option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.14. Available values for the numbers option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.15. Default font sizes for different levels of document sectioning . . . . . . . . . . . . . . . 104
3.16. Default settings for the elements of a dictum . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
3.17. Available values for the captions option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
3.18. Font defaults for the elements of figure or table captions . . . . . . . . . . . . . . . . . . 132
3.19. Example: Measure of the rectangle in figure 3.2 . . . . . . . . . . . . . . . . . . . . . . . . . 134
3.20. Alignments for multi-line captions of floating environments . . . . . . . . . . . . . . . . 141
3.21. Available values for the listof option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
3.22. Available values for the bibliography option . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.23. Available values for the index option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

4.1. Supported variables in scrlttr2 and scrletter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156


4.2. Pseudo-lengths provided by scrlttr2 and scrletter . . . . . . . . . . . . . . . . . . . . . . . . . 161
4.3. Elements whose font style can be changed in the scrlttr2 class or the scrletter
package with the \setkomafont and \addtokomafont commands . . . . . . . . . . . 182
4.4. Combinable values for configuring fold marks with the foldmarks option . . . . . 187
4.5. Available values for the fromalign option with scrlttr2 . . . . . . . . . . . . . . . . . . . 192
List of Tables 19

4.6. Available values for the fromrule option with scrlttr2 . . . . . . . . . . . . . . . . . . . . 192
4.7. Default descriptions of the letterhead variables . . . . . . . . . . . . . . . . . . . . . . . . . . 198
4.8. Default descriptions and contents of the letterhead separators without the
symbolicnames option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
4.9. Available values for the addrfield option with scrlttr2 . . . . . . . . . . . . . . . . . . . 205
4.10. Default font styles for the elements of the address field. . . . . . . . . . . . . . . . . . . . 206
4.11. Available values for the priority option in scrlttr2 . . . . . . . . . . . . . . . . . . . . . . 206
4.12. Available values for the locfield option with scrlttr2 . . . . . . . . . . . . . . . . . . . . 210
4.13. Available values for the refline option with scrlttr2 . . . . . . . . . . . . . . . . . . . . . 213
4.14. Default descriptions of variables in the reference line . . . . . . . . . . . . . . . . . . . . . 214
4.15. Default font styles for elements in the reference line . . . . . . . . . . . . . . . . . . . . . . 215
4.16. Default descriptions of variables for the subject . . . . . . . . . . . . . . . . . . . . . . . . . 218
4.17. Available values for the subject option with scrlttr2 . . . . . . . . . . . . . . . . . . . . . 219
4.18. Available values for the pagenumber option with scrlttr2 . . . . . . . . . . . . . . . . . . 230
4.19. Predefined lco files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

5.1. Elements of scrlayer-scrpage whose font styles can be changed with the
\setkomafont and \addtokomafont commands . . . . . . . . . . . . . . . . . . . . . . . . . 257
5.2. Available values for the markcase option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
5.3. Symbolic values for the headwidth and footwidth options . . . . . . . . . . . . . . . . 277

10.1. Available extended features of scrextend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

11.1. Elements whose scrjura font styles can be changed with \setkomafont and
\addtokomafont, including their default settings . . . . . . . . . . . . . . . . . . . . . . . . 312
11.2. Available properties for the optional argument of \Clause and \SubClause . . . 315
11.3. Available values for the clausemark option to activate running heads . . . . . . . . 317
11.4. Available values for the ref option to configure the cross-reference format . . . . 322
11.6. Options provided by \DeclareNewJuraEnvironment for new contract environ-
ments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
11.5. Example outputs of the ref-independent cross-reference commands . . . . . . . . . 323
11.7. Meanings and English defaults of language-dependent terms . . . . . . . . . . . . . . . 325

12.1. Overview of common language-dependent terms . . . . . . . . . . . . . . . . . . . . . . . . . 353

15.1. Attributes of the predefined TOC-entry styles of tocbasic . . . . . . . . . . . . . . . . . 392


15.2. Options for command \DeclareNewTOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
15.3. Comparing the example remarkbox environment with the figure environment 412

17.1. Options for defining page layers and the meaning of the corresponding layer
attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
17.2. Hook options for page styles (in order of execution) . . . . . . . . . . . . . . . . . . . . . . 435
List of Tables 20

18.1. The layers scrlayer-scrpage defines for a page style . . . . . . . . . . . . . . . . . . . . . . . 455

19.1. Available settings for declaring note columns . . . . . . . . . . . . . . . . . . . . . . . . . . . 464

21.1. Style-independent attributes for declaring sectioning commands . . . . . . . . . . . . 483


21.2. Attributes of the section style when declaring a sectioning command . . . . . . . 484
21.3. Attributes of the chapter style when declaring a sectioning command . . . . . . . 485
21.4. Attributes of the part style when declaring a sectioning command . . . . . . . . . . 486
21.5. Defaults for the chapter headings of scrbook and scrreprt depending on the
headings option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
21.6. Defaults for the headings of scrbook and scrreprt . . . . . . . . . . . . . . . . . . . . . . . . 489

22.1. Defaults for language-dependent terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514


22.2. Language-dependent forms of the date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515

A.1. ISO and JIS standard paper sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517


A.2. Japanese B-series variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
A.3. Main Japanese contemporary stationery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
A.4. Japanese ISO envelope sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
A.5. Japanese envelope sizes 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
A.6. Supported Japanese envelope types, window sizes, and locations . . . . . . . . . . . . 522
A.7. lco files provided by scrlttr2 for Japanese window envelopes . . . . . . . . . . . . . . . 523
Chapter 1: Introduction 21

Introduction

This chapter contains, among other things, important information about the structure of the
manual and the history of KOMA - Script, which begins years before the first version. You will
also find information on how to install KOMA - Script and what to do if you encounter errors.

1.1. Preface

KOMA-Script is very complex. This is due to the fact that it consists of not just a single
class or a single package but a bundle of many classes and packages. Although the classes
are designed as counterparts to the standard classes, that does not mean they provide only
the commands, environments, and settings of the standard classes, or that they imitate their
appearance. The capabilities of KOMA - Script sometimes far surpass those of the standard
classes. Some of them should be considered extensions to the basic capabilities of the LATEX
kernel.
The foregoing means that the documentation of KOMA - Script has to be extensive. In
addition, KOMA - Script is not normally taught. That means there are no teachers who know
their students and can therefore choose the teaching materials and adapt them accordingly.
It would be easy to write documentation for a specific audience. The difficulty facing the
author, however, is that the manual must serve all potential audiences. I have tried to create
a guide that is equally suitable for the computer scientist and the fishmonger’s secretary. I
have tried, although this is actually an impossible task. The result is numerous compromises,
and I would ask you to take this issue into account if you have any complaints or suggestions
to help improve the current situation.
Despite the length of this manual, I would ask you to consult the documentation first in
case you have problems. You should start by referring to the multi-part index at the end of
this document. In addition to this manual, documentation includes all the text documents
that are part of the bundle. See manifest.tex for a complete list.

1.2. Structure of the Guide

This manual is divided into several parts: There is a section for average users, one for advanced
users and experts, and an appendix with further information and examples for those who want
to understand KOMA - Script thoroughly.
part I is intended for all KOMA - Script users. This means that some information in this
section is directed at newcomers to LATEX. In particular, this part contains many examples
that are intended to clarify the explanations. Do not hesitate to try these examples yourself
and discover how KOMA - Script works by modifying them. That said, the KOMA - Script user
guide is not intended to be a LATEX primer. Those new to LATEX should look at The Not So
Chapter 1: Introduction 22

Short Introduction to LATEX 2ε [OPHS11] or LATEX 2ε for Authors [Tea05b] or a LATEX reference
book. You will also find useful information in the many LATEX FAQs, including the TEX
Frequently Asked Questions on the Web [FAQ13]. Although the length of the TEX Frequently
Asked Questions on the Web is considerable, you should get at least a rough overview of it
and consult it in case you have problems, as well as this guide.
part II is intended for advanced KOMA - Script users, those who are already familiar with
LATEX or who have been working with KOMA - Script for a while and want to understand more
about how KOMA - Script works, how it interacts with other packages, and how to perform
more specialized tasks with it. For this purpose, we return to some aspects of the class
descriptions from part I and explain them in more detail. In addition we document some
commands that are particularly intended for advanced users and experts. This is supplemented
by the documentation of packages that are normally hidden from the user, insofar as they do
their work beneath the surface of the classes and user packages. These packages are specifically
designed to be used by authors of classes and packages.
The appendix, which can only be found in the German book version, contains information
beyond that which is covered in part I and part II. Advanced users will find background
information on issues of typography to give them a basis for their own decisions. In addition,
the appendix provides examples for aspiring package authors. These examples are not intended
simply to be copied. Rather, they provide information about planning and implementing
projects, as well as some basic LATEX commands for package authors.
The guide’s layout should help you read only those parts that are actually of interest. Each
class and package typically has its own chapter. Cross-references to another chapter are thus
usually also references to another part of the overall package. However, since the three main
classes (scrbook, scrrprt, and scrartcl) largely agree, they are introduced together in chapter 3.
scrartcl Differences between the classes, e. g., for something that only affects the class scrartcl, are
clearly highlighted in the margin, as shown here with scrartcl.
The primary documentation for KOMA - Script is in German and has been translated for your
convenience; like most of the LATEX world, its commands, environments, options, etc., are in
English. In a few cases, the name of a command may sound a little strange, but even so, we hope
and believe that with the help of this guide, KOMA - Script will be usable and useful to you.
At this point you should know enough to understand the guide. It might, however, still be
worth reading the rest of this chapter.

1.3. History of KOMA - Script

In the early 1990s, Frank Neukam needed a method to publish an instructor’s lecture notes. At
that time LATEX was LATEX2.09 and there was no distinction between classes and packages —
there were only styles. Frank felt that the standard document styles were not good enough
for his work; he wanted additional commands and environments. At the same time he was
interested in typography and, after reading Tschichold’s Ausgewählte Aufsätze über Fragen der
Chapter 1: Introduction 23

Gestalt des Buches und der Typographie (Selected Articles on the Problems of Book Design and
Typography) [Tsc87], he decided to write his own document style — and not just a one-time
solution to his lecture notes, but an entire style family, one specifically designed for European
and German typography. Thus Script was born.
Markus Kohm, the developer of KOMA - Script, came across Script in December 1992 and
added an option to use the A5 paper format. At that time neither the standard style nor
Script provided support for A5 paper. Therefore it did not take long until Markus made the
first changes to Script. This and other changes were then incorporated into Script-2, released
by Frank in December 1993.
In mid-1994, LATEX 2ε became available and brought with it many changes. Users of Script-2
were faced with either limiting their usage to LATEX 2ε ’s compatibility mode or giving up Script
altogether. This situation led Markus to put together a new LATEX 2ε package, released on
7 July 1994 as KOMA - Script. A few months later, Frank declared KOMA - Script to be the
official successor to Script. KOMA - Script originally provided no letter class, but this deficiency
was soon remedied by Axel Kielhorn, and the result became part of KOMA - Script in December
1994. Axel also wrote the first true German-language user guide, which was followed by an
English-language guide by Werner Lemberg.
Since then much time has passed. LATEX has changed in only minor ways, but the LATEX
landscape has changed a great deal; many new packages and classes are now available and
KOMA-Script itself has grown far beyond what it was in 1994. The initial goal was to pro-
vide good LATEX classes for German-language authors, but today its primary purpose is to
provide more-flexible alternatives to the standard classes. KOMA - Script’s success has led
to e-mail from users all over the world, and this has led to many new macros — all needing
documentation; hence this “small guide.”

1.4. Special Thanks

Acknowledgements in the introduction? No, the proper acknowledgements can be found in


the addendum. My comments here are not intended for the authors of this guide — and
those thanks should rightly come from you, the reader, anyhow. I, the author of KOMA -
Script, would like to extend my personal thanks to Frank Neukam. Without his Script family,
KOMA-Script would not have come about. I am indebted to the many persons who have
contributed to KOMA - Script, but with their indulgence, I would like to specifically mention
Jens-Uwe Morawski and Torsten Krüger. The English translation of the guide is, among many
other things, due to Jens’s untiring commitment. Torsten was the best beta-tester I ever had.
His work has particularly enhanced the usability of scrlttr2 and scrpage2. Many thanks to all
who encouraged me to go on, to make things better and less error-prone, or to implement
additional features.
Special thanks go as well to the founders and members of DANTE, Deutschsprachige An-
wendervereinigung TEX e.V, (the German-Language TEX User Group). Without the DANTE
Chapter 1: Introduction 24

server, KOMA - Script could not have been released and distributed. Thanks as well to ev-
erybody on the TEX newsgroups and mailing lists who answer questions and have helped me
provide support for KOMA - Script.
My thanks also go to all those who have always encouraged me to go further and to imple-
ment this or that feature better, with fewer flaws, or simply as an extension. I would also like
to thank the very generous donor who has given me the most significant amount of money I
have ever been paid for the work done so far on KOMA - Script.

1.5. Legal Notes

KOMA-Script is released under the LATEX Project Public License. You will find it in the file
lppl.txt. An unofficial German-language translation is also available in lppl-de.txt and is
valid for all German-speaking countries.
This document and the KOMA - Script bundle are provided “as is” and without warranty of
any kind.

1.6. Installation

The three most important TEX distributions, MacTEX, MiKTEX, and TEX Live, make KOMA -
Script available through their package management software. You should install and update
KOMA-Script using these tools, if possible. Manual installation without using the package
managers is described in the file INSTALL.txt, which is part of every KOMA - Script distribu-
tion. You should also read the documentation that comes with the TEX distribution you are
using.

1.7. Bug Reports and Other Requests

If you think you have found an error in the documentation or a bug in one of the KOMA -
Script classes, packages, or another part of KOMA - Script, please do the following: First check
on CTAN to see if a newer version of KOMA - Script has been released. If a newer version is
available, install this new version and check if the problem persists.
If the bug still occurs and your installation is fully up to date, please provide a short LATEX
file that demonstrates the problem. Such a file is known as a minimal working example (MWE).
You should include only minimal text and use only the packages and definitions essential to
demonstrate the problem. Avoid using any unusual packages as much as possible.
By preparing such an example it often becomes clear whether the problem is truly a KOMA -
Script bug or caused by something else. To check if another package or class is actually causing
the problem, you can also test your example with the corresponding standard class instead
of a KOMA-Script class. If your problem still occurs, you should address your error report
to the author of the appropriate package than to the author of KOMA - Script. Finally, you
Chapter 1: Introduction 25

should carefully review the instructions for the appropriate package, classes, and KOMA - Script
component. A solution to your problem may already exist, in which case an error report is
unnecessary.
If you think you have found a previously unreported error, or if for some other reason you
need to contact the author of KOMA - Script, don’t forget the following:
• Does the problem also occur if a standard class is used instead of a KOMA - Script class?
In this case, the error is most likely not with KOMA - Script, and it makes more sense to
ask your question in a public forum, a mailing list, or Usenet.
• Which KOMA - Script version do you use? For related information, see the log file of the
LATEX run of any document that uses a KOMA - Script class.
• Which operating system and which TEX distribution do you use? This information might
seem rather superfluous for a system-independent package like KOMA - Script or LATEX,
but time and again they have certainly been shown to play a role.
• What exactly is the problem or the error? Describe the problem. It’s better to be too
detailed than too short. Often it makes sense to explain the background.
• What does a minimal working example look like? You can easily create one by comment-
ing out content and packages from the document step by step. The result is a document
that only contains the packages and parts necessary to reproduce the problem. In ad-
dition, all loaded images should be replaced by \rule statements of the appropriate
size. Before sending your MWE,remove the commented-out parts, insert the command
\listfiles in the preamble, and perform another LATEX run. At the end of the log
file, you will see an overview of the packages used. Add the MWE and the log file to the
end of your description of the problem.
Do not send packages, PDF, PS, or DVI files. If the entire issue or bug description, including
the minimal example and the log file is larger than a few tens of kilobytes, you’re likely doing
something wrong.
If you’ve followed all these steps, please send your KOMA - Script (only) bug report to
[email protected].
If you want to ask your question in a Usenet group, mailing list, or Internet forum, you
should follow the procedures mentioned above and include a minimal working example as part
of your question, but usually you don’t need to provide the log-file. Instead, just add the list
of packages and package versions from the log-file and, if your MWE compiles with errors,
you should quote those messages from the log file.
Please note that default settings which are not typographically optimal do not represent
errors. For reasons of compatibility, defaults are preserved whenever possible in new versions
of KOMA-Script. Furthermore, typographical best practices are partly a matter of language
and culture, and so the default settings of KOMA - Script are necessarily a compromise.
Chapter 1: Introduction 26

1.8. Additional Information

Once you become familiar with KOMA - Script, you may want examples that show how to
accomplish more difficult tasks. Such examples go beyond the basic instructional scope of
this manual and so are not included. However, you will find more examples on the website of
the KOMA-Script Documentation Project [KDP]. These examples are designed for advanced
LATEX users and are not particularly suitable for beginners. The main language of the site is
German, but English is also welcome.
Part I.
KOMA - Script for Authors

This part provides information for writers of articles, reports, books, and letters. The average
user is probably less interested in how things are implemented in KOMA - Script and what
pitfalls exist. Also, normal users aren’t interested in obsolete options and instructions. They
want to know how to achieve things using current options and instructions, and perhaps in
some background information about typography.
The few passages in this part which contain extra information and explanations that may be
of less interest for the impatient reader are set in a sans-serif typeface and can be skipped if de-
sired. For those who are interested in more information about the implementation, side-effects
with other packages, or obsolete options and instructions, please refer to part II beginning on
page 333. That part of the KOMA - Script guide also describes all the features that were created
specially for authors of packages and classes.
Chapter 2: Calculating the Page Layout with typearea 28

Calculating the Page Layout with typearea

Many LATEX classes, including the standard classes, present the user with a largely fixed
configuration of margins and page layout. In the standard classes, the choice is limited to
selecting a font size. There are separate packages, such as geometry (see [Ume10]), which
give the user complete control over, but also full responsibility for, setting the type area and
margins.
KOMA-Script takes a somewhat different approach with the typearea package. Users are
offered ways to adjust the design and algorithms based on established typographic standards,
making it easier for them to make good choices.

2.1. Fundamentals of Page Layout

At first glance, a single page of a book or other printed material consists of the margins, a header,
a body of text, and a footer. More precisely, there is also a space between the header area and the
text body, as well as between the body and the footer. The text body is called, in the jargon of
typographers and typesetters, the type area. The division of these areas, as well as their relations
to each other and to the paper, is called the page layout.
Various algorithms and heuristic methods for constructing an appropriate type area have been
discussed in the literature [Koh02]. These rules are known as the “canons of page construction.”
One approach often mentioned involves diagonals and their intersections. The result is that the
aspect ratio of the type area corresponds to the proportions of the page. In a one-sided document,
the left and right margins should have equal widths, while the ratio of the top and bottom margins
should be 1:2. In a two-sided document (e. g. a book), however, the entire inner margin (the
margin at the spine) should be the same size as each of the two outer margins; in other words, a
single page contributes only half of the inner margin.
In the previous paragraph, we mentioned and emphasised the page. It is often mistakenly thought
that the format of the page is the same as the format of the paper. However, if you look at a bound
document, you can see that part of the paper disappears in the binding and is no longer part of the
visible page. For the type area, however, it is not the format of the paper which is important; it is
the impression of the visible page to the reader. Thus, it is clear that the calculation of the type
area must account for the “lost” paper in the binding and add this amount to the width of the
inner margin. This is called the binding correction. The binding correction is therefore calculated
as part of the gutter but not the visible inner margin.
The binding correction depends on the production process and cannot be defined in general
terms. It is therefore a parameter that must be redefined for each project. In professional printing,
this value plays only a minor role, since printing is done on larger sheets of paper and then cropped
to the right size. The cropping is done so that the above relations for the visible, two-sided page
are maintained.
Chapter 2: Calculating the Page Layout with typearea 29

So now we know how the individual parts of a page relate to each other. However, we do not
yet know how wide and high the type area is. Once we know one of these two dimensions, we
can calculate all the other dimensions from the paper format and the page format or the binding
correction.

type area height : type area width = page height : page width
top margin : footer margin = 1 : 2
left margin : right margin = 1 : 1
half inner margin : outer margin = 1 : 2
page width = paper width − binding correction
top margin + bottom margin = page height − type area height
left margin + right margin = page width − type area width
half inner margin + outer margin = page width − type area width
half inner margin + binding correction = gutter

The values left margin and right margin only exist in a one-sided document while half inner margin
and outer margin only exist in a two-sided document. We use half inner margin in these equations,
since the full inner margin is an element of the whole two-page spread. Thus, only half of the inner
margin, half inner margin, belongs to a single page.
The question of the width of the type area is also discussed in the literature. The optimum
width depends on several factors:

• the size, width, and type of font used,

• the line spacing,

• the word length,

• the available space.

The importance of the font becomes clear once you realize what serifs are for. Serifs are small
strokes that finish off the lines of letters. Letters with vertical lines touching the text baseline
disturb the flow rather than keeping the eye on the line. It is precisely with these letters that the
serifs lie horizontally on the baseline and thus enhance the horizontal effect of the font. The eye
can better follow the line of text, not only when reading the words but also when jumping back to
the beginning of the next line. Thus, the line length can actually be slightly longer for a serif font
than for a sans serif font.
Leading refers to the vertical distance between individual lines of text. In LATEX, the leading is
set at about 20% of the font size. With commands like \linespread, or better, packages like
setspace (see [TF11]), you can change the leading. A wider leading makes it easy for the eye to
follow the line. A very wide leading, however, disturbs reading because the eye has to travel long
Chapter 2: Calculating the Page Layout with typearea 30

distances between the lines. In addition, the reader becomes uncomfortable because of the visible
striped effect. The uniform grey value of the page is thereby spoiled. Nevertheless, the lines can
be longer with a wider leading.
The literature gives different values for good line lengths, depending on the author. To some
extent, this is related to the author’s native language. Since the eye usually jumps from word
to word, short words make this task easier. Across all languages and fonts, a line length of 60
to 70 characters, including spaces and punctuation, forms a usable compromise. This requires
well-chosen leading, but LATEX’s default is usually good enough. Longer line lengths should only be
considered for highly-developed readers who spend many hours a day reading. But even then, line
lengths beyond 80 characters are unacceptable. In each case, the leading must be appropriately
chosen. An extra 5% to 10% is recommended as a good rule of thumb. For typefaces like Palatino,
which require more than 5% leading for normal line lengths, even more can be required.
Before looking at the actual construction of the page layout, there are a few minor points you
should know. LATEX does not start the first line in the text area of a page at the upper edge
of the text area but sets the baseline at a defined distance from the top of the text area. Also,
LATEX recognizes the commands \raggedbottom and \flushbottom. \raggedbottom specifies
that the last line of a page should be positioned wherever it was calculated. This means that the
position of this line can be different on each page, up to the height of one line — even more when
the end of the page coincides with headings, figures, tables, or the like. In two-sided documents
that is usually undesirable. The second command, \flushbottom, makes sure that the last line is
always at the lower edge of the text area. To achieve this vertical compensation, LATEX may have
to stretch vertical glue beyond what is normally allowed. Paragraph skip is such a stretchable,
vertical glue, even when set to zero. To avoid stretching on normal pages where paragraph spacing
is the only stretchable glue, the height of the text area should be a multiple of the height of the
text line, including the distance of the first line from the top of the text area.
This concludes the fundamentals. In the following two sections, the methods of construction
offered by KOMA - Script are presented in detail.

2.2. Constructing the Type Area by Division

The easiest way to make sure that the text area has the same ratio as the page is as follows:
• First, subtract the BCOR required for the binding correction from the inner edge of the
paper, and divide the rest of the page vertically into DIV rows of equal height.

• Next, divide the page horizontally into the same number (DIV) of columns of equal width.

• Then, take the uppermost row as the upper margin and the two lowermost rows as the lower
margin. If you are printing two-sided, you similarly take the innermost column as the inner
margin and the two outermost columns as the outer margin.

• Then add the binding correction BCOR to the inner margin.


Chapter 2: Calculating the Page Layout with typearea 31

1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1

2 2

3 3

binding correction
4 4

5 page layout left page layout right 5

6 6

7 7

Figure 2.1.: Two-sided layout 8 8


with the box construction of the
9 9
classical nine-part division, after
subtracting a binding correction

What remains within the page is the text area. The width and height of the text area and margins
result automatically from the number of rows and columns, DIV. Since the margins always need
three stripes, DIV must be greater than three. In order that the text area occupy at least twice as
much space as the margins, DIV should really be at least nine. With this value, the design is also
known as the classical nine-part division (see figure 2.1).
In KOMA-Script, this kind of design is implemented with the typearea package, where the
bottom margin may drop any fractions of a line in order to comply with the constraint for the
height of the type area mentioned in the previous paragraph and thereby reduce the problem
mentioned with \flushbottom. For A4 paper, DIV is predefined according to the font size (see
table 2.2, page 37). If there is no binding correction (BCOR = 0 pt), the results roughly match
the values of table 2.1, page 36.
In addition to the predefined values, you can specify BCOR and DIV as options when loading
the package (see section 2.4, starting on page 34). There is also a command to calculate the type
area explicitly by providing these values as parameters (see also section 2.4, page 40).
The typearea package can automatically determine the optimal value of DIV for the font and
leading used. Again, see section 2.4, page 37.

2.3. Constructing the Type Area by Describing a Circle

In addition to the construction method for the type area described above, there is an even more
traditional, or even medieval, method found in the literature. The aim of this method is not just
to have the same ratios between page size and type area; it is considered optimal when the height
of the text area corresponds to the width of the page. This means that a circle can be drawn
Chapter 2: Calculating the Page Layout with typearea 32

that will touch both the sides of the page and the top and bottom of the text area. The exact
procedure can be found in [Tsc87].
A disadvantage of this late-medieval canon of page construction is that the width of the text
area no longer depends on the font. One no longer chooses the text area to match the font.
Instead, the author or typesetter must choose the appropriate font for the text area. This should
be considered mandatory.
In the typearea package, this construction is modified to determine the DIV value by selecting
a special (normally meaningless) DIV value or a special, symbolic indication of the DIV value so
that the resulting type area comes as close as possible to the late-medieval page canon. Hence it
relies in turn on the method of constructing the type area by division.

2.4. Early or Late Selection of Options

This section introduces a special feature of KOMA - Script which, in addition to typearea, is also
relevant to other KOMA - Script packages and classes. This section appears in nearly identical
form in several chapters, so you can find all the information about a single package or class in
the relevant chapter. Users who are interested not just in a particular package or class but in
getting an overview of KOMA - Script as a whole only need to read this section in one of the
chapters and can then skip it as they study the guide.

\documentclass[option list ]{KOMA - Script class }


\usepackage[option list ]{package list }
LATEX allows users to pass class options as a comma-separated list of keywords in the optional
argument to \documentclass. In addition to being passed to the class, these options are also
passed on to all packages that can understand them. Users can also pass a similar comma-
v3.00 separated list of keywords in the optional argument of \usepackage. KOMA - Script extends
the option mechanism for the KOMA - Script classes and some packages with further options.
Thus most KOMA - Script options can also take a value, so an option does not necessarily
take the form option , but can also take the form option =value . Except for this difference,
\documentclass and \usepackage in KOMA - Script function as described in [Tea05b] or any
introduction to LATEX, for example [OPHS11].
When using a KOMA - Script class, you should not specify options when loading the typearea
or scrbase packages. The reason for this restriction is that the class already loads these
packages without options, and LATEX refuses to load a package multiple times with different
option settings.
Setting the options with \documentclass has one major disadvantage: unlike the interface
described below, the options in \documentclass are not robust. So commands, lengths,
counters, and similar constructs may break inside the optional argument of this command.
For example, with many non-KOMA - Script classes, using a LATEX length in the value of an
option results in an error before the value is passed to a KOMA - Script package and it can take
Chapter 2: Calculating the Page Layout with typearea 33

control of the option execution. So if you want to use a LATEX length, counter, or command
as part of the value of an option, you should use \KOMAoptions or \KOMAoption. These
commands will be described next.

\KOMAoptions{option list }
\KOMAoption{option }{value list }
v3.00 KOMA-Script also provides the ability to change the values of most class and package options
even after loading the class or package. You can use the \KOMAoptions command to change
the values of a list of options, as in \documentclass or \usepackage. Each option in the
option list has the form option =value .
Some options also have a default value. If you do not specify a value, that is if you give the
option simply as option , then this default value will be used.
Some options can have several values simultaneously. For such options, it is possible, with
the help of \KOMAoption, to pass a list of values to a single option . The individual values
are given as a comma-separated value list .
KOMA-Script uses the commands \FamilyOptions and \FamilyOption with the family
“KOMA” to implement this ability. Advanced users will find more on these instructions in sec-
tion 12.2, page 338.
Options set with \KOMAoptions or \KOMAoption will reach both the KOMA - Script class
and any previously loaded KOMA - Script packages that recognise these options. If an option
or a value is unknown, scrbase will report it as an error.

2.5. Compatibility with Earlier Versions of KOMA - Script

Those who produce their documents from source code typically attach the utmost importance
to the fact that future LATEX runs will yield exactly the same result. In some cases, however,
improvements and bug fixes to the package will result in changes of behaviour, especially to
the layout. This, however, may be undesirable.

version=value
version=first
version=last
v3.01b Since Version 3.01b, typearea has been able to choose whether the source file should, as
much as possible, continue to produce exactly the same result within a LATEX run or should be
formatted according to the modifications of the latest version. You can specify the version with
which you want your file to be compatible by using the version option. Compatibility with
the oldest supported KOMA - Script version can be achieved with version=first or version=
2.9 or version=2.9t. Setting value to an unknown release number will result in a warning
message and selects version=first for safety.
Chapter 2: Calculating the Page Layout with typearea 34

With version=last, you can select the latest version. In this case, you give up backwards
v3.01a compatibility. If the option is used without a value, last is assumed. This also corresponds
to the default setting, as long as you do not use any deprecated options.
If you use a deprecated option of KOMA - Script 2, KOMA - Script 3 will switch to version=
first automatically. This will also result in a warning message that explains how to prevent
this switch. Alternatively, you can choose a different setting for version with the desired
compatibility after the deprecated option.
Compatibility is primarily a question of line and page breaks (wrapping). If you choose
compatibility with an older version, new options that do not affect wrapping are still avail-
able. The version option does not affect any wrapping changes that are the result of fixing
unambiguous errors. If you need unconditional wrapping compatibility even in the case of
bugs, you should physically save the old KOMA - Script version you need together with your
document.
Note that you cannot change the version option after loading the typearea package. Setting
this option with \KOMAoptions or \KOMAoption will therefore cause an error.

2.6. Adjusting the Type Area and Page Layout

The typearea package offers two different user interfaces to influence the construction of the
type area. The most important method is to specify options when loading the package. For
information on how to setup options with KOMA - Script, please refer to section 2.4.
In this section the classes used in the examples are not existing KOMA - Script classes but
hypothetical ones. This guide assumes that ideally an appropriate class is available for each
task.

BCOR=correction
v3.00 Use the BCOR=correction option to specify the absolute value of the binding correction, i. e.
the width of the area lost from the paper during the binding process. This value is then
automatically taken into account when constructing the page layout and is added back to the
inner (or left) margin during output. In the value of the correction , you can specify any
measurement unit understood by TEX.

Example: Suppose you create a financial report. The whole thing should be printed out one-
sided on A4 paper and then stapled in a binder folder. The clip of the folder covers
7.5 mm. The stack of pages is very thin, so at most another 0.75 mm will be lost
from bending and the sheets themselves. Therefore, you can write:
\documentclass[a4paper]{report}
\usepackage[BCOR=8.25mm]{typearea}
with BCOR=8.25mm as an option to typearea or
Chapter 2: Calculating the Page Layout with typearea 35

\documentclass[a4paper,BCOR=8.25mm]{report}
\usepackage{typearea}
when using BCOR=8.25mm as a global option.
When using a KOMA - Script class, you do not need to load the typearea package
explicitly:
\documentclass[BCOR=8.25mm]{scrreprt}
You can omit the a4paper option with scrreprt, since this is the default for all
KOMA - Script classes.
If you want to set the option to a new value later, you can, for example, use the
following:
\documentclass{scrreprt}
\KOMAoptions{BCOR=8.25mm}
Defaults are initialized when the scrreprt class is loaded. Changing a setting with
the \KOMAoptions or \KOMAoption commands will automatically calculate a new
type area with new margins.

Note you must pass this option as a class option when loading one of the KOMA - Script
classes, as in the example above, or via \KOMAoptions or \KOMAoption after loading the class.
When you use a KOMA - Script class, you should not load the typearea package explicitly with
\usepackage, nor should you specify it as an optional argument when loading the package
if you are using another class. If the option is changed with \KOMAoptions or \KOMAoption
after loading the package, the type area and margins are automatically recalculated.

DIV=factor
v3.00 The DIV=factor option specifies the number of strips into which the page is divided horizon-
tally and vertically during the construction of the type area. The exact construction method
is found in section 2.2. It’s important to realise that the larger the factor , the larger the
text block and the smaller the margins. Any integer value greater than 4 is valid for factor .
Note, however, that large values can cause violations in the constraints on the margins of the
type area, depending on how you set other options. In extreme cases, the header may fall
outside of the page. When you use the DIV=factor option, you are responsible for complying
with the margin constraints and for choosing a typographically pleasing line length.
In table 2.1, you will find the sizes of the type areas for several DIV factors for the A4 page
with no binding correction. In this case, the other constraints that are dependent on the font
size are not taken into account.

Example: Suppose you are writing up the minutes of a meeting using the minutes class. The
whole thing should be two-sided. Your company uses 12 pt Bookman font. This
Chapter 2: Calculating the Page Layout with typearea 36

Table 2.1.: Type area dimensions dependent on DIV for


A4 regardless of \topskip or BCOR Type area Margins
DIV width height top inner
6 105.00 148.50 49.50 35.00
7 120.00 169.71 42.43 30.00
8 131.25 185.63 37.13 26.25
9 140.00 198.00 33.00 23.33
10 147.00 207.90 29.70 21.00
11 152.73 216.00 27.00 19.09
12 157.50 222.75 24.75 17.50
13 161.54 228.46 22.85 16.15
14 165.00 233.36 21.21 15.00
15 168.00 237.60 19.80 14.00
(all lengths in mm)

font, which is one of the standard PostScript fonts, is enabled in LATEX with the
command \usepackage{bookman}. Bookman is a very wide font, meaning that
the individual characters are relatively wide compared to their height. Therefore,
the default setting for DIV in typearea is too small. After thoroughly studying this
entire chapter, you conclude that a value of 15, instead of 12, is most suitable. The
minutes will not be bound but punched and kept in a folder, and thus no binding
correction is necessary. So you write:
\documentclass[a4paper,twoside]{minutes}
\usepackage{bookman}
\usepackage[DIV=15]{typearea}
When you’re done, you become aware that the minutes will from now on be col-
lected and bound together as a book at the end of the quarter. The binding is to be
a simple glue binding because this is only being done to conform to ISO 9000 and
nobody is actually going to read them. The binding, including space lost in folding
the pages, requires an average of 12 mm You change the options of the typearea
package accordingly and use the class for minutes that conform to ISO 9000 regu-
lations:
\documentclass[a4paper,twoside]{iso9000p}
\usepackage{bookman}
\usepackage[DIV=15,BCOR=12mm]{typearea}
Of course, it is equally possible to use a KOMA - Script class here:
\documentclass[twoside,DIV=15,BCOR=12mm]{scrartcl}
\usepackage{bookman}
The a4paper option can be left out when using the scrartcl class, as it is predefined
Chapter 2: Calculating the Page Layout with typearea 37

Table 2.2.: DIV defaults for A4


base font size: 10 pt 11 pt 12 pt
DIV: 8 10 12

in all KOMA - Script classes.

Note that when using this option with one of the KOMA - Script classes, as in the example
above, it must be passed either as a class option, or via \KOMAoptions or \KOMAoption after
loading the class. When using a KOMA - Script class, the typearea package should not be
loaded explicitly with \usepackage, nor should the option be given as an optional argument
thereto. If the option is changed via \KOMAoptions or \KOMAoption after loading the package,
the type area and margins are automatically recalculated.

DIV=calc
DIV=classic
v3.00 As already mentioned in section 2.2, there are fixed defaults for DIV when using A4 paper.
These can be found in table 2.2. However, such fixed values have the disadvantage that they
do not take into account the letter spacing of the font used. With A4 and fairly narrow
fonts, this can quickly lead to an unpleasantly high number of characters per line. See the
considerations in section 2.1. If you choose a different paper size, typearea will calculate an
appropriate DIV value for you. Of course, you can also apply this same calculation to A4.
To do so, simply use DIV=calc in place of DIV=factor . Of course, you can also specify this
option explicitly for all other paper sizes. If you want automatic calculation, this specification
is useful, as it is possible to set different preferences in a configuration file (see section 20.3).
Explicitly specifying the DIV=calc option overrides such configuration settings.
You can also select the traditional page layout mentioned in section 2.3, the medieval page
canon. Instead of the DIV=factor or DIV=calc option, simply use the DIV=classic option.
A DIV value which is as close as possible to the medieval page canon is then chosen.

Example: In the example using the Bookman font and the DIV=factor option, the problem
was to select a DIV value that better matched the font. Modifying that example,
you can simply leave the calculation of this value to typearea:
\documentclass[a4paper,twoside]{protocol}
\usepackage{bookman}
\usepackage[DIV=calc]{typearea}

Note that when using this option with one of the KOMA - Script classes, as in the example
above, it must be passed either as a class option, or via \KOMAoptions or \KOMAoption after
loading the class. When using a KOMA - Script class, the typearea package should not be loaded
explicitly with \usepackage, nor should the option be given as an optional argument. If the
Chapter 2: Calculating the Page Layout with typearea 38

option is changed via \KOMAoptions or \KOMAoption after loading the package, the type area
and margins are automatically recalculated.

DIV=current
DIV=last
v3.00 If you’ve been following the examples closely, you already know how to calculate a DIV value
based on the font you chose when using a KOMA - Script class together with a font package.
The difficulty with doing so is that the KOMA - Script class already loads the typearea package
itself. Thus, it is not possible to pass options as optional arguments to \usepackage. It would
also be pointless to specify the DIV=calc option as an optional argument to \documentclass.
This option would be evaluated immediately on loading the typearea package and as a result the
type area and margins would be calculated for the standard LATEX font and not for the font loaded
later.
However, it is possible to recalculate the type area and margins after loading the font with the
aid of \KOMAoptions{DIV=calc} or \KOMAoption{DIV}{calc}. The option DIV=calc will then
request a DIV value for an appropriate line length.
As it is often more convenient to set the DIV option not after loading the font but at a more
noticeable point, such as when loading the class, the typearea package offers two further symbolic
values for this option.
v3.00 The option DIV=current recalculates the type area and margins using the current DIV value.
This is less important for recalculating the type area after loading a different font. Instead,
it is useful if, for example, you change the leading while keeping the DIV value the same
and want to ensure the margin constraint that \textheight minus \topskip is a multiple of
\baselineskip.
v3.00 The option DIV=last will recalculate the type area and margins using exactly the same
settings as the last calculation.
By the way, if the last typeset area calculation before using DIV=last or DIV=current was
done using \areaset, the recalculation will be done using \areaset again. It then corresponds
to \areaset[current]{\textwidth}\textheight.
Example: Let’s suppose again that we need to calculate an appropriate line length for a type
area using the Bookman font. At the same time, a KOMA - Script class is used.
This is very easy with the symbolic value last and the command \KOMAoptions:
\documentclass[BCOR=12mm,DIV=calc,twoside]{scrartcl}
\usepackage{bookman}
\KOMAoptions{DIV=last}
If you decide later that you need a different DIV value, just change the setting of
the optional argument to \documentclass.
For a summary of all possible symbolic values for the DIV option, see table 2.3. Note that
the use of the fontenc package may also cause LATEX to load a different font.
Chapter 2: Calculating the Page Layout with typearea 39

Table 2.3.: Available symbolic values for the DIV option or the DIV argument to \typearea[BCOR ]
{DIV }

areaset
Recalculate page layout.
calc
Recalculate type area including choice of appropriate DIV value.
classic
Recalculate type area using medieval book design canon (circle-based calculation).
current
Recalculate type area using current DIV value.
default
Recalculate type area using the standard value for the current page format and
current font size. If no standard value exists, calc is used.
last
Recalculate type area using the same DIV argument as was used in the last call.

Frequently, the type area must be recalculated in combination with a change in the line
spacing (leading). Since the type area should be calculated in such a way that a whole number
of lines fits in the text block, a change in the leading normally requires a recalculation of the
type area.

Example: Suppose that you require a 10 pt font and a spacing of 1.5 lines for a dissertation.
By default, LATEX sets the leading for 10 pt fonts at 2 pt, in other words 1.2 lines.
Therefore, you must use an additional stretch factor of 1.25. Suppose also that you
need a binding correction of 12 mm. Then the solution to the problem might look
like this:
\documentclass[10pt,twoside,BCOR=12mm,DIV=calc]{scrreprt}
\linespread{1.25}
\KOMAoptions{DIV=last}
Since typearea always executes the \normalsize command itself when calculat-
ing a new type area, it is not strictly necessary to set the chosen leading with
\selectfont after \linespread, since this will already be done in the recalcula-
tion.
When using the setspace package (see [TF11]), the same example would appear as
follows:
\documentclass[10pt,twoside,BCOR=12mm,DIV=calc]{scrreprt}
\usepackage[onehalfspacing]{setspace}
\KOMAoptions{DIV=last}
Chapter 2: Calculating the Page Layout with typearea 40

As you can see from the example, the setspace package saves you from needing to know the
correct stretch value. However, this only applies to the standard font sizes 10 pt, 11 pt, and
12 pt. For all other font sizes, the package uses an approximate value.
At this point, note that the line spacing for the title page should be reset to the normal
value, and the indexes should be set with the normal line spacing as well.

Example: Here is a complete example:


\documentclass[10pt,twoside,BCOR=12mm,DIV=calc]
{scrreprt}
\usepackage{setspace}
\onehalfspacing
\AfterTOCHead{\singlespacing}
\KOMAoptions{DIV=last}
\begin{document}
\title{Title}
\author{Markus Kohm}
\begin{spacing}{1}
\maketitle
\end{spacing}
\tableofcontents
\chapter{Ok}
\end{document}
Also see the notes in section 2.8. The \AfterTOCHead command is described in
chapter 15 of part II on page 383.

Note also that changing the line spacing can also affect the page’s header and footer. For
example, if you are using the scrlayer-scrpage package, you have to decide for yourself whether
you prefer to have the normal or the changed leading. See the singlespacing option in
chapter 17, page 438.
Note that when using this option with one of the KOMA - Script classes, as in the example
above, it must be passed either as a class option, or via \KOMAoptions or \KOMAoption after
loading the class. When using a KOMA - Script class, the typearea package should not be
loaded explicitly with \usepackage, nor should the option be given as an optional argument
thereto. If the option is changed via \KOMAoptions or \KOMAoption after loading the package,
the type area and margins are automatically recalculated.

\typearea[BCOR ]{DIV }
\recalctypearea
If the DIV option or the BCOR option is set after loading the typearea package, the \typearea
command will be called internally. When setting the DIV option, the symbolic value current
is used internally for BCOR , which for reasons of completeness is also found in table 2.4. When
setting the BCOR option, the symbolic value last is used internally for DIV . If instead you want
Chapter 2: Calculating the Page Layout with typearea 41

Table 2.4.: Available symbolic BCOR arguments for \typearea[BCOR ]{DIV }

current
Recalculate type area with the currently valid BCOR value.

the type area and margins to be recalculated using the symbolic value current for DIV , you can
use \typearea[current]{current} directly.
If you change both BCOR and DIV , you should use \typearea, since then the type area and
margins are recalculated only once. With \KOMAoptions{DIV=factor ,BCOR=correction }
the type area and margins are recalculated once for the change to DIV and again for the
change to BCOR.
The command \typearea is currently defined so as to make it possible to change the type area
in the middle of a document. However, several assumptions about the structure of the LATEX kernel
are made, and internal definitions and sizes of the kernel are changed. Since changes are only made
to the LATEX kernel to fix bugs, there is a high likelihood, though no guarantee, that this will still
work in future versions of LATEX 2ε . When used within the document, a page break will result.
Since \KOMAoption{DIV}{last}, \KOMAoptions{DIV=last}, or \typearea[current]
{last} is frequently needed to recalculate the type area and margins, there is a convenience
v3.00 command, \recalctypearea.

Example: If you find the notation


\KOMAoptions{DIV=last}
or
\typearea[current]{last}
too cumbersome for recalculating text area and margins because of the many special
characters, you can simply use
\recalctypearea

twoside=simple switch
twoside=semi
As explained in section 2.1, the distribution of the margins depends on whether the document
is to be printed one-sided or two-sided. For one-sided printing, the left and right margins
are the same width, whereas for two-sided printing the inner margin of one page is only half
as wide as the corresponding outer margin. To invoke two-sided printing, you must give
the typearea package the twoside option. For the simple switch , you can use any of the
standard values for simple switches in table 2.5. If the option is passed without a value, the
value true is assumed, so two-sided printing is enabled. Deactivating the option leads to
one-sided printing.
Chapter 2: Calculating the Page Layout with typearea 42

Table 2.5.: Standard values for simple switches in KOMA - Script

Value Description
true activates the option
on activates the option
yes activates the option
false deactivates the option
off deactivates the option
no deactivates the option

v3.00 In addition to the values in table 2.5, you can also use the value semi. This value results
in two-sided printing with one-sided margins and one-sided, that is non-alternating, marginal
v3.12 notes. Beginning with KOMA - Script version 3.12, binding corrections (see BCOR, page 34) will
be part of the left margin on odd pages but part of the right margin on even pages. But if you
switch on compatibility with a prior version of KOMA - Script (see section 2.5, page 33), the
binding correction will be part of the left margin on both pages while using twoside=semi.
The option can also be passed as class option in \documentclass, as a package option with
\usepackage, or even after loading typearea with \KOMAoptions or \KOMAoption. Using this
option after loading typearea automatically results in the recalculation of the type area using
\recalctypearea (see page 40). If the two-sided mode was active before the option was set,
a page break is made to the next odd page before the recalculation.

twocolumn=simple switch
To compute an appropriate type area with the help of DIV=calc, it is useful to know in advance
if the document is to be typeset in one or two columns. Since the considerations about line
length in section 2.1 apply to each column, the type area in two-column documents can be up
to twice as wide as in one-column documents.
To make this distinction, you must tell typearea if the document is to be set with two
columns using the twocolumn option. Since this is a simple switch , any of the standard
values for simple switches from table 2.5 are valid. If the option is passed without a value, the
value true is used, i. e. the two-column setting. Deactivating the option returns you to the
default one-column setting.
The option can also be passed as a class option in \documentclass, as a package op-
tion to \usepackage, or even after loading typearea with \KOMAoptions or \KOMAoption.
Using this option after loading typearea will automatically recalculate the type area using
\recalctypearea (see page 40).
Chapter 2: Calculating the Page Layout with typearea 43

headinclude=simple switch
footinclude=simple switch
So far we have discussed how the type area is calculated and the relationship of the margins to
one another and between margins and body of the text. But one important question has not been
answered: What exactly are the margins?
At first glance the question appears trivial: Margins are those parts on the right, left, top, and
bottom of the page which remain empty. But this is only half the story. Margins are not always
empty. Sometimes there can be marginal notes, for example (see the \marginpar command in
[OPHS11] or section 3.21).
For the top and bottom margins, the question becomes how to handle headers and footers. Do
these two belong to the text body or to their respective margins? This question is not easy to
answer. Clearly an empty footer or header belongs to the margins, since it cannot be distinguished
from the rest of the margins. A footer that contains only the pagination looks more like a margin
and should therefore be counted as such. It is irrelevant for the visual effect whether headers
or footers are easily recognized as such when reading or skimming. The decisive factor is how a
well-filled page appears when viewed out of focus. For this purpose, you could, for example, steal
the glasses of a far-sighted grandparent and hold the page about half a meter from the tip of your
nose. If you lack an available grandparent, you can also adjust your vision to infinity and look at
the page with one eye only. Those who wear glasses have a clear advantage here. If the footer
contains not only the pagination but also other material like a copyright notice, it looks more
like a slightly detached part of the body of the text. This needs to be taken into account when
calculating the type area.
For the header, this is even more complicated. The header often contains running heads. If you
use the current chapter and section titles in your running head and these titles are long, the header
itself will necessarily be very long. In this case, the header again acts like a detached part of the
text body and less like an empty margin. This effect is reinforced if the header contains not only
the chapter or section title but also the pagination. With material on the right and left side, the
header no longer appears as an empty margin. It is more difficult if the pagination is in the footer
and the length of the running titles varies, so that the header may look like part of the margin
on one page and part of the text body on another. Under no circumstances should you treat the
pages differently. That would lead to vertically jumping headers, which is not suitable even for a
flip book. In this case it is probably best to count the header as part of the text body.
The decision is easy when the header or footer is separated from the actual text body by a line.
This will give a “closed” appearance and the header or footer should be calculated as part of the
text body. Remember: It is irrelevant that the line improves the optical separation of text and
header or footer; only the appearance when viewed out of focus is important.
The typearea package cannot determine on its own whether to count headers and footers as
part of the text body or the margin. The headinclude and footinclude options cause the
v3.00 header or footer to be counted as part of the text. These options, being simple switch es,
accept the standard values for simple switches in table 2.5. You can use the options without
Chapter 2: Calculating the Page Layout with typearea 44

specifying a value, in which case the value true is used for the simple , i. e. the header or
footer is counted as part of the text.
If you are unsure what the correct setting should be, reread the explanations above. The
default is usually headinclude=false and footinclude=false, but this can change in the
KOMA-Script classes or in other KOMA - Script packages depending on the options used (see
section 3.1 and chapter 5).
Note that these options must be passed as class options when using one of the KOMA - Script
classes, or after loading the class with \KOMAoptions or \KOMAoption. Changing these options
after loading the typearea package does not automatically recalculate the type area. Instead,
the changes only take effect the next time the type area is recalculated. For recalculation
of the type area, see the DIV option with the values last or current (see page 38) or the
\recalctypearea command (see page 40).

mpinclude=simple switch
v2.8q In addition to documents where the header and footer are more likely to be part of the text
body than the margins, there are also documents where marginal notes should be considered
part of the text body as well. The option mpinclude does exactly this. The option, as a
v3.00 simple switch , accepts the standard values for simple switches in table 2.5. You can also
pass this option without specifying a value, in which case true is assumed.
The effect of mpinclude=true is that a width-unit is removed from the main text body and
used as the area for marginal notes. With the mpinclude=false option, which is the default
setting, part of the normal margin is used for marginal notes. The width of that area is one
or one-and-a-half width units, depending on whether you have chosen one-sided or two-sided
printing. The mpinclude=true option is mainly for experts and so is not recommended.
In most cases where the option mpinclude makes sense, you also require a wider area for
marginal notes. Often, however, only a part of the marginal note’s width should be part of the
text area, not the whole width, for example if the margin is used for quotations. Such quotations
are usually set as unjustified text, with the flush edge against the text area. Since the unjus-
tified text gives no homogeneous optical impression, these lines can protrude partially into the
margin. You can accomplish that by using the option mpinclude and by increasing the length
\marginparwidth after the type area has been set up. The length can be easily enlarged with the
command \addtolength. How much the length has to be increased depends on the individual
situation and it requires a certain amount of sensitivity. This is another reason the mpinclude
option is primarily intended for experts. Of course you can specify, for example, that the marginal
notes should project a third of the way into the normal margin by using the following:
\setlength{\marginparwidth}{1.5\marginparwidth}
Currently there is no option to enlarge the space for marginal notes within the text area. There
is only one way to accomplish this: first, either omit the mpinclude option or set it to false,
and then, after the type area has been calculated, reduce \textwidth (the width of the text
Chapter 2: Calculating the Page Layout with typearea 45

body) and increase \marginparwidth (the width of the marginal notes) by the same amount.
Unfortunately, this procedure cannot be combined with automatic calculation of the DIV value. In
contrast, mpinclude is taken into account with DIV=calc (see page 37).
Note that these options must be passed as class options when using one of the KOMA - Script
classes, or after loading the class with \KOMAoptions or \KOMAoption. Changing these options
after loading the typearea package does not automatically recalculate the type area. Instead,
the changes only take effect the next time the type area is recalculated. For recalculation
of the type area, see the DIV option with the values last or current (see page 38) or the
\recalctypearea command (see page 40).

headlines=number of lines
headheight=height
We have seen how to calculate the type area using the typearea package and how to specify
whether the header and footer are part of the text or the margins. However, especially for the
header, we still have to specify the height. This is achieved with the options headlines and
v3.00 headheight.
The headlines option specifies the number of lines of text in the header. The typearea
package uses a default of 1.25. This is a compromise: large enough for underlined headers
(see section 3.12) and small enough that the relative weight of the top margin is not affected
too much when the header is not underlined. Thus the default value will usually be adequate.
In special cases, however, you may need to adjust the header height more precisely to your
actual requirements.

Example: Suppose you want to create a two-line header. Normally this would result in LATEX
issuing the warning “overfull \vbox” for each page. To prevent this from hap-
pening, you tell the typearea package to calculate an appropriate type area:
\documentclass[a4paper]{article}
\usepackage[headlines=2.1]{typearea}
If you use a KOMA - Script class, you should pass this option directly to the class:
\documentclass[a4paper,headlines=2.1]{scrartcl}
Commands that can be used to define the contents of a two-line header can be
found in chapter 5.

In some cases it is useful to be able to specify the header height not in lines but directly
as a length. This is accomplished with the alternative option headheight. All lengths and
sizes that LATEX understands are valid for height . Note, however, that if you use a LATEX
length such as \baselineskip, its value is not fixed at the time the option is set. The value
that will be used will be the one current at the time the type area and margins are calculated.
Also, LATEX lengths like \baselineskip should never be used in the optional argument of
\documentclass or \usepackage.
Chapter 2: Calculating the Page Layout with typearea 46

Please be sure to note that these options must be passed as class options when using one
of the KOMA - Script classes, or after loading the class with \KOMAoptions or \KOMAoption.
Changing these options after loading the typearea package does not automatically recalculate
the type area. Instead, the changes only take effect the next time the type area is recalculated.
For recalculation of the type area, see the DIV option with the values last or current (see
page 38) or the \recalctypearea command (see page 40).

footlines=number of lines
footheight=height
\footheight
v3.12 Like the header, the footer also requires an indication of how high it should be. But unlike
the height of the header, the LATEX kernel does not provide a length for the height of the
footer. So typearea defines a new length, \footheight, if it does not already exist. Whether
this length will be used by classes or packages to design the headers and footers depends on
the individual classes and packages. The KOMA - Script package scrlayer-scrpage incorporates
\footheight and actively cooperates with typearea. The KOMA - Script classes, on the other
hand, do not recognize \footheight because without the help of packages they offer only
page styles with single-line page footers.
You can use footlines to set the number of lines in the footer, similar to headlines for
the number of lines in the header. By default the typearea package uses 1.25 footer lines.
This value is a compromise: large enough to accommodate an overlined or underlined footer
(see section 3.12), and small enough that the relative weight of the bottom margin is not
affected too much when the footer lacks a dividing line. Thus the default value will usually be
adequate. In special cases, however, you may need to adjust the footer height more precisely
to your actual requirements.

Example: Suppose you need to place a two-line copyright notice in the footer. Although
there is no test in LATEX itself to check the space available for the footer, exceeding
the designated height will likely result in unbalanced distribution of type area and
margins. Moreover, a package such as scrlayer-scrpage, which can be used to define
such a footer, performs the appropriate test and will report any overruns. So it
makes sense to specify the required footer height when calculating of the type area:
\documentclass[a4paper]{article}
\usepackage[footlines=2.1]{typearea}
Again, if you use a KOMA - Script class, you should pass this option directly to the
class:
\documentclass[footlines=2.1]{scrartcl}
Commands that can be used to define the contents of a two-line footer are described
in chapter 5.
Chapter 2: Calculating the Page Layout with typearea 47

In some cases it is useful to be able to specify the footer height not in lines but directly as
a length. This is accomplished with the alternative option footheight. All lengths and sizes
that LATEX understands are valid for height . Note, however, that if you use a LATEX length
such as \baselineskip, its value is not fixed at the time the option is set. The value that
will be used will be the one current at the time the type area and margins are calculated.
Also, LATEX lengths like \baselineskip should never be used in the optional argument of
\documentclass or \usepackage.
Please be sure to note that these options must be passed as class options when using one
of the KOMA - Script classes, or after loading the class with \KOMAoptions or \KOMAoption.
Changing these options after loading typearea does not automatically recalculate the type
area. Instead, the changes only take effect the next time the type area is recalculated. For
recalculation of the type area, see the DIV option with the values last or current (see page 38)
or the \recalctypearea command (see page 40).

\areaset[BCOR ]{width }{height }


So far, we have seen how to create a nice type area for standard situations and how the
typearea package makes it easier to accomplish this while still giving the freedom to adapt
the layout. However, there are cases where the text body has to adhere precisely to specific
dimensions. At the same time, the margins should be distributed as nicely as possible and,
if necessary, a binding correction should be taken into account. The typearea package offers
the command \areaset for this purpose. This command takes as parameters the width and
height of the text body, as well as the binding correction as an optional parameter. The width
and position of the margins are then calculated automatically, taking account of the options
headinclude, headinclude=false, footinclude and footinclude=false where needed. On
the other hand, the options headlines, headheight, footlines, and footheight are ignored!
For more information, see \areaset on page 473 of section 20.1.
The default for BCOR is 0 pt. If you want to preserve the current binding correction, for
example the value set by option BCOR, you can use the symbolic value current at an optional
argument.

Example: Suppose a text on A4 paper needs a width of exactly 60 characters in a typewriter


font and a height of exactly 30 lines per page. You can accomplish this with the
following preamble:
\documentclass[a4paper,11pt]{article}
\usepackage{typearea}
\newlength{\CharsLX}% Width of 60 characters
\newlength{\LinesXXX}% Height of 30 lines
\settowidth{\CharsLX}{\texttt{1234567890}}
\setlength{\CharsLX}{6\CharsLX}
\setlength{\LinesXXX}{\topskip}
\addtolength{\LinesXXX}{29\baselineskip}
Chapter 2: Calculating the Page Layout with typearea 48

\areaset{\CharsLX}{\LinesXXX}
The factor is 29 rather than 30 because the baseline of the topmost line of text
is \topskip below the top margin of the type area, as long as the height of the
topmost line is less than \topskip. So we don’t need to add any height for the
first line. The descenders of characters on the lowermost line, on the other hand,
protrude below the dimensions of the type area.
To set a book of poetry with a square text area with a side length of 15 cm and a
binding correction of 1 cm, the following is possible:
\documentclass{poetry}
\usepackage{typearea}
\areaset[1cm]{15cm}{15cm}

DIV=areaset
v3.00 In rare cases it is useful to be able to realign the current type area. This is possible with the
option DIV=areaset, where \KOMAoptions{DIV=areaset} corresponds to the
\areaset[current]{\textwidth}{\textheight}
command. The same result is obtained if you use DIV=last and the typearea was last set with
\areaset.
If you have concrete specifications for the margins, typearea is not suitable. In this case,
you should use the geometry package (see [Ume10]).

2.7. Selecting the Paper Size

The paper size is a key feature of a document. As already mentioned in the description of
the supported page layout constructions (see section 2.1 to section 2.3 starting on page 28),
the layout of the page, and hence the entire document, depends on the paper size. Whereas
the LATEX standard classes are limited to a few formats, KOMA - Script supports even unusual
paper sizes in conjunction with the typearea package.

paper=size
paper=orientation
v3.00 The paper option is the central element for paper-size selection in KOMA - Script. Size sup-
ports the American formats letter, legal, and executive. In addition, it supports the ISO
formats of the series A, B, C, and D, for example A4 or — written in lower case — a4.
Landscape orientations are supported by specifying the option one more time with the value
v3.02c landscape or seascape. The only difference between landscape and seascape is that that
the application dvips rotates landscape pages by -90 °, while it rotates seascape pages by
Chapter 2: Calculating the Page Layout with typearea 49

+90 °. Thus seascape is particularly useful whenever a PostScript viewer shows landscape
pages upside-down. In order for the difference to have an effect, you must not deactivate the
pagesize option described below.
v3.01b Additionally, the size can also be specified either in the form width :height or in the form
v3.22 height :width . Which value is taken as the height and which as the width depends on the
orientation of the paper. With paper=landscape or paper=seascape, the smaller value is
the height and the larger one is the width . With paper=portrait, the smaller value is the
width and the larger one is the height .
Note that until version 3.01a the first value was always the height and the second one the
width . From version 3.01b through version 3.21, the first value was always the width and
the second one the height . This is important if you use compatibility settings (see option
version, section 2.5, page 33).

Example: Suppose you want to print an ISO-A8 index card in landscape orientation. The
margins should be very small and no header or footer will be used.
\documentclass{article}
\usepackage[headinclude=false,footinclude=false,
paper=A8,landscape]{typearea}
\areaset{7cm}{5cm}
\pagestyle{empty}
\begin{document}
\section*{Supported Paper Sizes}
letter, legal, executive, a0, a1 \dots\ %
b0, b1 \dots\ c0, c1 \dots\ d0, d1 \dots
\end{document}
If the file cards have the special format (height:width) 5 cm : 3 cm, this can be
achieved using the following:
\documentclass{article}
\usepackage[headinclude=false,footinclude=false,%
paper=landscape,paper=5cm:3cm]{typearea}
\areaset{4cm}{2.4cm}
\pagestyle{empty}
\begin{document}
\section*{Supported Paper Sizes}
letter, legal, executive, a0, a1 \dots\ %
b0, b1 \dots\ c0, c1 \dots\ d0, d1 \dots
\end{document}

By default, KOMA - Script uses A4 paper in portrait orientation. This is in contrast to the
standard classes, which by default use the American letter paper format.
Please note that these options must be passed as class options when using one of the KOMA -
Script classes, or after loading the class with \KOMAoptions or \KOMAoption. Changing the
Chapter 2: Calculating the Page Layout with typearea 50

paper size or orientation with \KOMAoptions or \KOMAoption does not automatically recal-
culate the type area. Instead, the changes only take effect the next time the type area is
recalculated. For recalculation of the type area, see the DIV option with the values last or
current (see page 38) or the \recalctypearea command (see page 40).

pagesize=output driver
The above-mentioned mechanisms for choosing the paper format only affect the output insofar as
internal LATEX lengths are set. The typearea package then uses them in dividing the page into type
area and margins. The specification of the DVI formats, however, does not include any indication
of paper size. When outputting directly from the DVI format to a low-level printer language such as
PCL1 or ESC/P22 or ESC/P-R3 , this is usually not an issue, since with these formats the reference
zero-position is at the top left, as in DVI. But nowadays, the output is normally translated into
languages such as PostScript or PDF, in which the zero-position is at a different point, and in
which the paper format should be specified in the output file, which is missing this information. To
solve this problem, the corresponding driver uses a default paper size, which the user can change
either by an option or by specifying it in the TEX source file. When using the DVI driver dvips or
dvipdfm, the information can be given in the form of a \special command. When using pdfTEX,
luaTEX, XETEX or VTEX their paper-size lengths are set appropriately.
With the pagesize option, you can select an output driver for writing the paper size into
v3.17 the destination document. Supported output drivers are listed at table 2.6. The default is
pagesize. Using this option without providing a value is equivalent to pagesize=auto.

Example: Suppose a document should be available both as a DVI data file and in PDF format
for on-line viewing. The preamble might begin as follows:
\documentclass{article}
\usepackage[paper=A4,pagesize]{typearea}

If the pdfTEX engine is used and PDF output is enabled, the lengths \pdfpagewidth
and \pdfpageheight are set appropriately. If, however, a DVI data file is created —
whether by LATEX or by pdfLATEX — then a \special is written at the start of this
data file.

If you use an older version of typearea, you should always specify the pagesize option, because
older versions of typearea did not set them by default. As a rule, the method without an output
driver or with auto or automedia is convenient.

1
PCL is a family of printer languages that HP uses for its inkjet and laser printers.
2
ESC/P2 is the printer language that EPSON uses for its dot-matrix, and older inkjet or laser printers.
3
ESC/P-R is the printer language that EPSON currently uses for inkjet and laser printers.
Chapter 2: Calculating the Page Layout with typearea 51

Table 2.6.: Output driver for option pagesize=output driver

auto
Uses output driver pdftex if the pdfTEX-specific lengths \pdfpagewidth and
\pdfpageheight or the luaTEX-specific lengths \pagewidth and \pageheight are
defined. In addition, the output driver dvips will also be used. This setting is in
principle also suitable for XETEX.
automedia
Almost the same as auto but if the VTEX-specific lengths \mediawidth and
\mediaheight are defined, they will be set as well.
false, no, off
Does not set any output driver and does not send page size information to the output
driver.
dvipdfmx
v3.05a Writes the paper size into DVI files using \special{pagesize=width ,height }.
The name of the output driver is dvipdfmx because the application dvipdfmx handles
such specials not just in the preamble but in the document body too.
dvips
Using this option in the preamble sets the paper size using \special
{pagesize=width ,height }. Since the dvips driver cannot handle changes of paper
size in the inner document pages, a hack is required to achieve such changes. Use
changes of paper size after \begin{document} at your own risk, if you are using
dvips!
pdftex, luatex
v3.20 Sets paper size using the pdfTEX-specific lengths \pdfpagewidth and
\pdfpageheight or the luaTEX-specific lengths \pagewidth and \pageheight. You
can do this at any time in your document.

2.8. Tips

For theses and dissertations, many rules exist that violate even the most elementary rules
of typography. The reasons for such rules include the typographical incompetence of those
who issue them, but also the fact that they were originally meant for mechanical typewriters.
With a typewriter or a primitive text processor from the early 1980s, it was not possible to
produce typographically correct output without extreme effort. So rules were created that
appeared to be easy to follow and were still accommodating to a proofreader. These include
margins that lead to usable line lengths for one-sided printing with a typewriter. To avoid
extremely short lines, which are made worse by unjustified text, the margins were kept narrow
and the leading was increased to 1.5 lines to allow space for corrections. Before the advent of
Chapter 2: Calculating the Page Layout with typearea 52

modern text processing systems, single spacing would have been the only alternative — except
with TEX. In such a single-spaced document, even correction signs would have been difficult
to add. When computers became more widely available for text processing, some students
showed their playful side and tried to spice up their work by using an ornamental font to make
their work look better than it really was. They did not consider that such fonts are often more
difficult to read and therefore unsuitable for this purpose. Thus, two font families found their
way into the regulations which are neither compatible nor particularly suitable for the job in
the case of Times. Times is a relatively narrow typeface designed at the beginning of the 20th
century for the narrow columns of British newspapers. Modern versions usually are somewhat
improved. But still the Times font, which is often required, does not really fit the prescribed
margins.
LATEX already uses adequate line spacing, and the margins are wide enough for corrections.
Thus a page will look spacious, even when quite full of text.
Often these typographically questionable rules are difficult to implement in LATEX. A fixed
number of characters per line can be achieved only when a non-proportional font is used.
There are very few good non-proportional fonts available. Hardly any text typeset in this way
looks really good. In many cases font designers try to increase the serifs on the ‘i’ or ‘l’ to
compensate for the different character widths. This does not work and results in a fragmented
and agitated-looking text. If you use LATEX for your thesis, some of these rules have to be
either ignored or at least interpreted generously. For example, “60 characters per line” can be
interpreted not as a fixed but as an average or maximum value.
As implemented, typesetting rules are usually intended to obtain a useful result even if
the author does not know what needs to be considered. Useful frequently means readable
and correctable. In my opinion the type area of a text set with LATEX and the typearea
package meets these criteria well from the outset. So if you are confronted with regulations
which deviate substantially from it, I recommend that you present a sample of the text to
your advisor and ask whether you can submit the work despite deviations in the format. If
necessary the type area can be adapted somewhat by changing the DIV option. I advise against
using \areaset for this purpose, however. In the worst case, use the geometry package (see
[Ume10]), which is not part of KOMA - Script, or change the page layout parameters of LATEX
yourself. You can find the values as determined by typearea in the log file of your document.
The usegeometry option, which you can find in part II, can also improve the interactions
between typearea and geometry. This should allow modest adjustments. However, make sure
that the proportions of the text area match those of the page, taking the binding correction
into account.
If it is absolutely necessary to set the text with a line spacing of 1.5, do not under any
circumstances redefine \baselinestretch. Although this procedure is recommended all too
frequently, it has been obsolete since the introduction of LATEX 2ε in 1994. In the worst case,
use the \linespread command. I recommend the package setspace (see [TF11]), which is not
part of KOMA - Script. You should also let typearea recalculate a new type area after changing
Chapter 2: Calculating the Page Layout with typearea 53

the line spacing. However, you should switch back to the normal line spacing for the title,
and preferably for the table of contents and various lists — as well as the bibliography and the
index. For details, see the explanation of DIV=current.
The typearea package, even with option DIV=calc, calculates a very generous text area.
Many conservative typographers will find that the resulting line length is still excessive. The
calculated DIV value may be found in the log file for each document. So you can easily choose
a smaller value after the first LATEX run.
Not infrequently I am asked why I dwell on type area calculations for an entire chapter, when
it would be much easier just to provide a package with which you can adjust the margins as in
a word processor. Often it is said that such a package would be a better solution in any case,
since everyone knows how to choose appropriate margins, and that the margins calculated
by KOMA-Script are not that good anyway. I would like to quote Hans Peter Willberg and
Friedrich Forssmann, two of the most respected contemporary typographers [WF00]. (You
can find the original German in the German guide.)

The practice of doing things oneself has long been widespread, but the results are
often dubious because amateur typographers do not see what is wrong and cannot
know what is important. This is how you get used to incorrect and poor typography.
[. . . ] Now the objection could be made that typography is a matter of taste. When it
comes to decoration, one could perhaps accept that argument, but since typography
is primarily about information, not only can mistakes irritate, but they may even
cause damage.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 54

The Main Classes: scrbook, scrreprt, and scrartcl

The main classes of the KOMA - Script bundle are designed as counterparts to the standard
LATEX classes. This means that the KOMA - Script bundle contains replacements for the three
standard classes, book, report, and article. There is also a replacement for the standard letter
class. The document class for letters is described in a separate chapter because it is funda-
mentally different from the three main classes (see chapter 4).
The simplest way to use a KOMA - Script class instead of a standard one is to substitute
the class name in the \documentclass command in accordance with table 3.1. For example,
you can replace \documentclass{book} with \documentclass{scrbook}. Normally, LATEX
should process the document without errors, just as before the substitution. The layout,
however, should be different. Additionally, the KOMA - Script classes provide new possibilities
and options that are described in the following sections.
However, it should be noted here that some package authors develop their packages based
on the implementation and even internal code of the standard classes, without regard to
completely independent developments like the KOMA - Script classes. In such cases, the first
LATEX run after the change may well result in error messages or additional warnings. These
can usually be corrected in a simple way. Often the extended capabilities of KOMA - Script can
be used for this purpose, which completely eliminates the problematic package. Sometimes
the package scrhack documented in chapter 16 starting on page 414 can also help. Replacing
obsolete packages with current successors can also help to eliminate such problems. Sometimes
even the KOMA - Script classes provide warnings to help solve incompatibilities.
Let me say something before describing the classes. When beginning to write a document,
you are often unsure which specific options to choose. Some settings, for instance the choice of
paper size, may be fixed in advance. But even the question of the appropriate page layout could
be difficult to answer initially. On the other hand, these settings should be nearly irrelevant,
in the beginning, to the main business of an author: planning the document structure, writing
the text, preparing figures, tables, lists, index, and other data. As an author, you should
concentrate initially on the content. When that is done, you can take on the fine points
of presentation. In addition to the choice of options, this includes correcting hyphenation,
optimizing page breaks, and placing tables and figures.
Table 3.1.: Correspondence between standard classes and
KOMA - Script classes standard class KOMA - Script class
article scrartcl
report scrreprt
book scrbook
letter scrlttr2
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 55

3.1. Early or Late Selection of Options

The information in section 2.4 applies equally to this chapter. So if you have already read and
understood section 2.4, you can skip ahead to section 3.2, page 56.

\documentclass[option list ]{KOMA - Script class }


\usepackage[option list ]{package list }
LATEX allows users to pass class options as a comma-separated list of keywords in the optional
argument to \documentclass. In addition to being passed to the class, these options are also
passed on to all packages that can understand them. Users can also pass a similar comma-
v3.00 separated list of keywords in the optional argument of \usepackage. KOMA - Script extends
the option mechanism for the KOMA - Script classes and some packages with further options.
Thus most KOMA - Script options can also take a value, so an option does not necessarily
take the form option , but can also take the form option =value . Except for this difference,
\documentclass and \usepackage in KOMA - Script function as described in [Tea05b] or any
introduction to LATEX, for example [OPHS11].
When using a KOMA - Script class, you should not specify options when loading the typearea
or scrbase packages. The reason for this restriction is that the class already loads these
packages without options, and LATEX refuses to load a package multiple times with different
option settings. In general, it is not necessary to load either one of these packages explicitly
when using any KOMA - Script class.
Setting the options with \documentclass has one major disadvantage: unlike the interface
described below, the options in \documentclass are not robust. So commands, lengths,
counters, and similar constructs may break inside the optional argument of this command.
For example, with many non-KOMA - Script classes, using a LATEX length in the value of an
option results in an error. So if you want to use a LATEX length, counter, or command as part
of the value of an option, you should use \KOMAoptions or \KOMAoption. These commands
will be described next.

\KOMAoptions{option list }
\KOMAoption{option }{value list }
v3.00 KOMA-Script also provides the ability to change the values of most class and package options
even after loading the class or package. You can use the \KOMAoptions command to change
the values of a list of options, as in \documentclass or \usepackage. Each option in the
option list has the form option =value .
Some options also have a default value. If you do not specify a value, that is if you give the
option simply as option , then this default value will be used.
Some options can have several values simultaneously. For such options, it is possible, with
the help of \KOMAoption, to pass a list of values to a single option . The individual values
are given as a comma-separated value list .
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 56

KOMA-Script uses the commands \FamilyOptions and \FamilyOption with the family
“KOMA” to implement this ability. See part II, section 12.2, page 338.
Options set with \KOMAoptions or \KOMAoption will reach both the KOMA - Script class
and any previously loaded KOMA - Script packages that recognise these options. If an option
or a value is unknown, scrbase will report it as an error.

3.2. Compatibility with Earlier Versions of KOMA - Script

The information in section 2.5 applies equally to this chapter. So if you have already read and
understood section 2.5 you can skip ahead to page 57, page 57.
Those who produce their documents from source code typically attach the utmost impor-
tance to the fact that future LATEX runs will yield exactly the same result. In some cases,
however, improvements and bug fixes to the class will result in changes of behaviour, especially
to the layout. This, however, may be undesirable.

version=value
version=first
version=last
v2.96a Since Version 2.96a, KOMA - Script has been able to choose whether the source file should, as
much as possible, continue to produce exactly the same result within a LATEX run or should
be formatted according to the modifications of the latest version of the class. You can specify
the version with which you want your file to be compatible by using the version option.
Compatibility with the oldest supported KOMA - Script version can be achieved with version=
first or version=2.9 or version=2.9t. Setting value to an unknown release number will
result in a warning message and selects version=first for safety.
With version=last, you can select the latest version. In this case, you give up backwards
v3.01a compatibility. If the option is used without a value, last is assumed. This also corresponds
to the default setting, as long as you do not use any deprecated options.
If you use a deprecated option of KOMA - Script 2, KOMA - Script 3 will switch to version=
first automatically. This will also result in a warning message that explains how to prevent
this switch. Alternatively, you can choose a different setting for version with the desired
compatibility after the deprecated option.
Compatibility is primarily a question of line and page breaks (wrapping). If you choose
compatibility with an older version, new options that do not affect wrapping are still avail-
able. The version option does not affect any wrapping changes that are the result of fixing
unambiguous errors. If you need unconditional wrapping compatibility even in the case of
bugs, you should physically save the old KOMA - Script version you need together with your
document.
Note that you cannot change the version option after loading the class. Setting this option
with \KOMAoptions or \KOMAoption will therefore cause an error.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 57

3.3. Draft Mode

Many classes and packages provide a draft mode in addition to the normal typesetting mode.
The differences between these two are as diverse as the classes and packages that offer this
distinction.

draft=simple switch
overfullrule=simple switch
v3.00 The draft option distinguishes between documents being drafted and finished documents.
The simple switch can be one of the standard values for simple switches from table 2.5,
page 42. If you activate this option, small black boxes will be output at the end of overly
long lines. These boxes make it easier for the untrained eye to locate the paragraphs that
require manual post-processing. By contrast, the default, draft=false, shows no such boxes.
Incidentally, such lines often disappear when you use the microtype package [Sch13].
v3.25 Since the draft option can lead to all sorts of unwanted effects with various packages,
KOMA-Script allows you to control this marking of overly long lines separately with the
overfullrule option. If this option is enabled, the marker is again displayed.

3.4. Page Layout

Each page of a document consists of different layout elements, such as the margins, the header,
the footer, the text area, the marginal note column, and the distances between these elements.
KOMA-Script additionally distinguishes the entire page, also known as the paper, and the
visible page. Without doubt, the separation of the page into these different parts is one of
the basic features of a class. KOMA - Script delegates this work to the package typearea. This
package can also be used with other classes. The KOMA - Script classes, however, load typearea
on their own. Therefore, it’s neither necessary nor sensible to load the package explicitly with
\usepackage while using a KOMA - Script class. See also section 3.1, page 55.
Some settings of KOMA - Script classes affect the page layout and vice versa. Those effects
are documented at the corresponding settings.
For more information about the choice of paper format, the division of the page into margins
and type area, and the choice between one- and two-column typesetting, see the documentation
for the typearea package. You can find it in chapter 2, starting on page 28.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 58

\flushbottom
\raggedbottom
In two-sided documents especially, it is preferable to have the same visual baseline not only for the
first lines of each text area in a two-page spread but also for the last lines. If a page consists only of
text without paragraphs or headings, this is generally the result. But a paragraph spacing of half a
line would be enough to prevent you from achieving this goal if the number of paragraphs on each
page of the two-page spread differs by an odd number. In this case, at least some of the paragraph
distances need to be stretched or shrunk to reach the target again. TEX defines stretchable and
shrinkable distances for this purpose, and LATEX lets you perform this kind of vertical adjustment
automatically.
Using two-sided printing with the twoside option (see section 2.4, page 41) or two-column
formatting with the twocolumn option (see page 42) also activates this vertical adjustment.
v3.17 But this does not apply with a compatibility setting for a KOMA - Script version prior to 3.17
(see section 3.2, page 56, option version) if you use \KOMAoption or \KOMAoptions to change
the setting of these options.
You can also explicitly request vertical adjustment at any time starting with the current
page by using \flushbottom. \raggedbottom has the opposite effect, switching off vertical
adjustment starting with the current page. This corresponds to the default for one-sided
printing.
By the way, KOMA - Script uses a slightly modified method for adjusting the vertical skip.
This has been done to move footnotes to the bottom of the text area instead of having them
close to the last text line used.

3.5. Choosing the Document Font Size

The main font and its size are central elements in the design of a document. As stated in
chapter 2, the division of the page into the text area and the margins fundamentally depends
on them. The main font is the one that is used for most of the text in a document. All
variations, whether in shape, thickness, slant, or size, are related to the main font.

fontsize=size
While the standard classes support only a very limited number of font sizes, KOMA - Script
provides the ability to specify any size for the main font. You can also use any known
TEXunit as a unit for the size . If the size is specified without a unit, it is assumed to be
pt.
If you set the option within the document, the main font size and the dependent font sizes of
the commands \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large,
\LARGE, \huge and \Huge are changed. This can be useful, for example, if you want the
appendix to be set in a smaller font size.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 59

Note that using this option after loading the class does not automatically recalculate the type
area and margins (see \recalctypearea, section 2.6, page 40). However, if this recalculation
is performed, it will be based on the current main font size. The effects of changing the main
font size upon other loaded packages or the class used depends on these packages and on the
class. This means that you can encounter errors which are not the fault of KOMA - Script, and
even the KOMA - Script classes themselves do not recalculate all lengths if the main font size
changes after loading the class.
This option should by no means be misinterpreted as a substitute for \fontsize (see
[Tea05a]). Also, you should not use it in place of one of the font size commands that are
relative to the main font, from \tiny to \Huge.
The default for scrbook, scrreprt, and scrartcl is fontsize=11pt. In contrast, the default
size in the standard classes is 10pt. You may need to account for this difference if you switch
from a standard class to a KOMA - Script class.

3.6. Text Markup

LATEX offers different possibilities for logical and direct markup of text. In addition to the
choice of the font, this includes commands for choosing the font size and orientation. For
more information about the standard font facilities, see [OPHS11], [Tea05b], and [Tea05a].

\setkomafont{element }{commands }
\addtokomafont{element }{commands }
\usekomafont{element }
v2.8p With the help of the \setkomafont and \addtokomafont commands, you can attach particular
font styling commands that change the appearance of a given element . Theoretically, all state-
ments, including literal text, can be used as commands . You should, however, limit yourself
to those statements that really change font attributes only. These are usually commands like
\rmfamily, \sffamily, \ttfamily, \upshape, \itshape, \slshape, \scshape, \mdseries,
\bfseries, \normalfont, as well as the font size commands \Huge, \huge, \LARGE, \Large,
\large, \normalsize, \small, \footnotesize, \scriptsize, and \tiny. You can find these
commands explained in [OPHS11], [Tea05b], or [Tea05a]. Colour switching commands like
\normalcolor (see [Car17] and [Ker07]) are also acceptable. The use of other commands, in
particular those that redefine things or or lead to output, is not supported. Strange behaviour
is possible in these cases and does not represent a bug.
The command \setkomafont provides an element with a completely new definition of its
font styling. In contrast, the \addtokomafont command merely extends an existing definition.
You should not use either command inside the document body but only in the preamble. For
examples of their use, refer to the sections for the respective element. The name and meaning
of each element are listed in table 3.2 . The default values can be found in the corresponding
sections.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 60

With the \usekomafont command, the current font style can be changed to the one defined
for the specified element .

Example: Suppose you want to use the same font specification for the element captionlabel
that is used with descriptionlabel. This can be easily done with:
\setkomafont{captionlabel}{%
\usekomafont{descriptionlabel}%
}
You can find other examples in the explanation of each element.

Table 3.2.: Elements whose font style can be changed in scrbook, scrreprt or scrartcl with \setkomafont
and \addtokomafont

author
v3.12 author of the document in the title, i. e., the argument of \author when \maketitle
is used (see section 3.7, page 68)
caption
text of a figure or table caption (see section 3.20, page 130)
captionlabel
label of a figure or table caption; applied in addition to the caption element (see
section 3.20, page 130)
chapter
title of the sectioning command \chapter (see section 3.16, page 101)
chapterentry
table of contents entry for the sectioning command \chapter (see section 3.9,
page 76)
chapterentrydots
v3.15 optional points connecting table-of-content entries for the \chapter level, differing
from the chapterentry element, \normalfont and \normalsize (see section 3.9,
page 76)
chapterentrypagenumber
page number of the table of contents entry for the sectioning command \chapter,
differing from the element chapterentry (see section 3.9, page 76)
...
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 61

Table 3.2.: Elements whose font style can be changed (continued)

chapterprefix
label, e. g., “Chapter”, appearing before the chapter number in both chapterprefix=
true and appendixprefix=true (see section 3.16, page 96)
date
v3.12 date of the document in the main title, i. e., the argument of \date when \maketitle
is used (see section 3.7, page 68)
dedication
v3.12 dedication page after the main title, i. e., the argument of \dedication when
\maketitle is used (see section 3.7, page 71)
descriptionlabel
labels, i. e., the optional argument of \item in the description environment (see
section 3.18, page 120)
dictum
dictum or epigraph (see section 3.17, page 116)
dictumauthor
author of a dictum or epigraph; applied in addition to the element dictum (see
section 3.17, page 116)
dictumtext
alternative name for dictum
disposition
all sectioning command titles, i. e., the arguments of \part down to \subparagraph
and \minisec, including the title of the abstract; applied before the element of the
respective unit (see section 3.16, page 95)
footnote
footnote text and marker (see section 3.14, page 90)
footnotelabel
marker for a footnote; applied in addition to the element footnote (see section 3.14,
page 90)
footnotereference
footnote reference in the text (see section 3.14, page 90)
...
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 62

Table 3.2.: Elements whose font style can be changed (continued)

footnoterule
v3.07 horizontal rule above the footnotes at the end of the text area (see section 3.14,
page 94)
itemizelabel
v3.33 Default for the preset symbols of the environment itemize (see section 3.18,
page 118)
labelinglabel
labels, i. e., the optional argument of \item in the labeling environment (see sec-
tion 3.18, page 121)
labelingseparator
separator, i. e., the optional argument of the labeling environment; applied in ad-
dition to the element labelinglabel (see section 3.18, page 121)
labelitemi
v3.33 Font to be used in the item symbol definition \labelitemi (see section 3.18,
page 118)
labelitemii
v3.33 Font to be used in the item symbol definition \labelitemii (see section 3.18,
page 118)
labelitemiii
v3.33 Font to be used in the item symbol definition \labelitemiii (see section 3.18,
page 118)
labelitemiv
v3.33 Font to be used in the item symbol definition \labelitemiv (see section 3.18,
page 118)
minisec
title of \minisec (see section 3.16 ab page 106)
pagefoot
only used if package scrlayer-scrpage has been loaded (see chapter 5, page 263)
pagehead
alternative name for pageheadfoot
...
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 63

Table 3.2.: Elements whose font style can be changed (continued)

pageheadfoot
the header and footer of a page (see section 3.12 from page 80)
pagenumber
page number in the header or footer (see section 3.12)
pagination
alternative name for pagenumber
paragraph
title of the sectioning command \paragraph (see section 3.16, page 101)
part
title of the \part sectioning command, without the line containing the part number
(see section 3.16, page 101)
partentry
table of contents entry for the sectioning command \part (see section 3.9, page 76)
partentrypagenumber
page number of the table of contents entry for the sectioning command \part; applied
in addition to the element partentry (see section 3.9, page 76)
partnumber
line containing the part number in a title of the sectioning command \part (see
section 3.16, page 101)
publishers
v3.12 publishers of the document in the main title, i. e., the argument of \publishers
when \maketitle is used (see section 3.7, page 68)
section
title of the sectioning command \section (see section 3.16, page 101)
sectionentry
table of contents entry for sectioning command \section (only available in scrartcl,
see section 3.9, page 76)
...
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 64

Table 3.2.: Elements whose font style can be changed (continued)

sectionentrydots
v3.15 optional points connecting table-of-content entries for the \section level, differing
from the sectionentry element, \normalfont and \normalsize (only available in
scrartcl, see section 3.9, page 76)
sectionentrypagenumber
page number of the table of contents entry for the sectioning command \section; ap-
plied in addition to element sectionentry (only available in scrartcl, see section 3.9,
page 76)
sectioning
alternative name for disposition
subject
topic of the document, i. e., the argument of \subject on the main title page (see
section 3.7, page 68)
subparagraph
title of the sectioning command \subparagraph (see section 3.16, page 101)
subsection
title of the sectioning command \subsection (see section 3.16, page 101)
subsubsection
title of the sectioning command \subsubsection (see section 3.16, page 101)
subtitle
subtitle of the document, i. e., the argument of \subtitle on the main title page
(see section 3.7, page 68)
title
main title of the document, i. e., the argument of \title (for details about the title
size see the additional note in the text of section 3.7 from page 68)
titlehead
v3.12 heading above the main title of the document, i. e., the argument of \titlehead
when \maketitle is used (see section 3.7, page 68)
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 65

\usefontofkomafont{element }
\useencodingofkomafont{element }
\usesizeofkomafont{element }
\usefamilyofkomafont{element }
\useseriesofkomafont{element }
\useshapeofkomafont{element }
v3.12 Sometimes, although this is not recommended, the font setting of an element is used for
settings that are not actually related to the font. If you want to apply only the font setting
of an element but not those other settings, you can use \usefontofkomafont instead of
\usekomafont. This will activate the font size and baseline skip, the font encoding, the font
family, the font series, and the font shape of an element, but no further settings as long as
those further settings are local.
You can also switch to a single one of those attributes using one of the other commands.
Note that \usesizeofkomafont uses both the font size and the baseline skip.
However, you should not take these commands as legitimizing the insertion of arbitrary
commands in an element’s font setting. To do so can lead quickly to errors (see section 21.5,
page 479).

3.7. Document Titles

In general, we distinguish two kinds of document titles. First, there are title pages. These
include title of the document, together with additional information such as the author, on a
separate page. In addition to the main title page, there may be several other title pages, such
as the half-title or bastard title, publisher data, dedication, and so on. Second, there is the
in-page title. This kind of title appears at the top of a new page, usually the first, and is
specially emphasized. It too may be accompanied by additional information, but it will be
followed by more material on the same page, for example by an abstract, the table of contents,
or even a section.

titlepage=simple switch
titlepage=firstiscover
\coverpagetopmargin
\coverpageleftmargin
\coverpagerightmargin
\coverpagebottommargin
v3.00 This option determines whether to use document title pages or in-page titles when using
\maketitle (see page 67). Any value from table 2.5, page 42 can be used for simple switch .
With the titlepage=true or titlepage option, invoking \maketitle creates titles on
separate pages. These pages are set inside a titlepage environment, and they normally have
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 66

neither header nor footer. Compared to standard LATEX, KOMA - Script significantly expands
the handling of the titles. These additional elements can be found on the following pages.
In contrast, with the titlepage=false option, invoking \maketitle creates an in-page
title. This means that the title is specially emphasized, but it may be followed by more
material on the same page, for instance an abstract or a section.
v3.12 The third choice, titlepage=firstiscover not only activates title pages but also prints
the first title page of \maketitle, i. e. either the half-title or the main title, as a cover page.
Any other setting of the titlepage option will cancel this setting. The margins of the cover
page are given by \coverpagetopmargin, \coverpageleftmargin, \coverpagerightmargin,
and \coverpagebottommargin. The defaults of these depend on the lengths of \topmargin
and \evensidemargin and can be changed with \renewcommand.
The default of the scrbook and scrreprt classes is to use title pages. The scrartcl class, on
the other hand, uses in-page titles by default.

\begin{titlepage} . . . \end{titlepage}
The standard classes and KOMA - Script set all title pages in a special environment: the
titlepage environment. This environment always starts a new page — in two-sided printing
a new right-hand page — and in single-column mode. For this page, the style is changed to
\thispagestyle{empty}, so that neither page number nor running head is output. At the
end of the environment, the page is automatically shipped out. Should you not be able to use
the automatic layout of the title pages provided by \maketitle, described next, you should
design a new one with the help of this environment.

Example: Suppose you want a title page on which only the word “Me” stands at the top on
the left, as large as possible and in bold — no author, no date, nothing else. The
following document creates just that:
\documentclass{scrbook}
\begin{document}
\begin{titlepage}
\textbf{\Huge Me}
\end{titlepage}
\end{document}
It’s simple, isn’t it?
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 67

\maketitle[page number ]
While the standard classes produce at most one title page that can have three items (title,
author, and date), with KOMA - Script \maketitle can produce up to six pages. In contrast
to the standard classes, \maketitle in KOMA - Script accepts an optional numeric argument.
If it is used, this number is the page number of the first title page. This page number is not
output, but it affects the subsequent numbering. You should definitely choose an odd number,
because otherwise the whole count gets mixed up. In my opinion, there are only two useful
applications for the optional argument. On the one hand, you could give the the logical page
number -1 to the half-title in order to give the full title page the number 1. On the other hand,
you could use it to start at a higher page number, for example, 3, 5, or 7, to accommodate
other title pages added by the publishing house. The optional argument is ignored for in-page
titles. You can change the page style of such a title page by redefining the \titlepagestyle
macro (see section 3.12, page 84).
The following commands do not lead immediately to the ship-out of the titles. The typeset-
ting and ship-out of the title pages are always done by \maketitle. Note also that \maketitle
should not be used inside a titlepage environment. As shown in the examples, you should
use either \maketitle or titlepage, but not both.
The following commands only define the contents of the title. Therefore they must be used
before \maketitle. It is, however, not necessary and, when using the babel package not
recommended, to include these in the preamble before \begin{document} (see [BB13]). You
can find examples in the descriptions of the other commands in this section.

\extratitle{half-title }
\frontispiece{frontispiece }
In earlier times the inner book was often not protected from dirt by a cover. This function was then
assumed by the first page of the book, which usually had just a short title, known as the half-title.
Nowadays the extra page often appears before the real main title and contains information about
the publisher, series number, and similar information.
With KOMA - Script, it is possible to include a page before the real title page. The
half-title can be arbitrary text — even several paragraphs. The contents of the half-title
are output by KOMA - Script without additional formatting. Their organisation is completely
v3.25 left to the user. The verso of the half-title is the frontispiece. The half-title is set on its own
page even when in-page titles are used. The output of the half-title defined with \extratitle
takes place as part of the title produced by \maketitle.

Example: Let’s return to the previous example and suppose that the Spartan “Me” is the
half-title. The full title should still follow the half-title. You can proceed as follows:
\documentclass{scrbook}
\begin{document}
\extratitle{\textbf{\Huge Me}}
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 68

\title{It’s me}
\maketitle
\end{document}
You can centre the half-title horizontally and put it a little lower down the page:
\documentclass{scrbook}
\begin{document}
\extratitle{\vspace*{4\baselineskip}
\begin{center}\textbf{\Huge Me}\end{center}}
\title{It’s me}
\maketitle
\end{document}
The command \title is necessary in order to make the examples above work
correctly. It is explained next.

\titlehead{title head }
\subject{subject }
\title{title }
\subtitle{subtitle }
\author{author }
\date{date }
\publishers{publisher }
\and
\thanks{footnote }
There are seven elements available for the content of the main title page. The main title page
is output as part of the title pages created by \maketitle, while the definitions given here
only apply to the respective elements.
The title head is defined with the command \titlehead. It occupies the entire text
width, at the top of the page, in normal justification, and it can be freely designed by the
user. It uses the font element with same name (see table 3.4, page 69).
The subject is output with the font element of the same name immediately above the
title .
v2.8p The title is set in a very large font size. Along with the font size, the font element title
is applied (see table 3.4, page 69).
v2.97c The subtitle is set just below the title using the font element of the same name (see
table 3.4, page 69).
Below the subtitle appears the author . Several authors can be specified in the argument
of \author. They should be separated by \and. The output uses the font element of the same
name. (see table 3.4, page 69).
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 69

Table 3.3.: Font defaults for


the elements of the title Element name Default
author \Large
date \Large
dedication \Large
publishers \Large
subject \normalfont\normalcolor\bfseries\Large
subtitle \usekomafont{title}\large
title \usekomafont{disposition}
titlehead

Below the author or authors appears the date in the font of the element of the same name.
The default value is the current date, as produced by \today. The \date command accepts
arbitrary information — even an empty argument. The output uses the font element of the
same name (see table 3.4, page 69).
Finally comes the publisher . Of course this command can also be used for any other
information of minor importance. If necessary, the \parbox command can be used to typeset
this information over the full page width like a regular paragraph instead of centring it. It
should then be considered equivalent to the title head. Note, however, that this field is placed
above any existing footnotes. The output uses the font element of the same name (see table 3.4,
page 69).
Footnotes on the title page are produced not with \footnote, but with \thanks. They serve
typically for notes associated with the authors. Symbols are used as footnote markers instead
of numbers. Note that \thanks has to be used inside the argument of another command, such
as in the author argument of the command \author.
v3.12 For the output of the title elements, the font can be set using the \setkomafont and
\addtokomafont command (see section 3.6, page 59). The defaults are listed in table 3.3.
With the exception of title head and any footnotes, all output is centred horizontally.
These details are briefly summarized in table 3.4.
Table 3.4.: Font and
horizontal positioning Element Command Font Alignment
of the elements in the
main title page in the Title head \titlehead \usekomafont{titlehead} justified
order of their vertical Subject \subject \usekomafont{subject} centred
position from top to Title \title \usekomafont{title}\huge centred
bottom when typeset Subtitle \subtitle \usekomafont{subtitle} centred
with \maketitle Authors \author \usekomafont{author} centred
Date \date \usekomafont{date} centred
Publishers \publishers \usekomafont{publishers} centred
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 70

Note that for the main title, \huge will be used after the font switching element title. So
you cannot change the size of the main title using \setkomafont or \addtokomafont.

Example: Suppose you are writing a dissertation. The title page should have the university’s
name and address at the top, flush left, and the semester, flush right. As usual, a
title including author and submission date should be given. The adviser must also
be indicated, together with the fact that the document is a dissertation. You can
do this as follows:
\documentclass{scrbook}
\usepackage[english]{babel}
\begin{document}
\titlehead{{\Large Unseen University
\hfill SS~2002\\}
Higher Analytical Institute\\
Mythological Rd\\
34567 Etherworld}
\subject{Dissertation}
\title{Digital space simulation with the DSP\,56004}
\subtitle{Short but sweet?}
\author{Fuzzy George}
\date{30. February 2002}
\publishers{Adviser Prof. John Eccentric Doe}
\maketitle
\end{document}

A common misconception concerns the function of the full title page. It is often erroneously
assumed to be the cover or dust jacket. Therefore, it is frequently expected that the title page
will not follow the normal layout for two-sided typesetting but will have equally large left and right
margins.
But if you pick up a book and open it, you will quickly find at least one title page inside the
cover, within the so-called book block. Precisely these title pages are produced by \maketitle.
As is the case with the half-title, the full title page belongs to the book block, and therefore
should have the same page layout as the rest of the document. A cover is actually something that
you should create in a separate document. After all, it often has a very distinct format. It can
also be designed with the help of a graphics or DTP program. A separate document should also
be used because the cover will be printed on a different medium, such as cardboard, and possibly
with another printer.
Nevertheless, since KOMA - Script 3.12 the first title page issued by \maketitle can be for-
matted as a cover page with different margins. Changes to the margins on this page do not affect
the other margins. For more information about this option, see titlepage=firstiscover on
page 65.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 71

\uppertitleback{titlebackhead }
\lowertitleback{titlebackfoot }
In two-sided printing, the standard classes leave the back (verso) of the title page empty.
However, with KOMA - Script the back of the full title page can be used for other informa-
tion. There are exactly two elements which the user can freely format: titlebackhead and
titlebackfoot . The header can extend to the footer and vice versa. Using this guide as an
example, the legal disclaimer was set with the help of the \uppertitleback command.

\dedication{dedication }
KOMA-Script offers its own dedication page. This dedication is centred and set by default
v3.12 with a slightly larger font. The exact font setting for the dedication element, which is
taken from table 3.3, page 69, can be changed with the \setkomafont and \addtokomafont
commands (see section 3.6, page 59).

Example: Suppose you have written a book of poetry and want to dedicate it to your spouse.
A solution would look like this:
\documentclass{scrbook}
\usepackage[english]{babel}
\begin{document}
\extratitle{\textbf{\Huge In Love}}
\title{In Love}
\author{Prince Ironheart}
\date{1412}
\lowertitleback{This poem book was set with%
the help of {\KOMAScript} and {\LaTeX}}
\uppertitleback{Self-mockery Publishers}
\dedication{To my treasured hazel-hen\\
in eternal love\\
from your dormouse.}
\maketitle
\end{document}
Please use your own favourite pet names to personalize it.

3.8. Abstract

Particularly with articles, more rarely with reports, there is an abstract, or summary, directly
beneath the title and before the table of contents. When using an in-page title, this abstract
is normally a kind of left- and right-indented block. In comparison, the abstract appears as a
chapter or section when using title pages.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 72

abstract=simple switch
scrreprt, In the standard classes, the abstract environment sets the text “Abstract” centred before
scrartcl the abstract text. This used to be the normal practice. Since then, reading newspapers has
trained us to recognize a suitably highlighted text at the beginning of an article or report as
the abstract. This is even more true when the text comes before the table of contents. It is also
v3.00 confusing if, of all things, this title appears small and centred. KOMA - Script offers the option
to include or exclude the abstract’s title with the abstract option. For simple switch , you
can use any value from table 2.5, page 42. The default for KOMA - Script is false.
Books typically use a different kind of summary. There, you usually place an appropriate
chapter at the beginning or the end of the work. This chapter is often combined with either
the introduction or a description of a larger prospectus. Therefore, the scrbook class has no
abstract environment. A summary chapter is also recommended for reports in a wider sense,
such as a Master’s thesis or Ph.D. dissertation. See the commands \chapter*, \addchap, and
\addchap* documented in section 3.16, from page 105.

\begin{abstract} . . . \end{abstract}
scrartcl,
scrreprt Some LATEX classes provide a special environment for this summary: the abstract environ-
ment. This is output directly, so it is not part of the title created with \maketitle. Please
note that abstract is an environment, not a command. Whether the abstract has a heading
or not is determined by the abstract option (see above).
For books, the abstract is usually part of the introduction or a separate chapter at the end
of the document. Therefore scrbook does not provide an abstract environment. When using
the scrreprt class, it is definitely worth considering whether to proceed in the same way. See
the commands \chapter* and \addchap, or \addchap* in section 3.16 from page 105 for more
on this.
When using an in-page title (see option titlepage, section 3.7, page 65), the abstract is set
internally using the quotation environment (see section 3.18, page 124). This way paragraphs
will be set with the first line indented. If the first paragraph of the abstract should not be
indented, you can suppress this indent by using \noindent just after \begin{abstract}.

3.9. Table of Contents

The title and optional abstract are normally followed by a table of contents. Often you also
find additional lists of the floating environments, such as tables and figures, after the table of
contents (see section 3.20).
In addition to the options documented in this section, the tocbasic package style selected and
configured with \DeclareTOCStyleEntry (see page 388) also has a significant impact on the
appearance of the table of contents. Similarly, the commands \DeclareSectionCommand,
\ProvideSectionCommand, \DeclareNewSectionCommand and \RedeclareSectionCommand
documented in section 21.8, page 482 can also affect the table of contents.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 73

toc=setting
It is becoming increasingly common to include lists of tables and figures, the bibliography,
and sometimes even the index in the table of contents. This is surely related to the recent
trend of putting lists of figures and tables at the end of the document. Both lists are similar
to the table of contents in structure and intention. I’m therefore sceptical of this evolution.
Since it makes no sense to include only the list of tables or that of figures in the table of
v3.00 contents without the other, there is only one setting listof, which causes entries for both
types of lists to be included. This also includes any lists produced with version 1.2e or later of
the float package from Version 1.2e (see [Lin01]) or floatrow (see [Lap08]). None of these lists
are generally given a chapter number. If you want to ignore this principle, use the setting
listofnumbered.
The toc=index option causes an entry for the index to be included in the table of contents.
The index is unnumbered since it too only includes references to the contents of the other
v3.18 sectioning levels. Despite the author’s concerns, KOMA - Script does support deviating from
this principle with toc=indexnumbered.
The bibliography is a slightly different kind of listing. It does not list the contents of
the present document but refers instead to external sources. For that reason, it could be
argued that it qualifies as a chapter (or section) and, as such, should be numbered. The toc=
bibliographynumbered option has this effect, and puts the appropriate entry in the table
of contents. However, I think that this reasoning would lead us to consider even a classic,
annotated source list to be a separate chapter. Moreover, the bibliography is ultimately not
something that you wrote yourself. Therefore the bibliography merits, at best, an unnumbered
entry in the table of contents, and you can achieve this achieved with toc=bibliography.
v2.8q The table of contents is normally formatted so that different levels of sectioning commands
have different indentations. The number for each level is set left-justified in a fixed-width field.
v3.00 This default set-up is selected with the toc=graduated option.
If the sectioning level which appears in the table of contents is too deep, the number for
that level can be so wide that the space reserved for the number is insufficient. The German
FAQ [Wik] suggests redefining the table of contents in such a case. KOMA - Script offers an
alternative format that avoids the problem completely. If you use the toc=flat option, no
graduated indentation is applied to the headings of the sectioning levels. Instead, a table-
like organisation is used, where all sectioning numbers and headings are set in a left-justified
column. The space necessary for the section numbers is thus determined automatically.
You can find an overview of all available values for the setting of toc. in table 3.5.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 74

Table 3.5.: Available values for the toc option to set the format and contents of the table of contents

bibliography, bib
The bibliography has an unnumbered entry in the table of contents.
bibliographynumbered, bibnumbered, numberedbibliography, numberedbib
The bibliography has a numbered entry in the table of contents.
chapterentrywithdots, chapterentrydotfill
v3.15 The chapter entries for the scrbook and scrreprt classes also use dots to separate the
heading text from the page numbers.
chapterentrywithoutdots, chapterentryfill
v3.15 The chapter entries of the scrbook and scrreprt classes use white space to separate
the heading text from the page numbers. This corresponds to the default setting.
flat, left
The table of contents is set in table form. The numbers of the headings are in the first
column, the heading text in the second column, and the page number in the third
column. The amount of space needed for the numbers of the headings is determined
by the required amount of space detected during the previous LATEX run.
graduated, indent, indented
The table of contents is set in hierarchical form. The amount of space for the heading
numbers is limited. This corresponds to the default setting.
indenttextentries, indentunnumbered, numberline
v3.12 The numberline property (see section 15.2, page 385) is set for the table of contents.
As a result, unnumbered entries are left aligned with the text of numbered entries
of the same level.
index, idx
The index has an unnumbered entry in the table of contents.
indexnumbered, idxnumbered, numberedindex, numberedidx
v3.18 The index has a numbered entry in the table of contents.
leftaligntextentries, leftalignunnumbered, nonumberline
v3.12 The numberline property (see section 15.2, page 385) is deleted for the table of
contents. This places unnumbered entries left-aligned with the number of numbered
entries of the same level. This corresponds to the default setting.
...
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 75

Table 3.5.: Available values for the toc option (continued)

listof
The lists of floating environments, e. g. figures and tables, have unnumbered entries
in the table of contents.
listofnumbered, numberedlistof
The lists of floating environments, e. g. figures and tables, have numbered entries in
the table of contents.
nobibliography, nobib
The bibliography does not have an entry in the table of contents. This corresponds
to the default setting.
noindex, noidx
The index does not have an entry in the table of contents. This corresponds to the
default setting.
nolistof
The lists of floating environments, e. g. figures and tables, do not have entries in the
table of contents. This corresponds to the default setting.
sectionentrywithdots, sectionentrydotfill
v3.15 The section entries of the scrartcl class also use dots to separate the heading text
from the page numbers.
sectionentrywithoutdots, sectionentryfill
v3.15 The section entries of the scrartcl class use white space to separate the heading text
from the page number. This corresponds to the default setting.

chapterentrydots=simple switch
sectionentrydots=simple switch
v3.15 These options configure a dotted connecting line between the text and page number of the
scrbook, chapter entries for the scrbook and scrreprt classes, or for the section entries of the scrartcl
scrreprt class, in the table of contents. For the simple switch , you can use any value from table 2.5,
scrartcl page 42. The default is false. It selects an empty gap instead of dots.
If a dotted line is used, you can change its font using the element chapterentrydots or
sectionentrydots (see also \setkomafont and \addtokomafont, section 3.6, page 59, as well
as table 3.2, page 60). The defaults of the elements are shown in table 3.6, from page 76. Note
that the dots of all entries will be equally spaced only if all dots use the same font. Because of
this the base font is always \normalfont\normalsize and only the colour of chapterentry
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 76

Table 3.6.: Default font


styles for the elements of Element Default font style
the table of contents
partentry \usekomafont{disposition}\large
partentrypagenumber
chapterentry \usekomafont{disposition}
chapterentrydots \normalfont
chapterentrypagenumber
sectionentry \usekomafont{disposition}
sectionentrydots \normalfont
sectionentrypagenumber

or sectionentry is also used for the dots.

\tableofcontents
The table of contents is output by the \tableofcontents command. To get correct values
in the table of contents requires at least two LATEX runs after every change. The toc option
described above can also affect the extent and format of the table of contents. After changing
the settings of this option, at least two LATEX runs are needed again.
Entries for \chapter with scrbook and scrreprt, or \section with scrartcl, and the sectioning
level \part are not indented. Additionally, there are no dots between the text of this heading
and the page number. The typographical logic for this behaviour is that the font is usually
v3.15 distinct and appropriate emphasis is desirable. However, you can change this behaviour with
the previously documented options. The table of contents of this guide is created with the
default settings and serves as an example.
v2.97c The font style of the top two levels in the table of contents is also affected by the settings
for the partentry element, as well as by the chapterentry element for the scrbook and
scrreprt classes, and by the sectionentry element for the scrartcl class. You can set the
font style of the page numbers separately from these elements using partentrypagenumber
and chapterentrypagenumber — for scrbook and scrreprt — or sectionentrypagenumber —
for scrartcl — (see \setkomafont and \addtokomafont in section 3.6, page 59, or table 3.2,
v3.15 page 60). If you use dotted lines connecting the heading entries (chapter or section depending
on the class) to the page numbers using the toc chapterentrydots or sectionentrydots
option, you can change their font style using the chapterentrydots and sectionentrydots
elements. The defaults for these elements are found in table 3.6.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 77

tocdepth
\parttocdepth
\sectiontocdepth
\subsectiontocdepth
\subsubsectiontocdepth
\paragraphtocdepth
\subparagraphtocdepth
Normally, the sectioning divisions included in the table of contents are all those from \part
to \subsection for the scrbook and scrreprt classes, or from \part to \subsubsection for
the scrartcl class. Whether or not to include a sectioning level in the table of contents is
controlled by the tocdepth counter. This has the value -1 for \part, 0 for \chapter, and
so on. By incrementing or decrementing the counter, you can choose the lowest sectioning
level to include in the table of contents. Incidentally, the standard classes work the same
v3.15 way. Unlike with the standard classes, with KOMA - Script you do not need to remember these
values. KOMA - Script defines a \level tocdepth command for each sectioning level with the
appropriate value which you can use to set tocdepth.
scrartcl Please note that in scrartcl, the values of tocdepth and secnumdepth (see section 3.16,
page 113) for \part are not the same. This behaviour was copied from the standard article
class for compatibility. Thus, for example, you should not use \partnumdepth to set the value
of tocdepth.
Example: Suppose you are preparing an article that uses the sectioning level \subsubsection.
However, you do not want this sectioning level to appear in the table of contents.
The preamble of your document might contain the following:
\documentclass{scrartcl}
\setcounter{tocdepth}{\subsectiontocdepth}
Thus you set the tocdepth counter to the value of the \subsectiontocdepth com-
mand. That value is normally 2, but this way, you do not have to remember it.
If instead you simply want to include one less level in the table of contents than you
normally would, you can simply subtract one from the default value of tocdepth:
\documentclass{scrartcl}
\addtocounter{tocdepth}{-1}
The value that you need to add to or subtract from tocdepth is listed in the table
of contents after at least two LATEX runs.

3.10. Marking Paragraphs

The standard classes normally set paragraphs indented and without any vertical, inter-
paragraph space. This is the best solution when using a regular page layout like the ones
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 78

produced with the typearea package. If neither indentation nor vertical space is used, only
the length of the last line would give the reader a guide to the paragraph break. In extreme
cases, it is very difficult to tell whether a line is full or not. Furthermore, typographers find
that a signal given at the paragraph’s end is easily forgotten by the start of the next line.
A signal at the paragraph’s beginning is more easily remembered. Inter-paragraph spacing
has the drawback of disappearing in some contexts. For instance, after a displayed formula it
would be impossible to detect if the previous paragraph continues or a new one begins. Also,
at the top of a new page, it might be necessary to look at the previous page to determine if a
new paragraph has been started or not. All these problems disappear when using indentation.
A combination of indentation and vertical inter-paragraph spacing is redundant and therefore
should be avoided. Indentation alone is sufficient. The only drawback of indentation is that it
shortens the line length. The use of inter-paragraph spacing is therefore justified when using
short lines, such as in a newspaper.

parskip=method
Once in a while you may require a document layout with vertical inter-paragraph spacing
instead of indentation. The KOMA - Script classes provide several ways to accomplish this
v3.00 with the parskip option. The method consists of two elements. The first element is either
full or half, where full stands for a paragraph spacing of one line and half stands for a
paragraph spacing of half a line. The second element consists of one of the characters “*”,
“+”, or “-” and can be omitted. Without the second element, the final line of a paragraph
will end with a white space of at least 1 em. With the plus character as the second element,
the white space will be at least one third — and with the asterisk one fourth — the width of a
normal line. With the minus variant, no provision is made for white space in the last line of
a paragraph.
You can change the setting at any time. If you change it inside the document, the
v3.08 \selectfont command will be called implicitly. Changes to paragraph spacing within a
paragraph will not be visible until the end of the paragraph.
In addition to the resulting eight combinations for method , you can use the values for simple
switches shown in table 2.5, page 42. Activating the option corresponds to using full with no
second element and therefore results in inter-paragraph spacing of one line with at least 1 em
white space at the end of the last line of each paragraph. Deactivating the option re-activates
the default indentation of 1 em at the first line of the paragraph instead of paragraph spacing.
A summary of all possible values for method are shown in table 3.7.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 79

Table 3.7.: Available values of option parskip to select how paragraph are distinguished

false, off, no
Paragraphs are identified by indentation of the first line by 1em. There is no spacing
requirement at the end of the last line of a paragraph.
full, true, on, yes
Paragraphs are identified by a vertical space of one line between paragraphs. There
must be at least 1 em of free space at the end of the last line of the paragraph.
full-
Paragraphs are identified by a vertical space of one line between paragraphs. There
is no spacing requirement at the end of the last line of a paragraph.
full+
Paragraphs are identified by a vertical space of one line between paragraphs. There
must be at least a third of a line of free space at the end of a paragraph.
full*
Paragraphs are identified by a vertical space of one line between paragraphs. There
must be at least a quarter of a line of free space at the end of a paragraph.
half
Paragraphs are identified by a vertical space of half a line between paragraphs. There
must be at least 1 em free space at the end of the last line of a paragraph.
half-
Paragraphs are identified by a vertical space of half a line between paragraphs. There
is no spacing requirement at the end of the last line of a paragraph.
half+
Paragraphs are identified by a vertical space of half a line between paragraphs. There
must be at least a third of a line of free space at the end of a paragraph.
half*
Paragraphs are identified by a vertical space of half a line between paragraphs. There
must be at least a quarter of a line of free space at the end of a paragraph.
never
v3.08 No inter-paragraph spacing will be inserted even if additional vertical spacing is
needed for vertical adjustment with \flushbottom.

All eight full and half option values also change the spacing before, after, and inside list
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 80

environments. This prevents these environments or the paragraphs inside them from having
a larger separation than that between the paragraphs of normal text. Additionally, these
options ensure that the table of contents and the lists of figures and tables are set without any
additional spacing.
The default behaviour of KOMA - Script is parskip=false. In this case, there is no spacing
between paragraphs, only an indentation of the first line by 1 em.

3.11. Detecting Odd and Even Pages

In two-sided documents we distinguish left and right pages. Left pages always have an even
page number, and right pages always have an odd page number. Identifying right and left
pages is equivalent to identifying even- or odd-numbered pages, and so we normally refer to
them as even and odd pages in this guide.
In one-sided documents, the distinction between left and right pages does not exist. Never-
theless, there are still pages with even and odd page numbers.

\Ifthispageodd{true part }{false part }


v3.28 If you want to determine whether text appears on an even or odd page, KOMA - Script provides
the \Ifthispageodd command. The true part argument is executed only if you are currently
on an odd page. Otherwise the false part argument is executed.

Example: Suppose you simply want to show whether a text will be placed onto an even or
odd page. You may achieve that using
This page has an \Ifthispageodd{odd}{even}
page number.
This results in the output
This page has an even page number.

Because the \Ifthispageodd command uses a mechanism that is very similar to a label
and a reference to it, at least two LATEX runs are required after each change to the text. Only
then will the decision be correct. In the first run, a heuristic is used to make the initial choice.
In section 21.1, page 476, advanced users can find more information about the problems of
detecting left and right pages, or even and odd page numbers.

3.12. Headers and Footers Using Predefined Page Styles

One of the general characteristics of a document is the page style. In LATEX this primarily
consists of the contents of headers and footers.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 81

headsepline=simple switch
footsepline=simple switch
v3.00 You can use these options to specify whether a horizontal rule appears beneath the header
or above the footer. You can use any of the values for simple switches shown in table 2.5,
page 42. Setting the headsepline option to true or invoking it with no value results in a line
beneath the header. Similarly, activating the footsepline option results in a rule above the
footer. Deactivating either option switches off the respective rule.
The headsepline option naturally has no effect with the empty and plain page styles, which
are described below, because these styles explicitly dispense with a header. Typographically,
such a line has the effect of making the header appear to be closer to the text. This does not
mean that the header then needs to be moved farther away from the body of the text. Instead,
the header should be considered as belonging to the text body for the purpose of calculating
the type area. KOMA - Script takes this into account by passing the headsepline option to the
typearea package, which then automatically executes the package option headinclude with
the same value. The same applies to the footer separation line. Unlike headsepline, the
footsepline option also affects the plain page style because plain prints a page number in
the footer.
The options themselves do not automatically recalculate the type area. To recalculate it,
use the DIV option with the values last or current (see page 38) or the \recalctypearea
command (see page 40) in chapter 2.
The scrlayer-scrpage package (see chapter 5) offers further possibilities for adjusting lines in
headers and footers.

\pagestyle{page style }
\thispagestyle{local page style }
There are usually four different page styles:
empty is the page style with completely empty headers and footers. In KOMA - Script this is
identical to the standard classes.
headings is the page style with running heads in the header. In this style, headings are auto-
scrbook, matically inserted into the header. With the classes scrbook and scrreprt, the headings
scrreprt of chapters and sections are repeated in the header for two-sided printing — on the outer
side with KOMA - Script, on the inner side with the standard classes. KOMA - Script puts
the page number on the outer side of the footer; the standard classes put it on the inner
side of the header. In one-sided printing, KOMA - Script uses only the chapter headings,
scrartcl which are centred in the header, and puts the page numbers centred in the footer. scrartcl
behaves similarly but starts one a level deeper in the sectioning hierarchy, with sections
and subsections, because the chapter level does not exist in this case.
While the standard classes automatically convert the running heads to upper-case let-
ters, KOMA - Script uses the capitalisation found in the headings. There are several
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 82

Table 3.8.: Default values for page


style elements Element Default
pagefoot
pageheadfoot \normalfont\normalcolor\slshape
pagenumber \normalfont\normalcolor

typographical reasons for this. Upper-case letters are actually far too massive as a
text decoration. If you use them anyway, they should be set one point smaller and with
slightly tighter spacing. The standard classes do not take these points into consideration.
In addition, the KOMA - Script classes support rules below the header and above the
footer with the headsepline and footsepline options (see page 81).

myheadings mostly corresponds to the headings page style, but the running heads are
not generated automatically — they have to be defined by the user. You can use the
\markboth and \markright commands for that purpose (see page 83).

plain is the page style with no running head and only a page number in the footer. The
standard classes always centre this page number in the footer. KOMA - Script puts the
page number on the outer side of the footer in two-sided mode. KOMA - Script behaves
like the standard classes in one-sided printing.

You can set the page style at any time with the help of the \pagestyle command, and
this setting takes effect with the next page that is output. If you use \pagestyle just before
a command that results in an implicit page break and if the new page style should be used
on the resulting new page, a \cleardoublepage just before \pagestyle will be useful. But
usually you set the page style only once, at the beginning of the document or in the preamble.
To change the page style of the current page only, use the \thispagestyle command. This
occurs automatically at some points in the document. For example, the \thispagestyle
{\chapterpagestyle} command is issued implicitly on the first page of a chapter.
Note that when you use the scrlayer-scrpage package, switching between automatic and
manual running heads is no longer accomplished by changing the page styles but with special
instructions. You should not use the headings and myheadings page styles with this package.
v2.8p To change the font style used for the header, the footer, or the page number, use the
\setkomafont and \addtokomafont commands (see section 3.6, page 59). The same element,
pageheadfoot, is used for the header and the footer. The element for the page number within
the header or footer is called pagenumber. The pagefoot element, which is also provided
by the KOMA - Script classes, is used only if you define a page style with the scrlayer-scrpage
package in which the footer contains text (see chapter 5, page 263).
You can find the default settings in table 3.8.

Example: Suppose you want to set header and footer in a smaller type size and in italics.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 83

However, the page number should not be set in italics but in bold. Apart from the
fact that the result will look horrible, you can do this as follows:
\setkomafont{pageheadfoot}{%
\normalfont\normalcolor\itshape\small}
\setkomafont{pagenumber}{\normalfont\bfseries}
On the other hand, if you only want a smaller font to be used along with the default
slanted text, you can use the following:
\addtokomafont{pagehead}{\small}
As you can see, the previous example uses the pagehead element. You can achieve
the same result using pageheadfoot instead (see table 3.2 on page 60).

It is not possible to use these methods to force upper-case letters to be used automatically
for the running heads. Although you can redefine \MakeMarkcase, in such cases you should
instead use the scrlayer-scrpage package (see chapter 5, page 272).
If you define your own page styles, the commands \usekomafont{pageheadfoot},
\usekomafont{pagenumber}, and \usekomafont{pagefoot} can be useful. In particular,
if you do not use the KOMA - Script package scrlayer-scrpage (see chapter 5) but use, for ex-
ample, the fancyhdr package (see [vO04]), you can use these commands in your definitions. In
this way you can maintain compatibility with KOMA - Script as much as possible. If you do
not use these commands in your own definitions, changes such as those shown in the previous
examples have no effect. The scrlayer-scrpage package tries to maintain maximum compatibil-
ity as long as, for example, \thepage is not used directly for the page number rather than the
\pagemark which is provided for it.

\markboth{left mark }{right mark }


\markright{right mark }
The myheadings page style does not set the running head. Instead, you set it with the help of
the \markboth and \markright commands. This way the left mark will normally be used in
the header of even pages and right mark in the header of odd pages. With one-sided printing,
only the right mark exists. With the scrlayer-scrpage package, the \markleft command is
also available.
You can use these commands with other page styles too. However, when combined with au-
tomatic running heads, for example with the headings page style, the effect of the commands
lasts only until the next time the respective marks are set automatically.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 84

Table 3.9.: Macros to set up the page style of special pages

\titlepagestyle
Page style for a title page when using in-page titles.
\partpagestyle
Page style for pages with \part titles.
\chapterpagestyle
Page style for the first page of a chapter.
\indexpagestyle
Page style for the first page of the index.

\titlepagestyle
\partpagestyle
\chapterpagestyle
\indexpagestyle
On some pages, a different page style is chosen automatically with the help of the
\thispagestyle command. Which page style this actually is, is defined by these four macros,
scrbook, of which \partpagestyle and \chapterpagestyle are found only with classes scrbook and
scrreprt scrreprt, and not in scrartcl. The default value for all four cases is plain. You can find the
meaning of these macros in table 3.9. You can redefine the page styles with the \renewcommand
macro.

Example: Suppose you do not want the pages with a \part heading to be numbered. You
can use the following command in the preamble of your document:
\renewcommand*{\partpagestyle}{empty}
As mentioned previously on page 81, the empty page style is exactly what is required
in this example. Of course, you can also use a user-defined page style.
Suppose you have defined your own page style for initial chapter pages with the
scrlayer (see section 17.4) or the scrlayer-scrpage package (see section 18.2). You
have given this page style the fitting name of chapter. To actually use this style,
you must redefine \chapterpagestyle in this way:
\renewcommand*{\chapterpagestyle}{chapter}
Suppose you do not want the table of contents of a book to have page numbers.
Everything after the table of contents, however, should use the headings page style,
including the plain page style for the first page of every chapter. You can use the
following:
\clearpage
\pagestyle{empty}
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 85

\renewcommand*{\chapterpagestyle}{empty}
\tableofcontents
\clearpage
\pagestyle{headings}
\renewcommand*{\chapterpagestyle}{plain}
You can also keep the redefinition local by using a group. This method has the
advantage that you do not need to make any assumptions about the what the
previous page style was in order to restore it after your local change:
\clearpage
\begingroup
\pagestyle{empty}
\renewcommand*{\chapterpagestyle}{empty}
\tableofcontents
\clearpage
\endgroup
Note, however, that you never should put a numbered sectioning command into a
group. Otherwise you may get unpredictable results with commands like \label.
On page 383 in section 15.2, you will discover the \AfterTOCHead command, which
makes a solution even easier:
\AfterTOCHead[toc]{%
\thispagestyle{empty}%
\pagestyle{empty}%
}
This takes advantage of the fact that if there are several \thispagestyle commands
on the same page, the last one always wins.
You might think that you can put running heads on the first page of a chapter simply by using
the
\renewcommand*{\chapterpagestyle}{headings}
command. Before you try this, you should read the remarks on \rightfirstmark starting on
page page 449 in chapter 18, part II .

\pagenumbering{numbering style }
This command works the same way in KOMA - Script as in the standard classes. Strictly
speaking, it is a feature of neither the standard classes nor the KOMA - Script classes but of
the LATEX kernel. This command is used to change the numbering style of page numbers.
The changes take effect immediately, i. e., starting from the page that contains the com-
mand. If necessary, you should first close the current page with \clearpage or better
\cleardoubleoddpage. You can find the available settings for numbering style in table 3.10.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 86

Table 3.10.: Available numbering


numbering style example description styles of page numbers

arabic 8 Arabic numbers


roman viii lower-case Roman numbers
Roman VIII upper-case Roman numbers
alph h letters
Alph H capital letters

Calling \pagenumbering always resets the page number. The current page becomes number
1 in the selected numbering style . In order that two-sided documents produce the correct
results on an even page, so that the left-hand page is not missing, you should always add
\cleardoubleoddpage before \pagenumbering. The next section provides more information
about potentially inserted blank pages.
Let me say a word about a common mistake found in various templates circulating on the
Internet. If you encounter lines like the following — without the initial comment naturally — this
is an unmistakable sign that the creator did not read or understand the remark above:
% Attention! This example contains errors!
% Please note the explanation in the text!
\tableofcontents
\pagenumbering{arabic}
\setcounter{page}{1}
Since \tableofcontents outputs the table of contents but does not automatically issue a page
break at the end, the page numbering is already changed on the last page of the table of contents.
Because it lacks a \cleardoubleoddpage command before \pagenumbering, it receives a pagi-
nation of the Arabic number 1. Additionally, the final line which sets the page numbering to 1 is
superfluous, since this is already done by \pagenumbering.
Sometimes — without the initial comment, naturally — you find:
% Attention! This example contains errors!
% Please note the explanation in the text!
\tableofcontents
\pagebreak
\pagenumbering{arabic}
\setcounter{page}{1}
Here the creator tried to solve the problem with the final page of the table of contents with the
help of \pagebreak.
Unfortunately, this solution is not much better. Here there is a page break after the last page
of the table of contents. This may cause entries on the last page of a two-sided document to have
excess vertical spacing (see \flushbottom, page 58). \pagebreak is clearly the wrong command
here.
Furthermore, \newpage or \clearpage would not be sufficient for a two-sided document. For
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 87

example, if the last page of the table of contents had the Roman numeral vii, the Arabic numbered
right-side page 1 would immediately follow the Roman numeral right-side page. A left-side page
between the two would be missing, which could cause serious problems with later printing.
My advice: Avoid using templates that contain errors with respect to such simple things. Inci-
dentally, the correct way would be:
\tableofcontents
\cleardoubleoddpage
\pagenumbering{arabic}
scrartcl This also applies if scrartcl uses a class that usually does not start a new page after the table of
contents. If you switch the page numbering, a new right-hand page must be started. If you do
not want such a change, you should keep the numbering style of pages consistent throughout the
document without changing it in between.
scrbook It is easier to change the numbering style when using scrbook. There you have the support of
two commands, \frontmatter and \mainmatter, for the most commonly used switching. For
more information, please see section 3.15, page 94.

3.13. Interleaf Pages

Interleaf pages are pages that are inserted between parts of a document. Traditionally, these
pages are completely blank. LATEX, however, sets them by default with the current page style.
KOMA-Script provides several extensions to this functionality.
Interleaf pages are mostly found in books. Because book chapters commonly start on the
right (recto) page of a two-page spread, an empty left (verso) page must be inserted if the
previous chapter ends on a recto page. For this reason, interleaf pages really only exist for
two-sided printing.

cleardoublepage=page style
cleardoublepage=current
v3.00 With this option, you can define the page style of the interleaf pages created by the commands
\cleardoublepage, \cleardoubleoddpage, or \cleardoubleevenpage to advance to the de-
sired page. You can use any previously defined page style (see section 3.12 from page 80 and
chapter 5 from page 254). In addition, cleardoublepage=current is also possible. This case
corresponds to the default prior to KOMA - Script 2.98c and creates an interleaf page without
v3.00 changing the page style. Starting with KOMA - Script 3.00, the default follows the recom-
mendation of most typographers and creates interleaf pages with the empty page style unless
you switch compatibility to earlier KOMA - Script versions (see option version, section 3.2,
page 56).

Example: Suppose you want interleaf pages that are empty except for the pagination, so they
are created with plain. You can achieve this, for example, with:
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 88

\KOMAoptions{cleardoublepage=plain}
You can find more information about the plain page style in section 3.12, page 82.

\clearpage
\cleardoublepage
\cleardoublepageusingstyle{page style }
\cleardoubleemptypage
\cleardoubleplainpage
\cleardoublestandardpage
\cleardoubleoddpage
\cleardoubleoddpageusingstyle{page style }
\cleardoubleoddemptypage
\cleardoubleoddplainpage
\cleardoubleoddstandardpage
\cleardoubleevenpage
\cleardoubleevenpageusingstyle{page style }
\cleardoubleevenemptypage
\cleardoubleevenplainpage
\cleardoubleevenstandardpage
The LATEX kernel provides the \clearpage command, which ensures that all pending floats
are output and then starts a new page. There is also the \cleardoublepage command, which
works like \clearpage but which starts a new right-hand page in two-sided printing (see the
twoside layout option in section 2.4, page 41). An empty left-hand page in the current page
style is output if necessary.
v3.00 With \cleardoubleoddstandardpage, KOMA - Script works as exactly in the way just de-
scribed for the standard classess. The \cleardoubleoddplainpage command, on the other
hand, additionally changes the page style of the empty left page to plain in order to suppress
the running title. Likewise, the \cleardoubleoddemptypage command uses the empty page
style to suppress both running title and page number on the empty left-hand side. The page
is thus completely empty. If you want to specify your own page style for the interleaf page,
this should be given as an argument of \cleardoubleoddusingpagestyle. You can use any
previously defined page style (see chapter 5).
Sometimes you want chapters to start not on the right-hand but on the left-hand page.
Although this layout contradicts classic typography, it can be appropriate if the double-
page spread at the beginning of the chapter very specific contents. For this reason,
KOMA-Script provides the \cleardoubleevenstandardpage command, which is equivalent
to the \cleardoubleoddstandardpage command except that the next page is a left page.
The same applies to the \cleardoubleevenplainpage, \cleardoubleevenemptypage, and
\cleardoubleevenpageusingstyle commands, the last of which expects an argument.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 89

The \cleardoublestandardpage, \cleardoubleemptypage, and \cleardoubleplainpage


commands, and the single-argument \cleardoublepageusingstyle command, as well as the
standard \cleardoublepage command, depend on the open option explained in section 3.16,
page 95 and, depending on that setting, correspond to one of the commands explained in the
preceding paragraphs.

Example: Suppose you want to insert a double-page spread into your document with a picture
on the left-hand page and a new chapter starting on the right-hand page. If the
previous chapter ends with a left-hand page, an interleaf page has to be added,
which should be completely empty. The picture should be the same size as the text
area without any header or footer.
At the relevant place in your document, write:
\cleardoubleevenemptypage
\thispagestyle{empty}
\includegraphics[width=\textwidth,%
height=\textheight,%
keepaspectratio]%
{picture}
\chapter{Chapter Heading}
The first of these lines switches to the next left-hand page. If needed it also adds
a completely blank right-hand page. The second line makes sure that the following
left-hand page will also be set using the empty page style. The third through sixth
lines load an image file named picture and scale it to the desired size without
distorting it. This command requires the graphicx package (see [Car17]). The last
line starts a new chapter on the next page, which will be a right-hand one.

In two-sided printing, \cleardoubleoddpage always moves to the next left-hand page and
\cleardoubleevenpage to the next right-hand page. The style of the interleaf page to be
inserted if necessary is defined with the cleardoublepage option.

3.14. Footnotes

Unlike the standard classes, KOMA - Script offers the ability to configure the format of the
footnote block.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 90

Table 3.11.: Available values for the footnotes option to configure footnotes

multiple
Consecutive footnote marks will be separated by \multfootsep.
nomultiple
Consecutive footnote marks will be handled like single footnotes and not separated
from each other.

footnotes=setting
\multfootsep
v3.00 Footnotes are marked by default in the text with a small superscript number. If several
footnotes appear in succession at the same point, it gives the impression that there is one
footnote with a large number rather than multiple footnotes (e. g. footnote 12 instead of
footnotes 1 and 2). With footnotes=multiple, footnotes that follow each other directly are
separated with a delimiter instead. The default delimiter in \multfootsep is defined as a
comma without a space:
\newcommand*{\multfootsep}{,}
This can be redefined.
The whole mechanism is compatible with the footmisc package, version 5.3d to 5.5b (see
[Fai11]). It affects footnote markers placed using \footnote, as well as those placed directly
with \footnotemark.
You can switch back to the default footnotes=nomultiple at any time using the
\KOMAoptions or \KOMAoption command. However, if you encounter any problems using
another package that alters the footnotes, you should not use this option, nor should you
change the setting anywhere inside the document.
A summary of the available setting values of footnotes can be found in table 3.11.

\footnote[number ]{text }
\footnotemark[number ]
\footnotetext[number ]{text }
\multiplefootnoteseparator
Footnotes in KOMA - Script are produced, as they are in the standard classes, with
the \footnote command, or alternatively the pair of commands \footnotemark and
\footnotetext. As in the standard classes, it is possible for a page break to occur within a
footnote. Normally this happens if the footnote mark is placed so near the bottom of a page
v3.00 as to leave LATEX no choice but to move the footnote to the next page. Unlike the standard
classes, KOMA - Script can recognize and separate consecutive footnotes automatically. See
the previously documented option footnotes.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 91

If instead you want to place this delimiter manually, you can do so by calling
\multiplefootnoteseparator. However, users should not redefine this command, as it
contains not only the delimiter but also the delimiter’s formatting, for example the font
size selection and the superscript. The delimiter itself is stored in the previously described
\multfootsep command.

Example: Suppose you want to put two footnotes after a single word. First you try
Word\footnote{1st footnote}\footnote{2nd footnote}
Let’s assume that the footnotes are numbered 1 and 2. Since the two footnote
numbers follow each other directly, it creates the impression that the word has only
one footnote numbered 12. You can change this behaviour by using
\KOMAoptions{footnotes=multiple}
to enable the automatic recognition of footnote sequences. Alternatively, you can
use
word\footnote{Footnote 1}%
\multiplefootnoteseparator
\footnote{Footnote 2}
This should give you the desired result even if automatic detection fails or cannot
be used for some reason.
Now suppose you also want the footnote numbers to be separated not just by a
comma, but by a comma and a space. In this case, write
\renewcommand*{\multfootsep}{,\nobreakspace}
in the preamble of your document. \nobreakspace was used here instead of a
normal space to avoid paragraph or page breaks within the sequence of footnotes.

\footref{reference }
v3.00 Sometimes you have a footnote in a document to which there are several references in the
text. An inconvenient way to typeset this would be to use \footnotemark to set the number
directly. The disadvantage of this method is that you need to know the number and manually
set every \footnotemark command. And if the number changes because you add or remove
an earlier footnote, you will have to change each \footnotemark. KOMA - Script thefore offers
the \label mechanism to handle such cases. After placing a \label inside the footnote, you
can use \footref to set all the other marks for this footnote in the text.

Example: You are writing a text in which you must create a footnote each time a brand name
occurs, indicating that it is a registered trademark. You can write, for example,
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 92

-  mark width
first paragraph of a footnote
-  indent
-  parindent
Figure 3.1.: Parameters that con- next paragraph of a footnote
trol the footnote layout

Company SplishSplash\footnote{This is a registered trade name.


All rights are reserved.\label{refnote}}
produces not only SplishPlump\footref{refnote}
but also SplishPlash\footref{refnote}.
This will produce the same footnote mark three times, but only one footnote text.
The first footnote mark is produced by \footnote itself, and the following two
footnote marks are produced by the additional \footref commands. The footnote
text will be produced by \footnote.

When setting footnote marks with the \label mechanism, any changes to the footnote num-
bers will require at least two LATEX runs to ensure correct numbers for all \footref marks.
Note that statements like \ref or \pageref are fragile and therefore you should put
\protect in front of them if they appear in moving arguments such as headings. By the
v3.33 way, from LATEX 2021-05-01 on, the command is provided by LATEX itself.

\deffootnote[mark width ]{indent }{parindent }{definition }


\deffootnotemark{definition }
\thefootnotemark
The KOMA-Script classes set footnotes slightly differently than the standard classes do. As
in the standard classes, the footnote mark in the text is rendered with small, superscript
numbers. The same formatting is used in the footnote itself. The mark in the footnote is
typeset right-justified in a box with a width of mark width . The first line of the footnote
follows directly.
All subsequent lines will be indented by the length of indent . If the optional parameter
mark width is not specified, it defaults to indent . If the footnote consists of more than one
paragraph, the first line of each paragraph is indented by the value of parindent .
figure 3.1 shows the different parameters again. The default configuration of the KOMA -
Script classes is as follows:
\deffootnote[1em]{1.5em}{1em}{%
\textsuperscript{\thefootnotemark}%
}
\textsuperscript controls both the superscript and the smaller font size. The command
\thefootnotemark contains the current footnote mark without any formatting.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 93

v2.8q The footnote, including the footnote mark, uses the font specified in the footnote ele-
ment. You can change the font of the footnote mark separately using the \setkomafont
and \addtokomafont commands (see section 3.6, page 59) for the footnotelabel element.
See also table 3.2, page 60. The default setting is no change to the font. Please don’t mis-
use this element for other purposes, for example to set the footnotes ragged right (see also
\raggedfootnote, page 94).
The footnote mark in the text is defined separately from the mark in front of the actual
footnote. This is done with \deffootnotemark. The default setting is:
\deffootnotemark{%
\textsuperscript{\thefootnotemark}}
v2.8q With this default, the font for the footnotereference element is used (see table 3.2, page 60).
Thus, the footnote marks in the text and in the footnote itself are identical. You can change
the font with the commands \setkomafont and \addtokomafont (see section 3.6, page 59).

Example: One feature that is often requested is footnote marks which are neither in su-
perscript nor in a smaller font. They should not touch the footnote text but be
separated by a small space. You can accomplish this as follows:
\deffootnote{1em}{1em}{\thefootnotemark\ }
This will set the footnote mark and subsequent space right-aligned in a box of width
1 em. The lines of the footnote text that follow are also indented by 1 em from the
left margin.
Another layout that is often requested is footnote marks that are left-aligned. You
can obtain them with the following definition:
\deffootnote{1.5em}{1em}{%
\makebox[1.5em][l]{\thefootnotemark}}
If, however you want to change the font for all footnotes, for example to sans serif,
this can easily be done with the commands \setkomafont and \addtokomafont
(see section 3.6, page 59):
\setkomafont{footnote}{\sffamily}

As the examples show, KOMA - Script allows a wide variety of different footnote formats with
this simple user interface.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 94

\setfootnoterule[thickness ]{length }
v3.06 Generally, a horizontal rule is set between the text area and the footnote area, but normally
this rule does not extend the full width of the type area. With \setfootnoterule, you can set
the exact thickness and length of the rule. In this case, the parameters thickness and length
are only evaluated when setting the rule itself. If the optional argument thickness has been
omitted, the thickness of the rule will not be changed. Empty arguments for thickness or
length are also allowed and do not change the corresponding parameters. Using absurd values
will result in warning messages both when setting and when using the parameters.
v3.07 You can change the colour of the rule with the footnoterule element using the
\setkomafont and \addtokomafont commands (see section 3.6, page 59). The default is
no change of font or colour. In order to change the colour, you must also load a colour
package like xcolor.

\raggedfootnote
v3.23 By default KOMA - Script justifies footnotes just as in the standard classes. But you
can also change the justification separately from the rest of the document by redefining
\raggedfootnote. Valid definitions are \raggedright, \raggedleft, \centering, \relax or
an empty definition, which is the default. The alignment commands of the ragged2e package
are also valid (see [Sch09]).
Example: Suppose you are using footnotes only to provide references to very long links, where
line breaks would produce poor results if justified. You can use
\let\raggedfootnote\raggedright
in your document’s preamble to switch to ragged-right footnotes.

scrbook 3.15. Book Structure

Sometimes books are loosely divided into front matter, main matter, and back matter. KOMA -
Script also provides this capability for scrbook.

\frontmatter
\mainmatter
\backmatter
The front matter includes all the material which appears before the main text begins, including
title pages, preface, and table of contents. It is initiated with \frontmatter. In the front
matter, Roman numerals are used for the page numbers, and chapter headings in the header are
not numbered. However, section headings are numbered consecutively, starting from chapter
0. This typically does not matter, as the front matter is used only for the title pages, table
of contents, lists of figures and tables, and a preface or foreword. The preface can thus be
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 95

created as a normal chapter. A preface should be as short as possible and never divided into
sections. The preface thus does not require a deeper level of structure than the chapter.
If you see things differently and want to use numbered sections in the chapters of the front
v2.97e matter, as of version 2.97e, the section numbering no longer contains the chapter number.
This change only takes effect when the compatibility option is set to at least version 2.97e
(see option version, section 3.2, page 56). It is explicitly noted that this creates confusion
with chapter numbers! The use of \addsec and \section* (see section 3.16, page 105 and
page 106) are thus, in the author’s opinion, greatly preferable.
v2.97e As of version 2.97e the numbering of floating environments, such as tables and figures, and
equation numbers in the front matter also contains no chapter-number part. To take effect,
this too requires the corresponding compatibility setting (see the version option, section 3.2,
page 56).
The part of the book with the main text is introduced with \mainmatter. If there is no
front matter, you can omit this command. The default page numbering in the main matter
uses Arabic numerals and (re)starts the page count at 1 at the start of the main matter.
The back matter is introduced with \backmatter. Opinions differ as to what belongs in
the back matter. So in some cases you will find only the bibliography, in some cases only
the index, and in other cases both of these as well as the appendices. The chapters in the
back matter are similar to the chapters in the front matter, but page numbering is not reset.
If you do require separate page numbering, you can use the \pagenumbering command in
section 3.12, page 85.

3.16. Document Structure

The structure refers to dividing a document into parts, chapters, sections, and additional levels
of structure.

open=method
scrbook, The KOMA-Script classes scrbook and scrreprt give you the choice of where to start a new
scrreprt chapter with two-sided printing. By default scrreprt starts a new chapter on the next page.
This is equivalent to method any. However, scrbook starts new chapters at the next right-
hand page. This is equivalent to method right and is usually used in books. But some-
times chapters should start on the left-hand page of a two-page spread. You can accomplish
v3.00 this with the method left. You can find a summary of the available values in table 3.12.
The table also describes the effects of \cleardoublepage, \cleardoublepageusingstyle,
\cleardoublestandardpage, \cleardoubleplainpage, and \cleardoubleemptypage (see
section 3.13, page 88).
Since LATEX does not differentiate between left-hand and right-hand pages in one-sided
printing, the option has no effect in that case.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 96

Table 3.12.: Available values for the open option to select page breaks with interleaf pages using scrbook
or scrreprt

any
Parts, chapter, index, and back matter use \clearpage, not
\cleardoublepage; \cleardoublepageusingstyle, \cleardoublestandardpage,
\cleardoubleplainpage, \cleardoubleemptypage, and \cleardoublepage
behave the same as using open=right.
left
Part, chapter, index, and back matter use \cleardoublepage; the
commands \cleardoublepageusingstyle, \cleardoublestandardpage,
\cleardoubleplainpage, \cleardoubleemptypage, and \cleardoublepage
result in a page break and add an interleaf page if needed to reach the next left-hand
page.
right
Part, chapter, index, and back matter use \cleardoublepage; the
commands \cleardoublepageusingstyle, \cleardoublestandardpage,
\cleardoubleplainpage, \cleardoubleemptypage, and \cleardoublepage
result in a page break and add an interleaf page if needed to reach the next
right-hand page.

In the scrartcl class, the section is the first structural element below the part. For this
reason, scrartcl does not support this option.

chapterprefix=simple switch
appendixprefix=simple switch
\IfChapterUsesPrefixLine{then code }{else code }
scrbook, With the standard classes book and report, a chapter heading consists of a line with the
scrreprt word “Chapter”1 followed by the chapter number. The heading itself is set left-justified on
the following line. The same effect is obtained in KOMA - Script with the chapterprefix
option. You can use any value from table 2.5, page 42 as the simple switch . The default,
however, is chapterprefix=false, the opposite behaviour of that of the standard classes,
which corresponds to chapterprefix=true. These options also affect the automatic running
heads in the headers (see section 3.12, page 81).
Sometimes you may want to use the simplified chapter headings produced by
chapterprefix=false but at the same time to have the heading of an appendix preceded
by a line with “Appendix” followed by the appendix letter. This is achieved by using the
appendixprefix option (see table 2.5, page 42). Since this results in an inconsistent document
1
When using another language the word “Chapter” is of course translated to the appropriate language.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 97

layout, I advise against using this option. Ultimately, this option changes the chapterprefix
option automatically at the beginning of the \appendix.
v3.18 You can execute code depending on the current setting for the chapter preceding line us-
ing \IfChapterUsesPrefixLine. If chapterprefix is currently active, the then code is
executed; otherwise, the else code is executed.
You can change the font style of the chapter number line that uses chapterprefix=true
v2.96a or appendixprefix=true by using the chapterprefix element with the \setkomafont and
\addtokomafont commands (see section 3.6, page 59). The default is to use the chapter
element (see page 101, as well as table 3.15, page 104).
You can find additional settings for chapter headings in the explanation for
\RedeclareSectionCommand and the commands \chapterlineswithprefixformat and
\chapterlinesformat in section 21.8, part II.

headings=setting
Headings of sectioning levels normally use a relatively large font size in both the standard
classes and KOMA - Script. This choice does not appeal to everyone and is especially prob-
lematic for small paper sizes. Consequently, KOMA - Script provides, in addition to the large
v3.00 headings defined by the headings=big option, the options headings=normal and headings=
small, which allow for smaller headings. The font sizes resulting from these options for scrbook
and scrreprt are shown in table 3.15, page 104. Specifically, all three settings reset the elements
chapter, section, subsection, subsubsection, paragraph, and subparagraph to the cor-
scrbook, responding defaults. scrartcl generally uses slightly smaller headings. The spacing before and
scrreprt after chapter headings is also reset by these options.
scrbook, Chapter headings also have the two options headings=twolinechapter and headings=
scrreprt onelinechapter, which correspond to chapterprefix=true and chapterprefix=false ex-
plained above. For the appendix, appendixprefix=true and appendixprefix=false serve
as alternatives for the headings=twolineappendix and headings=onelineappendix options.
Of course, these options do not exist with scrartcl.
v3.12 The headings=standardclasses option adjusts the font sizes of the headings to those of
the standard classes. In addition, the font for the disposition element is set to \bfseries.
scrbook, It therefore no longer uses a sans-serif font for the headings. If you use scrbook or scrreprt,
scrreprt headings=twolinechapter is also set and the spacing between the chapter headings is ad-
justed to that of the standard classes.
scrbook, You can set the method to specify the page on which new chapters begin with headings=
scrreprt openany, headings=openright, and headings=openleft, or alternatively with the open op-
tion, which takes the values any, right, and left (see above).
v3.10 Another special feature of KOMA - Script is the handling of the optional argument of the
sectioning commands \part, \chapter, etc. down to \subparagraph. You can change its
function and meaning with the options headings=optiontohead, headings=optiontotoc and
headings=optiontoheadandtoc.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 98

See table 3.13 for a summary of all available settings for the headings option. The expla-
nations of the sectioning commands below contain examples using some of these settings.

Table 3.13.: Available values for the headings option to format section headings

big
Use large fonts in the headings for each of the default sectioning levels with wide
spacing above and below the titles.
normal
Use medium-sized fonts in the headings with medium spacing above and below the
titles.
onelineappendix, noappendixprefix, appendixwithoutprefix,
appendixwithoutprefixline
Chapter headings in the appendix are set like other headings.
onelinechapter, nochapterprefix, chapterwithoutprefix,
chapterwithoutprefixline
Chapter titles are set like other headings.
openany
The commands \cleardoublepageusingstyle, \cleardoublestandardpage,
\cleardoubleplainpage, \cleardoubleemptypage, and \cleardoublepage gener-
ate a page break and insert an interleaf page if needed to reach the next right-hand
page in two-sided printing, the same as in headings=openright. Parts, chapter,
the index, and back matter use \clearpage instead of \cleardoublepage.
openleft
The commands \cleardoublepageusingstyle, \cleardoublestandardpage,
\cleardoubleplainpage, \cleardoubleemptypage, and \cleardoublepage
generate a page break and insert an interleaf page if needed to reach the next
left-hand page in two-sided printing. Part, chapter, index and back matter use
\cleardoublepage.
openright
The commands \cleardoublepageusingstyle, \cleardoublestandardpage,
\cleardoubleplainpage, \cleardoubleemptypage, and \cleardoublepage
generate a page break and insert an interleaf page if needed to reach the next
right-hand page in two-sided printing. Part, chapter, index and back matter use
\cleardoublepage.
...
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 99

Table 3.13.: Available values for the headings option (continued)

optiontohead
v3.10 The advanced functionality of the optional argument of the sectioning commands
\part down to \subparagraph is activated. By default, the optional argument is
used only for the running head.
optiontoheadandtoc, optiontotocandhead
v3.10 The advanced functionality of the optional argument of the sectioning commands
\part down to \subparagraph is activated. By default, the optional argument is
used for the running head and the table of contents.
optiontotoc
v3.10 The advanced functionality of the optional argument of the sectioning commands
\part down to \subparagraph is activated. By default, the optional argument is
used only for the table of contents.
small
Use small fonts in the headings with small spacing above and below the titles.
standardclasses
v3.12 Reset the font settings for each of the standard sectioning levels and use headings
with the sizes of the standard classes. For chapter headings, scrbook und scrreprt set
headings=twolinechapter.
twolineappendix, appendixprefix, appendixwithprefix, appendixwithprefixline
Chapter titles in the appendix are set with a number line whose format is determined
by \chapterformat.
twolinechapter, chapterprefix, chapterwithprefix, chapterwithprefixline
Chapter titles are set with a number line whose format is determined by
\chapterformat.

numbers=setting
According to DUDEN, if only Arabic numerals are used to number section headings, the
German practice is to have no point at the end (see [DUD96, R 3]). On the other hand, if
Roman numerals or letters appear in the numbering, then a point should appear at the end
of the numbering (see [DUD96, R 4]). KOMA - Script has a mechanism that tries to automate
this somewhat complex rule. The result is that normally after the sectioning commands \part
and \appendix the numbering switches to using a final point. This information is saved in
the aux file and takes effect on the next LATEX run.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 100

Table 3.14.: Available values of the numbers option to configure the final points of the numbers for
section headings

autoendperiod, autoenddot, auto


KOMA - Script decides whether to set the point at the end of sectioning command
numbers. If there are only Arabic numerals, the point will be omitted. If a letter or
Roman numeral is found, the point is set. However, references to these numbers are
set without a final point.
endperiod, withendperiod, periodatend, enddot, withenddot, dotatend
All numbers of sectioning commands and their subordinate numbers are set with a
final point. Only references will be set without the final point.
noendperiod, noperiodatend, noenddot, nodotatend
All numbers of sectioning commands are set without a final point.

Sometimes the mechanism for placing or omitting the final point may fail. Sometimes other
languages have different rules. Therefore you can force the use of the final point with the
option numbers=endperiod or to prohibit it with numbers=noendperiod.
Note that this mechanism only takes effect on the next LATEX run. Therefore, before you
try to use these options to force the correct numbering format, you should always perform
another LATEX run without modifying the document.
You can find a summary of the available values for the setting of numbers in table 3.14.
Unlike most other settings, this option can only be set in the document preamble, i. e. before
\begin{document}.

chapteratlists
chapteratlists=value
scrbook, As mentioned in section 3.20, page 142, every chapter that is created with \chapter normally
scrreprt inserts a vertical space in the lists of floating environments (e. g., tables and figures). Since
v2.96a version 2.96a, this also applies to the \addchap command unless you choose a compatibility
setting for an earlier version (see the version option in section 3.2, page 56).
In addition, you can use the chapteratlists option to change the vertical spacing by
specifying the desired distance as the value . The default with listof=chaptergapsmall is
10 pt (see theversion option in section 3.2, page 56).
If you use chapteratlists=entry or chapteratlists without specifying a value, instead
of a vertical space, the chapter entry itself will be entered into the lists. Note that such an
entry occurs even if the chapter does not contain a floating environment. A method where
only chapters with floating environments are displayed in the respective list can be found in
the German-language KOMA - Script forum at [Koh15].
Please note that changes to this option only takes effect after two additional LATEX runs.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 101

\part[short version ]{heading }


\chapter[short version ]{heading }
\section[short version ]{heading }
\subsection[short version ]{heading }
\subsubsection[short version ]{heading }
\paragraph[short version ]{heading }
\subparagraph[short version ]{heading }
The standard sectioning commands in KOMA - Script work the same way as those in the
standard classes. Thus, you can specify an alternative text for the table of contents and
running heads as an optional argument to the sectioning commands.
v3.10 However, with the headings=optiontohead option, KOMA - Script only uses the optional
argument short version in the running head, not the table of contents. Of course, this
text will only appear if you use a page style that puts the corresponding sectioning level in
the running head. See section 3.12 and chapter 5. With the headings=optiontotoc option,
KOMA-Script uses the optional argument short version exclusively for the table of contents
and not the running head. However, the entry will be shown only if the tocdepth counter
is great enough (see section 3.9, page 77). With the headings=optiontoheadandtoc option,
KOMA-Script uses the optional argument short version in both the table of contents and
the running head. These three options all activate the extended interpretation of the optional
argument short version , which is not active by default.
v3.10 The extended interpretation of the optional argument checks to see if there is an equals
sign in short version . If so, the optional argument will be interpreted as an option list .
Three options — head=running head , tocentry=table of contents entry , reference=
v3.22
v3.27 reference title , and nonumber=simple switch — are supported with this format. To use
commas or equals signs within the values of those options, you must enclose them in braces.
Please note that this mechanism only works as long as KOMA - Script controls the sectioning
commands. If you use package that redefines the KOMA - Script’s or the internal LATEX kernel’s
sectioning commands, KOMA - Script can no longer provide this extended mechanism. This
also applies to a KOMA - Script extension that is always active: sectioning commands with no
heading text do not create entries in the table of contents. If you really want an entry with
empty heading text, you can use an invisible entry like \mbox{}.

Example: Suppose you have a document with very long chapter headings. These headings
should appear in the table of contents, but you want to limit the running head to
short, single-line headings. You can do this with the optional argument of \chapter.
\chapter[short version of chapter heading]
{The Sectioning Command for Chapters
Supports not only the Heading Text
Itself but also a Short Version Whose
Use can be Controlled}
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 102

A little later you realize that the line breaks for this long heading are very inap-
propriate. You therefore want to choose the breaks yourself. Nevertheless, you still
want automatic line breaking in the table of contents. With
\chapter[head={short version of chapter heading},
tocentry={The Sectioning
Command for Chapters Supports not
only the Heading Text Itself but
also a Short Version Whose Use
can be Controlled}]
{The Sectioning\\
Command for Chapters\\
Supports not only\\
the Heading Text Itself\\
but also\\
a Short Version Whose\\
Use can be Controlled}
you create separate entries for the table of contents, running head, and chapter
heading itself. The arguments of the options head and tocentry have been enclosed
in braces so their contents can be arbitrary.
The need for braces in the example above is best illustrated by another example.
Suppose you chose the headings=optiontotoc option and set the title this way:
\section[head=\emph{value}]
{Option head=\emph{value}}
This results in the entry “Option head=value” in the table of contents but “value”
in the running head. But surely you wanted the entry “head=value” in the table
of contents and the complete heading text in the running head. You can do this
using braces:
\section[head{=}\emph{value}]
{Option head=\emph{value}}
A similar case concerns the comma. Using the same headings option as before
\section[head=0, 1, 2, 3, \dots]
{Natural Numbers Including the Zero}
results in an error because the comma is interpreted as the separator between the
individual options of the option list “0, 1, 2, 3, \dots”. But writing
\section[head={0, 1, 2, 3, \dots}]
{Natural Numbers Including the Zero}
makes “0, 1, 2, 3, \dots” the argument of the head option.
v3.22 Like setting the title of a running head with the head option, or setting the title of a
table-of-contents entry with the tocentry option, you can set the title of a reference with
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 103

the nameref or titleref packages, or with the titleref module of the zref package, using the
reference option. Note that the support for the titleref package is rather rudimentary, since
that package’s performance is poor compared to the other two, and it is not fully compatible
with hyperref.
v3.27 You can deactivate the numbering using nonumber=true in the extended optional argument.
In contrast to the starred versions of the sectioning commands explained below, the titles will
still be added to the table of contents and, if applicable, used for the running head. For \part,
\chapter, and \section, using nonumber=true this essentially corresponds to the \addpart,
\addchap, and \addsec commands, which are explained on page 106.
The part-level title (\part) differs from other sectioning levels by being numbered inde-
pendently. This means that the chapter level (in scrbook or scrreprt), or the section level
scrbook, (in scrartcl) is numbered consecutively over all parts. Furthermore, for the scrbook and
scrreprt scrreprt classes, the title of the part level together with the corresponding preamble (see
\setpartpreamble, page 114) is set on a separate page.
scrbook, The \chapter command only exists in the book and report classes, that is, in book,
scrreprt scrbook, report and scrreport, but not in the article classes article and scrartcl. Furthermore,
the \chapter command in KOMA - Script differs substantially from the version in the stan-
dard classes. In the standard classes, the chapter number is used together with the prefix
“Chapter”, or the corresponding word in the appropriate language, on a separate line above
the actual chapter title text. KOMA - Script replaces this overpowering style with a simple
chapter number before the chapter title, but you can restore the original behaviour with the
chapterprefix option (see page 96).
scrbook, Please note that \part and \chapter in the scrbook and scrreprt classes change the page style
scrreprt for one page. The page style applied in KOMA - Script is defined in the macros \partpagestyle
and \chapterpagestyle (see section 3.12, page 84).
v2.8p You can change the font style for all headings with the \setkomafont and \addtokomafont
commands (see section 3.6, page 59). In doing so, the element disposition is applied first,
followed by the specific element for each sectioning level (see table 3.2, page 60). There is
a separate elements, partnumber, for the number of the part heading, and chapterprefix,
for the optional prefix line of chapter headings. The initial definition for the disposition
element is \normalcolor\sffamily\bfseries. The default font sizes for the specific elements
depends on the options headings=big, headings=normal, and headings=small (see page 97).
They are listed in table 3.15.

Example: Suppose you use the headings=big class option and notice that the very large
headings of the document parts are too bold. You could change this as follows:
\setkomafont{disposition}{\normalcolor\sffamily}
\part{Appendices}
\addtokomafont{disposition}{\bfseries}
Using the command above you only switch off the font attribute bold for a heading
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 104

Table 3.15.: Default font


sizes for different levels Class Option Element Default
of document sectioning in
scrbook and scrreprt headings=big part \Huge
partnumber \huge
chapter \huge
chapterprefix \usekomafont{chapter}
section \Large
subsection \large
subsubsection \normalsize
paragraph \normalsize
subparagraph \normalsize
headings=normal part \huge
partnumber \huge
chapter \LARGE
chapterprefix \usekomafont{chapter}
section \Large
subsection \large
subsubsection \normalsize
paragraph \normalsize
subparagraph \normalsize
headings=small part \LARGE
partnumber \LARGE
chapter \Large
chapterprefix \usekomafont{chapter}
section \large
subsection \normalsize
subsubsection \normalsize
paragraph \normalsize
subparagraph \normalsize

“Appendices”. A much more convenient and elegant solution is to change all \part
headings at once. This is done either by:
\addtokomafont{part}{\normalfont\sffamily}
\addtokomafont{partnumber}{\normalfont\sffamily}
or simply:
\addtokomafont{part}{\mdseries}
\addtokomafont{partnumber}{\mdseries}
The second version is preferred because it gives you the correct result even if you
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 105

change the disposition element, for instance:


\setkomafont{disposition}{\normalcolor\bfseries}
With this change, it is possible to set all section levels at once to no longer use sans
serif fonts.

I strongly advise against using the ability to switch fonts in order to mix fonts, font sizes,
and font attributes wildly. Picking the right font for the job is a matter for experts and has
almost nothing to do with the personal tastes of non-experts. See the citation at the end of
section 2.8, page 53 and to the following explanation.
It is possible to use different font types for different sectioning levels in KOMA - Script. Non-
experts in typography should absolutely avoid doing so for excellent typographical reasons.
A rule of typography states that you should mix as few fonts as possible. Using sans serif for
headings already seems to violate this rule. However, you should realize that large, bold, serif
letters are much too heavy for headings. Strictly speaking, you should then use a normal instead
of a bold or semi-bold font. However, in deeper levels of the sectioning, a normal font may then
appear too light. On the other hand, sans serif fonts have a very pleasant appearance in headings,
and almost solely in headings. There is, therefore, good reason why sans serif is the default in
KOMA-Script.
Greater variety should, however, be avoided. Font mixing is something for professionals. For
this reason, if you want to use fonts other than the standard TEX fonts — regardless of whether
these are CM, EC, or LM fonts — you should consult an expert about the compatibility of the
sans serif and serif fonts, or redefine the element disposition as a precautionary measure. The
author considers the commonly encountered combinations of Times and Helvetica or Palatino with
Helvetica to be awkward.

\part*{heading }
\chapter*{heading }
\section*{heading }
\subsection*{heading }
\subsubsection*{heading }
\paragraph*{heading }
\subparagraph*{heading }
The starred variants of all sectioning commands produce unnumbered headings which do not
appear in the table of contents or in the running head. The absence of a running head often has
an unwanted side effect. If, for example, a chapter set using \chapter* spans several pages,
then the running head of the previous chapter suddenly reappears. KOMA - Script offers a
scrbook, solution for this problem, described below. \chapter* only exists in book and report classes,
scrreprt that is, book, scrbook, report and scrreport, not in the article classes article and scrartcl.
Please note that \part and \chapter change the page style for one page. While the standard
classes use the plain page style, KOMA - Script applies the style defined in the \partpagestyle
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 106

and \chapterpagestyle macros (see section 3.12, page 84).


v2.8p The possibilities for switching fonts described above for the unstarred variants apply without
change. The elements use the same names since they do not indicate variants but structuring
levels.

\addpart[short version ]{heading }


\addpart*{heading }
\addchap[short version ]{heading }
\addchap*{heading }
\addsec[short version ]{heading }
\addsec*{heading }
In addition to the commands of the standard classes, KOMA - Script offers the new com-
mands \addpart, \addsec and \addchap. They are similar to the standard commands \part,
\chapter and \section except that they are unnumbered. They thus produce both a run-
ning head and an entry in the table of contents which take into account the headings option
settings, especially the handling of the optional argument. However, enabling or disabling the
nonumber switch will have no effect.
The starred variants \addchap* and \addsec* are similar to the standard commands
\chapter* and \section* except for a small but important difference: the running heads
are deleted. This eliminates the side effect of obsolete headers mentioned above. Instead,
book, the running heads on subsequent pages remain empty. \addchap and \addchap* only exist,
scrreprt of course, in book and report classes, namely book, scrbook, report and scrreport, not in the
article classes article and scrartcl.
The \addpart command produces an unnumbered document part with an entry in the table
of contents. Since the running heads are already deleted by \part and \part* the previously
mentioned problem with obsolete headers does not exist. The starred version \addpart* is
thus identical to \part* and is only defined for reasons of consistency.
Please note that \addpart and \addchap and their starred variants change the page style
for one page. The particular page style is defined in the macros \partpagestyle and
\chapterpagestyle (see section 3.12, page 84).
v2.8p The possibilities for switching fonts described above for the unstarred variant of the sec-
tioning commands apply without change. The elements have the same names since they do
not designate variants but sectioning levels.

\minisec{heading }
Sometimes you want a heading that is highlighted but also closely linked to the following text.
Such a heading should not be separated by a large vertical skip.
The \minisec command is designed for this situation. This heading is not associated with
any sectioning level. Such a mini-section does not produce an entry in the table of contents,
nor does it receive any numbering.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 107

v2.96a You can change the font of the \minisec command using the disposition and minisec
element (see table 3.2, page 60). The default of the minisec element is empty, so by default
only the disposition element is used.
Example: You have developed a kit for building a mouse trap and want the documentation
separated into a list of necessary items and an assembly description. You could
write the following:
\documentclass{scrartcl}

\begin{document}

\title{DIY Projects}
\author{Two Left Thumbs}
\date{\today}
\maketitle

\section{Mousetrap}

The first project is suitable for beginners and only requires


a few components that should be found in every household.

\minisec{Material Required}

\begin{flushleft}
1 board ($100\times 50 \times 12$)\\
1 swing-top cap of a beer-bottle\\
1 ballpoint pen\\
1 push pin\\
2 screws\\
1 hammer\\
1 knife
\end{flushleft}

\minisec{Assembly}
First, find the mouse hole and put the push pin directly behind
the hole so that the mouse cannot escape during the following
actions.

Next tap the swing-top cap into the mouse hole with the hammer.
If the cap is not big enough to block the hole completely and
permanently, take the board instead and screw it to the front
of the mouse hole using the two screws and the knife. Of
course, you can use a screwdriver instead of a knife. The
ballpoint pen has fallen victim to animal welfare.
\end{document}
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 108

The main part, starting with the heading “Material Required” will look like this:
Material Required
1 board (100 × 50 × 12)
1 swing-top cap of a beer-bottle
1 ballpoint pen
1 push pin
2 screws
1 hammer
1 knife

Assembly
First, find the mouse hole and put the push pin directly behind the hole so
that the mouse cannot escape during the following actions.
Next tap the swing-top cap into the mouse hole with the hammer. If
the cap is not big enough to block the hole completely and permanently,
take the board instead and screw it to the front of the mouse hole using
the two screws and the knife. Of course, you can use a screwdriver instead
of a knife. The ballpoint pen has fallen victim to animal welfare.

\raggedsection
\raggedchapter
\raggedpart
In the standard classes, headings are set as justified text. That means that hyphenated words
can occur and multi-line headings are stretched up to the text width. This approach is rather
uncommon in typography. KOMA - Script therefore sets the headings left aligned with hanging
indentation using \raggedsection with the default:
\newcommand*{\raggedsection}{\raggedright}
You can redefine this command with \renewcommand.
Example: You prefer justified headings, so you write in the preamble of your document:
\renewcommand*{\raggedsection}{}
or more compactly:
\let\raggedsection\relax
You will get heading formatting which is very close to that of the standard classes.
It will become even closer when you combine this change with the change to the
disposition element mentioned above.
v3.15 Because some users want a different alignment for the \chapter level than for the
other sectioning levels, you can change the \chapter justification separately by redefining
\raggedchapter. By default, however, this command simply uses \raggedsection, so chang-
ing \raggedsection indirectly affects \raggedchapter.
By default, part headings (\part) are set horizontally centred rather than ragged right.
This formatting is performed by the \raggedpart statement, which has the default definition
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 109

\let\raggedpart\centering
You can also redefine this command using \renewcommand.
Example: You want the headings for \part to be formatted the same as any other sectioning
command. To do so, put
\renewcommand*{\raggedpart}{\raggedsection}
in the preamble of your document. In this case, and unlike in the example above,
we did not use \let because \let would set \raggedpart to the underlying value of
\raggedsection. Subsequent changes to \raggedsection would then not change
the behaviour of \raggedpart. By redefining with \renewcommand, \raggedpart
will use the current meaning of \raggedsection at the time it is used rather than
when it was redefined.

\partformat
\chapterformat
\sectionformat
\subsectionformat
\subsubsectionformat
\paragraphformat
\subparagraphformat
\othersectionlevelsformat{sectioning name }{}{counter output }
\IfUsePrefixLine{then code }{else code }
\autodot
KOMA-Script adds another logical layer above \thesectioning name to format the section-
ing numbers. The counters for each heading are not merely output. They are formatted using
v3.17 the commands \partformat, \chapterformat, down to \subparagraphformat. Of course
the \chapterformat command, like \thechapter, does not exist in the scrartcl class, but
scrbook, only in the scrbook and scrreprt classes.
scrreprt As already explained for the numbers option at the beginning of this section (see page 99),
KOMA-Script’s handling of points in section numbers implements the rules given in [DUD96],
which are standard in German-language typography, in the \autodot command. In all levels
except for \part, a point is followed by a further \enskip. This corresponds to a horizontal
skip of 0.5 em.
v3.17 Since KOMA - Script 3.17, the command \othersectionlevelsformat is used only in rare
circumstances, i. e., if the corresponding format command to a section command does not
exist or is \relax. This should not happen for any section commands defined by KOMA -
Script itself. Therefore the command is no longer officially documented. Nevertheless, if you
select a compatibility level prior to 3.17 (see option version, section 3.2, page 56), commands
\sectionformat down to \subparagraphformat are ignored by KOMA - Script. Instead, these
layers will continue to use \othersectionlevelsformat.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 110

You can redefine the formatting commands using \renewcommand to fit them to your per-
sonal needs. The following default definitions are used by the KOMA - Script classes:
\newcommand*{\partformat}{\partname~\thepart\autodot}
\newcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}\thechapter
\autodot\IfUsePrefixLine{}{\enskip}}}
\newcommand*{\sectionformat}{\thesection\autodot\enskip}
\newcommand*{\subsectionformat}{%
\thesubsection\autodot\enskip}
\newcommand*{\subsubsectionformat}{%
\thesubsubsection\autodot\enskip}
\newcommand*{\paragraphformat}{\theparagraph\autodot\enskip}
\newcommand*{\subparagraphformat}{%
\thesubparagraph\autodot\enskip}
\newcommand*{\othersectionlevelsformat}[3]{%
#3\autodot\enskip}
v3.17 Because it uses \IfUsePrefixLine, \chapterformat should not be used outside of
\chapter. \IfUsePrefixLine is only valid inside KOMA - Script sectioning commands.
Within those commands, it executes the then code if a prefix line for the number is used and
the else code otherwise.
Please also remember to replace \newcommand with \renewcommand if you want to redefine
one of the commands above.

Example: Suppose you do not want the word “Part” written in front of the part number
when you use \part. You can put the following command in the preamble of your
document:
\renewcommand*{\partformat}{\thepart\autodot}
In fact, you could do without \autodot here and insert a fixed point instead. Since
\part is numbered with Roman numerals, it must be followed by a point according
to [DUD96]. However, by using \autodot you retain the ability to use the numbers
option numbers=endperiod and thus deviate from the rule. You can find more
details concerning class options on page 99.
Another possibility is to place the section numbers in the left margin in such a way
that the heading text is left aligned with the surrounding text. You can accomplish
this with:
\renewcommand*{\sectionformat}{%
\makebox[0pt][r]{\thesection\autodot\enskip}}
\renewcommand*{\subsectionformat}{%
\makebox[0pt][r]{\thesubsection\autodot\enskip}}
\renewcommand*{\subsubsectionformat}{%
\makebox[0pt][r]{%
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 111

\thesubsubsection\autodot\enskip}}
\renewcommand*{\paragraphformat}{%
\makebox[0pt][r]{\theparagraph\autodot\enskip}}
\renewcommand*{\paragraphformat}{%
\makebox[0pt][r]{%
\thesubparagraph\autodot\enskip}}
The optional arguments of the \makebox command require LATEX to create a zero-
width box with right-justified content. As a result, the contents of the box are
output to the left of the current position. You can find more about the optional
arguments of \makebox in [Tea05b].

For formatting changes in the headings that go beyond merely formatting the unit num-
ber, please refer to \partlineswithprefixformat, \chapterlineswithprefixformat
and \chapterlinesformat, as well as \sectionlinesformat and its
\sectioncatchphraseformat format in section 21.8, starting from page 494.

\chapappifchapterprefix{additional text }
\chapapp
v2.8o These two commands are used internally by KOMA - Script and also made available to the
scrbook, user. Later, you will see how to use them, for example to redefine other commands.
scrreprt If you use the layout option chapterprefix=true (see page 96), \chapappifchapterprefix
outputs the word “Chapter” in the body of the text in the current language, followed by
additional text . In the appendix, the word “Appendix” in the current language is output
instead, followed by additional text . If the option maincls=chapterprefixfalse is set,
then nothing is output.
The \chapapp command always outputs the word “Chapter” or “Appendix”, regardless of
the setting of the chapterprefix option.
Since chapters only exist in the classes scrbook and scrreprt, these commands only exist in
these classes.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 112

\chaptermark{running head }
\addchapmark{running head }
\sectionmark{running head }
\addsecmark{running head }
\subsectionmark{running head }
\chaptermarkformat
\sectionmarkformat
\subsectionmarkformat
As mentioned in section 3.12, the headings page style works with automatic running
heads. For this, the commands \chaptermark and \sectionmark, or \sectionmark and
\subsectionmark, are defined accordingly. Every sectioning command (\chapter, \section,
etc.) automatically executes the corresponding \...mark command. The parameter passed con-
tains the text of the section heading. The corresponding section number is added automatically in
the \...mark command. The formatting is done according to the sectioning level with one of the
three commands \chaptermarkformat, \sectionmarkformat, or \subsectionmarkformat.
Note that the running heads of \addchap and \addsec are also based on \chaptermark
and \sectionmark. However, the secnumdepth counter is set locally to a value that switches
off the numbering of chapters or sections. You should consider this, for example, if you rede-
fine \chaptermark or \sectionmark (see \Ifnumbered on page 113). The starred variants
\addchap* and \addsec* use additional commands \addchapmark and \addsecmark that are
also defined based on \chaptermark and \sectionmark with local changes of secnumdepth.
scrartcl Although there is no \chaptermark or \chaptermarkformat command in scrartcl, there are
two commands, \subsectionmark and \subsectionmarkformat, which exist only in scrartcl.
However using the scrlayer-scrpage package changes this (see chapter 5).
Just as numbers in the sectioning-command headers are formatted with \partformat
down to \subparagraphformat, \chaptermarkformat, \sectionmarkformat, and
\subsectionmarkformat define the formatting of the sectioning numbers in the auto-
matic running heads. They can be adapted to your personal needs with \renewcommand. The
original definitions for the KOMA - Script classes are:
\newcommand*{\chaptermarkformat}{%
\chapappifchapterprefix{\ }\thechapter\autodot\enskip}
\newcommand*{\sectionmarkformat}{%
\thesection\autodot\enskip}
\newcommand*{\subsectionmarkformat}{%
\thesubsection\autodot\enskip}

Example: Suppose you want the word “Chapter” to precede the chapter number in the running
head. You could put the following definition in the preamble of your document:
\renewcommand*{\chaptermarkformat}{%
\chapapp~\thechapter\autodot\enskip}
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 113

As you can see, both \chapapp and \chapappifchapterprefix, explained above, are used
here.

secnumdepth
\partnumdepth
\chapternumdepth
\sectionnumdepth
\subsectionnumdepth
\subsubsectionnumdepth
\paragraphnumdepth
\subparagraphnumdepth
Normally, the scrbook and scrreport classes number the section headings from \part down to
\subsection and the scrartcl class numbers them from \part down to \subsubsection. The
actual depth to which headings are numbered is controlled by the LATEX counter secnumdepth.
v3.12 To save users the trouble of having to remember abstract numbers, the commands
\partnumdepth to \subparagraphnumdepth return the appropriate number for the section
level in their name.

Example: For a book project, you want the section levels from part down to section to be
numbered. To achieve this, you have to set counter secnumdepth to the value
represented by \sectionnumdepth in the preamble of your document:
\setcounter{secnumdepth}{\sectionnumdepth}

No provision is made for redefining these commands. Doing so could lead to unexpected
results, not only with KOMA - Script but also with third party packages. Thus, you should
never redefine them.
Do not confuse the secnumdepth and tocdepth counters (see section 3.9, page 77). Depend-
ing on the class you are using, the meaning of the values of the secnumdepth and tocdepth
counters may differ for the same section level.

\Ifnumbered{section level }{then code }{else code }


\Ifunnumbered{section level }{then code }{else code }
v3.28
v3.12 The commands \Ifnumbered and \Ifunnumbered determine which section-level headings are
numbered, using the technique described above, and execute code depending on whether
a section level is numbered or not. If a section level is numbered with the cur-
rent settings, \Ifnumbered executes the then code . If the section level is unnumbered,
the else code is executed. The \Ifunnumbered command behaves in exactly the oppo-
site manner, executing the then code if the current level is unnumbered and the else
code if it is. The section level parameter is simply the LATEX name of a section like
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 114

part, chapter, section, subsection, subsubsection, paragraph oder subparagraph.part,


chapter, section, subsection, subsubsection, paragraph, or subparagraph.
KOMA-Script itself uses these tests, for example, in the definition of \chaptermark in the
headings page style. This indirectly ensures that headings inserted by \addchap do not set
a number inside the running head (see also \addchapmark, page 112).

\setpartpreamble[position ][width ]{preamble }


\setchapterpreamble[position ][width ]{preamble }
scrbook, Parts and chapters in KOMA - Script can be given a preamble . This is particularly useful
scrreprt when you are using a two-column format with the class option twocolumn, since the heading
and the preamble are always set in a one-column layout. The preamble can contain more
than one paragraph. The command to set the preamble must come before the respective
\part, \addpart, \chapter, or \addchap command.
Example: You are writing a report about the condition of a company. You organize the report
in such a way that every department gets its own partial report. Each of these parts
should be introduced by an abstract on the corresponding title page. You could
write the following:
\setpartpreamble{%
\begin{abstract}
This is a filler text. It serves merely to demonstrate the
capabilities of {\KOMAScript}. If you read this text, you will
get no information.
\end{abstract}
}
\part{Department for Word Processing}
Depending on the settings for the heading font size (see page 97) and the options for
the abstract environment (see section 3.8, page 72), the result will look something
like this:

Part III.

Department for Word Processing

Abstract

This is a filler text. It serves merely to demonstrate the capabilities


of KOMA - Script. If you read this text, you will get no information.

Please note that you are responsible for the spacing between the heading, preamble, and the
following text. Note also that there is no abstract environment in the scrbook class (see
section 3.8, page 72).
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 115

v2.8p The first optional argument, position , determines the position at which the preamble is
placed with the help of one or two letters. For vertical placement there are two possibilities
at present:

o – above the heading


u – below the heading

You can therefore put one preamble above and another below a heading. For horizontal
placement you have three options:

l – left-aligned
r – right-aligned
c – centred

This setting does not affect the alignment of the text in the preamble . Instead, it aligns the
box that contains the preamble. The width of this box is determined by the second optional
argument, width . If you omit this second argument, the box uses the full text width. In that
case, the option for horizontal positioning has no effect. You can combine exactly one letter
from the vertical with one letter from the horizontal positioning.
A typical use for \setchapterpreamble would be something like an epigraph, a wise saying,
or a dictum. The \dictum command, which you can use for this purpose, is described in the
next section. You will also find an example there.
Please note that a preamble placed above the heading is set within the existing vertical
space above the heading. The heading will not be moved down. You are therefore responsible
for ensuring that the preamble is not too large and that the space above the heading is
sufficient. See also the beforeskip setting for \RedeclareSectionCommand in section 21.8,
table 21.3, page 485.

3.17. Dicta

A common element in a document is an epigraph or quotation that is set above or below


a chapter or section heading, along with a reference to the source and its own formatting.
KOMA-Script refers to such an epigraph as a dictum.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 116

Table 3.16.: Default settings


for the elements of a dictum Element Default
dictum \normalfont\normalcolor\sffamily\small
dictumauthor \itshape

\dictum[author ]{text }
\dictumwidth
\dictumauthorformat{author }
\dictumrule
\raggeddictum
\raggeddictumtext
\raggeddictumauthor
You can set such a saying with the help of the \dictum command. This macro can be included
in the mandatory argument of either the \setchapterpreamble or the \setpartpreamble
command. However, this is not obligatory.
The dictum, along with an optional author , is inserted in a \parbox (see [Tea05b])
of width \dictumwidth. However, \dictumwidth is not a length which can be set with
\setlength. It is a macro that can be redefined using \renewcommand. The default is
0.3333\textwidth, which is one third of the text width. The box itself is aligned with the com-
mand \raggeddictum. The default is \raggedleft, that is, right justified. \raggeddictum
can be redefined with the help of \renewcommand.
You can align the dictum within the box using \raggeddictumtext. The de-
fault is \raggedright, that is, left justified. You can also redefine this macro with
\renewcommand.The output uses the default font setting for the element dictum, which can be
changed with the commands \setkomafont and \addtokomafont (see section 3.6, page 59).
Default settings are listed in table 3.16.
If an author is defined, it is separated from the dictum by a horizontal rule spanning the
v3.10 full width of the \parbox. This rule is defined in \dictumrule as a vertical object with
\newcommand*{\dictumrule}{\vskip-1ex\hrulefill\par}
The \raggeddictumauthor command defines the alignment for the rule and the author .
The default is \raggedleft. This command can also be redefined using \renewcommand. The
format is defined with \dictumauthorformat. This macro expects the author text as its
argument. By default \dictumauthorformat is defined as
\newcommand*{\dictumauthorformat}[1]{(#1)}
Thus the author is set enclosed in rounded parentheses. For the dictumauthor element,
you can define a different font than that used for the dictum element. The default settings
are listed in table 3.16. Changes can be made using the \setkomafont and \addtokomafont
commands (see section 3.6, page 59).
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 117

If you use \dictum within the \setchapterpreamble or \setpartpreamble macro,


\textwidth is not the width of the whole text body but the current text width. If
\dictumwidth is set to .5\textwidth and \setchapterpreamble has an optional width of
.5\textwidth too, you will get a box with a width one quarter of the text width. The hor-
izontal positioning of the dictum inside the box is always done with \raggeddictum. The
optional argument for horizontal positioning which is implemented for these two commands
has no effect to the \text. If you use \dictum you should refrain from setting the optional
width for \setchapterpreamble or \setpartpreamble.
If you have more than one dictum, one under another, you should separate them by an
additional vertical space, which is easily accomplished using the \bigskip command.

Example: You are writing a chapter about modern marriage, and you want to place a dictum
in the preamble to the chapter heading. You write:
\setchapterpreamble[u]{%
\dictum[Schiller]{So pause ye who would link your fates~\dots}}
\chapter{Modern Marriage}
The output would look as follows:

17 Modern Marriage
So pause ye who would link
your fates . . .
(Schiller)

If you want the dictum to span only a quarter of the text width rather than a third,
you can redefine \dictumwidth this way:
\renewcommand*{\dictumwidth}{.25\textwidth}

3.18. Lists

Both LATEX and the standard classes offer different environments for lists. Naturally, KOMA -
Script also offers all these environments, though slightly modified or extended in some cases.
In general, all lists — even those of different kinds — can be nested up to four levels deep.
From a typographical view, anything more would make no sense, as lists of more than three
levels cannot easily be apprehended. In such cases, I recommend that you split a large list
into several smaller ones.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 118

\begin{itemize}
..
\item ...
.
\end{itemize}
\labelitemi
\labelitemii
\labelitemiii
\labelitemiv
The simplest form of a list is the itemized list, itemize. Depending on the level, KOMA - Script
classes use the following marks: “•”, “–”, “∗”, and “·”. The definition of these symbols is
specified in the macros \labelitemi, \labelitemii, \labelitemiii, and \labelitemiv,
all of which you can redefine using \renewcommand. With the KOMA - Script classes the
v3.33 fonts used to format the symbols for the different levels can be changed using \setkomafont
and \addtokomafont (see section 3.6, page 59) for the elements labelitemi, labelitemii,
labelitemiii and labelitemiv. By default these all use the font setting for element
itemizelabel. Only element labelitemii additionally uses \bfseries. The default of
itemizelabel itself is \normalfont. Every item is introduced with \item.
Example: You have a simple list which is nested in several levels. You write, for example:
\minisec{Vehicles in the game}
\begin{itemize}
\item aeroplanes
\begin{itemize}
\item biplane
\item transport planes
\begin{itemize}
\item single-engine
\begin{itemize}
\item jet propelled
\item propeller driven
\end{itemize}
\item twin-engine
\begin{itemize}
\item jet propelled
\item propeller driven
\end{itemize}
\end{itemize}
\item helicopters
\end{itemize}
\item motorcycles
\item automobiles
\begin{itemize}
\item racing cars
\item passenger cars
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 119

\item lorries
\end{itemize}
\item bicycles
\end{itemize}
As output you get:
Vehicles in the game
• aeroplanes
– biplanes
– transport planes
∗ single-engine
· jet-propelled
· propeller-driven
∗ twin-engine
· jet propelled
· propeller driven
– helicopters

• motorcycles

• automobiles
– racing cars
– passenger cars
– lorries

• bicycles

\begin{enumerate}
..
\item ...
.
\end{enumerate}
\theenumi
\theenumii
\theenumiii
\theenumiv
\labelenumi
\labelenumii
\labelenumiii
\labelenumiv
The numbered list is also very common and already provided by the LATEX kernel. The number-
ing differs according to the level, with Arabic numbers, small letters, small Roman numerals,
and capital letters, respectively. The style of numbering is defined with the macros \theenumi
down to \theenumiv. The output format is determined by the macros \labelenumi to
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 120

\labelenumiv. While the small letter of the second level is followed by a right parenthe-
sis, the values of all other levels are followed by a dot. Every item is introduced with \item.

Example: Let’s shorten the previous example, using an itemize environment instead of the
enumerate environment:
Vehicles in the game
1. aeroplanes
a) biplanes
b) transport planes
i. single-engine
A. jet-propelled
B. propeller-driven
ii. twin-engine

2. motorcycles
a) historically accurate
b) futuristic, not real

Within the list, you can set labels in the normal way with \label and then reference
then with \ref. In the example above, a label was set after the jet-propelled,
single-engine transport planes with “\label{xmp:jets}”. The \ref value is then
“1(b)iA”.

\begin{description}
..\item[keyword ] . . .
.
\end{description}
Another list form is the description list. It primarily serves to describe individual items or
v2.8p keywords. The item itself is specified as an optional parameter in \item. The font used to
format the keyword can be changed with the \setkomafont and \addtokomafont commands
(see section 3.6, page 59) for the descriptionlabel element (see table 3.2, page 60). The
default is \sffamily\bfseries.

Example: You want the keywords to be printed bold and in the normal font instead of bold
and sans serif. Using
\setkomafont{descriptionlabel}{\normalfont\bfseries}
you redefine the font accordingly.
An example for a description list is the output of the page styles listed in sec-
tion 3.12. The (abbreviated) source is:
\begin{description}
\item[empty] is the page style without any header or footer.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 121

\item[plain] is the page style without headings.


\item[headings] is the page style with running headings.
\item[myheadings] is the page style for manual headings.
\end{description}
This gives:

empty is the page style without any header or footer.

plain is the page style without headings.

headings is the page style with running headings.

myheadings is the page style for manual headings.

\begin{labeling}[delimiter ]{widest pattern }


..\item[keyword ]. . .
.
\end{labeling}
Another form of description list is only available in the KOMA - Script classes: the labeling
environment. Unlike the description described above, you can specify a pattern for labeling
whose length determines the indentation of all items. Furthermore, you can put an optional
v3.02 delimiter between the item and its description. The font used to format the item and
the separator can be changed with the \setkomafont and \addtokomafont commands (see
section 3.6, page 59) for the element labelinglabel and labelingseparator (see table 3.2,
page 60).

Example: Slightly changing the example from the description environment, we could write
the following:
\setkomafont{labelinglabel}{\ttfamily}
\setkomafont{labelingseparator}{\normalfont}
\begin{labeling}[~--]{myheadings}
\item[empty]
Page style without header or footer
\item[plain]
Page style for chapter beginnings without headings
\item[headings]
Page style for running headings
\item[myheadings]
Page style for manual headings
\end{labeling}
The result is this:
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 122

empty – Page style without header or footer

plain – Page style for chapter beginnings without headings

headings – Page style for running headings

myheadings – Page style for manual headings

As this example shows, you can set a font-changing command in the usual way.
But if you do not want the font of the separator to be changed in the same way as
the font of the label, you have to set the font of the separator as well.

Originally, this environment was implemented for things like “Premise, Evidence, Proof”, or
“Given, Find, Solution” that are often used in lecture handouts. These days, however, the
environment has very different applications. For example, the environment for examples in
this guide was defined with the labeling environment.

\begin{verse} . . . \end{verse}
The verse environment is not normally perceived as a list environment because you do not
work with \item commands. Instead, fixed line breaks are used within the flushleft envi-
ronment. Internally, however, both the standard classes as well as KOMA - Script implement
it as a list environment.
In general, the verse environment is used for poetry. Lines are indented both left and right.
Individual lines of verse are ended by a fixed line break: \\. Verses are set as paragraphs,
separated by an empty line. Often also \medskip or \bigskip is used instead. To avoid a
page break at the end of a line of verse you can, as usual, insert \\* instead of \\.

Example: As an example, Emma Lazarus’s sonnet from the pedestal of Liberty Enlightening
the World2 :
\begin{verse}
Not like the brazen giant of Greek fame\\*
With conquering limbs astride from land to land\\*
Here at our sea-washed, sunset gates shall stand\\*
A mighty woman with a torch, whose flame\\*
Is the imprisoned lightning, and her name\\*
Mother of Exiles. From her beacon-hand\\*
Glows world-wide welcome; her mild eyes command\\*
The air-bridged harbor that twin cities frame.\\*
‘‘Keep, ancient lands, your storied pomp!’’ cries she\\*
With silent lips. ‘‘Give me your tired, your poor,\\*

2
The lines from Roald Dahl’s poem “Little Red Riding Hood and the Wolf”, which was used in former releases,
has been replaced, because in these times certain politicians around the world really seem to need “The
New Colossus” as urgent reminder.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 123

Your huddled masses yearning to breathe free,\\*


The wretched refuse of your teeming shore.\\*
Send these, the homeless, tempest-tossed to me:\\*
I lift my lamp beside the golden door.’’
\end{verse}
The result is as follows:

Not like the brazen giant of Greek fame


With conquering limbs astride from land to land
Here at our sea-washed, sunset gates shall stand
A mighty woman with a torch, whose flame
Is the imprisoned lightning, and her name
Mother of Exiles. From her beacon-hand
Glows world-wide welcome; her mild eyes command
The air-bridged harbor that twin cities frame.
“Keep, ancient lands, your storied pomp!” cries she
With silent lips. “Give me your tired, your poor,
Your huddled masses yearning to breathe free,
The wretched refuse of your teeming shore.
Send these, the homeless, tempest-tossed to me:
I lift my lamp beside the golden door.”

However, if you have very long lines of verse where a line break occurs within a line
of verse:
\begin{verse}
Both the philosopher and the house-owner
always have something to repair.\\*
\bigskip
Don’t trust a man, my son, who tells you
that he has never lied.
\end{verse}

Both the philosopher and the house-owner always have some-


thing to repair.

Don’t trust a man, my son, who tells you that he has never lied.

in this case \\* can not prevent a page break occurring within a verse at such a
line break. To prevent such a page break, a change of \interlinepenalty would
have to be inserted at the beginning of the environment:
\begin{verse}\interlinepenalty 10000
Both the philosopher and the house-owner
always have something to repair.\\
\bigskip
Don’t trust a man, my son, who tells you
that he has never lied.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 124

\end{verse}
Here are two sayings that should always be considered when confronted with seem-
ingly strange questions about LATEX or its accompanying explanations:
\begin{verse}
A little learning is a dangerous thing.\\*
Drink deep, or taste not the Pierian Spring;\\
\bigskip
Our judgments, like our watches, none\\*
go just alike, yet each believes his own.
\end{verse}

A little learning is a dangerous thing.


Drink deep, or taste not the Pierian Spring;

Our judgments, like our watches, none


go just alike, yet each believes his own.

Incidentally, \bigskip was used in these examples to separate two sayings.

\begin{quote} . . . \end{quote}
\begin{quotation} . . . \end{quotation}
These two environments are also set internally as list environments and can be found in both
the standard and the KOMA - Script classes. Both environments use justified text which is
indented on both the left and the right side. Often they are used to separate longer quotations
from the main text. The difference between the two lies in in the manner in which paragraphs
are typeset. While quote paragraphs are distinguished by vertical space, in quotation para-
graphs, the first line is indented. This also applies to the first line of a quotation environment,
unless it is preceded by \noindent.

Example: You want to highlight a short anecdote. You write the following quotation envi-
ronment for this:
A small example for a short anecdote:
\begin{quotation}
The old year was turning brown; the West Wind was
calling;

Tom caught the beechen leaf in the forest falling.


‘‘I’ve caught the happy day blown me by the breezes!
Why wait till morrow-year? I’ll take it when me pleases.
This I’ll mend my boat and journey as it chances
west down the withy-stream, following my fancies!’’
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 125

Little Bird sat on twig. ‘‘Whillo, Tom! I heed you.


I’ve a guess, I’ve a guess where your fancies lead you.
Shall I go, shall I go, bring him word to meet you?’’
\end{quotation}
The result is:
A small example for a short anecdote:

The old year was turning brown; the West Wind was calling;
Tom caught the beechen leaf in the forest falling. “I’ve caught
the happy day blown me by the breezes! Why wait till morrow-
year? I’ll take it when me pleases. This I’ll mend my boat and
journey as it chances west down the withy-stream, following my
fancies!”
Little Bird sat on twig. “Whillo, Tom! I heed you. I’ve a
guess, I’ve a guess where your fancies lead you. Shall I go, shall
I go, bring him word to meet you?”

Using a quote environment instead you get:

A small example for a short anecdote:

The old year was turning brown; the West Wind was calling;
Tom caught the beechen leaf in the forest falling. “I’ve caught
the happy day blown me by the breezes! Why wait till morrow-
year? I’ll take it when me pleases. This I’ll mend my boat and
journey as it chances west down the withy-stream, following my
fancies!”
Little Bird sat on twig. “Whillo, Tom! I heed you. I’ve a guess,
I’ve a guess where your fancies lead you. Shall I go, shall I go,
bring him word to meet you?”

\begin{addmargin}[left indentation ]{indentation } . . . \end{addmargin}


\begin{addmargin*}[inner indentation ]{indentation } . . . \end{addmargin*}
Like quote and quotation, the addmargin environment changes the margin. However, unlike
the first two environments, addmargin lets the user change the width of the indentation. Apart
from this change, this environment does not change the indentation of the first line nor the
vertical spacing between paragraphs.
If only the obligatory argument indentation is given, both the left and right margin are
expanded by this value. If the optional argument left indentation is given as well, then
the value left indentation is used for the left margin instead of indentation .
The starred variant addmargin* differs from the normal version only in the two-sided mode.
Furthermore, the difference only occurs if the optional argument inner indentation is used.
In this case, the value of inner indentation is added to the normal inner indentation. For
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 126

right-hand pages this is the left margin; for left-hand pages, the right margin. Then the value
of indentation determines the width of the opposite margin.
Both versions of this environment allow negative values for all parameters. This can be
done so that the environment protrudes into the margin.
Example: \newenvironment{SourceCodeFrame}{%
\begin{addmargin*}[1em]{-1em}%
\begin{minipage}{\linewidth}%
\rule{\linewidth}{2pt}%
}{%
\rule[.25\baselineskip]{\linewidth}{2pt}%
\end{minipage}%
\end{addmargin*}%
}
If you now put your source code in such an environment, it will show up as:

You define the following environment:

\newenvironment{\SourceCodeFrame}{%
\begin{addmargin*}[1em]{-1em}%
\begin{minipage}{\linewidth}%
\rule{\linewidth}{2pt}%
}{%
\rule[.25\baselineskip]{\linewidth}{2pt}%
\end{minipage}%
\end{addmargin*}%
}

This may be feasible or not. In any case, it shows the usage of this envi-
ronment.

The optional argument of the addmargin* environment makes sure that the inner
margin is extended by 1 em. In turn the outer margin is decreased by 1 em. The
result is a shift by 1 em to the outside. Instead of 1em, you can of course use a
length, for example, 2\parindent.
Whether a page is going to be on the left or right side of the book cannot be determined
reliably on the first LATEX run. For details please refer to the explanation of the commands
\Ifthispageodd (section 3.11, page 80) and \ifthispagewasodd (section 21.1).
The interplay of environments such as lists and paragraphs gives rise to frequent questions.
Therefore, you can find further explanation in the description of the parskip option in section 21.1.

3.19. Mathematics

KOMA-Script classes do not provide their own environments for formulas, systems of equa-
tions, or similar mathematical elements. Instead, KOMA - Script relies fully on the maths
features of the LATEX kernel. This also applies to the the options leqno and fleqn.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 127

You will not find a description of the maths environments of the LATEX kernel here. If you
want to use displaymath, equation, or eqnarray you should read an introduction to LATEX
like [OPHS11]. But if you want more than very simple mathematics, you should use the
amsmath package (see [Ame02]).

leqno
Equations are normally numbered on the right. The leqno option loads the standard option
file leqno.clo. The equations are then numbered on the left. You must use this option
as an optional argument of \documentclass. Using it as an argument of \KOMAoptions or
\KOMAoption is not supported. The latter would not make sense because the recommended
maths package amsmath can only respond to this option at load time and does not react to
run-time changes of the option.

fleqn
Displayed equations are normally centred. The standard option fleqn loads the standard
option file fleqn.clo. Displayed equations are then left-justified. You must use this option
as an optional argument of \documentclass. Using it as an argument of \KOMAoptions or
\KOMAoption is not supported. The latter would not make sense because the recommended
maths package amsmath can only respond to this option at load time and does not react to
run-time changes of the option.

3.20. Floating Environments for Tables and Figures

With the floating environments, LATEX offers a powerful and convenient mechanism to arrange
figures and tables automatically. Frequently, beginners do not properly understand these
floating environments. They often ask to specify the exact position of a table or figure within
the text. However, this is usually unnecessary, since the text will contain references to these
floating environments. It is also not sensible because such an object can only be set on the
page if there is enough space left for it. If this is not the case, the object would have to be
shifted onto the next page, possibly leaving a huge empty space on the previous page.
Often a document will use the same optional argument to position every floating object.
This also makes no sense. In such cases, you should instead change the default value globally.
For more details, see [Wik].
One final, important note before starting this section: most of mechanisms described here,
which extend the capabilities of the standard classes, no longer work correctly when used with
packages that modify the appearance of figure and table captions. This should be self-evident,
but it is often overlooked.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 128

captions=setting
In the standard classes, the titles of floating environments, which are formatted with the
\caption command (see below), are set off from the float with vertical spacing appropriate
for putting the caption beneath the float, like a signature. They also distinguish between
one-line and multi-line captions. One-line captions are centred while multi-line captions are
left-justified.
For tables, however, you want the caption to appear as a heading instead of a signature.
That’s because tables can span multiple pages. With such tables, the reader wants to know
the purpose of the table on the first page. Furthermore, tables are usually read row by row,
from top to bottom. So there are normally at least two good reasons to provide all tables with
headings. KOMA - Script therefore offers the captions=tableheading option, which changes
the formatting of table captions for use above the table.
Note that multi-page tabulars cannot use a floating environment. To have an automatic page
break in a tabular you need an additional package like longtable (see [Car04]) or supertabular
(see [BJ04]).
You can switch back to the default caption formatting using captions=tablesignature.
Note that these options change only the formatting, not the actual position of the caption.
Whether the caption is placed above or below a float depends solely upon where you use the
\caption command inside float environment. However, this can change when using the float
package with the \restylefloats command (see [Lin01]).
v3.09 Of course, corresponding functions exist for figures using the options captions=
figureheading and captions=figuresignature. However, figures such as photos tend to be
viewed as a whole, and a diagram or graph will mostly be examined starting from the lower
left. Therefore, it only rarely makes sense to change the caption format for figures alone from
signatures to headings.
Sometimes, however, all floating environments should use headings. Therefore KOMA -
v3.09 Script provides options captions=heading and captions=signature to switch the format of
every floating environment. These options can also be used inside a floating environment.
float Please note when using the float package that the settings for signatures or headings will
no longer work once \restylefloat is applied to tables or figures. For details about the float
package and \restylefloat, please refer to [Lin01]. This also applies to \caption within new
floating environments defined with float. You can find additional support which KOMA - Script
provides when using the float package in the explanation of komaabove (see page 137). As an
alternative to float, you can also consult \captionof (see page 132) and \DeclareNewTOC (see
page 407). Additionally, when using float, the scrhack package is expressly recommended (see
chapter 16 from page 414 in part II).
Furthermore, KOMA - Script offers the option to disable the distinction between one-line and
multi-line captions using the captions=nooneline option. This can be useful, for example,
if you do not want one-line captions to be centred. The default, where one-line captions are
centred, corresponds to captions=oneline.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 129

Another special feature of KOMA - Script is the ability to put the caption beside the floating
object rather than above or below it. For this, you need the environment captionbeside,
which is explained starting on page 134. The settings for this environment can also be changed
with the caption option. You can find the available values for the corresponding settings
in table 3.17.

Table 3.17.: Available values for the captions option for setting formatting of captions as headings or
signatures in floating environments

bottombeside, besidebottom
Captions for the captionbeside environment (see section 3.20, page 134) are verti-
cally aligned with the bottommost baseline of the contents of the floating environ-
ment.
centeredbeside, besidecentered, middlebeside, besidemiddle
Captions for the captionbeside environment (see section 3.20, page 134) are verti-
cally aligned with the center of the contents of the floating environment.
figureheading, figureabove, abovefigure, topatfigure
v3.09 Captions for figures use heading format — possibly deviating from captions=
signature.
figuresignature, belowfigure, bottomatfiggure
v3.09 Captions for figures use signature format — possibly deviating from captions=
headings.
heading, above, top
v3.09 Captions for floating environments use formatting suitable for use in a heading.
This setting does not control whether they are placed at the top or the bottom
of the object. This option also implies captions=tableheading and captions=
figureheading.
innerbeside, besideinner
Captions for the captionbeside environment (see section 3.20, page 134) are placed
inside of and next to the contents of the environment in two-sided printing. In
one-sided printing, captions=leftbeside is used.
leftbeside, besideleft
Captions for the captionbeside environment (see section 3.20, page 134) are placed
to the left of the contents of the floating environment.
...
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 130

Table 3.17.: Available values for the captions option (continued)

nooneline
Single-line captions are handled the same as multi-line captions.
oneline
Single-line captions are centred horizontally.
outerbeside, besideouter
Captions for the captionbeside environment (see section 3.20, page 134) are placed
outside of and next to the contents of the environment in two-sided printing. In
one-sided printing, captions=rightbeside is used.
rightbeside, besideright
Captions for the captionbeside environment (see section 3.20, page 134) are placed
to the right of the contents of the floating environment.
signature, below, bot, bottom
v3.09 Captions for floating environments use signature format. This setting does not con-
trol whether they are placed at the top or the bottom of the object. This options
also implies captions=tablesignature and captions=figuresignature.
tableheading, tableabove, abovetable, abovetabular, topattable
Captions for tables use heading format — possibly deviating from captions=
signature.
tablesignature, belowtable, belowtabular, bottomattable
Captions for tables use signature format — possibly deviating from captions=
heading.
topbeside, besidetop
Captions for the captionbeside environment (see section 3.20, page 134) are verti-
cally aligned to the baseline at the top of the floating environment.

\caption[entry ]{title }
\captionbelow[entry ]{title }
\captionabove[entry ]{title }
In the standard classes, tables and figures are given captions with the \caption command
placed below the table or figure. For figures, this is generally correct. For tables, opinions
differ as to whether captions should be placed above the table or, consistent with captions of
figures, below it. Therefore KOMA - Script, unlike the standard classes, offers \captionbelow
for captions below and \captionabove for captions above tables or figures.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 131

For tables and figures, or in general for all floating environments, you can control the
behaviour of \caption with the captions option described at the beginning of this section. For
compatibility reasons, the default behaviour of \caption for all floating environments is like
\captionbelow. However, you should use the captions=tableheading option, which switches
the behaviour of \caption inside table environments to \captionabove. Alternatively, you
can use \captionabove instead of \caption inside every table environment.

Example: Instead of using captions below a table, you want to place your captions above it,
because you have tables which span more then one page. In the standard classes
you could only write:
\begin{table}
\caption{This is an example table}
\begin{tabular}{llll}
This & is & an & example.\\\hline
This & is & an & example.\\
This & is & an & example.
\end{tabular}
\end{table}
Then you would get this unsatisfying result:

Table 30.2: This is an example table.


This is an example.
This is an example.
This is an example.

Using KOMA - Script you write instead:


\begin{table}
\captionabove{This is just an example table}
\begin{tabular}{llll}
This & is & an & example.\\\hline
This & is & an & example.\\
This & is & an & example.
\end{tabular}
\end{table}
Then you get:

Table 30.2: This is just an example table

This is an example.
This is an example.
This is an example.

Since you want all your tables typeset with captions above, you could of course
use the captions=tableheading option instead (see page 128). Then you can use
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 132

Table 3.18.: Font defaults for the elements of figure or table cap-
tions
element default
caption \normalfont
captionlabel \normalfont

\caption as you would in the standard classes. You will get the same result as
with \captionabove.

v2.8p The font style for the description and the label — “Figure” or “Table”, followed by
the number and the delimiter — can be changed with the commands \setkomafont and
\addtokomafont (see section 3.6, page 59). The respective elements for this are caption
and captionlabel (see table 3.2, page 60). The font style for the element caption is applied
to the element captionlabel before the font style of captionlabel itself is applied. The
default settings are listed in table 3.18.

Example: You want the table and figure descriptions typeset in a smaller font size. Thus you
could write the following in the preamble of your document:
\addtokomafont{caption}{\small}
Furthermore, you would like the labels to be printed in sans serif and bold. You
add:
\setkomafont{captionlabel}{\sffamily\bfseries}
As you can see, simple extensions of the default definitions are possible.

\captionof{float type }[entry ]{title }


\captionbelowof{float type }[entry ]{title }
\captionaboveof{float type }[entry ]{title }
v3.05 Like the caption and capt-of packages, KOMA - Script offers the \captionof command, with
which you can put a caption for a floating environment, together with an entry in the corre-
sponding environment list, outside of the floating environment or even in a different floating
environment. Unlike \caption, the type of floating environment must be specified as the first
parameter.
v3.09 In addition, KOMA - Script also provides the commands \captionaboveof and
\captionbelowof. These are like \captionabove and \captionbelow but with the addi-
tional features and parameter of \captionof.
v3.09a Of course \captionof takes into account the heading and signature settings of the
captions option. But this feature may be lost if you load the capt-of or caption packages.
When using caption, you must follow the instructions for that package (see [Som13])!
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 133

Example: Suppose you want to create a floating object with a table and a figure next to each
other. Since there are no mixed floating environments, you primarily use a figure
environment:
\begin{figure}
\begin{minipage}{.5\linewidth}
\centering
\rule{4cm}{5cm}
\caption{A rectangle}\label{fig:rechteck}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\centering
\captionaboveof{table}
[Measure of the rectangle in
figure~\ref{fig:rechteck}]%
{Measure of the rectangle}
\label{tab:rechteck}
\begin{tabular}{ll}
Width: & 4\,cm\\
Height: & 5\,cm
\end{tabular}
\end{minipage}
\end{figure}
Two minipage environments were used to place the figure and the table side by
side. The percent sign after the end of the first minipage is important. Without
it, an additional space would appear between the minipage environments.
The figure caption was created with \caption. The table caption was created with
\captionaboveof with table as the first argument. Because of this, KOMA - Script
knows that this is a table caption even though it is inside the figure environment.
The optional argument of \captionaboveof creates an entry in the list of tables.
Without the optional argument, the caption specified in the final mandatory argu-
ment would have been used for the list of tables too. Although this caption text is
sufficient for the environment itself, it would not be very meaningful in the list of
tables. Therefore, a different title is used for the list of tables using the optional
argument. figure 3.3 shows the result of the example code.

You can produce a non-floating table with a caption in the same way as the table inside a
figure environment in the example above. In such a case, a minipage environment should
also be used to avoid page breaks between the caption and the table. In addition, you should
embed the minipage environment in a flushleft environment both to achieve a pleasing sep-
aration between the surrounding text and to avoid the paragraph indentation of the minipage
environment.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 134

Table 3.19.: Rectangle size

Width: 4 cm
Height: 5 cm

Figure 3.3.: Example: Us-


ing \captionaboveof inside Figure 3.2.: A rectangle
another floating environment

\begin{captionbeside}[short title ]{caption text }[placement ][width ][offset ] . . . \end


{captionbeside}
\begin{captionbeside}[short title ]{caption text }[placement ][width ][offset ]* . . . \end
{captionbeside}
v2.8q In addition to captions above and below the figure, you will often find captions, in particu-
lar for small figures, which are placed beside the figure. The bottom edge of the caption is
normally aligned with the bottom of the figure. Of course, you can achieve the same thing
in the standard classes with some fiddling and the use of two \parbox commands. However,
KOMA-Script offers a special environment for this which you can use within the floating envi-
ronments. The first optional parameter, short title , and the required parameter caption
text have the same meaning as the corresponding parameters of \caption, \captionabove
or \captionbelow. The caption text is placed beside the content of the environment in
this case.
The placement parameter can determine whether the caption text is placed on the left
or the right. Exactly one of the following letters is allowed:

l – left
r – right
i – inner margin in two-sided printing
o – outer margin in two-sided printing

The default placement is to the right of the content of the environment. You can change this
v3.00 default using the captions option (see page 128) with values like innerbeside, leftbeside,
outerbeside, and rightbeside. If either o or i are used you may need to run LATEX twice
to obtain the correct placement.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 135

Normally, the content of the environment and the caption text fill the entire available
text width. However, you can specify a different width using the optional parameter width .
This can be greater than the current text width.
When specifying a width , the width used is usually centred with respect to the body text.
Using the optional parameter offset , you can shift the environment relative to the left margin.
A positive value corresponds to a shift to the right, whereas a negative value corresponds to
a shift to the left. An offset of 0 pt gives you a left-aligned output.
If you add a star to the optional offset parameter, the value represents a shift relative to
the right margin on left-hand pages in a two-sided layout. A positive value corresponds to a
shift towards the outer margin, whereas a negative value corresponds to a shift towards the
inner margin. An offset of 0 pt means alignment with the inner margin. This variant may
require two LATEX runs to achieve the correct offset.
The default vertical alignment is bottom. This means that the bottommost base lines
v3.00 of the contents of the environment and of the caption are aligned. You can change this
setting using the captions option (see page 128) with the value topbeside, centeredbeside,
or bottombeside. With the setting topbeside, the topmost base lines of the environment
contents and caption will be aligned. With centeredbeside, they will be centred vertically.
In this context, note that the base line of a figure is usually the bottom of the figure. You can
change this using, for example, \raisebox.

Example: You can find an example using the captionbeside environment in figure 3.4. This
figure was typeset with:
\begin{figure}
\begin{captionbeside}[Example: Figure beside description]%
{A figure description which is neither above nor
below, but beside the figure}[i][\linewidth][%
[i][\linewidth][%
\dimexpr\marginparwidth+\marginparsep\relax]*
\fbox{%
\parbox[b][5\baselineskip][c]{.25\textwidth}
{%
\hspace*{\fill}\KOMAScript
\hspace*{\fill}\par
}%
}
\end{captionbeside}
\label{fig:\LabelBase.captionbeside}
\end{figure}
The total width is thus the currently available width of \linewidth. However, this
width is shifted \marginparwidth + \marginparsep to the outside. The caption
text or description is placed on the inner side beside the figure. The figure itself is
shifted 2 em into the outer margin.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 136

KOMA - Script
Figure 3.4.: A figure description which is neither above nor below, but
beside the figure

Figure 3.5 shows a centred caption with:


\KOMAoption{captions}{centeredbeside}
This is certainly not a recommended solution.
In contrast, you can use the top-aligned format seen in figure 3.6. To illustrate how
to shift the baseline using \raisebox, here is a complete example. You can apply
this not only to a substitute figure, as previously shown, but also, for example, to
\includegraphics (see [Car17]).
\documentclass[captions=topbeside]{scrbook}
\usepackage[english]{babel}
\usepackage{graphics}
\begin{document}
\chapter{An Example}
\begin{figure}
\begin{captionbeside}%
[Example: Figure title top beside]%
{A figure description which is neither above nor
below, but top beside the figure}%
[i][\linewidth][%
\dimexpr\marginparwidth+\marginparsep\relax
]*
\raisebox{%
\dimexpr\baselineskip-\totalheight\relax
}{%
\includegraphics{examplepicture}%
}%
\end{captionbeside}
\label{fig:\LabelBase.captionbesidetop}

KOMA - Script
Figure 3.5.: A figure description which is neither above nor below, but
centred beside the figure
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 137

Figure 3.6.: A figure description which is neither above nor below, but
top beside the figure
KOMA - Script

\end{figure}
\end{document}

\begin{captionofbeside}{float type }[short title ]{caption text }[placement ][width ]


..
[offset ]
.
\end{captionofbeside}
\begin{captionofbeside}{float type }[short title ]{caption text }[placement ][width ]
..
[offset ]*
.
\end{captionofbeside}
v3.10 As is the case for \caption, there is a variant for \captionof where the float type is not
defined by using it within a floating environment of this type, so you can specify a suitable
environment for captionbeside with captionofbeside. In contrast to captionbeside, the
float type must be specified as an additional, first argument.

komaabove
komabelow
float If you use the float package, the appearance of the float environments is solely defined by
the float style. This includes whether captions appear above or below. In the float package,
there is no predefined style which gives you the same output and offers the same setting
options (see below) as KOMA - Script. Therefore KOMA - Script defines the two additional
styles, komaabove and komabelow. When using the float package, you can activate these
styles just like the styles plain, boxed, or ruled defined in float. For details refer to [Lin01].
The style komaabove inserts \caption, \captionabove, and \captionbelow above, whereas
komabelow inserts them below the float content.

\captionformat
In KOMA-Script there are various ways to change the formatting of the caption text. The
definition of different font styles has already been explained above. The delimiter or delimiters
between the label and actual caption text is specified by the macro \captionformat. In
contrast to all other \...format commands, this is not the counter but only the items which
follow it. The original definition is:
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 138

\newcommand*{\captionformat}{:\ }
You can change this too with \renewcommand.

Example: For some inexplicable reason, you want a dash surrounded by spaces instead of a
colon followed by a space as a label delimiter. You therefore define:
\renewcommand*{\captionformat}{~--~}
This definition should be put in the preamble of your document.

\figureformat
\tableformat
It has already been mentioned that \captionformat does not contain formatting for the label
itself. You should not alter this by redefining the commands for the output of the \thefigure
or \thetable counters. Such a redefinition would have unwanted side effects on the output
of \ref, the table of contents, the list of figures, and the list of tables. Instead, KOMA - Script
offers two \...format commands. These have the following defaults:
\newcommand*{\figureformat}{\figurename~\thefigure\autodot}
\newcommand*{\tableformat}{\tablename~\thetable\autodot}
They can also be customised to your requirements with \renewcommand.

Example: From time to time, it is required to have captions without labels or delimiters. With
KOMA - Script the following definitions suffice to achieve this:
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\renewcommand*{\captionformat}{}
It should be noted, however, that although no numbering is output, the internal
counters are nevertheless incremented. This becomes especially important if this
redefinition is applied only to selected figure or table environments.

\setcapindent{indent }
\setcapindent*{xindent }
\setcaphanging
As mentioned previously, in the standard classes the captions are set in a non-hanging style.
In other words, in multi-line captions the second and subsequent lines start directly beneath
the label. The standard classes provide no direct mechanism to change this behaviour. In
KOMA-Script, on the contrary, beginning at the second line all lines are indented by the width
of the label so that the caption text is aligned.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 139

KOMA - Script KOMA - Script

Figure 3.7.: With the default setting, like Figure 3.8.: With partially hanging inden-
using \setcaphanging tation starting from the second line by us-
ing \setcapindent{1em}

KOMA - Script KOMA - Script

Figure 3.9.: Figure 3.10.:


With hanging indentation starting from With indentation only in the second line
the second line and line break before the and a line break before the description using
description using \setcapindent*{1em} \setcapindent{-1em}

You can change this behaviour, which corresponds to using \setcaphanging, at any time
with the \setcapindent or \setcapindent* command. Here the parameter indent deter-
mines the indentation of the second and subsequent lines. If you want a line break after the
label and before the caption text, then you can define the indentation xindent of the caption
text with the starred version of the command instead: \setcapindent*.
A negative value of indent , on the other hand, results in a line break before the caption
text, and only the first line of the caption text, not subsequent lines, is indented by the absolute
value of indent .
Whether one-line captions are set the same way as multi-line captions or are treated sep-
arately is specified with the option captions. For details please refer to the explanations of
this option on page 128.

Example: The illustrations 3.7 to 3.10 show the effects of different settings. As you can
see, using a fully hanging indentation with a narrow column width is awkward. To
illustrate, the source code for the second figure is given here with a modified caption
text:
\begin{figure}
\setcapindent{1em}
\fbox{\parbox{.95\linewidth}{\centering{\KOMAScript}}}
\caption{Example with partially indented caption
starting from the second line}
\end{figure}
As you can see, the formatting can also be changed locally within the figure
environment. The change then affects only the current figure. Subsequent figures
once again use the default settings or global settings that you set, for example, in
the preamble. This also, of course, applies to tables.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 140

\setcapwidth[justification ]{width }
\setcapdynwidth[justification ]{width }
\setcapmargin[left margin ]{margin }
\setcapmargin*[inside margin ]{margin }
v2.8q Using these three commands, you can specify the width and justification of the caption text.
Normally, the entire text or column width is available for the caption.
With the \setcapwidth command, you can decrease this width . The mandatory argument
determines the maximum width of the caption. As an optional argument, you can supply
exactly one letter which specifies the horizontal justification. The possible justifications are
given in the following list:

l – left-justified

c – centred

r – right-aligned

i – aligned to the inner margin in two-sided printing

o – aligned to the outer margin in two-sided printing

Inside and outside justification corresponds to left-aligned and right-aligned justification, re-
spectively, in one-sided printing. Within longtable tables, inside and outside justification does
not work correctly. In particular, the captions on subsequent pages of such tables are aligned
according to the format of the caption on the first page of the table. This is a conceptual
problem in the implementation of the longtable package.
v3.20 Note that \setcapwidth immediately sets the width to the value of the width parameter at
the time of the assignment, as \setlength does. If you instead want to use the current value
of width when the caption is set, you should use \setcapdynwidth. There can be significant
differences in the result if, for example, you use lengths like \linewidth or other commands
as width arguments.
With the \setcapmargin command, instead of specifying the width of the caption text, you
can specify a margin to be set next to the caption text in addition to the normal text margin.
If you want margins with different widths on the left and right sides, you can use the optional
argument to specify a left margin that differs from margin . Instead of a left margin ,
the starred version \setcapmargin* defines an inside margin in a two-sided layout. The
same problem arises here with with inside and outside justification inside longtable tables that
occurs with \setcapwidth. Furthermore, using \setcapmargin or \setcapmargin* activates
the captions=nooneline option (see page 128) for captions which are typeset with this margin
setting.
You can also specify negative values for margin and left margin or inside margin . This
has the effect of making the caption protrude into the margin.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 141

Table 3.20.: Alignments for multi-line captions of floating en-


vironments c centred
j fully justified
l left justified
r right justified
C centred with ragged2e
J fully justified with ragged2e
L left justified with ragged2e
R right justified with ragged2e

\setcaptionalignment[float type ]{alignment }


v3.25 Normally, multi-line captions are fully justified. This corresponds to \setcaptionalignment
{j}. Sometimes, however, you want a different alignment, for example ragged right. An
appropriate change is possible at any time with \setcaptionalignment. You can specify
exactly one of the letters listed in table 3.20 for the alignment . If you specify an unknown
alignment , you will receive an error message.
The four possibilities with the ragged2e package are only available if that package was loaded
before you use \setcaptionalignment. Otherwise, they are converted to the corresponding
options without ragged2e. For safety reasons, a warning is issued in this case.
When using this command without the optional parameter, the result depends on whether
the call occurs inside our outside of a floating environment. Within a floating environment, the
alignment is then set for this floating environment. Outside, on the other hand, the optional
parameter is assumed to be empty.
Using this command with an empty optional parameter, or outside a floating environment
and also without any optional parameter, sets the general alignment. This is used whenever
the current floating environment type does not define an alignment.
If you only want to set the alignment of a particular type of floating environment without
changing the alignment for other types of floating environments, then the type of floating
environment, e. g., figure or table, is given as the optional parameter float type .

Example: You want captions to be centred under the images even if they are multi-line. To
text this for a single image, use:
\begin{figure}
\centering
\setcaptionalignment{c}
\includegraphics{example-image}
\caption{\blindtext}
\end{figure}
Since you are satisfied with the result, you move the
\setcaptionalignment{c}
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 142

command to the document preamble. Thereafter, however, you decide you do not
like this change for table captions at all. Therefore, you use
\setcaptionalignment[figure]{c}
to limit the centring to figures.
A little later, you realize that the centring is not so suitable. Instead, you now
prefer to have ragged right alignment. So you change the alignment again:
\setcaptionalignment[figure]{l}
However, you do not like the fact that the lines are very different in length. This
is caused by the lack of hyphenation, causing long words to wrap completely onto
the next line, leaving large gaps. You want to allow hyphenation as needed. This
is easy to achieve with the help of the ragged2e package. However, it is not enough
to use
\usepackage{ragged2e}
to load the package. Using the newcommands option when loading the package does
not help. Instead, the alignment must also be changed:
\usepackage{ragged2e}
\setcaptionalignment[figure]{L}
Note the upper-case letter for the alignment .

origlongtable
If you do not want the table captions produced by the longtable package (see [Car04]) to
be redefined by the KOMA - Script classes, activate the origlongtable option. This option
must be used in the optional argument of \documentclass. It cannot be used as a setting of
\KOMAoptions or \KOMAoption.

listof=setting
v3.00 Normally lists of floating environments — like tables or figures — are neither numbered nor
included in the table of contents. You can find more information about this behaviour
in section 3.9. As an alternative to the settings toc=nolistof, toc=listof, and toc=
listofnumbered mentioned there, you can also look at this behaviour from perspective of
the lists themselves. Therefore you can achieve the same results with the settings listof=
notoc, listof=totoc, and listof=numbered.
By default, the headings in the lists of floating environments use the topmost level below
\part. This is the chapter level in scrbook and scrreprt and the section level in scrartcl.
v3.15
v3.06 By contrast, listof=leveldown uses the next lower level to be used instead. listof=
standardlevel switches back to the default sectioning level, if necessary.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 143

Example: In a book, you want to put the list of figures and the list of tables as sub-lists into
a common list named “Figures and Tables”. Simply use:
\KOMAoption{listof}{leveldown}
to use the section instead of the chapter level for both lists, and put the following
at the appropriate place in your document:
\addchap*{Figures and Tables}
\listoffigures
\listoftables
You can find more information about the \addchap* command in section 3.16 on
page 106.
v2.8q Normally the lists of floating environments use a fixed-width space for the caption number of
the entries. At the same time, all entries are somewhat indented. This behaviour corresponds
to the listof=graduated setting.
If the numbers become very wide, for example because you have many tables or figures,
the space provided may at some point no longer be sufficient. KOMA - Script offers the set-
ting listof=flat for lists of floating environments, comparable to toc=flat for the table of
contents. The width required to print the number is determined automatically and the space
is adjusted accordingly. See the toc=flat option, section 3.9, page 73 for more information
about side effects and how it works. Note again that you need more than one LATEX run before
the lists of floating environments reach their final state.
v3.06 The listof=entryprefix setting automatically activates listof=flat too. Normally, it
does not make sense to add a prefix such as “figure” or “table” to each entry in the lists of
floating environments because, of course, only figures are included in the list of figures and only
tables are included in the list of tables. Such a prefix provides no additional information and is
thus omitted by default. However, you can add such prefixes using the listof=entryprefix
option. With this, all entries in the same list will get the same prefix. The prefix depends on
the file extension of the auxiliary file that is used for the corresponding list. For the list of
figures, the file extension is “lof” and therefore \listoflofentryname is used. For the list
of tables, the file extension is “lot” and \listoflotentryname is used.
scrbook, For the scrbook and scrreprt classes, KOMA - Script adds a vertical space to the lists of
scrreprt floating environments whenever a new chapter starts. This behaviour, which also exists in
the standard classes, groups the lists by chapters. In KOMA - Script, it corresponds to setting
v3.00 listof=chaptergapsmall. In this case, is uses a fixed vertical space of 10 pt. With the
listof=chaptergapline option, you instead get a vertical space the height of one standard
text line. With listof=nochaptergap, you can completely remove the vertical space. The
listof=chapterentry option is a special feature. Instead of a vertical space, the table of
contents entry for the chapter is inserted into the lists of floating environments. Note that this
happens even if the chapter does not contain a floating environment. You can find a method
where only chapters containing floating environments appear in the respective lists at [Koh15].
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 144

You can achieve a more direct control over what appears in the lists of floating environments
with the chapteratlists option, which is explained in section 3.16, on page 100.
You can find an overview of all settings for the listof option in table 3.21.

Table 3.21.: Available values for the listof option for modifying the format and contents of the lists
of floating environments

chapterentry, withchapterentry
Indicates the beginning of chapters in the lists of floating environments with copies
of their table-of-contents entries.
chaptergapline, onelinechaptergap
Indicates the beginning of chapters in the lists of floating environments with a vertical
space the height of one standard text line.
chaptergapsmall, smallchaptergap
Indicates the beginning of chapters in the lists of floating environments with a small
vertical space.
entryprefix
v3.06 Adds a prefix before the number of each floating-environment list entry. The prefix
is usually language-dependent, e. g., in English “Figure” is used for the list of figures
and “Table” for the list of tables, each followed by a white space.
flat, left
Prints the lists of floating environments in tabular form. The caption numbers are
the first column, the caption texts the second column, and the page numbers the
third column. The space reserved for the caption numbers depends on the previous
LATEX run.
graduated, indent, indented
Prints the lists of floating environments in a hierarchical form. The space reserved
for the caption numbers is limited.
leveldown
Uses headings that are one level lower in the sectioning hierarchy than the default
for lists of floating environments.
...
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 145

Table 3.21.: Available values for the listof option (continued)

indenttextentries, indentunnumbered, numberline


v3.12 The numberline property (see section 15.2, page 385) is set for the lists of floating
environments such as figures and tables. As a result, unnumbered entries are left-
aligned with the text of numbered entries of the same level. However, the KOMA -
Script classes themselves do not put unnumbered entries in these lists. This option
therefore affects only entries that are generated not by the KOMA - Script classes
themselves but with the help of \addxcontentsline (see section 15.2, page 380).
leftaligntextentries, leftalignunnumbered, nonumberline
v3.12 The nonumberline property (see section 15.2, page 385) is set for the lists of floating
environments. This will place unnumbered entries left-aligned with the number
of numbered entries. However, the KOMA - Script classes themselves do not put
unnumbered entries in these lists. This option therefore affects only entries that
are generated not by the KOMA - Script classes themselves but with the help of
\addxcontentsline (see section 15.2, page 380).
nochaptergap, ignorechapter
The beginnings of chapters are not marked in the lists of floating environments.
notoc, nottotoc, plainheading
The lists of floating environments do not generate entries in the table of contents.
numbered, totocnumbered, tocnumbered, numberedtoc, numberedtotoc
The lists of floating environments receive numbered entries in the table of contents.
standardlevel
The lists use the normal sectioning level.
totoc, toc, notnumbered
The lists of floating environment generate entries in the table of contents, but their
headings are unnumbered.

\listoftables
\listoffigures
These commands generate a list of tables or figures. Changes affecting these lists will re-
quire two LATEX runs to take effect. The layout of the lists can be influenced by the listof
option with the values graduated or flat (see page 142). In addition, the listof and
listofnumbered values of the toc option (see section 3.9), as well as the totoc and numbered
values of the listof option described above indirectly affect these lists.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 146

As a rule, you will find the lists of the floating environments immediately after the table of
contents. In some documents, they go into the appendix. However, the author of this guide
prefers them immediately after the table of contents.

3.21. Marginal Notes

In addition to the text area, which normally fills the type area, documents often contain a
column for marginalia. You can set marginal notes in this area. This guide makes frequent
use of them.

\marginpar[margin note left ]{margin note }


\marginline{margin note }
Marginal notes in LATEX are usually inserted with the \marginpar command. They are placed
in the outer margin. One-sided documents use the right border. Although you can specify
a different marginal note for \marginpar in case it winds up in the left margin, marginal
notes are always fully justified. However, experience has shown that many users prefer left- or
right-justified marginal notes instead. For this purpose, KOMA - Script offers the \marginline
command.

Example: In some parts of this guide, the class name scrartcl can be found in the margin. You
can produce this with:
\marginline{\texttt{scrartcl}}
Instead of \marginline you could have used \marginpar. In fact the first command
is implemented internally as:
\marginpar[\raggedleft\texttt{scrartcl}]
{\raggedright\texttt{scrartcl}}
Thus \marginline is really just a shorthand notation for the code above.

Advanced users will find notes about difficulties that can arise using \marginpar in sec-
tion 21.1. These remarks also apply to \marginline. In addition, chapter 19 introduces a
package that you can use to create note columns with their own page breaks.

3.22. Appendix

The appendix of a document mostly consists of supplements to the document. Typical parts of
an appendix include a bibliography, an index, and a glossary. However you should not start an
appendix for these parts alone because their format already distinguishes them from the main
document. But if there are additional elements in the appendix, such as quoted third-party
documents, endnotes, figures, or tabulars, the standard elements such as the bibliography
should also be part of the appendix.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 147

\appendix
The appendix is started in the standard as well as the KOMA - Script classes with \appendix.
Among other things, this command changes the chapter numbering to upper-case letters while
ensuring that the rules according to [DUD96] for numbering the sectioning levels are followed
(for German-speaking regions). These rules are explained in more detail in the description of
the numbers option in section 3.16, page 99.
scrbook, The format of the chapter headings in the appendix is influenced by the chapterprefix
scrreprt and appendixprefix options. See section 3.16, page 96 for more information.
Please note that \appendix is a command, not an environment! This command does not
expect an argument. Chapters and sections in the appendix use \chapter and \section, just
as in the main text.

3.23. Bibliography

The bibliography makes external sources accessible. As a rule, the bibliography is created
from an external file with a database-like structure using the BIBTEX program. You can use
the BIBTEX style to change both the format of the entries and their sorting. If you use an
additional bibliography package like natbib, babelbib, or biblatex, KOMA - Script’s influence
over the bibliography disappears. In such cases, you must follow the manual of the relevant
bibliography package. You can find general information about bibliographies in [OPHS11].

bibliography=setting
v3.00 For a start, you can select any predefined bibliography style in setting . There are two such
bibliography styles predefined in KOMA - Script. You should not confuse them with the styles
used by BIBTEX, which you select with \bibstyle. While BIBTEX determines both the sorting
and the contents of the bibliography, KOMA - Script influences only some basic features of the
bibliography and few properties of the entry format.
The bibliography=oldstyle option selects a compact format for bibliography entries. In
this case, using the \newblock command results in only a small glue between the entries.
The name comes from the fact that this is the most common classic form of a bibliography.
In contrast, the bibliography=openstyle setting selects a more modern and open kind of
bibliography. The name comes from the fact that the \newblock command inserts a paragraph
break. The bibliography entries appear more structured. They are less compact and seem
more relaxed or open. Information about defining new bibliography styles can be found in the
description of the \newbibstyle command in section 21.9, page 503.
In addition to the formatting style, you can select one more feature using setting . The
bibliography is a kind of list of contents. But instead of listing the contents of the document
itself, it references external works. With this reasoning, you could argue that the bibliography
is a separate chapter or section and therefore deserves a chapter or section number. The
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 148

Table 3.22.: Predefined values for the bibliography option for setting the bibliography format

leveldown
v3.12 The bibliography uses a sectioning command one level lower than the default.
notoc, nottotoc, plainheading
The bibliography receives neither an entry in the table of contents nor a number.
numbered, tocnumbered, totocnumbered, numberedtoc, numberedtotoc
The bibliography receives an entry in the table of contents and a number.
oldstyle
The bibliography uses the classic, compact formation, where \newblock generates
only a horizontal glue.
openstyle
The bibliography uses the structured, open format where \newblock generates a
paragraph break.
standardlevel
v3.12 The bibliography uses the standard sectioning command level.
toc, totoc, notnumbered
The bibliography receives an entry in the table of contents but no number.

bibliography=numbered setting does exactly that, including creating an entry in the table
of contents. In my opinion, a traditional, annotated source list should by this reasoning be a
separate chapter too. Moreover, the bibliography is ultimately nothing you’ve written yourself
and so merits at most an unnumbered entry in the table of contents, which is achieved with
the bibliography=totoc option. The default setting, where the bibliography is produced as
an unnumbered chapter and does not receive an entry in the table of contents corresponds to
bibliography=nottotoc. For more information, see the toc option in section 3.9, especially
the bibliographynumbered, bibliography, andnobibliography values for this option on
page 73.
v3.12 Sometimes a document made using scrbook or scrreprt will have a bibliography for every
chapter rather than one bibliography for the whole document. In that case, it makes sense
for the bibliography itself to be not a chapter but a section. You can achieve this using
the bibliography=leveldown option. You can also use this if you want the bibliography to
appear with other lists under a common heading, therefore this option is also available with
scrartcl.
You can find a summary of available values for the bibliography option in table 3.22. Note,
however, that you can define new values with \newbibstyle.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 149

\setbibpreamble{preamble }
You can use the \setbibpreamble command to set a preamble for the bibliography. This
preamble must be placed before the command for issuing the bibliography. However, it need
not be directly in front of it. For example, it could be placed at the beginning of the document.
Like the bibliography=totoc and bibliography=totocnumbered options, this command
only works if you have not loaded a package which prevents this from happening by redefining
the thebibliography environment. Although the natbib package uses undocumented, internal
KOMA-Script macros, \setbibpreamble could still work with the current version of natbib
(see [Dal10]).
Example: You want to point out that the bibliographical references are sorted alphabetically
by the names of the authors. You therefore use the following command:
\setbibpreamble{References are in alphabetical order.
References with more than one author are sorted
according to the first author.\par\bigskip}
The \bigskip command ensures that the preamble and the first reference are sep-
arated by a large vertical space.

\BreakBibliography{interruption code }
v3.00 This command exists only if the environment thebibliography has not been redefined by
another package. With this instruction, you can insert a break into the bibliography. The
interruption code will be expanded inside a group. Such a break may be, for example, a
heading using \minisec. Unfortunately there is currently no way to have this command auto-
matically generated, for example by using a special entry in the BIBTEX database. Therefore,
it can currently only be used by users who edit the bibliography directly. For this reason, its
usefulness is very limited.

\AfterBibliographyPreamble{code }
\AtEndBibliography{code }
v3.00 In some cases, it may be useful to add some code after the bibliography preamble or just
before the end of the bibliography. This is possible with the help of these two instructions.
Example: You want to set the bibliography not justified but ragged right. You can achieve
this with:
\AfterBibliographyPreamble{\raggedright}
You can put this instruction anywhere before the bibliography. However, it is
recommended to do so in the preamble of the document or a separate package.
The functionality of this instruction depends on cooperation with packages modifying the
bibliography, if you use such a package.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 150

Table 3.23.: Available values for the index option

leveldown
v3.18 The index is moved down by one sectioning level.
notoc, nottotoc, plainheading
The index does not receive an entry in the table of contents.
numbered, tocnumbered, totocnumbered, numberedtoc, numberedtotoc
v3.18 The index receives an entry in the table of contents and is numbered.
standardlevel
v3.18 The index is at the usual sectioning level.
toc, totoc, notnumbered
The index receives an entry in the table of contents without being numbered.

3.24. Index

For general information about making a keyword index, see [OPHS11], [Lam87], and [Keh97].
Using a package that redefines commands or environments for the index KOMA - Script’s ability
to influence the index may disappear. This applies, for example, when using the index package,
but not when using the splitidx package (see [Koh14]).

index=setting
v3.00 By default or with index=default, the index is an unnumbered chapter (scrbook or scrreprt)
or section (scrartcl) without an entry in the table of contents. Since the index usually comes
last in a book or similar document, it does not actually need an entry in the table of contents.
Nevertheless, if you want to do this, for example because you are working with a multi-index
keyword dictionary such as the one that appears in this guide, you can create this with the
v3.18 index=totoc option. You can even number the index using the index=numbered setting. See
also the toc option with the index or indexnumbered values in section 3.9 starting at page 73.
For example, if you create multiple indexes with splitidx (see [Koh14]), it may be useful to
v3.18 group them under a common heading. To make this possible, index=leveldown places the
index one sectioning level deeper than usual. In scrbook and scrreprt, it is no longer a chapter
v3.18 but a section; with scrartcl, a subsection. The index=standardlevel option is the counterpart
to this and cancels any instance of index=leveldown used previously.
You can find a summary of the available values for the setting of index in table 3.23.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl 151

\setindexpreamble{preamble }
As with the bibliography, you can also provide a preamble to the index. This is often the case
if you have more than one index or if you mark different kinds of references by highlighting
the page numbers in different ways.

Example: You have a document in which terms are both defined and used. The page numbers
of definitions are in bold. Of course you want to make your reader aware of this
fact. Thus you insert a preamble for the index:
\setindexpreamble{All page numbers printed in \textbf{bold}
refer to definitions of terms. Page numbers printed
normally refer to pages where the term is used.\par\bigskip}

Note that the page style is changed for the first page of the index. The page style that is
applied is defined in the macro \indexpagestyle (see section 3.12, page 84).
The usual LATEX packages and additional programs are responsible for creating, sorting, and
outputting the index. KOMA - Script, like the standard classes, provides only the basic macros
and environments for them.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 152

Letters with the scrlttr2 Class or the scrletter Package

Letters are quite different in many ways from articles, reports, books, and the like. That alone
justifies a separate chapter on letters. But there are other reasons for a separate chapter on
scrlttr2 and scrletter.
The scrlttr2 class was developed from scratch in 2002. It provides a completely new user
interface, different from every other class I know. This new user interface may be unusual,
but it offers benefits to both new and experienced KOMA - Script users.
v3.15 The scrletter package has supplemented KOMA - Script since Version 3.15. It also provides
all the letter-based functionality of scrlttr2 to the other classes. I recommend you use one of
the KOMA-Script classes — scrbook, scrreprt or scrartcl — which are explained in the previous
chapter. With minor limitations, scrletter also works well with the standard classes.
The starting point for developing scrletter was, on the one hand, requests from users who also
wanted to have elements such as section headings, floating environments, or a bibliography in
letters. On the other hand, there were also requests to use scrlttr2 variables in the remaining
KOMA-Script classes. You can achieve both by combining the desired KOMA - Script class
with scrletter.
Compared to the letter class, the letter package has a few small changes that were necessary
to avoid conflicts with other classes. These changes mainly affect the page styles and are
explicitly documented (see section 4.13, starting at page 228). Where scrletter is not explicitly
mentioned, everything that is documented for scrlttr2 applies without change.

4.1. Early or Late Selection of Options

The information in section 2.4 applies equally to this chapter. So if you have already read and
understood section 2.4, you can skip ahead to section 4.2, page 153.

\documentclass[option list ]{KOMA - Script class }


\usepackage[option list ]{package list }
LATEX allows users to pass class options as a comma-separated list of keywords in the optional
argument to \documentclass. In addition to being passed to the class, these options are also
passed on to all packages that can understand them. Users can also pass a similar comma-
v3.00 separated list of keywords in the optional argument of \usepackage. KOMA - Script extends
the option mechanism for the KOMA - Script classes and some packages with further options.
Thus most KOMA - Script options can also take a value, so an option does not necessarily
take the form option , but can also take the form option =value . Except for this difference,
\documentclass and \usepackage in KOMA - Script function as described in [Tea05b] or any
introduction to LATEX, for example [OPHS11].
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 153

When using a KOMA - Script class, you should not specify options when loading the typearea
or scrbase packages. The reason for this restriction is that the class already loads these
packages without options, and LATEX refuses to load a package multiple times with different
option settings. In general, it is not necessary to load either one of these packages explicitly
when using any KOMA - Script class.
Setting the options with \documentclass has one major disadvantage: unlike the interface
described below, the options in \documentclass are not robust. So commands, lengths,
counters, and similar constructs may break inside the optional argument of this command.
For example, with many non-KOMA - Script classes, using a LATEX length in the value of an
option results in an error. So if you want to use a LATEX length, counter, or command as part
of the value of an option, you should use \KOMAoptions or \KOMAoption. These commands
will be described next.

\KOMAoptions{option list }
\KOMAoption{option }{value list }
v3.00 KOMA-Script also provides the ability to change the values of most class and package options
even after loading the class or package. You can use the \KOMAoptions command to change
the values of a list of options, as in \documentclass or \usepackage. Each option in the
option list has the form option =value .
Some options also have a default value. If you do not specify a value, that is if you give the
option simply as option , then this default value will be used.
Some options can have several values simultaneously. For such options, it is possible, with
the help of \KOMAoption, to pass a list of values to a single option . The individual values
are given as a comma-separated value list .
KOMA-Script uses the commands \FamilyOptions and \FamilyOption with the family
“KOMA” to implement this ability. See part II, section 12.2, page 338.
Options set with \KOMAoptions or \KOMAoption will reach both the KOMA - Script class
and any previously loaded KOMA - Script packages that recognise these options. If an option
or a value is unknown, scrbase will report it as an error.

4.2. Compatibility with Earlier Versions of KOMA - Script

The information in section 2.5 applies equally to this chapter. However, this feature has
existed in scrlttr2 since version 2.9t, whereas scrletter does not offer it. So if you have already
read and understood section 2.5 you can skip ahead to page 154, page 154.
Those who produce their documents from source code typically attach the utmost impor-
tance to the fact that future LATEX runs will yield exactly the same result. In some cases,
however, improvements and bug fixes to the class will result in changes of behaviour, especially
to the layout. This, however, may be undesirable.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 154

version=value
version=first
version=last
scrlttr2
v2.9t Since Version 2.9t, scrlttr2 has been able to choose whether the source file should, as much
as possible, continue to produce exactly the same result within a LATEX run or should be
formatted according to the modifications of the latest version of the class. You can specify
the version with which you want your file to be compatible by using the version option.
Compatibility with the oldest supported KOMA - Script version can be achieved with version=
first or version=2.9 or version=2.9t. Setting value to an unknown release number will
result in a warning message and selects version=first for safety.
With version=last, you can select the latest version. In this case, you give up backwards
v3.01a compatibility. If the option is used without a value, last is assumed. This also corresponds
to the default setting, as long as you do not use any deprecated options.
If you use a deprecated option of KOMA - Script 2, KOMA - Script 3 will switch to version=
first automatically. This will also result in a warning message that explains how to prevent
this switch. Alternatively, you can choose a different setting for version with the desired
compatibility after the deprecated option.
Compatibility is primarily a question of line and page breaks (wrapping). If you choose
compatibility with an older version, new options that do not affect wrapping are still avail-
able. The version option does not affect any wrapping changes that are the result of fixing
unambiguous errors. If you need unconditional wrapping compatibility even in the case of
bugs, you should physically save the old KOMA - Script version you need together with your
document.

Example: The example letters in this chapter should use all the features of the latest version of
KOMA - Script. For this, the we set the compatibility correspondingly when loading
the class:
\documentclass[version=last]{scrlttr2}
In this case the symbolic value last has been used to select the latest version.Here,
the latest version was simply chosen with the symbolic value last.

Note that you cannot change the version option after loading the class. Setting this option
with \KOMAoptions or \KOMAoption will therefore cause an error.

4.3. Draft Mode

scrlttr2 The information in section 3.3 applies equally to scrlttr2. So if you have already read and
understood section 3.3, you can skip ahead to section 4.4 on page 155. The scrletter package
does not provide a draft mode itself but relies upon the class you use.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 155

Many classes and packages provide a draft mode in addition to the normal typesetting
mode. The differences between these two are as diverse as the classes and packages that offer
this distinction.

draft=simple switch
overfullrule=simple switch
scrlttr2
v3.00 The draft option distinguishes between documents being drafted and finished documents.
The simple switch can be one of the standard values for simple switches from table 2.5,
page 42. If you activate this option, small black boxes will be output at the end of overly
long lines. These boxes make it easier for the untrained eye to locate the paragraphs that
require manual post-processing. By contrast, the default, draft=false, shows no such boxes.
Incidentally, such lines often disappear when you use the microtype package [Sch13].
v3.25 Since the draft option can lead to all sorts of unwanted effects with various packages,
KOMA-Script allows you to control this marking of overly long lines separately with the
overfullrule option. If this option is enabled, the marker is again displayed.

4.4. Page Layout

Each page of a document consists of different layout elements, such as the margins, the header,
the footer, the text area, the marginal note column, and the distances between these elements.
KOMA-Script additionally distinguishes the entire page, also known as the paper, and the
visible page. Without doubt, the separation of the page into these different parts is one of
scrlttr2 the basic features of a class. KOMA - Script delegates this work to the package typearea. This
package can also be used with other classes. The KOMA - Script classes, however, load typearea
on their own. Therefore, it’s neither necessary nor sensible to load the package explicitly with
\usepackage while using a KOMA - Script class. See also section 4.1, page 152.
Some settings of KOMA - Script classes affect the page layout and vice versa. Those effects
are documented at the corresponding settings.
For more information about the choice of paper format, the division of the page into margins
and type area, and the choice between one- and two-column typesetting, see the documentation
for the typearea package. You can find it in chapter 2, starting on page 28.
For letters, it is normally not useful to distinguish one-sided and two-sided printing. Since
letters are not usually bound, each page of a letter will be viewed on its own. This is also
true even if both the letter is printed on both sides of the paper. Vertical adjustment usually
does not matter for letters either. If you nevertheless need it, or want to understand what it
is, please refer to the commands \raggedbottom and \flushbottom explained in section 3.4
on page 58.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 156

4.5. Variables

In addition to options, commands, environments, counters, and lengths, chapter 3 introduced


the concept of additional elements for KOMA - Script. A typical property of an element is
its font style and the ability to change it (see section 4.9, page 180). In this section we
introduce variables. Variables can have a label used to identify them when they are output in
the document as well as their actual content. To avoid confusion with labels used for cross-
references, this guide refers to such labels as the “description” of the variable. The content
of a variable can be set independently of the time and place it is used the same way that the
content of a command can be defined separately from its use. The main difference between
a command and a variable is that a command usually triggers an action, whereas a variable
usually consists of plain text which is then output by a command. In addition, a variable can
also have a description which can be customised and output.
This section deliberately confines itself to introducing the concept of variables. The examples
below have no special meaning. More detailed examples can be found in the explanation of
predefined variables used in the class and the package. An overview of all defined variables is
given in table 4.1.

Table 4.1.: Supported variables in scrlttr2 and scrletter

addresseeimage
commands used to print the postpaid postmark for the addrfield=
backgroundimage option or the postpaid address for the addrfield=image
option (section 4.10, page 204)
backaddress
return address for window envelopes (section 4.10, page 204)
backaddressseparator
separator within the return address (section 4.10, page 204)
ccseparator
separator between title of additional addresses (cc list) and additional addresses
(section 4.7, page 176)
customer
customer number (section 4.10, page 214)
date
date (section 4.10, page 213)
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 157

Table 4.1.: Supported variables in scrlttr2 and scrletter (continued)

emailseparator
separator between email name and email address (section 4.10, page 197)
enclseparator
separator between title of enclosure and enclosures (section 4.7, page 176)
faxseparator
separator between title of fax and fax number (section 4.10, page 197)
firstfoot
v3.08 footer of the letterhead page (section 4.10, page 224)
firsthead
v3.08 header of the letterhead page (section 4.10, page 202)
fromaddress
sender’s address without sender name (section 4.10, page 191)
frombank
sender’s bank details (section 4.10, page 225)
fromemail
sender’s e-mail (section 4.10, page 197)
fromfax
sender’s fax number (section 4.10, page 197)
fromlogo
commands for inserting the sender’s logo (section 4.10, page 201)
frommobilephone
v3.12 sender’s mobile telephone number (section 4.10, page 197)
fromname
complete name of sender (section 4.10, page 191)
fromphone
sender’s telephone number (section 4.10, page 197)
fromurl
URL of the sender, e. g. of the sender’s homepage (section 4.10, page 197)
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 158

Table 4.1.: Supported variables in scrlttr2 and scrletter (continued)

fromzipcode
ZIP code (postal code) of the sender for the postpaid postmark of the addrfield=
PP option (section 4.10, page 204)
invoice
invoice number (section 4.10, page 214)
location
extra details of the sender (section 4.10, page 210)
myref
sender’s reference (section 4.10, page 214)
nextfoot
v3.08 footer using page style headings or myheadings (section 4.13, page 232)
nexthead
v3.08 header using page style headings or myheadings (section 4.13, page 232)
phoneseparator
separator between title of telephone and telephone number (section 4.10, page 197)
place
sender’s location; used next to date (section 4.10, page 204)
placeseparator
separator between location and date (section 4.10, page 214)
PPdatamatrix
command to print the data array for the addrfield=PP option (section 4.10,
page 204)
PPcode
commands for the sender’s identification code for the addrfield=PP option (sec-
tion 4.10, page 204)
signature
signature annotation beneath the closing text of the letter (section 4.10.7, page 221)
specialmail
delivery method (section 4.10, page 204)
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 159

Table 4.1.: Supported variables in scrlttr2 and scrletter (continued)

subject
letter’s subject (section 4.10, page 218)
subjectseparator
separator between subject title and subject (section 4.10, page 218)
title
letter title (section 4.10, page 217)
toaddress
address of recipient without recipient name (section 4.10, page 204)
toname
complete name of recipient (section 4.10, page 204)
yourmail
date of recipient’s referenced mail (section 4.10, page 214)
yourref
recipient’s reference (section 4.10, page 214)
zipcodeseparator
separator between the title of ZIP code (postal code) and the code itself (section 4.10,
page 204)

\setkomavar{name }[description ]{content }


\setkomavar*{name }{description }
The \setkomavar command sets the content of the name variable. Using the optional ar-
gument, you can change the description of the variable at the same time. In contrast,
\setkomavar* sets only the description of the name variable.

Example: It is customary for letters to indicate the sender in the letterhead. First, KOMA -
Script must know the name of the sender. For “Joe Public” that would be done
with:
\setkomavar{fromname}{Joe Public}
The default for the description of the sender is “From”. Assuming, however, that
Mr Public wants to have “Sender” in the places where KOMA - Script outputs his
name, he would have to add
\setkomavar*{fromname}{Sender}
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 160

or combine the two commands into one:


\setkomavar{fromname}[Sender]{Joe Public}
He thus kills two birds with one stone, so to speak.

By the way, you can delete the content of the variable by providing an empty content argu-
ment. Of course, you can delete the description of the variable in the same way, with an
empty argument for the description.

Example: Suppose Mr Public wants to have no label for the name of the sender. He can either
delete it for himself with
\setkomavar*{fromname}{}
or he could again kill two birds with one stone and use
\setkomavar{fromname}[]{Joe Public}
This will simultaneously set the contents of the variable and delete its description.

\usekomavar[command ]{name }
\usekomavar*[command ]{name }
v2.9i In some cases, it is necessary to access the content or description of a variable and not to
leave this solely to the class. This is especially important if you have defined a variable which
is not added to the reference fields line. Using the command \usekomavar you have access
to the content of the name variable, whereas the starred version \usekomavar* allows you to
access the description or title. In section 22.1, page 505 you can find more information about
defining your own variables.

\Ifkomavar{name }{then code }{else code }


v3.28
v3.03 With this command, you can determine if a variable has already been defined. The then
code will be executed only if the variable already exists. The variable’s contents will not be
examined and so can be empty. The else code will be executed if the variable does not exist.
Such tests can be useful, for example, if your own variables are defined in one lco file (see
section 4.20 starting at page 242) but used in another lco file only if they exist.

\Ifkomavarempty{name }{then code }{else code }


\Ifkomavarempty*{name }{then code }{else code }
v2.9i
v3.28 With these commands, you can determine whether either the content or the description of a
variable is empty. The then code will be executed if the expanded content or the expanded
description of the name variable is empty. Otherwise, the else code will be executed. The
starred variant tests the variable’s description, while the normal variant tests its contents.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 161

4.6. Pseudo-lengths

LATEX processes lengths with three commands: \newlength, \setlength and \addtolength.
Many packages also use macros, which are commands, to store lengths. KOMA - Script extends
this method with the ability to process such lengths stored in macros with commands similar
to those used to handle real lengths. KOMA - Script calls lengths that are actually stored in
macros pseudo-lengths.
Note that even though these pseudo-lengths are internally implemented as macros, the
commands for pseudo-length management expect only the names of the pseudo-lengths not
the macros representing the pseudo-lengths. The names of pseudo-lengths are written without
the initial backslash, like the names of LATEX counters and unlike macros or LATEX lengths.
Historical TEX works with a fixed number of registers. There are registers for tokens, for boxes,
for counters, for skips, and for dimensions. Overall there are 256 registers for each of these
categories. For LATEX lengths, which are defined with \newlength, skip registers are used. Once
all these registers are in use, you can not define any more lengths. Both scrlttr2 and scrletter
would normally use more than 20 of these registers for the first page alone. LATEX itself already
uses 40 of these registers. The typearea package needs some of them too; thus, approximately a
quarter of these precious registers would already be in use. For this reason, in 2002 scrlttr2 stores
letter-specific lengths in macros instead of lengths.
Anyone who wants to argue that the recommended LATEX installation with ε-TEX, which is
required for KOMA - Script anyway, no longer suffers from the above-mentioned limitation would
be right. However, that improvement came too late for scrlttr2. With scrletter, the concept of
psuedo-lengths was adopted for reasons of compatibility.
The pseudo-lengths defined and uses by KOMA - Script are listed in table 4.2, which also
provides cross references to the detailed descriptions of each pseudo-lengths in the following
sub-sections.
A schematic display of the most important distances of the letterhead page is shown in
figure 4.1 on page 166. In addition to the pseudo-lengths for the configurable distances, some
non-configurable lengths are also shown in light gray. For the sake of clarity, however, some
rarely required pseudo-lengths have been omitted.

Table 4.2.: Pseudo-lengths provided by scrlttr2 and scrletter

backaddrheight
the height of the return address at the upper edge of the address field (section 4.10.3,
page 209)
bfoldmarklength
the length of the bottommost fold mark (section 4.10.1, page 188)
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 162

Table 4.2.: Pseudo-lengths provided by scrlttr2 and scrletter (continued)

bfoldmarkvpos
the vertical distance of the bottommost fold mark from the top edge of the paper
(section 4.10.1, page 188)
firstfoothpos
the horizontal distance of the letterhead page footer from the left edge of the paper;
values greater than the width of the paper or less than the negative value of the
width of the paper activate special handling (section 4.10.8, page 226)
firstfootvpos
the vertical distance of letterhead page footer from the top edge of the paper (sec-
tion 4.10.8, page 226)
firstfootwidth
the width of the letterhead page footer (section 4.10.8, page 226)
firstheadhpos
the horizontal distance of the letterhead from the left edge of the paper; values
greater than the width of the paper or less than the negative value of the width of
the paper activate special handling (section 4.10.2, page 191)
firstheadvpos
the vertical distance of the letterhead from the top edge of the paper (section 4.10.2,
page 191)
firstheadwidth
the width of the letterhead (section 4.10.2, page 191)
foldmarkhpos
the horizontal distance of the horizontal fold marks from the left edge of the paper
(section 4.10.1, page 189)
foldmarkvpos
the vertical distance of the vertical fold marks from the top edge of the paper (sec-
tion 4.10.1, page 190)
fromrulethickness
the thickness of an optional horizontal rule in the letterhead (section 4.10.2, page 195)
fromrulewidth
the length of an optional horizontal rule in the letterhead (section 4.10.2, page 195)
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 163

Table 4.2.: Pseudo-lengths provided by scrlttr2 and scrletter (continued)

lfoldmarkhpos
the horizontal distance of the vertical fold mark from the left edge of the paper
(section 4.10.1, page 189)
lfoldmarklength
the length of the vertical fold mark (section 4.10.1, page 190)
locheight
the height of the field containing the additional sender information if the value is
not 0; if it is 0, toaddrheight is used instead (section 4.10.4, page 211)
lochpos
the horizontal distance of the field containing the additional sender information; if
the value is positive, the distance is measured from the right paper edge; if negative,
from the left paper edge; if 0, the negative value of toaddrhpos is used instead
(section 4.10.4, page 211)
locvpos
the vertical distance of the field containing the additional sender information from
the top edge of the paper if the value is not 0; if it is 0, toaddrvpos is used instead
(section 4.10.4, page 211)
locwidth
the width of the field containing the additional sender information; if it is 0, the width
is calculated automatically based on the locfield option described in section 4.10,
page 210 (section 4.10.4, page 211)
mfoldmarklength
the length of the middle horizontal fold mark (section 4.10.1, page 189)
mfoldmarkvpos
the vertical distance of the middle horizontal fold mark from the top edge of the
paper (section 4.10.1, page 188)
pfoldmarklength
the length of the hole-punch mark (section 4.10.1, page 189)
PPdatamatrixvskip
the vertical distance between the postpaid header and the data array with
addrfield=PP (section 4.10.3, page 209)
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 164

Table 4.2.: Pseudo-lengths provided by scrlttr2 and scrletter (continued)

PPheadheight
the height of the postpaid header (section 4.10.3, page 209)
PPheadwidth
the width of the left postpaid field with addrfield=PP (section 4.10.3, page 209)
refaftervskip
vertical skip below reference-field line (section 4.10.5, page 217)
refhpos
the horizontal distance of reference-field line from the left edge of the paper; if
the value is 0, the reference-field line is centred horizontally on the letterhead page
(section 4.10.5, page 216)
refvpos
the vertical distance of reference-field line from the top edge of the paper (sec-
tion 4.10.5, page 216)
refwidth
the width of the reference-field line (section 4.10.5, page 216)
sigbeforevskip
the vertical skip between the closing and the signature (section 4.10.7, page 223)
sigindent
the indentation of the signature with respect to the text body (section 4.10.7,
page 223)
specialmailindent
the left indentation of the delivery method within the address field (section 4.10.3,
page 209)
specialmailrightindent
the right indentation of the delivery method within the address field (section 4.10.3,
page 209)
subjectaftervskip
the vertical skip after the subject (section 4.10.6, page 221)
subjectbeforevskip
additional vertical skip before the subject (section 4.10.6, page 221)
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 165

Table 4.2.: Pseudo-lengths provided by scrlttr2 and scrletter (continued)

subjectvpos
the vertical distance of the subject from the top edge of the paper; if it is 0, the
position is calculated based on the subject option (section 4.10.6, page 221)
tfoldmarklength
the length of the topmost horizontal fold mark (section 4.10.1, page 189)
tfoldmarkvpos
the vertical distance of the topmost horizontal folding mark from the top edge of the
paper (section 4.10.1, page 188)
toaddrheight
the height of the address field (section 4.10.3, page 208)
toaddrhpos
the horizontal distance of the address field from left edge of the paper, if the value
is positive; if it is negative, the negative horizontal distance of the address field from
the right edge of the paper (section 4.10.3, page 207)
toaddrindent
the left and right indentation of the address within the address field (section 4.10.3,
page 208)
toaddrvpos
the vertical distance of the address field from the the top edge of the paper (sec-
tion 4.10.3, page 207)
toaddrwidth
the width of the address field (section 4.10.3, page 208)

\newplength{name }
v3.26 This command defines a new pseudo-length. The new pseudo-length is uniquely identified
by its name . Each name can therefore be assigned only once. If you attempt to redefine an
existing pseudo-length, the commands exits with an error message.
Since the ordinary user does not normally need to define pseudo-lengths, this command was
not a user instruction until KOMA - Script 3.26. Before then, \@newplength existed with the
same functionality. This instruction still exists for package authors.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 166

firstheadhpos firstheadwidth firstheadvpos

letterhead
fromrulewidth

toaddrvpos locvpos
toaddrhpos toaddrwidth locwidth lochpos
return address backaddrheight
mode of dispatch specialmailrightindent
toaddrheight

specialmailindent

locheight
supplemental
data
addressee

toaddrindent toaddrindent
refvpos
refhpos refwidth

reference fields line


tfoldmarkvpos refaftervskip
title
\baselineskip +subjectbeforevskip
subject
subjectaftervskip
opening
\baselineskip

letter body

\baselineskip
sigindent closing
bfoldmarkvpos sigbeforevskip
signature

foldmarkhpos

≥\footskip

\textwidth
firstfootvpos
firstfootwidth

letter footer

firstfoothpos

Figure 4.1.: Schematic of the pseudo-lengths for a letter


Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 167

\Ifplength{pseudo-length }{then-code }{else-code }


v3.27 This command can be used to determine whether a pseudo-length has been defined. The
then-code is executed if the pseudo-length is defined and not \relax. Otherwise the
else-code is executed.
For reasons of consistency only, the internal command \if@plength, with the identical
meaning, exists for the use of package authors.

\useplength{name }
Using this command you can access the value of the pseudo-length of the given name . This
is one of the few user commands in connection with pseudo-lengths. Of course this command
can also be used with an lco file (see section 4.20 ab page 242).

\setplength[factor ]{pseudo-length }{value }


\addtoplength[factor ]{pseudo-length }{value }
Using \setplength, you can assign the multiple of a value to a pseudo-length . The factor
is given as an optional argument (see also \setlengthtoplength, section 4.6, page 168).
With \addtoplength you can add the multiple of a value to a pseudo-length . Again,
you can pass a factor as an optional argument.
To assign or to add the multiple of one pseudo-length to another pseudo-length, use the
\useplength command (see section 4.6, page 167) within the value . To subtract the value
of one pseudo-length from another pseudo-length , you use should use at the same time a
minus sign or -1 as the factor .
Since the ordinary user does not normally need to define pseudo-lengths, these com-
mands were not user instructions until KOMA - Script 3.26. Before then, \@setplength and
\@addtoplength existed with the same functionality. These commands still exist for the use
of package authors.

\setplengthtowidth[factor ]{pseudo-length }{content }


\setplengthtoheight[factor ]{pseudo-length }{content }
\setplengthtodepth[factor ]{pseudo-length }{content }
\setplengthtototalheight[factor ]{pseudo-length }{content }
v3.26 The first three commands essentially correspond with \settowidth, \settoheight, and
\settodepth from the LATEX kernel, but set pseudo-length s instead of lengths. Like
\setplength, these commands extend their LATEX kernel equivalents with an optional factor .
They set a pseudo-length to the natural width, height or depth of the given content , mul-
tiplied by the optional factor . The additional command \setplengthtototalheight sets
the pseudo-length to the sum of the height and depth of content multiplied by the optional
factor .
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 168

\documentclass[...]{scrlttr2}
...
settings for all letters
...
\begin{document}
...
settings for all letters
...

\begin{letter}{recipient }
...
content of the individual letter
...
Figure 4.2.: General structure \end{letter}
of a letter document containing ..
several individual letters (the .
structure of a single letter is \end{document}
shown in figure 4.3)

\setlengthtoplength[factor ]{length }{pseudo-length }


\addtolengthplength[factor ]{length }{pseudo-length }
With the \setlengthtoplength command, you can assign a multiple of a pseudo-length
to a real length . The factor is given as an optional argument instead of directly preced-
ing the pseudo-length . You should also use this command when you want to assign the
negative of a pseudo-length to a length . In this case, you can use either a minus sign or
-1 as the factor . The \addtolengthplength command works very similarly. It adds the
pseudo-length multiplied by the factor to the length .

4.7. General Structure of Letter Documents

The general structure of a letter document differs somewhat from the structure of a normal
document. Whereas a book document usually contains only one book, a letter document can
contain several letters. As illustrated in figure 4.2, a letter document consists of a preamble,
the individual letters, and the closing.
The preamble contains all the settings that apply generally to all letters. Most of them can
also be overwritten in the settings of the individual letters. The only setting which cannot
currently be changed within a single letter is the version of scrlttr2 for which compatibility is
required (see the version option in section 4.2, page 154).
If you use scrletter, the only difference is that another class is loaded, with \usepackage
{scrletter} added before the settings for all letters. For setting options with scrletter, see
section 4.1, on page 152.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 169

\begin{letter}[options ]{recipient }
...
settings for this letter
...
\opening{salutation }
...
letter text
...

\closing{concluding text }
\ps
...
postscript
...
\encl{enclosures }
Figure 4.3.: General structure \cc{additional recipients }
of a single letter within a letter \end{letter}
document (see also figure 4.2)

I recommended that you place only general settings such as loading packages and setting
options before \begin{document}. You should initialise all variables or other textual features
after \begin{document}, particularly when you use the babel package (see [BB13]) or change
language-dependent variables of scrlttr2.
The closing usually consists only of \end{document}. Of course you can also add additional
comments at this point.
As detailed in figure 4.3, individual letters each consist of an introduction, the body of the
letter, and the closing. In the introduction, all settings pertaining to the current letter alone
are defined. It is important that this introduction always ends with \opening. Similarly,
the closing always starts with \closing. The opening and closing arguments of the two
commands can be left empty, but both commands must be used and must have an argument.
Note that you can change additional settings between the individual letters. Such changes
then apply to all subsequent letters. However, to keep your letter documents clear and main-
tainable, you should think carefully before actually placing further general settings of limited
scope between the letters. I cannot recommend this practice. However, if you use scrletter2,
there is nothing wrong with inserting additional parts of the document between or after letters
that should not be in the same scope. For example, you can combine a cover letter and a CV
in one document.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 170

\begin{letter}[options ]{recipient } . . . \end{letter}


The letter environment is one of the key environments of the letter class. A noteworthy
feature of scrlttr2 and scrletter is that they can provide additional options for the letter
environment. These options are executed internally using the \KOMAoptions command.
The recipient , or addressee, is a mandatory argument passed to the letter environment
and includes both the name and the address of the recipient of the letter. Double backslashes
serve to separate the individual parts of the address. These parts are output on individual lines
in the address field. Nevertheless, you should not interpret the double backslash as a manda-
tory line break. Vertical material such as new paragraphs or vertical space is not permitted
within the address. They can lead to unexpected results and error messages. Incidentally, this
is the same for the standard letter class.

Example: Suppose you want to write a letter to Joanna Public. A minimalist letter document
would look like this:
\documentclass[version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ}
\end{letter}
\end{document}
However, this would not result in any output. It would not even print the recipient
on the letterhead page. Why this is the case is explained in the description of the
\opening command on page 172.

v3.27 Letters are always printed in single-column mode and without vertical adjustment. You
can use \flushbottom, explained in section 3.4 on page 58, together with \AtBeginLetter to
force a vertical adjustment.

\AtBeginLetter{code }
\AtEndLetter{code }
As mentioned in [Tea06], LATEX lets the user declare additional code to be executed at
certain points in a LATEX run. For this purpose, the LATEX kernel provides, for example,
\AtBeginDocument and \AtEndOfClass. Such points are called hooks. The scrlttr2 class and
the scrletter package provide two additional hooks. You can declare the code for these using
v2.95 \AtBeginLetter and \AtEndLetter. Originally, hooks were intended for package and class
authors, so they are documented only in [Tea06] and not in [Tea05b]. However, with letters
there are useful applications at the user level for both new hooks, as the following example
illustrates.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 171

Example: Suppose you have several letters in a document that use their own commands to
insert a questionnaire in the letters. The questions are numbered automatically
using a counter. Since KOMA - Script is unaware of this counter, it would not be
reset at the start of each new letter, unlike the page number. If each questionnaire
contains ten questions, the first question in the fifth letter would get the number 41.
You can solve this problem by telling KOMA - Script to reset this counter at the
beginning of each letter:
\newcounter{Question}
\newcommand{\Question}[1]{%
\refstepcounter{Question}\par
\noindent\begin{tabularx}{\textwidth}{l@{}X}
\theQuestion:~ & #1\\
\end{tabularx}%
}%
\AtBeginLetter{\setcounter{Question}{0}}
This way first question remains question 1, even in the 1001st letter. Of course the
definition in this example requires the tabularx package (see [Car99b]).

letter
\thisletter
\letterlastpage
v3.19 If you have more than one letter in a document, it is useful to have a letter number. For this
purpose, KOMA - Script has provided the letter counter, which is incremented by one at each
\begin{letter}, since version 3.19.

Example: Let’s return to the \AtBeginLetter example. Instead of resetting the counter
explicitly at \begin{letter}, we can do so implicitly by defining counter Question
to depend on counter letter:
\newcounter{Question}[letter]
\newcommand{\Question}[1]{%
\refstepcounter{Question}\par
\noindent\begin{tabularx}{\textwidth}{l@{}X}
\theQuestion:~ & #1\\
\end{tabularx}%
}%
Now the new counter will be reset at every start of each letter so that the first
question in each letter will be number one.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 172

If you want to display the current value of letter, this is possible, as usual, with
\theletter. The counter can also be used for cross-references. So you can use \label
{name } to generate a label immediately after \begin{letter} and reference it somewhere in
the document using \ref{name }. Inside the same letter you can get the same result by simply
using \thisletter without creating a label.
For labels in form letters, it is necessary to give them a unique name across all letters.
Once again, you can use \thisletter for this purpose. KOMA - Script also uses \thisletter
internally to put a label on the last page of each letter. This makes it possible to use
\letterlastpage to reference the number of the last page of the current letter at any point
within the letter. Since \letterlastpage uses \label and \pageref, it is only valid after
several LATEX runs — usually two or three. If you use \letterlastpage, pay attention to
the Rerun messages in the terminal output or log file messages about labels that have been
changed.

\opening{salutation }
This is one of the most important commands for letters. On the surface, it may seem that
only the salutation , for example “Dear Mrs . . . ”, is printed. Actually, this command also
prints the fold marks, the letterhead, the address, the extra sender information, the reference
line, the title, the subject, and the footer. In short, without \opening there is no letter. If, in
fact, you want to print a letter without a salutation, you have to use an \opening command
with an empty argument.

Example: Let’s return to the example of page 170 and add a salutation:
\documentclass[version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
\end{letter}
\end{document}
This will result in the letterhead shown in figure 4.4.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 173

Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

13th November 2021

Dear Madam Chair,

Figure 4.4.: result of a minimalist letter with recipient and


salutation only (the date is set by default)

\closing{concluding text }
The main purpose of the command \closing is to typeset the concluding text . This can
even consist of multiple lines. In that case, the individual lines should be separated by a
double backslash. Paragraph breaks inside the concluding text are not allowed.
In addition, this command also prints the content of the signature variable. You can find
more information about the signature and its configuration in section 4.10.7 on page 221.

Example: Let’s extend the our example with a few lines of text and a closing phrase:
\documentclass[version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 174

Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

13th November 2021

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

Figure 4.5.: result of a short letter with recipient, opening,


text, and closing (the date is set by default)

six months. For this reason, I call on the executive


board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\end{letter}
\end{document}
This will result in a the letter shown in figure 4.5.

\ps
This instruction merely switches to the postscript. To do so, a new paragraph begins, and
a vertical gap — usually below the signature — is inserted. The \ps text can be followed by
any text. If you want the postscript to be introduced with the acronym “PS:”, which in most
current usage is written without full stops, you have to type this yourself. This abbreviation
is printed neither automatically nor optionally by the scrlttr2 class.

Example: The sample letter with the addition of a postscript


\documentclass[version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{%
Joanna Public\\
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 175

Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

13th November 2021

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

PS: I hope you do not take this request amiss.

Figure 4.6.: result of a short letter with recipient, opening,


text, closing, and postscript (the date is set by default)

1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\end{letter}
\end{document}
results in figure 4.6.

When letters were written still by hand, it was quite common to use a postscript because this
was the only way to add information which had been forgotten in the main part of the letter. For
letters written with LATEX, of course, you can easily insert additional lines. Nevertheless, postscripts
remain popular. They can be useful to emphasize important points once more, or even to mention
the less important matters.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 176

\cc{distribution list }
\setkomavar{ccseparator}[description ]{contents }
You can print a distribution list with the \cc command. The command takes the
distribution list as its argument. If the content of the variable ccseparator is not
empty, the name and content of this variable are inserted before the distribution list .
In this case, the distribution list will be indented appropriately. It’s a good idea to set
the distribution list \raggedright and to separate the individual entries with a double
backslash.
Example: This time, the sample letter should go not only to the chairman but also to all club
members:
\documentclass[version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\cc{executive board\\all members}
\end{letter}
\end{document}
The result is shown in figure 4.7.
A vertical gap is inserted automatically before the distribution list.

\encl{enclosures }
\setkomavar{enclseparator}[description ]{contents }
The enclosures have the same structure as the distribution list. The only difference is that
the list of enclosures begins with the name and content of the enclseparator variable.
Example: To the sample letter we will attach an excerpt from the club’s articles of association.
These will be added as an enclosure. Because there is only one enclosure, we change
the description title accordingly:
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 177

Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

13th November 2021

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

PS: I hope you do not take this request amiss.

cc: executive board


all members

Figure 4.7.: result of a short letter with recipient, opening,


text, closing, postscript, and distribution list (the date is
set by default)

\documentclass[version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 178

Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

13th November 2021

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings

cc: executive board


all members

Figure 4.8.: result of a short letter with recipient, opening,


text, closing, postscript, distribution list, and enclosure (the
date is set by default)

This will result in figure 4.8.

4.8. Choosing the Document Font Size

scrlttr2 The information in section 3.5 applies equally to scrlttr2. By contrast, the scrletter package
by itself does not offer font-size selection but depends completely on the class you use. So if
you have already read and understood section 3.5, you can continue to page 179 at the end of
this section. If you use scrletter, you can skip directly to section 4.9, page 180.

fontsize=size
scrlttr2 While the standard classes support only a very limited number of font sizes, scrlttr2 provides
the ability to specify any size for the main font. You can also use any known TEXunit as a
unit for the size . If the size is specified without a unit, it is assumed to be pt.
If you set the option within the document, the main font size and the dependent font sizes of
the commands \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large,
\LARGE, \huge and \Huge are changed. This can be useful, for example, if you want another
letter to be set in a smaller font size.
Note that using this option after loading the class does not automatically recalculate the type
area and margins (see \recalctypearea, section 2.6, page 40). However, if this recalculation
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 179

is performed, it will be based on the current main font size. The effects of changing the main
font size upon other loaded packages or the class used depends on these packages and on the
class. You can encounter errors which are not the fault of KOMA - Script, and further, the
scrlttr2 class itself does not recalculate all lengths if the main font size changes after loading
the class.
This option should by no means be misinterpreted as a substitute for \fontsize (see
[Tea05a]). Also, you should not use it in place of one of the font size commands that are
relative to the main font, from \tiny to \Huge. For scrlttr2 the default is fontsize=12pt.

Example: Suppose the organization in the sample letter is the “Friends of Noxious Font Sizes”,
for which reason it should be set in 14 pt instead of 12 pt. You can achieve this by
making a small change to the first line:
\documentclass[version=last,fontsize=14pt]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
Alternatively, the option could be set as an optional argument to letter:
\documentclass[version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}[fontsize=14pt]{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 180

WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
Since the text area is not recalculated in this late change of the font size, the two
results differ in figure 4.9.

4.9. Text Markup

The information in in section 3.6 largely applies to this chapter. So if you have already read
and understood section 3.6, you can limit yourself to examining table 4.3, page 182 and then
skip ahead to section 4.10, page 185.
LATEX offers different possibilities for logical and direct markup of text. For more informa-
tion about the standard font facilities, see [OPHS11], [Tea05b], and [Tea05a].

\setkomafont{element }{commands }
\addtokomafont{element }{commands }
\usekomafont{element }
With the help of the \setkomafont and \addtokomafont commands, you can attach particular
font styling commands that change the appearance of a given element . Theoretically, all state-
ments, including literal text, can be used as commands . You should, however, limit yourself
to those statements that really change font attributes only. These are usually commands like
\rmfamily, \sffamily, \ttfamily, \upshape, \itshape, \slshape, \scshape, \mdseries,
\bfseries, \normalfont, as well as the font size commands \Huge, \huge, \LARGE, \Large,
\large, \normalsize, \small, \footnotesize, \scriptsize, and \tiny. You can find these
commands explained in [OPHS11], [Tea05b], or [Tea05a]. Colour switching commands like
\normalcolor (see [Car17] and [Ker07]) are also acceptable. The use of other commands, in
particular those that redefine things or or lead to output, is not supported. Strange behaviour
is possible in these cases and does not represent a bug.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 181

Joanna Public Joanna Public


1 Hillside 1 Hillside
SAMPLESTEAD SAMPLESTEAD
WX12 3YZ WX12 3YZ

13th November 2021 13th November 2021

Dear Madam Chair, Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind The last general meeting was more than a year ago. I would like to remind
you that the articles of our club stipulate that one should be held every you that the articles of our club stipulate that one should be held every six
six months. For this reason, I call on the executive board to arrange such months. For this reason, I call on the executive board to arrange such a meeting
a meeting immediately. immediately.

Anticipating an invitation Anticipating an invitation

PS: I hope you do not take this request amiss. PS: I hope you do not take this request amiss.
Enclosure: Excerpt from the articles governing general meetings Enclosure: Excerpt from the articles governing general meetings
cc: executive board cc: executive board
all members all members

Figure 4.9.: result of a short letter with recipient, opening, text, closing, postscript, enclosures, distri-
bution list, and a noxiously large font (the date is set by default): in the left-hand version,
the font size has been defined by the optional argument of letter; in the right-hand one,
the optional argument of \documentclass has been used

The command \setkomafont provides an element with a completely new definition of its
font styling. In contrast, the \addtokomafont command merely extends an existing definition.
You should not use either command inside the document body but only in the preamble. For
examples of their use, refer to the sections for the respective element. The name and meaning
of each element are listed in table 4.3 . The default values can be found in the corresponding
sections.
The \usekomafont command can be used to switch the current font style to the specified
Element .
You can find a general example that uses both \setkomafont and \usekomafont in sec-
tion 3.6 on page 60.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 182

Table 4.3.: Elements whose font style can be changed in the scrlttr2 class or the scrletter package with
the \setkomafont and \addtokomafont commands

addressee
recipient’s name and address in the address field (section 4.10, page 204)
backaddress
return address for a window envelope (section 4.10, page 204)
descriptionlabel
label, i. e. the optional argument of \item, in a description environment (sec-
tion 4.16, page 239)
foldmark
fold mark on the letterhead page; allows change of line colour (section 4.10, page 185)
footnote
footnote text and marker (section 4.15, page 235)
footnotelabel
footnote marker; applied in addition to the footnote element (section 4.15, page 235)
footnotereference
footnote reference in the text (section 4.15, page 235)
footnoterule
v3.07 horizontal rule above the footnotes at the end of the text area (section 3.14, page 94)
fromaddress
sender’s address in the letterhead (section 4.10, page 191)
fromname
sender’s name in the letterhead, not including fromaddress (section 4.10, page 191)
fromrule
horizontal rule in the letterhead; intended for colour changes (section 4.10, page 191)
itemizelabel
v3.33 Default for the preset symbols of the environment itemize (see section 4.16,
page 238)
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 183

Table 4.3.: Elements whose font style can be changed (continued)

labelinglabel
labels, i. e. the optional argument of \item in the labeling environment (see sec-
tion 4.16, page 239)
labelingseparator
separator, i. e. the optional argument of the labeling environment; applied in
addition to the labelinglabel element (see section 4.16, page 239)
labelitemi
v3.33 Font to be used in the item symbol definition \labelitemi (see section 4.16,
page 238)
labelitemii
v3.33 Font to be used in the item symbol definition \labelitemii (see section 4.16,
page 238)
labelitemiii
v3.33 Font to be used in the item symbol definition \labelitemiii (see section 4.16,
page 238)
labelitemiv
v3.33 Font to be used in the item symbol definition \labelitemiv (see section 4.16,
page 238)
pagefoot
depending on the page style used after the pageheadfoot element for the footer
(section 4.13, page 232)
pagehead
depending on the page style used after the pageheadfoot element for the header
(section 4.13, page 232)
pageheadfoot
the header and footer of a page for all page styles that have been defined using
KOMA - Script (section 4.13, page 232)
pagenumber
page number in the header or footer (section 4.13, page 232)
pagination
alternative name for pagenumber
...
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 184

Table 4.3.: Elements whose font style can be changed (continued)

placeanddate
v3.12 place and date, if a date line will be used instead of a normal reference line (sec-
tion 4.10, page 214)
refname
description or title of the fields in the reference line (section 4.10, page 214)
refvalue
content of the fields in the reference line (section 4.10, page 214)
specialmail
delivery type in the address field (section 4.10, page 204)
lettersubject
v3.17 subject in the opening of the letter (section 4.10, page 218)
lettertitle
v3.17 title in the opening of the letter (section 4.10, page 217)
toaddress
variation of the addressee element to format the recipient’s address, not including
the name, in the address field (section 4.10, page 204)
toname
variation of the addressee element to format the recipient’s name in the address
field (section 4.10, page 204)

\usefontofkomafont{element }
\useencodingofkomafont{element }
\usesizeofkomafont{element }
\usefamilyofkomafont{element }
\useseriesofkomafont{element }
\useshapeofkomafont{element }
v3.12 Sometimes, although this is not recommended, the font setting of an element is used for
settings that are not actually related to the font. If you want to apply only the font setting
of an element but not those other settings, you can use \usefontofkomafont instead of
\usekomafont. This will activate the font size and baseline skip, the font encoding, the font
family, the font series, and the font shape of an element, but no further settings as long as
those further settings are local.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 185

You can also switch to a single one of those attributes using one of the other commands.
Note that \usesizeofkomafont uses both the font size and the baseline skip.
However, you should not take these commands as legitimizing the insertion of arbitrary
commands in an element’s font setting. To do so can lead quickly to errors (see section 21.5,
page 479).

4.10. Letterhead Page

The letterhead page is the first page of, and therefore the signpost for, each letter. In a
business context, the paper for this page is often preprinted stationery containing elements
such as a header with the sender’s information and logo. This header itself is also known
as a letterhead. KOMA - Script lets you position these elements freely, and so you can not
only replicate the letterhead page directly but also fill in the required fields instantaneously.
This free positioning is achieved with pseudo-lengths (see section 4.6 starting on page 161).
You can find a schematic representation of the letterhead page and the variables used for it in
figure 4.10. The names of the variables are printed in bold to better distinguish the commands
from their arguments.
Subsequent pages should be distinguished from the letterhead page. For the purposes of
this manual, subsequent pages are all pages of a letter except the first one.

4.10.1. Fold Marks


Fold marks, or folding marks, are short horizontal lines at the left edge, and short vertical lines
at the upper edge of the paper. KOMA - Script currently supports three configurable horizontal
and one configurable vertical fold marks. In addition, there is support for a hole-punch mark,
or centre mark, which cannot be shifted vertically.

foldmarks=setting
The foldmarks option activates or deactivates fold marks for two, three, or four vertical
divisions and one horizontal division. The individual parts do not have to be of equal size.
The positions of three of the four horizontal marks and the single vertical mark are configurable
via pseudo-lengths (see section 4.6, page 161).
With the foldmarks option, you can either use the default values for simple switches de-
scribed in table 2.5, page 42 in order to activate or deactivate all configured fold marks on
v2.97e the left and upper edges of the paper at once, or you can configure the individual fold marks
independently by specifying one or more letters, as listed in table 4.4. In the latter case, the
fold marks are only shown if they have not been deactivated globally with false, off, or
no. The exact position of the fold marks is depends on the user settings or the lco files (see
section 4.20 starting on page 242). The default values are true and TBMPL.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 186

firsthead
fromname, fromaddress, fromphone, fromfax, fromemail, fromurl

backaddress
specialmail

location
\begin{letter}{addressee}

yourref, yourmail, myref, customer, invoice, place, date

title

subject

\opening{opening term}

letter body

\closing{closing term}

signature

firstfoot

Figure 4.10.: schematic display of the letterhead page outlining the most important commands and
variables
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 187

Table 4.4.: Combinable val-


ues for configuring fold marks B activate bottom horizontal fold mark on left paper edge
with the foldmarks option b deactivate bottom horizontal fold mark on left paper edge
H activate all horizontal fold marks on left paper edge
h deactivate all horizontal fold marks on left paper edge
L activate left vertical fold mark on upper paper edge
l deactivate left vertical fold mark on upper paper edge
M activate middle horizontal fold mark on left paper edge
m deactivate middle horizontal fold mark on left paper edge
P activate hole-punch or centre mark on left paper edge
p deactivate hole-punch or centre mark on left paper edge
T activate top horizontal fold mark on left paper edge
t deactivate top horizontal fold mark on left paper edge
V activate all vertical fold marks on upper paper edge
v deactivate all vertical fold marks on upper paper edge

Example: Suppose you want to deactivate all fold marks except the hole-punch mark. If the
default has not already been changed, you can deactivate it as follows:
\KOMAoptions{foldmarks=blmt}
If there is a chance that the default has already been changed, you should use a
safer method. This changes our example a little bit:
\documentclass[foldmarks=true,foldmarks=blmtP,
version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 188

Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

13th November 2021

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings

cc: executive board


all members

Figure 4.11.: result of a short letter with recipient, open-


ing, text, closing, postscript, distribution list, enclosure,
and hole-punch mark (the date is set by default)

meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
The result is shown in figure 4.11.
v2.97c You can change the colour of the fold mark with the \setkomafont and \addtokomafont
commands (see section 4.9, page 180) with the foldmark element. The default is no change.

\setplength{tfoldmarkvpos}{length }
\setplength{mfoldmarkvpos}{length }
\setplength{bfoldmarkvpos}{length }
KOMA-Script recognises a total of three fold marks whose vertical position can be configured.
The distance of the top fold mark from the upper edge of the paper is determined by the
v2.97e tfoldmarkvpos pseudo-length; the distance of the middle fold mark, by the mfoldmarkvpos
pseudo-length; the distance of the bottommost fold mark, by bfoldmarkvpos pseudo-length.
With the addition of the hole-punch or centre mark, there is yet a fourth horizontal mark. This
one is however always placed at the vertical centre of the paper. There is no pseudo-length
for this last mark because its vertical position is not configurable.
The top and bottom fold marks do not serve to divide the paper exactly into equal thirds.
Instead, the paper should be folded with their help such that the address field can be seen
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 189

in a window envelope. The settings are therefore different depending on the lco file chosen.
Several such files are available offering predefined formats. One format particularly worth
noting is DINmtext. This format assumes an envelope format of C6/5 (also known as “C6
long”). Letters written with this option are typically not suited for C5 or C4 envelopes.
The middle fold mark is not normally required for Western letters. In Japan, however,
a larger number of envelope formats exists, requiring one more fold mark (see the Japanese
lco files). Note that the terms “top”, “middle”, and “bottom” fold marks only represent
a naming convention. In fact, it is not required that tfoldmarkvpos must be smaller than
mfoldmarkvpos, which in turn must be smaller than bfoldmarkvpos. If, though, one of the
pseudo-lengths is zero, then the corresponding fold mark will not be set even if the foldmarks
option (see section 4.10, page 185) is explicitly activated.

\setplength{tfoldmarklength}{length }
\setplength{mfoldmarklength}{length }
\setplength{bfoldmarklength}{length }
\setplength{pfoldmarklength}{length }
v2.97e These four pseudo-lengths determine the lengths of the four horizontal fold marks. One feature
is particularly worth noting. If the length is given as zero, then the three vertically configurable
pseudo-lengths tfoldmarklength, mfoldmarklength and bfoldmarklength are set to 2 mm.
The length of the hole-punch mark, pfoldmarklength, however, is set to 4 mm.

\setplength{foldmarkhpos}{length }
This pseudo-length gives the distance of all horizontal fold marks from the left edge of the
paper. Normally, this is 3.5 mm. You can change this value in your own lco file if you are
using a printer that has a wider unprintable left margin. Whether the fold marks are typeset
at all depends on the option foldmarks (see section 4.10, page 185).

\setplength{lfoldmarkhpos}{length }
v2.97e In addition to the horizontal fold marks, there is also a vertical fold mark. Its distance from the
left margin is set via the lfoldmarkhpos pseudo-length. This fold mark is used, for example,
in Japanese Chou- or You-format envelopes if you want to use them with A4 paper. It can
also be useful for envelopes in C6 format.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 190

\setplength{lfoldmarklength}{length }
v2.97e The lfoldmarklength pseudo-length determines the length of the vertical fold mark. Once
again, a feature worth noting is that if the length is given as zero, a length of 4 mm is actually
used.

\setplength{foldmarkvpos}{length }
v2.97e This pseudo-length determines the distance of all vertical fold marks from the upper edge of
the paper. Normally this is 3.5 mm, but you can change the value in your own lco file in case
your printer has a wider unprintable top margin. Whether or not the foldmarks are actually
typeset depends on the foldmarks option (see section 4.10, page 185). At present there is
only one vertical fold mark, called the left vertical fold mark.

\setplength{foldmarkthickness}{length }
v2.97c This pseudo-length determines the thickness of all fold marks. The default is 0.2 pt, in other
words a very thin hairline. In particular, if the colour of the fold marks is changed, this may
not be enough.

4.10.2. Letterhead
The term letterhead refers here to all of the information concerning the sender that appears
above the recipient’s address. Normally you would expect that this information would be set
through the page-style settings. In fact, this was the case with the old letter class, scrlettr.
But scrlttr2 and scrletter output the letterhead independently of the page style by means of
the \opening command. The letterhead is positioned absolutely, so that it is independent of
the type area. In fact, the first page of a letter, the page that holds the letterhead, is set using
the page style empty.

firsthead=simple switch
v2.97e The letterhead is usually the topmost element of the letterhead page. With the firsthead
option, you can choose whether the letterhead will be typeset at all. The option accepts the
standard values for simple switches given in table 2.5 on page 42. The default is to typeset
the letterhead.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 191

\setplength{firstheadvpos}{length }
The firstheadvpos pseudo-length gives the distance between the top edge of the paper and
the start of the letterhead. This value is set differently in the various predefined lco files. A
typical value is 8 mm.

\setplength{firstheadhpos}{length }
v3.05 A positive value of the firstheadhpos pseudo-length gives the distance between the left edge
of the paper and the start of the letterhead. If the value is actually greater than or equal to
the paper width, \paperwidth, the letterhead will be centred horizontally on the letterhead
paper. A negative value gives the distance between the right edge of the paper and the right
edge of the letterhead. If the value actually less than or equal to the negative value of the
width of the paper, the letterhead is placed flush with the left edge of the type area.
The default value is typically \maxdimen, which is the maximum allowed value of a length.
This results in horizontal centring.

\setplength{firstheadwidth}{length }
The firstheadwidth pseudo-length gives the width of the letterhead. This value is set differ-
ently in the various predefined lco files. While this value usually depends on the paper width
and the distance between the left edge of the paper and the recipient’s address field, it was
the width of the type area in KOMAold and has a fixed value of 170 mm in NF.

fromalign=method
The fromalign option determines where the sender information should be placed on the first
v2.97e page. In addition to the various placement options in the letterhead, you also have the ability
to accommodate extra sender information. At the same time, this option serves as a central
switch to activate or deactivate letterhead extensions. If these extensions are deactivated,
some other options will have no effect. This will be noted in the explanations of the respective
options. Available values for fromalign are shown in table 4.5. The default value is left.

fromrule=position
\setkomavar{fromname}[description ]{contents }
\setkomavar{fromaddress}[description ]{contents }
The sender’s name is determined by the fromname variable. Its description (see also ta-
ble 4.7, page 198) is not used in the default letterheads.
In the extended letterhead, you can create a horizontal rule below the sender’s name with
fromrule=aftername. Alternatively you can place this rule below the complete sender in-
formation with fromrule=afteraddress. A summary of all available settings for the rule
position is shown in table 4.6. The length of this rule is determined by the fromrulewidth
pseudo-length.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 192

Table 4.5.: Available values for the fromalign option to define the position of the from address in the
letterhead with scrlttr2

center, centered, middle


Sender information is centred inside the letterhead; a logo is placed at the beginning
of the extra sender information, if applicable; letterhead extensions are activated.
false, no, off
The default design will be used for the sender information; the letterhead extensions
are deactivated.
left
Sender information is left-aligned in the letterhead; a logo is placed right-aligned, if
applicable; letterhead extensions are activated.
locationleft, leftlocation
Sender information is left-justified and uses the extra sender information; a logo is
placed at the top of it, if applicable; the letterhead is automatically deactivated but
can be reactivated using the firsthead option.
locationright, rightlocation, location
Sender information is right-justified and uses the extra sender information; a logo is
placed at the top of it, if applicable; the letterhead is automatically deactivated but
can be reactivated using the firsthead option.
right
Sender information is right-justified; a logo is placed left-justified, if applicable; let-
terhead extensions are activated

Table 4.6.: Available values for the fromrule option for the position of the rule in the sender information
with scrlttr2

afteraddress, below, on, true, yes


rule below the sender’s address
aftername
rule directly below the sender’s name
false, no, off
no rule
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 193

The default for the rule with the extended letterhead is false. But in the standard letter-
head, the rule will always be placed below the sender’s name.
The sender’s address follows below the name. The content of variable fromaddress deter-
mines this address. The address description (see also table 4.7) is not used in the default
letterheads
You can set the font used for the complete sender information with the fromaddress ele-
ment. You can define modifications to this with the fromname element for the sender’s name,
and with the fromrule element for the rule created with the fromrule option. The default
setting does not change the font. For the rule, font switching is mainly intended to change
the colour of the rule, for example to use grey instead of black. See [Ker07] for information
about colours.

Example: Now let’s give the sender of our sample letter a name:
\documentclass[foldmarks=true,foldmarks=blmtP,
fromalign=false,
version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\setkomavar{fromname}{Joe Public}
\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{[email protected]}
\setkomavar{fromlogo}{\includegraphics{musterlogo}}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 194

Joe Public Joe Public


2 Valley 2 Valley
SAMPLEBY SAMPLEBY
ZY32 1XW ZY32 1XW

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW

Joanna Public Joanna Public


1 Hillside 1 Hillside
SAMPLESTEAD SAMPLESTEAD
WX12 3YZ WX12 3YZ

13th November 2021 13th November 2021

Dear Madam Chair, Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason, articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately. I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation Anticipating an invitation

Joe Public Joe Public

PS: I hope you do not take this request amiss. PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings Enclosure: Excerpt from the articles governing general meetings

cc: executive board cc: executive board


all members all members

Figure 4.12.: result of a short letter with sender, recipient, opening, text, closing, postscript, distribu-
tion list, and enclosure (the date is set by default): on the left, the standard letterhead
using fromalign=false; on the right, the extended letterhead using fromalign=center

\end{document}
Initially, the standard rather than the extended letterhead is used. The result can
be seen in figure 4.12 on the left. For comparison, the same example is shown on
the right with fromalign=center (that is, with the extended letterhead). You can
see that this variation initially has no rule.
For the first time, figure 4.12 also shows a signature below the closing phrase. This
is generated automatically from the sender’s name. You can find more information
about how to configure the signature in section 4.10.7, starting on page 221.
Next, the letter with the extended letterhead should use the fromrule option to
print a rule below the sender’s name:
\documentclass[foldmarks=true,foldmarks=blmtP,
fromalign=center,fromrule=aftername,
version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\setkomavar{fromname}{Joe Public}
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 195

\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
You can see the result on the right in figure 4.13. By comparison, the same example
on the left uses the standard letterhead, which ignores the additional options.

An important note concerns the sender’s address: within the sender’s address, individual
parts such as house number and street, city and postal code, etc., are separated with a double
backslash. This double backslash is interpreted differently depending on how the sender’s
address is used and therefore is not necessarily a line break. Paragraphs, vertical spacing, and
the like are usually not allowed within the sender’s information. You have to know KOMA -
Script very well to put such things into the sender information, if necessary. In addition, note
that if you do so, you should definitely set the variables for return address (see backaddress,
page 204) and signature (see signature, page 221) yourself.

\setplength{fromrulethickness}{length }
\setplength{fromrulewidth}{length }
As mentioned in the explanation of the fromrule option in section 4.10, page 191, you can
put a horizontal rule within or below the sender’s address in the predefined letterheads. If
the fromrulewidth pseudo-length has a value of 0 pt, which is the default in the predefined
lco files, the length of this rule is calculated automatically taking into account, for example,
letterhead width or an optional logo. You can adjust rule length manually in your own lco
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 196

Joe Public Joe Public


2 Valley 2 Valley
SAMPLEBY SAMPLEBY
ZY32 1XW ZY32 1XW

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW

Joanna Public Joanna Public


1 Hillside 1 Hillside
SAMPLESTEAD SAMPLESTEAD
WX12 3YZ WX12 3YZ

13th November 2021 13th November 2021

Dear Madam Chair, Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason, articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately. I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation Anticipating an invitation

Joe Public Joe Public

PS: I hope you do not take this request amiss. PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings Enclosure: Excerpt from the articles governing general meetings

cc: executive board cc: executive board


all members all members

Figure 4.13.: result of a short letter with sender, rule, recipient, opening, text, closing, signature,
postscript, distribution list, enclosure and hole-punch mark (the date is set by default):
at left one the standard letterhead using fromalign=false, at right one the extended
letterhead using fromalign=center

files by setting this pseudo-length to positive values using \setplength (see page 167). The
v2.97c default thickness of the line, fromrulethickness, is 0.4 pt.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 197

symbolicnames=value
fromphone=simple switch
frommobilephone=simple switch
fromfax=simple switch
fromemail=simple switch
fromurl=simple switch
\setkomavar{fromphone}[description ]{contents }
\setkomavar{frommobilephone}[description ]{contents }
\setkomavar{fromfax}[description ]{contents }
\setkomavar{fromemail}[description ]{contents }
\setkomavar{fromurl}[description ]{contents }
\setkomavar{phoneseparator}[description ]{contents }
\setkomavar{mobilephoneseparator}[description ]{contents }
\setkomavar{faxseparator}[description ]{contents }
\setkomavar{emailseparator}[description ]{contents }
\setkomavar{urlseparator}[description ]{contents }
v3.12 You can use the five options fromphone, frommobilephone, fromfax, fromemail, and fromurl
v3.12 to specify whether to include the phone number, mobile phone number, fax number, e-mail
address, or URL should be as part of the sender’s information. You can assign any standard
value for simple switches from table 2.5, page 42 to these options. The default for all of them
is false. The contents themselves are determined by the variables of the same name. You
can find the defaults for the description or title of each variable in table 4.7. You can find
the separators that will be inserted between the description and the content in table 4.8.
v3.12 You can change the defaults for describing the variables all at once with the symbolicnames
option. This option understands the values for simple switches found in table 2.5, page 42.
v3.27 Activating the option corresponds to value marvosym and replaces the descriptions from the
language-dependent labels of \emailname, \faxname, \mobilephonename, and \phonename
with symbols from the marvosym package. At the same time, the colon is omitted when defining
the separators. In this case, both the description and the content of the URL separator will be
empty. With symbolicnames=fontawesome or symbolicnames=awesome, symbols of package
fontawesome are used. In this case there is also a symbol for the URL. Note that you may
need to load the marvosym or fontawesome package in your document preamble if you activate
the option for the corresponding package for the first time after \begin{document}.

Example: Mr Public from our sample letter has a telephone and an e-mail address. He also
wants to show these in the letterhead. At the same time, the separation rule should
now be placed after the letterhead. So he uses the appropriate options and also
sets the required variables:
\documentclass[foldmarks=true,foldmarks=blmtP,
fromalign=false,fromrule=afteraddress,
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 198

Table 4.7.: Default descriptions of the letterhead variables (you can find the description and contents
of the separator variables in table 4.8

fromemail
\usekomavar*{emailseparator}\usekomavar{emailseparator}
fromfax
\usekomavar*{faxseparator}\usekomavar{faxseparator}
frommobilephone
v3.12 \usekomavar*{mobilephoneseparator}\usekomavar{mobilephoneseparator}
fromname
\headfromname
fromphone
\usekomavar*{phoneseparator}\usekomavar{phoneseparator}
fromurl
\usekomavar*{urlseparator}\usekomavar{urlseparator}

fromphone,fromemail,
version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\setkomavar{fromname}{Joe Public}
\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{[email protected]}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 199

Table 4.8.: Default descriptions and contents of the letterhead separators without the symbolicnames
option

variable name description content


emailseparator \emailname :˜
faxseparator \faxname :˜
mobilephoneseparator \mobilephonename \usekomavaer{phoneseparator}
phoneseparator \phonename :˜
urlseparator \wwwname :˜

meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
The results on the left side of figure 4.14, however, are confounding: the options are
ignored. That’s because the additional variables and options are only used in the
extended letterhead. So the fromalign option must be used, as it is in the right
side of figure 4.14.
\documentclass[foldmarks=true,foldmarks=blmtP,
fromalign=center,fromrule=afteraddress,
fromphone,fromemail,
version=last]{scrlttr2}
\usepackage[british]{babel}
\begin{document}
\setkomavar{fromname}{Joe Public}
\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{[email protected]}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 200

Joe Public Joe Public


2 Valley 2 Valley
SAMPLEBY SAMPLEBY
ZY32 1XW ZY32 1XW
Phone: 0 12 34 56 78
Email: [email protected]

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW

Joanna Public Joanna Public


1 Hillside 1 Hillside
SAMPLESTEAD SAMPLESTEAD
WX12 3YZ WX12 3YZ

13th November 2021 13th November 2021

Dear Madam Chair, Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason, articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately. I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation Anticipating an invitation

Joe Public Joe Public

PS: I hope you do not take this request amiss. PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings Enclosure: Excerpt from the articles governing general meetings

cc: executive board cc: executive board


all members all members

Figure 4.14.: result of a short letter with sender, rule, recipient, opening, text, closing, signature,
postscript, distribution list, enclosure and hole-punch mark (the date is set by default):
the left one uses the standard letterhead with fromalign=false; the right one uses the
extended letterhead with fromalign=center

board to arrange such a meeting immediately.


\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
You can compare two other alternatives with left-aligned sender information using
fromalign=left and right-aligned sender information using fromalign=right in
figure 4.15.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 201

Joe Public Joe Public


2 Valley 2 Valley
SAMPLEBY SAMPLEBY
ZY32 1XW ZY32 1XW
Phone: 0 12 34 56 78 Phone: 0 12 34 56 78
Email: [email protected] Email: [email protected]

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW

Joanna Public Joanna Public


1 Hillside 1 Hillside
SAMPLESTEAD SAMPLESTEAD
WX12 3YZ WX12 3YZ

13th November 2021 13th November 2021

Dear Madam Chair, Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason, articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately. I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation Anticipating an invitation

Joe Public Joe Public

PS: I hope you do not take this request amiss. PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings Enclosure: Excerpt from the articles governing general meetings

cc: executive board cc: executive board


all members all members

Figure 4.15.: result of a short letter with extra sender information, rule, recipient, opening, text, closing,
signature, postscript, distribution list, enclosure and hole-punch mark (the date is set by
default): the left one uses a left-aligned letterhead with fromalign=left; the right one
uses a right-aligned letterhead using fromalign=right

fromlogo=simple switch
\setkomavar{fromlogo}[description ]{contents }
You can use the fromlogo to configure whether to put a logo in the letterhead. You can use
any of the default values from table 2.5, page 42 for the simple switch . The default is false,
which means no logo. The logo itself is defined by the content of the fromlogo variable. The
description of the logo is empty by default and KOMA - Script does not use it in the default
letterhead pages.

Example: Mr Public finds it particularly stylish when he provides his letterhead with a
logo. He has saved his logo as a graphics file, which he would like to load using
\includegraphics. To do this, he loads the graphics package (see [Car17]).
\documentclass[foldmarks=true,foldmarks=blmtP,
fromrule=afteraddress,
fromphone,fromemail,fromlogo,
version=last]{scrlttr2}
\usepackage[british]{babel}
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 202

\usepackage{graphics}
\begin{document}
\setkomavar{fromname}{Joe Public}
\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{[email protected]}
\setkomavar{fromlogo}{\includegraphics{musterlogo}}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
You can see the result in the top left of figure 4.16. The other two images in this
figure show the results with right-aligned and centred sender information.

\setkomavar{firsthead}[description ]{contents }
In many cases, the capabilities that scrlttr2 offers with the foregoing options and variables
will be sufficient to design a letterhead. In some cases, however, you may want even more
flexibility. In those situations, you will have to do without the possibilities offered by the
predefined letterhead, which you can select via the options described above. Instead, you must
create your own letterhead from scratch. To do so, you must specify the desired structure as
the contents of the firsthead variable. For example, you can set several boxes side by
side or one beneath the other using the \parbox command (see [Tea05b]). Experienced users
should thus be able to create their own a letterheads. Of course you can and should use
other variables with \usekomavar. KOMA - Script does not use the description of variable
firsthead.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 203

Joe Public Joe Public


2 Valley 2 Valley
SAMPLEBY SAMPLEBY

M
ZY32 1XW ZY32 1XW
Phone: 0 12 34 56 78 Phone: 0 12 34 56 78
Email: [email protected] Email: [email protected]

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW

Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ
Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ
M
13th November 2021 13th November 2021

Dear Madam Chair, Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason, articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately. I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation Anticipating an invitation

Joe Public Joe Public

PS: I hope you do not take this request amiss. PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings Enclosure: Excerpt from the articles governing general meetings

cc: executive board cc: executive board


all members all members

Joe Public
2 Valley
SAMPLEBY

M
ZY32 1XW
Phone: 0 12 34 56 78
Email: [email protected]

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW

Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

13th November 2021

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

Joe Public

PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings

cc: executive board


all members

Figure 4.16.: result of a short letter with extra sender infor-


mation, logo, rule, recipient, opening, text, closing, signa-
ture, postscript, distribution list, enclosure and hole-punch
mark (the date is set by default): at top left the sender
is left-aligned, at top right the sender is centred, and at
bottom right the sender is right-aligned sender
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 204

4.10.3. Addressee
The term addressee normally refers only to the recipient’s name and address, which are output
in an address field. Additional information, however, can be placed within this address field,
including the delivery method, for example registered mail or special delivery. For window
envelopes, the return address also counts as part of the address field, as it will be displayed in
the address window. The address field directly follows the letterhead.

addrfield=format
backaddress=value
priority=priority
\setkomavar{toname}[description ]{contents }
\setkomavar{toaddress}[description ]{contents }
\setkomavar{backaddress}[description ]{contents }
\setkomavar{backaddressseparator}[description ]{contents }
\setkomavar{specialmail}[description ]{contents }
\setkomavar{fromzipcode}[description ]{contents }
\setkomavar{zipcodeseparator}[description ]{contents }
\setkomavar{place}[description ]{contents }
\setkomavar{PPcode}[description ]{contents }
\setkomavar{PPdatamatrix}[description ]{contents }
\setkomavar{addresseeimage}[description ]{contents }
The addrfield option determines whether or not to print an address field. The default is to
v3.03 include an address field. The option recognizes the formats described in table 4.9. With the
v3.17 values true, topaligned, PP, and backgroundimage, the name and address of the recipient are
determined by the mandatory argument of the letter environment (see section 4.7, page 170).
This information is also copied into the variables toname and toaddress.
v2.97c You can change the default font styles with the \setkomafont or \addtokomafont com-
mands (see section 4.9, page 180). There are three elements. First, the addressee element
is responsible for the overall style of the recipient’s name and address. The elements toname
and toaddress are responsible only for the name and the address of the recipient, respec-
tively. You can use toname and toaddress to define modifications from the basic addressee
configuration.
The default addrfield=true also prints an underlined return address in the address field.
The backaddress option defines if and in what form a return address will be printed for window
envelopes. On the one hand, this option accepts the standard values for simple switches listed
in table 2.5, page 42. These values do not change style of the return address. On the other
v2.96 hand, when the return address is enabled, you can select its format at the same time. For
example, the underlined option value enables an underlined return address, while plain
selects a style without underlining. The default is underlined and thus prints an underlined
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 205

Table 4.9.: Available values for the addrfield option to change the recipient format of scrlttr2

backgroundimage, PPbackgroundimage, PPBackgroundImage, PPBackGroundImage,


ppbackgroundimage, ppBackgroundImage, ppBackGroundImage
Prints an address with a background image stored in the addresseimage variable as
the postpaid postmark, but without a return address or delivery type.
false, off, no
Does not print an address.
image, Image, PPimage, PPImage, ppimage, ppImage
Prints an image stored in the addresseeimage variable as an address with a postpaid
postmark. Recipient information, return address, and delivery type or priority are
ignored.
PP, pp, PPexplicite, PPExplicite, ppexplicite, ppExplicite
Prints an address with a postage print impression (pospaid) header filled in with
the variables fromzipcode, place, and PPcode, and when applicable with a priority
and a data array defined by PPdatamatrix, but without a return address or delivery
type.
v3.17 topaligned, alignedtop
Prints an address including a return address and a delivery type or priority. The
address is not centred vertically beneath the delivery type.
true, on, yes
Prints an address field including a return address and delivery type or priority.

return address.
The return address itself is defined by the content of the backaddress variable. The
default is the name specified in fromname and the address specified in fromaddress. The
double backslash is also replaced with the content of the backaddressseparator variable.
The default separator is a comma followed by a non-breaking space. KOMA - Script does not
use the description of the backaddress variable. You can configure the font style of the
return address via the backaddress element. The default is \sffamily (see table 4.10). Before
applying the element’s font style KOMA - Script switches to \scriptsize.
The default addrfield=true, centres the address vertically within the space available for
v3.17 the address. In contrast, addrfield=topaligned will not centre the address but place it flush
with the top of the available space.
With the default addrfield=true setting, you can output an optional delivery type between
the return address and the recipient address. This will be output only if the specialmail
v3.03 variable has non-empty content and priority=manual has been selected, which is the de-
fault. The scrlttr2 class itself does not use the description of the specialmail variable.
The alignment is defined by the specialmailindent and specialmailrightindent pseudo-
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 206

Table 4.10.: Default font


styles for the elements of the element font style
address field.
addressee
backaddress \sffamily
PPdata \sffamily
PPlogo \sffamily\bfseries
priority \fontsize{10pt}{10pt}\sffamily\bfseries
prioritykey \fontsize{24.88pt}{24.88pt}\selectfont
specialmail
toaddress
toname

v2.97c lengths (see page 209). You can change the default font style of the specialmail element,
which is listed in table 4.10, with the \setkomafont and \addtokomafont commands (see
section 4.9, page 180).
v3.03 However, selecting an international priority with priority=A or priority=B (see table 4.11)
together with addrfield=true, prints the priority as the delivery type. Using it together with
addrfield=PP prints the priority at the corresponding position in the postpaid postmark (also
known as the postage print impression or port payé). The priority element defines the basic
font style, and prioritykey defines the modification of the basic font style for the priority
keys “A” or “B”. You can find the default font styles listed in table 4.10 and can change then
using the \setkomafont and \addtokomafont commands (see section 4.9, page 180).
v3.03 With addrfield=PP, the postal code in the fromzipcode variable and the location from
the place pariable will be output in the postpaid postmark. The postal code (that is, the
content of fromzipcode) is preceded by the description of the fromzipcode variable and
the content of zipcodeseparator. The default for the description depends on the lco file
used (see section 4.20 starting on page 242). On the other hand, the default content of the

Table 4.11.: Available values for the priority option to select the international priority in the address
field ofscrlttr2

false, off, no, manual


Priority will not be printed.
B, b, economy, Economy, ECONOMY, B-ECONOMY, B-Economy, b-economy
Use international priority B-Economy. With addrfield=true, this is printed instead
of the delivery type.
A, a, priority, Priority, PRIORITY, A-PRIORITY, A-Priority, a-priority
Use international priority A-Priority. With addrfield=true, this is printed instead
of the delivery type.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 207

zipcodeseparator variable is a thin space followed by an en rule followed by another thin


space (\,--\,).
v3.03 With addrfield=PP, a code is placed in the postpaid postmark that uniquely identifies the
sender. This is stored in the PPcode variable. You can also print an additional data array to
the right of the address, which is stored in the PPdatamatrix variable.
v3.03 The ZIP code (postal code), place, and sender code will be printed by default in an 8 pt
font. The the font style of the PPdata is used to do so. The default is listed in table 4.10
and can be changed with the \setkomafont and \addtokomafont commands (see section 4.9,
page 180).
For the postpaid logo “P.P.”, however, the font style of the PPlogo element is used. Its
default can also be found in table 4.10.
v3.03 With the two settings addrfield=backgroundimage and addrfield=image, an image
is print inside the address window. This image is stored in the content of variable
addresseeimage. KOMA - Script does not use the description of this variable. Although
only the image is printed with the addrfield=image option, the recipient’s name and address
from the mandatory argument of the letter environment will be printed with the addrfield=
backgroundimage option.
The position of the postpaid postmark and that of the postpaid address is defined by the
toaddrindent pseudo-length (see page 208) as well as PPheadwidth and PPheadheight (see
page 209). The position of the data array is defined by the PPdatamatrixvskip pseudo-length
(see page 209).
Note that KOMA - Script cannot print any external graphics or pictures by itself. So if you
want to put external picture files into variables like addresseeimage or PPdatamatrix, you
must load an additional graphics package like graphics or graphicx and use, for instance, the
\includegraphics command in the content of the variables.

\setplength{toaddrvpos}{length }
\setplength{toaddrhpos}{length }
These pseudo-lengths define the vertical and horizontal distance of the address field from
the top-left corner of the paper. Values are set differently in the various predefined lco files,
according to standard envelope window measures. For toaddrhpos, one property worth noting
is that with negative values, the offset is the distance from the right edge of the address field
to the right edge of the paper. You will find this, for instance, in SN or NF. The smallest
value of toaddrvpos is found with DINmtext. With this setting, the letterhead can easily
protrude into the address window. Whether the address field is output or not depends on the
addrfield option (see section 4.10, page 204).
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 208

\setplength{toaddrheight}{length }
This pseudo-length defines the height of the address field, including the delivery method.
Whether the name and address of the recipient are vertically centred in the address field,
taking into account the presence or absence of the delivery method, depends on the addrfield
option.

\setplength{toaddrwidth}{length }
This pseudo-length defines the width of the address field. The various predefined lco files use
different settings according to the different standards for window envelopes. Typical values
are between 70 mm and 100 mm.

Example: Suppose your printer has very wide, non-printable left and right margins of 15 mm.
This means that the letterhead, the additional sender information, and the address
field cannot be completely printed if you use the SN option. You therefore create a
new lco file with the following content:
\ProvidesFile{SNmmarg.lco}
[2002/06/04 v0.1 my lco]
\LoadLetterOption{SN}
\addtoplength{toaddrwidth}{%
-\useplength{toaddrhpos}}
\setplength{toaddrhpos}{-15mm}
\addtoplength{toaddrwidth}{%
\useplength{toaddrhpos}}
\endinput
Then, until you can obtain a printer with smaller page margins, you simply use the
option SNmmarg instead of SN.

\setplength{toaddrindent}{length }
Sometimes you do not want the address field to extend the full width of the address window
but to be indented a bit. You can set the amount of this indentation with the toaddrindent
pseudo-length. Typically, the default value is 0 pt.
v3.03 For the addrfield=PP, addrfield=image, and addrfield=backgroundimage settings (see
section 4.10, page 204) a value of 0 pt will be replaced by a value of 8 mm. If you really do
not want any indentation, you can use a value of 1 sp to set a negligibly small indentation.
Furthermore, toaddrindent is also used for the distance to the right edge of the address
window with the these addrfield settings.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 209

\setplength{backaddrheight}{length }
For window envelopes, the sender is often printed in a small font on one line above the ad-
dressee. This sender information is called the return address, because it is visible in the address
window and will be used by the post office to return an undeliverable letter to the sender.
This return address, therefore, requires only the information necessary for that purpose.
The height reserved for the return address within the address window is given by the
backaddrheight pseudo-length. This value is typically 5 mm in the predefined lco fileslco
file=lco file. Whether to print the return address at all depends on the addrfield (see
section 4.10, page 204) and backaddress options (see section 4.10, page 204).

\setplength{specialmailindent}{length }
\setplength{specialmailrightindent}{length }
You can print an optional delivery method between the return address and the recipient’s
address. This field is printed only if the specialmail variable has non-empty contents. Its
alignment is determined by the specialmailindent and specialmailrightindent pseudo-
lengths, which specify the left and right indentation, respectively. In the predefined lco files,
specialmailindent is set to rubber length \fill, while specialmailrightindent is set to
1 em. Thus the delivery method is set 1 em from the address field’s right margin.

\setplength{PPheadheight}{length }
\setplength{PPheadwidth}{length }
v3.03 The PPheadheight pseudo-length specifies the height reserved for the postpaid header at the
start of the address field for the two options addrfield=PP and addrfield=backgroundimage.
The PPheadwidth pseudo-length is used only with addrfield=PP (see section 4.10, page 204)
and gives the width of the left-hand field within the postpaid header, which contains the
postpaid logo, the postal code, and the location. The width of the right-hand field containing
the sender’s code and the priority is the remaining width.
KOMA-Script automatically changes the default value of 0 mm for the PPheadheight
pseudo-length to 20.74 pt, and PPheadwidth’s default from 0 mm to 42 mm.

\setplength{PPdatamatrixvskip}{length }
v3.03 This pseudo-length specifies the vertical distance between the postpaid header and the data
array used with addrfield=PP (see section 4.10, page 204). KOMA - Script automatically
changes the default value of 0 mm to 9 mm. The data matrix is flush right within the postpaid
header.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 210

Table 4.12.: Available values for the locfield option


to set the width of the field for extra sender informa- narrow
tion with scrlttr2 narrow extra sender information
field
wide
wide extra sender information
field

4.10.4. Extra Sender Information


Often, especially with business letters, there is not enough space in the letterhead and footer
to accommodate all the information about the sender that you want to include. For such
additional information, you can use the space next to the addressee. In this manual, this field
is called the extra sender information. In earlier versions of this manual, it was called the
sender’s extension or the location field.

locfield=setting
The content ot the field with extra sender attributes next to the address field can be anything
you want, for example a location, a bank-account number, or other information. Depending
on the fromalign option, it will also be used for the sender’s logo. The width of this field can
be specified in an lco file (see section 4.20). If the width is set to zero there, the locfield
option can toggle between two defaults for the field width. This is the case for most of the lco
files that come with KOMA - Script. See also the explanation on the locwidth pseudo-length
in section 4.10.4, page 211. Available values for this option are shown in table 4.12. The
default is narrow.

\setkomavar{location}[description ]{contents }
The contents of the extra sender information field, unless it contains the logo or the basic
sender information itself, are specified by the location variable. You can use formatting
commands like \raggedright within this variable’s content . KOMA - Script does not use the
description of this variable.

Example: Mr Public would like to provide some additional information about his membership.
Therefore he uses the location variable:
\documentclass[foldmarks=true,foldmarks=blmtP,
fromphone,fromemail,fromlogo,
version=last]{scrlttr2}
\usepackage[british]{babel}
\usepackage{graphics}
\begin{document}
\setkomavar{fromname}{Joe Public}
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 211

\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{[email protected]}
\setkomavar{fromlogo}{\includegraphics{musterlogo}}
\setkomavar{location}{\raggedright
Club member no.~4711\\
since 11.09.2001\\
chairman 2003--2005}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
This will place the corresponding field beside the recipient’s address, as shown in
figure 4.17.

\setplength{locheight}{length }
\setplength{lochpos}{length }
\setplength{locvpos}{length }
\setplength{locwidth}{length }
v2.97d The locwidth and locheight pseudo-lengths set the width and height of the extra-sender-
information field. The lochpos and locvpos pseudo-lengths determine the distances from the
top-right edge of the paper. These values are typically set to 0 pt in the predefined lco files.
These zero-length values have a special meaning. They result in the actual values being set
within \opening based on the paper width, the address-window width, the address window’s
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 212

Joe Public
2 Valley
SAMPLEBY
ZY32 1XW
Phone: 0 12 34 56 78
Email: [email protected]

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW


M
Club member no. 4711
since 11.09.2001
chairman 2003–2005
Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

13th November 2021

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

Joe Public

PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings

cc: executive board


all members

Figure 4.17.: result of a short letter with extended sender,


logo, recipient, extra sender information, opening, text,
closing, signature, postscript, distribution list, enclosure,
and hole-punch mark (the date is set by default)

distance from the top-left edge of the paper, and the locfield option (see section 4.10,
page 210). As is the case for toaddrhpos, negative values of lochpos also take on a special
meaning. Instead of referring to the distance from the right edge of the paper, lochpos then
refers to the distance from the left edge of the paper. The meaning is thus the opposite of
that of toaddrhpos (see section 4.10.3, page 207).

4.10.5. Reference Line


The reference line can actually be longer than just one line. It is printed only if at least one
of variables for the reference line is not empty. Only non-empty fields will be printed. To set
a seemingly empty field, you can provide content for the variable that appears empty, such
as \mbox{}. If the reference line is omitted, the description and contents of the date variable
are printed in its place. You can find information about adding variables to or removing them
from the reference line in section 22.1, page 505.

numericaldate=simple switch
This option toggles between the standard, language-dependent date presentation, and a short,
numerical one. KOMA - Script does not provide the standard date format. It should be defined
by a package such as ngerman, babel, or isodate. The short, numerical representation, however,
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 213

Table 4.13.: Available values for the refline option to set the width of the reference line with scrlttr2

dateleft
v3.09 The date is placed leftmost in the reference line.
dateright
v3.09 The date is placed rightmost in the reference line.
narrow
The reference line is restricted to the type area.
nodate
v3.09 The date is not placed automatically into the reference line.
wide
The width of the reference line depends on the positions of the address and extra
sender information.

is produced by scrlttr2 itself. The option recognizes the standard values for simple switches as
listed in table 2.5, page 42. The default is false, which results in standard date format.

\setkomavar{date}[description ]{contents }
The date in the selected format is stored as content of the date variable. Setting the
numericaldate option has no effect if this variable is overridden. The date is usually output
as part of the reference line. If all other elements of the reference line are empty, a date line
consisting of the location and the date is printed instead. However in this case, the settings of
the refline option described below also affect the date line. See the description of variable
place on page 214 for more information about the location.

refline=selection
Business letters in particular often contain an area with information such as an identification
code, phone extension, customer number, invoice number, or references to previous letters.
This guide calls this area the reference-field line, or simply the reference line.
With scrlttr2 and scrletter, the header, footer, address, and extra sender information can
extend left and right beyond the normal type area. The refline=wide option specifies that
this should also apply to the reference-field line. Normally, the reference-field line contains at
least the date, but it can hold additional data. Available values for this option are shown in
v3.09 table 4.13. The default is narrow and dateright.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 214

Table 4.14.: Default descriptions of typi-


cal variables in the reference line using name description English default text
language-dependent commands
yourref \yourrefname Your reference
yourmail \yourmailname Your letter from
myref \myrefname Our reference
customer \customername Customer No.:
invoice \invoicename Invoice No.:
date \datename date

\setkomavar{yourref}[description ]{contents }
\setkomavar{yourmail}[description ]{contents }
\setkomavar{myref}[description ]{contents }
\setkomavar{customer}[description ]{contents }
\setkomavar{invoice}[description ]{contents }
You can manage the typical contents of the reference-field line with five variables: yourref,
yourmail, myref, customer and invoice. Their meanings are listed in table 4.1 on page 156.
Each variable has also a predefined description , shown in table 4.14. How to add more
variables to the reference-field line is explained in section 22.1 starting on page 505.
v2.97c You can change the font style and colour of the description and content of the fields
in the reference line with the refname and refvalue elements using the \setkomafont and
\addtokomafont commands (see section 4.9, page 180). The defaults for both elements are
listed in table 4.15.

\setkomavar{placeseparator}[description ]{contents }
If all variables in the reference-field line, with the exception of date, are empty, no actual
reference line is output. Instead, a date line consisting only of a location and a date is output.
The content of the place variable contains the location. The delimiter, which in this case is
placed after the location, is specified by the content of the placeseparator variable. The
default content of the delimiter is a comma followed by a non-breaking space. If the location
is empty, the delimiter is not output. The default content of date is \today and depends on
the setting of the numericaldate option (see page 212).
v3.09 Starting with version 3.09, the location and date are no longer required to be right-aligned.
Instead, when a date line is used, its alignment is specified by the date setting of the refline
option, as listed in table 4.13.
v3.12 If such a date line is output with a location rather than a reference-field line, the font
setting of the refvalue element does not apply. In this case, the placeanddate element is
used. You can change the empty default of this font element as usual with the \setkomafont
and \addtokomafont commands (see section 4.9, page 180).

Example: Now Mr Public also sets the variable for the location:
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 215

Table 4.15.: Default font style settings for the elements in


the reference line element default configuration
refname \sffamily\scriptsize
refvalue

\documentclass[foldmarks=true,foldmarks=blmtP,
fromphone,fromemail,fromlogo,
version=last]{scrlttr2}
\usepackage[british]{babel}
\usepackage{graphics}
\begin{document}
\setkomavar{fromname}{Joe Public}
\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{[email protected]}
\setkomavar{fromlogo}{\includegraphics{musterlogo}}
\setkomavar{location}{\raggedright
Club member no.~4711\\
since 11.09.2001\\
chairman 2003--2005}
\setkomavar{date}{29th February 2011}
\setkomavar{place}{Sampleby}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 216

Joe Public
2 Valley
SAMPLEBY
ZY32 1XW
Phone: 0 12 34 56 78
Email: [email protected]

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW


M
Club member no. 4711
since 11.09.2001
chairman 2003–2005
Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

Sampleby, 29th February 2011

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

Joe Public

PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings

cc: executive board


all members

Figure 4.18.: result of a short letter with extended sender,


logo, recipient, extra sender information, location, date,
opening, text, closing, signature, postscript, distribution
list, enclosure and hole-punch mark

As seen in figure 4.18, the location appears in front of the date, followed by the
automatic delimiter. This date has been defined explicitly so that the original date
is maintained in any later LATEX run rather than using the date of the LATEX run.

\setplength{refvpos}{length }
This pseudo-length specifies the distance from the upper edge of the paper to the reference
line. Its value is set differently in the various predefined lco files. Typical values are between
80.5 mm and 98.5 mm.

\setplength{refwidth}{length }
\setplength{refhpos}{length }
The refwidth pseudo-length specifies the width available for the reference line. Its value is
typically set to 0 pt in the predefined lco files. This value has a special meaning. In no way
does it indicate that there is no available width for the reference line. Instead, it indicates
that the width will be calculated within the \opening command. This calculated width then
depends on the value of the refline options (see section 4.10, page 213). At the same time,
refhpos will also be set according to this option. With refline=wide, the reference fields
line is centred, while with refline=narrow it is aligned flush left with the type area.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 217

If refwidth is not zero, the width of the reference line is not determined by the refline
option, and so refhpos specifies the distance of the reference line from the left edge of the
paper. If this distance is zero, the the reference line is placed so that the ratio between its
distances from the left and right edges of the paper corresponds to the ratio of distance of
the type area from the left and right edges of the paper. Thus, for a type area horizontally
centred on the paper, the reference line will also be centred.
As a rule, these special cases are likely of little interest to the normal user. The simplest rule
is as follows: either refhpos remains zero, and so the width and alignment of the reference
line are determined with the refline option, or the user sets both refwidth and refhpos.

\setplength{refaftervskip}{length }
This pseudo-length specifies the vertical skip to be inserted beneath the reference line. The
value is set in the predefined lco files. It directly affects the height of the text area on the
first page. A typical value is between one and two lines.

4.10.6. Subject
Different countries have different conventions for placing the subject line of a letter. Some
place it before the opening phrase; others place it after. Some professional groups even want
it before the reference line.

\setkomavar{title}[description ]{contents }
With KOMA- Script, you can also give a letter a title. The title is centred, using the \LARGE
font size, and placed directly beneath the reference-field line.
You can change the font style for the lettertitle element with the \setkomafont and
\addtokomafont commands (see section 4.9, page 180). Font size declarations are allowed.
The \LARGE font size always precedes the font selection in KOMA - Script, and is therefore
not part of the default setting \normalcolor\sffamily\bfseries. With scrlttr2, you can
also use title as an alias for lettertitle. This is not possible when using scrletter with
a KOMA-Script class because these classes already define a title element for the document
title with different setting.

Example: Suppose you are writing a reminder letter. You set a corresponding title:
\setkomavar{title}{Reminder}
This way the recipient should recognize the reminder as such.

As shown in the example, the content of the variable defines the title. KOMA - Script does
not use the description .
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 218

Table 4.16.: Default descriptions


of variables for the subject variable name description
subject \usekomavar*{subjectseparator}%
\usekomavar{subjectseparator}
subjectseparator \subjectname

subject=selection
\setkomavar{subject}[description ]{contents }
\setkomavar{subjectseparator}[description ]{contents }
To include a subject, define the content of the subject variable accordingly. First of all,
you can use the subject=true option, to choose whether the subject should be preceded with
a description or not. If you use the description the content of the subjectseparator
variable is output between the description and the content of the subject variable. The
default content of subjectseparator consists of a colon followed by a space.
Additionally, you can use subject=afteropening to place the subject after the letter open-
ing instead of the default subject=beforeopening. You can also specify other formatting for
v2.97c the subject with subject=underlined, subject=centered, or subject=right. The available
values are listed in table 4.17. Note that with the subject=underlined option, the whole
subject must fit onto one line. The defaults are subject=left, subject=beforeopening, and
subject=untitled.
The subject line is set in a separate font. To change this, use the \setkomafont and
\addtokomafont commands (see section 4.9, page 180). For the lettersubject element, the
default font is \normalcolor\bfseries. With the scrlttr2 class, you can also use subject
as an alias of lettersubject. This is not possible with the scrletter package when using a
KOMA-Script class, because these classes already define a subject element for the document
title with different settings.

Example: Mr Public now includes a subject. As a traditionalist, he also wants the subject to
be labelled accordingly and therefore sets the corresponding option:
\documentclass[foldmarks=true,foldmarks=blmtP,
fromphone,fromemail,fromlogo,
subject=titled,
version=last]{scrlttr2}
\usepackage[british]{babel}
\usepackage{graphics}
\begin{document}
\setkomavar{fromname}{Joe Public}
\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\setkomavar{fromphone}{0\,12\,34~56\,78}
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 219

Table 4.17.: Available values for the


subject option for the position and afteropening
formatting of the subject with scrlttr2 subject after opening
beforeopening
subject before opening
centered
subject centred
left
subject left-justified
right
subject right-justified
titled
add title/description to subject
underlined
set subject underlined (see note in text)
untitled
do not add title/description to subject

\setkomavar{fromemail}{[email protected]}
\setkomavar{fromlogo}{\includegraphics{musterlogo}}
\setkomavar{location}{\raggedright
Club member no.~4711\\
since 11.09.2001\\
chairman 2003--2005}
\setkomavar{date}{29th February 2011}
\setkomavar{place}{Sampleby}
\setkomavar{subject}{Missing general meeting}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 220

Joe Public
2 Valley
SAMPLEBY
ZY32 1XW
Phone: 0 12 34 56 78
Email: [email protected]

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW


M
Club member no. 4711
since 11.09.2001
chairman 2003–2005
Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

Sampleby, 29th February 2011

Subject: Missing general meeting

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

Joe Public

PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings

cc: executive board


all members

Figure 4.19.: result of a short letter with extended sender,


logo, recipient, extra sender information, place, date, sub-
ject, opening, text, closing, signature, postscript, distribu-
tion list, enclosure and hole-punch mark

meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
The result is shown in figure 4.19.

\setplength{subjectvpos}{length }
v3.01 If the value of this pseudo-length is 0 pt, the subject option (see section 4.10, page 218)
determines the position of the subject. Any other value defines the distance between the top
edge of the paper and the subject. In this case, you should ensure that there is enough space
available that overlapping with other elements is unlikely.
Example: A few professionals prefer to have the subject above the reference line. For this, you
can specify the position as follows, which also changes the position of the reference
line itself:
\ProvidesFile{lawsubj.lco}
[2008/11/03 lawyers lco file]
\setplength{subjectvpos}{\useplength{refvpos}}
\addtoplength{refvpos}{3\baselineskip}
\endinput
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 221

If you want to leave at least one empty line between the subject and the reference,
you have space for a maximum of two lines.

\setplength{subjectbeforevskip}{length }
\setplength{subjectaftervskip}{length }
v3.01 If the subject is placed not absolutely but before or after the salutation, you can insert addi-
tional vertical space before and after the subject. The space before the subject may interfere
with other distances, such as the automatic distance of one line after the title. Therefore the
default is to use no additional space here. The default of the class and the package for the
space after the subject is two lines.

4.10.7. Closing
It has already been mentioned in section 4.7, page 173 that the letter’s closing text is provided
by \closing. Beneath the closing text, there is often a space for a handwritten signature,
beneath which there can be a printed name, which serves as a kind of annotation to the actual
signature.

\setkomavar{signature}[description ]{contents }
The signature variable contains the printed name or annotation for the handwritten signa-
ture. Its default content is the \usekomavar{fromname}. This annotation can consist of
multiple lines. In that case, you should separate the individual lines with double backslashes.
Paragraph breaks in the signature annotation, however, are not permitted.

\raggedsignature
The closing phrase and the signature will be typeset in a box. The width of the box is
determined by the length of the longest line in the closing phrase or signature.
The sigindent and sigbeforevskip pseudo-lengths determine exactly where this box is
placed (see section 4.10.7, page 223). The \raggedsignature command defines the alignment
inside the box. In the default lco files, the command is either defined as \centering (all
besides KOMAold) or \raggedright (KOMAold). In order to obtain flush-right or flush-left
alignment inside the box, you can redefine the command in the same way as \raggedsection
(see the example in section 3.16, page 108).

Example: Now Mr Public wants to make himself seem really important, and therefore he uses
the signature to show once again that he was formerly a chairman himself. So
he changes contents of the signature variable. He also wants the signature be
aligned flush-left and so he also redefines \raggedsignature:
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 222

\documentclass[foldmarks=true,foldmarks=blmtP,
fromphone,fromemail,fromlogo,
subject=titled,
version=last]{scrlttr2}
\usepackage[british]{babel}
\usepackage{graphics}
\begin{document}
\setkomavar{fromname}{Joe Public}
\setkomavar{signature}{Joe Public\\
(former chairman)}
\renewcommand*{\raggedsignature}{\raggedright}
\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{[email protected]}
\setkomavar{fromlogo}{\includegraphics{musterlogo}}
\setkomavar{location}{\raggedright
Club member no.~4711\\
since 11.09.2001\\
chairman 2003--2005}
\setkomavar{date}{29th February 2011}
\setkomavar{place}{Sampleby}
\setkomavar{subject}{Missing general meeting}
\begin{letter}{%
Joanna Public\\
1 Hillside\\
SAMPLESTEAD\\
WX12 3YZ%
}
\opening{Dear Madam Chair,}
The last general meeting was more than a year ago.
I would like to remind you that the articles of our
club stipulate that one should be held every
six months. For this reason, I call on the executive
board to arrange such a meeting immediately.
\closing{Anticipating an invitation}
\ps PS: I hope you do not take this request amiss.
\setkomavar*{enclseparator}{Enclosure}
\encl{Excerpt from the articles governing general
meetings}
\cc{executive board\\all members}
\end{letter}
\end{document}
See figure 4.20 for the result.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 223

Joe Public
2 Valley
SAMPLEBY
ZY32 1XW
Phone: 0 12 34 56 78
Email: [email protected]

Joe Public, 2 Valley, SAMPLEBY, ZY32 1XW


M
Club member no. 4711
since 11.09.2001
chairman 2003–2005
Joanna Public
1 Hillside
SAMPLESTEAD
WX12 3YZ

Sampleby, 29th February 2011

Subject: Missing general meeting

Dear Madam Chair,

The last general meeting was more than a year ago. I would like to remind you that the
articles of our club stipulate that one should be held every six months. For this reason,
I call on the executive board to arrange such a meeting immediately.

Anticipating an invitation

Joe Public
(former chairman)

PS: I hope you do not take this request amiss.

Enclosure: Excerpt from the articles governing general meetings

cc: executive board


all members

Figure 4.20.: result of a short letter with extended sender,


logo, recipient, extra sender information, place, date, sub-
ject opening, text, closing, modified signature, postscript,
distribution list, enclosure and hole-punch mark

The preceding example shows the most important, although not all possible, elements of a
letter. It can, however, serve quite well as a general template.

\setplength{sigindent}{length }
\setplength{sigbeforevskip}{length }
The closing phrase and signature explanation are typeset in a box whose width is determined
by the length of the longest line of the closing phrase or explanation.
The box will be indented by the distance specified in the sigindent pseudo-length. In the
predefined lco files, this length is set to 0 mm.
Between the closing phrase and the signature explanation, a vertical skip is inserted whose
height is defined in the sigbeforevskip pseudo-length. In the predefined lco files this value
is set to two lines. In this space you can then write your signature.

4.10.8. Letterhead Page Footer


The first page of a letter, the letterhead page, contains not just its own header, the letterhead,
but also its own footer. Just like the letterhead, it will be set not by the page style but directly
within \opening.
Chapter 4: Letters with the scrlttr2 Class or the scrletter Package 224

enlargefirstpage=simple switch
The first page of a letter always uses a different page layout because of the many predefined
elements such as the letterhead or the address. The scrlttr2 class provides a mechanism to
calculate height and vertical alignment of header and footer of the first page independently of the
subsequent pages. If, as a result, the footer of the first page would protrude into the text area,
this text area of the first page is automatically reduced using \enlargethispage.
If the text area should become larger, assuming the footer on the first page permits this,
you can use this option. At best, a little more text will then fit on the first page. See also the
description of the firstfootvpos pseudo-length on page 226. This option takes the standard
values for simple switches, as listed in table 2.5, page 42. The default is false.

firstfoot=simple switch
v2.97e This option determines whether the footer for the letterhead page is output. Switching off
the letterhead page footer with firstfoot=false, has an effect when the enlargefirstpage
option (see