| 1 |
% ====================================================================== |
| 2 |
% scrlttr2-experts-en.tex |
| 3 |
% Copyright (c) Markus Kohm, 2002-2022 |
| 4 |
% |
| 5 |
% This file is part of the LaTeX2e KOMA-Script bundle. |
| 6 |
% |
| 7 |
% This work may be distributed and/or modified under the conditions of |
| 8 |
% the LaTeX Project Public License, version 1.3c of the license. |
| 9 |
% The latest version of this license is in |
| 10 |
% http://www.latex-project.org/lppl.txt |
| 11 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 12 |
% version 2005/12/01 or later and of this work. |
| 13 |
% |
| 14 |
% This work has the LPPL maintenance status "author-maintained". |
| 15 |
% |
| 16 |
% The Current Maintainer and author of this work is Markus Kohm. |
| 17 |
% |
| 18 |
% This work consists of all files listed in MANIFEST.md. |
| 19 |
% ====================================================================== |
| 20 |
% |
| 21 |
% Chapter about scrlttr2 of the KOMA-Script guide expert part |
| 22 |
% Maintained by Markus Kohm |
| 23 |
% |
| 24 |
% ============================================================================ |
| 25 |
|
| 26 |
\KOMAProvidesFile{scrlttr2-experts-en.tex} |
| 27 |
[$Date: 2023-08-10 10:46:50 +0200 (Do, 10. Aug 2023) $ |
| 28 |
KOMA-Script guide (chapter: scrlttr2 for experts)] |
| 29 |
|
| 30 |
\translator{Harald Bongartz\and Georg Grandke\and Raimund Kohl\and Jens-Uwe |
| 31 |
Morawski\and Stephan Hennig\and Gernot Hassenpflug\and Markus Kohm\and |
| 32 |
Karl Hagen} |
| 33 |
|
| 34 |
\chapter{Additional Information about the \Class{scrlttr2} Class and the |
| 35 |
\Package{scrletter} Package} |
| 36 |
\labelbase{scrlttr2-experts} |
| 37 |
|
| 38 |
\BeginIndexGroup |
| 39 |
\BeginIndex{Class}{scrlttr2} |
| 40 |
This chapter provides additional information about the \KOMAScript{} class |
| 41 |
\Class{scrlttr2}. \iffree{Some parts of the chapter are found only in the |
| 42 |
German \KOMAScript{} book \cite{book:komascript}. This should not be a |
| 43 |
problem, because the}{The} average user, who only wants to use the class |
| 44 |
or package, will not normally need this information. Part of this information |
| 45 |
is addressed to users for whom the default options are insufficient. Thus, |
| 46 |
for example, the first section describes in detail the pseudo-lengths that |
| 47 |
specify the letterhead page and which can be used be used to modify the its |
| 48 |
layout.% |
| 49 |
\iffalse% Es wird Zeit das komplett rauszuwerfen! |
| 50 |
In addition, this chapter also describes features that exist only to |
| 51 |
provide compatibility with the deprecated \Class{scrlettr} class. It also |
| 52 |
explains in detail how to convert a document from this obsolete class |
| 53 |
to the current class. |
| 54 |
\fi |
| 55 |
|
| 56 |
\BeginIndex{Package}{scrletter}% |
| 57 |
Starting with \KOMAScript~3.15\ChangedAt[2014/11]{v3.15}{\Package{scrletter}}, |
| 58 |
you can use the \Package{scrletter} package with one of the \KOMAScript{} |
| 59 |
classes \Class{scrartcl}, \Class{scrreprt}, or \Class{scrbook}. It provides |
| 60 |
nearly all the features of \Class{scrlttr2} for those classes. There are, |
| 61 |
however, a few differences described later in this chapter.% |
| 62 |
|
| 63 |
|
| 64 |
\section{Variables for Experienced Users} |
| 65 |
\seclabel{variables} |
| 66 |
\BeginIndexGroup |
| 67 |
\BeginIndex{}{variables} |
| 68 |
|
| 69 |
\KOMAScript{} provides commands not only to use predefined variables but also |
| 70 |
to define new variables or to change their automatic use within the reference |
| 71 |
line\Index{reference line}. |
| 72 |
|
| 73 |
\begin{Declaration} |
| 74 |
\Macro{newkomavar}\OParameter{description}\Parameter{name}% |
| 75 |
\Macro{newkomavar*}\OParameter{description}\Parameter{name}% |
| 76 |
\Macro{addtoreffields}\Parameter{name} |
| 77 |
\Macro{removereffields}% |
| 78 |
\Macro{defaultreffields}% |
| 79 |
\end{Declaration} |
| 80 |
\Macro{newkomavar} defines a new variable. This variable is referenced as |
| 81 |
\PName{name}. Optionally, you can define a \PName{description} for the |
| 82 |
\PName{name} variable. Unlike the \PName{name}, the \PName{description} is not |
| 83 |
used to reference a variable. Instead, the \PName{description} acts as a |
| 84 |
supplement to the content of a variable that can be printed as a label along |
| 85 |
with its content. |
| 86 |
|
| 87 |
You can use the \Macro{addtoreffields} command to add the \PName{name} |
| 88 |
variable to the reference line\Index{reference line} (see |
| 89 |
\autoref{sec:scrlttr2.firstpage}, \DescPageRef{scrlttr2.option.refline}). The |
| 90 |
\PName{description} and the content of the variable are added to the end of |
| 91 |
the reference line. The starred version \Macro{newkomavar*} is similar to the |
| 92 |
unstarred version but also calls the \Macro{addtoreffields} command. Thus, the |
| 93 |
starred version automatically adds the variable to the reference line. |
| 94 |
\begin{Example} |
| 95 |
Suppose you need an additional field for a telephone extension in the |
| 96 |
reference line. You can define this field with |
| 97 |
\begin{lstcode} |
| 98 |
\newkomavar[Extension]{myphone} |
| 99 |
\addtoreffields{myphone} |
| 100 |
\end{lstcode} |
| 101 |
or more concisely with |
| 102 |
\begin{lstcode} |
| 103 |
\newkomavar*[Extension]{myphone} |
| 104 |
\end{lstcode} |
| 105 |
\end{Example} |
| 106 |
When\textnote{Attention!} you define a variable for the reference line, you |
| 107 |
should always give it a description. |
| 108 |
|
| 109 |
You can use the \Macro{removereffields} command to remove all variables from |
| 110 |
the reference field. This includes the predefined variables of the class. The |
| 111 |
reference line is then empty. This can be useful, for example, if you wish to |
| 112 |
change the order of the variables in the reference fields line. |
| 113 |
|
| 114 |
The \Macro{defaultreffields} command resets the reference fields line to its |
| 115 |
predefined format. In doing so, all custom-defined variables are removed from |
| 116 |
the reference fields line. |
| 117 |
|
| 118 |
You\textnote{Attention!} should not add the date to the reference line with |
| 119 |
the \Macro{addtoreffields} command. Instead you should use the |
| 120 |
\DescRef{scrlttr2.option.refline}% |
| 121 |
\important{\OptionValueRef{scrlttr2}{refline}{dateleft}\\ |
| 122 |
\OptionValueRef{scrlttr2}{refline}{dateright}\\ |
| 123 |
\OptionValueRef{scrlttr2}{refline}{nodate}}% |
| 124 |
\IndexOption{refline~=\textKValue{dateleft}}% |
| 125 |
\IndexOption{refline~=\textKValue{dateright}}% |
| 126 |
\IndexOption{refline~=\textKValue{nodate}} option to select whether the date |
| 127 |
should appear on the left or right side of the reference line, or not at all. |
| 128 |
These settings also affect the position of the date when no reference line is |
| 129 |
used.% |
| 130 |
% |
| 131 |
\EndIndexGroup |
| 132 |
|
| 133 |
|
| 134 |
\begin{Declaration} |
| 135 |
\Macro{usekomavar}\OParameter{command}\Parameter{name}% |
| 136 |
\Macro{usekomavar*}\OParameter{command}\Parameter{name} |
| 137 |
\end{Declaration} |
| 138 |
The \DescRef{scrlttr2.cmd.usekomavar} and \DescRef{scrlttr2.cmd.usekomavar*} |
| 139 |
commands are, like all commands where a starred version exists or which can |
| 140 |
take an optional argument, not fully expandable. Nevertheless, if you use them |
| 141 |
within \DescRef{scrlttr2.cmd.markboth}\IndexCmd{markboth}, |
| 142 |
\DescRef{scrlttr2.cmd.markright}\IndexCmd{markright} or similar commands, you |
| 143 |
need not insert \Macro{protect}\IndexCmd{protect} beforehand. Of course |
| 144 |
this is also true for |
| 145 |
\DescRef{scrlayer-scrpage.cmd.markleft}\IndexCmd{markleft} if you use the |
| 146 |
\hyperref[cha:scrlayer-scrpage]{\Package{scrlayer-scrpage}}% |
| 147 |
\IndexPackage{scrlayer-scrpage} package. These\textnote{Attention!} commands |
| 148 |
cannot be used within commands that directly affect their argument, such as |
| 149 |
\Macro{MakeUppercase}\important{\Macro{MakeUppercase}}% |
| 150 |
\IndexCmd{MakeUppercase}. To avoid this problem you can use commands like |
| 151 |
\Macro{MakeUppercase} as an optional argument to \Macro{usekomavar} or |
| 152 |
\Macro{usekomavar*}. Then you will get the upper-case content of a variable |
| 153 |
with |
| 154 |
\begin{lstcode}[escapeinside=`'] |
| 155 |
\usekomavar[\MakeUppercase]{`\PName{Name}'} |
| 156 |
\end{lstcode} |
| 157 |
% |
| 158 |
\EndIndexGroup |
| 159 |
|
| 160 |
|
| 161 |
\begin{Declaration} |
| 162 |
\Macro{Ifkomavarempty}\Parameter{name}\Parameter{true}\Parameter{false}% |
| 163 |
\Macro{Ifkomavarempty*}\Parameter{name}\Parameter{true}\Parameter{false} |
| 164 |
\end{Declaration} |
| 165 |
It is important to know that the content of the variable will be expanded as |
| 166 |
far as this is possible with \Macro{edef}. If this results in spaces or |
| 167 |
unexpandable macros like \Macro{relax}, the result will be not empty even |
| 168 |
where the use of the variable would not result in any visible output. |
| 169 |
|
| 170 |
Once\textnote{Attention!} again, this command cannot be used as the argument |
| 171 |
of \Macro{MakeUppercase}\IndexCmd{MakeUppercase} or similar commands However, |
| 172 |
it is robust enough to be used as the argument of |
| 173 |
\DescRef{scrlttr2.cmd.markboth} or \DescRef{scrlttr2.cmd.footnote}, for |
| 174 |
example.% |
| 175 |
% |
| 176 |
\EndIndexGroup |
| 177 |
|
| 178 |
|
| 179 |
\begin{Declaration} |
| 180 |
\Macro{foreachkomavar}\Parameter{list of variables}\Parameter{command} |
| 181 |
\Macro{foreachnonemptykomavar}\Parameter{list of variables}\Parameter{command} |
| 182 |
\Macro{foreachemptykomavar}\Parameter{list of variables}\Parameter{command} |
| 183 |
\Macro{foreachkomavarifempty}\Parameter{list of variables} |
| 184 |
\Parameter{then-code}\Parameter{else-code} |
| 185 |
\end{Declaration} |
| 186 |
The\ChangedAt{v3.27}{\Class{scrlttr2}\and \Package{scrletter}} |
| 187 |
\Macro{foreachkomavar} command executes the specified \PName{command} for each |
| 188 |
variable in the comma-separated \PName{list of variables}. The name of each |
| 189 |
variable is added as parameter to the \PName{command}.% |
| 190 |
|
| 191 |
The \Macro{foreachnonemptykomavar} command does the same but only for those |
| 192 |
variables that are not empty in sense of |
| 193 |
\DescRef{\LabelBase.cmd.Ifkomavarempty}. Empty variables in the \PName{list of |
| 194 |
variables} are ignored. |
| 195 |
|
| 196 |
By contrast, the \Macro{foreachemptykomavar} command executes the |
| 197 |
\PName{command} only for variables that are empty in sense of |
| 198 |
\DescRef{\LabelBase.cmd.Ifkomavarempty}. Accordingly, non-empty variables are |
| 199 |
ignored. |
| 200 |
|
| 201 |
The \Macro{foreachkomavarifempty} command is a kind of combination of the two |
| 202 |
previously described commands. It executes the \PName{then-command} only for |
| 203 |
those variables in the \PName{list of variables} that are empty, and the |
| 204 |
\PName{else-command} for the non empty variables. As with \PName{command}, the |
| 205 |
name of each variable is added as a parameter in both cases.% |
| 206 |
\EndIndexGroup |
| 207 |
% |
| 208 |
\EndIndexGroup |
| 209 |
|
| 210 |
|
| 211 |
\section{Additional Information about Page Styles} |
| 212 |
\seclabel{pagestyleatscrletter} |
| 213 |
\BeginIndexGroup |
| 214 |
\BeginIndex{}{page>style} |
| 215 |
|
| 216 |
\LoadNonFree{scrlttr2-experts}{0}% |
| 217 |
\EndIndexGroup |
| 218 |
|
| 219 |
\iffalse% Wurde bereits in Kapitel 4.21 behandelt |
| 220 |
\section{Differences in How \Package{scrletter} Handles \File{lco} Files} |
| 221 |
\seclabel{lcoatscrletter} |
| 222 |
\BeginIndexGroup |
| 223 |
\BeginIndex{File}{lco} |
| 224 |
\BeginIndex{}{lco file=\File{lco} file} |
| 225 |
|
| 226 |
As\ChangedAt{v3.15}{\Package{scrletter}} explained in |
| 227 |
\autoref{sec:scrlttr2.lcoFile}, \Class{scrlttr2} can load \File{lco} files via |
| 228 |
the optional argument of \Macro{documentclass}. The \Package{scrletter} package |
| 229 |
does not support this. |
| 230 |
|
| 231 |
\begin{Declaration} |
| 232 |
\Macro{LoadLetterOption}\Parameter{name}% |
| 233 |
\Macro{LoadLetterOptions}\Parameter{list of names} |
| 234 |
\end{Declaration} |
| 235 |
For \Class{scrlttr2}, load \File{lco} files with |
| 236 |
\DescRef{scrlttr2.cmd.LoadLetterOption} or |
| 237 |
\DescRef{scrlttr2.cmd.LoadLetterOptions} is only a recommendation. For |
| 238 |
\Package{scrletter}, it is mandatory. Of course, you can only load the |
| 239 |
\File{lco} files after you load \Package{scrletter}. |
| 240 |
% |
| 241 |
\EndIndexGroup |
| 242 |
% |
| 243 |
\EndIndexGroup |
| 244 |
\fi |
| 245 |
|
| 246 |
|
| 247 |
\section{\File{lco} Files for Experienced Users} |
| 248 |
\seclabel{lcoFile} |
| 249 |
\BeginIndexGroup |
| 250 |
\BeginIndex{File}{lco} |
| 251 |
\BeginIndex{}{lco file=\File{lco} file} |
| 252 |
|
| 253 |
\BeginIndexGroup% |
| 254 |
\BeginIndex{}{paper>format}% |
| 255 |
Although you can use any paper size that the |
| 256 |
\hyperref[cha:typearea]{\Package{typearea}}% |
| 257 |
\IndexPackage{typearea} package can configure, the output of the letterhead |
| 258 |
page may produce undesirable results with some formats. Unfortunately, there |
| 259 |
are no general rules to calculate the position of the address fields and the |
| 260 |
like for every available paper size. Instead, different parameter sets are |
| 261 |
needed for different paper sizes.% |
| 262 |
|
| 263 |
%\subsection{Verifying the Paper Size} |
| 264 |
%\seclabel{papersize} |
| 265 |
|
| 266 |
At present parameter sets and \File{lco} files exist only for A4-sized and |
| 267 |
letter-sized paper. Theoretically, however, the \Class{scrlttr2} class can |
| 268 |
support many more paper sizes. Therefore, it's necessary to verify that the |
| 269 |
correct paper size is used. This is even more true if you use |
| 270 |
\Package{scrletter}, since the paper size depends on the class you use. |
| 271 |
|
| 272 |
\begin{Declaration} |
| 273 |
\Macro{LetterOptionNeedsPapersize}% |
| 274 |
\Parameter{option name}\Parameter{paper size} |
| 275 |
\end{Declaration} |
| 276 |
To provide at least a warning when another \PName{paper size} is used, you can |
| 277 |
find a \Macro{LetterOptionNeedsPapersize} command in every \File{lco} file |
| 278 |
distributed with {\KOMAScript}. The first argument is the name of the |
| 279 |
\File{lco} file without the ``\File{.lco}'' suffix. The second argument is the |
| 280 |
paper size for which the \File{lco} file is designed. |
| 281 |
|
| 282 |
If several \File{lco} files are loaded in succession, a |
| 283 |
\Macro{LetterOptionNeedsPapersize} command can be contained in each of them, |
| 284 |
but the \DescRef{scrlttr2.cmd.opening} command will only check the last given |
| 285 |
\PName{paper size}. As the following example shows, an experienced user can |
| 286 |
thus easily write \File{lco} files with parameter sets for other paper sizes. |
| 287 |
\iffalse% Umbruchoptimierung |
| 288 |
If you do not plan to set up such \File{lco} files yourself, you can just |
| 289 |
forget about this option and skip the example.% |
| 290 |
\fi |
| 291 |
\begin{Example} |
| 292 |
Suppose you use A5-sized paper in normal, that is upright or portrait, |
| 293 |
orientation for your letters. Let's assume that you want to put them into |
| 294 |
standard C6 window envelopes. In that case, the position of the address |
| 295 |
field would be the same as for a standard letter on A4-sized paper. The main |
| 296 |
difference is that A5 paper needs only one fold. So you want to disable the |
| 297 |
top and bottom fold marks. You can do this, for example, by placing the |
| 298 |
marks outside the paper area. |
| 299 |
\begin{lstcode} |
| 300 |
\ProvidesFile{a5.lco} |
| 301 |
[2002/05/02 letter class option] |
| 302 |
\LetterOptionNeedsPapersize{a5}{a5} |
| 303 |
\setplength{tfoldmarkvpos}{\paperheight} |
| 304 |
\setplength{bfoldmarkvpos}{\paperheight} |
| 305 |
\end{lstcode} |
| 306 |
Of course, it would be more elegant to deactivate the marks with the |
| 307 |
\DescRef{scrlttr2.option.foldmarks} option. In addition, you must adjust the |
| 308 |
position of the footer, that is, the \PLength{firstfootvpos} pseudo-length. |
| 309 |
I leave it to the reader to find an appropriate value. When using such an |
| 310 |
\File{lco} file, you must declare other \File{lco} file options like |
| 311 |
\File{SN} before you load ``\File{a5.lco}''. |
| 312 |
\end{Example} |
| 313 |
% |
| 314 |
\EndIndexGroup% |
| 315 |
\EndIndexGroup% |
| 316 |
\vskip-\ht\strutbox% Wegen Beispiel am Ende der Erklaerung |
| 317 |
|
| 318 |
|
| 319 |
%\subsection{Visualizing Positions} |
| 320 |
%\seclabel{visualize} |
| 321 |
%\BeginIndexGroup |
| 322 |
\begin{Declaration} |
| 323 |
\File{visualize.lco} |
| 324 |
\end{Declaration} |
| 325 |
\BeginIndex{Option}{visualize}% |
| 326 |
If you develop your own \File{lco} file, for example to modify the positions |
| 327 |
of various fields on the letterhead page because your own desires or |
| 328 |
requirements, it is helpful if you can make at least some elements directly |
| 329 |
visible. The \File{lco} file |
| 330 |
\File{visualize.lco}\ChangedAt{v3.04}{\Class{scrlttr2}} exists for this |
| 331 |
purpose. You can load this file as you would any other \File{lco} file. But |
| 332 |
this \emph{letter class options} file must be loaded in the document preamble, |
| 333 |
and its effects cannot be deactivated. The \File{lco} file uses the |
| 334 |
\Package{eso-pic}\IndexPackage{eso-pic}% |
| 335 |
\important[i]{\Package{eso-pic}\\\Package{graphicx}} and |
| 336 |
\Package{graphicx}\IndexPackage{graphicx} packages, which are not part of |
| 337 |
\KOMAScript. |
| 338 |
|
| 339 |
|
| 340 |
\begin{Declaration} |
| 341 |
\Macro{showfields}\Parameter{field list} |
| 342 |
\end{Declaration} |
| 343 |
This command makes the space occupied by the fields on the letterhead page |
| 344 |
visible. The \PName{field list} argument is a comma-separated list of fields |
| 345 |
to be shown. The following fields are supported: |
| 346 |
\begin{labeling}[~--]{\PValue{location}} |
| 347 |
\item[\PValue{test}] is a 10\Unit{cm} by 15\Unit{cm} test field, 1\Unit{cm} |
| 348 |
from the top and left edges of the paper. This field exists for debugging. |
| 349 |
You can use it as a benchmark to check whether the measurements have been |
| 350 |
distorted during the creation of the document. |
| 351 |
\item[\PValue{head}] is the header area of the letterhead page. This field |
| 352 |
is open at the bottom. |
| 353 |
\item[\PValue{foot}] is the footer area of the letterhead page. This field is |
| 354 |
open at the top. |
| 355 |
\item[\PValue{address}] is the address window area used by window envelopes. |
| 356 |
\item[\PValue{location}] is the field for the extra sender information. |
| 357 |
\item[\PValue{refline}] is the reference line. This field is open at the |
| 358 |
bottom. |
| 359 |
\end{labeling}% |
| 360 |
\BeginIndex{FontElement}{field}\LabelFontElement{field}% |
| 361 |
You can change the colour of the visualisation with |
| 362 |
the\DescRef{scrlttr2.cmd.setkomafont} and \DescRef{scrlttr2.cmd.addtokomafont} |
| 363 |
(see \autoref{sec:scrlttr2.textmarkup}, |
| 364 |
\DescPageRef{scrlttr2.cmd.setkomafont}) commands using the |
| 365 |
\FontElement{field}\important{\FontElement{field}} element. The default is |
| 366 |
\Macro{normalcolor}.% |
| 367 |
\EndIndex{FontElement}{field}% |
| 368 |
% |
| 369 |
\EndIndexGroup |
| 370 |
|
| 371 |
|
| 372 |
\begin{Declaration} |
| 373 |
\Macro{setshowstyle}\Parameter{style}% |
| 374 |
\Macro{edgesize} |
| 375 |
\end{Declaration} |
| 376 |
By default, \File{visualize.lco} indicates the individual areas with |
| 377 |
frames\important{\PValue{frame}}, which corresponds to the \PName{style} |
| 378 |
\PValue{frame}. Areas open at top or bottom are not completely framed but have |
| 379 |
an open edge with with small arrows pointing up or down. |
| 380 |
Alternatively\important{\PValue{rule}}, you can use the \PName{style} |
| 381 |
\PValue{rule}. In this case, the area is highlighted by a background colour. |
| 382 |
It isnot possible to distinguish open and closed areas. Instead a minimal |
| 383 |
height will be used for open areas. The third\important{\PValue{edges}} |
| 384 |
available \PName{style} is \PValue{edges}, which shows the corners of the |
| 385 |
areas. The corner marks at the open edge of open areas will be omitted. The |
| 386 |
size of two edges of the corner marks are given by the \Macro{edgesize} macro |
| 387 |
with a default of 1\Unit{ex}.% |
| 388 |
\EndIndexGroup |
| 389 |
|
| 390 |
|
| 391 |
\begin{Declaration} |
| 392 |
\Macro{showenvelope}\AParameter{width\textup{,}height}% |
| 393 |
\AParameter{h-offset\textup{,}v-offset}% |
| 394 |
\OParameter{instructions}% |
| 395 |
\Macro{showISOenvelope}\Parameter{format}\OParameter{instructions}% |
| 396 |
\Macro{showUScommercial}\Parameter{format}\OParameter{instructions}% |
| 397 |
\Macro{showUScheck}\OParameter{instructions}% |
| 398 |
\Macro{unitfactor} |
| 399 |
\end{Declaration} |
| 400 |
If you have loaded \File{visualize.lco}, you can use these commands to output |
| 401 |
a page with a drawing of an envelope. The envelope drawing is always rotated |
| 402 |
by 90\textdegree{} on a separate page and printed in 1:1~scale. The addressee |
| 403 |
window is generated automatically from the current data for the address |
| 404 |
position of the letterhead page: \PLength{toaddrvpos}, \PLength{toaddrheight}, |
| 405 |
\PLength{toaddrwidth}, and \PLength{toaddrhpos}. To do so requires knowing how |
| 406 |
much smaller the folded letter pages are than the width and height of the |
| 407 |
envelope. If you do not specify these two values, \PName{h-offset} and |
| 408 |
\PName{v-offset}, when calling \Macro{showenvelope}, they are calculated from |
| 409 |
the fold marks and the paper size itself. |
| 410 |
|
| 411 |
The \Macro{showISOenvelope}, \Macro{showUScommercial}, and \Macro{showUScheck} |
| 412 |
commands are based on \Macro{showenvelope}. With \Macro{showISOenvelope}, you |
| 413 |
can create ISO-envelopes in C4, C5, C5/6, DL (also known as C5/6) or C6 |
| 414 |
\PName{format}. With \Macro{showUScommercial}, you can create a US commercial |
| 415 |
envelope in the 9 or 10 \PName{format}. You can use \Macro{showUScheck} for |
| 416 |
envelopes in US check format. |
| 417 |
|
| 418 |
\BeginIndex{FontElement}{letter}\LabelFontElement{letter}% |
| 419 |
The position of the letterhead page inside the envelope is indicated with |
| 420 |
dashed lines. You can change the colour of these lines with the |
| 421 |
\DescRef{scrlttr2.cmd.setkomafont} and \DescRef{scrlttr2.cmd.addtokomafont} |
| 422 |
(see \autoref{sec:scrlttr2.textmarkup}, |
| 423 |
\DescPageRef{scrlttr2.cmd.setkomafont}) using the |
| 424 |
\FontElement{letter}\important{\FontElement{letter}} element. The default is |
| 425 |
\Macro{normalcolor}.% |
| 426 |
\EndIndex{FontElement}{letter}% |
| 427 |
|
| 428 |
\BeginIndex{FontElement}{measure}\LabelFontElement{measure}% |
| 429 |
The envelope drawing will be provided with dimensions automatically. You can |
| 430 |
change the colour of these dimension labels with the commands |
| 431 |
\DescRef{scrlttr2.cmd.setkomafont} and \DescRef{scrlttr2.cmd.addtokomafont} |
| 432 |
(see \autoref{sec:scrlttr2.textmarkup}, |
| 433 |
\DescPageRef{scrlttr2.cmd.setkomafont}) using the |
| 434 |
\FontElement{measure}\important{\FontElement{measure}} element. The default is |
| 435 |
\Macro{normalcolor}. The dimensions are given in multiples of |
| 436 |
\Length{unitlength}, with an accuracy of $1/\Macro{unitfactor}$, where the |
| 437 |
accuracy of \TeX{} arithmetic is the actual limits. The default is 1. You can |
| 438 |
redefine \Macro{unitfactor} using \Macro{renewcommand}.% |
| 439 |
\EndIndex{FontElement}{measure}% |
| 440 |
|
| 441 |
\begin{Example} |
| 442 |
You are generating a sample letter using the ISO-A4 format. The supported |
| 443 |
fields should be marked with yellow borders to check their position. |
| 444 |
Furthermore, the position of the window for a DL-size envelope should be |
| 445 |
checked with drawing. The dimension lines in this drawing should be red, and |
| 446 |
the numbers should use a smaller font, with the dimensions printed in cm |
| 447 |
with an accuracy of 1\Unit{mm}. The dashed letterhead page in the envelope |
| 448 |
should be coloured green. |
| 449 |
\begin{lstcode} |
| 450 |
\documentclass[visualize]{scrlttr2} |
| 451 |
\usepackage{xcolor} |
| 452 |
\setkomafont{field}{\color{yellow}} |
| 453 |
\setkomafont{measure}{\color{red}\small} |
| 454 |
\setkomafont{letter}{\color{green}} |
| 455 |
\showfields{head,address,location,refline,foot} |
| 456 |
\usepackage[british]{babel} |
| 457 |
\usepackage{lipsum} |
| 458 |
\begin{document} |
| 459 |
\setkomavar{fromname}{Joe Public} |
| 460 |
\setkomavar{fromaddress}{2 Valley\\ |
| 461 |
SAMPLEBY\\ |
| 462 |
ZY32 1XW} |
| 463 |
\begin{letter}{% |
| 464 |
1 Hillside\\ |
| 465 |
SAMPLESTEAD\\ |
| 466 |
WX12 3YZ% |
| 467 |
} |
| 468 |
\opening{Hello,} |
| 469 |
\lipsum[1] |
| 470 |
\closing{Good bye} |
| 471 |
\end{letter} |
| 472 |
\setlength{\unitlength}{1cm} |
| 473 |
\renewcommand*{\unitfactor}{10} |
| 474 |
\showISOenvelope{DL} |
| 475 |
\end{document} |
| 476 |
\end{lstcode} |
| 477 |
This will show the letterhead page as the first page and the drawing of the |
| 478 |
envelope on the second page. |
| 479 |
\end{Example} |
| 480 |
|
| 481 |
Note that poorly chosen combinations of \Length{unitlength} and |
| 482 |
\Macro{unitfactor} can quickly lead to a \TeX{} \emph{arithmetic overflow} |
| 483 |
error. The dimension numbers shown may also differ slightly from the actual |
| 484 |
values. Neither are errors in \Option{visualize} but merely implementation |
| 485 |
limitations of \TeX. |
| 486 |
% |
| 487 |
\EndIndexGroup |
| 488 |
% |
| 489 |
\EndIndexGroup |
| 490 |
% |
| 491 |
\EndIndexGroup |
| 492 |
|
| 493 |
|
| 494 |
\section{Language Support} |
| 495 |
\seclabel{languages}% |
| 496 |
\BeginIndexGroup |
| 497 |
\BeginIndex{}{languages}% |
| 498 |
|
| 499 |
The \Class{scrlttr2} class and the \Package{scrletter} package support many |
| 500 |
languages. These include German\Index{language>German} (\PValue{german} for |
| 501 |
the old German orthography, \PValue{ngerman} for the new orthography; |
| 502 |
\PValue{austrian} for Austrian with the old German orthography, |
| 503 |
\PValue{naustrian}\ChangedAt{v3.09}{\Class{scrlttr2}} for Austrian with the |
| 504 |
new orthography; and \PValue{nswissgerman}\ChangedAt{v3.13}{\Class{scrlttr2}} |
| 505 |
for Swiss German with the new orthography, \PValue{swissgerman} for Swiss |
| 506 |
German with the old orthography), English\Index{language>English} (among |
| 507 |
others, \PValue{english} without specification as to whether American or |
| 508 |
British should be used, \PValue{american} and \PValue{USenglish} for American |
| 509 |
English, and \PValue{british} and \PValue{UKenglish} for British English), |
| 510 |
French\Index{language>French}, Italian\Index{language>Italian}, |
| 511 |
Spanish\Index{language>Spanish}, Dutch\Index{language>Dutch}, |
| 512 |
Croatian\Index{language>Croatian}, Finnish\Index{language>Finnish}, |
| 513 |
Norwegian\Index{language>Norwegian}\ChangedAt{v3.02}{\Class{scrlttr2}}, |
| 514 |
Swedish\Index{language>Swedish}\ChangedAt{v3.08}{\Class{scrlttr2}}, |
| 515 |
Polish\ChangedAt{v3.13}{\Class{scrlttr2}}, |
| 516 |
Czech\ChangedAt{v3.13}{\Class{scrlttr2}}, and Slovak. |
| 517 |
|
| 518 |
You can switch languages using the \Package{babel}\IndexPackage{babel} package |
| 519 |
(see \cite{package:babel}) with the \Macro{selectlanguage}\Parameter{language} |
| 520 |
command. Other packages like \Package{german}\IndexPackage{german} (see |
| 521 |
\cite{package:german}) and \Package{ngerman}\IndexPackage{ngerman} (see |
| 522 |
\cite{package:ngerman}) also define this command. As a rule though, the |
| 523 |
language selection occurs immediately as a direct consequence of loading such |
| 524 |
a package. |
| 525 |
\iffalse% Umbruchkorrekturtext |
| 526 |
For details, please refer to the documentation of the relevant packages. |
| 527 |
\fi |
| 528 |
|
| 529 |
There\textnote{Attention!} is one more point to note about language-switching |
| 530 |
packages. The |
| 531 |
\Package{french}\IndexPackage{french}\important{\Package{french}} package (see |
| 532 |
\cite{package:french}) makes changes well beyond redefining the terms in |
| 533 |
\autoref{tab:\LabelBase.languageTerms}. For instance, it redefines the |
| 534 |
\DescRef{scrlttr2.cmd.opening} command, since the package simply assumes that |
| 535 |
\DescRef{scrlttr2.cmd.opening} is always defined as it is in the standard |
| 536 |
\Class{letter} class. This, however, is not the case with \KOMAScript{}. The |
| 537 |
\Package{french} package thus overwrites the definition and does not work |
| 538 |
correctly with \KOMAScript. I regard this as a fault in the \Package{french} |
| 539 |
package which, although reported decades ago, was unfortunately never |
| 540 |
eliminated. |
| 541 |
|
| 542 |
If you use the \Package{babel}\IndexPackage{babel} package to switch to |
| 543 |
\PValue{french}, problems can occasionally occur. With \Package{babel}, |
| 544 |
however, you can usually deactivate changes to a language in a targeted |
| 545 |
manner.% |
| 546 |
\iffalse% This is actually outdated! |
| 547 |
\ If the package \Package{french} is not installed, the problem with |
| 548 |
\Package{babel} does not arise. Similarly, the problem usually does not |
| 549 |
exist when you use \Package{babel} with other varieties of French such as |
| 550 |
\PValue{acadian}, \PValue{canadien}, \PValue{francais} or \PValue{frenchb} |
| 551 |
instead of \PValue{french}. |
| 552 |
\fi |
| 553 |
|
| 554 |
\iffalse% This is also outdated! |
| 555 |
However, with \Package{babel} version 3.7j and above, this problem only occurs |
| 556 |
if the option explicitly indicates that \Package{babel} should use the |
| 557 |
\Package{french} package. |
| 558 |
% |
| 559 |
\iftrue |
| 560 |
If you cannot be sure you are not using an old version of \Package{babel}, I |
| 561 |
recommend you use |
| 562 |
\begin{lstcode} |
| 563 |
\usepackage[...,frenchb,...]{babel} |
| 564 |
\end{lstcode} |
| 565 |
to select French. |
| 566 |
\iffalse % |
| 567 |
If necessary, you can still switch to French with |
| 568 |
\Macro{selectlanguage}\PParameter{french}.% |
| 569 |
\fi% |
| 570 |
\fi |
| 571 |
\fi |
| 572 |
|
| 573 |
\iffalse |
| 574 |
It cannot be ruled out that similar problems will not occur with other |
| 575 |
languages or packages. For German and English, however, there are currently |
| 576 |
no known problems with the \Package{babel} package. |
| 577 |
\fi |
| 578 |
|
| 579 |
|
| 580 |
\begin{Declaration} |
| 581 |
\Macro{yourrefname}% |
| 582 |
\Macro{yourmailname}% |
| 583 |
\Macro{myrefname}% |
| 584 |
\Macro{customername}% |
| 585 |
\Macro{invoicename}% |
| 586 |
\Macro{subjectname}% |
| 587 |
\Macro{ccname}% |
| 588 |
\Macro{enclname}% |
| 589 |
\Macro{headtoname}% |
| 590 |
\Macro{headfromname}% |
| 591 |
\Macro{datename}% |
| 592 |
\Macro{pagename}% |
| 593 |
\Macro{mobilephonename}% |
| 594 |
\Macro{phonename}% |
| 595 |
\Macro{faxname}% |
| 596 |
\Macro{emailname}% |
| 597 |
\Macro{wwwname}% |
| 598 |
\Macro{bankname} |
| 599 |
\end{Declaration} |
| 600 |
These commands contain the language-dependent terms. These\important[i]{% |
| 601 |
\DescRef{scrbase.cmd.newcaptionname}\\ |
| 602 |
\DescRef{scrbase.cmd.renewcaptionname}\\ |
| 603 |
\DescRef{scrbase.cmd.providecaptionname}} definitions can be |
| 604 |
modified to support a new language or for your private customization, as |
| 605 |
described in |
| 606 |
\autoref{sec:scrbase.languageSupport}. \KOMAScript{} sets these terms only in |
| 607 |
\Macro{begin}\PParameter{document}. Therefore they are not available in the |
| 608 |
preamble and cannot be redefined there. The default settings for |
| 609 |
\Option{english} and \Option{ngerman} are listed in |
| 610 |
\autoref{tab:\LabelBase.languageTerms}.% |
| 611 |
\EndIndexGroup |
| 612 |
%\iffree{}{\clearpage}% Siehe Kommentar zur Tabelle |
| 613 |
|
| 614 |
\begin{Declaration} |
| 615 |
\Macro{captionsacadian} |
| 616 |
\Macro{captionsamerican} |
| 617 |
\Macro{captionsaustralien} |
| 618 |
\Macro{captionsaustrian} |
| 619 |
\Macro{captionsbritish} |
| 620 |
\Macro{captionscanadian} |
| 621 |
\Macro{captionscanadien} |
| 622 |
\Macro{captionscroatian} |
| 623 |
\Macro{captionsczech} |
| 624 |
\Macro{captionsdutch} |
| 625 |
\Macro{captionsenglish} |
| 626 |
\Macro{captionsfinnish} |
| 627 |
\Macro{captionsfrancais} |
| 628 |
\Macro{captionsfrench} |
| 629 |
\Macro{captionsgerman} |
| 630 |
\Macro{captionsitalian} |
| 631 |
\Macro{captionsnaustrian} |
| 632 |
\Macro{captionsnewzealand} |
| 633 |
\Macro{captionsngerman} |
| 634 |
\Macro{captionsnorsk} |
| 635 |
\Macro{captionsnswissgerman} |
| 636 |
\Macro{captionspolish} |
| 637 |
\Macro{captionsslovak} |
| 638 |
\Macro{captionsspanish} |
| 639 |
\Macro{captionsswedish} |
| 640 |
\Macro{captionsswissgerman} |
| 641 |
\Macro{captionsUKenglish} |
| 642 |
\Macro{captionsUSenglish} |
| 643 |
\end{Declaration} |
| 644 |
If you change the language of a letter, the language-dependent terms listed in |
| 645 |
\autoref{tab:\LabelBase.languageTerms}, |
| 646 |
\autopageref{tab:\LabelBase.languageTerms} are redefined using these |
| 647 |
commands. If your language-switching package does not support this, you can |
| 648 |
also use the above commands directly. |
| 649 |
% |
| 650 |
\begin{table} |
| 651 |
\begin{minipage}{\textwidth} |
| 652 |
\centering |
| 653 |
% \KOMAoptions{captions=topbeside}% |
| 654 |
% \setcapindent{0pt}% |
| 655 |
\caption[{% |
| 656 |
Defaults for language-dependent terms |
| 657 |
}]{% |
| 658 |
Defaults for language-dependent terms for the languages |
| 659 |
\Option{english} and \Option{ngerman}, if they are not already defined |
| 660 |
by the packages used for language switching% |
| 661 |
\label{tab:\LabelBase.languageTerms}% |
| 662 |
}[l] |
| 663 |
\begin{tabular}[t]{lll} |
| 664 |
\toprule |
| 665 |
Command & \Option{english} & \Option{ngerman} \\ |
| 666 |
\midrule |
| 667 |
\Macro{bankname} & Bank account & Bankverbindung \\ |
| 668 |
\Macro{ccname}\footnotemark[1] & cc & Kopien an \\ |
| 669 |
\Macro{customername} & Customer no. & Kundennummer \\ |
| 670 |
\Macro{datename} & Date & Datum \\ |
| 671 |
\Macro{emailname} & Email & E-Mail \\ |
| 672 |
\Macro{enclname}\footnotemark[1] & encl & Anlagen \\ |
| 673 |
\Macro{faxname} & Fax & Fax \\ |
| 674 |
\Macro{headfromname} & From & Von \\ |
| 675 |
\Macro{headtoname}\footnotemark[1] & To & An \\ |
| 676 |
\Macro{invoicename} & Invoice no. & Rechnungsnummer \\ |
| 677 |
\Macro{myrefname} & Our ref. & Unser Zeichen \\ |
| 678 |
\Macro{pagename}\footnotemark[1] & Page & Seite \\ |
| 679 |
\Macro{mobilephonename} & Mobile phone & Mobiltelefon \\ |
| 680 |
\Macro{phonename} & Phone & Telefon \\ |
| 681 |
\Macro{subjectname} & Subject & Betrifft \\ |
| 682 |
\Macro{wwwname} & Url & URL \\ |
| 683 |
\Macro{yourmailname} & Your letter of & Ihr Schreiben vom\\ |
| 684 |
\Macro{yourrefname} & Your ref. & Ihr Zeichen \\ |
| 685 |
\bottomrule |
| 686 |
\end{tabular} |
| 687 |
\deffootnote{1em}{1em}{1\ }% brutal aber effektiv |
| 688 |
\footnotetext[1000]{Normally these terms are defined by language |
| 689 |
packages like \Package{babel}. In this case, \KOMAScript{} does not |
| 690 |
redefine them. The actual wording may therefore differ and can |
| 691 |
be found in the documentation for the language package used.} |
| 692 |
% \end{captionbeside} |
| 693 |
\end{minipage} |
| 694 |
\end{table} |
| 695 |
% |
| 696 |
\EndIndexGroup |
| 697 |
\iffree{}{\clearpage}% Umbruchkorrektur |
| 698 |
|
| 699 |
\begin{Declaration} |
| 700 |
\Macro{dateacadian} |
| 701 |
\Macro{dateamerican} |
| 702 |
\Macro{dateaustralien} |
| 703 |
\Macro{dateaustrian} |
| 704 |
\Macro{datebritish} |
| 705 |
\Macro{datecanadian} |
| 706 |
\Macro{datecanadien} |
| 707 |
\Macro{datecroatian} |
| 708 |
\Macro{dateczech} |
| 709 |
\Macro{datedutch} |
| 710 |
\Macro{dateenglish} |
| 711 |
\Macro{datefinnish} |
| 712 |
\Macro{datefrancais} |
| 713 |
\Macro{datefrench} |
| 714 |
\Macro{dategerman} |
| 715 |
\Macro{dateitalian} |
| 716 |
\Macro{datenaustrian} |
| 717 |
\Macro{datenewzealand} |
| 718 |
\Macro{datengerman} |
| 719 |
\Macro{datenorsk} |
| 720 |
\Macro{datenswissgerman} |
| 721 |
\Macro{datepolish} |
| 722 |
\Macro{dateslovak} |
| 723 |
\Macro{datespanish} |
| 724 |
\Macro{dateswedish} |
| 725 |
\Macro{dateswissgerman} |
| 726 |
\Macro{dateUKenglish} |
| 727 |
\Macro{dateUSenglish} |
| 728 |
\end{Declaration} |
| 729 |
Depending on the language used, the numerical representation of the date\Index{date} (see option |
| 730 |
\DescRef{scrlttr2.option.numericaldate} in \autoref{sec:scrlttr2.firstpage}, |
| 731 |
\DescPageRef{scrlttr2.option.numericaldate}) is formatted in various ways. |
| 732 |
The exact format can be found in \autoref{tab:date}.% |
| 733 |
\EndIndexGroup |
| 734 |
% |
| 735 |
\EndIndexGroup |
| 736 |
\iffree{}{\clearpage}% Umbruchkorrektur zwecks Ausgabe der Tabellen |
| 737 |
|
| 738 |
\begin{table}[!tp]% Umbruchoptimierung |
| 739 |
% \centering |
| 740 |
\KOMAoptions{captions=topbeside}% |
| 741 |
\setcapindent{0pt}% |
| 742 |
% \caption |
| 743 |
\begin{captionbeside}{Language-dependent forms of the date}[l] |
| 744 |
\begin{tabular}[t]{ll} |
| 745 |
\toprule |
| 746 |
Command & Date Example \\ |
| 747 |
\midrule |
| 748 |
\Macro{dateacadian} & 24.\,12.\,1993\\ |
| 749 |
\Macro{dateamerican} & 12/24/1993\\ |
| 750 |
\Macro{dateaustralien}& 24/12/1993\\ |
| 751 |
\Macro{dateaustrian} & 24.\,12.\,1993\\ |
| 752 |
\Macro{datebritish} & 24/12/1993\\ |
| 753 |
\Macro{datecanadian} & 1993/12/24\\ |
| 754 |
\Macro{datecanadien} & 1993/12/24\\ |
| 755 |
\Macro{datecroatian} & 24.\,12.\,1993.\\ |
| 756 |
\Macro{dateczech} & 24.\,12.\,1993\\ |
| 757 |
\Macro{datedutch} & 24.\,12.\,1993\\ |
| 758 |
\Macro{dateenglish} & 24/12/1993\\ |
| 759 |
\Macro{datefinnish } & 24.12.1993.\\ |
| 760 |
\Macro{datefrancais} & 24.\,12.\,1993\\ |
| 761 |
\Macro{datefrench} & 24.\,12.\,1993\\ |
| 762 |
\Macro{dategerman} & 24.\,12.\,1993\\ |
| 763 |
\Macro{dateitalian} & 24.\,12.\,1993\\ |
| 764 |
\Macro{datenaustrian} & 24.\,12.\,1993\\ |
| 765 |
\Macro{datenewzealand}& 24/12/1993\\ |
| 766 |
\Macro{datengerman} & 24.\,12.\,1993\\ |
| 767 |
\Macro{datenorsk} & 24.12.1993\\ |
| 768 |
\Macro{datenswissgerman} & 24.\,12.\,1993\\ |
| 769 |
\Macro{datepolish} & 24.\,12.\,1993\\ |
| 770 |
\Macro{dateslovak} & 24.\,12.\,1993\\ |
| 771 |
\Macro{datespanish} & 24.\,12.\,1993\\ |
| 772 |
\Macro{dateswedish} & 24/12 1993\\ |
| 773 |
\Macro{dateswissgerman} & 24.\,12.\,1993\\ |
| 774 |
\Macro{dateUKenglish} & 24/12/1993\\ |
| 775 |
\Macro{dateUSenglish} & 12/24/1993\\ |
| 776 |
\bottomrule |
| 777 |
\end{tabular} |
| 778 |
\end{captionbeside} |
| 779 |
\label{tab:date} |
| 780 |
\end{table} |
| 781 |
% |
| 782 |
\section{Obsolete Commands} |
| 783 |
\seclabel{obsolete} |
| 784 |
\BeginIndexGroup |
| 785 |
|
| 786 |
\LoadNonFree{scrlttr2-experts}{1} |
| 787 |
\EndIndexGroup |
| 788 |
% |
| 789 |
\iffalse% Es wird Zeit das komplett rauszuwerfen! |
| 790 |
\section{From Obsolete \Class{scrlettr} to Current \Class{scrlttr2}} |
| 791 |
\seclabel{fromscrlettr} |
| 792 |
|
| 793 |
With\textnote{Attention!} the 2002 release of \Class{scrlttr2} (see |
| 794 |
\autoref{cha:scrlttr2}), the old letter class, \Class{scrlettr}, became |
| 795 |
obsolete, and it is no longer part of \KOMAScript. If you still need the class |
| 796 |
or information about it, you will find it in |
| 797 |
\cite{package:koma-script-obsolete}. |
| 798 |
|
| 799 |
To facilitate the transition to the new class, there is the compatibility |
| 800 |
option \Option{KOMAold}. Basically, all the older functionality still |
| 801 |
exists in the new class. Without \Option{KOMAold}, however, the user |
| 802 |
interface and the defaults are different. More details on |
| 803 |
this option are provided in \autoref{sec:scrlttr2.lcoFile}, |
| 804 |
\autoref{tab:lcoFiles}. |
| 805 |
|
| 806 |
\LoadNonFree{scrlttr2-experts}{2} |
| 807 |
% |
| 808 |
\EndIndexGroup |
| 809 |
\fi |
| 810 |
% |
| 811 |
\EndIndexGroup |
| 812 |
|
| 813 |
\endinput |
| 814 |
|
| 815 |
%%% Local Variables: |
| 816 |
%%% mode: latex |
| 817 |
%%% TeX-master: "scrguide-en.tex" |
| 818 |
%%% coding: utf-8 |
| 819 |
%%% ispell-local-dictionary: "en_GB" |
| 820 |
%%% eval: (flyspell-mode 1) |
| 821 |
%%% End: |