Example: You want to point out that the sorting of the references in the bibliography is not
according to their occurrence in the text, but in alphabetical order. You use the
following command:
\setbibpreamble{References are in alphabetical order.
134
Chapter 3.
References with more than one author are sorted
according to the first author.\par\bigskip}
The \bigskip command makes sure that the preamble and the first reference are
separated by a large vertical space.
\BreakBibliography{interruption code }
This
v3.00
command exists only if the environment thebibliography has not been redefined by
another package. It provides a break at the bibliography. The interruption code will be
expanded inside a group. Such a break may be, e. g., a heading using \minisec. Unfortunately
it is not possible to add this command to the B
IB
TEX database using, e. g., a special kind of
B
IB
TEX entry. Because of this, users may use is currently only if they make the bibliography
on their own. Because of this usage is very limited.
\AfterBibliographyPreamble{code }
\AtEndBibliography{code }
In
v3.00
some cases it may be useful to add some code after the bibliography preamble or just
before the end of the bibliography. This may be achieved using one of this instructions.
Example: You want to set the bibliography not justified but ragged right. This may be
achieved using:
\AfterBibliographyPreamble{\raggedright}
You may place this instruction anywhere before the bibliography. Nevertheless
it is recommended to do so at the preamble of the document or inside your own
package.
The functionality of this instruction depends on cooperation with packages modifying the
bibliography, if such a package should be used (see
section 21.2
,
page 386
).
3.24. Index
For general information about making an index see [
OPHS11
], [
Lam87
], and [
Keh97
]. Using
a package, that redefines commands or environments for the index, may limit the influence of
KOMA-Script to the index hardly. This would be valid, e. g., for usage of package index but
not for usage of package splitidx (see [
Koh14b
]).
index=selection
v3.00
The index is chapter (scrbook or scrreprt) or section (scrartcl) without heading number or
entry at the table of contents by default or option index=default. The index does not
need an entry at the table of contents, because it should always be the last element of a
document. Nevertheless, such an entry may be achieved using option index=totoc. You
v3.18
can
135
Chapter 3.
Table 3.22.: Available values of option index
default
, nottotoc, plainheading
The index will not have an entry at the table of contents.
numbered
, totocnumbered
v3.18
The index will have an entry at the table of contents and also will have a heading
number.
totoc
, toc, notnumbered
The index will have an entry at the table of contents, but will not have a heading
number.
even number the index using option index=numbered. See also option toc with value index
or indexnumbered in
section 3.9
from
page 65
onward.
A summary of all available values for option index may be found in
table 3.22
.
\setindexpreamble{preamble }
Similarly to the bibliography you can use a preamble to the index. This is often the case if
you have more than one index or if you use different kinds of referencing 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{In \textbf{bold} printed page numbers are
references to the definition of terms. Other page numbers
indicate the use of a term.\par\bigskip}
Please note that the page style of the first page of the index is changed. The applied page
style is defined in the macro \indexpagestyle (see
section 3.12
,
page 75
).
The production, sorting and output of the index is done by the standard L
A
TEX packages
and additional programs. Similar to the standard classes KOMA-Script only provides the
basic macros and environments.
136
Chapter 4.
The New Letter Class scrlttr2
Letters are quite different from articles, reports, books, and suchlike. That alone justifies a
separate chapter about the letter class. But there is another reason for a chapter on scrlttr2.
This class has been redeveloped from scratch and provides a new user interface different
from every other class the author knows of. This new user interface may be uncommon, but
the author is convinced both experienced and new KOMA-Script users will benefit from its
advantages.
4.1. Variables
Apart from options, commands, environments, counters and lengths, additional elements have
already been introduced in KOMA-Script. A typical property of an element is the font style
and the option to change it (see
section 4.9
,
page 53
). At this point we now introduce variables.
Variables have a name by which they are called, and they have a content. The content of a
variable can be set independently from time and location of the actual usage in the same way
as the contents of a command can be separated from its usage. The main difference between
a command and a variable is that a command usually triggers an action, whereas a variable
only consists of plain text which is then output by a command. Furthermore, a variable can
additionally have a description which can be set and output.
This section specifically only gives an introduction to the concept of variables. The following
examples have no special meaning. More detailed examples can be found in the explanation
of predefined variables of the letter class in the following sections. An overview of all variables
is given in
table 4.1
.
Table 4.1.: Alphabetical list of all supported variables in scrlttr2
addresseeimage
instuctions, that will be used to print the Port-Payé head of op-
tion addrfield=backgroundimage or the Port-Payé addressee of option
addrfield=image
(
section 4.10
,
page 173
)
backaddress
return address for window envelopes (
section 4.10
,
page 173
)
backaddressseparator
separator within the return address (
section 4.10
,
page 173
)
. . .
137
Chapter 4.
Table 4.1.: Alphabetical list of all supported variables in scrlttr2 (continuation)
ccseparator
separator between title of additional addressees, and additional addressees (
sec-
tion 4.7
,
page 150
)
customer
customer number (
section 4.10
,
page 179
)
date
date (
section 4.10
,
page 178
)
emailseparator
separator between e-mail name and e-mail address (
section 4.10
,
page 166
)
enclseparator
separator between title of enclosure, and enclosures (
section 4.7
,
page 150
)
faxseparator
separator between title of fax, and fax number (
section 4.10
,
page 166
)
firstfoot
page
v3.08
foot of the note paper (
section 4.10
,
page 184
)
firsthead
page
v3.08
head of the note paper (
section 4.10
,
page 171
)
fromaddress
sender’s address without sender name (
section 4.10
,
page 161
)
frombank
sender’s bank account (
section 4.10
,
page 185
)
fromemail
sender’s e-mail (
section 4.10
,
page 166
)
fromfax
sender’s fax number (
section 4.10
,
page 166
)
fromlogo
commands for inserting the sender’s logo (
section 4.10
,
page 170
)
frommobilephone
v3.12
sender’s mobile telephone number (
section 4.10
,
page 166
)
. . .
138
Chapter 4.
Table 4.1.: Alphabetical list of all supported variables in scrlttr2 (continuation)
fromname
complete name of sender (
section 4.10
,
page 161
)
fromphone
sender’s telephone number (
section 4.10
,
page 166
)
fromurl
a URL of the sender, e. g., the URL of his homepage (
section 4.10
,
page 166
)
fromzipcode
zip code or postcode of the sender used at the Port-Payé head of option
addrfield=PP
(
section 4.10
,
page 173
)
invoice
invoice number (
section 4.10
,
page 179
)
location
more details of the sender (
section 4.10
,
page 176
)
myref
sender’s reference (
section 4.10
,
page 179
)
nextfoot
page
v3.08
foot using page style headings or myheadings (
section 4.13
,
page 190
)
nexthead
page
v3.08
head using page style headings or myheadings (
section 4.13
,
page 190
)
phoneseparator
separator between title of telephone and telephone number (
section 4.10
,
page 166
)
place
sender’s place used near date (
section 4.10
,
page 173
)
placeseparator
separator between place and date (
section 4.10
,
page 180
)
PPdatamatrix
instruction, that print the data array of option addrfield=PP (
section 4.10
,
page 173
)
. . .
139
Chapter 4.
Table 4.1.: Alphabetical list of all supported variables in scrlttr2 (continuation)
PPcode
instructions for the sender’s identification code of option addrfield=PP (
section 4.10
,
page 173
)
signature
signature beneath the ending of the letter (
section 4.20
,
page 192
)
specialmail
mode of dispatch (
section 4.10
,
page 173
)
subject
letter’s subject (
section 4.10
,
page 182
)
subjectseparator
separator between title of subject and subject (
section 4.10
,
page 182
)
title
letter title (
section 4.10
,
page 181
)
toaddress
address of addressee without addressee name (
section 4.10
,
page 173
)
toname
complete name of addressee (
section 4.10
,
page 173
)
yourmail
date of addressee’s referenced mail (
section 4.10
,
page 179
)
yourref
addressee’s reference (
section 4.10
,
page 179
)
zipcodeseparator
separator between the zip code’s or postcode’s title and the code itself (
section 4.10
,
page 173
)
\setkomavar{name }[description ]{content }
\setkomavar*{name }{description }
With the command \setkomavar you determine the content of the variable name . Using
an optional argument you can at the same time change the description of the variable. In
contrast, \setkomavar* can only set the description of the variable name .
Example: Suppose you have defined a direct dialling as mentioned above and you now want
to set the content. You write:
140
Chapter 4.
\setkomavar{myphone}{-\,11}
In addition, you want to replace the term “direct dialling” with “Connection”.
Thus you add the description:
\setkomavar*{myphone}{Connection}
or you can combine both in one command:
\setkomavar{myphone}[Connection]{-\,11}
By the way: You may delete the content of a variable using an empty content argument.
You can also delete the description using an empty description argument.
Example: Suppose you have defined a direct dialling as mentioned above and you now no
longer want a description to be set. You write:
\setkomavar*{myphone}{}
You can combine this with the definition of the content:
\setkomavar{myphone}[]{-\,11}
So you may setup the content and delete the description using only one command.
\usekomavar[command ]{name }
\usekomavar*[command ]{name }
In
v2.9i
some cases it is necessary for the user to access the content or the description of a variable,
and not to leave this only up to the class. This is specially important when 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 variable name , whereas the starred version \usekomavar*
allows you to access the description or title. In
section 22.2
,
page 423
you may find more
information about defining variable on your own.
\ifkomavar{name }{true-code }{false-code }
This
v3.03
command may be used to test, whether or not a variable has already been defined. The
true-code
will be executed only, if the variable already exists. The contents of the variable
will not be examined, so it may be empty. The false-code will be executed if the variable
does not yet exist. Such tests make sense if a variable will be defined at one lco-file (see
section 4.21
from
page 194
onward), but used in another lco-file if it exists only.
\ifkomavarempty{name }{true-code }{false-code }
\ifkomavarempty*{name }{true-code }{false-code }
With
v2.9i
these commands you may check whether or not the expanded content or description of
a variable is empty. The true-code will be executed if the content or description is empty.
Otherwise the false-code will be executed. The starred variant handles the description of a
variable, the unstarred variant handles the contents.
141
Chapter 4.
4.2. Pseudo-Lengths
L
A
TEX processes length with commands \newlength, \setlength, \addtolength, and
\thelength
. Many packages also use macros, that are commands, to storage lengths. KOMA-
Script extends the method of storing length at macros by some commands similar to the com-
mands above, that are used to handle real lengths. KOMA-Scriptcalls this kind of lengths,
that are stored at macros instead of real L
A
TEX lengths, pseudo-lengths.
A list of all pseudo-lengths in scrlttr2 is shown in
table 22.1
starting at
page 410
. The
meaning of the various pseudo-lengths is shown graphically in
figure 22.1
. The dimensions
used in the figure correspond to the default settings of scrlttr2. More detailed description of
the individual pseudo-lengths is found in the individual sections of this chapter.
Normally users would not need to define a pseudo-length on their own. Because of this,
definition of pseudo-lengths will be described in the expert part at
section 22.1
,
page 413
.
Setting pseudo-lengths to new values is also a work for advanced users. So this will be described
in the expert part too at
page 413
.
Please note: 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 without backslash
at the very beginning similar to the names of L
A
TEX counters and in opposite to macros or
L
A
TEX lengths.
\useplength{ name }
Using this command you can access the value of the pseudo-length with 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.21
ab
page 194
).
\setlengthtoplength[factor ]{length }{pseudo-length }
\addtolengthplength[factor ]{length }{pseudo-length }
While you can simply prepend a factor to a length, this is not possible with pseudo-lengths. Suppose
you have a length \test with the value 2 pt; then 3\test gives you the value 6 pt. Using pseudo-
lengths instead, 3\useplength{test} would give you 32 pt. This is especially annoying if you
want a real length to take the value of a pseudo-length .
Using the command \setlengthtoplength you can assign the multiple of a pseudo-length
to a real length . Here, instead of prepending the factor to the pseudo-length , it is given
as an optional argument. You should also use this command when you want to assign the
negative value of a pseudo-length to a length . In this case you can either use a minus sign
or -1 as the factor . The command \addtolengthplength works very similarly; it adds the
multiple of a pseudo-length to the length .
142
Chapter 4.
4.3. Early or late Selection of Options
All of what is described in
section 2.4
is generally applicable.
4.4. Compatibility with Earlier Versions of KOMA-Script
It applies, mutatis mutandis, what is written in
section 2.5
. However, this feature exists at
scrlttr2 since version 2.9t.
4.5. Draft Mode
What is written in
section 3.3
applies, mutatis mutandis.
4.6. Page Layout
Each page of a document is separated into several different layout elements, e. g., margins,
head, foot, text area, margin note column, and the distances between all these elements.
KOMA-Script additionally distinguishes the page as a whole also known as the paper and
the viewable area of the page. Without doubt, the separation of the page into the several
parts is one of the basic features of a class. Nevertheless at KOMA-Script the classes delegate
that business to the package typearea. This package may be used with other classes too. In
difference to those other classes the KOMA-Script classes load typearea on their own. Because
of this, there’s no need to load the package explicitly with \usepackage while using a KOMA-
Script class. Nor would this make sense or be useful. See also
section 4.3
.
Some settings of KOMA-Script classes do influence the page layout. Those effects will be
documented at the corresponding settings.
For more information about page size, separation of pages into margins and type area, and
about selection of one or two column typesetting see the documentation of package typearea.
You may find it at
chapter 2
from
page 24
onwards.
Normally it makes no sense to distinguish letters with single-side layout and letters with
double-side layout. Mostly letters are not bound like books. Therefor each page will be viewed
on its own. This is also true if both sides of the paper sheet will be used for printing. Vertical
adjustment is unusual at letters too. Nevertheless, if you need or want it, you may read the
description of \raggedbottom and \flushbottom in
section 3.4
at
page 50
.
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 in general contains only one book, a letter document can
143
Chapter 4.
Figure 4.1.: General structure
of a letter document with
several individual letters (the
structure of a single letter is
shown in
figure 4.2
)
\documentclass[...]{scrlttr2}
. . .
settings for all letters
. . .
\begin{document}
. . .
settings for all letters
. . .
\begin{letter}{ addressee }
. . .
content of the individual letter
. . .
\end{letter}
...
\end{document}
contain several letters. As illustrated in
figure 4.1
, a letter document consists of a preamble,
the individual letters, and the closing.
The preamble comprises all settings that in general concern all letters. Most of them can
also be overwritten in the settings of the individual letters. The only setting which can not be
changed within a single letter is compatibility to prior versions of scrlttr2 (see option version
in
section 4.4
,
page 29
).
It is recommended that only general settings such as the loading of packages and the setting
of options be placed before \begin{document}. All settings that comprise the setting of
variables or other text features should be done after \begin{document}. This is particularly
recommended when the babel package (see [
BB13
]) is used, or language-dependent variables
of scrlttr2 are to be changed.
The closing usually consists only of \end{document}. Of course you can also insert addi-
tional comments at this point.
As shown in
figure 4.2
, every single letter itself consists of an introduction, the letter body,
and the closing. In the introduction, all settings pertaining only to the current letter are
defined. It is important that this introduction always ends with \opening. Similarly, the
closing always starts with \closing. The two arguments opening and closing can be left
empty, but both commands must be used and must have an argument.
It should be noted that several settings can be changed between the individual letters. Such
changes then have an effect on all subsequent letters. For reasons of maintainability of your
letter documents, it is however not recommended to use further general settings with limited
scope between the letters.
144
Chapter 4.
Figure 4.2.: General structure
of a single letter within a letter
document (see also
figure 4.1
)
\begin{letter}[Optionen ]{addressee }
. . .
settings for this letter
. . .
\opening{ opening }
. . .
letter text
. . .
\closing{ closing }
\ps
. . .
postscript
. . .
\encl{ enclosures }
\cc{additional addressees }
\end{letter}
\begin{letter}[options ]{addressee }
. . .
\end{letter}
The letter environment is one of the key environments of the letter class. A special scrlttr2
feature are optional arguments to the letter environment. These options are executed
internally via the \KOMAoptions command.
The addressee is a mandatory argument passed to the letter environment. Parts of the
addressee contents are separated by double backslashes. These parts are output on individual
lines in the address field. Nevertheless, the double backslash should not be interpreted as a
certain line break. Vertical material such as paragraphs or vertical space is not permitted
within addressee , and could lead to unexpected results and error messages, as is the case
also for the standard letter class.
Dostları ilə paylaş: |