summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/chletter/chletter.dtx
blob: aabf5cd9b8db254623840fd893fb801946fd4d42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
% \iffalse meta-comment
%
% Copyright 2008 Boris Oriet
% The licence is LPPL.
% 
% \fi
% \iffalse
%<chletter>\NeedsTeXFormat{LaTeX2e}[1996/06/01]
%<chletter>\ProvidesClass{chletter}[2008/07/29 v1.0 Swiss Letter document class]
%<*driver>
\ProvidesFile{chletter.dtx}
\documentclass[a4paper]{ltxdoc}
\usepackage[colorlinks]{hyperref}
\CodelineNumbered
\CodelineIndex
\EnableCrossrefs
\RecordChanges
\frenchspacing
\begin{document}
\DocInput{chletter.dtx}
\end{document}
%</driver>
% \fi
% \changes{v1.0}{2008/07/29}{Initial version}
% \GetFileInfo{chletter.dtx}
% \DoNotIndex{\newcommand,\newenvironment}
% \author{Boris \textsc{Oriet}}
% \title{Swiss Letter Document Class for \LaTeXe{}}
% \maketitle
%
% \section{Introduction}
% The \textsf{chletter} class is intended for typesetting letters with addresses fields
% corresponding to C5 \& C6/5 envelopes (according to the swiss norm SN~010130)\footnote
% {This version of the class only generates
% envelopes with righthanded recipient addresses, perhaps a future version
% will add an option to support lefthanded windows.}.
%
% This class is mostly compatible with the standard \LaTeXe{} classes,
% especially the \textsf{letter} class. Unlike the \textsf{lettre} class\footnote
% {From the Observatoire de Gen\`eve, see at \texttt{http://www.ctan.org}},
% this one doesn't provide much additional commands and declarations.
%
% \section{Examples sources}
% The following examples describe the normal usage of the \textsf{chletter} class.
%
% \subsection{Standard Letter: \texttt{standardletter.ltx}} 
% \begin{verbatim}
% \documentclass{chletter}
% \author{fromname}
% \address{fromaddress}
% \begin{document}
%   \begin{letter}{toname\\toaddress}
%     \opening{salutation}
%     text
%     \closing{valediction}
%   \end{letter}
% \end{document}
% \end{verbatim}
%
% \subsection{Minimal Letter: \texttt{minimalletter.ltx}}
% \begin{verbatim}
% \documentclass{chletter}
% \begin{document}
% \end{document}
% \end{verbatim}
%
% \subsection{Commented example: \texttt{sampleletter.ltx}}
% \begin{verbatim}
% \documentclass{chletter}    % defaults: 11pt,a4paper,oneside
% \title{sampleletter}        % 
% \author{author}             % if no signature specified
% \name{fromname}             % to appear in the footer
% \signature{fromsig}         % to appear after valediction
% \location{office}           % to appear in the sender address zone
% \address{fromaddress}       % to appear at the upper left
% \return{returnaddress}      % to appear in the window
% \telephone{telephone}       % to appear under the address
% \date{place, \today}        % to alter the date string
% \makelabels                 % will generate an envelope page
% \begin{document}            %
%   \begin{letter}{toname     % gets the recipient name and address
%                \\toaddress} % and creates the addresses zones
%     \conc[l]{subject}       % the letter's subject, left aligned
%     \opening[i]{salutation} % the salutation, text will be indented
%     text                    % the letter's main text
%     \closing{valediction}   % adds the signature
%     \ps{\emph{ps}}post      % creates a post scriptum
%     \cc{copies}             % creates a copies field
%     \encl{enclosures}       % creates an enclosures field
%   \end{letter}              %
% \end{document}              %
% \end{verbatim}
%
% \section{Compatibility}
% The \textsf{chletter} class is based upon the standard classes of the \LaTeXe{} 
% distribution. It is mostly compatible with any type of document founded on these classes.
%
%\subsection{Compatibility with the \LaTeXe{} \textsf{letter} class}
%
%\subsubsection{Ascending Compatiblity}
% \textsf{chletter} is ``source compatible'' with the standard \textsf{letter} class.
% Usually a file which compiles with \textsf{letter} will recompile straight forward
% with this one. There are however some functional differencies:
%\begin{itemize}
%\item the addresses zones, at the top of the first page, is inserted at the opening
% of the |letter| envrionment rather than at the |\opening| command;
% \item there are important differences in the page layout; the addresses zones are
% redefined and the vertical centering mecanisme is absent;
% \item some macros, for example |\makelabels|, behave somewhat differently; the labels
% generation mechanism via the \textsf{.aux} file is inactive.
%\end{itemize}
%
%\subsubsection{Descending Compatibility}
% A document using the new options and macros of the \textsf{chletter} class won't
% compile directly with the \textsf{letter} class\footnote{These differences are marked
% with an asterisk in the following sections}.
%
%\subsection{Compatibility With Other \LaTeXe{} Standard Classes}
% The \textsf{chletter} class is largely ``source compatible'' with the standard \LaTeXe{}
% classes. It doesn't implement the sectioning mecanism, but accepts the related commands
% (|\section| for example). The |\maketitle| command is defined but behaves in a special way. 
%
%\subsection{Compatibility with \LaTeX\,2.09}
% No compatibility mecanism with \LaTeX\,2.09 has been implemented. The sources should
% be adapted to the standards defined by \LaTeXe, particularly those concerning the font
% selection scheme\footnote{\texttt{\textbackslash textbf} or \texttt{\textbackslash mathbf} in 
% place of \texttt{\textbackslash bf}.}.
%\subsection{Compatibility With Other Packages}
%
% There is no reported incompatibility with usual packages.
% \StopEventually{\PrintChanges\PrintIndex}
%
% \section{Implementation}
%
% \subsection{Options}
% The initial code is taken from the \LaTeXe{} standard document
% classes. See classes.dtx and letter.dtx for more information.
% This class is largely compatible with the standard letter class.
% We have mainly the same options with the same behaviour.
%    \begin{macrocode}
%<*chletter>
\newcommand\@ptsize{}
%    \end{macrocode}
%
% \subsubsection{Declaring Options}
%    \begin{macrocode}
\DeclareOption{a4paper}{\paperheight297mm\paperwidth210mm}
\DeclareOption{a5paper}{\paperheight210mm\paperwidth148mm}
\DeclareOption{b5paper}{\paperheight250mm\paperwidth176mm}
\DeclareOption{letterpaper}{\paperheight11in\paperwidth8.5in}
\DeclareOption{legalpaper}{\paperheight14in\paperwidth8.5in}
\DeclareOption{executivepaper}{\paperheight10.5in\paperwidth7.25in}
\DeclareOption{landscape}
 {\@tempdima\paperheight
  \paperheight\paperwidth
  \paperwidth\@tempdima}
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
\DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse}
\DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue}
\DeclareOption{draft}{\setlength\overfullrule{5\p@}}
\DeclareOption{final}{\setlength\overfullrule{0\p@}}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
%    \end{macrocode}
%
% \subsubsection{Executing Options}
% The default options are set according to swiss paper format (A4).
% We also set a standard type size of 11pt.
%    \begin{macrocode}
\ExecuteOptions{a4paper,11pt,oneside,onecolumn,final}
\ProcessOptions
\input{size1\@ptsize.clo}
%    \end{macrocode}
%
% \subsubsection{Loading Packages}
%  This class dos not load additional packages.
%
% \subsection{Document Layout}
% This class tries to provide a quite universal layout, not only suitable
% for letters, but also for other types of short documents.
%
% \subsubsection{Paragraphing}
% We prefer some paragraph spacing and some indentation at the document level.
% This may be altered in the letter environment.
%    \begin{macrocode}
\parskip9\p@\parindent18\p@
%    \end{macrocode}
% \begin{macro}{letterskip}
% \begin{macro}{letterindent}
% These values are used to store the current paragraph skip and indentation parameters. They are
% computed at the beginning of the \textsf{letter} environment from |\parskip| and |\parindent| values.
%    \begin{macrocode}
\newdimen\letterskip\newdimen\letterindent
%    \end{macrocode}
% \end{macro}
% \end{macro}
% We don't allow the breaking of a page in an hyphenated line.
%    \begin{macrocode}
\brokenpenalty10000
%    \end{macrocode}
%
% \subsubsection{Standard Page Layout}
% All margin dimensions are measured from a point one inch from the
% top and lefthand side of the page (the \LaTeXe{} origin). We add 0.5 inch for the header. 
% This gives a 1.5 inch total margin from the top of the page
% to the begining of the text. Note that the standard classes do not 
% set the |\topskip| value, which is set to 10 pt by the \LaTeX{} kernel.
%    \begin{macrocode}
\topmargin\z@\topskip12\p@\headheight12\p@\headsep24\p@
%    \end{macrocode}
% Same as above, we add 0.5 inch for the footer. We also set the footnotes vertical spaces here.
%    \begin{macrocode}
\footskip36\p@\footnotesep12\p@\skip\footins18\p@
%    \end{macrocode}
% We substract 2.5 inches to the width of the paper.
%    \begin{macrocode}
\textwidth\paperwidth\addtolength\textwidth{-180\p@}
%    \end{macrocode}
% We substract 3 inches from the height of the paper.
%    \begin{macrocode}
\textheight\paperheight\addtolength\textheight{-216\p@}
%    \end{macrocode}
% We set standard values here. We will have a 1.5 inch
% lefthand margin and a 1~inch righthand margin (given
% the text width is 2.5~inches shorter than the paper width.
%    \begin{macrocode}
\oddsidemargin36\p@\evensidemargin0\p@
\marginparwidth48\p@\marginparsep12\p@\marginparpush6\p@
%    \end{macrocode}
%
% \subsubsection{New Horizontal Dimensions}
% \begin{macro}{\addressmargin}
% This is the space between the origin (1 inch from the left border of the page)
% and the recipient address field.
%    \begin{macrocode}
\newdimen\addressmargin\addressmargin246\p@
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\longindentation}
% \begin{macro}{\indentedwidth}
% |\longindentation| + |\indentedwidth| = |\textwidth|.
% These values will be computed at the begining of the \textsf{letter} environment.
% They are useful to align text width the recipient address field, which may be
% modified by author between two letters.
%    \begin{macrocode}
\newdimen\longindentation\newdimen\indentedwidth
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{New Vertical Dimensions}
% \begin{macro}{\fromtop}
% We need to position precisely the addresses fields, substracting some values until
% we reach the origin at 1 inch from the top of the paper.
%   \begin{macrocode}
\newdimen\fromtop\fromtop\z@\addtolength\fromtop{-\headheight}
\addtolength\fromtop{-\headsep}\addtolength\fromtop{-\baselineskip}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\fromheight}
% \begin{macro}{\toheight}
% |\fromheight| is the height of the field containing the sender address.
% |\toheight| is the height of the field containing the recipient address.
% Theses values are set accordingly to swiss standard windowed envelopes.
%    \begin{macrocode}
\newdimen\fromheight\fromheight60\p@\newdimen\toheight\toheight96\p@
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\sigspace}
% is the total space in which the signature is centered.
%    \begin{macrocode}
\newdimen\sigspace\sigspace6\bigskipamount
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Page Styles}
% The pagestyles \textsl{empty} and \textsl{plain} are defined in
% the \LaTeX{} kernel ({ltpage.dtx}). In this class we change
% a bit the \textsl{plain} style. Note that we don't set different
% headings for one-sided and two-sided documents.
%   \begin{macrocode}
\def\ps@plain
 {\let\@oddhead\@empty
  \def\@oddfoot
  {\footnotesize{\hfil\pagename~\thepage}}
  \let\@evenhead\@oddhead\let\@evenfoot\@oddfoot}
\def\ps@headings
 {\def\@oddhead
  {\footnotesize{\hspace*{-\oddsidemargin}\headtoname~\toname\hfil\pagename~\thepage}}
  \def\@oddfoot
  {\footnotesize{\hspace*{-\oddsidemargin}\leftmark\hfil\rightmark}}
  \let\@evenhead\@oddhead\let\@evenfoot\@oddfoot}
\def\ps@myheadings
 {\def\@oddhead
  {\footnotesize{\hspace*{-\oddsidemargin}\leftmark\hfil\rightmark}}
  \def\@oddfoot
  {\footnotesize{\hfil\pagename~\thepage}}
  \let\@evenhead\@oddhead\let\@evenfoot\@oddfoot}
\def\ps@firstpage
 {\let\@oddhead\@empty
  \def\@oddfoot
  {\footnotesize{\hspace*{-\oddsidemargin}\leftmark\hfil\rightmark}}
  \let\@evenhead\@oddhead\let\@evenfoot\@oddfoot}
%    \end{macrocode}
%
% \subsection{Declarations}
%
% \subsubsection{Commands}
% \begin{macro}{\name\fromname}
% \begin{macro}{\signature\fromsig}
% \begin{macro}{\address\fromaddress}
% \begin{macro}{\location\fromlocation}
% \begin{macro}{\telephone\telephonenum}
% \begin{macro}{\return\returnaddress}
% The standard \textsf{letter} class doesn't provide a |\return| command, but
% knows of the |\returnaddress| value. One should note that some of these values
% are functionally different from the standard class, and that |\@author| 
% (set by the |\author| command) may be used to replace |\fromname| and |\fromsig|
% in most cases (see ...). Usually the user will use these commands in the preamble
% of his letter. But they can be altered anywhere to obtain some special effects
% (different addresses for the envelope page for example).
%    \begin{macrocode}
\newcommand*{\name}[1]{\def\fromname{#1}}\name{}
\newcommand*{\signature}[1]{\def\fromsig{#1}}\signature{}
\newcommand*{\address}[1]{\def\fromaddress{#1}}\address{}
\newcommand*{\location}[1]{\def\fromlocation{#1}}\location{}
\newcommand*{\telephone}[1]{\def\telephonenum{#1}}\telephone{}
\newcommand*{\return}[1]{\def\returnaddress{#1}}\return{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\fromstreet}
% \begin{macro}{\fromplace}
% \begin{macro}{\toname}
% \begin{macro}{\toaddress}
% We additionaly declare some default values. These are computed at the begining of
% the letter environment (see xxx), but may be altered manually by the user.
% Here we ensure they are defined even if the letter environment is not invoked, to
% prevent runtime errors.
%    \begin{macrocode}
\def\toname{}\def\toaddress{}\def\fromstreet{}\def\fromplace{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Words}
% \begin{macro}{\ccname}
% \begin{macro}{\enclname}
% \begin{macro}{\pagename}
% \begin{macro}{\headtoname}
% These names are defined the same way as in the standard letter class. They
% will be altered by the linguistic packages (babel) at the begining of the document.
% If the user wants to alter them manually, he should do it after |\begin{document}| 
% to obtain the expected result.
%    \begin{macrocode}
\newcommand*{\ccname}{cc}\newcommand*{\enclname}{encl}
\newcommand*{\pagename}{Page}\newcommand*{\headtoname}{To}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Date}
% \begin{macro}{\today}
% This macro is identical to the one defined in the standard class.
%    \begin{macrocode}
\newcommand*{\today}
 {\ifcase\month\or January\or February\or March\or April\or May\or June\or
   July\or August\or September\or October\or November\or December\fi
  \space\number\day, \number\year}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Insertion commands}
% \begin{macro}{\maketitle}
% This macro will generate the addresses fields from given values. It is invocated by
% the letter environment, but can be used anywhere in the document (not in the preamble).
% The recipient address is defined as an argument to the letter environment,
% but one may use |\def\toname{}| and |\def\toaddress{}| to set it manually.
%
% This macro takes the same optional argument as the letter environment:\\
% |[p]| (plain, default) will put the expeditor field, the date and the recipient field.\\
% |[e]| (everything) will add the return address to the recipient field.\\
% |[n]| (nofrom) will put only the recipient field.\\
% |[r]| (return) will add the return address to the recipient field.
%    \begin{macrocode}
\newcommand*{\maketitle}[1][p]
 {\vspace*{-\parskip}\ifx n#1\vspace*{\fromheight}\else\ifx r#1\vspace*{\fromheight}%
  \else\noindent\hspace{-\oddsidemargin}\parbox[t][\fromheight]{\addressmargin}
     {\ifx\ch@aut\@author
      \else\leavevmode\@author\\\fi
      \ifx\@empty\fromlocation
      \else\fromlocation\\\fi
      \ifx\@empty\fromaddress
      \else\fromaddress\par\medskip\fi
      \ifx\@empty\telephonenum
      \else{\footnotesize\telephonenum\par\medskip}\fi}%
      \parbox[t]{\indentedwidth}{~\\\@date}\par\vspace*{-\parskip}\fi\fi
    \noindent\hspace{\longindentation}\parbox[t][\toheight]{\indentedwidth}
   {\ifx p#1\else\ifx n#1\else{\footnotesize\returnaddress\par\medskip}\fi\fi
    \leavevmode\toname\\\toaddress\\}\vspace*{-\parskip}\par}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\opening}
% Unlike the standard letter |\opening| command, this one is very simplistic. It only creates
% the opening formula given in its mandatory argument. 
%
% There is an optional argument:\\
% |[n]| (noindent, default) turns indentation off for the following text.\\
% |[i]| (indent) turns indentation on for the following text.
%
% Note that the optional argument modifies the following text, not the opening itself! The
% indentation value is taken from |\letterindent|.
%    \begin{macrocode}
\newcommand{\opening}[2][n]
 {\ifx i#1\parindent\letterindent\else\parindent\z@\fi\par\noindent#2\par\medskip}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\closing}
% This command generates the valediction line and the signature.
% The signature is horizontaly aligned width the recipient address field and
% verticaly spaced by |\sigspace|. The signature is one of the following:
% |\fromsig|, |\fromname|, |\@author|, depending on whether they are defined or not.
%
% It takes the same optional argument as the |\opening| command, default is |[n]|.
%    \begin{macrocode}
\newcommand{\closing}[2][n]
 {\ifx i#1\parindent\letterindent\else\parindent\z@\fi\par\medskip
  #2\par\vspace*{.5\sigspace}
  \noindent\hspace\longindentation
  \ifx\@empty\fromsig
    \ifx\@empty\fromname\@author\else\fromname\fi
  \else\fromsig\fi
  \par\vspace*{.5\sigspace}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\longindentation}
% This macro will align the text contained in its argument with the recipient address.
%    \begin{macrocode}
\newcommand*{\longindent}[1]
 {\par\noindent\hspace{\longindentation}\parbox[t]{\indentedwidth}{#1}\par\smallskip}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\conc}
% This command is intended to be used before the |\opening| command, to add a subject
% line. It accepts one mandatory argument (the actual text to be inserted) and one
% optional argument:\\
% |[r]| (right, default) aligns against the text margin.\\
% |[l]| (left) aligns with the expeditor address.
%
%    \begin{macrocode}
\newcommand*{\conc}[2][r]{\ch@pul[#1]{\textbf{#2}}\par\bigskip}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ps}
% This command is useful to achieve certain effects. It aligns its text argument following
% the optional argument and dosen't close the current paragraph. The following text will
% continue on the same line.
%    \begin{macrocode}
\newcommand*{\ps}[2][r]{\ch@put[#1]{#2}{\ignorespaces}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\cc}
% \begin{macro}{\encl}
% These two commands are intended to be used at the end of the letter, but they can
% be placed anywhere in the document to obtain special effects. Their usage is quite similar
% to what is described in the standard letter class. They all take a mandatory
% argument (some text) and an optional argument:\\
% |[r]| (right, default) aligns against the text margin.\\
% |[l]| (left) aligns with the expeditor address.
%    \begin{macrocode}
\newcommand*{\cc}[2][r]{\ch@put[#1]{\emph{\ccname}}{#2}\par\medskip}
\newcommand*{\encl}[2][r]{\ch@put[#1]{\emph{\enclname}}{#2}\par\medskip}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\section}
% \begin{macro}{\subsection}
% \begin{macro}{\subsubsection}
% These commands are not defined in the standard letter class. functionally, they do nothing
% but emphasize the text given as their argument. They cannot be used to generate
% a table of contents, because the necessary provisions are not implemented in this class.
% They take an optional argument:\\
% |[r]| (right, default) aligns against the text margin.\\
% |[l]| (left) aligns with the expeditor address.
%    \begin{macrocode}
\newcommand*{\subsubsection}[2][r]{\par\ch@pul[#1]{\textbf{#2}}\par}
\newcommand*{\subsection}[2][r]{\smallskip\subsubsection[#1]{#2}}
\newcommand*{\section}[2][r]{\medskip\subsubsection[#1]{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\paragraph}
% \begin{macro}{\subparagraph}
% Contrary to the commands above, these do not accept an optional argument.
%    \begin{macrocode}
\newcommand*{\subparagraph}[1]{\par\textbf{#1}~}
\newcommand*{\paragraph}[1]{\par\noindent\textbf{#1}~}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{The \texttt{\textbackslash makelabels} Command}
% \begin{macro}{\makelabels}
% This acts as a flag for the letter environment. If true (i.e. |\makelabels| have
% been invoked with a given option before the |letter| environement), then a page will be 
% added to the letter, containing only the addresses fields. This is intended to generate envelopes.
%
% This command passes its argument to the |letter| environment and then to |\maketitle|. An |[f]| argument will be
% interpreted at the end of the letter environment as a request to deactivate the labels
% generation mecanism.
%    \begin{macrocode}
\newcommand*{\makelabels}[1][r]{\let\ch@lab#1}
%    \end{macrocode}
% \end{macro}
%
% \subsection{The Letter Environment}
% The aforementioned commands are arguably specific to letters. But they may be used as well outside
% the letter environment to achieve some special effects. It is not mandatory to use a letter
% environment with this class.   
% \begin{environment}{letter}
% The letter environment creates a new page, resets numberings, computes some values,
% invokes the |\maketitle| macro, optionaly twice (following the flag set
% by |\makelabels|) to generate an additional envelope page. 
% This is an important functional difference with the standard letter class.
% As a side effect, local declarations (|\name| for example) will alter only the additional
% envelope page if they are made inside the letter environement.
%
% It has the same mandatory argument as the standard class, nevertheless it accepts one optional argument
% which will be passed to |\maketitle|:\\
% |[p]| (plain, default) will put the expeditor field, the date and the recipient field.\\
% |[e]| (everything) will add the return address to the recipient field.\\
% |[n]| (nofrom) will put only the recipient field.\\
% |[r]| (return) will add the return address to the recipient field.
%    \begin{macrocode}
\newenvironment*{letter}[2][p]
 {\ch@pfr{\fromaddress}\ch@pto{#2}
  \letterindent\parindent\parindent\z@\letterskip\parskip
  \longindentation\addressmargin\addtolength\longindentation{-\oddsidemargin}
  \indentedwidth\textwidth\addtolength\indentedwidth{-\longindentation}
  \newpage\c@page\@ne\c@footnote\z@\pagestyle{plain}\thispagestyle{empty}
  \vspace*{\fromtop}\maketitle[#1]}
 {\vfil\pagebreak
  \if f\ch@lab
  \else\newpage\thispagestyle{empty}\vspace*{\fromtop}\maketitle[\ch@lab]\fi}
%    \end{macrocode}
% \end{environment}
%
% \subsection{Standard Definitions}
%
% \subsubsection{Lists Parameters}
%    \begin{macrocode}
\leftmargini\parindent\leftmargin\leftmargini
\leftmarginii\leftmargini\leftmarginiii\leftmargini\leftmarginiv\leftmargini
\labelsep.25\parindent\labelwidth.75\parindent
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{(\theenumii)}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}
\newcommand\labelitemi{\textbullet}
\newcommand\labelitemii{\textendash}
\newcommand\labelitemiii{\textasteriskcentered}
\newcommand\labelitemiv{\textperiodcentered}
%    \end{macrocode}
%
% \subsubsection{New Environments}
%    \begin{macrocode}
\newenvironment{description}
 {\list{}{\labelwidth\z@\itemindent-\leftmargin
    \let\makelabel\descriptionlabel}}{\endlist}
\newcommand*{\descriptionlabel}[1]
 {\hspace\labelsep\textbf{#1}}
\newenvironment{verse}
 {\let\\=\@centercr
  \list{}{\itemsep\z@\itemindent-\parindent
    \listparindent\itemindent\rightmargin\leftmargin
    \addtolength\leftmargin\parindent}
    \item[]}{\endlist}
\newenvironment{quotation}
 {\list{}{\listparindent\parindent
    \itemindent\listparindent\rightmargin\leftmargin}
    \item[]}{\endlist}
\newenvironment{quote}
 {\list{}{\rightmargin\leftmargin}
   \item[]}{\endlist}       
%    \end{macrocode}
%
% \subsubsection{Existing Environments Parameters}
%    \begin{macrocode}
\arraycolsep5\p@\tabcolsep6\p@
\arrayrulewidth.4\p@\doublerulesep2\p@
\tabbingsep\labelsep
\skip\@mpfootins=\skip\footins
\fboxsep3\p@\fboxrule.4\p@
\renewcommand\theequation{\@arabic\c@equation}
%    \end{macrocode}
%
% \subsubsection{Footnotes Parameters}
%    \begin{macrocode}
\renewcommand\footnoterule
 {\kern-3\p@\hrule\@width.4\columnwidth\kern2.6\p@}
\newcommand\@makefntext[1]
 {\noindent\hb@xt@\z@{\hss\@makefnmark}#1}
%    \end{macrocode}
%
% \subsubsection{Column Mode}
%    \begin{macrocode}
\columnsep10\p@\columnseprule0\p@
\pagenumbering{arabic}
\raggedbottom\onecolumn
%    \end{macrocode}
%
% \subsection{Internal Declarations}
% The following macros are internal to the chletter class.
%
% \subsubsection{Tokenizers}
% \begin{macro}{\ch@pfr}
% \begin{macro}{\ch@pto}
% \begin{macro}{\ch@cut}
% These  macros are tokenizers which split their argument 
% depending on what is defined or not by the user.
% They build |\fromstreet|, |\fromplace|, |\toname|,
% |\toaddress| and  |\returnaddress|. Note that if
% |\returnaddress| is not empty, it will be left in place.
%    \begin{macrocode}
\newcommand\ch@pfr[1]
 {\expandafter\ch@cut#1\\\@empty
  \ifx\ch@sec\@empty\else\expandafter\ch@cut#1\@empty\fi
  \let\fromstreet\ch@fir\let\fromplace\ch@sec
  \ifx\@empty\returnaddress
    \ifx\@empty\fromname
      \ifx\@author\ch@aut\def\returnaddress{\fromstreet, \fromplace}
      \else\def\returnaddress{\@author, \fromstreet, \fromplace}\fi
    \else\def\returnaddress{\fromname, \fromstreet, \fromplace}\fi\fi}
\newcommand\ch@pto[1]
 {\expandafter\ch@cut#1\\\@empty
   \ifx\ch@sec\@empty\else\expandafter\ch@cut#1\@empty\fi
   \let\toname\ch@fir\let\toaddress\ch@sec}
\def\ch@cut#1\\#2\@empty{\def\ch@fir{#1}\def\ch@sec{#2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Extractors}
% \begin{macro}{\ch@put}
% \begin{macro}{\ch@pul}
% These two macros are used by some commands (|\ps|, |\cc|, etc.) to position some text
% outside of the margin, following their optional argument.
%    \begin{macrocode}
\newcommand{\ch@put}[3][r]
 {\par\noindent\hspace{-\oddsidemargin}\makebox[\oddsidemargin][#1]{#2~}#3}
\newcommand{\ch@pul}[2][r]
 {\noindent\ifx l#1\hspace{-\oddsidemargin}\fi#2}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Flags}
% \begin{macro}{\ch@lab}
% \begin{macro}{\ch@aut}
% These are flags used by the letter environment and the titling commands. |\ch@lab| defines
% whether or not a label page should be generated, and |\ch@aut| knows if |\@author| has been
% altered by the user.
%    \begin{macrocode}
\let\ch@lab=f\let\ch@aut=\@author
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Dummies}
% These commands are here only for compatibility with the standard letter class.
%    \begin{macrocode}
\def\@startlabels{}\let\@mlabel=\@gobbletwo
%    \end{macrocode}
%
% \subsection{End Of Class}
%    \begin{macrocode}
%</chletter>
%    \end{macrocode}
%\newpage
%\tableofcontents
% \Finale
%
\endinput