Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
57
In the example above, the notation “\molec C6” is used. This makes use of the fact that
arguments consisting of only one character do not have to be enclosed in parentheses. That is why
“\molec C6” is similar to “\molec{C}{6}”. You might already know this from indices or powers
in mathematical environments, such as “$x^2$” instead of “$x^{2}$” for “x
2
”.
\setkomafont{element }{commands }
\addtokomafont{element }{commands }
\usekomafont{element }
With
v2.8p
the help of the two commands \setkomafont and \addtokomafont, it is possible to
define the commands that change the characteristics of a given element . Theoretically, all
possible statements including literal text could be used as commands . You should, however,
absolutely limit yourself to those statements that really switch only one font attribute. This
will usually be the commands \normalfont, \rmfamily, \sffamily, \ttfamily, \mdseries,
\bfseries
, \upshape, \itshape, \slshape, and \scshape, as well as the font size commands
\Huge
, \huge, \LARGE, \Large, \large, \normalsize, \small, \footnotesize, \scriptsize,
and \tiny. The description of these commands can be found in [
OPHS11
], [
Tea05b
], or
[
Tea05a
]. Color switching commands like \normalcolor (see [
Car05
] and [
Ker07
]) are also
acceptable. The behavior when using other commands, especially those that make redefinitions
or generate output, is not defined. Strange behavior is possible and does not represent a bug.
The command \setkomafont provides a font switching command with a completely new
definition. In contrast to this, the \addtokomafont command merely extends an existing
definition. It is recommended to not use both commands inside the document body, but
only in the document preamble. Usage examples can be found in the paragraphs on the
corresponding element. Names and meanings of the individual items are listed in
table 3.2
.
The default values are shown in the corresponding paragraphs.
With command \usekomafont the current font style may be changed into the font style of
the selected element .
Example: Assume that you want to use for the element
captionlabel
the same font speci-
fication that is used with
descriptionlabel
. This can be easily done with:
\setkomafont{captionlabel}{%
\usekomafont{descriptionlabel}%
}
You can find other examples in the paragraphs on each element.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
58
Table 3.2.: Elements whose type style can be changed with the KOMA-Script command \setkomafont
or \addtokomafont
author
v3.12
author of the document on the main title, i. e., the argument of
\author
when
\maketitle
will be used (see
section 3.7
,
page 65
)
caption
text of a table or figure caption (see
section 3.20
,
page 123
)
captionlabel
label of a table or figure caption; used according to the element
caption
(see
sec-
tion 3.20
,
page 123
)
chapter
title of the sectional unit
\chapter
(see
section 3.16
,
page 95
)
chapterentry
table of contents entry of the sectional unit
\chapter
(see
section 3.9
,
page 72
)
chapterentrypagenumber
page number of the table of contents entry of the sectional unit
\chapter
, variation
on the element
chapterentry
(see
section 3.9
,
page 72
)
chapterprefix
chapter number line at setting
chapterprefix=true
or
appendixprefix=true
(see
section 3.16
,
page 91
)
date
v3.12
date of the document on the main title, i. e., the argument of
\date
when
\maketitle
will be used (see
section 3.7
,
page 65
)
dedication
v3.12
dedication page after the main title, i. e., the argument of
\dedication
when
\maketitle
will be used (see
section 3.7
,
page 67
)
descriptionlabel
labels, i. e., the optional argument of
\item
in the
description
environment (see
section 3.18
,
page 113
)
dictum
dictum, wise saying, or smart slogan (see
section 3.17
,
page 109
)
. . .
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
59
Table 3.2.: Elements whose type style can be changed (continuation)
dictumauthor
author of a dictum, wise saying, or smart slogan; used according to the element
dictum
(see
section 3.17
,
page 109
)
dictumtext
another name for
dictum
disposition
all sectional unit titles, i. e., the arguments of
\part
down to
\subparagraph
and
\minisec
, including the title of the abstract; used before the element of the corre-
sponding unit (see
section 3.16
ab
page 90
)
footnote
footnote text and marker (see
section 3.14
,
page 85
)
footnotelabel
mark of a footnote; used according to the element
footnote
(see
section 3.14
,
page 85
)
footnotereference
footnote reference in the text (see
section 3.14
,
page 85
)
footnoterule
horizontal rule
v3.07
above the footnotes at the end of the text area (see
section 3.14
,
page 88
)
labelinglabel
labels, i. e., the optional argument of
\item
in the
labeling
environment (see
sec-
tion 3.18
,
page 114
)
labelingseparator
separator, i. e., the optional argument of the
labeling
environment; used according
to the element
labelinglabel
(see
section 3.18
,
page 114
)
minisec
title of
\minisec
(see
section 3.16
ab
page 100
)
pagefoot
only used if package scrlayer-scrpage has been loaded (see
chapter 5
,
page 234
)
. . .
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
60
Table 3.2.: Elements whose type style can be changed (continuation)
pagehead
another name for
pageheadfoot
pageheadfoot
the head of a page, but also the foot of a page (see
section 3.12
ab
page 76
)
pagenumber
page number in the header or footer (see
section 3.12
)
pagination
another name for
pagenumber
paragraph
title of the sectional unit
\paragraph
(see
section 3.16
,
page 95
)
part
title of the
\part
sectional unit, without the line containing the part number (see
section 3.16
,
page 95
)
partentry
table of contents entry of the sectional unit
\part
(see
section 3.9
,
page 72
)
partentrypagenumber
Page number of the table of contents entry of the sectional unit
\part
variation on
the element
partentry
(see
section 3.9
,
page 72
)
partnumber
line containing the part number in a title of the sectional unit
\part
(see
section 3.16
,
page 95
)
publishers
v3.12
publishers of the document on the main title, i. e., the argument of
\publishers
when
\maketitle
will be used (see
section 3.7
,
page 65
)
section
title of the sectional unit
\section
(see
section 3.16
,
page 95
)
sectionentry
table of contents entry of sectional unit
\section
(only available in scrartcl, see
section 3.9
,
page 72
)
. . .
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
61
Table 3.2.: Elements whose type style can be changed (continuation)
sectionentrypagenumber
page number of the table of contents entry of the sectional unit
\section
, variation
on element
sectionentry
(only available in scrartcl, see
section 3.9
,
page 72
)
sectioning
another name for
disposition
subject
categorization of the document, i. e., the argument of
\subject
on the main title
page (see
section 3.7
,
page 65
)
subparagraph
title of the sectional unit
\subparagraph
(see
section 3.16
,
page 95
)
subsection
title of the sectional unit
\subsection
(see
section 3.16
,
page 95
)
subsubsection
title of the sectional unit
\subsubsection
(see
section 3.16
,
page 95
)
subtitle
subtitle of the document, i. e., the argument of
\subtitle
on the main title page
(see
section 3.7
,
page 65
)
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 65
)
titlehead
v3.12
head above the main title of the document, i. e., the argument of
\titlehead
when
\maketitle
will be used (see
section 3.7
,
page 65
)
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
62
\usefontofkomafont{element }
\useencodingofkomafont{element }
\usesizeofkomafont{element }
\usefamilyofkomafont{element }
\useseriesofkomafont{element }
\useshapeofkomafont{element }
Sometimes
v3.12
and despite the recommendation users use the font setting feature of elements
not only for font settings but for other settings too. In this case it may be useful to
switch only to the font setting of an element but not to those other settings. You may
use \usefontofkomafont in such cases. 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 may also switch to one of those attributes only using one of the other commands. Note,
that \usesizeofkomafont will activate both, the font size and the baseline skip.
You should not misunderstand these commands as a legitimation of using all kind of com-
mands at the font setting of an element. Hence this would result in errors sooner or later (see
section 21.3
,
page 444
).
3.7. Document Titles
In general we distinguish two kinds of document titles. First known are title pages. In this
case the document title will be placed together with additional document information, like the
author, on a page of its own. Besides the main title page, several further title pages may exist,
like the half-title or bastard title, publisher data, dedication, or similar. The second known
kind of document title is the in-page title. In this case, the document title is placed at the top
of a page and specially emphasized, and may be accompanied by some additional information
too, but it will be followed by more material in the same page, for instance by an abstract, or
the table of contents, or even a section.
titlepage=simple switch
titlepage=firstiscover
Using
\maketitle
(see
page 63
), this option
v3.00
switches between document title pages and in-
page title. For simple switch , any value from
table 2.5
,
page 39
may be used.
The option titlepage=true or titlepage makes L
A
TEX use separate pages for the titles.
Command
\maketitle
sets these pages inside a
titlepage
environment and the pages nor-
mally have neither header nor footer. In comparison with standard L
A
TEX, KOMA-Script
expands the handling of the titles significantly.
The option titlepage=false specifies that an in-page title is used. This means that the
title is specially emphasized, but it may be followed by more material on the same page, for
instance by an abstract or a section.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
63
The third choice,
v3.12
titlepage=firstiscover
does not only select title pages. It addition-
ally prints the first title page of
\maketitle
, this is either the extra title or the main title,
as a cover page. Every other setting of option titlepage would cancel this setting. The
margins of the cover page are given by \coverpagetopmargin, \coverpagebottommargin,
\coverpageleftmargin
und \coverpagerightmargin. The defaults of these depend on the
lengths \topmargin and \evensidemargin and can be changed using \renewcommand.
The default of classes scrbook and scrreprt is usage of title pages. Class scrartcl, on the other
hand, uses in-page titles as default.
\begin{titlepage}
. . . \end{titlepage}
With the standard classes and with KOMA-Script, all title pages are defined in a special
environment, the titlepage environment. This environment always starts a new page — in
the two-sided layout a new right page — and in single column mode. For this page, the style
is changed by
\thispagestyle
{empty}
, so that neither page number nor running heading are
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
, that will be
described next; it is advisable to design a new one with the help of this environment.
Example: Assume 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?
\maketitle[page number ]
While the the standard classes produce at least one title page that may have the three items
title, author, and date, with KOMA-Script the \maketitle command can produce up to six
pages. In contrast to the standard classes, the \maketitle macro in KOMA-Script accepts an
optional numeric argument. If it is used, this number is made the page number of the first title
page. However, this page number is not output, but affects only the numbering. You should
choose an odd number, because otherwise the whole count gets mixed up. In my opinion there
are only two meaningful applications for the optional argument. On the one hand, one could
give to the half-title the logical page number −1 in order to give the full title page the number
1. On the other hand, it could be used to start at a higher page number, for instance, 3, 5, or
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
64
7, to accommodate other title pages added by the publishing house. The optional argument
is ignored for in-page titles. However, the page style of such a title page can be changed by
redefining the
\titlepagestyle
macro. For that see
section 3.12
,
page 79
.
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. By the way, you should
note that \maketitle should not be used inside a
titlepage
environment. Like shown in the
examples, one should use either \maketitle or
titlepage
only, but not both.
The commands explained below only define the contents of the title pages. Because of this,
they have to be used before \maketitle. It is, however, not necessary and, when using, e. g.,
the babel package, not recommended to use these in the preamble before \begin{document}
(see [
BB13
]). Examples can be found at the end of this section.
\extratitle{half-title }
In earlier times the inner book was often not protected from dirt by a cover. This task was then
taken over by the first page of the book which carried mostly a shortened title called the half-title.
Nowadays the extra page is often applied before the real full 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
left to the user. The back of the half-title remains empty. The half-title has its own title page
even when in-page titles are used. The output of the half-title defined with \extratitle takes
place as part of the titles produced by
\maketitle
.
Example: Let’s go back to the previous example and assume that the spartan “Me” is the
half-title. The full title should still follow the half-title. One can proceed as follows:
\documentclass{scrbook}
\begin{document}
\extratitle{\textbf{\Huge Me}}
\title{It’s me}
\maketitle
\end{document}
You can center 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}
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
65
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 }
The contents of the full title page are defined by seven elements. The output of the full title
page occurs as part of the title pages of
\maketitle
, whereas the now listed elements only
define the corresponding elements.
The title head is defined with the command \titlehead. It is typeset with the font of
the homonymous element in regular justification and full width at the top of the page. It can
be freely designed by the user.
The subject is output with the font of the homonymous element immediately above the
title
.
The title is output with a very large font size. Beside
v2.8p
all other element the font size is,
however, not affected by the font switching element title (see
table 3.4
,
page 66
).
The subtitle
v2.97c
is output with the font of the homonymous element just below the title.
Below the subtitle appears the author . Several authors can be specified in the argument
of \author. They should be separated by \and. The font of element author is used for the
output of the authors.
Below the author or authors appears the date in the font of the homonymous element.
The default value is the present date, as produced by \today. The \date command accepts
arbitrary information — even an empty argument.
Finally comes the publisher . Of course this command can also be used for any other
information of little importance. If necessary, the \parbox command can be used to typeset
this information over the full page width like a regular paragraph instead of centering it. Then
it is to be considered equivalent to the title head. However, note that this field is put above
any existing footnotes. The font of element publishers is used for the output.
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,
e. g., at the argument author of the command \author.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
66
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
While
v3.12
printing the title elements the equal named font switching elements will be used for
all them. The defaults, that may be found in
table 3.3
, may be changed using the commands
\setkomafont
and
\addtokomafont
(see
section 3.6
,
page 57
).
With the exception of titlehead and possible footnotes, all the items are centered hor-
izontally. The information is summarised in
table 3.4
. Please 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: Assume 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 is to be used, including author and delivery date. The adviser must also be
indicated, together with the fact that the document is a dissertation. This can be
obtained as follows:
\documentclass{scrbook}
\usepackage[english]{babel}
\begin{document}
\titlehead{{\Large Unseen University
\hfill SS~2002\\}
Higher Analytical Institute\\
Table 3.4.: Font and
horizontal position-
ing of the elements
in the main title
page in the order
of their vertical po-
sition from top to
bottom when type-
set with
\maketitle
Element
Command
Font
Orientation
Title head \titlehead
\usekomafont
{titlehead}
justified
Subject
\subject
\usekomafont
{subject}
centered
Title
\title
\usekomafont
{title}\huge
centered
Subtitle
\subtitle
\usekomafont
{subtitle}
centered
Authors
\author
\usekomafont
{author}
centered
Date
\date
\usekomafont
{date}
centered
Publishers \publishers
\usekomafont
{publishers}
centered
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
67
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 frequent misunderstanding concerns the role of the full title page. It is often erroneously
assumed that the cover or dust cover is meant. Therefore, it is frequently expected that the title
page does not follow the normal page layout, but has equally large left and right margins.
However, if one takes a book and opens it, one notices very quickly at least one title page under
the cover within the so-called inner book. Precisely these title pages are produced by
\maketitle
.
As is the case with the half-title, the full title page belongs to the inner book, and therefore
should have the same page layout as the rest of the document. A cover is actually something that
should be created in a separate document. The cover often has a very individual 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, possibly cardboard, and possibly
with another printer.
Nevertheless, since KOMA-Script 3.12 the first title page of
\maketitle
can be printed as a
cover page with different margins. For more information about this see the description of option
titlepage=firstiscover
on
page 62
.
\uppertitleback{titlebackhead }
\lowertitleback{titlebackfoot }
With the standard classes, the back of the title page of a double-side print is left empty.
However, with KOMA-Script the back of the full title page can be used for other information.
Exactly two elements which the user can freely format are recognized: titlebackhead and
titlebackfoot
. The head can reach up to the foot and vice versa. If one takes this manual as
an example, the exclusion of liability was set with the help of the \uppertitleback command.
\dedication{dedication }
KOMA-Script provides a page for dedications. The dedication is centered and uses a slightly
larger type size given by the font of the homonymous element. The font can be changed using
command
\setkomafont
or
\addtokomafont
(see
section 3.6
,
page 56
). The back is empty
like the back page of the half-title. The dedication page is produced by
\maketitle
and must
therefore be defined before this command is issued.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
68
Example: This time assume that you have written a poetry book and you want to dedicate
it to your wife. 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{Selfmockery Publishers}
\dedication{To my treasure hazel-hen\\
in eternal love\\
from your dormouse.}
\maketitle
\end{document}
Please use your own favorite pet names.
3.8. Abstract
Particularly with articles, more rarely with reports, there is a summary directly under the
scrartcl
,
scrreprt
title and before the table of contents. When using an in-page title, this summary is normally
a kind of left- and right-indented block. In contrast to this, a kind of chapter or section is
printed using title pages.
abstract=simple switch
In
v3.00
the standard classes the
abstract
environment sets the text “Abstract” centered before
scrreprt
,
scrartcl
the summary text. This was normal practice in the past. In the meantime, newspaper reading
has trained readers to recognize a displayed 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 surprising when precisely this title appears small and centered. KOMA-Script provides
the possibility of including or excluding the abstract’s title with the options abstract. For
simple switch
, any value from
table 2.5
,
page 39
may be used.
Books typically use another type of summary. In that case there is usually a dedicated
summary chapter at the beginning or end of the book. This chapter is often combined with
the introduction or a description of wider prospects. Therefore, the class scrbook has no
abstract
environment. A summary chapter is also recommended for reports in a wider sense,
like a Master’s or Ph.D. thesis.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
69
\begin{abstract}
. . . \end{abstract}
scrartcl
,
scrreprt
Some L
A
TEX classes offer a special environment for this summary, the abstract environment.
This is output directly, as it is not a component of the titles set by
\maketitle
. Please note
that abstract is an environment, not a command. Whether the summary has a heading or
not is determined by the option
abstract
(see above).
With books (scrbook) the summary is frequently a component of the introduction or a
separate chapter at the end of the document. Therefore no abstract environment is provided.
When using the class scrreprt it is surely worth considering whether one should not proceed
likewise. See commands
\chapter*
and
\addchap
or
\addchap*
at
section 3.16
from
page 99
onwards.
When using an in-page title (see option
titlepage
,
section 3.7
,
page 62
), the abstract is set
using the environment quotation (see
section 3.18
,
page 116
) internally. Thereby paragraphs
will be set with indentation of the first line. If that first paragraph of the abstract should not
be indented, this indent may be disabled using \noindent just after \begin{abstract}.
3.9. Table of Contents
The table of contents is normally set after the document title and an optional existing abstract.
Often one may find additional lists of floating environments, e. g., the list of tables and the
list of figures, after the table of contents (see
section 3.20
).
toc=selection
It is becoming increasingly common to find entries in the table of contents for the lists of tables
and figures, for the bibliography, and, sometimes, even for the index. This is surely also related
to the recent trend of putting lists of figures and tables at the end of the document. Both lists
are similiar to the table of contents in structure and intention. I’m therefore sceptical of this
evolution. Since it makes no sense to include only one of the lists of tables and figures in the
table of contents, there exists only one selection
v3.00
listof
that 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 (see [
Lin01
]) or the floatrow (see [
Lap08
]). All these lists are unnumbered, since
they contain entries that reference other sections of the document. If one wants to ignore this
general agreement, one may use selection listofnumbered.
The option index=totoc 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
sectional units. Despite
v3.18
objection of the author, KOMA-Script does also support to ignore
this general agreement using toc=indexnumbered.
The bibliography is a different kind of listing. It does not list the contents of the present
document but refers instead to external documents. For that reason, it could be argued that
it qualifies as a chapter (or section) and, as such, should be numbered. The option toc=
bibliographynumbered
has this effect, including the generation of the corresponding entry
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
70
in the table of contents. I personally think that this reasoning would lead us to consider a
classical list of sources also to be a separate chapter. On the other hand, the bibliography
is finally not something that was written by the document’s author. In view of this, the
bibliography merits nothing more than an unnumbered entry in the table of contents, and
that can be achieved with toc=bibliography.
The table of contents is normally
v2.8q
set up so that different sectional units have different
indentations. The section number is set left-justified in a fixed-width field. This default setup
is selected with the option
v3.00
toc=graduated
.
When there are many sections, the corresponding numbering tends to become very wide, so
that the reserved field overflows. The German FAQ [
Wik
] suggests that the table of contents
should be redefined in such a case. KOMA-Script offers an alternative format that avoids the
problem completely. If the option toc=flat is selected, then no variable indentation is applied
to the titles of the sectional units. Instead, a table-like organisation is used, where all unit
numbers and titles, respectively, are set in a left-justified column. The space necessary for the
unit numbers is thus determined automatically.
The
table 3.5
shows an overview of possible values for selection of toc.
Table 3.5.: Possible values of option toc to set form and contents of the table of contents
bibliography
, bib
The bibliography will be represented by an entry at the table of contents, but will
not be numbered.
bibliographynumbered
, bibnumbered, numberedbibliography, numberedbib
The bibliography will be represented by an entry at the table of contents and will
be numbered.
chapterentrywithdots
, chapterentrydotfill
v3.15
The chapter entries of classes scrbook and scrreprt also use dots to separate the
headings text from the page number.
chapterentrywithoutdots
, chapterentryfill
v3.15
The chapter entries of classes scrbook and scrreprt use white space to separate the
headings text from the page number.
flat
, left
The table of contents will be set in table form. The numbers of the headings will be
at the first column, the heading text at the second column, and the page number at
the third column. The amount of space needed for the numbers of the headings will
be determined by the detected needed amount of space at the previous L
A
TEX run.
. . .
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
71
Table 3.5.: Possible values of option toc (continuation)
graduated
, indent, indented
The table of contents will be set in hierarchical form. The amount of space for the
heading numbers is limited.
index
, idx
The index will be represented by an entry at the table of contents, but will not be
numbered.
indexnumbered
v3.18
The index will be represented by an entry at the table of contents and will be
numbered.
listof
The lists of floating environments, e. g., the list of figures and the list of tables, will
be represented by entries at the table of contents, but will not be numbered.
listofnumbered
, numberedlistof
The lists of floating environments, e. g., the list of figures and the list of tables, will
be represented by entries at the table of contents and will be numbered.
nobibliography
, nobib
The bibliography will not be represented by an entry at the table of contents.
noindex
, noidx
The index will not be represented by an entry at the table of contents.
nolistof
The lists of floating environments, e. g., the list of figures and the list of tables, will
not be represented by entries at the table of contents.
sectionentrywithdots
, sectionentrydotfill
v3.15
The section entries of class scrartcl also use dots to separate the headings text from
the page number.
sectionentrywithoutdots
, sectionentryfill
v3.15
The section entries of class scrartcl use white space to separate the headings text
from the page number.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
72
chapterentrydots=simple switch
sectionentrydots=simple switch
These
v3.15
options configure a dotted separation line between the text and the page number of the
chapter entries of classes scrbook and scrreprt, or of the section entries of class scrartcl in the
scrbook
,
scrreprt
scrartcl
table of contents. For simple switch , any value from
table 2.5
,
page 39
may be used. The
default is false. It selects an empty gap instead of dots.
If a dotted line is selected, you can change their font using element chapterentrydots or
sectionentrydots
. The font also depends on the element of the page number of the entry
(see also
section 3.6
,
page 57
and
table 3.2
,
page 58
). The defaults of the elements are shown
in
table 3.6
. Please note that the dots of all entries are equally aligned only if all dots use the
same font.
\tableofcontents
The production of the table of contents is done by the \tableofcontents command. To get
a correct table of contents, at least two L
A
TEX runs are necessary after every change. The
contents and the form of the table of contents may be influenced with the above described
option
toc
. After changing the settings of this option, at least two L
A
TEX runs are needed
again.
The entry for the highest sectional unit below
\part
, i. e.,
\chapter
with scrbook and
scrreprt or
\section
with scrartcl is not indented. There are no dots between the text of the
sectional unit heading and the page number. The typographic reasons for this are that the
font is usually different, and the desire for appropriate emphasis. The table of contents of this
manual is a good example of these considerations. The font style
v2.97c
is, however, affected by the
settings of the element partentry, and for classes scrbook and scrreprt by chapterentry, and
for class scrartcl by sectionentry. The font style of the page numbers may be set dissenting
from these elements using partentrypagenumber and chapterentrypagenumber respectively
sectionentrypagenumber
(see
section 3.6
,
page 57
, and
table 3.2
,
page 58
). If the optional
dots of the entries of
\chapter
or
\section
are used, you can change their font using element
chapterentrydots
or sectionentrydots. The font also depends on the element of the page
number of the entry (see also
section 3.6
,
page 57
and
table 3.2
,
page 58
). The defaults of the
elements are shown in
table 3.6
. Please note that the dots of all entries are aligned same only
if all dots use the same font.
tocdepth
Normally, the units included in the table of contents are all the units from
\part
to
\subsection
for the classes scrbook and scrreprt or from
\part
to
\subsubsection
for the
class scrartcl. The inclusion of a sectional unit in the table of contents is controlled by the
counter tocdepth. This has the value −1 for
\part
, 0 for
\chapter
, and so on. By increment-
ing or decrementing the counter, one can choose the lowest sectional unit level to be included
in the table of contents. The same happens with the standard classes.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
73
Table 3.6.: Font style de-
faults of the elements of
the table of contents
Element
Default font style
partentry
\usekomafont
{disposition}\large
partentrypagenumber
chapterentry
\usekomafont
{disposition}
chapterentrydots
\normalfont
chapterentrypagenumber
sectionentry
\usekomafont
{disposition}
sectionentrydots
\normalfont
sectionentrypagenumber
Please note that for
\part
the values of tocdepth and
secnumdepth
(see
section 3.16
,
page 106
) are not the same in scrartcl. Therefore, you should not use
\partnumdepth
to set
scrartcl
the value of tocdepth.
Example: Assume that you are preparing an article that uses the sectional unit
\subsubsection
. However, you do not want this sectional unit to appear in the
table of contents. The preamble of your document might contain the following:
\documentclass{scrartcl}
\setcounter{tocdepth}{2}
You set the counter tocdepth to 2 because you know that this is the value for
\subsection
. If you know that scrartcl normally includes all levels down to
\subsubsection
in the table of contents, you can simply decrement the counter
tocdepth
by one:
\documentclass{scrartcl}
\addtocounter{tocdepth}{-1}
How much you should add to or subtract from the tocdepth counter can also be
found by looking at the table of contents after the first L
A
TEX run.
A small hint in order that you do not need to remember which sectional unit has which number:
in the table of contents count the number of units required extra or less and then, as in the
above example, use \addtocounter to add or subtract that number to or from tocdepth.
3.10. Paragraph Markup
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
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 reference point. In extreme cases, it is
very difficult to detect whether a line is full or not. Furthermore, it is found that a marker
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
74
at the paragraph’s end tends to be easily forgotten by the start of the next line. A marker
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 if a new one begins. Also, when
starting to read at the top of a new page it might be necessary to look at the previous page
in order 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 extremely redundant and therefore should be avoided. The indentation is perfectly suffi-
cient by itself. The only drawback of indentation is the reduction of the line length. The
use of inter-paragraph spacing is therefore justified when using short lines, for instance in a
newspaper.
parskip=manner
Once in a while there are requests for a document layout with vertical inter-paragraph spacing
instead of indentation. The KOMA-Script classes provide with option parskip
v3.00
several capa-
bilities to use inter-paragraph spacing instead of paragraph indent. The manner consists of
two elements. The first element is either full or half, meaning the space amount of one line
or only half of a line. The second element is “*”, “+”, or “-”, and may be omitted. Without
the second element the last line of a paragraph will end with white space of at least 1 em.
With the plus character as second element the white space amount will be a third, and with
the asterisk a fourth, of the width of a normal line. The minus variant does not take care
about the white space at the end of the last line of a paragraph.
The setting may be changed at any place inside the document. In this case the command
\selectfont
v3.08
will be called implicitly. The change will be valid and may be seen from the
next paragraph.
Besides the resulting eight possible combinations for manner , the values for simple switches
shown at
table 2.5
,
page 39
may be used. Switching on the option would be the same as
using full without annex and therefore will result in inter-paragraph spacing of one line with
at least 1 em white space at the end of the last line of each paragraph. Switching off the
options would reactivate the default of 1 em indent at the first line of the paragraph instead
of paragraph spacing. All the possible values of option parskip are shown in
table 3.7
.
Table 3.7.: Possible values of option parskip to select the paragraph mark
false
, off, no
paragraph indentation instead of vertical space; the last line of a paragraph may be
arbitrarily filled
. . .
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
75
Table 3.7.: Possible values of option parskip (continuation)
full
, true, on, yes
one line vertical space between paragraphs; there must be at least 1 em free space in
the last line of a paragraph
full-
one line vertical space between paragraphs; the last line of a paragraph may be
arbitrarily filled
full+
one line vertical space between paragraphs; there must be at least a third of a line
free space at the end of a paragraph
full*
one line vertical space between paragraphs; there must be at least a quarter of a line
free space at the end of a paragraph
half
half a line vertical space between paragraphs; there must be at least 1 em free space
in the last line of a paragraph
half-
one line vertical space between paragraphs
half+
half a line vertical space between paragraphs; there must be at least a third of a line
free space at the end of a paragraph
half*
half a line vertical space between paragraphs; there must be at least a quarter of a
line free space at the end of a paragraph
never
there
v3.08
will be no inter-paragraph spacing even if additional vertical spacing is needed
for the vertical adjustment with \flushbottom
All eight full and half option values also change the spacing before, after, and inside
list environments. This avoids the problem of these environments or the paragraphs inside
them having a larger separation than the separation 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 follows parskip=false. In this case, there is no
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
76
spacing between paragraphs, only an indentation of the first line by 1 em.
3.11. Detection of Odd and Even Pages
In double-sided documents we distinguish left and right pages. Left pages always have an
even page number, right pages always have an odd page number. Thus, they are most often
referred to as even and odd pages in this guide. This also means that the detection of a left
or right page is same as detection of even and odd page numbers.
There’s no distinction in left and right pages in single-sided documents. Nevertheless there
are pages with even or odd page numbers.
\ifthispageodd{true part }{false part }
If one wants to find out with KOMA-Script whether a text falls on an even or odd page, one
can use the \ifthispageodd command. The true part argument is executed only if the
command falls on an odd page. Otherwise the false part argument is executed.
Example: Assume that 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.
which will result 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 L
A
TEX runs are required after every text modification. Only
then the decision is correct. In the first run a heuristic is used to make the first choice.
At
section 21.1
,
page 441
experts may find more information about the problems detecting
left and right pages or even and odd page number.
3.12. Head and Foot Using Predefined Page Styles
One of the general characteristics of a document is the page style. In L
A
TEX this means mostly
the contents of headers and footers.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
77
headsepline=simple switch
footsepline=simple switch
In
v3.00
order to have or not to have a rule separating the header from the text body, use the option
headsepline
with any value shown in
table 2.5
,
page 39
. Activation of the option will result
in such a separation line. Similarly, activation of option footsepline switches on a rule above
the foot line. Deactivation of any of the options will deactivate the corresponding rule.
These options have no effect with the page styles empty and plain, because there is no
header in this case. Such a line always has the effect of visually bringing header and text body
closer together. That does not mean that the header must now be moved farther from the text
body. Instead, the header should be considered as belonging to the text body for the purpose
of page layout calculations. KOMA-Script takes this into account by automatically passing
the option
headinclude
to the typearea package whenever the headsepline option is used.
KOMA-Script behaves similar to
footinclude
using footsepline. Package scrlayer-scrpage
(see
chapter 5
) adds additional features to this.
\pagestyle{page style}
\thispagestyle{local page style }
Usually one distinguishes four different page styles:
empty is the page style with entirely empty headers and footers. In KOMA-Script this is
completely identical to the standard classes.
headings is the page style with running headings in the header. These are headings for which
titles are automatically inserted into the header. With the classes scrbook and scrreprt
scrbook
,
scrreprt
the titles of chapters and sections are repeated in the header for double-sided layout —
with KOMA-Script on the outer side, with the standard classes on the inner side. The
page number is set on the outer side of the footer with KOMA-Script; with the standard
classes it is set on the inner side of the header. In one-sided layouts only the titles of
the chapters are used and are, with KOMA-Script, centered in the header. The page
numbers are set centered in the footer with KOMA-Script. scrartcl behaves similarly, but
scrartcl
starting a level deeper in the section hierarchy with sections and subsections, because
the chapter level does not exist in this case.
While the standard classes automatically set running headings always in capitals,
KOMA-Script applies the style of the title. This has several typographic reasons. Cap-
itals as a decoration are actually far too strong. If one applies them nevertheless, they
should be set in a one point smaller type size and with tighter spacing. The standard
classes do not take these points into consideration.
Beyond this KOMA-Script classes support rules below the head and above the foot using
options
headsepline
and
footsepline
which are described above.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
78
Table 3.8.: Default values for the ele-
ments of a page style
Element
Default value
pagefoot
pageheadfoot
\normalfont\normalcolor\slshape
pagenumber
\normalfont\normalcolor
myheadings corresponds mostly to the page style headings, but the running headings are
not automatically produced — they have to be defined by the user. The commands
\markboth
and
\markright
can be used for that purpose (see below).
plain is the page style with empty header and only a page number in the footer. With the
standard classes this page number is always centered in the footer. With KOMA-Script
the page number appears on double-sided layout on the outer side of the footer. The
one-sided page style behaves like the standard setup.
The page style can be set at any time with the help of the \pagestyle command and takes
effect with the next page that is output. If one uses \pagestyle just before a command, that
results in an implicit page break and if the new page style should be used at the resulting new
page first, a
\cleardoublepage
just before \pagestyle will be useful. But usually one sets
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, one uses the \thispagestyle command.
This also happens automatically at some places in the document. For example, the instruction
\thispagestyle{
\chapterpagestyle
}
is issued implicitly on the first page of a chapter.
Please note that the change between automatic and manual running headings is no longer
performed by page style changes when using the scrlayer-scrpage package, but instead via
special instructions. The page styles headings and myheadings should not be used together
with this package.
In order to change the font style used in the header, footer, or for the page number
v2.8p
, please
use the interface described in
section 3.6
,
page 57
. The same element is used for header
and footer, which you can designate with pageheadfoot. The element for the page number
within the header or footer is called pagenumber. The element pagefoot, that is additionally
supported by the KOMA-Script classes, will be used only if a page style has been defined that
has text at the foot line, using package scrlayer-scrpage (see
chapter 5
,
page 234
).
The default settings can be found in
table 3.8
.
Example: Assume that you want to set header and footer in a smaller type size and in italics.
However, the page number should not be set in italics but bold. Apart from the
fact that the result will look horrible, you can obtain this as follows:
\setkomafont{pageheadfoot}{%
\normalfont\normalcolor\itshape\small
}
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
79
\setkomafont{pagenumber}{\normalfont\bfseries}
If you want only that, in addition to the default slanted variant, a smaller type
size is used, it is sufficient to use the following:
\addtokomafont{pagehead}{\small}
As you can see, the last example uses the element pagehead. You can achieve the
same result using pageheadfoot instead (see
table 3.2
on
page 58
).
It is not possible to use these methods to force capitals to be used automatically for the
running headings. For that, please use the scrlayer-scrpage package (see
chapter 5
,
page 244
).
If you define your own page styles, the commands
\usekomafont
{pageheadfoot}
,
\usekomafont
{pagenumber}
, and
\usekomafont
{pagefoot}
can be useful. If you do not
use the KOMA-Script package scrlayer-scrpage (see
chapter 5
) for that, but, for example, the
package fancyhdr (see [
vO04
]), you can use these commands in your definitions. Thereby you
can remain compatible with KOMA-Script as much as possible. If you do not use these com-
mands in your own definitions, changes like those shown in the previous examples have no
effect. The package scrlayer-scrpage takes care to keep the maximum possible compatibility
with other packages itself.
\markboth{left mark }{right mark }
\markright{right mark }
With page style myheadings, there’s no automatic setting of the running head. Instead of
this one would set it with the help of commands \markboth and \markright. Thereby left
mark
normally will be used at the head of even pages and right mark at the heads of odd
pages. With one-sided printing, only the right mark exists. Using package scrlayer-scrpage,
the additional command
\markleft
exists.
The commands may be used with other page styles too. Combination with automatic
running head, e. g., with page style headings, limits the effect of the commands until the next
automatic setting of the corresponding marks.
\titlepagestyle
\partpagestyle
\chapterpagestyle
\indexpagestyle
For some pages, a different page style is chosen with the help of the command
\thispagestyle
.
Which page style this actually is, is defined by these four macros, of which \partpagestyle
and \chapterpagestyle are found only with classes scrbook and scrreprt, but not in scrartcl.
scrbook
,
scrreprt
The default value for all four cases is plain. The meaning of these macros can be taken from
table 3.9
. The page styles can be redefined with the \renewcommand macro.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
80
Table 3.9.: Macros to set up page style of special pages
\titlepagestyle
Page style for a title page when using in-page titles.
\partpagestyle
Page style for the pages with
\part
titles.
\chapterpagestyle
Page style for the first page of a chapter.
\indexpagestyle
Page style for the first page of the index.
Example: Assume that you want the pages with a
\part
heading to have no number. Then
you can use the following command, for example in the preamble of your document:
\renewcommand*{\ Dostları ilə paylaş: |