Akletter.cls Manual

Axel Kielhorn a.kielhorn@tu-bs.de

30. Mai 2000

1 Preface

In the beginning there was Lindner-TEX for the Atari St computer. It came with a letter style called liletter.sty. I adapted the style to my liking and saw that everything was good.

On the second day, my roommate came, saw my letters and wanted a similar style for his correspondence, thus a second letter style was created and everything was good.

On the third day, I had to write an official letter for the students group I was working with and I had to create a third letter style. And I said onto myself “Well, that’s a fine mess you got yourself into.”

And than came the June of 1994 and They released L^{A}TEX 2ε. I realized immediately that I had to adjust my letter styles. And I decided to separate the class from the user defined settings and put the class into a .cls file and the user defined settings into a .cfg file. And again everything was good.

After someone asked in de.comp.text.tex for a letter class suitable for ISO A4 paper that will work with envelopes with windows, I said onto my letter class “Go out into the world and show the people out there how to print letters with L^{A}TEX.” And my letter class was distributed throughout the internet to every user who has to print letters on A4 paper. And it was not only used in the german speaking countries but spread even to Norway and Italy where the german tongue was not well known, except in some holiday centers where you find few L^{A}TEX users.

And a cry came onto me “Dear Axel, who has made akletter.cls, can you give us, who do not read nor speak german, an english version of the documentation to your class?” And I said onto me “Oh bugger, that will be a lot of work, but it is raining outside and I have nothing better to do, so why not?” And this is the story of this document. If you don’t like it try scrlettr.cls from the Koma-Script packages which is a very nice letter class and even shares some code with akletter.cls.

2 What does akletter.cls do?

akletter implements a fixed layout for the first page of a letter. This layout consists of boxes at fixed positions with a more or less variable contents. This picture will give you an impression about how the layout looks:

FIRM Firmreturn Addressfield Refline Subject Opening Closing Firmfoot  Firmaddress Right- box Date

Some of these boxes are static. They are created once (at the \begin{document} command) and cannot be changed later.

• FIRM

• Firmaddress

• Firmreturn

• Firmfoot. The other boxes are created for each letter (did you know that you can

have more letters in one document? Well, don’t bother, it is easier to have one document for each letter).

• Refline

• Subject • Opening

• Closing

The layout of these boxes is defined in the cfg file. You can select different cfg files with the \usename command. If you omitt it, akletter.cfg will be used. Thus all the user specific data is separated from the class file and you should be able to update the class without changing the cfg file. This didn’t always work because I change the interface to allow for new configuration options but in theory it was a good idea.

3 The cfg file

This file contains all the user specific options. You should never have to edit the class file.^{1} You usually create this file once when you install akletter.cls and never touch it again. (Unless you move, change your ISP, marry or whatever). You should keep a copy of akletter.cfg because it contains a lot of small code-fragments that you may want to use later.

\makeatletter

You may have to redefine some internal commands.

\telephone{0800 / 12 34 56 }
\telefax  {}
%% You may include logos and other graphic-material into
%% your letterhead:
%%
%%\RequirePackage[dvips]{graphics}

Define your phone and fax number, thus you don’t have to type it for every new letter. If you want to include a picture in your letterhead (or a scanned signature) you may need the graphics-package.

%% You may redefine the following variables
%%
%\renewcommand*{\yourrefname}   {Ihr Zeichen:}
%\renewcommand*{\yourmailname}  {Ihr Schreiben vom:}
%\renewcommand*{\myrefname}     {Unser Zeichen:}
%\renewcommand*{\mymailname}    {Unser Schreiben vom:}
%\renewcommand*{\customername}  {Kundennummer }
%\renewcommand*{\invoicename}   {Rechnungsnummer }
%\renewcommand*{\subjectname}   {}  %{Betr.}
%\renewcommand*{\ccname}        {Kopien an:}
%\renewcommand*{\enclname}      {Anlagen:}
%\renewcommand*{\headtoname}    {An}
%\renewcommand*{\datename}      {Datum}
%\renewcommand*{\pagename}      {Seite}
%\renewcommand*{\telephonename} {Telefon}
%\renewcommand*{\telefaxname}   {FAX}

1This may not be true if you want to add a new language or some fancy option.

You can change the text akletter.cls inserts into your letter. This does only work with german.sty. When you use babel.sty you may need to add some more code to your cfg file to make it work. The code below may help you getting it to work:

\let\savedcaptions\captionsgerman
\def\captionsgerman{\savedcaptions
   \renewcommand*{\myrefname} {Mein Zeichen:}
   }
