Example: Mr Public likes to use a letterhead with logo. He generated a graphics file with
the logo and would like to include this using \includegraphics. Therefor he uses
the additional package graphics (see [
Car05
]).
171
Chapter 4.
\documentclass[foldmarks=true,foldmarks=blmtP,
fromrule=afteraddress,
fromphone,fromemail,fromlogo,
version=last]{scrlttr2}
\usepackage[english]{babel}
\usepackage{graphics}
\begin{document}
\setkomavar{fromname}{John Public}
\setkomavar{fromaddress}{Valley 2\\
54321 Public-Village}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{Peter@Public.invalid}
\setkomavar{fromlogo}{\includegraphics{musterlogo}}
\begin{letter}{%
Joana Public\\
Hillside 1\\
12345 Public-City%
}
\opening{Dear chairman,}
the last general meeting was about one year ago.
I want to remind you, that the constitution of our
club advises you to make a general meeting every
six month. Because of this I expect the executive
board to detain such a meeting immediately.
\closing{Expecting an invitation}
\ps PS: I hope you accept this as an friendly
demand note.
\setkomavar*{enclseparator}{Enclosure}
\encl{Compendium of the constitution with the
general meeting paragraphs.}
\cc{executive board\\all members}
\end{letter}
\end{document}
The result may be seen at the left top position of
figure 4.15
. The additional letter
prints at this figure shows the result with right aligned or centered sender.
\setkomavar{firsthead}[description ]{content }
For many cases, scrlttr2 with its options and variables offers enough possibilities to create a
letterhead. In very rare situations one may wish to have more freedom in terms of layout.
In those situations one will have to do without predefined letterheads, which could have been
chosen via options. Instead, one needs to create one’s own letterhead from scratch. To do
so, one has to define the preferred construction as content of variable firsthead. Within
\firsthead
, and with the help of the \parbox command (see [
Tea05b
]), one can set several
172
Chapter 4.
John Public
Valley 2
54321 Public-Village
Phone: 0 12 34 56 78
Email: Peter@Public.invalid
M
John Public, Valley 2, 54321 Public-Village
Joana Public
Hillside 1
12345 Public-City
June 17, 2016
Dear chairman,
the last general meeting was about one year ago. I want to remind you, that the
constitution of our club advises you to make a general meeting every six month. Because
of this I expect the executive board to detain such a meeting immediately.
Expecting an invitation
John Public
PS: I hope you accept this as an friendly demand note.
Enclosure: Compendium of the constitution with the general meeting paragraphs.
cc: executive board
all members
John Public
Valley 2
54321 Public-Village
Phone: 0 12 34 56 78
Email: Peter@Public.invalid
John Public, Valley 2, 54321 Public-Village
Joana Public
Hillside 1
12345 Public-City
M
June 17, 2016
Dear chairman,
the last general meeting was about one year ago. I want to remind you, that the
constitution of our club advises you to make a general meeting every six month. Because
of this I expect the executive board to detain such a meeting immediately.
Expecting an invitation
John Public
PS: I hope you accept this as an friendly demand note.
Enclosure: Compendium of the constitution with the general meeting paragraphs.
cc: executive board
all members
Figure 4.15.: result of a small letter with extended sender,
logo, separation rule, addressee, opening, text, closing, sig-
nature, postscript, distribution list, enclosure and puncher
hole mark (the date is a default of DIN-letters): at top
left one left aligned sender using, at right beneath one with
centered sender, and at right one right aligned sender
M
John Public
Valley 2
54321 Public-Village
Phone: 0 12 34 56 78
Email: Peter@Public.invalid
John Public, Valley 2, 54321 Public-Village
Joana Public
Hillside 1
12345 Public-City
June 17, 2016
Dear chairman,
the last general meeting was about one year ago. I want to remind you, that the
constitution of our club advises you to make a general meeting every six month. Because
of this I expect the executive board to detain such a meeting immediately.
Expecting an invitation
John Public
PS: I hope you accept this as an friendly demand note.
Enclosure: Compendium of the constitution with the general meeting paragraphs.
cc: executive board
all members
173
Chapter 4.
boxes side by side, or one underneath the other. An advanced user will thus be able to create
a letterhead on his own. Of course the construct may and should use other variables with the
help of \usekomavar. KOMA-Script does not use the description of variable firsthead.
The command \firsthead exists only for reason of compatibility to former scrlttr2 versions.
However it is deprecated and you should not use it anymore.
addrfield=mode
backaddress=value
priority=priority
\setkomavar{toname}[description ]{content }
\setkomavar{toaddress}[description ]{content }
\setkomavar{backaddress}[description ]{content }
\setkomavar{backaddressseparator}[description ]{content }
\setkomavar{specialmail}[description ]{content }
\setkomavar{fromzipcode}[description ]{content }
\setkomavar{zipcodeseparator}[description ]{content }
\setkomavar{place}[description ]{content }
\setkomavar{PPcode}[description ]{content }
\setkomavar{PPdatamatrix}[description ]{content }
\setkomavar{addresseeimage}[description ]{content }
Option addrfield defines whether or not to set an address field. Default is to use an address
field. This option can take the mode values from
table 4.8
v3.03
. Default is true. With values true,
topaligned
v3.17
, PP, and backgroundimage name and address of the addressee will be defined
by the mandatory argument of the letter environment (see
section 4.7
,
page 144
). These
elements will additionally be copied into the variables toname and toaddress. The predefined
font styles may be changed
v2.97c
by execution of command \setkomafont or \addtokomafont (siehe
section 4.9
,
page 53
). Thereby three elements exist. First of all element addressee, that is
responsible for the addressee overall. The additional elements toname and toaddress are
responsible only either for the name or the address of the addressee. They may be used to
define modifications from the addressee configuration.
With the default addrfield=true an additional return address will be printed. Option
backaddress
defines whether a return address for window envelopes will be set. This option
can take the standard values for simple switches, as listed in
table 2.5
,
page 38
. These values
do not change style of the return address. On the other hand, additionally
v2.96
to switching on
the return address, the style of the return address may be selected. Option value underlined
selects an underlined return address. In opposite to this value plain selects a style without
underline. Default is underlined and therefore printing an underlined return address.
The return address itself is defined by the content of variable backaddress. Default is a
combination of variable toname and toaddress with redefinition of the double backslash to
set the content of variable backaddressseparator. The predefined separator content is a
comma followed by a non-breakable white space. The description of variable backaddress
is not used by KOMA-Script. The font style of the return address is configurable via element
174
Chapter 4.
Table 4.8.: available values for option addrfield to change the addressee mode of scrlttr2
backgroundimage
, PPbackgroundimage, PPBackgroundImage, PPBackGroundImage,
ppbackgroundimage
, ppBackgroundImage, ppBackGroundImage
Prints an address field with Port-Payé head, in variable addresseimage defined
background graphics, but without return address or mode of dispatch.
false
, off, no
Omits the address field.
image
, Image, PPimage, PPImage, ppimage, ppImage
Prints variable addresseeimage as addressee with Port-Payé, but ignores addressee
information and definitions for return address, mode of dispatch or priority.
PP
, pp, PPexplicite, PPExplicite, ppexplicite, ppExplicite
Prints an address field with Port-Payé head, defined by the variables fromzipcode,
place
, and PPcode and when indicated with priority and data array defined by
PPdatamatrix
but without return address and mode of dispatch.
topaligned
, alignedtop
v3.17
Prints an address field including a return address and a mode of dispatch or priority
without centring the address vertically in the available space.
true
, on, yes
Prints an address field including a return address and a mode of dispatch or priority.
backaddress
. Default for this is \sffamily (see
table 4.9
). Before execution of the element’s
font style KOMA-Script switches to \scriptsize.
By default, addrfield=true, the address will be vertically centred in the available space
below the mode of dispatch or priority. In
v3.17
opposite to this, addrfield=topaligned will not
centre the address but follow it aligned top at the available space. This is the only difference
to addrfield=true.
At the default addrfield=true an optional dispatch type can be output within the address
field between the return address and the addressee address, This will be done only if variable
specialmail
is not empty and priority=manual
v3.03
has been selected, which is also the default.
Class scrlttr2 itself does not use the description of variable specialmail. The alignment is
defined by the pseudo-lengths PLengthspecialmailindent and specialmailrightindent (siehe
page 419
). The predefined font style of element
v2.97c
specialmail
, that has been listed in
ta-
ble 4.9
, may be changed using commands \setkomafont and \addtokomafont (see
section 4.9
,
page 53
).
On
v3.03
the other hand, using an international priority with priority=A or priority=B (see
table 4.10
) together with addrfield=true will print the priority as mode of dispatch. Using
175
Chapter 4.
Table 4.9.: Predefined font
style for the elements of the
address field.
element
font style
addressee
backaddress
\sffamily
PPdata
\sffamily
PPlogo
\sffamily\bfseries
priority
\fontsize{10pt}{10pt}\sffamily\bfseries
prioritykey
\fontsize{24.88pt}{24.88pt}\selectfont
specialmail
toaddress
toname
it together with addrfield=PP will print the priority at the corresponding position in the Port-
Payé head. Thereby the element priority defines the basic font style and prioritykey the
modification of the basic font style for the priority key, “A” or “B”. The default font styles are
listed in
table 4.9
and may be changed using commands \setkomafont und \addtokomafont
(siehe
section 4.9
,
page 53
).
With
v3.03
addrfield=PP
also the zip-code of variable fromzipcode and the place from content
of variable place will be set in the Port-Payé head. Thereby the content of variable
fromzipcode
will be preceded by the description of variable fromzipcode and the content
of variable zipcodeseparator. The predefined description depends on the used lco-file
(see
section 4.21
from
page 194
onward). On the other hand the default of the content of
variable zipcodeseparator is a small distance followed by an endash followed by one more
small distance (\,--\,).
Beyond
v3.03
that, with addrfield=PP and sender’s identification code will be used at the Port-
Payé head. This is the content of variable PPcode. Right beside the address of the addressee
Table 4.10.: available values for option priority to select the international priority at the address field
ofscrlttr2
false
, off, no, manual
Priority will not be printed.
B
, b, economy, Economy, ECONOMY, B-ECONOMY, B-Economy, b-economy
Use international priority B-Economy. With addrfield=true this will be printed
instead of the mode of dispatch.
A
, a, priority, Priority, PRIORITY, A-PRIORITY, A-Priority, a-priority
Use international priority A-Priority. With addrfield=true this will be printed
instead of the mode of dispatch.
176
Chapter 4.
Table 4.11.: Possible values of option locfield for set-
ting the width of the field with additional sender at-
tributes with scrlttr2
narrow
narrow sender supplement field
wide
wide sender supplement field
an additional data array may be printed. The content of variable PPdatamatrix will be used
for this.
Zip-code
v3.03
, place and code will be printed with default font size 8 pt. Thereby the font style
of element PPdata will be used. The default of the element is listed in
table 4.9
and may be
changed using commands \setkomafont and \addtokomafont (see
section 4.9
,
page 53
).
With options addrfield=backgroundimage
v3.03
or addrfield=image a picture will be print
inside the address field. The content of variable addresseeimage will be used for this.
KOMA-Script does not use the description of that variable. Nothing else but the picture
will be printed with option addrfield=image. But with option addrfield=backgroundimage
the addressee’s name and address from the mandatory argument of the letter environment
will be output.
The alignment of the Port-Payé head as long as the alignment of the Port-Payé ad-
dress is defined by pseudo-length toaddrindent (see
page 419
) as well as PPheadwidth and
PPheadheight
(siehe
page 419
). The alignment of the data array is defined by pseudo-length
PPdatamatrixvskip
(see
page 420
).
Please note that KOMA-Script itself cannot set any external graphics or pictures. So, if you
want to put external picture files into variables like addresseeimage or PPdatamatrix, you
have to use an additional graphics package like graphics or graphicx to use, i. e., the command
\includegraphics
at the content of the variables.
locfield=selection
scrlttr2 places a field with additional sender attributes next to the address field. This can
be used, for example, for bank account or similar additional information. Depending on the
fromalign
option, it will also be used for the sender logo. The width of this field may be
defined within an lco file (see
section 4.21
). If the width is set to 0 in that file, then the
locfield
option can toggle between two presets for the field width. See the explanation on
the locwidth pseudo length in
section 22.1.4
,
page 420
. Possible values for this option are
shown in
table 4.11
. Default is narrow.
\setkomavar{location}[description ]{content }
The contents of the sender’s extension field is determined by the variable location. To
set this variable’s content , it is permitted to use formatting commands like \raggedright.
KOMA-Script does not use the description of the variable.
177
Chapter 4.
Example: Mr Public likes to show some additional information about his membership. There-
for he uses the location variable:
\documentclass[foldmarks=true,foldmarks=blmtP,
fromphone,fromemail,fromlogo,
version=last]{scrlttr2}
\usepackage[english]{babel}
\usepackage{graphics}
\begin{document}
\setkomavar{fromname}{John Public}
\setkomavar{fromaddress}{Valley 2\\
54321 Public-Village}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{Peter@Public.invalid}
\setkomavar{fromlogo}{\includegraphics{musterlogo}}
\setkomavar{location}{\raggedright
Club nember no.~4711\\
since 11.09.2001\\
chairman 2003--2005}
\begin{letter}{%
Joana Public\\
Hillside 1\\
12345 Public-City%
}
\opening{Dear chairman,}
the last general meeting was about one year ago.
I want to remind you, that the constitution of our
club advises you to make a general meeting every
six month. Because of this I expect the executive
board to detain such a meeting immediately.
\closing{Expecting an invitation}
\ps PS: I hope you accept this as an friendly
demand note.
\setkomavar*{enclseparator}{Enclosure}
\encl{Compendium of the constitution with the
general meeting paragraphs.}
\cc{executive board\\all members}
\end{letter}
\end{document}
This will define the field beside the addressee’s address like shown in
figure 4.16
.
numericaldate=simple switch
This option toggles between the standard, language-dependent date presentation, and a short,
numerical one. KOMA-Script does not provide the standard presentation. It should be defined
by packages such as ngerman, babel, or isodate. The short, numerical presentation, on the
178
Chapter 4.
Figure 4.16.: result of a small letter with extended sender,
logo, addressee, additional sender information, opening,
text, closing, signature, postscript, distribution list, enclo-
sure and puncher hole mark (the date is a default of DIN-
letters)
John Public
Valley 2
54321 Public-Village
Phone: 0 12 34 56 78
Email: Peter@Public.invalid
M
John Public, Valley 2, 54321 Public-Village
Joana Public
Hillside 1
12345 Public-City
Club nember no. 4711
since 11.09.2001
chairman 2003–2005
June 17, 2016
Dear chairman,
the last general meeting was about one year ago. I want to remind you, that the
constitution of our club advises you to make a general meeting every six month. Because
of this I expect the executive board to detain such a meeting immediately.
Expecting an invitation
John Public
PS: I hope you accept this as an friendly demand note.
Enclosure: Compendium of the constitution with the general meeting paragraphs.
cc: executive board
all members
other hand, is produced by scrlttr2 itself. This option can take the standard values for simple
switches, as listed in
table 2.5
,
page 38
. Default is false, which results in standard date
presentation.
\setkomavar{date}[description ]{content }
The date in the selected presentation will become the content of variable date. The selection
of option numericaldate does not influence the date any longer, if the content of this variable
will be changed by the user. Normally the date will be part of the reference line. If all other
elements of the reference line will be empty and therefore unused a date line instead of a
reference line will be printed. See the description of variable place on
page 180
for more
information about the date line. You should note, that you can change the automatic printing
of the date using option refline, that will be described next.
refline=selection
Especially in business letters a line with information like identification code, direct dial, cus-
tomer’s number, invoice’s number, or references to previous letters may be found usually. This
line will be named reference line in this manual.
With the scrlttr2 class, the header, footer, address, and sender attributes may extend beyond
the normal type area to the left and to the right. Option refline=wide defines that this should
also apply to the reference fields line. Normally, the reference fields line contains at least the
179
Chapter 4.
Table 4.12.: Possible value of option refline for setting the width of the reference fields line with
scrlttr2
dateleft
v3.09
The date will be placed leftmost at the reference line.
dateright
v3.09
The date will be placed rightmost at the reference line.
narrow
The reference line will be restricted to type area.
nodate
v3.09
The date is not placed automatically into the reference line.
wide
The with of the reference line corresponds to address and sender’s additional
information.
date, but it can hold additional data. Possible values for this option are shown in
table 4.12
.
Default is narrow and dateright
v3.09
.
\setkomavar{yourref}[description ]{content }
\setkomavar{yourmail}[ description ]{ content }
\setkomavar{myref}[description ]{content }
\setkomavar{customer}[description ]{content }
\setkomavar{invoice}[description ]{content }
These five variables represent typical fields of the reference line. Their meanings are given in
table 4.1
on
page 136
. Each variable has also a predefined description , shown in
table 4.13
.
Additional information about adding other variables to the reference line may be found in
section 22.2
from
page 423
onward.
Font style and color
v2.97c
of the description and content of the fields of the reference line may
be changed with elements refname and refvalue. Therefor the commands \setkomafont
Table 4.13.: predefined descriptions of
typical variables of the reference fields line
using macros depending on the current
language
variable name description
e. g., in english
yourref
\yourrefname
Your reference
yourmail
\yourmailname
Your letter from
myref
\myrefname
Our reference
customer
\customername
Customer No.:
invoice
\invoicename
Invoice No.:
date
\datename
date
180
Chapter 4.
Table 4.14.: default font style configuration of the ele-
ments of the reference line
element
default configuration
refname
\sffamily\scriptsize
refvalue
and \addtokomafont (see
section 4.9
,
page 53
) should be used. The default configuration of
both elements is listed in
table 4.14
.
\setkomavar{place}[description ]{content }
\setkomavar{placeseparator}[ description ]{ content }
If all variables of the reference line are empty, the line will be omitted. In this case, the
content
of place and placeseparator will be set, followed by the content of date. The
predefined content of the placeseparator is a comma followed by a non-breaking space. If
the variable place has no content value then the hyphen remains unset also. The predefined
content
of date is \today and depends on the setting of the option numericaldate (see
page 177
).
Since version 3.09
v3.09
place and date the alignment of place and date is given by option refline.
The available alignment values for this option are listed in
table 4.12
.
The
v3.12
font setting of place and date in the date line are given by font elementplaceanddate
instead of element refvalue, which would be used for general reference lines. You can change
the empty default of the font element using commands \setkomafont and \addtokomafont
(see
section 4.9
,
page 53
).
Dostları ilə paylaş: |