10.6. Text Markup
What is described in
section 3.6
applies, mutatis mutandis. So if you have alread read and
understood
section 3.7
you can switch to
page 270
.
L
A
TEX offers different possibilities for logical and direct markup of text. Selection of the font
family commands, as well as choosing the font size and width is supported. More information
about the standard font facilities may be found at [
OPHS11
], [
Tea05b
], and [
Tea05a
].
\textsuperscript{Text }
\textsubscript{Text }
The L
A
TEX-Kern already defines the command \textsuperscript to superscript text. Un-
fortunately, until release 2015/01/01 L
A
TEX itself does not offer a command to produce text
in subscript instead of superscript. KOMA-Script defines \textsubscript for this purpose.
You may find an example of usage at
section 3.6
,
page 56
.
Chapter 10: KOMA-Script Features for other Classes with Package scrextend
269
\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
,
page 58
. However only the listed elements for the document title, dicta, footnotes, and the
labeling
environment are supported. Though element
disposition
exists, it will also be
used for the document title only. This has been done for compatibility with the KOMA-Script
classes. 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: Assumed, you want to print the document title in a serif font and with red colour.
You may do this using:
\setkomafont{title}{\color{red}}
Package color or xcolor will be needed for command \color{red}. The additional
usage of \normalfont is not needed in this case, because it is already part of the
definition of the title itself. This example also needs option
extendedfeature=
title
(see
section 10.3
,
page 267
).
Chapter 10: KOMA-Script Features for other Classes with Package scrextend
270
\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
).
10.7. Document Titles
What is written in
section 3.7
applies, mutatis mutandis. So if you have alread read and
understood
section 3.7
you can jump to
section 10.8
on
page 274
. But there’s a difference: The
document title capabilities of scrextend are part of the optional, advanced features. Therfore
they are only available, if
extendedfeature=title
has been selected while loading the package
(see
section 10.3
,
extendedfeature
).
Beyond that scrextend cannot be used with a KOMA-Script class together. Because of this
\documentclass{scrbook}
must be replaced by
\documentclass{book}
\usepackage[extendedfeature=title]{scrextend}
at all examples from
section 3.7
, if scrextend should be used.
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.
Chapter 10: KOMA-Script Features for other Classes with Package scrextend
271
titlepage=simple switch
titlepage=firstiscover
Using
\maketitle
(see
page 271
), this option 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 makes L
A
TEX use separate pages for the titles. Command
\maketitle
sets these pages inside a
titlepage
environment and the pages normally 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.
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 depends on the used class and scrextend handles it compatible to the standard
class. If a class does not set up a comparable default, in-page title will be used.
\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.
A simple example for a title page with titlepage is shown in
section 3.7
on
page 63
\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
Chapter 10: KOMA-Script Features for other Classes with Package scrextend
272
1. On the other hand, it could be used to start at a higher page number, for instance, 3, 5, or
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
.
A simple example for a title page with extra title and main title is shown in
section 3.7
on
page 64
\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.
Chapter 10: KOMA-Script Features for other Classes with Package scrextend
273
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 all other element the font size is,
however, not affected by the font switching element title (see
table 3.4
,
page 66
).
The subtitle 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.
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
,
page 66
, may be changed using the
commands
\setkomafont
and
\addtokomafont
(see
section 10.6
,
page 269
).
With the exception of titlehead and possible footnotes, all the items are centered hori-
zontally. The information is summarised in
table 3.4
,
page 66
. 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
.
An example for a title page with all elements provided by KOMA-Script for the main title
page is shown in
section 3.7
on
page 66
.
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
Chapter 10: KOMA-Script Features for other Classes with Package scrextend
274
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 271
.
\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 10.6
,
page 268
). 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.
An example with all title pages provided by KOMA-Script is shown in
section 3.7
on
page 68
.
10.8. Detection of Odd and Even Pages
What is described in
section 3.11
applies, mutatis mutandis. So if you have alread read and
understood
section 3.11
you can switch to
page 275
,
page 275
.
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.
\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.
Chapter 10: KOMA-Script Features for other Classes with Package scrextend
275
which will result in the output
This page has an odd 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.
10.9. Head and Foot Using Predefined Page Styles
One of the basic features of a document is the page style. Page style in L
A
TEX means mainly
header and footer of the page. Package scrextend does not define any page style, but it uses
and expects the definition some page styles.
\titlepagestyle
Some pages have a different page style automatically selected using
\thispagestyle
. With
scrextend this will be used currently for the page with the in-page title if and only if option
extendedfeature=title
has been used (see
section 10.3
,
page 267
). In this case the page
style stored at
\thispagestyle
will be used. Default for
\thispagestyle
is plain. This
page style is predefined by the L
A
TEX kernel. So it should be available always.
10.10. Interleaf Pages
What is described in
section 3.13
applies, mutatis mutandis. So if you have alread read and
understood
section 3.13
you can switch to
section 10.11
,
page 278
.
Interleaf pages are pages that are intended to stay blank. Originally these pages were really
completely white. L
A
TEX, on the other hand, by default sets those pages with the current valid
page style. So those pages may have a head and a pagination. KOMA-Script provides several
extensions to this.
Interleaf pages may be found in books mostly. Because chapters in books commonly start
on odd pages, sometimes a left page without contents has to be added before. This is also the
reason that interleaf pages only exist in double-sided printing. The unused back sides of the
one-sided printings are not interleaf pages, really, although they may seem to be such pages.
|