%% Alternate definitions for the reference-line.
%% Use this if you do not need a mymail-entry.
%% In fact you can do a lot of things with these
%% 4 entries, e.g. setting \mymailname to {InvoiceNo}
%% and using \mymail to display an invoiceno.
%% You may change these lines but make sure that
%% the combined length of the 3 fields is 1\leftfield
%% or less.
%\def\yref#1{\def\@yref{\parbox[t]{.33\leftfield}
%    {\scriptsize \yourrefname\\ \normalsize #1}}
%     reftrue}
%\def\ymail#1{\def\@ymail{\parbox[t]{.33\leftfield}
%    {\scriptsize \yourmailname\\ \normalsize #1}}
%     reftrue}
%\def\myref#1{\def\@myref{\parbox[t]{.33\leftfield}
%    {\scriptsize \myrefname\\ \normalsize #1}}
%     reftrue}
%\let\mymail=\@gobbleone

The reference line is build according to DIN 676 but can be redefined according to your needs. The normal layout uses 4 fields unless you use the refdate option, then it uses 5 fields. The code above changes that to 3 fields.

%%% Top of first page: left
\sbox{\FIRM}
   {\parbox[t]{\leftfield}
   {\fontsize{17.28}{22pt}\fontseries{bx}\selectfont%
    Mein Name\hfill}}
%%% Top of first page: right
\sbox{\firmaddress}
% Use either Text:
   {\parbox[t]{\rightfield}{%
    \fontsize{9}{10pt}\selectfont\normalfont
    Meine Stra{\ss}e 1\\ 12345 Meindorf}}
% or graphic:
% {\includegraphics{ourlogo}}
% and don't forget to adjust FIRM and firmaddress:
%%% Top of first page: left + right
%%% You may want to adjust the raisebox
\sbox{\FIRMHEAD}
   {\usebox{\FIRM}\raisebox{3mm}{\usebox{\firmaddress}}}

The letterhead on the first page consists of the two boxes FIRM and firmaddress which will be put together into FIRMHEAD. I use this approach because it enables me to shift the firmaddress up and down to make it look correct and to make it easier to include a logo in one of the boxes.

%%% Top of every other page
\sbox{\firm}
   {\fontsize{10}{12pt}\selectfont\normalfont
    Mein Name}

The following pages do not need such an elaborated layout, simply put your name on it. If you really want to use some fancy headings look into the cfg file for suggestion or use fancyhdr.sty.

% \if@twoside % Twoside definition
%   \def\ps@headings{%
%       \def\@oddfoot{\hfil Text on the odd page}
%    \def\@evenfoot{Text on the even page\hfil}
%       \def\@oddhead{\usebox{\firm}
%          \headfont\hfil\@date\hfil\pagename\ \pnumfont\thepage}%
%       \let\@evenhead\@oddhead}
% \else % Oneside definition
%   \def\ps@headings{%
%       \def\@oddfoot{\hfil Text for one-side layout\hfill}
%       \def\@oddhead{\usebox{\firm}
%          \headfont\hfil\@date\hfil\pagename\ \pnumfont\thepage}}
% \fi
%%% Return address
%%% one line version
\sbox{\firmreturn}
   {\underline{\fontsize{7}{8pt}\selectfont
    \hskip5mm Mein Name $\cdot$ Meine Stra{\ss}e 1
    $\cdot$ D--12345 Meindorf\hskip5mm}}
%%% two line version
%\sbox{\firmreturn}
%   {\underline{
%      \fontsize{7}{8pt}\fontfamily{\sfdefault}\selectfont
%      \hskip3mm\parbox{65mm}
%      {\makebox[65mm][c]
%   {Fachschaft -- Maschinenbau $\cdot$
%    \mbox{\raise .75ex \hbox{c}\kern -.15em /\kern -.125em
%        \smash{\lower .3ex \hbox{o}}}
% AStA TU Braunschweig}
% \makebox[65mm][c]
%    {Katharinenstra{\ss}e 1 $\cdot$ D--38106 Braunschweig}}
%   \hskip3mm}}

It is always nice for the addressee to see the sender of the letter before opening it. If you don’t happen to have envelopes with your name and corporation printed on them, you may want to use a line above the address to show who you are.

%%% Firstpage footer
%%% The code should be controlled by @banklo
\sbox{\firmfoot}
   {\fontsize{9}{11pt}\selectfont
%%% The following line may look nice in a FAX.CFG :-)
%%% If you have a bad telephone-line try snail-mail!\\
     \if@banklo
       \ifnum\language = \l@german
  Bankverbindung:
  \hspace{5mm}
  \parbox[t]{\rightfield}{\raggedright
  Undeutsche Landesbank Frankfurt,
  BLZ~123\,456\,78, Konto~1\,111\,007\\}%
  \hspace{5mm}
  \parbox[t]{\rightfield}{\raggedright
  Die Sparkasse Meindorf,
  BLZ~007\,123\,10, Konto~08\,15\\}
       \fi
     \fi}

