summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/chletter/chletter.dtx
blob: 7a50fa21ed8a468bb6aa79893e032bb290e19e4f (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
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
% \iffalse meta-comment
%
% Copyright 2008, 2009, 2010 by Boris Oriet <http://boris.oriet.net>
% -------------------------------------------------------
% 
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
%    http://www.latex-project.org/lppl.txt
%
% and version 1.3c or later is part of all distributions of LaTeX 
% version 2008/05/04 or later.
%
% This file has the LPPL maintenance status "author-maintained".
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{chletter.dtx}
\documentclass[a4paper]{ltxdoc}
\usepackage{hypdoc}
\pdfstringdefDisableCommands{\def\url{}}
\makeatletter
\let\PrintMacroName\HDorg@PrintMacroName
\let\PrintDescribeMacro\HDorg@PrintDescribeMacro
\makeatother
\setlength\parindent{0pt}
\setlength\unitlength{.59pt}
\CodelineIndex
\begin{document}
  \DocInput{chletter.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{1057}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{v1.0}{2008/07/29}{Initial version}
% \changes{v1.1}{2009/11/05}{Internal interim version, minor changes}
% \changes{v2.0}{2010/10/10}{Code overhaul, new features, code frozen}
%
% \title{The \textsf{chletter} Document Class
% \thanks{This document corresponds to \textsf{chletter} v2.0, dated 2010/10/10.}}
% \author{Boris \textsc{Oriet}\\\url{http://boris.oriet.net}}
% \maketitle
% \bigskip\bigskip
% \tableofcontents
% \pagebreak
%
% \section{Introduction}
%
% The \textsf{chletter} class is suited for typesetting letters with letterhead 
% corresponding to the swiss norm SN~010130.\bigskip
%
% The default letterhead is set according to Swiss rules. It fits into both right
% and left windowed ISO 269 C5 and C6/5 envelopes.\bigskip
%
% This class is mostly compatible with the standard \LaTeXe{} classes.
% It is not limited to letters and may be used as a generic document class.\bigskip
%
% Its basic usage is very simple and user friendly. 
% It is appropriate to quickly typeset casual documents and letters.\bigskip
%
% It is however highly configurable and may be used within complex setups 
% to provide automated letters composition.
%
% \section{Usage}
%
% The following examples describe the regular usage of the \textsf{chletter} class.
% Basically, this class behaves in a similar way to a standard class and accepts the
% regular \textsf{letter} commands, including the dedicated |letter| environment. 
% Much like with standard classes, the only mandatory commands are |\documentclass|
% and the |document| environment (|\begin{document}| and |\end{document}|).
%
% \subsection{A basic letter}
%
% This example shows the plain usage of the \textsf{chletter} class.\medskip
%
% |\author|, |\address| and |\date| are markup commands which store
% global values used to build the letterhead. The |letter| environment actually creates the
% letter with its letterhead and all the needed layout. |\opening|, |\closing|, |\encl| and
% |\cc| are mainly formatting commands. To have multiple lines in a field, one may use
% |\newline| (shortcut |\\| as in this example) or |\par| (shortcut is an empty line).\medskip
%
% Please note that this example would also compile straightforward with the
% standard \textsf{letter} class (giving a somewhat different output).
%
% \begin{verbatim}
% \documentclass{chletter}
%
% \author{My name}
% \address{My address\\My city}
% \date{Location, \today}
%
% \begin{document}
%  \begin{letter}{Name\\Address\\City}
%   \opening{Salutation,}
%   Hello World!
%   \closing{Valediction.}
%   \encl{enclosures}
%   \cc{other recipients}
%  \end{letter}
% \end{document}
% \end{verbatim}
%
% \begin{figure}
% \begin{picture}(596,842)(0,0)
% \fontsize{7}{7}\selectfont
% \thicklines
% \put(0,0){\framebox(596,842){}}
% \thinlines
% \put(72,758){My name}
% \put(72,746){My address}
% \put(72,734){My city}
% \put(334,758){Location, October 10, 2010}
% \put(334,686){Name}
% \put(334,674){Address}
% \put(334,662){City}
% \put(108,542){Salutation,}
% \put(108,518){Hello World!}
% \put(108,494){Valediction.}
% \put(334,446){My name}
% \end{picture}
% \caption{Standard letter output by \textsf{chletter}.}
% \end{figure}
%
% \subsection{A customized letter}
%
% This example provides a good overview of the different class options and macros.\medskip
%
% The |leftwin| option is to be used with a left windowed envelope, inverting the sender's
% and recipient's addresses. The |leftsig| option places the signature against the left body
% margin. The |foldmark| option will include a thin line to help folding of C6/5 letters.
% The |footfill| option will throw the letter foot against the document footer, for refined
% vertical balancing.\medskip
%
% |\makelabels| creates an addtional envelope page with only the recipient's address and
% the sender's return address. |\addresswidth| adjusts the letterhead layout (here it is
% computed to right align the date field, mimicking the standard \textsf{letter} class
% behaviour). |\location|, |\name|, |\return| and |\telephone| are supplementary markup
% commands. |\object| and |\ps| are extra layout commands. |\longindentation| (which is
% also provided by the standard \textsf{letter} class) enables alignement of the text with
% the addresses.\medskip
%
% Please note that lines with a comment (|%|) should be removed to allow compilation with the
% standard \textsf{letter} class.
%
% \begin{verbatim}
% \documentclass[leftwin,leftsig,foldmark,footfill]{chletter}
%
% \settowidth\addresswidth{\today} %
%
% \makelabels
%
% \location{Our Company}
% \name{My name}
% \return{\fromlocation, My address, My city} %
% \address{My address\\My city}
% \telephone{My phone\\My email}
% \signature{My signature\\\footnotesize My position}
% \title{\textbf{About the \textsf{chletter} document class}}
%
% \begin{document}
%  \begin{letter}{Name\\Address\\City}
%   \object %
%   \opening{Dear \toname,}
%   Body text.
%   \closing{Yours truly,}
%   \encl{Enclosures}
%   \cc{Other recipients}
%   \ps{P. S.}{Don't forget\par\hspace{\longindentation}long indentation!}
%  \end{letter}
% \end{document}
% \end{verbatim}
%
% \begin{figure}
% \begin{picture}(596,842)(0,0)
% \fontsize{7}{7}\selectfont
% \thicklines
% \put(0,0){\framebox(596,842){}}
% \thinlines
% \put(424,758){Our Company}
% \put(424,746){My name}
% \put(424,734){My address}
% \put(424,722){My city}
% \put(424,710){\tiny My phone}
% \put(424,698){\tiny My email}
% \put(72,686){\textsuperscript{\underline{Our Company, My address, My city}}}
% \put(72,674){Name}
% \put(72,662){Address}
% \put(72,650){City}
% \put(424,614){October 10, 2010}
% \put(0,554){\line(1,0){18}}
% \put(108,542){\textbf{About the \textsf{chletter} document class}}
% \put(108,512){Dear Name,}
% \put(108,482){Body text.}
% \put(108,452){Yours truly,}
% \put(108,400){My signature}
% \put(108,388){\tiny My position}
% \put(72,168){\makebox(36,0)[r]{\strut encl~}}
% \put(108,168){\makebox(0,0)[l]{\strut Enclosures}}
% \put(72,144){\makebox(36,0)[r]{\strut cc~}}
% \put(108,144){\makebox(0,0)[l]{\strut Other recipients}}
% \put(72,120){\makebox(36,0)[r]{\strut P. S.~}}
% \put(108,120){\makebox(0,0)[l]{\strut Don't forget}}
% \put(424,108){\makebox(0,0)[l]{\strut |long indentation|!}}
% \end{picture}
% \caption{Customized letter output by \textsf{chletter}.}
% \end{figure}
%
% \begin{figure}
% \begin{picture}(596,842)(0,0)
% \fontsize{7}{7}\selectfont
% \thicklines
% \put(0,0){\framebox(596,842){}}
% \thinlines
% \put(72,686){\textsuperscript{\underline{Our Company, My address, My city}}}
% \put(72,674){Name}
% \put(72,662){Address}
% \put(72,650){City}
% \end{picture}
% \caption{Cover page output by \textsf{chletter}.}
% \end{figure}\pagebreak
%
% \section{Compatibility}
%
% The \textsf{chletter} class is based upon the standard classes of the \LaTeXe{} distribution. 
% Many documents founded on these classes will also compile with \textsf{chletter}.
%
% \subsection{With the \LaTeXe{} \textsf{letter} class}
%
% The \textsf{chletter} class is `source compatible' (ascending) with the standard 
% \textsf{letter} class. For the most part a file which compiles with \textsf{letter} will
% recompile straightforward with \textsf{chletter}. There are however some functional
% differencies, which are described in the following sections.
%
% \subsection{With other \LaTeXe{} classes}
%
% The \textsf{chletter} class is largely `source compatible' (ascending) with other standard
% \LaTeXe{} classes. It doesn't implement the sectioning mecanism, but accepts the related
% commands (|\section| for example). Some commands behave differently (|\maketitle| for
% example). Obvsiously, any command specific to the \textsf{chletter} class will prevent
% compilation with other classes.
%
% \subsection{With older versions of \textsf{chletter}}
%
% The \textsf{chletter} class has been completely overhauled between versions |1.0| and |2.0|.
% The new code is far more compact and efficient, so is its usage (the commands no more have
% a plethora of optional arguments). The versions of the class are mostly `source compatible,'
% given the deprecated commands are not used: |\conc| (replaced by |\object|), |\letterindent|,
% |\letterskip|, |\fromheight| (replaced by |\titletopheight|, |\toheight| (replaced by
% |\titlemidheight|) and |\stockheight| (replaced by |\titlebotheight|). To add a
% `compilability layer', the following code can be inserted in the preamble:
% \begin{verbatim}
%  \newcommand\conc[2]{\object{#2}}
%  \let\letterindent\parindent
%  \let\letterskip\parskip
%  \let\fromheight\titletopheight
%  \let\toheight\titlemidheight
%  \let\stockheight\titlebotheight
% \end{verbatim}
%
% \subsection{With upcoming versions of \textsf{chletter}}
%
% The \textsf{chletter} class is now considered mature and won't evolve further
% (the code is frozen). The class has been thoroughly tested, and there are no known deficiencies.
%
% \subsection{With other packages}
%
% The \textsf{chletter} class is generic in the sense that it doesn't rely on anything but
% the \LaTeXe\ kernel. There is no known command clash with any package.\medskip
%
% Please note that a \textsf{chextras} companion package is available (but not mandatory).
% It simplifies the preparation of documents and letters by loading and setting up font,
% linguistic and other common packages. It also implements a `glue code' for full source
% compatibility with older \textsf{chletter v1.0} documents.
%
% \section{Configuration}
% 
% The default values used by the \textsf{chletter} class are balanced for casual writing of
% simple articles (the class can eventually replace the standard \textsf{article} class) and 
% letters (of course). Nevertheless this class is highly configurable and customizable.
%
% \subsection{Class options}
%
% The \textsf{chletter} class accepts the options provided by the \LaTeXe\ default classes.
% These options are: |a4paper|, |a5paper|, |b5paper|, |letterpaper|, |legalpaper|,
% |executivepaper|, |landscape|, |10pt|, |11pt|, |12pt|, |oneside|, |twoside|, |draft|, |final|,
% |leqno|, |fleqn|, |onecolumn|, |twocolumn|. The defaults are: |a4paper|, |10pt|, |oneside|,
% |final|, |onecolumn|. Additionally, the \textsf{chletter} class provides four extra options
% (described just below) to adjust the general layout of the letters.\bigskip
%
% \DescribeMacro{leftwin}
% \DescribeMacro{leftsig}
% \DescribeMacro{foldmark}
% \DescribeMacro{footfill}
% |leftwin| places the recipient's address to the left of the letterhead rather than to the
% right. |leftsig| aligns the signature with the left body margin rather than with the right
% address. |foldmark| puts a thin line to help folding of C6/5 letters. |footfill| adds an
% infinite glue between the signature and the letter foot.
%
% \subsection{Page layout}
%
% The default page layout provided by the \textsf{chletter} class, while generic enough,
% leaves more place for the text than the standard classes do.\bigskip
%
% \DescribeMacro{\textwidth}
% \DescribeMacro{\textheight}
% \DescribeMacro{\oddsidemargin}
% \DescribeMacro{\evensidemargin}
% In a single sided document, the space between the top left corner of the page and the main
% text is (|1in + 36pt|, |1in + 36pt|); |36pt| are left for the header and the footer, along
% with |72pt| for the right and bottom margins. For A4 paper, the defaults are the following
% (values in inches and centimeters are rounded):
% \begin{verbatim}
% \textwidth       416pt [5.75in or 14.5cm]
% \textheight      630pt [8.75in or 22cm]
% \oddsidemargin   36pt  [.5in or 1.25cm]
% \evensidemargin  0pt
% \end{verbatim}
%
% \DescribeMacro{\titlehead}
% \DescribeMacro{\titletopheight}
% \DescribeMacro{\titlemidheight}
% \DescribeMacro{\titlebotheight}
% \DescribeMacro{\titlemargin}
% \DescribeMacro{\titlewidth}
% \DescribeMacro{\addressmargin}
% \DescribeMacro{\addresswidth}
% These values are used for the letterhead layout. They are related to the \TeX\ origin, which
% is (|1in|, |1in|) from the top left corner of the page. Please remember that |1in = 72.27pt|.
% |\titlehead| controls the vertical placement of the first baseline of the letterhead.
% |\titlemargin| and |\titlewidth| control the horizontal position and width of the letterhead.
% |\addressmargin| is where the title is split in two. |\addresswith| is the width of the right
% address fields. The title is built by opening a |letter| environment or by calling directly
% |\maketitle|. For A4 paper, the defaults are the following (values in inches and centimeters
% are rounded):
% \begin{verbatim}
% \titlehead       12pt [.16in or .4cm]
% \titletopheight  72pt [1in or 2.5cm]
% \titlemidheight  72pt [1in or 2.5cm]
% \titlebotheight  72pt [1in or 2.5cm]
% \titlemargin     0pt
% \titlewidth      452pt [6.25in or 16 cm]
% \addressmargin   262pt [3.625in or 9.25cm]
% \addresswidth    190pt [2.625in or 6.75cm]
% \end{verbatim}
%
% \begin{figure}
% \begin{picture}(595,842)(0,0)
% \fontsize{5}{5}\selectfont
% \thicklines
% \put(0,0){\framebox(596,842){}}
% \thinlines
% \put(74,758){|fromname|}
% \put(74,746){|fromaddress|}
% \put(336,758){|date|}
% \put(336,686){|toname|}
% \put(336,674){|toaddress|}
% \multiput(72,770)(0,-72){4}{\line(1,0){452}}
% \multiput(72,770)(262,0){2}{\line(0,-1){216}}
% \put(524,770){\line(0,-1){662}}
% \put(108,554){\line(0,-1){446}}
% \put(108,108){\line(1,0){416}}
% \put(110,542){|salutation|}
% \put(110,518){|text|}
% \put(110,494){|valediction|}
% \put(336,446){|signature|}
% \put(25,788){\vector(-1,0){25}}\put(47,788){\vector(1,0){25}}
% \put(0,788){\makebox(72,0){|1in|}}
% \put(170,788){\vector(-1,0){98}}\put(236,788){\vector(1,0){98}}
% \put(72,788){\makebox(262,0){|addressmargin|}}
% \put(398,788){\vector(-1,0){64}}\put(460,788){\vector(1,0){64}}
% \put(334,788){\makebox(190,0){|addresswidth|}}
% \put(272,806){\vector(-1,0){200}}\put(324,806){\vector(1,0){200}}
% \put(72,806){\makebox(452,0){|titlewidth|}}
% \put(560,800){\vector(0,-1){30}}\put(560,812){\vector(0,1){30}}
% \put(524,800){\makebox(72,12){|1in|}}
% \put(560,728){\vector(0,-1){30}}\put(560,740){\vector(0,1){30}}
% \put(524,728){\makebox(72,12){|titletopheight|}}
% \put(560,656){\vector(0,-1){30}}\put(560,668){\vector(0,1){30}}
% \put(524,656){\makebox(72,12){|titlemidheight|}}
% \put(560,584){\vector(0,-1){30}}\put(560,596){\vector(0,1){30}}
% \put(524,584){\makebox(72,12){|titlebotheight|}}
% \put(182,320){\vector(-1,0){74}}\put(260,320){\vector(1,0){74}}
% \put(108,320){\makebox(226,0){|longindentation|}}
% \put(396,320){\vector(-1,0){62}}\put(462,320){\vector(1,0){62}}
% \put(334,320){\makebox(190,0){|indentedwidth|}}
% \put(292,90){\vector(-1,0){184}}\put(340,90){\vector(1,0){184}}
% \put(108,90){\makebox(416,0){|textwidth|}}
% \end{picture}
% \caption{The default \textsf{chletter} layout.}
% \end{figure}
%
% \subsection{The \texttt{letter} environment}
%
% The |letter| environment performs some special actions in the scope of writing letters. At
% its beginning, it generates the letterhead according to its arguments and 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).\bigskip
% 
% \DescribeEnv{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' into |\toname| and |\toaddress|, which can be used in the
% letter body. The `token separator' is the first encountered |\\|\,. Please note that an
% invocation of the |letter| environment without argument will retrieve previously defined
% |\toname| and |\toaddress| values (empty by default).\medskip
%
% There is an optional argument to specify if the letter is to be indented |[i]| or not |[n]|
% where |[n]| is the default. Please note that this option will alter the formatting of general
% \LaTeX\ lists and \textsf{chletter} |\ps|, |\cc| and |\encl| commands (see below).\bigskip
%
% It is possible to open multiple |letter| environments within a single document. Global
% values may be shared between each letter (see next page). Please remember that environments
% involve some locality; for example a length value altered within a |letter| environment
% will recover its initial value outside of the environment.\medskip
%
% An ordinary usage would be:
% \begin{verbatim}
% \begin{letter}[i]{Toname\\ToAddressFirstLine\\...\\ToAddressLastLine}
% ...
% \end{letter}
% \end{verbatim}
%
% \subsubsection{Cover page}
%
% \DescribeMacro{\makelabels}
% Unlike the standard \textsf{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 \textsf{chletter} class provides a way 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.
%
% \subsubsection{Page breaking}
%
% These commands are intended to (try to) control the place where a page break occur.
% They may be used anywhere in a document.\medskip
%
% \DescribeMacro{\stopbreaks}
% |\stopbreaks| will try to prevent all page breaks after its invocation.\bigskip
%
% \DescribeMacro{\startbreaks}
% |\startbreaks| cancels the behaviour of |\stopbreaks|.
%
% \subsubsection{Letter counter}
%
% \DescribeMacro{\theletter}
% At each new |letter| environment opened, this counter is incremented. Please note that
% |thepage| and |thefootnote| counters are reset at the same time.
%
% \subsubsection{Letter markup}
%
% The commands described here are usually put in the preamble, but they may be called from
% anywhere in the document. They store their argument in associated values which will be
% retrieved by the |letter| environment, for example to build the letterhead. They are common
% to a bunch of letter classes.\medskip
%
% \DescribeMacro{\name}
% \DescribeMacro{\address}
% \DescribeMacro{\location}
% \DescribeMacro{\telephone}
% \DescribeMacro{\return}
% The values stored by these commands are respectively: |\fromname|, |\fromaddress|,
% |\fromlocation|, |\telephonenum| and |\returnaddress|. |\telephone| and |\return| will
% format their output (respectively small text and underlined superscript text). Please note
% that |\return| is not defined in the standard \textsf{letter} class. These values are used
% to build the expeditor's address fields:
% \begin{verbatim}
% \name{My Name}
% \address{My Street\\My City}
% \return{My Return Address}
% \end{verbatim}
%
% \DescribeMacro{\date}
% The date field (stored by kernel |\@date| value) can be customized by, for example:
% \begin{verbatim}
% \date{Here, \today}
% \end{verbatim}
%
% \DescribeMacro{\signature}
% The value stored by this macro is |\fromsig|, which is used by the |\closing| command to
% output the signature field (see below).\bigskip
%
% 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 (\textsf{babel} or
% \textsf{polyglossia}).\medskip
%
% To prevent any value from appearing, it has to be emptied by the corresponding command,
% for example: |\date{}|.\medskip
%
% These macros can contain anything that fits in a |\parbox|, including some special stuff
% (using dedicated packages): |\location{\includegraphics{mylogo.pdf}}|\medskip
%
% Any of the values stored by these commands can be retrieved anywhere in the letter (given
% the corresponding value is accessible, |\@author| and |\@date| requiring a |\makeatletter|):
% |I, \fromname, declare...|
%
% \subsubsection{Letter body}
%
% These commands are mostly used within a letter environment, but they may be called at
% document level for special purpose. Their foremost intend is formatting, although they are
% able to retrieve or store their value at will.\medskip
%
% \DescribeMacro{\object}
% This command will simply output the text given in its argument, followed by a |\bigskip|.
% The |\object| command stores its argument in |\@title| and actually outputs it. If the
% argument is either empty or null, then the |\object| command will output the value of
% |\@title| previously set by a |\title| command. Remember that the default |\@title| value
% is an error (set by the \LaTeX\ kernel):
% \begin{verbatim}
% \title{Answer to your previous letter}
% ...
% \begin{document}
% \begin{letter}{...}
% \object
% \end{verbatim}
%
% 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{verbatim}
% \begin{document}
% \begin{letter}{...}
% \object{Answer to your previous letter}
% \end{verbatim}
%
% \DescribeMacro{\opening}
% This command outputs the text given in its argument (adding a |\medskip| vertical space
% after it):
% \begin{verbatim}
% \opening{Dear Sir,}
% \end{verbatim}
%
% It stores its argument in |\salutation| for further use. |\salutation| can also be defined
% previously and be recalled by an |\opening| with an empty or null argument:
% \begin{verbatim}
% \renewcommand{\salutation}{Dear Sir,}
% ...
% \begin{document}
% \begin{letter}{...}
% \opening
% \end{verbatim}
%
% \DescribeMacro{\closing}
% This command issues a |\medskip|, outputs the text given in its argument and generates
% the signature field, which should provide its own vertical spacing (by default it is
% |4\bigskip| above the signature and |2\bigskip| below):
% \begin{verbatim}
% \closing{Yours sincerely,}
% \end{verbatim}
%
% The signature field placement can be altered by invocation of |leftsig| as a
% class option. The signature field will contain the value defined by:
% \begin{itemize}
% \item[---] |\fromsig|  (set by |\signature{...}|) in the first place;
% \item[---] |\fromname| (set by |\name{...}|) if no |\signature| given;
% \item[---] |\@author| (set by |\author{...}|) if no |\name| given (eventually empty).
% \end{itemize}
%
% The |\closing| macro stores its argument in |\valediction| for later use. As usual, the
% |\valediction| value can also be defined before and be output by an invocation of
% |\closing| with an empty or null argument:
% \begin{verbatim}
% \renewcommand{\valediction}{Yours sincerely,}
% \begin{document}
% \begin{letter}{...}
% ...
% \closing{}
% \end{verbatim}
%
% Depending on the class option |footfill|, an extra vertical glue will be added after the
% signature, in order to balance the appearance of the letter foot. |footfill| pushes the
% letter foot text against the document footer (usually the the letter foot is filled by the
% |\ps|, |\encl| and |\cc| commands). Please note that for a weaker balance a |\vfil| could
% be manually added after the |\closing| command.\bigskip
%
% Be aware of the locality of macros. |\salutation| and |\valediction| values are local to
% the current |letter| environment if defined within the environment (usually by |\opening|
% and |\closing| commands), global otherwise. Please look at the \LaTeX\ documentation for
% further explanations.
%
% \subsubsection{Letter foot}
%
% Some formatting commands are intended to be used at the end of the letter (although they
% can be used anywhere in the document, even outside of a letter environment---just as any
% formatting command provided by the \textsf{chletter} class).\bigskip
%
% \DescribeMacro{\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:
% \begin{verbatim}
% \ps{P.S.}{This is a post scriptum}
% \end{verbatim}
%
% \DescribeMacro{\encl}
% This command is a shortcut for |\ps{\enclname}{...}| and takes one mandatory argument.
% Regular use is:
% \begin{verbatim}
% \encl{1. Your previous letter\\2. My Curriculum Vit\ae}
% \end{verbatim}
%
% \DescribeMacro{\cc}
% This command is a shortcut for |\ps{\ccname}{...}| and takes one mandatory argument.
% Regular use is:
% \begin{verbatim}
% \cc{1. First other recipient\\2. Second other recipient}
% \end{verbatim}
%
% |\enclname| and |\ccname| are set to |{encl}|, respectively |{cc}| by default.
% They will be adjusted by a linguistic package (\textsf{babel} or \textsf{polyglossia}).
%
% \subsection{Sectioning}
%
% \DescribeMacro{section}
% \DescribeMacro{subsection}
% \DescribeMacro{subsubsection}
% \DescribeMacro{paragraph}
% \DescribeMacro{subparagraph}
% The class is intended to output short documents (mainly letters!), so the sectioning mecanism
% is minimalist (no index nor table of contents generation). The stock sectioning commands are
% here: |section|, |subsection|, |subsubsection|, |paragraph|, |subparagraph|, but are merely
% formating commands which select some text style and vertical space. As usual, these commands
% take one mandatory argument.
%
% \subsection{Environments}
%
% \DescribeMacro{description}
% \DescribeMacro{verse}
% \DescribeMacro{quotation}
% \DescribeMacro{quote}
% These environments are available and behave as ordinary in the \textsf{chletter} class.
% The default list values (at document level) are:|\labelsep6pt|, |\labelwidth12pt|,
% |\leftmargin18pt|. Please note that |\labelwidth| and |\labelsep| are redefined by a
% |\closing| command to |\leftmargin2\parindent|, |\labelwidth3\labelwidth|.
%
% \subsection{Paragraphing}
%
% \DescribeMacro{\parindent}
% \DescribeMacro{\parskip}
%|\parindent| and |\parskip| respectively default to |18pt| and |9pt| at document level. If
% a |letter| environment is called with the |[i]| option, |\parindent| is kept at its previous
% value. With the default |[n]| option, |\parindent| is locally set to |0| (zero).\bigskip
%
% Please note that the actual value of |\parindent| while a |\closing| command is issued
% will alter the layout of \LaTeX\ lists (in fact |\ps|, |\encl| and |\cc| are lists): the
% |leftmargin| value (which defaults to |18pt|) is then defined as three times the value of
% |\parindent| (thus |0pt| for a default letter and |36pt| for an indented letter).
%
% \StopEventually
%
% \section{Implementation}
%
% The \textsf{chletter} code is fairly compact (less than 300 lines) and highly optimized
% (it relies on \TeX\ primitives wherever practical), dropping the obsolete legacy (namely
% \LaTeX\ 2.09) for the sake of efficiency.\bigskip
%
% 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.
%
% \subsection{Initial code}
%
%    \begin{macrocode}
%<*chletter.cls>
%    \end{macrocode} 
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{chletter}[2010/10/10 v2.0 Swiss letter document class]
%    \end{macrocode}
%
% \subsubsection{Declaring options}
%
% \begin{macro}{leftwin}
% \begin{macro}{leftsig}
% \begin{macro}{foldmark}
% \begin{macro}{footfill}
% There are four specific options: |leftwin|, |leftsig|, |foldmark| and |footfill|,
% corresponding to the format of the letter (left envelope window, left signature, folding
% mark for C6/5 covers, letter foot balancing). The default is to not set any of these options.
% All other options are borrowed from the standard classes.
%
%    \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}{\def\@ptsize{0}}
\DeclareOption{11pt}{\def\@ptsize{1}}
\DeclareOption{12pt}{\def\@ptsize{2}}
\DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse}
\DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue}
\DeclareOption{draft}{\overfullrule5\p@}
\DeclareOption{final}{\overfullrule\z@}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
\DeclareOption{onecolumn}{\@twocolumnfalse\@leftsigfalse}
\DeclareOption{twocolumn}{\@twocolumntrue\@leftsigtrue}
\DeclareOption{leftwin}{\@leftwintrue}
\DeclareOption{leftsig}{\@leftsigtrue}
\DeclareOption{foldmark}{\@foldmarktrue}
\DeclareOption{footfill}{\@footfilltrue}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% These booleans will be evaluated at the end of the class code. They are |false| until the
% associated option is selected.
%
%    \begin{macrocode}
\newif\if@leftwin
\newif\if@leftsig
\newif\if@foldmark
\newif\if@footfill
%    \end{macrocode}
%
% \subsubsection{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 level.
%
%    \begin{macrocode}
\ExecuteOptions{a4paper,10pt}
\ProcessOptions\relax
%    \end{macrocode}
%
% Loading this |.clo| file leads to a lot of redundancy. But we want compatibility.
%
%    \begin{macrocode}
\input{size1\@ptsize.clo}
%    \end{macrocode}
%
% \subsubsection{Loading packages}
%
% The \textsf{chletter} class does not load additional packages.
%
% \subsection{Document layout}
%
% This class tries to provide quite a universal layout, not only suitable for letters, but
% also for other types of short documents. There are anyway some values specific to letters,
% principally the letterhead values.
%
% \subsubsection{Letter counter}
%
% \begin{macro}{theletter}
% Each time a letter is created by a |letter| environment, this counter is incremented.
%
%    \begin{macrocode}
\newcounter{letter}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Letter dimensions}
%
% These dimensions concern the letterhead, where |\titlehead| is the absolute position of
% its first baseline. The title matter is vertically stacked in three strips, each one with
% its  own height. |\titlemargin| is the absolute position of the letterhead margin, to which
% the letterhead matter is relative. |\longindentation| and |\indentedwidth| are to be used
% within a |letter| environment and will be computed on the fly by |\maketitle|, along with
% |\addressmargin| or |\addresswidth|.
%
%    \begin{macrocode}
\newdimen\titlehead
\newdimen\titletopheight
\newdimen\titlemidheight
\newdimen\titlebotheight
%    \end{macrocode}
%    \begin{macrocode}
\newdimen\titlemargin
\newdimen\titlewidth
\newdimen\addressmargin
\newdimen\addresswidth
%    \end{macrocode}
%    \begin{macrocode}
\newdimen\longindentation
\newdimen\indentedwidth
%    \end{macrocode}
%
% \subsubsection{Paragraphing}
%
% We prefer inter paragraph skips in a letter. Swiss letters are rarely  indented but the
% |letter| environement offers an option to do so. Indentation is still enabled at
% document level. Setting |\normallineskip| to zero prevents layout inconsistencies.
%
%    \begin{macrocode}
\parskip9\p@
\parindent18\p@
%    \end{macrocode}
%    \begin{macrocode}
\normallineskip\z@
%    \end{macrocode}
%
% \subsubsection{Page layout}
%
% All dimensions are measured from a point |1in| from the top left corner of the page.
% Remember that |1in = 72.27pt = 2.54cm| = |72bp| and |1pt| = |65536sp|.\medskip
%
% Regarding the header, |12pt| (more or less one line) are reserved, plus |24pt| spacing
% before the main text. The footer space is |36pt|, including body to footer gap.
%
%    \begin{macrocode}
\headheight12\p@
\headsep24\p@
%    \end{macrocode}
%    \begin{macrocode}
\footskip36\p@
%    \end{macrocode}
%
% Regarding the text dimensions, we remove approximately |1in| at each side, plus |36pt|
% horizontally (corresponding to the margin, see below) and |72pt| vertically
% (corresponding to the header and footer, see above). The trick in the definition
% of |\textwidth| and |\textheight| is to have integer values for A4 paper.
%
%    \begin{macrocode}
\textwidth\paperwidth
\advance\textwidth-9536004sp
\titlewidth\textwidth
\advance\textwidth-36\p@
%    \end{macrocode}
%    \begin{macrocode}
\textheight\paperheight
\advance\textheight-14093310sp
%    \end{macrocode}
%
% The left margin of the odd pages is set to |1in + 36pt| (more or less |4cm|). Sizes of the
% marginal notes are adapted to quite small margins. Top margin is set to zero.
%
%    \begin{macrocode}
\oddsidemargin36\p@
\evensidemargin\z@
%    \end{macrocode}
%    \begin{macrocode}
\marginparwidth48\p@
\marginparsep6\p@
\marginparpush6\p@
%    \end{macrocode}
%    \begin{macrocode}
\topmargin\z@
%    \end{macrocode}
%
% The footnotes values are somewhat larger than the default.
%
%    \begin{macrocode}
\footnotesep12\p@
\skip\footins12\p@
%    \end{macrocode}
%
% \subsubsection{Title layout}
%
% What we call `title' here is the letterhead, with the addresses fields and all this kind of
% stuff. Title is always placed on an odd page at an absolute position.
%
% \begin{macro}{\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). Please note that
% letterhead position is not altered by anything but |\titlehead| (for example it is
% independant from the |\topmargin| value).
%
%    \begin{macrocode}
\titlehead12\p@
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\titletopheight}
% \begin{macro}{\titlemidheight}
% \begin{macro}{\titlebotheight}
% The title (letterhead or cover) field is divided into three strips, each one containing
% some material. For example, the first field could contain the sender's address, the second
% one the recipient's address and the third one the letter's date. Obviously the total
% letterhead height is the sum of these three values (|216pt| by default).
%
%    \begin{macrocode}
\titletopheight72\p@
\titlemidheight72\p@
\titlebotheight72\p@
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\titlemargin}
% \begin{macro}{\titlewidth}
% The horizontal position of the title is controlled by |\titlemargin| which is set to |0pt|
% by default. |\titlewidth| has already been set as |\textwidth + 36pt|. 
% \end{macro}
% \end{macro}
%
% \begin{macro}{\addressmargin}
% \begin{macro}{\addresswidth}
% These values are to be computed on the fly by |\maketitle| depending on user input and
% actual |\titlewidth| value. If |\addressmargin| is defined by the user, then the formula
% |\titlewidth = \addressmargin + \addresswidth| will be applied to |\addresswidth|, otherwise
% it will be applied to |\addressmargin|.
%
%    \begin{macrocode}
\addresswidth190\p@
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Page styles}
%
% The default page styles are here, but their layout differ from the standard classes.
%
%    \begin{macrocode}
\def\ps@plain%
{\let\@oddhead\@empty
 \let\@evenhead\@empty
 \def\@oddfoot{\footnotesize\hfil\pagename~\thepage}
 \def\@evenfoot{\footnotesize\pagename~\thepage\hfil}}
%    \end{macrocode}
%    \begin{macrocode}
\def\ps@firstpage%
{\let\@oddhead\@empty
 \let\@evenhead\@empty
 \def\@oddfoot{\footnotesize\leftmark\hfil\rightmark}
 \def\@evenfoot{\footnotesize\rightmark\hfil\leftmark}}
%    \end{macrocode}
%    \begin{macrocode}
\def\ps@headings%
{\def\@oddhead{\footnotesize\headtoname~\toname\hfil\pagename~\thepage}
 \def\@evenhead{\footnotesize\pagename~\thepage\hfil}
 \def\@oddfoot{\footnotesize\leftmark\hfil\rightmark}
 \def\@evenfoot{\footnotesize\rightmark\hfil\leftmark}}
%    \end{macrocode}
%    \begin{macrocode}
\def\ps@myheadings%
{\def\@oddhead{\footnotesize\leftmark\hfil\rightmark}
 \def\@evenhead{\footnotesize\rightmark\hfil\leftmark}
 \def\@oddfoot{\footnotesize\hfil\pagename~\thepage}
 \def\@evenfoot{\footnotesize\pagename~\thepage\hfil}}
%    \end{macrocode}
%
% \subsection{Document markup}
%
% These user commands are common to all usual letter classes. 
%
% \subsubsection{Global declarations}
%
% \begin{macro}{\name}
% \begin{macro}{\signature}
% \begin{macro}{\address}
% \begin{macro}{\location}
% \begin{macro}{\telephone}
% \begin{macro}{\return}
% These macros work exactly the same way as with the standard \textsf{letter} class. They
% don't output anything, but just define an associated word containing their argument. The
% layout of |\telephonenum| (small text) and |\returnaddress| (underlined small text) is
% specific to this class and somewhat tricky, intended to manage the best possible appearance.
% Please note that the default contents of the associated words will be defined later.
%
%    \begin{macrocode}
\long\def\name#1{\def\fromname{#1}}
\long\def\signature#1{\def\fromsig{#1}}
\long\def\location#1{\def\fromlocation{#1}}
\long\def\address#1{\def\fromaddress{#1}}
\long\def\telephone#1{\def\telephonenum{\vtop{\footnotesize#1}}}
\long\def\return#1{\def\returnaddress{\underbar{\textsuperscript{#1}}}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\makelabels}
% \begin{macro}{\startlabels}
% The |\makelabels| command defines a |\startlabels| macro, which causes cover pages to be
% added at the end of each letter. See next page for more information.
%
%    \begin{macrocode}
\def\makelabels%
{\def\startlabels%
 {\let\titletopmatter\@empty
  \let\titlebotmatter\@empty
  \let\foldmark\@empty}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\maketitle}
% This artful piece of code actually outputs the letterhead stuff. |\maketitle| is always
% called at the opening of the |letter| environment, and at its closing if the |\startlabels|
% flag is not |\@null|. It 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|. |\longindentation| and |\indentedwidth| are computed
% here, so are |\addressmargin| and |\addresswidth| which are used by |\splitfield|. Some
% dedicated mecanism deals with the |\twoside| and |\twocolumns| cases (the letterhead is
% always issued on a clear odd page), executing the |\@maketitle| auxiliary macro. The
% |\foldmark| macro is called at the end of the letterhead.
%
%    \begin{macrocode}
\def\maketitle%
{\ifdim\addressmargin=\z@
  \addressmargin\titlewidth
  \advance\addressmargin-\addresswidth
 \else
  \addresswidth\titlewidth
  \advance\addresswidth-\addressmargin\fi
 \longindentation\titlemargin
 \advance\longindentation-\oddsidemargin
 \clearpage
 \if@twoside\ifodd\c@page
 \else\thispagestyle{empty}\hb@xt@\z@{}\clearpage\fi\fi
 \if@twocolumn\twocolumn[\@maketitle\leavevmode\vskip-\topskip]
 \else\vbox{\@parboxrestore\@maketitle}\vskip-\parskip\fi
 \advance\longindentation\addressmargin
 \indentedwidth\textwidth
 \advance\indentedwidth-\longindentation}
%    \end{macrocode}
%    \begin{macrocode} 
\def\@maketitle%
{\vskip-\topmargin\vskip-\baselineskip
 \vskip\titlehead\vskip-\headheight\vskip-\headsep
 \leftskip\longindentation\rightskip\textwidth
 \advance\rightskip-\paperwidth
 \advance\rightskip-\titlemargin
 \parbox[t][\titletopheight]{\titlewidth}
 {\hb@xt@\z@{}\titletopmatter\strut}\par
 \parbox[t][\titlemidheight]{\titlewidth}
 {\hb@xt@\z@{}\titlemidmatter\strut}\par
 \parbox[t][\titlebotheight]{\titlewidth}
 {\hb@xt@\z@{}\titlebotmatter\strut}\par
 \leftskip-\oddsidemargin\advance\leftskip-1in
 \parbox[b][\z@]{\paperwidth}{\foldmark}\par}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The \texttt{letter} environment}
%
% \begin{environment}{letter}
% The |letter| environment is the foremost part of a letter. It takes the recipient's address
% as mandatory argument and |[i]| (default is |[n]|) as optional argument to set the
% |\parindent| value within the group represented by the environment. The first part of the
% code manages these arguments. It is sturdier than the standard \LaTeX\ |\newenvironment| in
% the sense that, for example, the mandatory argument is not... mandatory! At its opening,
% the |letter| environment tokenizes its mandatory argument into two fields, |\toname| and
% |\toaddress| (token separator is the first encountered |\\|). If the argument is null
% (|\begin{letter}{}| or |\begin{letter}|), these values won't be modified and thus may be
% defined before the opening of the environment, hence the easy mail merging extension. Then
% |\maketitle| is called to output the letterhead (the first page of the letter is always
% issued on a clear odd page, leaving a blank page if necessary in two sided documents). The
% |\pagestyle| of the first letter page is set to |firstpage| and the |letter| counter is
% incremented, while the |page| and |footnote| counters are reset.
%
%    \begin{macrocode}
\def\letter{\futurelet\@let@token\ch@let}\def\ch@let%
{\ifx\@let@token[\expandafter\@letter\else\expandafter\ch@lea\fi}
\long\def\ch@lea#1 {\@letter[n]{#1} }
%    \end{macrocode}
%    \begin{macrocode}
\long\def\@letter[#1]#2
{\ifx#1n\parindent\z@\fi\ifx\@null#2\else\@processto#2\\@@@
  \ifx\@empty\toaddress\else\@processto#2@@@\fi\fi
 \maketitle\thispagestyle{firstpage}
 \global\c@page\@ne\global\c@footnote\z@\global\advance\c@letter\@ne}
%    \end{macrocode}
%    \begin{macrocode}
\long\def\@processto#1\\#2@@@{\def\toname{#1}\def\toaddress{#2}}
%    \end{macrocode}
%
% At its closing, the |letter| environment removes the last skip, then 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, taking the |\twoside| case in
% account (which may produce additional empty pages), then issuing a new page (intended to be
% a cover) followed by a |\clearpage|.
%
%    \begin{macrocode}
\def\endletter{\removelastskip\ifx\startlabels\undefined\else%
 \startlabels\maketitle\thispagestyle{empty}\fi\clearpage}
%    \end{macrocode}
% \end{environment}
%
% \subsubsection{Page breaking control}
%
% \begin{macro}{\stopbreaks}
% \begin{macro}{\startbreaks}
% When the command |\stopbreaks| is issued no page breaks should occur until |\startbreaks| is
% called. These macros are used by the |\closing| command.
%
%    \begin{macrocode}
\def\stopbreaks{\interlinepenalty\@M\def\par{\@@par\nobreak}}
\def\startbreaks{\interlinepenalty100\def\par{\@@par}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{The generic letter commands}
%
% \begin{macro}{\opening}
% Unlike the standard \textsf{letter} class, the |\opening| command doesn't generate the
% letterhead (this is done at the opening of the |letter| environment or by a direct call of
% |\maketitle|). The content of |\salutation| is either locally filled with the mandatory
% argument or recalled if the argument is null (either |\opening{}| or |\opening| without
% argument, look at the neat argument handling code), then output. The |\medskipamount| value
% controls the vertical spacing.
%
%    \begin{macrocode}
\def\opening{\futurelet\@let@token\ch@ope}\def\ch@ope%
{\ifx\@let@token\bgroup\expandafter\ch@opa\else\expandafter\@opening\fi}
\def\ch@opa#1{\ifx\@null#1\else\def\salutation{#1}\fi\@opening}
%    \end{macrocode}
%    \begin{macrocode}
\def\@opening{\par\salutation\par\medskip}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\closing}
% The |\closing| command is to be called at the end of the letter body. It generates the
% valediction and the signature. Much like the |\opening| command, its argument either fills
% or retrieve a value, here |\valediction|. A |\medskip| is issued, page breaking is prevented
% and |\closingmatter| is added. |\closingmatter| is defined according to the class option
% |leftsig| and could be completely customized.
%
%    \begin{macrocode}
\def\closing{\futurelet\@let@token\ch@clo}\def\ch@clo%
{\ifx\@let@token\bgroup\expandafter\ch@cla\else\expandafter\@closing\fi}
\def\ch@cla#1{\ifx\@null#1\else\def\valediction{#1}\fi\@closing}
%    \end{macrocode}
%    \begin{macrocode}
\def\@closing{\par\medskip\stopbreaks\valediction
 \samepage\par\closingmatter\par\startbreaks}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\object}
% The |\object| macro outputs the content of |\@title|, either previously defined by a
% |\title| command or filled by a non empty argument (see |\opening| for an explanation of
% this behaviour). The |\bigskipamount| value controls the vertical spacing. Styling is left
% to user's preference, for example: |\object{\textbf{...}}|.
%
%    \begin{macrocode}
\def\object{\futurelet\@let@token\ch@obj}\def\ch@obj%
{\ifx\@let@token\bgroup\expandafter\ch@oba\else\expandafter\@object\fi}
\def\ch@oba#1{\ifx\@null#1\else\title{#1}\fi\@object}
%    \end{macrocode}
%    \begin{macrocode}
\def\@object{\noindent\@title\par\bigskip}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ps}
% \begin{macro}{\cc}
% \begin{macro}{\encl}
% |\ps| is a shortcut for a simple \LaTeX\ list, with its first argument as item label and
% its second argument as a item contents. |\cc| and |\encl| are further shortcuts, using
% respectively |\ccname| and |\enclname| as label.  There is a trick involved here: the list
% behaviour is altered after a |\closing| command (see |\closingmatter|); by these means the
% letter foot benefit from the powerful list feature while the lists defaults are kept at
% convenient values for use within the letter body.\medskip
%
%    \begin{macrocode}
\long\def\ps#1#2{\begin{list}{}{}\item[#1]#2\end{list}}
\long\def\cc#1{\ps{\ccname}{#1}}
\long\def\encl#1{\ps{\enclname}{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Sections and paragraphs}
%
% Some sectioning commands are defined, but they are merely formatting commands. So there is
% no section numbering nor index and table of contents generation.
%
%    \begin{macrocode}
\long\def\subparagraph#1{\par\textbf{#1}\hskip\labelsep}
\long\def\paragraph#1{\par\noindent\textbf{#1}\hskip\labelsep}
\long\def\subsubsection#1{\par\noindent\textbf{#1}\par\nobreak}
\long\def\subsection#1{\smallskip\subsubsection{#1}}
\long\def\section#1{\medskip\subsubsection{#1}}
%    \end{macrocode}
%
% \subsubsection{Environments}
%
% This code is borrowed from the standard classes. Please look at the \LaTeXe\ documentation
% for further explanation. Remember that all these environments are lists which will be 
% formatted according following the general lists parameters.
%
%    \begin{macrocode}
\def\description
{\list{}
 {\labelwidth\z@
  \itemindent-\leftmargin
  \let\makelabel\descriptionlabel}}\def\enddescription{\endlist}
%    \end{macrocode}
%    \begin{macrocode}
\def\descriptionlabel#1{\hskip\labelsep\textbf{#1}}
%    \end{macrocode}
%    \begin{macrocode}
\def\verse
{\let\\\@centercr
 \list{}
 {\itemsep\z@
  \itemindent-\parindent
  \listparindent\itemindent
  \rightmargin\leftmargin
  \advance\leftmargin\parindent}
 \item\relax}\def\endverse{\endlist}
%    \end{macrocode}
%    \begin{macrocode}
\def\quotation
{\list{}
 {\listparindent\parindent
  \itemindent\listparindent
  \rightmargin\leftmargin}
 \item\relax}\def\endquotation{\endlist}
%    \end{macrocode}
%    \begin{macrocode}
\def\quote
{\list{}
 {\rightmargin\leftmargin}
 \item\relax}\def\endquote{\endlist}
%    \end{macrocode}
%
% \subsubsection{Lists}
%
% This code is borrowed from the standard classes. Please look at the \LaTeXe\ documentation
% for further explanation. Please also note that list nesting is limited to four levels
% (seems to be enough for a letter).
%
%    \begin{macrocode}
\def\@listI{}
\let\@listi\@listI
\let\@listii\@listI
\let\@listiii\@listI
\let\@listiv\@listI
%    \end{macrocode}
%    \begin{macrocode}
\def\theenumi{\@arabic\c@enumi}
\def\theenumii{\@alph\c@enumii}
\def\theenumiii{\@roman\c@enumiii}
\def\theenumiv{\@Alph\c@enumiv}
%    \end{macrocode}
%    \begin{macrocode}
\def\labelenumi{\theenumi.}
\def\labelenumii{(\theenumii)}
\def\labelenumiii{\theenumiii.}
\def\labelenumiv{\theenumiv.}
%    \end{macrocode}
%    \begin{macrocode}
\def\p@enumii{\theenumi}
\def\p@enumiii{\theenumi(\theenumii)}
\def\p@enumiv{\p@enumiii\theenumiii}
%    \end{macrocode}
%    \begin{macrocode}
\def\labelitemi{\textbullet}
\def\labelitemii{\textbf{\textendash}}
\def\labelitemiii{\textasteriskcentered}
\def\labelitemiv{\textperiodcentered}
%    \end{macrocode}
%
% \subsection{Default settings}
%
% As in other classes, some values are set here rather than at kernel level. The values used
% by the \textsf{chletter} class are as generic as possible.
%
% \subsubsection{Lists}
%
% \begin{macro}{\labelsep}
% \begin{macro}{\labelwith}
% \begin{macro}{\leftmargin}
% These default values are defined at document level and altered by |\closingmatter|
% (see next page) in the following manner: |\labelwidth3\labelsep| (usually |18pt|),
% |\leftmargin2\parindent| (|36pt| in an indented letter, |0pt| in a default letter).
%
%    \begin{macrocode}
\labelsep6\p@\labelwidth12\p@\leftmargin18\p@
%    \end{macrocode}
%    \begin{macrocode}
\topsep\z@\partopsep3\p@\itemsep\z@\parsep3\p@
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Environments}
%
% Exactly as in the standard classes.
%    \begin{macrocode}
\arraycolsep5\p@
\tabcolsep6\p@
\arrayrulewidth.4\p@
\doublerulesep2\p@
\tabbingsep\labelsep
\skip\@mpfootins=\skip\footins
\def\theequation{\@arabic\c@equation}
%    \end{macrocode}
%
% \subsubsection{Framed boxes}
%
% \begin{macro}{\fboxsep}
% \begin{macro}{\fboxrule}
% Apart from their ordinary application, the values defined here are used by the default
% |\foldmark| macro defined by the |foldmark| class option.
%  
%    \begin{macrocode}
\fboxsep3\p@
\fboxrule.4\p@
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Footnotes}
%
% Light is right! This definition is minimalist, at the same time sensible.
%    \begin{macrocode}
\long\def\@makefntext#1{\noindent\hb@xt@\z@{\hss\@makefnmark}#1}
%    \end{macrocode}
%
% \subsubsection{Letter}
%
% Some specific letter values are initialized here. 
%
% \begin{macro}{\fromname}
% \begin{macro}{\fromsig}
% \begin{macro}{\fromaddress}
% \begin{macro}{\fromlocation}
% \begin{macro}{\telephonenum}
% \begin{macro}{\returnaddress}
% |\fromname| is not empty by default, so is |\fromsig|: they contain the |\@author| value,
% which is defined at kernel level to output nothing but a warning message (no author given).
% |\@author| will be modified by the \LaTeX\ |\author| command. |\fromlocation| and 
% |\fromaddress| are somewhat redundant, but they may be used for special purpose.
% |\returnaddress| should also output nothing by default, but it has to leave an empty line,
% hence the |\null| trick (actually an empty |\hbox|).
%
%    \begin{macrocode}
\def\fromname{\@author}
\def\fromsig{\@author}
\let\fromlocation\@empty
\let\fromaddress\@empty
\let\telephonenum\@empty
\def\returnaddress{\null}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\toname}
% \begin{macro}{\toaddress}
% These values retrieved or adjusted at the opening of a |letter| environment.
% They are initialized here to prevent an error in certain condition.
%
%    \begin{macrocode}
\let\toname\@empty
\let\toaddress\@empty
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\salutation}
% \begin{macro}{\valediction}
% These values are retrieved or adjusted respectively by the |\opening| and |\closing|
% commands. They are initialized here to prevent an error in certain condition.
%
%    \begin{macrocode}
\let\salutation\@empty
\let\valediction\@empty
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \subsubsection{Words}
%
% \begin{macro}{\ccname}
% \begin{macro}{\enclname}
% \begin{macro}{\pagename}
% \begin{macro}{\headtoname}
% These words are common to the common \textsf{letter} classes. They will be adjusted by the
% linguistic packages (\textsf{babel} or \textsf{polyglossia}). |\ccname| and |\enclname| are
% used respectively by the |\cc| and |\encl| macros; while |\pagename| and |\headtoname| are
% used within |\pagestyle| layouts and some additional packages.
%
%    \begin{macrocode}
\def\ccname{cc}
\def\enclname{encl}
\def\pagename{Page}
\def\headtoname{To}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Date}
%
% \begin{macro}{\today}
% The |\@date| field, which appears in the letterhead, defaults to |\today|. The |\today|
% value will be adjusted by the linguistic packages (\textsf{babel} or \textsf{polyglossia}).
%
%    \begin{macrocode}
\def\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}
%
% \subsubsection{Two column mode}
%
% \begin{macro}{\columnsep}
% This is tricky! The idea is to align the columns with the addresses. In a default
% (A4) letter, the second column will align with the recipient's address and the date.
%
%    \begin{macrocode}
\columnsep36\p@
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The page style} 
%
% We have |\pagetyle{plain}| pages in this document class (except the letterhead
% page which has |\thispagestyle{firspage}|). We use arabic page numbers.
% 
%    \begin{macrocode}
\pagestyle{plain}
\pagenumbering{arabic}
%    \end{macrocode}
%
% \subsection{Later initializations}
%
% This code handles the class options |leftwin|, |leftsig|, |foldmark|, |footfill| and
% |twocolumn| (retrieved by the associated booleans). It defines the default layout of the
% letter and would be very interesting for those who wish to completely customize the letter
% appearance by redefining the relevant macros.
%
% \subsubsection{Letterhead layout}
%
% \begin{macro}{\titletopmatter}
% \begin{macro}{\titlemidmatter}
% \begin{macro}{\titlebotmatter}
% The default layout of the letterhead is defined here, taking in account the class option
% |leftwin|. |\titletopmatter|, |\titlemidmatter| and |\titlebotmatter| are three strips of
% |\titletopheight|, |\titlemidheight| and |\titlebotheight| respective heights. Please note
% the usage of |\splitfield{...}{...}| which cuts a strip in two columns of |\adressmargin|
% and |\addresswidth| respective widths.
%
%    \begin{macrocode}
\if@leftwin
 \def\titletopmatter%
 {\splitfield
  {}{\fromlocation\par\fromname\par\fromaddress\par\telephonenum}}
 \def\titlemidmatter%
 {\returnaddress\par\toname\par\toaddress}
 \def\titlebotmatter%
 {\splitfield
  {}{\@date}}
%    \end{macrocode}
%    \begin{macrocode}
\else
 \def\titletopmatter%
 {\splitfield
  {\fromlocation\par\fromname\par\fromaddress\par\telephonenum}{\@date}}
 \def\titlemidmatter%
 {\splitfield
  {}{\returnaddress\par\toname\par\toaddress}}
 \def\titlebotmatter%
 {}\fi
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\splitfield}
% The letterhead is divided in three vertically stacked strips of |\titlewidth| width, named
% respectively |\titletopmatter|, |titlemidmatter| and |titlebotmatter| (see above). 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 (computed on the fly by |\maketitle|, see
% above). The letterhead may contain graphics (a logo for example), so we have to cope with
% the relative vertical placement of text and imported pictures, hence the |\hbox| and |\strut|
% in the definitions of the parboxes.
%
%    \begin{macrocode}
\long\def\splitfield#1#2%
{\parbox[b][\baselineskip][t]{\addressmargin}{\hb@xt@\z@{}{#1}\strut}%
 \parbox[b][\baselineskip][t]{\addresswidth}{\hb@xt@\z@{}{#2}\strut}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Signature layout}
%
% \begin{macro}{\closingmatter}
% |\closingmatter| is output by the |\closing| command and can contain any piece of text or
% code. |\fooftill| is an extra glue for better letter foot balancing (see below). Please
% note the crafty use of the |\ps| command. Also remember that |\leftmargin| and |\labelwidth|
% values are changed by this |\closingmatter|.
%
%    \begin{macrocode}
\if@leftsig
 \def\closingmatter%
 {\leftmargin2\parindent
  \vskip4\bigskipamount
  \ps{}{\fromsig}
  \vskip2\bigskipamount plus\footfill
  \labelwidth3\labelwidth
  \advance\labelwidth-\labelsep}
%    \end{macrocode}
%    \begin{macrocode}
\else
 \def\closingmatter%
 {\leftmargin\longindentation
  \vskip4\bigskipamount
  \ps{}{\fromsig}
  \vskip2\bigskipamount plus\footfill
  \leftmargin2\parindent
  \labelwidth3\labelwidth
  \advance\labelwidth-\labelsep}\fi
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Fold mark}
%
% \begin{macro}{\foldmark}
% The |foldmark| class option alters the |\foldmark| macro, which causes a line to be added
% between the letterhead and the main text. Default is |\@empty|.
%
%    \begin{macrocode}
\if@foldmark\def\foldmark{\hrule\@width6\fboxsep\@height\fboxrule}
\else\let\foldmark\@empty\fi
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Letter footer}
%
% \begin{macro}{\footfill}
% A conditionnal definition of |\footfill| will alter the layout of |\closingmatter|
% (see above), adding an extra vertical glue after the signature. Default is |\@empty|.
%
%    \begin{macrocode}
\if@footfill\def\footfill{1fill}
\else\let\footfill\z@\fi
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Two column mode}
%
% The column separator (|\columnsep|) is initialized earlier in the class code.
% Please note that in one column mode we reverse the position of the margin paragraphs.
%
%    \begin{macrocode}
\if@twocolumn\twocolumn\sloppy
\else\onecolumn\reversemarginpar\fi
%    \end{macrocode}
%
% \subsection{Legacy}
%
% Unfortunately some widely spread packages still relie on this!
%
%    \begin{macrocode}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\relax}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\relax}
%    \end{macrocode}
%
%    \begin{macrocode}
%</chletter.cls>
%    \end{macrocode}
%
% \pagebreak
%
% \section{Letter template}
%
% \setcounter{CodelineNo}{0}
%
% The following \LaTeX\ document is intended to be used as a template. It will also
% compile with the standard \textsf{letter} class and the older version of the
% \textsf{chletter} class.\bigskip
%
% Please note that the \textsf{chextras} companion package will simplify the preparation of
% Swiss documents by setting up linguistic packages, font encoding and document layout.
% Look at \textsf{chextras} documentation for further information.
%
%    \begin{macrocode}
%<*chlettmp.tex>
%    \end{macrocode}
% 
%    \begin{macrocode}
\documentclass{chletter}

%%\usepackage[english,black]{chextras}

\author{My name}
\address{My address\\My City}
\telephone{My phone\\My email}
\date{My location, \today}

\begin{document}
\begin{letter}{Name\\Address\\City}

\opening{Dear \toname,}

Body text.

\closing{Yours truly,}

\encl{Enclosures}
\cc{Other recipients}

\end{letter}
\end{document}
%    \end{macrocode}
%    \begin{macrocode}
%</chlettmp.tex>
%    \end{macrocode}
%
% \pagebreak
%
% \Finale
% \PrintIndex
\endinput