Example: You do not want the chapters in the main part of the classes scrbook or scrreprt to
be introduced by a prefix line (see layout options chapterprefix in
section 3.16
,
page 85
). For consistency you also do not want such a line in the appendix either.
Instead, you would like to see the word “Chapter” in the language of your choice
written in front of the chapter letter and, simultaneously, in the page headings.
Instead of using layout option appendixprefix, you would define in the document
preamble:
\newcommand*{\appendixmore}{%
\renewcommand*{\chapterformat}{%
\appendixname~\thechapter\autodot\enskip}
\renewcommand*{\chaptermarkformat}{%
\appendixname~\thechapter\autodot\enskip}
}
In case you subsequently change your mind and decide to use the option
appendixprefix
at a later stage, you will get an error message because of the
already defined \appendixmore command. This behaviour prevents the definition
made above from invisibly changing the settings intended with the option.
It is also possible to get a similar behaviour of the appendix for the class scrartcl.
You can write in the preamble of your document:
\newcommand*{\appendixmore}{%
\renewcommand*{\sectionformat}{%
\appendixname~\thesection\autodot\enskip}%
\renewcommand*{\sectionmarkformat}{%
\appendixname~\thesection\autodot\enskip}}
Redefined commands are explained in more detail in
section 3.16
,
page 97
and
page 99
.
\newbibstyle[parent style ]{name }{instructions }
\newblock
\@openbib@code
\bib@beginhook
\bib@endhook
The standard classes already provide command \newblock for structuring of bibliography
entries. The exact purpose of this command depends on the class options. Using option
407
Chapter 21.
openbib
redefine commands \@openbib@code and \newblock at the end of the used standard
class. These classes execute command \@openbib@code at the begin — or more precise: at the
specification of the parameters of the — list environment, that will be used for the bibliography.
It should be assumed, that many packages will execute this command in the same kind, if
they redefine the bibliography.
The KOMA-Script classes do something similar. Nevertheless, they do not redefine
\@openbib@code
at the end of the class. Instead of, the bibliography style openstyle is defined
using \newbibstyle. The instructions , that has been defined as part of the implementation,
contain the appropriate redefinition of \@openbib@code and \newblock. Now, if this bibliog-
raphy style will be selected using option bibliography=openstyle, then the instructions
will be executed immediately. This will redefine \@openbib@code and \newblock.
Beside \@openbib@code and \newblock also \bib@beginhook and \bib@endhook may be
redefined by the instructions of the style. Command \bib@beginhook will be executed
immediately after heading and preamble of the bibliography, but before the begin of the list
with the bibliography entries. Command \bib@endhook will be executed immediately after
this list at the end of the bibliography. If \BreakBibliography (see
section 3.23
,
page 134
)
intercepts the bibliography, these commands will also executed at the begin and end of each
part of the bibliography, this would be immediately before and after \BreakBibliography.
The commands \newblock, \@openbib@code, \bib@beginhook, and \bib@endhook will
be reset to an empty definition at the start of each new bibliography style. After this the
instructions
of the parent style of the bibliography style will be executed. After this the
instructions
of the bibliography style itself will be executed. Because of this these commands
has to be defined using \renewcommand not \newcommand inside of argument instructions .
If the user declares additional instructions using \AtEndBibliography and
\AfterBibliographyPreamble
to be executed after the preamble or at the end of the bib-
liography, the instructions of \AfterBibliographyPreamble will be executed only once
at the begin of the bibliography but after the \bib@beginhook instructions , and the
instructions
of \AtEndBibliography will be executed only once at the end of the bibli-
ography but before \bib@endhook.
Package multicol (see [
Mit11
]) could be used to define a bibliography style for printing the
bibliography with two columns:
\newbibstyle{twocolumstyle}{%
\renewcommand*{\bib@beginhook}{\begin{multicols}{2}}%
\renewcommand*{\bib@endhook}{\end{multicols}}}%
If also an open-variation of this style should be defined, one may use the provided heredity
feature and specify a parent style :
\newbibstyle{twocolumopenstyle}[openstyle]{%
\renewcommand*{\bib@beginhook}{\begin{multicols}{2}}%
\renewcommand*{\bib@endhook}{\end{multicols}}}%
408
Chapter 21.
These new defined styles may be selected using option bibliography as usual.
21.4. More or Less Obsolete Options and Commands
Sorry, currently additional information to this may be found at the same point of the German
KOMA-Script book [
Koh14a
] only.
409
Chapter 22.
Additional Information about the Letter Class scrlttr2 and the
Letter Package scrletter
This chapter gives additional information about the KOMA-Script class scrlttr2. Some parts
of the chapter are subject to the KOMA-Script book [
Koh14a
] only. This should not be a
problem, because the average user, who only want to use the package, does not need the
information. Other information is addressed to users, who want additional information about
details. For example the first section will describe pseudo-lengths in detail. These may be
used to modify the note paper. Another part of the information describes features of the class
that exist only because of compatibility to deprecated scrlettr class. Last but not least it will
be described in detail how to change a document from the old scrlettr class to be used with
the current scrlttr2 class.
Since KOMA-Script 3.15
v3.15
the additional package scrletter exists. It can be used with one of
the KOMA-Script classes scrartcl, scrreprt, or scrbook and provides all the features of scrlttr2
for those classes. There are, however, small differences described later in this section.
22.1. Pseudo-Lengths for Experienced Users
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 cat-
egories. For L
A
TEX lengths, which are addressed with \newlength, skip registers are used.
Once all these registers are in use, you can not define any more additional lengths. The letter
class scrlttr2 would normally use up more than 20 of such registers for the first page alone.
L
A
TEX itself already uses 40 of these registers. The typearea package needs some of them too;
thus, approximately a quarter of the precious registers would already be in use. That is the
reason why lengths specific to letters in scrlttr2 are internally defined with macros instead of
lengths. The drawback of this approach is that computations with macros is somewhat more
complicated than with real lengths.
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.
It can be pointed out that the now recommended L
A
TEX installation with ε-TEX no longer
suffers from the above-mentioned limitation. However, that improvement came too late for
scrlttr2.
The pseudo-lengths defined and uses by scrlttr2 are listed in
table 22.1
. Cross references to
the detailed descriptions of each pseudo-lengths in the following sub-sections are also given in
the table.
410
Chapter 22.
A schematic display of the most important distances of the note paper is shown in
figure 22.1
at
page 414
. Beside the pseudo-lengths for the modifiable distances, also some lengths, which
may not be modified, are shown in light gray. Some rarely needed pseudo-length of the note
paper have been omitted to get a more clear arrangement.
Table 22.1.: Pseudo-lengths provided by class scrlttr2
backaddrheight
height of the return address at the upper edge of the address field (
section 22.1.3
,
page 419
)
bfoldmarklength
length of the bottommost folding mark (
section 22.1.1
,
page 415
)
bfoldmarkvpos
vertical distance of bottommost folding mark from top paper edge (
section 22.1.1
,
page 415
)
firstfoothpos
horizontal distance of the letter footer from the left paper edge; values greater than
the width of the paper or smaller than the negative value of the width of the paper
will activate special handling (
section 22.1.8
,
page 423
)
firstfootvpos
vertical distance of letter footer from top paper edge (
section 22.1.8
,
page 423
)
firstfootwidth
width of letter footer (
section 22.1.8
,
page 423
)
firstheadhpos
horizontal distance of the letterhead from the left paper edge; values greater than
the width of the paper or smaller than the negative value of the width of the paper
will activate special handling (
section 22.1.2
,
page 417
)
firstheadvpos
vertical distance of letterhead from top paper edge (
section 22.1.2
,
page 417
)
firstheadwidth
width of the letterhead (
section 22.1.2
,
page 417
)
. . .
411
Chapter 22.
Table 22.1.: Pseudo-lengths provided by class scrlttr2 (continued)
foldmarkhpos
horizontal distance of the horizontal folding marks from left paper edge (
sec-
tion 22.1.1
,
page 416
)
foldmarkvpos
vertical distance of the vertical folding marks from the top paper edge (
section 22.1.1
,
page 416
)
fromrulethickness
thickness of an optional horizontal rule in the letterhead (
section 22.1.2
,
page 417
)
fromrulewidth
length of an optional horizontal rule in letterhead (
section 22.1.2
,
page 417
)
lfoldmarkhpos
horizontal distance of the vertical folding mark from the left paper edge (
sec-
tion 22.1.1
,
page 416
)
lfoldmarklength
length of the vertical folding mark (
section 22.1.1
,
page 416
)
locheight
height of the field with the extended sender’s information, of the value is not zero;
toaddrheight
will be used instead of zero value (
section 22.1.4
,
page 420
)
lochpos
horizontal distance of the field with the extended sender’s information from the right
paper edge, if the value is positive; negative horizontal distance from the left paper
edge, if the value is negative; negative value of toaddrhpos will be used instead of
zero value (
section 22.1.4
,
page 420
)
locvpos
vertical distance of the field with the extended sender’s information from the top
paper edge, if the value is not zero; toaddrvpos will be used instead of zero value
(
section 22.1.4
,
page 420
)
locwidth
width of the field with the extended sender’s information; for zero value width is
calculated automatically with respect to option locfield that is described in
sec-
tion 4.10
,
page 176
(
section 22.1.4
,
page 420
)
. . .
412
Chapter 22.
Table 22.1.: Pseudo-lengths provided by class scrlttr2 (continued)
mfoldmarklength
length of the middle horizontal folding mark (
section 22.1.1
,
page 416
)
mfoldmarkvpos
vertical distance of the middle horizontal folding mark from the top paper edge
(
section 22.1.1
,
page 415
)
pfoldmarklength
length of the puncher hole mark (
section 22.1.1
,
page 416
)
refaftervskip
vertical skip below reference fields or business line (
section 22.1.5
,
page 421
)
refhpos
horizontal distance of reference fields or business line from left paper edge; for zero
value reference fields line is centered horizontally on letter paper (
section 22.1.5
,
page 421
)
refvpos
vertical distance of reference fields or business line from top paper edge (
sec-
tion 22.1.5
,
page 421
)
refwidth
width of reference fields line (
section 22.1.5
,
page 421
)
sigbeforevskip
vertical skip between closing and signature (
section 22.1.7
,
page 422
)
sigindent
indentation of signature with respect to text body (
section 22.1.7
,
page 422
)
specialmailindent
left indentation of mode of dispatch within address field (
section 22.1.3
,
page 419
)
specialmailrightindent
right indentation of mode of dispatch within address field (
section 22.1.3
,
page 419
)
subjectaftervskip
vertical distance after the subject (
section 22.1.6
,
page 422
)
subjectbeforevskip
additional vertical distance before the subject (
section 22.1.6
,
page 422
)
. . .
413
Chapter 22.
Table 22.1.: Pseudo-lengths provided by class scrlttr2 (continued)
subjectvpos
vertical distance of the subject from the top paper edge; zero value will set the
subject depending on option subject (
section 22.1.6
,
page 422
)
tfoldmarklength
length of the topmost horizontal folding mark (
section 22.1.1
,
page 416
)
tfoldmarkvpos
vertical distance of the topmost horizontal folding mark from the top paper edge
(
section 22.1.1
,
page 415
)
toaddrheight
height of address field (
section 22.1.3
,
page 418
)
toaddrhpos
horizontal distance of the address field from left paper edge, for positive values;
negative horizontal distance of the address field from right paper edge, for negative
values (
section 22.1.3
,
page 418
)
toaddrindent
left and right indentation of address within address field (
section 22.1.3
,
page 419
)
toaddrvpos
vertical distance of the address field from the top paper edge (
section 22.1.3
,
page 418
)
toaddrwidth
width of address field (
section 22.1.3
,
page 418
)
\@newplength{name }
This command defines an new pseudo-length. This new pseudo-length is uniquely identified
by its name . If with this command a redefinition of an already existing pseudo-length is
attempted, the commands exits with an error message.
Since the user in general does not define own pseudo-lengths, this command is not intended
as a user command. Thus, it can not be used within a document, but it can, for example, be
used within an lco-file.
\@setplength[factor ]{pseudo-length }{value }
\@addtoplength[factor ]{pseudo-length }{value }
Using the command \@setplength you can assign the multiple of a value to
a pseudo-length .
The factor is given as an optional argument (see also
414
Chapter 22.
\baselineskip
\baselineskip
\baselineskip
\textwidth
≥
\footskip
firstheadhpos
firstheadwidth
fromrulewidth
toaddrwidth
locwidth
specialmailindent
specialmailrightindent
toaddrhpos
lochpos
toaddrindent
toaddrindent
refwidth
refhpos
foldmarkhpos
sigindent
firstfoothpos
firstfootwidth
toaddrheight
lo
cheight
+subjectbeforevskip
subjectaftervskip
backaddrheight
refaftervskip
sigbeforevskip
firstheadvpos
toaddrvpos
locvpos
refvpos
tfoldmarkvpos
bfoldmarkvpos
firstfootvpos
letterhead
letter footer
return address
mode of dispatch
addressee
supplemental
data
reference fields line
title
subject
opening
letter body
closing
signature
Figure 22.1.: Schematic of the pseudo-lengths for a letter
415
Chapter 22.
\setlengthtoplength
,
section 4.2
,
page 141
).
The command \@addtoplength adds the value to a pseudo-length . Again a factor may
be given as an optional argument.
To assign, or to add the multiple of, one pseudo-length to another pseudo-length, the
command \useplength (siehe
section 4.2
,
page 141
) is used within value . To subtract the
value of one pseudo-length from another pseudo-length a minus sign, or -1, is used as the
factor
.
Since the user in general does not define own pseudo-lengths, this command is not intended
as a user command. Thus, it can not be used within a document, but can, for example, be
used within an lco-file.
22.1.1. Folding Marks
Folding mark are short horizontal lines at the left edge, and short vertical lines at the upper
edge of the paper. KOMA-Script at present supports three configurable horizontal and one
configurable vertical foldmarks. In addition, there is support for a puncher hole mark or center
mark which cannot be shifted in the vertical direction.
tfoldmarkvpos
mfoldmarkvpos
bfoldmarkvpos
The letter class scrlttr2 knows a total of three vertically placed configurable foldmarks. The
position of the topmost foldmark, taken from the upper edge of the paper, is governed by
the pseudo-length tfoldmarkvpos; the position of the middle foldmark by pseudo-length
mfoldmarkvpos
v2.97e
; the position of the bottommost foldmark by pseudo-length bfoldmarkvpos.
With the addition of the puncher hole or center mark, there is still a fourth horizontal mark.
This one is however always placed at the vertical center of the paper.
The topmost and bottommost foldmarks do not serve to divide the paper into exactly equal
thirds. Instead, with their help, the paper should be folded such that the address field appears
correctly in the space available in the chosen window envelope format, which is determined
by choice of lco-file. Several such files are available offering predefined formats. An anomaly
is present with DINmtext: for this format, an envelope format of C6/5 (also known as “C6
long”) is assumed. Letters written with this option are not suited to envelopes of formats C5
or C4.
The middle foldmark is not normally required for Western letters. In Japan, however, a
larger number of envelope formats exists, requiring one more foldmark (see the Japanese lco-
files). At this point attention is drawn to the fact that reference to “topmost”, “middle”, and
“bottommost” foldmarks is simply a convenience. In fact, it is not defined that tfoldmarkvpos
must be smaller than mfoldmarkvpos, which in turn must be smaller than bfoldmarkvpos.
If on the other hand one of the pseudo-lengths is set to null, then the corresponding foldmark
will not be set even if the option foldmarks (see
section 4.10
,
page 157
) is explicity activated.
416
Chapter 22.
tfoldmarklength
mfoldmarklength
bfoldmarklength
pfoldmarklength
These
v2.97e
four pseudo-lengths determine the lengths of the four horizontal foldmarks. One excep-
tional behaviour exists. If the length is given as null, then the three vertically-configurable
pseudo-lengths tfoldmarklength, mfoldmarklength and bfoldmarklength are set to 2 mm
in length. The length of the punchmark, pfoldmarklength, is instead set to 4 mm.
foldmarkhpos
This pseudo-length gives the distance of all horizontal foldmarks from the left edge of the
paper. Normally, this is 3.5 mm. This value can be changed in the user’s own lco-file, in case
the user’s printer has a wider unprintable left margin. Whether the foldmarks are typeset at
all depends on the option foldmarks (see
section 4.10
,
page 157
).
lfoldmarkhpos
Apart from
v2.97e
the horizontal foldmarks there is also a vertical foldmark, whose position from the
left margin is set via the pseudo-length lfoldmarkhpos. This foldmark is used, for example,
in Japanese Chou- or You-format envelopes, when one wishes to use A4 size sheets with them.
This can also be useful for envelopes in C6 format.
lfoldmarklength
The
v2.97e
length of the vertical foldmark is set via the pseudo-length lfoldmarklength. Here too
there is an exceptional behaviour. When the length is set to null, a length of 4 mm is actually
used.
foldmarkvpos
This
v2.97e
pseudo-length gives the distance of all vertical foldmarks from the upper edge of the
paper. Normally this is 3.5 mm, but the value can be changed in the user’s personal lco-file
in case the user’s printer has a wider unprintable top margin. Whether the foldmarks are
typeset at all depends on the option foldmarks (see
section 4.10
,
page 157
). At present there
is only one vertical foldmark, which is designated the left vertical foldmark.
foldmarkthickness
This
v2.97c
pseudo-length determines the thickness of all foldmarks. Default value is 0.2 pt, in other
words a very thin hairline. In particular, if the color of the foldmarks is changed, this can be
too thin!
417
Chapter 22.
Dostları ilə paylaş: |