The footer of the first page is quite complex because it contains vital information if you are a company. (But then you will have your own stationary and don’t have to print this every time.) According to DIN this is where information about your bank connection, the type of your company, the registration number in the register of commerce and all this should go. Since you won’t need this information for a private letter, there is a switch to enable it. Use the option banklow if you want this information to appear.

Some amateur designers put this information in the letter head, right of the address. Since this place is dedicated for a “received” rubber stamp it should remain free. But if you want to use it, see below:

%%% Text displayed below the header on the right side
%%% This should be controlled by @bankhi
%%% This is the only place that will be re-evaluated for
%%% every letter! Everything that changes for different
%%% letters (in the same document) must go either here
%%% or in the ref-line.
\newcommand{\rightbox}
    {\parbox[t]{\rightfield}
    {\fontsize{9}{11pt}\selectfont
     \raggedright
     \ifx\fromname\@empty
     \else
       \ifnum \language = \l@german
  Sachbearbeiter:
       \fi
       \fromname\\
     \fi
     \ifx\telephonenum\@empty
 \ifnum \language = \l@german

\telephonename: 040 / 44\,17\,77
\else
\telephonename: 49--40--44\,17\,77
\fi
\else
\telephonename: \telephonenum
\fi\\[1.5ex]
\ifx\telefaxnum\@empty
\ifnum \language = \l@german
\telefaxname: 040 / 44\,17\,77
\else
\telefaxname: 49--40--44\,17\,77
\fi
\else
\telefaxname: \telefaxnum
\fi\\[1.5ex]
\ifx\@email\@empty
e-mail Kein Mehl\\[1.5ex]
\else
e-mail: \@email \\[1.5ex]
\fi
\if@bankhi
  \ifnum \language = \l@german
Bankverbindung:\\[1ex]
Undeutsche Landesbank Frankfurt,
BLZ~123\,456\,78, Konto~1\,111\,007\\[.5ex]
Die Sparkasse L\"uneburg,
BLZ~007\,123\,10, Konto~08\,15 \\[.5ex]
  \fi
\fi
%% Finally fixed it!
%% If you want to have the date here, set the
%% rightdate option.
%% (With a big excuse to Markus and many others, who
%% had to wait that long)
\if@rightdate
  \vspace{0.5ex}
  \normalsize\@date
\fi
 }}

This rather complex code prints some text to the right of the address field. It will be evaluated for every new letter thus things that change from letter to letter has to go here. Some of the text shown in the example above should really be in the footer, but since people keep asking me how to put it into the rightfield I include it here. You have to set the bankhigh option to enable some of the code above. Note that banklow and bankhigh are not exclusive, you can define both if you want.

%% The labels defined in akletter.cls are what my printer likes:

