Documente Academic
Documente Profesional
Documente Cultură
Contents
1 Introduction 3
2 Example sources 3
2.1 A standard letter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 A customized letter . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Compatibility 8
3.1 Compatibility with the LATEX 2ε letter class . . . . . . . . . . . . . 8
3.2 Compatibility with other LATEX 2ε classes . . . . . . . . . . . . . . 8
3.3 Compatibility with older versions of chletter . . . . . . . . . . . . . 8
3.4 Compatibility with upcoming versions of chletter . . . . . . . . . . 8
3.5 Compatibility with other packages . . . . . . . . . . . . . . . . . . 8
4 Basic configuration 9
4.1 Class options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Page layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3 The letter environment . . . . . . . . . . . . . . . . . . . . . . . . 11
4.3.1 Letter layout commands . . . . . . . . . . . . . . . . . . . . 11
4.3.2 Page breaking control . . . . . . . . . . . . . . . . . . . . . 11
4.3.3 Letter counter . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.3.4 Letter markup commands . . . . . . . . . . . . . . . . . . . 12
4.3.5 Main letter commands . . . . . . . . . . . . . . . . . . . . . 12
4.3.6 Letter foot commands . . . . . . . . . . . . . . . . . . . . . 14
4.4 Sectioning commands . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.5 Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.6 Paragraph values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
∗ This document corresponds to chletter v2.0, dated 2010/10/10.
1
5 Implementation and advanced configuration 15
5.1 Initial code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.1.1 Declaring options . . . . . . . . . . . . . . . . . . . . . . . . 15
5.1.2 Executing options . . . . . . . . . . . . . . . . . . . . . . . 16
5.1.3 Loading packages . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2 Document layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2.1 Letter counter . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2.2 Letter dimensions . . . . . . . . . . . . . . . . . . . . . . . 16
5.2.3 Paragraphing . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2.4 Page layout . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.2.5 Title layout . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.2.6 Column separation . . . . . . . . . . . . . . . . . . . . . . . 18
5.2.7 Page styles . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.3 Document markup . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.3.1 Default matter . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.3.2 Global declarations . . . . . . . . . . . . . . . . . . . . . . . 20
5.3.3 The letter environment . . . . . . . . . . . . . . . . . . . 21
5.3.4 Page breaking control . . . . . . . . . . . . . . . . . . . . . 22
5.3.5 The generic letter commands . . . . . . . . . . . . . . . . . 22
5.3.6 Sections and paragraphs . . . . . . . . . . . . . . . . . . . . 23
5.3.7 Environments . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.3.8 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.4 Setting the defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.4.1 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.4.2 Array, Tabular, Tabbing, Minipage, Equation . . . . . . . . 24
5.4.3 Framed boxes . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.4.4 Footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.4.5 Letter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.4.6 Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.4.7 Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.4.8 Page and numbering styles . . . . . . . . . . . . . . . . . . 26
5.5 Applying the class options . . . . . . . . . . . . . . . . . . . . . . . 26
5.5.1 Letterhead layout . . . . . . . . . . . . . . . . . . . . . . . . 26
5.5.2 Signature layout . . . . . . . . . . . . . . . . . . . . . . . . 26
5.5.3 Two column mode . . . . . . . . . . . . . . . . . . . . . . . 26
5.6 Later initializations . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2
1 Introduction
The chletter class is suited for typesetting letters with letterhead corresponding to
the swiss norm SN 0101301 .
This class is mostly compatible with the standard LATEX 2ε classes. It is not limited
to letters and may be used as a generic document class.
Its basic usage is very simple and user friendly. It is appropriate to quickly typeset
casual documents and letters.
It is however highly configurable and may be used within complex setups to provide
automated letters composition.
The chletter code is very compact and highly optimized, droping the obsolete
legacy (namely LATEX 2.09) for the sake of efficiency.
2 Example sources
The following examples describe the normal usage of the chletter class. Basically,
the chletter class behaves much like the standard letter class. The letter below will
compile with both classes, although the output won’t be exactly the same.
1 http://www.poste.ch/post-pm-briefe-schweiz.pdf
3
My name April 1st, 2010
My address
My city
Name
Address
City
Salutation,
My name
4
2.2 A customized letter
This example provides a good overview of the different class options and macros.
This document won’t compile with the standard letter class.
\documentclass[leftwin,leftsig]{chletter}
\setlength\addressmargin{320pt}
\makemark
\makelabels
\location{My enterprise}
\name{My name}
\return{My name, My address, My city}
\address{My address\\My city}
\telephone{My phone\\My email}
\date{Here, \today}
\signature{My signature\\\footnotesize My position}
\begin{document}
\begin{letter}{Name\\Address\\City}
\textbf{\object{About the \textsf{chletter} document class}}
\opening{Dear \toname,}
The \texttt{leftwin} option selects a left windowed cover.\\
The \texttt{leftsig} option places the signature against the left margin.\\
\texttt{makemark} adds a fold mark for C6/5 covers.\\
\texttt{makelabels} adds page with only the return and recipient’s addresses.\\
The date field is customized, so is the signature.\\
A return address is specified.\\
The salutation contains the recipient’s name.
\closing{Yours truly,}
\encl{Enclosures}
\cc{Other recipients}
\ps{P. S.}{Post Scriptum}
\end{letter}
\end{document}
5
My enterprise
My name
My address
My city
My phone
My email
My name, My address, My city
Name
Address
City
Dear Name,
The leftwin option selects a left windowed cover.
The leftsig option places the signature against the left margin.
makemark adds a fold mark for C6/5 covers.
makelabels adds page with only the return and recipient’s addresses.
The date field is customized, so is the signature.
A return address is specified.
The salutation contains the recipient’s name.
Yours truly,
My signature
My position
encl Enclosures
cc Other recipients
P. S. Post Scriptum
6
My name, My address, My city
Name
Address
City
7
3 Compatibility
The chletter class is based upon the standard classes of the LATEX 2ε distribution.
It is mostly compatible with any type of document founded on these classes.
8
4 Basic configuration
The default values used by the chletter class are balanced for casual writing of
simple articles (the class can eventually replace the standard article class) and,
obviously, letters. Nevertheless this class is highly configurable and customizable.
lefwin The chletter class provides two additionnal options to modify the layout of the
leftsig letters. leftwin places the recipient’s address to the left of the letterhead rather
than to the right (the latter is the default and the standard in Switzerland).
leftsig aligns the signature field with the left margin rather than with the right
address field.
The space between the left border of the page and the main text is therefore 108pt
(for a single sided document). The header and footer space are 36pt each; so the
default layout gives 108pt between the top of the page and the main text, and
equally 108pt between the main text and the bottom of the page.
\titletopheight These values are used within the letter environment for the layout of the letter-
\titlemidheight head. Please note that everything is related to the LATEX origin, which is 72pt,
\titlebotheight 72pt from the top left corner of the page. The \titlemargin and \titlewidth
\titlemargin values are independant from the \oddsidemargin and \evensidemargin values.
\titlewidth These values are visually presented on next page. The default values are set fol-
\addressmargin lowing the swiss standards for letterhead:
\titletopheight 72pt
\titlemidheight 72pt
\titlebotheight 72pt
\titlemargin 0pt
\titlewidth \paperwidth-144pt
\addressmargin 264pt
9
6
titlewidth - 72pt
72pt - addressmargin -
?
fromname date 6
fromaddress
titletopheight
?
toname 6
toaddress
titlemidheight
?
6
titlebotheight
?
salutation
text
valediction
signature
longindentation - indentedwidth -
textwidth -
10
4.3 The letter environment
The letter environment performs some special actions in the scope of writing let-
ters. At its beginning, it generates the letterhead taking in account its arguments
ans some previously defined values (see below). The letter environment takes
in account some global options, for example twocolumn... so yes, it is possible
to write two column letters! At its closing, the letter environment generates a
cover page if needed (see below).
letter The letter environment takes one mandatory argument : the recipient’s address.
The address should be formatted with newline markers (\\) as in the standard
letter class. The argument is “tokenized” in \toname and \toaddress, which
can be used in the letter body. The “token separator” is the first encountered \\ .
\makelabels Unlike the standard letter class, this macro doesn’t involve a complex mecanism
using the .aux file to build a labels page (the main reason why the standard class
is fragile). Anyway, the chletter class provides a mean to generate dedicated cover
pages. The \makelabels command will set a flag which is checked at the closing
of the letter environment. The default behaviour is to put the recipient’s address
and, as requested by the swiss post, the return address above it, separated by a
line. \makelabels doesn’t take any argument.
\makemark This macro will add a thin line at the left side of the page to help folding a C6/5
letter. \makemark doesn’t take any argument.
\stopbreaks \stopbreaks will try to prevent all page breaks after its invocation.
11
4.3.3 Letter counter
\theletter At each new letter environment opened, this counter is incremented.
\date The date field (stored in the standard \@date) could be set up by, for example:
\today \date{Here, \today}
\signature The value stored by this macro is \fromsig, which is used by the \closing com-
mand to output the signature field (see below).
Please note that \fromname and \fromsig values default to \@author (initialized
by LATEX, modified by the standard \author command). The \@date field defaults
to \today, which will be localized by a linguistic package (babel or polyglossia).
These macros can contain anything that fits in a \parbox, including some special
stuff (using dedicated packages): \location{\includegraphics{mylogo.pdf}}
Any of the values stored by these commands can be retrieved anywhere in the
letter: I, \fromname, declare...
\object This command will simply output the text given in its argument. The \object
command stores its argument in \@title and actually outputs it. If the argument
is empty, the \object command will output the value of \@title previously set
by a \title command:
\title{Answer to your previous letter}
...
\begin{document}
\begin{letter}{...}
\object{}
12
Please note that the following code is functionally equivalent (the \@title value
set by both methods is global (available outside of the current letter environment):
\begin{document}
\begin{letter}{...}
\object{Answer to your previous letter}
\opening This command outputs the text given in its argument (adding some vertical space
after it):
\opening{Dear Sir,}
It stores its argument in \salutation for further use. \salutation can also
be defined before and be output by an invocation of \opening with an empty
argument:
\renewcommand{\salutation}{Dear Sir,}
...
\begin{document}
\begin{letter}{...}
\opening{}
\closing This command outputs the text given in its argument (adding some vertical space
around it) and generates the signature field:
\closing{Yours sincerely,}
This macro stores its argument in \valediction for later use. \valediction can
also be defined before and be output by an invocation of \closing with an empty
argument:
\renewcommand{\valediction}{Yours sincerely,}
\begin{document}
\begin{letter}{...}
...
\closing{}
13
4.3.6 Letter foot commands
Some formatting commands are intented to be used at the end of the letter (al-
though they can be used anywhere in the document, even outside of a letter
environment—just as any formatting command provided by the chletter class).
\ps This command is generic in the sense that it is nothing but a shortcut for a LATEX
list. It takes two mandatory arguments. The text contained in the arguments is
output as an indented paragraph. The indentation margin is set by the standard
LATEX \leftmargin value (which defaults to 18pt at document level, 0pt after
the \closing of a default letter and 36pt after the \closing of an indented [i]
letter). Here is an example use:
\ps{P.S.}{This is a post scriptum}
\encl This command is a shortcut for \ps{\enclname}{...} and takes one mandatory
argument. Regular use is:
\encl{1. Your previous letter\\2. My Curriculum Vit\ae}
\cc This command is a shortcut for \ps{\ccname}{...} and takes one mandatory
argument. Regular use is:
\cc{1. First other recipient\\2. Second other recipient}
\enclname and \ccname are set to {encl}, respectively {cc} by default. They
will be adjusted by a linguistic package (babel or polyglossia).
4.5 Environments
description These environments are available and behave as ordinary in the chletter class.
verse The default list values (at document level) are:\labelsep6pt, \labelwidth12pt,
quotation \leftmargin18pt. Please note that \labelwidth and \labelsep are redefined by
quote a \closing command to: \leftmargin2\parindent, \labelwidth3\labelwidth.
14
5 Implementation and advanced configuration
Appart from the options described until now, it is possible (and allowed!) to
“hook” into certain pieces of the class code. This enables a degree of customization
and extensibility. It would be quite straightforward to add, for example, mail
merging features through a dedicated package. While describing the class code,
we will discuss some of the interesting “hook eye” the chletter class provides to
the advanced user.
The code is structured in the very same manner as the LATEX 2ε standard document
classes. See classes.dtx and letter.dtx for further information.
15
5.1.2 Executing options
Swiss letters are written on A4 paper. Default font size is 10pt, like in other
standard classes. Other switches are set at kernel’s level.
29 \ExecuteOptions{a4paper,10pt}
30 \ProcessOptions
Loading this .clo file leads to a lot of redundancy. But we want compatibility.
31 \input{size1\@ptsize.clo}
37 \newdimen\titlemargin
38 \newdimen\titlewidth
39 \newdimen\addressmargin
40 \newdimen\addresswidth
41 \newdimen\longindentation
42 \newdimen\indentedwidth
5.2.3 Paragraphing
We prefer inter paragraph skips in a letter. Swiss letters are rarely indented but
the letter environement offers an option to do so. Thus indentation is enabled
at the document level.
43 \normallineskip\z@
44 \parskip9\p@
45 \parindent18\p@
16
5.2.4 Page layout
All margin dimensions are measured from a point one inch (actually 72pt and not
72bp) from the top and lefthand side of the page.
We assume nothing fancy in the header and footer. So 12pt (more or less one
line) are reserved, with 24pt spacing before, respectively after, the main text.
46 \headheight12\p@
47 \headsep24\p@
48 \footskip36\p@
We remove 1in (72pt) at each side, plus 36pt horizontally (corresponding to the
additional margin, see below) and 72pt vertically (corresponding to the header
and footer, see above).
49 \textwidth\paperwidth
50 \advance\textwidth-180\p@
51 \textheight\paperheight
52 \advance\textheight-216\p@
The leftside margin of the odd pages is set to 108pt (more or less 4cm). Sizes of
the marginal notes are adapted to quite small margins. Top margin (which also
alters the title position) is set to zero.
53 \oddsidemargin36\p@
54 \evensidemargin\z@
55 \marginparwidth48\p@
56 \marginparsep6\p@
57 \marginparpush6\p@
58 \topmargin\z@
The footnotes values are somewhat larger than the default. They are adapted to
the kind of document this class is intented for.
59 \footnotesep12\p@
60 \skip\footins12\p@
\titlehead The vertical position of the title is controled by the \titlehead value (by analogy
with \headheight which sets the first baseline of the running head) and the space
between the title and the main text by \titlebotheight (see below).
61 \titlehead12\p@
\titlewidth The title (letterhead or cover) field is divided into three strips, each one containing
\titletopheight some material. For example, the first field could contain the sender’s address, the
\titlemidheight second one the recipient’s address and the third one the letter’s date. The default
\titlebotheight values are tuned for swiss windowed envelopes.
17
62 \titlewidth\paperwidth
63 \advance\titlewidth-144\p@
64 \titletopheight72\p@
65 \titlemidheight72\p@
66 \titlebotheight72\p@
\titlemargin Please note that \addressmargin is relative to \titlemargin, the latter set to
\addressmargin zero, so the title is placed at 1in (72pt) from the lefthand side of the page.
67 \titlemargin0\p@
68 \addressmargin264\p@
77\def\ps@firstpage%
78{\let\@oddhead\@empty
79 \let\@evenhead\@empty
80 \def\@oddfoot{\footnotesize\leftmark\hfil\rightmark}
81 \def\@evenfoot{\footnotesize\rightmark\hfil\leftmark}}
82\def\ps@headings%
83{\def\@oddhead{\footnotesize\headtoname~\toname\hfil\pagename~\thepage}
84 \def\@evenhead{\footnotesize\pagename~\thepage\hfil}
85 \def\@oddfoot{\footnotesize\leftmark\hfil\rightmark}
86 \def\@evenfoot{\footnotesize\rightmark\hfil\leftmark}}
87\def\ps@myheadings%
88{\def\@oddhead{\footnotesize\leftmark\hfil\rightmark}
89 \def\@evenhead{\footnotesize\rightmark\hfil\leftmark}
90 \def\@oddfoot{\footnotesize\hfil\pagename~\thepage}
91 \def\@evenfoot{\footnotesize\pagename~\thepage\hfil}}
18
\leftwin The default layout of the letterhead is defined here, according to the class option
\rightwin leftwin which calls either \rightwin (not set, default) or \leftwin (when set).
\titletopmatter, \titlemidmatter and \titlebotmatter are three horizontal
strips which may contain anything that fits in a \parbox.
\splitfield{...}{...} is used to cut these strips into two columns, the second
one placed at \addressmargin from the lefthand side of the letterhead. So we
would be able to define a \titletopmatter{\splitfield{...}{...}} which is
the case here. See below for further explanations.
92 \def\leftwin
93 {\def\titletopmatter%
94 {\splitfield
95 {}
96 {\fromlocation\par
97 \fromname\par
98 \fromaddress\par
99 \telephonenum}}
100 \def\titlemidmatter%
101 {\returnaddress\par
102 \toname\par
103 \toaddress}
104 \def\titlebotmatter%
105 {\splitfield{}{\@date}}}
106 \def\rightwin
107 {\def\titletopmatter%
108 {\splitfield
109 {\fromlocation\par
110 \fromname\par
111 \fromaddress\par
112 \telephonenum}
113 {\@date}}
114 \def\titlemidmatter%
115 {\splitfield
116 {}
117 {\returnaddress\par
118 \toname\par
119 \toaddress}}
120 \def\titlebotmatter%
121 {}}
\leftsig These macros are called by the corresponding class option. They define the
\rightsig \closingmatter which is output by the \closing command. \closingmatter
can contain any piece of text or code. Please note that some list values are altered
here (\leftmargin and \labelwidth). See below for further explanations.
122 \def\leftsig
123 {\def\closingmatter%
124 {\leftmargin2\parindent
125 \vskip4\bigskipamount
126 \ps{}{\fromsig}
127 \vskip\bigskipamount
128 \labelwidth3\labelwidth
129 \advance\labelwidth-\labelsep}}
19
130 \def\rightsig
131 {\def\closingmatter%
132 {\leftmargin\longindentation
133 \vskip4\bigskipamount
134 \ps{}{\fromsig}
135 \vskip\bigskipamount
136 \leftmargin2\parindent
137 \labelwidth3\labelwidth
138 \advance\labelwidth-\labelsep}}
Please note the crafty use of the \ps command. \leftmargin and \labelwidth
values are changed after the \closing command (which calls the \closingmatter
defined here).
\splitfield The letterhead is divided in three vertically stacked strips of \titlewidth width.
The purpose of this command is to divide a strip in two columns, the first one
of \addressmargin width, the second one of \addresswidth width, the latter
value being computed on the fly. These columns are parboxes. The letterhead
may contain text or graphics (a logo for example), so we have to cope with the
relative vertical placement of text and imported pictures (see \includegraphics
command from the dedicated packages), hence the specifics (\hbox and \strut) in
the definitions of the parboxes. The \splitfield command takes two arguments,
which can be anything that fits in a parbox.
145\long\def\splitfield#1#2%
146{\addresswidth\titlewidth\advance\addresswidth-\addressmargin
147 \parbox[b][\baselineskip][t]{\addressmargin}{\hb@xt@\z@{}{#1}\strut}%
148 \parbox[b][\baselineskip][t]{\addresswidth}{\hb@xt@\z@{}{#2}\strut}}
\makemark The \makemark command alters the \titlerule macro, which causes a line to
\titlerule be added between the letterhead and the main text. The default \titlerule is
defined later.
149 \def\makemark{\def\titlerule%
150 {\hrule\@width6\fboxsep\@height\fboxrule}}
\makelabels The \makelabels command defines a \startlabels macro, which causes cover
\startlabels pages to be added at the end of each letter. This acts as a boolean flag, true if
\@empty or containig some code, false if \@null. If \startlabels is defined, it
has to contain the layout of the cover (see \maketitle below).
151 \def\makelabels{\def\startlabels%
152 {\let\titletopmatter\@empty\let\titlebotmatter\@empty\let\titlerule\@empty}}
20
\maketitle These commands actually output the letterhead stuff (\maketitle is the user level
\@maketitle command, \@maketitle contains the internals). \maketitle is always called at
the opening of the letter envrionment, and at its closing if the \startlabels
flag is not \@null. It doesn’t take any argument, but outputs the content of
\titletopmatter, \titlemidmatter, \titlebotmatter in three horizontal strips
stacked vertically. These strips have respective heights of \titletopheight,
\titlemidheight, \titlebotheight and are always placed on a new odd page at
an absolute position given by \titlehead and \titlemargin. The width of the
strips is given by \titlewidth. A \titlerule is added at the end of the letter-
head. Some dedicated mecanism cope with the \twoside and \twocolumns cases
(the letterhead is always issued on a new odd page). Please note that \maketitle
can be used outside of a letter environment, exactly like in the standard classes.
153 \def\maketitle%
154 {\clearpage
155 \if@twoside\ifodd\c@page\else\thispagestyle{empty}\hb@xt@\z@{}\clearpage\fi\fi
156 \if@twocolumn\twocolumn[\@maketitle\leavevmode\vskip-\topskip]
157 \else\vbox{\@parboxrestore\@maketitle}\vskip-\parskip\fi}
158 \def\@maketitle%
159 {\vskip-\topmargin\vskip\titlehead\vskip-\headheight\vskip-\headsep\vskip-\baselineskip
160 \leftskip\titleleftmargin\advance\leftskip-\oddsidemargin
161 \rightskip\textwidth\advance\rightskip-\paperwidth\advance\rightskip-\titlemargin
162 \parbox[t][\titlemidheight]{\titlewidth}{\hb@xt@\z@{}\titletopmatter\strut}\par
163 \parbox[t][\titlemidheight]{\titlewidth}{\hb@xt@\z@{}\titlemidmatter\strut}\par
164 \parbox[t][\titlebotheight]{\titlewidth}{\hb@xt@\z@{}\titlebotmatter\strut}\par
165 \leftskip-\oddsidemargin\advance\leftskip-72\p@
166 \parbox[b][\z@]{\paperwidth}{\titlerule}\par}
At its closing, the letter environment checks for the definition of \startlabels.
If undefined, nothing but a \clearpage happens. If defined, its contents is
executed (usually a redefinition of \titletopmatter, \titlemidmatter and
\titlebotmatter) and the \maketitle macro is called, issuing a new page (in-
tented to be a cover) followed by a \clearpage.
21
173 {\@ifundefined{startlabels}{}{\startlabels\maketitle\thispagestyle{empty}}
174 \clearpage}
\@processto This is an auxiliary macro to cut the letter environment’s argument into two
substrings (tokenizer). The token separator is \\ . \toname will contain everything
until the first occurrence of \\ , and \toaddress the remainder of the string.
175 \long\def\@processto#1\\#2@@@{\def\toname{#1}\def\toaddress{#2}}
\closing \closing works as \opening with the \valediction value. Page breaking is
\valediction prevented and \closingmatter (usually defined by \leftsig or \rightsig) is
added. \closingmatter should contain the signature field and may be completely
customized (for example to include some handwritten signature as a picture).
181\long\def\closing#1%
182{\ifx\@null#1\else\long\def\valediction{#1}\fi
183 \par\medskip\stopbreaks\valediction
184 \samepage\par\closingmatter\par\startbreaks}
\object The \object macro outputs the content of \@title, either previously defined by
a \title command or locally filled by a non empty argument (see \opening and
\closing commands for an explanation of this behaviour).
185 \long\def\object#1%
186 {\ifx\@null#1\else\title{#1}\fi\noindent\@title\par\bigskip}
\ps \ps is a shortcut for a simple LATEX list, with its first argument as the list topic
\cc and its second argument as a list item. \cc and \encl are further shortcuts,
\encl using respectively \ccname and \enclname as the list topic. There is a formatting
trick involved here: the list (\ps, \cc and \encl are actually lists!) behaviour is
altered after a \closing command (see definition of \closingmatter). This is
intentionally done to keep list default values within the letter body, while greatly
simplifying the definition and function of these three macros.
187 \long\def\ps#1#2{\begin{list}{}{}\item[#1]#2\end{list}}
188 \long\def\cc#1{\ps{\ccname}{#1}}
189 \long\def\encl#1{\ps{\enclname}{#1}}
22
5.3.6 Sections and paragraphs
\subparagraph The sectioning commands are defined, but they are merely formatting com-
\paragraph mands. So no section numbering nor table of contents generation. Anyway, the
\subsubsection \tableofcontents macro is not defined in this class!
\subsection 190 \long\def\subparagraph#1{\par\textbf{#1}\hskip\labelsep}
\section 191 \long\def\paragraph#1{\par\noindent\textbf{#1}\hskip\labelsep}
192 \long\def\subsubsection#1{\par\noindent\textbf{#1}\par\nobreak}
193 \long\def\subsection#1{\smallskip\subsubsection{#1}}
194 \long\def\section#1{\medskip\subsubsection{#1}}
5.3.7 Environments
This code is borrowed from the standard classes. Please look at the LATEX 2ε
documentation for further explanation.
195 \newenvironment{description}
196 {\list{}
197 {\labelwidth\z@
198 \itemindent-\leftmargin
199 \let\makelabel\descriptionlabel}}{\endlist}
200 \def\descriptionlabel#1{\hskip\labelsep\textbf{#1}}
201 \newenvironment{verse}
202 {\let\\\@centercr
203 \list{}
204 {\itemsep\z@
205 \itemindent-\parindent
206 \listparindent\itemindent
207 \rightmargin\leftmargin
208 \advance\leftmargin\parindent}
209 \item\relax}{\endlist}
210 \newenvironment{quotation}
211 {\list{}
212 {\listparindent\parindent
213 \itemindent\listparindent
214 \rightmargin\leftmargin}
215 \item\relax}{\endlist}
216\newenvironment{quote}
217{\list{}
218 {\rightmargin\leftmargin}
219 \item\relax}{\endlist}
5.3.8 Lists
This code is borrowed from the standard classes. Please look at the LATEX 2ε
documentation for further explanation.
220 \def\@listI{}
221 \let\@listi\@listI
222 \let\@listii\@listI
223 \let\@listiii\@listI
224 \let\@listiv\@listI
23
225 \def\theenumi{\@arabic\c@enumi}
226 \def\theenumii{\@alph\c@enumii}
227 \def\theenumiii{\@roman\c@enumiii}
228 \def\theenumiv{\@Alph\c@enumiv}
229 \def\labelenumi{\theenumi.}
230 \def\labelenumii{(\theenumii)}
231 \def\labelenumiii{\theenumiii.}
232 \def\labelenumiv{\theenumiv.}
233 \def\p@enumii{\theenumi}
234 \def\p@enumiii{\theenumi(\theenumii)}
235 \def\p@enumiv{\p@enumiii\theenumiii}
236 \def\labelitemi{\textbullet}
237 \def\labelitemii{\textbf{\textendash}}
238 \def\labelitemiii{\textasteriskcentered}
239 \def\labelitemiv{\textperiodcentered}
5.4.1 Lists
\labelsep These default values are defined at document level and altered by \closingmatter
\labelwith (see above) in the following manner: \labelwidth3\labelsep (usually 18pt),
\leftmargin \leftmargin2\parindent (36pt in an indented letter, 0pt in a default letter).
240 \labelsep6\p@
241 \labelwidth12\p@
242 \leftmargin18\p@
5.4.4 Footnotes
Light is right! This definition is minimalist.
252 \long\def\@makefntext#1{\noindent\hb@xt@\z@{\hss\@makefnmark}#1}
24
5.4.5 Letter
Some specific chletter values are initialized here.
\titlerule The default is to output no rule. \titlerule is always called by \maketitle (see
above) and so has to be defined.
253 \let\titlerule\@empty
\fromname \fromname is not empty by default, so is \fromsig: they contain the \@author
\fromsig value, which is defined at kernel level to output nothing but a warning message (no
\fromaddress author given). \fromlocation and \fromaddress are somewhat redundant, but
\fromlocation they may be used for special purpose. \@author may be modified by the LATEX
\telephonenum \author command. \returnaddress should also output nothing by default, but
\returnaddress it has to leave an empty line, hence the \null trick (actually an empty \hbox).
254 \def\fromname{\@author}
255 \def\fromsig{\@author}
256 \let\fromlocation\@empty
257 \let\fromaddress\@empty
258 \let\telephonenum\@empty
259 \def\returnaddress{\null}
\toname These values retrieved or altered at the opening of a letter environment. They
\toaddress are initialized here to prevent an error in certain condition.
260 \let\toname\@empty
261 \let\toaddress\@empty
\salutation These values are retrieved or altered respectively by the \opening and \closing
\valediction commands. They are initialized here to prevent an error in certain condition.
262 \let\salutation\@empty
263 \let\valediction\@empty
5.4.6 Words
\ccname These words are common to the standard letter classes. They will be adjusted by
\enclname the linguistic packages (babel or polyglossia). \ccname and \enclname are used
\pagename respectively by the \cc and \encl macros; while \pagename and \headtoname are
\headtoname used within \pagestyle layouts and some additional packages.
264 \def\ccname{cc}
265 \def\enclname{encl}
266 \def\pagename{Page}
267 \def\headtoname{To}
5.4.7 Date
\today The \@date field, which appears in the letterhead, defaults to \today. The \today
value will be adjusted by the linguistic packages (babel or polyglossia).
268\def\today
269{\ifcase\month\or
270 January\or February\or March\or April\or May\or June\or
271 July\or August\or September\or October\or November\or December\fi
272 \space\number\day, \number\year}
25
5.4.8 Page and numbering styles
We have \pstyle{plain} pages in this document class by default. We use arabic
page numbers.
273 \pagestyle{plain}
274 \pagenumbering{arabic}
\longindentation \longindentation is here for user convenience and for compatibility with the
standard letter class. It is defined as the length between the document margin
(\oddsidemargin) and the recipient’s address field (\addressmargin).
279 {\longindentation\addressmargin
280 \advance\longindentation-\oddsidemargin
\indentedwidth \indentedwith is here for user convenience and for compatibility with the stan-
dard letter class. It is defined as the length between the recipient’s address field
(\addressmargin) and the right document margin (defined by \textwidth).
281 \indentedwidth\textwidth
282 \advance\indentedwidth-\longindentation}
283 ⟨/chletter⟩
26