diff options
author | Karl Berry <karl@freefriends.org> | 2009-03-31 00:25:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-03-31 00:25:41 +0000 |
commit | d9a28f240927d595970990e323f189f3ed45bdaf (patch) | |
tree | 7ccf4eea17aed62ba6dcc4639b67832a863782b4 /Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls | |
parent | 088ae35fa451f7492dec5997ba5f8d53df17f47e (diff) |
koma-script update (30mar09)
git-svn-id: svn://tug.org/texlive/trunk@12579 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls | 329 |
1 files changed, 292 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls b/Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls index 7c1448ca5f9..1933305c456 100644 --- a/Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls +++ b/Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls @@ -66,8 +66,10 @@ %% See `README'. %% %% The KOMA-Script bundle (but maybe not this file) was based upon the -%% LaTeX2.09 Script family created by Frank Neukam 1993 and the LaTeX2e -%% standard classes created by The LaTeX3 Project 1994-1996. +%% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e +%% standard classes created by The LaTeX3 Project 1994-1996. You may +%% find a complete unmodified copy of LaTeX2e at +%% <http://www.ctan.org/pub/tex-archive/macros/latex/base/>. %% %%% From File: scrkvers.dtx \begingroup @@ -91,7 +93,7 @@ \fi } \fi - \@CheckKOMAScriptVersion{2009/01/24 v3.02b KOMA-Script}% + \@CheckKOMAScriptVersion{2009/04/01 v3.03 KOMA-Script}% \endgroup \newcommand*{\KOMAClassName}{% scrlttr2% @@ -159,7 +161,9 @@ \@namedef{scr@v@3.01c}{9} \@namedef{scr@v@3.02}{9} \@namedef{scr@v@3.02b}{9} -\@namedef{scr@v@last}{9} +\@namedef{scr@v@3.02c}{10} +\@namedef{scr@v@3.03}{0} +\@namedef{scr@v@last}{10} %%% From File: scrkmisc.dtx \KOMA@key{draft}[true]{% \KOMA@set@ifkey{draft}{@tempswa}{#1}% @@ -169,7 +173,8 @@ \setlength{\overfullrule}{\z@}% \fi } -\KOMA@DeclareStandardOption{final}{draft=false} +\KOMA@DeclareStandardOption +{final}{draft=false} %%% From File: scrklco.dtx \newcommand*{\lco@test}{% \IfFileExists{\CurrentOption.lco}{% @@ -569,8 +574,60 @@ \KOMA@ifkey{fromemail}{@email} \KOMA@ifkey{fromurl}{@www} \KOMA@ifkey{fromlogo}{@logo} -\newif\if@afield\@afieldtrue -\KOMA@ifkey{addrfield}{@afield} +\newcommand*{\if@afield}{% + \ClassWarning{\KOMAClassName}{% + Usage of \string\if@afield\space deprecated.\MessageBreak + Internal macro \string\if@afield\space was removed at\MessageBreak + KOMA-Script version 3.03. I'll replace the usage of\MessageBreak + \string\if@afield\space by \string\ifnum + \string\@afieldmode=\string\@ne.\MessageBreak + This may result in errors. A better solution would be\MessageBreak + to change the code}% + \ifnum \@afieldmode=\@ne} +\newcommand*{\@afieldtrue}{% + \ClassWarning{\KOMAClassName}{% + Usage of \string\if@afield\space deprecated.\MessageBreak + Internal macro \string\if@afield\space was removed at\MessageBreak + KOMA-Script version 3.03. I'll replace the usage of\MessageBreak + \string\@afieldtrue\space by + \string\KOMAoptions{addrfield=true}.\MessageBreak + This may result in erros. A better solution would be\MessageBreak + to change the code}% + \KOMAoptions{addrfield=true}} +\newcommand*{\@afieldfalse}{% + \ClassWarning{\KOMAClassName}{% + Usage of \string\if@afield\space deprecated.\MessageBreak + Internal macro \string\if@afield\space was removed at\MessageBreak + KOMA-Script version 3.03. I'll replace the usage of\MessageBreak + \string\@afieldfalse\space by + \string\KOMAoptions{addrfield=false}.\MessageBreak + This may result in erros. A better solution would be\MessageBreak + to change the code}% + \KOMAoptions{addrfield=false}} +\newcommand*{\@afieldmode}{\@ne} +\KOMA@ncmdkey{addrfield}[true]{@afieldmode}{% + {false}{0},{off}{0},{no}{0},% + {true}{1},{on}{1},{yes}{1},% + {PP}{2},{pp}{2},% + {PPexplicite}{2},{PPExplicite}{2},% + {ppexplicite}{2},{ppExplicite}{2},% + {backgroundimage}{3},% + {PPbackgroundimage}{3},{PPBackgroundImage}{3},{PPBackGroundImage}{3},% + {ppbackgroundimage}{3},{ppBackgroundImage}{3},{ppBackGroundImage}{3},% + {image}{4},{Image}{4},% + {PPimage}{4},{PPImage}{4},% + {ppimage}{4},{ppImage}{4}% +} +\newcommand*{\ltr@priority}{0}% +\KOMA@ncmdkey{priority}[A]{ltr@priority}{% + {no}{0},{off}{0},{false}{0},{manual}{1},% + {B}{1},{b}{1},% + {economy}{1},{Economy}{1},{ECONOMY}{1},% + {B-ECONOMY}{1},{B-Economy}{1},{b-economy}{1},% + {A}{2},{a}{2},% + {priority}{2},{Priority}{2},{PRIORITY}{2},% + {A-PRIORITY}{2},{A-Priority}{2},{a-priority}{2}% +}% \newcommand{\backaddr@format}[1]{} \let\backaddr@format\underline \newif\if@baddr\@baddrtrue @@ -1784,16 +1841,16 @@ \newcommand*{\@komavar@err}[2]{% \ClassError{% scrlttr2% - }{% + }{% KOMA-Script variable not defined% - }{% + }{% You've tried to #1 the not defined KOMA-Script variable `#2'.\MessageBreak You have to define the variable using \string\newkomavar\space before\MessageBreak you do this.% - }% - } + }% +} \DeclareRobustCommand*{\usekomavar}{% \@ifstar {\@usekomaname}{\@usekomavar}} \newcommand*{\@usekomavar}[2][\@firstofone]{% @@ -1810,32 +1867,43 @@ #1{\@nameuse{scr@#2@name}}% }% } +\DeclareRobustCommand*{\ifkomavar}[1]{% + \scr@ifundefinedorrelax{scr@#1@var}{% + \expandafter\@secondoftwo + }{% + \expandafter\@firstoftwo + }% +} \DeclareRobustCommand*{\ifkomavarempty}{% \begingroup \@ifstar {\@tempswatrue\@ifkomavarempty}% {\@tempswafalse\@ifkomavarempty}% } -\newcommand{\@ifkomavarempty}[3]{% - \@ifundefined{scr@#1@var}{% - \endgroup\@komavar@err{use}{#1}% - }{% - \if@tempswa\endgroup - \@ifundefined{scr@#1@name}{#2}{% - \expandafter\ifx\csname scr@#1@name\endcsname\@empty - #2% - \else - #3% - \fi +\newcommand{\@ifkomavarempty}[1]{% + \ifkomavar{#1}{% + \if@tempswa + \@ifundefined{scr@#1@name}{% + \aftergroup\@firstoftwo + }{% + \expandafter\ifx\csname scr@#1@name\endcsname\@empty + \aftergroup\@firstoftwo + \else + \aftergroup\@secondoftwo + \fi }% - \else\endgroup - \expandafter\ifx\csname scr@#1@var\endcsname\@empty - #2% \else - #3% + \expandafter\ifx\csname scr@#1@var\endcsname\@empty + \aftergroup\@firstoftwo + \else + \aftergroup\@secondoftwo + \fi \fi - \fi + }{% + \@komavar@err{use}{#1}% + \aftergroup\@gobbletwo }% - } + \endgroup +} %%% From File: scrkplen.dtx \newcommand*{\@newplength}[1]{% \@ifundefined{ltr@len@#1}{% @@ -2227,9 +2295,13 @@ } \newenvironment{labeling}[2][]{% \def\sc@septext{#1}% - \list{}{\settowidth{\labelwidth}{#2#1}% + \list{}{\settowidth{\labelwidth}{{% + \usekomafont{labelinglabel}{#1% + \usekomafont{labelingseparator}{\sc@septext}}% + }}% \leftmargin\labelwidth \advance\leftmargin by \labelsep - \let\makelabel\labelinglabel}% + \let\makelabel\labelinglabel + }% }{% \endlist } @@ -2459,6 +2531,10 @@ \newkomafont{fromrule}{} \newkomafont{backaddress}{\sffamily} \newkomafont{specialmail}{} +\newkomafont{priority}{\fontsize{10pt}{10pt}\sffamily\bfseries} +\newkomafont{prioritykey}{\fontsize{24.88pt}{24.88pt}\selectfont} +\newkomafont{PPlogo}{\sffamily\bfseries} +\newkomafont{PPdata}{\sffamily} \newkomafont{addressee}{} \newkomafont{toname}{} \newkomafont{toaddress}{} @@ -2489,6 +2565,9 @@ \@newplength{specialmailindent} \@newplength{specialmailrightindent} \@newplength{toaddrindent} +\@newplength{PPheadheight} +\@newplength{PPheadwidth} +\@newplength{PPdatamatrixvskip} \@newplength{toaddrwidth} \@newplength{toaddrheight} \@newplength{locvpos} @@ -2717,7 +2796,9 @@ }% } \newcommand*{\@addrfield}{% - \if@afield + \ifcase \@afieldmode\relax + \typeout{Address: No}% + \or \begingroup% \if@baddr \ifkomavarempty{backaddress}{% @@ -2728,9 +2809,15 @@ \else \let\@tempa\@empty\let\@tempb\@empty \fi - \ifkomavarempty{specialmail}{}{% - \edef\@tempa{\@tempa\@tempb specialmail}\def\@tempb{,\space}% - }% + \ifcase \ltr@priority + \ifkomavarempty{specialmail}{}{% + \edef\@tempa{\@tempa\@tempb specialmail}\def\@tempb{,\space}% + }% + \or + \edef\@tempa{\@tempa\@tempb B-Economy}\def\@tempb{,\space}% + \or + \edef\@tempa{\@tempa\@tempb A-Priority}\def\@tempb{,\space}% + \fi \typeout{Address (\@tempa\@tempb addressee)}% \endgroup% \move@topt\vskip\useplength{toaddrvpos}% @@ -2754,6 +2841,20 @@ \usekomavar{backaddress}}}}% \fi }{backaddress}{backaddrheight}{\setkomavar}% + \ifcase \ltr@priority + \or + \setkomavar{specialmail}{% + {\usekomafont{priority}{% + {\usekomafont{prioritykey}{B}}% + -ECONOMY}}% + }% + \or + \setkomavar{specialmail}{% + {\usekomafont{priority}{% + {\usekomafont{prioritykey}{A}}% + -PRIORITY}}% + }% + \fi \ifkomavarempty{specialmail}{}{% \vbox{\hsize\useplength{toaddrwidth}% \noindent\hspace*{\useplength{specialmailindent}}% @@ -2771,15 +2872,163 @@ \usekomafont{toaddress}{\usekomavar{toaddress}}}}% \vfil\null}% {address field}{toaddrheight}% - {\begin{letter} or you\MessageBreak + {\string\begin{letter} or you\MessageBreak have to define a smaller special purpose using\MessageBreak \string\specialmail}% }}}% \vskip-\useplength{toaddrvpos}\move@frompt \else - \typeout{Address: No}% + \begingroup% + \if@baddr + \let\@tempa\@empty\let\@tempb\@empty + \ifcase \@afieldmode\relax\or\or + \def\@tempa{PP-mode}\def\@tempb{,\space}% + \or + \def\@tempa{backgroundimage-mode}\def\@tempb{,\space}% + \or + \def\@tempa{image-mode}\def\@tempb{,\space}% + \fi + \ifkomavarempty{backaddress}{}{% + \edef\@tempa{\@tempa\@tempb backaddress ignored}\def\@tempb{,\space}% + }% + \else + \let\@tempa\@empty\let\@tempb\@empty + \fi + \ifcase \ltr@priority + \ifkomavarempty{specialmail}{}{% + \edef\@tempa{\@tempa\@tempb specialmail ignored}\def\@tempb{,\space}% + }% + \or + \edef\@tempa{\@tempa\@tempb B-Economy}\def\@tempb{,\space}% + \or + \edef\@tempa{\@tempa\@tempb A-Priority}\def\@tempb{,\space}% + \fi + \typeout{Address (\@tempa\@tempb addressee)}% + \endgroup% + \move@topt\vskip\useplength{toaddrvpos}% + \vb@t@z{{% + \setlength{\parfillskip}{\z@ \@plus 1fil}% + \setlength{\parindent}{\z@}% + \setlength{\parskip}{\z@}% + \ifdim \useplength{toaddrindent}=\z@ + \@setplength{toaddrindent}{8mm}% + \fi + \ifdim \useplength{PPheadheight}=\z@ + \@setplength{PPheadheight}{20.74pt}% + \fi + \ifdim \useplength{PPheadwidth}=\z@ + \@setplength{PPheadwidth}{42mm}% + \fi + \ifdim \useplength{PPdatamatrixvskip}=\z@ + \@setplength{PPdatamatrixvskip}{9mm}% + \fi + \rlap{\move@topl + \setlengthtoplength{\@tempskipa}{toaddrhpos}% + \ifdim \@tempskipa<\z@ + \addtolength{\@tempskipa}{\paperwidth}% + \addtolengthplength[-]{\@tempskipa}{toaddrwidth}% + \fi + \hskip\@tempskipa + \@savevbox{\useplength{toaddrheight}}{\hsize\useplength{toaddrwidth}% + \ifnum\@afieldmode=\tw@ + \vskip 2pt\relax + \hskip \useplength{toaddrindent}\relax + \fbox{% + \vbox to \dimexpr \useplength{PPheadheight}-2\fboxsep\relax{% + \setlength{\parindent}{0pt}% + \hsize \dimexpr \useplength{PPheadwidth}-2\fboxsep\relax + \setbox\@tempboxa\hbox{% + {\fontsize{20.74pt}{20.74pt}\selectfont + \usekomafont{PPlogo}{P.P.}}\hskip 2mm% + }% + \dp\@tempboxa\z@ + \setlength{\@tempdima}{\hsize}% + \addtolength{\@tempdima}{-\wd\@tempboxa}% + \hbox{\box\@tempboxa + \vbox to \dimexpr + \useplength{PPheadheight}-2\fboxsep\relax{% + \vss\hsize\@tempdima + \raggedright + \fontsize{8pt}{9pt}\selectfont\usekomafont{PPdata}% + \usekomavar*{fromzipcode}\usekomavar{zipcodeseparator}% + \usekomavar{fromzipcode}\unskip\strut\\ + \usekomavar{place}\unskip\strut + \hfill + }% + }% + \vss + }% + }% + \hskip 1mm + \mbox{% + \vbox to \useplength{PPheadheight}{% + \addtolengthplength[-]{\hsize}{PPheadwidth}% + \addtolength{\hsize}{-1mm}% + \addtolengthplength[-2]{\hsize}{toaddrindent}% + \setlength{\parindent}{0pt}% + \fontsize{8pt}{9pt}\selectfont\usekomafont{PPdata}% + \hfill\usekomavar{PPcode} + \vss + \ifcase \ltr@priority + \or + \usekomafont{priority}{% + {\usekomafont{prioritykey}{B}}% + -ECONOMY\hss\vskip-\dp\strutbox + }% + \or + \usekomafont{priority}{% + {\usekomafont{prioritykey}{A}}% + -PRIORITY\hss\vskip-\dp\strutbox + }% + \fi + \vss + }% + }% + \vskip 1mm + \vskip-\ht\strutbox + \noindent\hskip\useplength{toaddrindent}% + \hrulefill% + \hskip\useplength{toaddrindent}% + \vbox to\z@{\hsize\z@ + \vskip \useplength{PPdatamatrixvskip}\relax + \llap{\usekomavar{PPdatamatrix}\hskip\useplength{toaddrindent}}% + \vss + }% + \else + \vskip 1mm + \noindent\expandafter\hskip\useplength{toaddrindent}% + \vbox to \useplength{PPheadheight}{% + \addtolengthplength[-2]{\hsize}{toaddrindent}% + \setlength{\parindent}{0pt}% + \usekomavar{addresseimage}% + \vss + }% + \vskip 1mm + \vskip\dp\strutbox + \fi + \ifnum \@afieldmode=4 \else + \vfil% + \noindent\hskip\useplength{toaddrindent}% + \setlength{\@tempdima}{\useplength{toaddrwidth}}% + \addtolengthplength[-2]{\@tempdima}{toaddrindent}% + \vbox{\hsize\@tempdima + \ifkomavarempty{PPdatamatrix}{}{% + \addtolength{\hsize}{-2mm}% + \settowidth\@tempdima{\usekomavar{PPdatamatrix}}% + \addtolength{\hsize}{-\@tempdima}% + }% + \raggedright + \usekomafont{addressee}{% + \usekomafont{toname}{\usekomavar{toname}\\}% + \usekomafont{toaddress}{\usekomavar{toaddress}}}}% + \fi + \vss\null}% + {address field}{toaddrheight}% + {\string\begin{letter}}% + }}}% + \vskip-\useplength{toaddrvpos}\move@frompt \fi - } +} \newcommand*{\specialmail@format}[1]{} \let\specialmail@format\underline \newcommand*{\@ogobble}[1][]{} @@ -3270,6 +3519,10 @@ \newkomavar{specialmail} \newkomavar{title} \newkomavar{fromlogo} +\newkomavar{fromzipcode} +\newkomavar{PPcode} +\newkomavar{PPdatamatrix} +\newkomavar{addresseimage} \newkomavar[\usekomavar{place}]{placeseparator} \setkomavar{placeseparator}{,~} \newkomavar[\subjectname]{subjectseparator} @@ -3288,6 +3541,8 @@ \setkomavar{emailseparator}{:~} \newkomavar[\wwwname]{urlseparator} \setkomavar{urlseparator}{:~} +\newkomavar{zipcodeseparator} +\setkomavar{zipcodeseparator}{\,--\,} \newkomavar[\headfromname]{fromname} \newkomavar[\usekomavar{fromname}]{fromaddress} \newkomavar[\headtoname]{toname} |