%% Onecolumn, 100mm * 50mm, 3mm separation.
%% If you have different lables edit here:
%\renewcommand*{\startlabels}{\labelcount\z@
%   \pagestyle{empty}\let\@texttop\relax
% The margins are calculated from the 1in,1in point,
% thus negative values will occur if the margins are smaller
%   \topmargin -60\p@
%   \headsep \z@
%   \oddsidemargin -35\p@
%   \evensidemargin -35\p@
%   \textheight 10in
%   \@colht\textheight \@colroom\textheight \vsize\textheight
%   \textwidth 550\p@
% You may have to increase columnsep if you use twocolumn
% This is what letter.cls uses.
%   \columnsep 26\p@
% This does almost nothing since there is an explicit
% fontsize-command in the text written.
%   \ifcase \@ptsize\relax
%     \normalsize
%   \or
%     \small
%   \or
%     \footnotesize
%   \fi
%   \baselineskip \z@
%   \lineskip \z@
%   \boxmaxdepth \z@
%   \parindent \z@
% This is obvious, isn't it?
%   \twocolumn
%   \relax}
%% This is how the label will look like when printed.
%% Note that specialmail will be written to the .aux-file
%% when the letter is processed. The width used here is
%% what letter.cls uses.
%\renewcommand*{\mlabel}[2]{%
%  \parbox[b][2in][c]{262\p@}{%
%     \strut\ignorespaces\usebox{\firmreturn}\\
%     \fontsize{12}{14pt}\selectfont
%     \parbox[t][1.2in][c]{3in}{#2}
%   }\par%
%}

The code above overrides the normal code for printing address labels. It has to be adjusted for the kind of labels you use. You may even have to include some specials to tell the printer to select the labels from a different tray. This is left as an exercise to the reader. (But note that you can get envelops with windows in C5 and C4 (if that means anything to you) thus you may never need to print labels.)

\makeatother
\endinput

You may want to include something like the following into your .cfg file:

\email{A.Kielhorn@tu-bs.de}
\mailbox{}
\name{A. Kielhorn }
\signature{(Axel Kielhorn)}

4 The first letter

You can’t define everything in the cfg file, otherwise you would be writing the same letter again and again. Thus there are many settings you have to define in every letter:

The following commands have to appear in the preamble, before \begin{document}.

usenamedefault selects the cfg file.

pagestyle{headings} Style of the following pages, can be headings, plain or empty.

makelabels Do you really want to generate labels?

selectlanguage{english} The language you want to use (obvious, isn’t it?) You have to set it in the preamble because the boxes containing the fixed text are defined by the \begin{document} command and they have to know the language of the letter.

Since version 1.5e there are some additional options to change the layout of the letter, if you really want to (These commands have been added to enable one user to copy a certain WinWord design):

reffont \renewcommand*\reffont{} changes the font that akletter uses to

print the text in the reference line, the default is normalfont

reftextfont \renewcommand*\reftextfont{} changes the font used to print

the arguments (i. e. the user supplied text) in the reference line, default

     is normalfont
headfont \renewcommand*\headfont{} changes the font used to print the hea-

ding on every page but the first. This will only work with the pagestyle headings, default is slshape

pnumfont \renewcommand*\pnumfont{} changes the font used to print the pa-

genumber, default is normalfont

The following commands are letter specific. If you change them inside a letter environment they will not affect subsequent letters. telephone{0800 - 12 34 56} Overriding the default telephone number

telefax{0800 - 12 34 57} the fax number,
email{A.Kielhorn@tu-bs.de} email address

mailbox{ } and mailbox. name{A. Kielhorn} When you have .cfg file for the whole company, you may

want to set the name of the individual user here instead of generating lots of cfg files.

signature{(Axel Kielhorn)} usually the name, but you can specify any si-

gnature. specialmail{Recommandé} This will be printed in bold above the recipients

address. (Hey, I know some french!) refdatename{Braunschweig, den} The location where the letter was written.

yref{ }
ymail{1.6.1994}
myref{ak/AK}
mymail{1.6.1994}
subject{LaTeX2e Letter-style}
invoice{Invoice number} still experimental
customer{Customer number} still experimental

opening{Dear friends,} This command generates the letterhead you must not omit it, but you can use an empty argument if you don’t want to address the reader.

Here comes the text…

The end: closing{mfg} This command closes the letter, it must not be omitted but may

contain an empty argument. cc{comp.text.tex} A copy for the archive

encl{akletter.cfg} And an enclosure

ps Hey, the letter is finished. No long postscriptum please.

5 Mass mailings

Version 1.4 of akletter introduced a way to generate mass mailings. This is compatible to scrlettr.cls from the Koma-Script package. If you want to know how to use it read the Koma-Script manual.

6 Options

akletter.cls understands some options

a4paper Selects the page format. A4 is the default.

a4offset This layout ist shiftet 24 points to the right and 24 points narrower than a4paper. It looks better when you put the letter into a binder that covers the left margin of the page. These binders are often used for job applications.

letterpaper This options adapts the layout to US letter paper. Since I haven’t seen an envelope with a window for the address in the US I’m not sure if it is usable, but you can put the letter into a german DIN 680 DL envelope.

banklow and

bankhigh are two switches to enable some code that depends on these switches. In the cfg file distributed with akletter this set the bank connections either at the bottom or in the right field.

foldmarks This shows where to fold the letter to make it fit into the envelop. It doesn’t work on some printers like my Deskwriter:-(

refdate The date will be printed in the reference line thus changing the layout to 5 items.

subjectdate The date is printed in the same line as the subject (default).

rightdate Prints the date in the rightfield unless you change the code:-)

Version 1.5 h of akletter supports the date format according to ISO 8601 which looks like YYYY-MM-DD, e.g. 2000-05-28 for the 28th of May 2000. You can activate this format with \dateiso in the preamble. When you change the language the format is reset to the default for that language, thus you have to put the \dateiso after the \selectlanguage command. This format is recommeded by the Chicago Manual of Style.

7 Thanks

I would like to thank Donald E. Knuth and Leslie Lamport for creating TEX and L^{A}TEX, Stefan Lindner for porting it to the Atari, Andrew Trevorrow for porting it to the Mac and the L^{A}TEX3-Team.

Special thanks to the beta testers who found lots of bugs in previous versions and suggested a lot of new features thus keeping me busy on rainy afternoons.