| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright 2008, 2009, 2010 by Boris Oriet <http://boris.oriet.net> |
| 4 |
% ------------------------------------------------------- |
| 5 |
% |
| 6 |
% This file may be distributed and/or modified under the |
| 7 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 8 |
% of this license or (at your option) any later version. |
| 9 |
% The latest version of this license is in: |
| 10 |
% |
| 11 |
% http://www.latex-project.org/lppl.txt |
| 12 |
% |
| 13 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 14 |
% version 2008/05/04 or later. |
| 15 |
% |
| 16 |
% This file has the LPPL maintenance status "author-maintained". |
| 17 |
% |
| 18 |
% \fi |
| 19 |
% |
| 20 |
% \iffalse |
| 21 |
%<*driver> |
| 22 |
\ProvidesFile{chletter.dtx} |
| 23 |
\documentclass[a4paper]{ltxdoc} |
| 24 |
\usepackage{hypdoc} |
| 25 |
\pdfstringdefDisableCommands{\def\url{}} |
| 26 |
\makeatletter |
| 27 |
\let\PrintMacroName\HDorg@PrintMacroName |
| 28 |
\let\PrintDescribeMacro\HDorg@PrintDescribeMacro |
| 29 |
\makeatother |
| 30 |
\setlength\parindent{0pt} |
| 31 |
\setlength\unitlength{.59pt} |
| 32 |
\CodelineIndex |
| 33 |
\begin{document} |
| 34 |
\DocInput{chletter.dtx} |
| 35 |
\end{document} |
| 36 |
%</driver> |
| 37 |
% \fi |
| 38 |
% |
| 39 |
% \CheckSum{1057} |
| 40 |
% |
| 41 |
% \CharacterTable |
| 42 |
% {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 |
| 43 |
% 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 |
| 44 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 45 |
% Exclamation \! Double quote \" Hash (number) \# |
| 46 |
% Dollar \$ Percent \% Ampersand \& |
| 47 |
% Acute accent \' Left paren \( Right paren \) |
| 48 |
% Asterisk \* Plus \+ Comma \, |
| 49 |
% Minus \- Point \. Solidus \/ |
| 50 |
% Colon \: Semicolon \; Less than \< |
| 51 |
% Equals \= Greater than \> Question mark \? |
| 52 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 53 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 54 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 55 |
% Right brace \} Tilde \~} |
| 56 |
% |
| 57 |
% \changes{v1.0}{2008/07/29}{Initial version} |
| 58 |
% \changes{v1.1}{2009/11/05}{Internal interim version, minor changes} |
| 59 |
% \changes{v2.0}{2010/10/10}{Code overhaul, new features, code frozen} |
| 60 |
% |
| 61 |
% \title{The \textsf{chletter} Document Class |
| 62 |
% \thanks{This document corresponds to \textsf{chletter} v2.0, dated 2010/10/10.}} |
| 63 |
% \author{Boris \textsc{Oriet}\\\url{http://boris.oriet.net}} |
| 64 |
% \maketitle |
| 65 |
% \bigskip\bigskip |
| 66 |
% \tableofcontents |
| 67 |
% \pagebreak |
| 68 |
% |
| 69 |
% \section{Introduction} |
| 70 |
% |
| 71 |
% The \textsf{chletter} class is suited for typesetting letters with letterhead |
| 72 |
% corresponding to the swiss norm SN~010130.\bigskip |
| 73 |
% |
| 74 |
% The default letterhead is set according to Swiss rules. It fits into both right |
| 75 |
% and left windowed ISO 269 C5 and C6/5 envelopes.\bigskip |
| 76 |
% |
| 77 |
% This class is mostly compatible with the standard \LaTeXe{} classes. |
| 78 |
% It is not limited to letters and may be used as a generic document class.\bigskip |
| 79 |
% |
| 80 |
% Its basic usage is very simple and user friendly. |
| 81 |
% It is appropriate to quickly typeset casual documents and letters.\bigskip |
| 82 |
% |
| 83 |
% It is however highly configurable and may be used within complex setups |
| 84 |
% to provide automated letters composition. |
| 85 |
% |
| 86 |
% \section{Usage} |
| 87 |
% |
| 88 |
% The following examples describe the regular usage of the \textsf{chletter} class. |
| 89 |
% Basically, this class behaves in a similar way to a standard class and accepts the |
| 90 |
% regular \textsf{letter} commands, including the dedicated |letter| environment. |
| 91 |
% Much like with standard classes, the only mandatory commands are |\documentclass| |
| 92 |
% and the |document| environment (|\begin{document}| and |\end{document}|). |
| 93 |
% |
| 94 |
% \subsection{A basic letter} |
| 95 |
% |
| 96 |
% This example shows the plain usage of the \textsf{chletter} class.\medskip |
| 97 |
% |
| 98 |
% |\author|, |\address| and |\date| are markup commands which store |
| 99 |
% global values used to build the letterhead. The |letter| environment actually creates the |
| 100 |
% letter with its letterhead and all the needed layout. |\opening|, |\closing|, |\encl| and |
| 101 |
% |\cc| are mainly formatting commands. To have multiple lines in a field, one may use |
| 102 |
% |\newline| (shortcut |\\| as in this example) or |\par| (shortcut is an empty line).\medskip |
| 103 |
% |
| 104 |
% Please note that this example would also compile straightforward with the |
| 105 |
% standard \textsf{letter} class (giving a somewhat different output). |
| 106 |
% |
| 107 |
% \begin{verbatim} |
| 108 |
% \documentclass{chletter} |
| 109 |
% |
| 110 |
% \author{My name} |
| 111 |
% \address{My address\\My city} |
| 112 |
% \date{Location, \today} |
| 113 |
% |
| 114 |
% \begin{document} |
| 115 |
% \begin{letter}{Name\\Address\\City} |
| 116 |
% \opening{Salutation,} |
| 117 |
% Hello World! |
| 118 |
% \closing{Valediction.} |
| 119 |
% \encl{enclosures} |
| 120 |
% \cc{other recipients} |
| 121 |
% \end{letter} |
| 122 |
% \end{document} |
| 123 |
% \end{verbatim} |
| 124 |
% |
| 125 |
% \begin{figure} |
| 126 |
% \begin{picture}(596,842)(0,0) |
| 127 |
% \fontsize{7}{7}\selectfont |
| 128 |
% \thicklines |
| 129 |
% \put(0,0){\framebox(596,842){}} |
| 130 |
% \thinlines |
| 131 |
% \put(72,758){My name} |
| 132 |
% \put(72,746){My address} |
| 133 |
% \put(72,734){My city} |
| 134 |
% \put(334,758){Location, October 10, 2010} |
| 135 |
% \put(334,686){Name} |
| 136 |
% \put(334,674){Address} |
| 137 |
% \put(334,662){City} |
| 138 |
% \put(108,542){Salutation,} |
| 139 |
% \put(108,518){Hello World!} |
| 140 |
% \put(108,494){Valediction.} |
| 141 |
% \put(334,446){My name} |
| 142 |
% \end{picture} |
| 143 |
% \caption{Standard letter output by \textsf{chletter}.} |
| 144 |
% \end{figure} |
| 145 |
% |
| 146 |
% \subsection{A customized letter} |
| 147 |
% |
| 148 |
% This example provides a good overview of the different class options and macros.\medskip |
| 149 |
% |
| 150 |
% The |leftwin| option is to be used with a left windowed envelope, inverting the sender's |
| 151 |
% and recipient's addresses. The |leftsig| option places the signature against the left body |
| 152 |
% margin. The |foldmark| option will include a thin line to help folding of C6/5 letters. |
| 153 |
% The |footfill| option will throw the letter foot against the document footer, for refined |
| 154 |
% vertical balancing.\medskip |
| 155 |
% |
| 156 |
% |\makelabels| creates an addtional envelope page with only the recipient's address and |
| 157 |
% the sender's return address. |\addresswidth| adjusts the letterhead layout (here it is |
| 158 |
% computed to right align the date field, mimicking the standard \textsf{letter} class |
| 159 |
% behaviour). |\location|, |\name|, |\return| and |\telephone| are supplementary markup |
| 160 |
% commands. |\object| and |\ps| are extra layout commands. |\longindentation| (which is |
| 161 |
% also provided by the standard \textsf{letter} class) enables alignement of the text with |
| 162 |
% the addresses.\medskip |
| 163 |
% |
| 164 |
% Please note that lines with a comment (|%|) should be removed to allow compilation with the |
| 165 |
% standard \textsf{letter} class. |
| 166 |
% |
| 167 |
% \begin{verbatim} |
| 168 |
% \documentclass[leftwin,leftsig,foldmark,footfill]{chletter} |
| 169 |
% |
| 170 |
% \settowidth\addresswidth{\today} % |
| 171 |
% |
| 172 |
% \makelabels |
| 173 |
% |
| 174 |
% \location{Our Company} |
| 175 |
% \name{My name} |
| 176 |
% \return{\fromlocation, My address, My city} % |
| 177 |
% \address{My address\\My city} |
| 178 |
% \telephone{My phone\\My email} |
| 179 |
% \signature{My signature\\\footnotesize My position} |
| 180 |
% \title{\textbf{About the \textsf{chletter} document class}} |
| 181 |
% |
| 182 |
% \begin{document} |
| 183 |
% \begin{letter}{Name\\Address\\City} |
| 184 |
% \object % |
| 185 |
% \opening{Dear \toname,} |
| 186 |
% Body text. |
| 187 |
% \closing{Yours truly,} |
| 188 |
% \encl{Enclosures} |
| 189 |
% \cc{Other recipients} |
| 190 |
% \ps{P. S.}{Don't forget\par\hspace{\longindentation}long indentation!} |
| 191 |
% \end{letter} |
| 192 |
% \end{document} |
| 193 |
% \end{verbatim} |
| 194 |
% |
| 195 |
% \begin{figure} |
| 196 |
% \begin{picture}(596,842)(0,0) |
| 197 |
% \fontsize{7}{7}\selectfont |
| 198 |
% \thicklines |
| 199 |
% \put(0,0){\framebox(596,842){}} |
| 200 |
% \thinlines |
| 201 |
% \put(424,758){Our Company} |
| 202 |
% \put(424,746){My name} |
| 203 |
% \put(424,734){My address} |
| 204 |
% \put(424,722){My city} |
| 205 |
% \put(424,710){\tiny My phone} |
| 206 |
% \put(424,698){\tiny My email} |
| 207 |
% \put(72,686){\textsuperscript{\underline{Our Company, My address, My city}}} |
| 208 |
% \put(72,674){Name} |
| 209 |
% \put(72,662){Address} |
| 210 |
% \put(72,650){City} |
| 211 |
% \put(424,614){October 10, 2010} |
| 212 |
% \put(0,554){\line(1,0){18}} |
| 213 |
% \put(108,542){\textbf{About the \textsf{chletter} document class}} |
| 214 |
% \put(108,512){Dear Name,} |
| 215 |
% \put(108,482){Body text.} |
| 216 |
% \put(108,452){Yours truly,} |
| 217 |
% \put(108,400){My signature} |
| 218 |
% \put(108,388){\tiny My position} |
| 219 |
% \put(72,168){\makebox(36,0)[r]{\strut encl~}} |
| 220 |
% \put(108,168){\makebox(0,0)[l]{\strut Enclosures}} |
| 221 |
% \put(72,144){\makebox(36,0)[r]{\strut cc~}} |
| 222 |
% \put(108,144){\makebox(0,0)[l]{\strut Other recipients}} |
| 223 |
% \put(72,120){\makebox(36,0)[r]{\strut P. S.~}} |
| 224 |
% \put(108,120){\makebox(0,0)[l]{\strut Don't forget}} |
| 225 |
% \put(424,108){\makebox(0,0)[l]{\strut |long indentation|!}} |
| 226 |
% \end{picture} |
| 227 |
% \caption{Customized letter output by \textsf{chletter}.} |
| 228 |
% \end{figure} |
| 229 |
% |
| 230 |
% \begin{figure} |
| 231 |
% \begin{picture}(596,842)(0,0) |
| 232 |
% \fontsize{7}{7}\selectfont |
| 233 |
% \thicklines |
| 234 |
% \put(0,0){\framebox(596,842){}} |
| 235 |
% \thinlines |
| 236 |
% \put(72,686){\textsuperscript{\underline{Our Company, My address, My city}}} |
| 237 |
% \put(72,674){Name} |
| 238 |
% \put(72,662){Address} |
| 239 |
% \put(72,650){City} |
| 240 |
% \end{picture} |
| 241 |
% \caption{Cover page output by \textsf{chletter}.} |
| 242 |
% \end{figure}\pagebreak |
| 243 |
% |
| 244 |
% \section{Compatibility} |
| 245 |
% |
| 246 |
% The \textsf{chletter} class is based upon the standard classes of the \LaTeXe{} distribution. |
| 247 |
% Many documents founded on these classes will also compile with \textsf{chletter}. |
| 248 |
% |
| 249 |
% \subsection{With the \LaTeXe{} \textsf{letter} class} |
| 250 |
% |
| 251 |
% The \textsf{chletter} class is `source compatible' (ascending) with the standard |
| 252 |
% \textsf{letter} class. For the most part a file which compiles with \textsf{letter} will |
| 253 |
% recompile straightforward with \textsf{chletter}. There are however some functional |
| 254 |
% differencies, which are described in the following sections. |
| 255 |
% |
| 256 |
% \subsection{With other \LaTeXe{} classes} |
| 257 |
% |
| 258 |
% The \textsf{chletter} class is largely `source compatible' (ascending) with other standard |
| 259 |
% \LaTeXe{} classes. It doesn't implement the sectioning mecanism, but accepts the related |
| 260 |
% commands (|\section| for example). Some commands behave differently (|\maketitle| for |
| 261 |
% example). Obvsiously, any command specific to the \textsf{chletter} class will prevent |
| 262 |
% compilation with other classes. |
| 263 |
% |
| 264 |
% \subsection{With older versions of \textsf{chletter}} |
| 265 |
% |
| 266 |
% The \textsf{chletter} class has been completely overhauled between versions |1.0| and |2.0|. |
| 267 |
% The new code is far more compact and efficient, so is its usage (the commands no more have |
| 268 |
% a plethora of optional arguments). The versions of the class are mostly `source compatible,' |
| 269 |
% given the deprecated commands are not used: |\conc| (replaced by |\object|), |\letterindent|, |
| 270 |
% |\letterskip|, |\fromheight| (replaced by |\titletopheight|, |\toheight| (replaced by |
| 271 |
% |\titlemidheight|) and |\stockheight| (replaced by |\titlebotheight|). To add a |
| 272 |
% `compilability layer', the following code can be inserted in the preamble: |
| 273 |
% \begin{verbatim} |
| 274 |
% \newcommand\conc[2]{\object{#2}} |
| 275 |
% \let\letterindent\parindent |
| 276 |
% \let\letterskip\parskip |
| 277 |
% \let\fromheight\titletopheight |
| 278 |
% \let\toheight\titlemidheight |
| 279 |
% \let\stockheight\titlebotheight |
| 280 |
% \end{verbatim} |
| 281 |
% |
| 282 |
% \subsection{With upcoming versions of \textsf{chletter}} |
| 283 |
% |
| 284 |
% The \textsf{chletter} class is now considered mature and won't evolve further |
| 285 |
% (the code is frozen). The class has been thoroughly tested, and there are no known deficiencies. |
| 286 |
% |
| 287 |
% \subsection{With other packages} |
| 288 |
% |
| 289 |
% The \textsf{chletter} class is generic in the sense that it doesn't rely on anything but |
| 290 |
% the \LaTeXe\ kernel. There is no known command clash with any package.\medskip |
| 291 |
% |
| 292 |
% Please note that a \textsf{chextras} companion package is available (but not mandatory). |
| 293 |
% It simplifies the preparation of documents and letters by loading and setting up font, |
| 294 |
% linguistic and other common packages. It also implements a `glue code' for full source |
| 295 |
% compatibility with older \textsf{chletter v1.0} documents. |
| 296 |
% |
| 297 |
% \section{Configuration} |
| 298 |
% |
| 299 |
% The default values used by the \textsf{chletter} class are balanced for casual writing of |
| 300 |
% simple articles (the class can eventually replace the standard \textsf{article} class) and |
| 301 |
% letters (of course). Nevertheless this class is highly configurable and customizable. |
| 302 |
% |
| 303 |
% \subsection{Class options} |
| 304 |
% |
| 305 |
% The \textsf{chletter} class accepts the options provided by the \LaTeXe\ default classes. |
| 306 |
% These options are: |a4paper|, |a5paper|, |b5paper|, |letterpaper|, |legalpaper|, |
| 307 |
% |executivepaper|, |landscape|, |10pt|, |11pt|, |12pt|, |oneside|, |twoside|, |draft|, |final|, |
| 308 |
% |leqno|, |fleqn|, |onecolumn|, |twocolumn|. The defaults are: |a4paper|, |10pt|, |oneside|, |
| 309 |
% |final|, |onecolumn|. Additionally, the \textsf{chletter} class provides four extra options |
| 310 |
% (described just below) to adjust the general layout of the letters.\bigskip |
| 311 |
% |
| 312 |
% \DescribeMacro{leftwin} |
| 313 |
% \DescribeMacro{leftsig} |
| 314 |
% \DescribeMacro{foldmark} |
| 315 |
% \DescribeMacro{footfill} |
| 316 |
% |leftwin| places the recipient's address to the left of the letterhead rather than to the |
| 317 |
% right. |leftsig| aligns the signature with the left body margin rather than with the right |
| 318 |
% address. |foldmark| puts a thin line to help folding of C6/5 letters. |footfill| adds an |
| 319 |
% infinite glue between the signature and the letter foot. |
| 320 |
% |
| 321 |
% \subsection{Page layout} |
| 322 |
% |
| 323 |
% The default page layout provided by the \textsf{chletter} class, while generic enough, |
| 324 |
% leaves more place for the text than the standard classes do.\bigskip |
| 325 |
% |
| 326 |
% \DescribeMacro{\textwidth} |
| 327 |
% \DescribeMacro{\textheight} |
| 328 |
% \DescribeMacro{\oddsidemargin} |
| 329 |
% \DescribeMacro{\evensidemargin} |
| 330 |
% In a single sided document, the space between the top left corner of the page and the main |
| 331 |
% text is (|1in + 36pt|, |1in + 36pt|); |36pt| are left for the header and the footer, along |
| 332 |
% with |72pt| for the right and bottom margins. For A4 paper, the defaults are the following |
| 333 |
% (values in inches and centimeters are rounded): |
| 334 |
% \begin{verbatim} |
| 335 |
% \textwidth 416pt [5.75in or 14.5cm] |
| 336 |
% \textheight 630pt [8.75in or 22cm] |
| 337 |
% \oddsidemargin 36pt [.5in or 1.25cm] |
| 338 |
% \evensidemargin 0pt |
| 339 |
% \end{verbatim} |
| 340 |
% |
| 341 |
% \DescribeMacro{\titlehead} |
| 342 |
% \DescribeMacro{\titletopheight} |
| 343 |
% \DescribeMacro{\titlemidheight} |
| 344 |
% \DescribeMacro{\titlebotheight} |
| 345 |
% \DescribeMacro{\titlemargin} |
| 346 |
% \DescribeMacro{\titlewidth} |
| 347 |
% \DescribeMacro{\addressmargin} |
| 348 |
% \DescribeMacro{\addresswidth} |
| 349 |
% These values are used for the letterhead layout. They are related to the \TeX\ origin, which |
| 350 |
% is (|1in|, |1in|) from the top left corner of the page. Please remember that |1in = 72.27pt|. |
| 351 |
% |\titlehead| controls the vertical placement of the first baseline of the letterhead. |
| 352 |
% |\titlemargin| and |\titlewidth| control the horizontal position and width of the letterhead. |
| 353 |
% |\addressmargin| is where the title is split in two. |\addresswith| is the width of the right |
| 354 |
% address fields. The title is built by opening a |letter| environment or by calling directly |
| 355 |
% |\maketitle|. For A4 paper, the defaults are the following (values in inches and centimeters |
| 356 |
% are rounded): |
| 357 |
% \begin{verbatim} |
| 358 |
% \titlehead 12pt [.16in or .4cm] |
| 359 |
% \titletopheight 72pt [1in or 2.5cm] |
| 360 |
% \titlemidheight 72pt [1in or 2.5cm] |
| 361 |
% \titlebotheight 72pt [1in or 2.5cm] |
| 362 |
% \titlemargin 0pt |
| 363 |
% \titlewidth 452pt [6.25in or 16 cm] |
| 364 |
% \addressmargin 262pt [3.625in or 9.25cm] |
| 365 |
% \addresswidth 190pt [2.625in or 6.75cm] |
| 366 |
% \end{verbatim} |
| 367 |
% |
| 368 |
% \begin{figure} |
| 369 |
% \begin{picture}(595,842)(0,0) |
| 370 |
% \fontsize{5}{5}\selectfont |
| 371 |
% \thicklines |
| 372 |
% \put(0,0){\framebox(596,842){}} |
| 373 |
% \thinlines |
| 374 |
% \put(74,758){|fromname|} |
| 375 |
% \put(74,746){|fromaddress|} |
| 376 |
% \put(336,758){|date|} |
| 377 |
% \put(336,686){|toname|} |
| 378 |
% \put(336,674){|toaddress|} |
| 379 |
% \multiput(72,770)(0,-72){4}{\line(1,0){452}} |
| 380 |
% \multiput(72,770)(262,0){2}{\line(0,-1){216}} |
| 381 |
% \put(524,770){\line(0,-1){662}} |
| 382 |
% \put(108,554){\line(0,-1){446}} |
| 383 |
% \put(108,108){\line(1,0){416}} |
| 384 |
% \put(110,542){|salutation|} |
| 385 |
% \put(110,518){|text|} |
| 386 |
% \put(110,494){|valediction|} |
| 387 |
% \put(336,446){|signature|} |
| 388 |
% \put(25,788){\vector(-1,0){25}}\put(47,788){\vector(1,0){25}} |
| 389 |
% \put(0,788){\makebox(72,0){|1in|}} |
| 390 |
% \put(170,788){\vector(-1,0){98}}\put(236,788){\vector(1,0){98}} |
| 391 |
% \put(72,788){\makebox(262,0){|addressmargin|}} |
| 392 |
% \put(398,788){\vector(-1,0){64}}\put(460,788){\vector(1,0){64}} |
| 393 |
% \put(334,788){\makebox(190,0){|addresswidth|}} |
| 394 |
% \put(272,806){\vector(-1,0){200}}\put(324,806){\vector(1,0){200}} |
| 395 |
% \put(72,806){\makebox(452,0){|titlewidth|}} |
| 396 |
% \put(560,800){\vector(0,-1){30}}\put(560,812){\vector(0,1){30}} |
| 397 |
% \put(524,800){\makebox(72,12){|1in|}} |
| 398 |
% \put(560,728){\vector(0,-1){30}}\put(560,740){\vector(0,1){30}} |
| 399 |
% \put(524,728){\makebox(72,12){|titletopheight|}} |
| 400 |
% \put(560,656){\vector(0,-1){30}}\put(560,668){\vector(0,1){30}} |
| 401 |
% \put(524,656){\makebox(72,12){|titlemidheight|}} |
| 402 |
% \put(560,584){\vector(0,-1){30}}\put(560,596){\vector(0,1){30}} |
| 403 |
% \put(524,584){\makebox(72,12){|titlebotheight|}} |
| 404 |
% \put(182,320){\vector(-1,0){74}}\put(260,320){\vector(1,0){74}} |
| 405 |
% \put(108,320){\makebox(226,0){|longindentation|}} |
| 406 |
% \put(396,320){\vector(-1,0){62}}\put(462,320){\vector(1,0){62}} |
| 407 |
% \put(334,320){\makebox(190,0){|indentedwidth|}} |
| 408 |
% \put(292,90){\vector(-1,0){184}}\put(340,90){\vector(1,0){184}} |
| 409 |
% \put(108,90){\makebox(416,0){|textwidth|}} |
| 410 |
% \end{picture} |
| 411 |
% \caption{The default \textsf{chletter} layout.} |
| 412 |
% \end{figure} |
| 413 |
% |
| 414 |
% \subsection{The \texttt{letter} environment} |
| 415 |
% |
| 416 |
% The |letter| environment performs some special actions in the scope of writing letters. At |
| 417 |
% its beginning, it generates the letterhead according to its arguments and some previously |
| 418 |
% defined values (see below). The |letter| environment takes in account some global options, |
| 419 |
% for example |twocolumn|... so yes, it is possible to write two column letters! At its |
| 420 |
% closing, the |letter| environment generates a cover page if needed (see below).\bigskip |
| 421 |
% |
| 422 |
% \DescribeEnv{letter} |
| 423 |
% The |letter| environment takes one `mandatory' argument : the recipient's address. The |
| 424 |
% address should be formatted with newline markers (|\\|) as in the standard |letter| class. |
| 425 |
% The argument is `tokenized' into |\toname| and |\toaddress|, which can be used in the |
| 426 |
% letter body. The `token separator' is the first encountered |\\|\,. Please note that an |
| 427 |
% invocation of the |letter| environment without argument will retrieve previously defined |
| 428 |
% |\toname| and |\toaddress| values (empty by default).\medskip |
| 429 |
% |
| 430 |
% There is an optional argument to specify if the letter is to be indented |[i]| or not |[n]| |
| 431 |
% where |[n]| is the default. Please note that this option will alter the formatting of general |
| 432 |
% \LaTeX\ lists and \textsf{chletter} |\ps|, |\cc| and |\encl| commands (see below).\bigskip |
| 433 |
% |
| 434 |
% It is possible to open multiple |letter| environments within a single document. Global |
| 435 |
% values may be shared between each letter (see next page). Please remember that environments |
| 436 |
% involve some locality; for example a length value altered within a |letter| environment |
| 437 |
% will recover its initial value outside of the environment.\medskip |
| 438 |
% |
| 439 |
% An ordinary usage would be: |
| 440 |
% \begin{verbatim} |
| 441 |
% \begin{letter}[i]{Toname\\ToAddressFirstLine\\...\\ToAddressLastLine} |
| 442 |
% ... |
| 443 |
% \end{letter} |
| 444 |
% \end{verbatim} |
| 445 |
% |
| 446 |
% \subsubsection{Cover page} |
| 447 |
% |
| 448 |
% \DescribeMacro{\makelabels} |
| 449 |
% Unlike the standard \textsf{letter} class, this macro doesn't involve a complex mecanism |
| 450 |
% using the |.aux| file to build a labels page (the main reason why the standard class is |
| 451 |
% fragile). Anyway, the \textsf{chletter} class provides a way to generate dedicated cover |
| 452 |
% pages. The |\makelabels| command will set a flag which is checked at the closing of the |
| 453 |
% |letter| environment. The default behaviour is to put the recipient's address and, as |
| 454 |
% requested by the Swiss post, the return address above it, separated by a line. |\makelabels| |
| 455 |
% doesn't take any argument. |
| 456 |
% |
| 457 |
% \subsubsection{Page breaking} |
| 458 |
% |
| 459 |
% These commands are intended to (try to) control the place where a page break occur. |
| 460 |
% They may be used anywhere in a document.\medskip |
| 461 |
% |
| 462 |
% \DescribeMacro{\stopbreaks} |
| 463 |
% |\stopbreaks| will try to prevent all page breaks after its invocation.\bigskip |
| 464 |
% |
| 465 |
% \DescribeMacro{\startbreaks} |
| 466 |
% |\startbreaks| cancels the behaviour of |\stopbreaks|. |
| 467 |
% |
| 468 |
% \subsubsection{Letter counter} |
| 469 |
% |
| 470 |
% \DescribeMacro{\theletter} |
| 471 |
% At each new |letter| environment opened, this counter is incremented. Please note that |
| 472 |
% |thepage| and |thefootnote| counters are reset at the same time. |
| 473 |
% |
| 474 |
% \subsubsection{Letter markup} |
| 475 |
% |
| 476 |
% The commands described here are usually put in the preamble, but they may be called from |
| 477 |
% anywhere in the document. They store their argument in associated values which will be |
| 478 |
% retrieved by the |letter| environment, for example to build the letterhead. They are common |
| 479 |
% to a bunch of letter classes.\medskip |
| 480 |
% |
| 481 |
% \DescribeMacro{\name} |
| 482 |
% \DescribeMacro{\address} |
| 483 |
% \DescribeMacro{\location} |
| 484 |
% \DescribeMacro{\telephone} |
| 485 |
% \DescribeMacro{\return} |
| 486 |
% The values stored by these commands are respectively: |\fromname|, |\fromaddress|, |
| 487 |
% |\fromlocation|, |\telephonenum| and |\returnaddress|. |\telephone| and |\return| will |
| 488 |
% format their output (respectively small text and underlined superscript text). Please note |
| 489 |
% that |\return| is not defined in the standard \textsf{letter} class. These values are used |
| 490 |
% to build the expeditor's address fields: |
| 491 |
% \begin{verbatim} |
| 492 |
% \name{My Name} |
| 493 |
% \address{My Street\\My City} |
| 494 |
% \return{My Return Address} |
| 495 |
% \end{verbatim} |
| 496 |
% |
| 497 |
% \DescribeMacro{\date} |
| 498 |
% The date field (stored by kernel |\@date| value) can be customized by, for example: |
| 499 |
% \begin{verbatim} |
| 500 |
% \date{Here, \today} |
| 501 |
% \end{verbatim} |
| 502 |
% |
| 503 |
% \DescribeMacro{\signature} |
| 504 |
% The value stored by this macro is |\fromsig|, which is used by the |\closing| command to |
| 505 |
% output the signature field (see below).\bigskip |
| 506 |
% |
| 507 |
% Please note that |\fromname| and |\fromsig| values default to |\@author| (initialized by |
| 508 |
% \LaTeX, modified by the standard |\author| command). The |\@date| field defaults to |
| 509 |
% |\today|, which will be localized by a linguistic package (\textsf{babel} or |
| 510 |
% \textsf{polyglossia}).\medskip |
| 511 |
% |
| 512 |
% To prevent any value from appearing, it has to be emptied by the corresponding command, |
| 513 |
% for example: |\date{}|.\medskip |
| 514 |
% |
| 515 |
% These macros can contain anything that fits in a |\parbox|, including some special stuff |
| 516 |
% (using dedicated packages): |\location{\includegraphics{mylogo.pdf}}|\medskip |
| 517 |
% |
| 518 |
% Any of the values stored by these commands can be retrieved anywhere in the letter (given |
| 519 |
% the corresponding value is accessible, |\@author| and |\@date| requiring a |\makeatletter|): |
| 520 |
% |I, \fromname, declare...| |
| 521 |
% |
| 522 |
% \subsubsection{Letter body} |
| 523 |
% |
| 524 |
% These commands are mostly used within a letter environment, but they may be called at |
| 525 |
% document level for special purpose. Their foremost intend is formatting, although they are |
| 526 |
% able to retrieve or store their value at will.\medskip |
| 527 |
% |
| 528 |
% \DescribeMacro{\object} |
| 529 |
% This command will simply output the text given in its argument, followed by a |\bigskip|. |
| 530 |
% The |\object| command stores its argument in |\@title| and actually outputs it. If the |
| 531 |
% argument is either empty or null, then the |\object| command will output the value of |
| 532 |
% |\@title| previously set by a |\title| command. Remember that the default |\@title| value |
| 533 |
% is an error (set by the \LaTeX\ kernel): |
| 534 |
% \begin{verbatim} |
| 535 |
% \title{Answer to your previous letter} |
| 536 |
% ... |
| 537 |
% \begin{document} |
| 538 |
% \begin{letter}{...} |
| 539 |
% \object |
| 540 |
% \end{verbatim} |
| 541 |
% |
| 542 |
% Please note that the following code is functionally equivalent (the |\@title| value set by |
| 543 |
% both methods is global (available outside of the current letter environment): |
| 544 |
% \begin{verbatim} |
| 545 |
% \begin{document} |
| 546 |
% \begin{letter}{...} |
| 547 |
% \object{Answer to your previous letter} |
| 548 |
% \end{verbatim} |
| 549 |
% |
| 550 |
% \DescribeMacro{\opening} |
| 551 |
% This command outputs the text given in its argument (adding a |\medskip| vertical space |
| 552 |
% after it): |
| 553 |
% \begin{verbatim} |
| 554 |
% \opening{Dear Sir,} |
| 555 |
% \end{verbatim} |
| 556 |
% |
| 557 |
% It stores its argument in |\salutation| for further use. |\salutation| can also be defined |
| 558 |
% previously and be recalled by an |\opening| with an empty or null argument: |
| 559 |
% \begin{verbatim} |
| 560 |
% \renewcommand{\salutation}{Dear Sir,} |
| 561 |
% ... |
| 562 |
% \begin{document} |
| 563 |
% \begin{letter}{...} |
| 564 |
% \opening |
| 565 |
% \end{verbatim} |
| 566 |
% |
| 567 |
% \DescribeMacro{\closing} |
| 568 |
% This command issues a |\medskip|, outputs the text given in its argument and generates |
| 569 |
% the signature field, which should provide its own vertical spacing (by default it is |
| 570 |
% |4\bigskip| above the signature and |2\bigskip| below): |
| 571 |
% \begin{verbatim} |
| 572 |
% \closing{Yours sincerely,} |
| 573 |
% \end{verbatim} |
| 574 |
% |
| 575 |
% The signature field placement can be altered by invocation of |leftsig| as a |
| 576 |
% class option. The signature field will contain the value defined by: |
| 577 |
% \begin{itemize} |
| 578 |
% \item[---] |\fromsig| (set by |\signature{...}|) in the first place; |
| 579 |
% \item[---] |\fromname| (set by |\name{...}|) if no |\signature| given; |
| 580 |
% \item[---] |\@author| (set by |\author{...}|) if no |\name| given (eventually empty). |
| 581 |
% \end{itemize} |
| 582 |
% |
| 583 |
% The |\closing| macro stores its argument in |\valediction| for later use. As usual, the |
| 584 |
% |\valediction| value can also be defined before and be output by an invocation of |
| 585 |
% |\closing| with an empty or null argument: |
| 586 |
% \begin{verbatim} |
| 587 |
% \renewcommand{\valediction}{Yours sincerely,} |
| 588 |
% \begin{document} |
| 589 |
% \begin{letter}{...} |
| 590 |
% ... |
| 591 |
% \closing{} |
| 592 |
% \end{verbatim} |
| 593 |
% |
| 594 |
% Depending on the class option |footfill|, an extra vertical glue will be added after the |
| 595 |
% signature, in order to balance the appearance of the letter foot. |footfill| pushes the |
| 596 |
% letter foot text against the document footer (usually the the letter foot is filled by the |
| 597 |
% |\ps|, |\encl| and |\cc| commands). Please note that for a weaker balance a |\vfil| could |
| 598 |
% be manually added after the |\closing| command.\bigskip |
| 599 |
% |
| 600 |
% Be aware of the locality of macros. |\salutation| and |\valediction| values are local to |
| 601 |
% the current |letter| environment if defined within the environment (usually by |\opening| |
| 602 |
% and |\closing| commands), global otherwise. Please look at the \LaTeX\ documentation for |
| 603 |
% further explanations. |
| 604 |
% |
| 605 |
% \subsubsection{Letter foot} |
| 606 |
% |
| 607 |
% Some formatting commands are intended to be used at the end of the letter (although they |
| 608 |
% can be used anywhere in the document, even outside of a letter environment---just as any |
| 609 |
% formatting command provided by the \textsf{chletter} class).\bigskip |
| 610 |
% |
| 611 |
% \DescribeMacro{\ps} |
| 612 |
% This command is generic in the sense that it is nothing but a shortcut for a \LaTeX\ list. |
| 613 |
% It takes two mandatory arguments. The text contained in the arguments is output as an |
| 614 |
% indented paragraph. The indentation margin is set by the standard \LaTeX\ |\leftmargin| |
| 615 |
% value (which defaults to |18pt| at document level, |0pt| after the |\closing| of a default |
| 616 |
% letter and |36pt| after the |\closing| of an indented |[i]| letter). Here is an example use: |
| 617 |
% \begin{verbatim} |
| 618 |
% \ps{P.S.}{This is a post scriptum} |
| 619 |
% \end{verbatim} |
| 620 |
% |
| 621 |
% \DescribeMacro{\encl} |
| 622 |
% This command is a shortcut for |\ps{\enclname}{...}| and takes one mandatory argument. |
| 623 |
% Regular use is: |
| 624 |
% \begin{verbatim} |
| 625 |
% \encl{1. Your previous letter\\2. My Curriculum Vit\ae} |
| 626 |
% \end{verbatim} |
| 627 |
% |
| 628 |
% \DescribeMacro{\cc} |
| 629 |
% This command is a shortcut for |\ps{\ccname}{...}| and takes one mandatory argument. |
| 630 |
% Regular use is: |
| 631 |
% \begin{verbatim} |
| 632 |
% \cc{1. First other recipient\\2. Second other recipient} |
| 633 |
% \end{verbatim} |
| 634 |
% |
| 635 |
% |\enclname| and |\ccname| are set to |{encl}|, respectively |{cc}| by default. |
| 636 |
% They will be adjusted by a linguistic package (\textsf{babel} or \textsf{polyglossia}). |
| 637 |
% |
| 638 |
% \subsection{Sectioning} |
| 639 |
% |
| 640 |
% \DescribeMacro{section} |
| 641 |
% \DescribeMacro{subsection} |
| 642 |
% \DescribeMacro{subsubsection} |
| 643 |
% \DescribeMacro{paragraph} |
| 644 |
% \DescribeMacro{subparagraph} |
| 645 |
% The class is intended to output short documents (mainly letters!), so the sectioning mecanism |
| 646 |
% is minimalist (no index nor table of contents generation). The stock sectioning commands are |
| 647 |
% here: |section|, |subsection|, |subsubsection|, |paragraph|, |subparagraph|, but are merely |
| 648 |
% formating commands which select some text style and vertical space. As usual, these commands |
| 649 |
% take one mandatory argument. |
| 650 |
% |
| 651 |
% \subsection{Environments} |
| 652 |
% |
| 653 |
% \DescribeMacro{description} |
| 654 |
% \DescribeMacro{verse} |
| 655 |
% \DescribeMacro{quotation} |
| 656 |
% \DescribeMacro{quote} |
| 657 |
% These environments are available and behave as ordinary in the \textsf{chletter} class. |
| 658 |
% The default list values (at document level) are:|\labelsep6pt|, |\labelwidth12pt|, |
| 659 |
% |\leftmargin18pt|. Please note that |\labelwidth| and |\labelsep| are redefined by a |
| 660 |
% |\closing| command to |\leftmargin2\parindent|, |\labelwidth3\labelwidth|. |
| 661 |
% |
| 662 |
% \subsection{Paragraphing} |
| 663 |
% |
| 664 |
% \DescribeMacro{\parindent} |
| 665 |
% \DescribeMacro{\parskip} |
| 666 |
%|\parindent| and |\parskip| respectively default to |18pt| and |9pt| at document level. If |
| 667 |
% a |letter| environment is called with the |[i]| option, |\parindent| is kept at its previous |
| 668 |
% value. With the default |[n]| option, |\parindent| is locally set to |0| (zero).\bigskip |
| 669 |
% |
| 670 |
% Please note that the actual value of |\parindent| while a |\closing| command is issued |
| 671 |
% will alter the layout of \LaTeX\ lists (in fact |\ps|, |\encl| and |\cc| are lists): the |
| 672 |
% |leftmargin| value (which defaults to |18pt|) is then defined as three times the value of |
| 673 |
% |\parindent| (thus |0pt| for a default letter and |36pt| for an indented letter). |
| 674 |
% |
| 675 |
% \StopEventually |
| 676 |
% |
| 677 |
% \section{Implementation} |
| 678 |
% |
| 679 |
% The \textsf{chletter} code is fairly compact (less than 300 lines) and highly optimized |
| 680 |
% (it relies on \TeX\ primitives wherever practical), dropping the obsolete legacy (namely |
| 681 |
% \LaTeX\ 2.09) for the sake of efficiency.\bigskip |
| 682 |
% |
| 683 |
% Appart from the options described until now, it is possible (and allowed!) to `hook' into |
| 684 |
% certain pieces of the class code. This enables a degree of customization and extensibility. |
| 685 |
% It would be quite straightforward to add, for example, mail merging features through a |
| 686 |
% dedicated package. |
| 687 |
% |
| 688 |
% \subsection{Initial code} |
| 689 |
% |
| 690 |
% \begin{macrocode} |
| 691 |
%<*chletter.cls> |
| 692 |
% \end{macrocode} |
| 693 |
% \begin{macrocode} |
| 694 |
\NeedsTeXFormat{LaTeX2e} |
| 695 |
\ProvidesClass{chletter}[2010/10/10 v2.0 Swiss letter document class] |
| 696 |
% \end{macrocode} |
| 697 |
% |
| 698 |
% \subsubsection{Declaring options} |
| 699 |
% |
| 700 |
% \begin{macro}{leftwin} |
| 701 |
% \begin{macro}{leftsig} |
| 702 |
% \begin{macro}{foldmark} |
| 703 |
% \begin{macro}{footfill} |
| 704 |
% There are four specific options: |leftwin|, |leftsig|, |foldmark| and |footfill|, |
| 705 |
% corresponding to the format of the letter (left envelope window, left signature, folding |
| 706 |
% mark for C6/5 covers, letter foot balancing). The default is to not set any of these options. |
| 707 |
% All other options are borrowed from the standard classes. |
| 708 |
% |
| 709 |
% \begin{macrocode} |
| 710 |
\DeclareOption{a4paper}{\paperheight297mm\paperwidth210mm} |
| 711 |
\DeclareOption{a5paper}{\paperheight210mm\paperwidth148mm} |
| 712 |
\DeclareOption{b5paper}{\paperheight250mm\paperwidth176mm} |
| 713 |
\DeclareOption{letterpaper}{\paperheight11in\paperwidth8.5in} |
| 714 |
\DeclareOption{legalpaper}{\paperheight14in\paperwidth8.5in} |
| 715 |
\DeclareOption{executivepaper}{\paperheight10.5in\paperwidth7.25in} |
| 716 |
\DeclareOption{landscape} |
| 717 |
{\@tempdima\paperheight\paperheight\paperwidth\paperwidth\@tempdima} |
| 718 |
\DeclareOption{10pt}{\def\@ptsize{0}} |
| 719 |
\DeclareOption{11pt}{\def\@ptsize{1}} |
| 720 |
\DeclareOption{12pt}{\def\@ptsize{2}} |
| 721 |
\DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse} |
| 722 |
\DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue} |
| 723 |
\DeclareOption{draft}{\overfullrule5\p@} |
| 724 |
\DeclareOption{final}{\overfullrule\z@} |
| 725 |
\DeclareOption{leqno}{\input{leqno.clo}} |
| 726 |
\DeclareOption{fleqn}{\input{fleqn.clo}} |
| 727 |
\DeclareOption{onecolumn}{\@twocolumnfalse\@leftsigfalse} |
| 728 |
\DeclareOption{twocolumn}{\@twocolumntrue\@leftsigtrue} |
| 729 |
\DeclareOption{leftwin}{\@leftwintrue} |
| 730 |
\DeclareOption{leftsig}{\@leftsigtrue} |
| 731 |
\DeclareOption{foldmark}{\@foldmarktrue} |
| 732 |
\DeclareOption{footfill}{\@footfilltrue} |
| 733 |
% \end{macrocode} |
| 734 |
% \end{macro} |
| 735 |
% \end{macro} |
| 736 |
% \end{macro} |
| 737 |
% \end{macro} |
| 738 |
% |
| 739 |
% These booleans will be evaluated at the end of the class code. They are |false| until the |
| 740 |
% associated option is selected. |
| 741 |
% |
| 742 |
% \begin{macrocode} |
| 743 |
\newif\if@leftwin |
| 744 |
\newif\if@leftsig |
| 745 |
\newif\if@foldmark |
| 746 |
\newif\if@footfill |
| 747 |
% \end{macrocode} |
| 748 |
% |
| 749 |
% \subsubsection{Executing options} |
| 750 |
% |
| 751 |
% Swiss letters are written on A4 paper. Default font size is |10pt|, like in other standard |
| 752 |
% classes. Other switches are set at kernel level. |
| 753 |
% |
| 754 |
% \begin{macrocode} |
| 755 |
\ExecuteOptions{a4paper,10pt} |
| 756 |
\ProcessOptions\relax |
| 757 |
% \end{macrocode} |
| 758 |
% |
| 759 |
% Loading this |.clo| file leads to a lot of redundancy. But we want compatibility. |
| 760 |
% |
| 761 |
% \begin{macrocode} |
| 762 |
\input{size1\@ptsize.clo} |
| 763 |
% \end{macrocode} |
| 764 |
% |
| 765 |
% \subsubsection{Loading packages} |
| 766 |
% |
| 767 |
% The \textsf{chletter} class does not load additional packages. |
| 768 |
% |
| 769 |
% \subsection{Document layout} |
| 770 |
% |
| 771 |
% This class tries to provide quite a universal layout, not only suitable for letters, but |
| 772 |
% also for other types of short documents. There are anyway some values specific to letters, |
| 773 |
% principally the letterhead values. |
| 774 |
% |
| 775 |
% \subsubsection{Letter counter} |
| 776 |
% |
| 777 |
% \begin{macro}{theletter} |
| 778 |
% Each time a letter is created by a |letter| environment, this counter is incremented. |
| 779 |
% |
| 780 |
% \begin{macrocode} |
| 781 |
\newcounter{letter} |
| 782 |
% \end{macrocode} |
| 783 |
% \end{macro} |
| 784 |
% |
| 785 |
% \subsubsection{Letter dimensions} |
| 786 |
% |
| 787 |
% These dimensions concern the letterhead, where |\titlehead| is the absolute position of |
| 788 |
% its first baseline. The title matter is vertically stacked in three strips, each one with |
| 789 |
% its own height. |\titlemargin| is the absolute position of the letterhead margin, to which |
| 790 |
% the letterhead matter is relative. |\longindentation| and |\indentedwidth| are to be used |
| 791 |
% within a |letter| environment and will be computed on the fly by |\maketitle|, along with |
| 792 |
% |\addressmargin| or |\addresswidth|. |
| 793 |
% |
| 794 |
% \begin{macrocode} |
| 795 |
\newdimen\titlehead |
| 796 |
\newdimen\titletopheight |
| 797 |
\newdimen\titlemidheight |
| 798 |
\newdimen\titlebotheight |
| 799 |
% \end{macrocode} |
| 800 |
% \begin{macrocode} |
| 801 |
\newdimen\titlemargin |
| 802 |
\newdimen\titlewidth |
| 803 |
\newdimen\addressmargin |
| 804 |
\newdimen\addresswidth |
| 805 |
% \end{macrocode} |
| 806 |
% \begin{macrocode} |
| 807 |
\newdimen\longindentation |
| 808 |
\newdimen\indentedwidth |
| 809 |
% \end{macrocode} |
| 810 |
% |
| 811 |
% \subsubsection{Paragraphing} |
| 812 |
% |
| 813 |
% We prefer inter paragraph skips in a letter. Swiss letters are rarely indented but the |
| 814 |
% |letter| environement offers an option to do so. Indentation is still enabled at |
| 815 |
% document level. Setting |\normallineskip| to zero prevents layout inconsistencies. |
| 816 |
% |
| 817 |
% \begin{macrocode} |
| 818 |
\parskip9\p@ |
| 819 |
\parindent18\p@ |
| 820 |
% \end{macrocode} |
| 821 |
% \begin{macrocode} |
| 822 |
\normallineskip\z@ |
| 823 |
% \end{macrocode} |
| 824 |
% |
| 825 |
% \subsubsection{Page layout} |
| 826 |
% |
| 827 |
% All dimensions are measured from a point |1in| from the top left corner of the page. |
| 828 |
% Remember that |1in = 72.27pt = 2.54cm| = |72bp| and |1pt| = |65536sp|.\medskip |
| 829 |
% |
| 830 |
% Regarding the header, |12pt| (more or less one line) are reserved, plus |24pt| spacing |
| 831 |
% before the main text. The footer space is |36pt|, including body to footer gap. |
| 832 |
% |
| 833 |
% \begin{macrocode} |
| 834 |
\headheight12\p@ |
| 835 |
\headsep24\p@ |
| 836 |
% \end{macrocode} |
| 837 |
% \begin{macrocode} |
| 838 |
\footskip36\p@ |
| 839 |
% \end{macrocode} |
| 840 |
% |
| 841 |
% Regarding the text dimensions, we remove approximately |1in| at each side, plus |36pt| |
| 842 |
% horizontally (corresponding to the margin, see below) and |72pt| vertically |
| 843 |
% (corresponding to the header and footer, see above). The trick in the definition |
| 844 |
% of |\textwidth| and |\textheight| is to have integer values for A4 paper. |
| 845 |
% |
| 846 |
% \begin{macrocode} |
| 847 |
\textwidth\paperwidth |
| 848 |
\advance\textwidth-9536004sp |
| 849 |
\titlewidth\textwidth |
| 850 |
\advance\textwidth-36\p@ |
| 851 |
% \end{macrocode} |
| 852 |
% \begin{macrocode} |
| 853 |
\textheight\paperheight |
| 854 |
\advance\textheight-14093310sp |
| 855 |
% \end{macrocode} |
| 856 |
% |
| 857 |
% The left margin of the odd pages is set to |1in + 36pt| (more or less |4cm|). Sizes of the |
| 858 |
% marginal notes are adapted to quite small margins. Top margin is set to zero. |
| 859 |
% |
| 860 |
% \begin{macrocode} |
| 861 |
\oddsidemargin36\p@ |
| 862 |
\evensidemargin\z@ |
| 863 |
% \end{macrocode} |
| 864 |
% \begin{macrocode} |
| 865 |
\marginparwidth48\p@ |
| 866 |
\marginparsep6\p@ |
| 867 |
\marginparpush6\p@ |
| 868 |
% \end{macrocode} |
| 869 |
% \begin{macrocode} |
| 870 |
\topmargin\z@ |
| 871 |
% \end{macrocode} |
| 872 |
% |
| 873 |
% The footnotes values are somewhat larger than the default. |
| 874 |
% |
| 875 |
% \begin{macrocode} |
| 876 |
\footnotesep12\p@ |
| 877 |
\skip\footins12\p@ |
| 878 |
% \end{macrocode} |
| 879 |
% |
| 880 |
% \subsubsection{Title layout} |
| 881 |
% |
| 882 |
% What we call `title' here is the letterhead, with the addresses fields and all this kind of |
| 883 |
% stuff. Title is always placed on an odd page at an absolute position. |
| 884 |
% |
| 885 |
% \begin{macro}{\titlehead} |
| 886 |
% The vertical position of the title is controled by the |\titlehead| value (by analogy with |
| 887 |
% |\headheight| which sets the first baseline of the running head). Please note that |
| 888 |
% letterhead position is not altered by anything but |\titlehead| (for example it is |
| 889 |
% independant from the |\topmargin| value). |
| 890 |
% |
| 891 |
% \begin{macrocode} |
| 892 |
\titlehead12\p@ |
| 893 |
% \end{macrocode} |
| 894 |
% \end{macro} |
| 895 |
% |
| 896 |
% \begin{macro}{\titletopheight} |
| 897 |
% \begin{macro}{\titlemidheight} |
| 898 |
% \begin{macro}{\titlebotheight} |
| 899 |
% The title (letterhead or cover) field is divided into three strips, each one containing |
| 900 |
% some material. For example, the first field could contain the sender's address, the second |
| 901 |
% one the recipient's address and the third one the letter's date. Obviously the total |
| 902 |
% letterhead height is the sum of these three values (|216pt| by default). |
| 903 |
% |
| 904 |
% \begin{macrocode} |
| 905 |
\titletopheight72\p@ |
| 906 |
\titlemidheight72\p@ |
| 907 |
\titlebotheight72\p@ |
| 908 |
% \end{macrocode} |
| 909 |
% \end{macro} |
| 910 |
% \end{macro} |
| 911 |
% \end{macro} |
| 912 |
% |
| 913 |
% \begin{macro}{\titlemargin} |
| 914 |
% \begin{macro}{\titlewidth} |
| 915 |
% The horizontal position of the title is controlled by |\titlemargin| which is set to |0pt| |
| 916 |
% by default. |\titlewidth| has already been set as |\textwidth + 36pt|. |
| 917 |
% \end{macro} |
| 918 |
% \end{macro} |
| 919 |
% |
| 920 |
% \begin{macro}{\addressmargin} |
| 921 |
% \begin{macro}{\addresswidth} |
| 922 |
% These values are to be computed on the fly by |\maketitle| depending on user input and |
| 923 |
% actual |\titlewidth| value. If |\addressmargin| is defined by the user, then the formula |
| 924 |
% |\titlewidth = \addressmargin + \addresswidth| will be applied to |\addresswidth|, otherwise |
| 925 |
% it will be applied to |\addressmargin|. |
| 926 |
% |
| 927 |
% \begin{macrocode} |
| 928 |
\addresswidth190\p@ |
| 929 |
% \end{macrocode} |
| 930 |
% \end{macro} |
| 931 |
% \end{macro} |
| 932 |
% |
| 933 |
% \subsubsection{Page styles} |
| 934 |
% |
| 935 |
% The default page styles are here, but their layout differ from the standard classes. |
| 936 |
% |
| 937 |
% \begin{macrocode} |
| 938 |
\def\ps@plain% |
| 939 |
{\let\@oddhead\@empty |
| 940 |
\let\@evenhead\@empty |
| 941 |
\def\@oddfoot{\footnotesize\hfil\pagename~\thepage} |
| 942 |
\def\@evenfoot{\footnotesize\pagename~\thepage\hfil}} |
| 943 |
% \end{macrocode} |
| 944 |
% \begin{macrocode} |
| 945 |
\def\ps@firstpage% |
| 946 |
{\let\@oddhead\@empty |
| 947 |
\let\@evenhead\@empty |
| 948 |
\def\@oddfoot{\footnotesize\leftmark\hfil\rightmark} |
| 949 |
\def\@evenfoot{\footnotesize\rightmark\hfil\leftmark}} |
| 950 |
% \end{macrocode} |
| 951 |
% \begin{macrocode} |
| 952 |
\def\ps@headings% |
| 953 |
{\def\@oddhead{\footnotesize\headtoname~\toname\hfil\pagename~\thepage} |
| 954 |
\def\@evenhead{\footnotesize\pagename~\thepage\hfil} |
| 955 |
\def\@oddfoot{\footnotesize\leftmark\hfil\rightmark} |
| 956 |
\def\@evenfoot{\footnotesize\rightmark\hfil\leftmark}} |
| 957 |
% \end{macrocode} |
| 958 |
% \begin{macrocode} |
| 959 |
\def\ps@myheadings% |
| 960 |
{\def\@oddhead{\footnotesize\leftmark\hfil\rightmark} |
| 961 |
\def\@evenhead{\footnotesize\rightmark\hfil\leftmark} |
| 962 |
\def\@oddfoot{\footnotesize\hfil\pagename~\thepage} |
| 963 |
\def\@evenfoot{\footnotesize\pagename~\thepage\hfil}} |
| 964 |
% \end{macrocode} |
| 965 |
% |
| 966 |
% \subsection{Document markup} |
| 967 |
% |
| 968 |
% These user commands are common to all usual letter classes. |
| 969 |
% |
| 970 |
% \subsubsection{Global declarations} |
| 971 |
% |
| 972 |
% \begin{macro}{\name} |
| 973 |
% \begin{macro}{\signature} |
| 974 |
% \begin{macro}{\address} |
| 975 |
% \begin{macro}{\location} |
| 976 |
% \begin{macro}{\telephone} |
| 977 |
% \begin{macro}{\return} |
| 978 |
% These macros work exactly the same way as with the standard \textsf{letter} class. They |
| 979 |
% don't output anything, but just define an associated word containing their argument. The |
| 980 |
% layout of |\telephonenum| (small text) and |\returnaddress| (underlined small text) is |
| 981 |
% specific to this class and somewhat tricky, intended to manage the best possible appearance. |
| 982 |
% Please note that the default contents of the associated words will be defined later. |
| 983 |
% |
| 984 |
% \begin{macrocode} |
| 985 |
\long\def\name#1{\def\fromname{#1}} |
| 986 |
\long\def\signature#1{\def\fromsig{#1}} |
| 987 |
\long\def\location#1{\def\fromlocation{#1}} |
| 988 |
\long\def\address#1{\def\fromaddress{#1}} |
| 989 |
\long\def\telephone#1{\def\telephonenum{\vtop{\footnotesize#1}}} |
| 990 |
\long\def\return#1{\def\returnaddress{\underbar{\textsuperscript{#1}}}} |
| 991 |
% \end{macrocode} |
| 992 |
% \end{macro} |
| 993 |
% \end{macro} |
| 994 |
% \end{macro} |
| 995 |
% \end{macro} |
| 996 |
% \end{macro} |
| 997 |
% \end{macro} |
| 998 |
% |
| 999 |
% \begin{macro}{\makelabels} |
| 1000 |
% \begin{macro}{\startlabels} |
| 1001 |
% The |\makelabels| command defines a |\startlabels| macro, which causes cover pages to be |
| 1002 |
% added at the end of each letter. See next page for more information. |
| 1003 |
% |
| 1004 |
% \begin{macrocode} |
| 1005 |
\def\makelabels% |
| 1006 |
{\def\startlabels% |
| 1007 |
{\let\titletopmatter\@empty |
| 1008 |
\let\titlebotmatter\@empty |
| 1009 |
\let\foldmark\@empty}} |
| 1010 |
% \end{macrocode} |
| 1011 |
% \end{macro} |
| 1012 |
% \end{macro} |
| 1013 |
% |
| 1014 |
% \begin{macro}{\maketitle} |
| 1015 |
% This artful piece of code actually outputs the letterhead stuff. |\maketitle| is always |
| 1016 |
% called at the opening of the |letter| environment, and at its closing if the |\startlabels| |
| 1017 |
% flag is not |\@null|. It outputs the content of |\titletopmatter|, |\titlemidmatter|, |
| 1018 |
% |\titlebotmatter| in three horizontal strips stacked vertically. These strips have respective |
| 1019 |
% heights of |\titletopheight|, |\titlemidheight|, |\titlebotheight| and are always placed on |
| 1020 |
% a new odd page at an absolute position given by |\titlehead| and |\titlemargin|. The width of |
| 1021 |
% the strips is given by |\titlewidth|. |\longindentation| and |\indentedwidth| are computed |
| 1022 |
% here, so are |\addressmargin| and |\addresswidth| which are used by |\splitfield|. Some |
| 1023 |
% dedicated mecanism deals with the |\twoside| and |\twocolumns| cases (the letterhead is |
| 1024 |
% always issued on a clear odd page), executing the |\@maketitle| auxiliary macro. The |
| 1025 |
% |\foldmark| macro is called at the end of the letterhead. |
| 1026 |
% |
| 1027 |
% \begin{macrocode} |
| 1028 |
\def\maketitle% |
| 1029 |
{\ifdim\addressmargin=\z@ |
| 1030 |
\addressmargin\titlewidth |
| 1031 |
\advance\addressmargin-\addresswidth |
| 1032 |
\else |
| 1033 |
\addresswidth\titlewidth |
| 1034 |
\advance\addresswidth-\addressmargin\fi |
| 1035 |
\longindentation\titlemargin |
| 1036 |
\advance\longindentation-\oddsidemargin |
| 1037 |
\clearpage |
| 1038 |
\if@twoside\ifodd\c@page |
| 1039 |
\else\thispagestyle{empty}\hb@xt@\z@{}\clearpage\fi\fi |
| 1040 |
\if@twocolumn\twocolumn[\@maketitle\leavevmode\vskip-\topskip] |
| 1041 |
\else\vbox{\@parboxrestore\@maketitle}\vskip-\parskip\fi |
| 1042 |
\advance\longindentation\addressmargin |
| 1043 |
\indentedwidth\textwidth |
| 1044 |
\advance\indentedwidth-\longindentation} |
| 1045 |
% \end{macrocode} |
| 1046 |
% \begin{macrocode} |
| 1047 |
\def\@maketitle% |
| 1048 |
{\vskip-\topmargin\vskip-\baselineskip |
| 1049 |
\vskip\titlehead\vskip-\headheight\vskip-\headsep |
| 1050 |
\leftskip\longindentation\rightskip\textwidth |
| 1051 |
\advance\rightskip-\paperwidth |
| 1052 |
\advance\rightskip-\titlemargin |
| 1053 |
\parbox[t][\titletopheight]{\titlewidth} |
| 1054 |
{\hb@xt@\z@{}\titletopmatter\strut}\par |
| 1055 |
\parbox[t][\titlemidheight]{\titlewidth} |
| 1056 |
{\hb@xt@\z@{}\titlemidmatter\strut}\par |
| 1057 |
\parbox[t][\titlebotheight]{\titlewidth} |
| 1058 |
{\hb@xt@\z@{}\titlebotmatter\strut}\par |
| 1059 |
\leftskip-\oddsidemargin\advance\leftskip-1in |
| 1060 |
\parbox[b][\z@]{\paperwidth}{\foldmark}\par} |
| 1061 |
% \end{macrocode} |
| 1062 |
% \end{macro} |
| 1063 |
% |
| 1064 |
% \subsubsection{The \texttt{letter} environment} |
| 1065 |
% |
| 1066 |
% \begin{environment}{letter} |
| 1067 |
% The |letter| environment is the foremost part of a letter. It takes the recipient's address |
| 1068 |
% as mandatory argument and |[i]| (default is |[n]|) as optional argument to set the |
| 1069 |
% |\parindent| value within the group represented by the environment. The first part of the |
| 1070 |
% code manages these arguments. It is sturdier than the standard \LaTeX\ |\newenvironment| in |
| 1071 |
% the sense that, for example, the mandatory argument is not... mandatory! At its opening, |
| 1072 |
% the |letter| environment tokenizes its mandatory argument into two fields, |\toname| and |
| 1073 |
% |\toaddress| (token separator is the first encountered |\\|). If the argument is null |
| 1074 |
% (|\begin{letter}{}| or |\begin{letter}|), these values won't be modified and thus may be |
| 1075 |
% defined before the opening of the environment, hence the easy mail merging extension. Then |
| 1076 |
% |\maketitle| is called to output the letterhead (the first page of the letter is always |
| 1077 |
% issued on a clear odd page, leaving a blank page if necessary in two sided documents). The |
| 1078 |
% |\pagestyle| of the first letter page is set to |firstpage| and the |letter| counter is |
| 1079 |
% incremented, while the |page| and |footnote| counters are reset. |
| 1080 |
% |
| 1081 |
% \begin{macrocode} |
| 1082 |
\def\letter{\futurelet\@let@token\ch@let}\def\ch@let% |
| 1083 |
{\ifx\@let@token[\expandafter\@letter\else\expandafter\ch@lea\fi} |
| 1084 |
\long\def\ch@lea#1 {\@letter[n]{#1} } |
| 1085 |
% \end{macrocode} |
| 1086 |
% \begin{macrocode} |
| 1087 |
\long\def\@letter[#1]#2 |
| 1088 |
{\ifx#1n\parindent\z@\fi\ifx\@null#2\else\@processto#2\\@@@ |
| 1089 |
\ifx\@empty\toaddress\else\@processto#2@@@\fi\fi |
| 1090 |
\maketitle\thispagestyle{firstpage} |
| 1091 |
\global\c@page\@ne\global\c@footnote\z@\global\advance\c@letter\@ne} |
| 1092 |
% \end{macrocode} |
| 1093 |
% \begin{macrocode} |
| 1094 |
\long\def\@processto#1\\#2@@@{\def\toname{#1}\def\toaddress{#2}} |
| 1095 |
% \end{macrocode} |
| 1096 |
% |
| 1097 |
% At its closing, the |letter| environment removes the last skip, then checks for the |
| 1098 |
% definition of |\startlabels|. If undefined, nothing but a |\clearpage| happens. If defined, |
| 1099 |
% its contents is executed (usually a redefinition of |\titletopmatter|, |\titlemidmatter| and |
| 1100 |
% |\titlebotmatter|) and the |\maketitle| macro is called, taking the |\twoside| case in |
| 1101 |
% account (which may produce additional empty pages), then issuing a new page (intended to be |
| 1102 |
% a cover) followed by a |\clearpage|. |
| 1103 |
% |
| 1104 |
% \begin{macrocode} |
| 1105 |
\def\endletter{\removelastskip\ifx\startlabels\undefined\else% |
| 1106 |
\startlabels\maketitle\thispagestyle{empty}\fi\clearpage} |
| 1107 |
% \end{macrocode} |
| 1108 |
% \end{environment} |
| 1109 |
% |
| 1110 |
% \subsubsection{Page breaking control} |
| 1111 |
% |
| 1112 |
% \begin{macro}{\stopbreaks} |
| 1113 |
% \begin{macro}{\startbreaks} |
| 1114 |
% When the command |\stopbreaks| is issued no page breaks should occur until |\startbreaks| is |
| 1115 |
% called. These macros are used by the |\closing| command. |
| 1116 |
% |
| 1117 |
% \begin{macrocode} |
| 1118 |
\def\stopbreaks{\interlinepenalty\@M\def\par{\@@par\nobreak}} |
| 1119 |
\def\startbreaks{\interlinepenalty100\def\par{\@@par}} |
| 1120 |
% \end{macrocode} |
| 1121 |
% \end{macro} |
| 1122 |
% \end{macro} |
| 1123 |
% |
| 1124 |
% \subsubsection{The generic letter commands} |
| 1125 |
% |
| 1126 |
% \begin{macro}{\opening} |
| 1127 |
% Unlike the standard \textsf{letter} class, the |\opening| command doesn't generate the |
| 1128 |
% letterhead (this is done at the opening of the |letter| environment or by a direct call of |
| 1129 |
% |\maketitle|). The content of |\salutation| is either locally filled with the mandatory |
| 1130 |
% argument or recalled if the argument is null (either |\opening{}| or |\opening| without |
| 1131 |
% argument, look at the neat argument handling code), then output. The |\medskipamount| value |
| 1132 |
% controls the vertical spacing. |
| 1133 |
% |
| 1134 |
% \begin{macrocode} |
| 1135 |
\def\opening{\futurelet\@let@token\ch@ope}\def\ch@ope% |
| 1136 |
{\ifx\@let@token\bgroup\expandafter\ch@opa\else\expandafter\@opening\fi} |
| 1137 |
\def\ch@opa#1{\ifx\@null#1\else\def\salutation{#1}\fi\@opening} |
| 1138 |
% \end{macrocode} |
| 1139 |
% \begin{macrocode} |
| 1140 |
\def\@opening{\par\salutation\par\medskip} |
| 1141 |
% \end{macrocode} |
| 1142 |
% \end{macro} |
| 1143 |
% |
| 1144 |
% \begin{macro}{\closing} |
| 1145 |
% The |\closing| command is to be called at the end of the letter body. It generates the |
| 1146 |
% valediction and the signature. Much like the |\opening| command, its argument either fills |
| 1147 |
% or retrieve a value, here |\valediction|. A |\medskip| is issued, page breaking is prevented |
| 1148 |
% and |\closingmatter| is added. |\closingmatter| is defined according to the class option |
| 1149 |
% |leftsig| and could be completely customized. |
| 1150 |
% |
| 1151 |
% \begin{macrocode} |
| 1152 |
\def\closing{\futurelet\@let@token\ch@clo}\def\ch@clo% |
| 1153 |
{\ifx\@let@token\bgroup\expandafter\ch@cla\else\expandafter\@closing\fi} |
| 1154 |
\def\ch@cla#1{\ifx\@null#1\else\def\valediction{#1}\fi\@closing} |
| 1155 |
% \end{macrocode} |
| 1156 |
% \begin{macrocode} |
| 1157 |
\def\@closing{\par\medskip\stopbreaks\valediction |
| 1158 |
\samepage\par\closingmatter\par\startbreaks} |
| 1159 |
% \end{macrocode} |
| 1160 |
% \end{macro} |
| 1161 |
% |
| 1162 |
% \begin{macro}{\object} |
| 1163 |
% The |\object| macro outputs the content of |\@title|, either previously defined by a |
| 1164 |
% |\title| command or filled by a non empty argument (see |\opening| for an explanation of |
| 1165 |
% this behaviour). The |\bigskipamount| value controls the vertical spacing. Styling is left |
| 1166 |
% to user's preference, for example: |\object{\textbf{...}}|. |
| 1167 |
% |
| 1168 |
% \begin{macrocode} |
| 1169 |
\def\object{\futurelet\@let@token\ch@obj}\def\ch@obj% |
| 1170 |
{\ifx\@let@token\bgroup\expandafter\ch@oba\else\expandafter\@object\fi} |
| 1171 |
\def\ch@oba#1{\ifx\@null#1\else\title{#1}\fi\@object} |
| 1172 |
% \end{macrocode} |
| 1173 |
% \begin{macrocode} |
| 1174 |
\def\@object{\noindent\@title\par\bigskip} |
| 1175 |
% \end{macrocode} |
| 1176 |
% \end{macro} |
| 1177 |
% |
| 1178 |
% \begin{macro}{\ps} |
| 1179 |
% \begin{macro}{\cc} |
| 1180 |
% \begin{macro}{\encl} |
| 1181 |
% |\ps| is a shortcut for a simple \LaTeX\ list, with its first argument as item label and |
| 1182 |
% its second argument as a item contents. |\cc| and |\encl| are further shortcuts, using |
| 1183 |
% respectively |\ccname| and |\enclname| as label. There is a trick involved here: the list |
| 1184 |
% behaviour is altered after a |\closing| command (see |\closingmatter|); by these means the |
| 1185 |
% letter foot benefit from the powerful list feature while the lists defaults are kept at |
| 1186 |
% convenient values for use within the letter body.\medskip |
| 1187 |
% |
| 1188 |
% \begin{macrocode} |
| 1189 |
\long\def\ps#1#2{\begin{list}{}{}\item[#1]#2\end{list}} |
| 1190 |
\long\def\cc#1{\ps{\ccname}{#1}} |
| 1191 |
\long\def\encl#1{\ps{\enclname}{#1}} |
| 1192 |
% \end{macrocode} |
| 1193 |
% \end{macro} |
| 1194 |
% \end{macro} |
| 1195 |
% \end{macro} |
| 1196 |
% |
| 1197 |
% \subsubsection{Sections and paragraphs} |
| 1198 |
% |
| 1199 |
% Some sectioning commands are defined, but they are merely formatting commands. So there is |
| 1200 |
% no section numbering nor index and table of contents generation. |
| 1201 |
% |
| 1202 |
% \begin{macrocode} |
| 1203 |
\long\def\subparagraph#1{\par\textbf{#1}\hskip\labelsep} |
| 1204 |
\long\def\paragraph#1{\par\noindent\textbf{#1}\hskip\labelsep} |
| 1205 |
\long\def\subsubsection#1{\par\noindent\textbf{#1}\par\nobreak} |
| 1206 |
\long\def\subsection#1{\smallskip\subsubsection{#1}} |
| 1207 |
\long\def\section#1{\medskip\subsubsection{#1}} |
| 1208 |
% \end{macrocode} |
| 1209 |
% |
| 1210 |
% \subsubsection{Environments} |
| 1211 |
% |
| 1212 |
% This code is borrowed from the standard classes. Please look at the \LaTeXe\ documentation |
| 1213 |
% for further explanation. Remember that all these environments are lists which will be |
| 1214 |
% formatted according following the general lists parameters. |
| 1215 |
% |
| 1216 |
% \begin{macrocode} |
| 1217 |
\def\description |
| 1218 |
{\list{} |
| 1219 |
{\labelwidth\z@ |
| 1220 |
\itemindent-\leftmargin |
| 1221 |
\let\makelabel\descriptionlabel}}\def\enddescription{\endlist} |
| 1222 |
% \end{macrocode} |
| 1223 |
% \begin{macrocode} |
| 1224 |
\def\descriptionlabel#1{\hskip\labelsep\textbf{#1}} |
| 1225 |
% \end{macrocode} |
| 1226 |
% \begin{macrocode} |
| 1227 |
\def\verse |
| 1228 |
{\let\\\@centercr |
| 1229 |
\list{} |
| 1230 |
{\itemsep\z@ |
| 1231 |
\itemindent-\parindent |
| 1232 |
\listparindent\itemindent |
| 1233 |
\rightmargin\leftmargin |
| 1234 |
\advance\leftmargin\parindent} |
| 1235 |
\item\relax}\def\endverse{\endlist} |
| 1236 |
% \end{macrocode} |
| 1237 |
% \begin{macrocode} |
| 1238 |
\def\quotation |
| 1239 |
{\list{} |
| 1240 |
{\listparindent\parindent |
| 1241 |
\itemindent\listparindent |
| 1242 |
\rightmargin\leftmargin} |
| 1243 |
\item\relax}\def\endquotation{\endlist} |
| 1244 |
% \end{macrocode} |
| 1245 |
% \begin{macrocode} |
| 1246 |
\def\quote |
| 1247 |
{\list{} |
| 1248 |
{\rightmargin\leftmargin} |
| 1249 |
\item\relax}\def\endquote{\endlist} |
| 1250 |
% \end{macrocode} |
| 1251 |
% |
| 1252 |
% \subsubsection{Lists} |
| 1253 |
% |
| 1254 |
% This code is borrowed from the standard classes. Please look at the \LaTeXe\ documentation |
| 1255 |
% for further explanation. Please also note that list nesting is limited to four levels |
| 1256 |
% (seems to be enough for a letter). |
| 1257 |
% |
| 1258 |
% \begin{macrocode} |
| 1259 |
\def\@listI{} |
| 1260 |
\let\@listi\@listI |
| 1261 |
\let\@listii\@listI |
| 1262 |
\let\@listiii\@listI |
| 1263 |
\let\@listiv\@listI |
| 1264 |
% \end{macrocode} |
| 1265 |
% \begin{macrocode} |
| 1266 |
\def\theenumi{\@arabic\c@enumi} |
| 1267 |
\def\theenumii{\@alph\c@enumii} |
| 1268 |
\def\theenumiii{\@roman\c@enumiii} |
| 1269 |
\def\theenumiv{\@Alph\c@enumiv} |
| 1270 |
% \end{macrocode} |
| 1271 |
% \begin{macrocode} |
| 1272 |
\def\labelenumi{\theenumi.} |
| 1273 |
\def\labelenumii{(\theenumii)} |
| 1274 |
\def\labelenumiii{\theenumiii.} |
| 1275 |
\def\labelenumiv{\theenumiv.} |
| 1276 |
% \end{macrocode} |
| 1277 |
% \begin{macrocode} |
| 1278 |
\def\p@enumii{\theenumi} |
| 1279 |
\def\p@enumiii{\theenumi(\theenumii)} |
| 1280 |
\def\p@enumiv{\p@enumiii\theenumiii} |
| 1281 |
% \end{macrocode} |
| 1282 |
% \begin{macrocode} |
| 1283 |
\def\labelitemi{\textbullet} |
| 1284 |
\def\labelitemii{\textbf{\textendash}} |
| 1285 |
\def\labelitemiii{\textasteriskcentered} |
| 1286 |
\def\labelitemiv{\textperiodcentered} |
| 1287 |
% \end{macrocode} |
| 1288 |
% |
| 1289 |
% \subsection{Default settings} |
| 1290 |
% |
| 1291 |
% As in other classes, some values are set here rather than at kernel level. The values used |
| 1292 |
% by the \textsf{chletter} class are as generic as possible. |
| 1293 |
% |
| 1294 |
% \subsubsection{Lists} |
| 1295 |
% |
| 1296 |
% \begin{macro}{\labelsep} |
| 1297 |
% \begin{macro}{\labelwith} |
| 1298 |
% \begin{macro}{\leftmargin} |
| 1299 |
% These default values are defined at document level and altered by |\closingmatter| |
| 1300 |
% (see next page) in the following manner: |\labelwidth3\labelsep| (usually |18pt|), |
| 1301 |
% |\leftmargin2\parindent| (|36pt| in an indented letter, |0pt| in a default letter). |
| 1302 |
% |
| 1303 |
% \begin{macrocode} |
| 1304 |
\labelsep6\p@\labelwidth12\p@\leftmargin18\p@ |
| 1305 |
% \end{macrocode} |
| 1306 |
% \begin{macrocode} |
| 1307 |
\topsep\z@\partopsep3\p@\itemsep\z@\parsep3\p@ |
| 1308 |
% \end{macrocode} |
| 1309 |
% \end{macro} |
| 1310 |
% \end{macro} |
| 1311 |
% \end{macro} |
| 1312 |
% |
| 1313 |
% \subsubsection{Environments} |
| 1314 |
% |
| 1315 |
% Exactly as in the standard classes. |
| 1316 |
% \begin{macrocode} |
| 1317 |
\arraycolsep5\p@ |
| 1318 |
\tabcolsep6\p@ |
| 1319 |
\arrayrulewidth.4\p@ |
| 1320 |
\doublerulesep2\p@ |
| 1321 |
\tabbingsep\labelsep |
| 1322 |
\skip\@mpfootins=\skip\footins |
| 1323 |
\def\theequation{\@arabic\c@equation} |
| 1324 |
% \end{macrocode} |
| 1325 |
% |
| 1326 |
% \subsubsection{Framed boxes} |
| 1327 |
% |
| 1328 |
% \begin{macro}{\fboxsep} |
| 1329 |
% \begin{macro}{\fboxrule} |
| 1330 |
% Apart from their ordinary application, the values defined here are used by the default |
| 1331 |
% |\foldmark| macro defined by the |foldmark| class option. |
| 1332 |
% |
| 1333 |
% \begin{macrocode} |
| 1334 |
\fboxsep3\p@ |
| 1335 |
\fboxrule.4\p@ |
| 1336 |
% \end{macrocode} |
| 1337 |
% \end{macro} |
| 1338 |
% \end{macro} |
| 1339 |
% |
| 1340 |
% \subsubsection{Footnotes} |
| 1341 |
% |
| 1342 |
% Light is right! This definition is minimalist, at the same time sensible. |
| 1343 |
% \begin{macrocode} |
| 1344 |
\long\def\@makefntext#1{\noindent\hb@xt@\z@{\hss\@makefnmark}#1} |
| 1345 |
% \end{macrocode} |
| 1346 |
% |
| 1347 |
% \subsubsection{Letter} |
| 1348 |
% |
| 1349 |
% Some specific letter values are initialized here. |
| 1350 |
% |
| 1351 |
% \begin{macro}{\fromname} |
| 1352 |
% \begin{macro}{\fromsig} |
| 1353 |
% \begin{macro}{\fromaddress} |
| 1354 |
% \begin{macro}{\fromlocation} |
| 1355 |
% \begin{macro}{\telephonenum} |
| 1356 |
% \begin{macro}{\returnaddress} |
| 1357 |
% |\fromname| is not empty by default, so is |\fromsig|: they contain the |\@author| value, |
| 1358 |
% which is defined at kernel level to output nothing but a warning message (no author given). |
| 1359 |
% |\@author| will be modified by the \LaTeX\ |\author| command. |\fromlocation| and |
| 1360 |
% |\fromaddress| are somewhat redundant, but they may be used for special purpose. |
| 1361 |
% |\returnaddress| should also output nothing by default, but it has to leave an empty line, |
| 1362 |
% hence the |\null| trick (actually an empty |\hbox|). |
| 1363 |
% |
| 1364 |
% \begin{macrocode} |
| 1365 |
\def\fromname{\@author} |
| 1366 |
\def\fromsig{\@author} |
| 1367 |
\let\fromlocation\@empty |
| 1368 |
\let\fromaddress\@empty |
| 1369 |
\let\telephonenum\@empty |
| 1370 |
\def\returnaddress{\null} |
| 1371 |
% \end{macrocode} |
| 1372 |
% \end{macro} |
| 1373 |
% \end{macro} |
| 1374 |
% \end{macro} |
| 1375 |
% \end{macro} |
| 1376 |
% \end{macro} |
| 1377 |
% \end{macro} |
| 1378 |
% |
| 1379 |
% \begin{macro}{\toname} |
| 1380 |
% \begin{macro}{\toaddress} |
| 1381 |
% These values retrieved or adjusted at the opening of a |letter| environment. |
| 1382 |
% They are initialized here to prevent an error in certain condition. |
| 1383 |
% |
| 1384 |
% \begin{macrocode} |
| 1385 |
\let\toname\@empty |
| 1386 |
\let\toaddress\@empty |
| 1387 |
% \end{macrocode} |
| 1388 |
% \end{macro} |
| 1389 |
% \end{macro} |
| 1390 |
% |
| 1391 |
% \begin{macro}{\salutation} |
| 1392 |
% \begin{macro}{\valediction} |
| 1393 |
% These values are retrieved or adjusted respectively by the |\opening| and |\closing| |
| 1394 |
% commands. They are initialized here to prevent an error in certain condition. |
| 1395 |
% |
| 1396 |
% \begin{macrocode} |
| 1397 |
\let\salutation\@empty |
| 1398 |
\let\valediction\@empty |
| 1399 |
% \end{macrocode} |
| 1400 |
% \end{macro} |
| 1401 |
% \end{macro} |
| 1402 |
% \subsubsection{Words} |
| 1403 |
% |
| 1404 |
% \begin{macro}{\ccname} |
| 1405 |
% \begin{macro}{\enclname} |
| 1406 |
% \begin{macro}{\pagename} |
| 1407 |
% \begin{macro}{\headtoname} |
| 1408 |
% These words are common to the common \textsf{letter} classes. They will be adjusted by the |
| 1409 |
% linguistic packages (\textsf{babel} or \textsf{polyglossia}). |\ccname| and |\enclname| are |
| 1410 |
% used respectively by the |\cc| and |\encl| macros; while |\pagename| and |\headtoname| are |
| 1411 |
% used within |\pagestyle| layouts and some additional packages. |
| 1412 |
% |
| 1413 |
% \begin{macrocode} |
| 1414 |
\def\ccname{cc} |
| 1415 |
\def\enclname{encl} |
| 1416 |
\def\pagename{Page} |
| 1417 |
\def\headtoname{To} |
| 1418 |
% \end{macrocode} |
| 1419 |
% \end{macro} |
| 1420 |
% \end{macro} |
| 1421 |
% \end{macro} |
| 1422 |
% \end{macro} |
| 1423 |
% |
| 1424 |
% \subsubsection{Date} |
| 1425 |
% |
| 1426 |
% \begin{macro}{\today} |
| 1427 |
% The |\@date| field, which appears in the letterhead, defaults to |\today|. The |\today| |
| 1428 |
% value will be adjusted by the linguistic packages (\textsf{babel} or \textsf{polyglossia}). |
| 1429 |
% |
| 1430 |
% \begin{macrocode} |
| 1431 |
\def\today |
| 1432 |
{\ifcase\month\or |
| 1433 |
January\or February\or March\or April\or May\or June\or |
| 1434 |
July\or August\or September\or October\or November\or December\fi |
| 1435 |
\space\number\day, \number\year} |
| 1436 |
% \end{macrocode} |
| 1437 |
% \end{macro} |
| 1438 |
% |
| 1439 |
% \subsubsection{Two column mode} |
| 1440 |
% |
| 1441 |
% \begin{macro}{\columnsep} |
| 1442 |
% This is tricky! The idea is to align the columns with the addresses. In a default |
| 1443 |
% (A4) letter, the second column will align with the recipient's address and the date. |
| 1444 |
% |
| 1445 |
% \begin{macrocode} |
| 1446 |
\columnsep36\p@ |
| 1447 |
% \end{macrocode} |
| 1448 |
% \end{macro} |
| 1449 |
% |
| 1450 |
% \subsubsection{The page style} |
| 1451 |
% |
| 1452 |
% We have |\pagetyle{plain}| pages in this document class (except the letterhead |
| 1453 |
% page which has |\thispagestyle{firspage}|). We use arabic page numbers. |
| 1454 |
% |
| 1455 |
% \begin{macrocode} |
| 1456 |
\pagestyle{plain} |
| 1457 |
\pagenumbering{arabic} |
| 1458 |
% \end{macrocode} |
| 1459 |
% |
| 1460 |
% \subsection{Later initializations} |
| 1461 |
% |
| 1462 |
% This code handles the class options |leftwin|, |leftsig|, |foldmark|, |footfill| and |
| 1463 |
% |twocolumn| (retrieved by the associated booleans). It defines the default layout of the |
| 1464 |
% letter and would be very interesting for those who wish to completely customize the letter |
| 1465 |
% appearance by redefining the relevant macros. |
| 1466 |
% |
| 1467 |
% \subsubsection{Letterhead layout} |
| 1468 |
% |
| 1469 |
% \begin{macro}{\titletopmatter} |
| 1470 |
% \begin{macro}{\titlemidmatter} |
| 1471 |
% \begin{macro}{\titlebotmatter} |
| 1472 |
% The default layout of the letterhead is defined here, taking in account the class option |
| 1473 |
% |leftwin|. |\titletopmatter|, |\titlemidmatter| and |\titlebotmatter| are three strips of |
| 1474 |
% |\titletopheight|, |\titlemidheight| and |\titlebotheight| respective heights. Please note |
| 1475 |
% the usage of |\splitfield{...}{...}| which cuts a strip in two columns of |\adressmargin| |
| 1476 |
% and |\addresswidth| respective widths. |
| 1477 |
% |
| 1478 |
% \begin{macrocode} |
| 1479 |
\if@leftwin |
| 1480 |
\def\titletopmatter% |
| 1481 |
{\splitfield |
| 1482 |
{}{\fromlocation\par\fromname\par\fromaddress\par\telephonenum}} |
| 1483 |
\def\titlemidmatter% |
| 1484 |
{\returnaddress\par\toname\par\toaddress} |
| 1485 |
\def\titlebotmatter% |
| 1486 |
{\splitfield |
| 1487 |
{}{\@date}} |
| 1488 |
% \end{macrocode} |
| 1489 |
% \begin{macrocode} |
| 1490 |
\else |
| 1491 |
\def\titletopmatter% |
| 1492 |
{\splitfield |
| 1493 |
{\fromlocation\par\fromname\par\fromaddress\par\telephonenum}{\@date}} |
| 1494 |
\def\titlemidmatter% |
| 1495 |
{\splitfield |
| 1496 |
{}{\returnaddress\par\toname\par\toaddress}} |
| 1497 |
\def\titlebotmatter% |
| 1498 |
{}\fi |
| 1499 |
% \end{macrocode} |
| 1500 |
% \end{macro} |
| 1501 |
% \end{macro} |
| 1502 |
% \end{macro} |
| 1503 |
% |
| 1504 |
% \begin{macro}{\splitfield} |
| 1505 |
% The letterhead is divided in three vertically stacked strips of |\titlewidth| width, named |
| 1506 |
% respectively |\titletopmatter|, |titlemidmatter| and |titlebotmatter| (see above). The |
| 1507 |
% purpose of this command is to divide a strip in two columns, the first one of |\addressmargin| |
| 1508 |
% width, the second one of |\addresswidth| width (computed on the fly by |\maketitle|, see |
| 1509 |
% above). The letterhead may contain graphics (a logo for example), so we have to cope with |
| 1510 |
% the relative vertical placement of text and imported pictures, hence the |\hbox| and |\strut| |
| 1511 |
% in the definitions of the parboxes. |
| 1512 |
% |
| 1513 |
% \begin{macrocode} |
| 1514 |
\long\def\splitfield#1#2% |
| 1515 |
{\parbox[b][\baselineskip][t]{\addressmargin}{\hb@xt@\z@{}{#1}\strut}% |
| 1516 |
\parbox[b][\baselineskip][t]{\addresswidth}{\hb@xt@\z@{}{#2}\strut}} |
| 1517 |
% \end{macrocode} |
| 1518 |
% \end{macro} |
| 1519 |
% |
| 1520 |
% \subsubsection{Signature layout} |
| 1521 |
% |
| 1522 |
% \begin{macro}{\closingmatter} |
| 1523 |
% |\closingmatter| is output by the |\closing| command and can contain any piece of text or |
| 1524 |
% code. |\fooftill| is an extra glue for better letter foot balancing (see below). Please |
| 1525 |
% note the crafty use of the |\ps| command. Also remember that |\leftmargin| and |\labelwidth| |
| 1526 |
% values are changed by this |\closingmatter|. |
| 1527 |
% |
| 1528 |
% \begin{macrocode} |
| 1529 |
\if@leftsig |
| 1530 |
\def\closingmatter% |
| 1531 |
{\leftmargin2\parindent |
| 1532 |
\vskip4\bigskipamount |
| 1533 |
\ps{}{\fromsig} |
| 1534 |
\vskip2\bigskipamount plus\footfill |
| 1535 |
\labelwidth3\labelwidth |
| 1536 |
\advance\labelwidth-\labelsep} |
| 1537 |
% \end{macrocode} |
| 1538 |
% \begin{macrocode} |
| 1539 |
\else |
| 1540 |
\def\closingmatter% |
| 1541 |
{\leftmargin\longindentation |
| 1542 |
\vskip4\bigskipamount |
| 1543 |
\ps{}{\fromsig} |
| 1544 |
\vskip2\bigskipamount plus\footfill |
| 1545 |
\leftmargin2\parindent |
| 1546 |
\labelwidth3\labelwidth |
| 1547 |
\advance\labelwidth-\labelsep}\fi |
| 1548 |
% \end{macrocode} |
| 1549 |
% \end{macro} |
| 1550 |
% |
| 1551 |
% \subsubsection{Fold mark} |
| 1552 |
% |
| 1553 |
% \begin{macro}{\foldmark} |
| 1554 |
% The |foldmark| class option alters the |\foldmark| macro, which causes a line to be added |
| 1555 |
% between the letterhead and the main text. Default is |\@empty|. |
| 1556 |
% |
| 1557 |
% \begin{macrocode} |
| 1558 |
\if@foldmark\def\foldmark{\hrule\@width6\fboxsep\@height\fboxrule} |
| 1559 |
\else\let\foldmark\@empty\fi |
| 1560 |
% \end{macrocode} |
| 1561 |
% \end{macro} |
| 1562 |
% |
| 1563 |
% \subsubsection{Letter footer} |
| 1564 |
% |
| 1565 |
% \begin{macro}{\footfill} |
| 1566 |
% A conditionnal definition of |\footfill| will alter the layout of |\closingmatter| |
| 1567 |
% (see above), adding an extra vertical glue after the signature. Default is |\@empty|. |
| 1568 |
% |
| 1569 |
% \begin{macrocode} |
| 1570 |
\if@footfill\def\footfill{1fill} |
| 1571 |
\else\let\footfill\z@\fi |
| 1572 |
% \end{macrocode} |
| 1573 |
% \end{macro} |
| 1574 |
% |
| 1575 |
% \subsubsection{Two column mode} |
| 1576 |
% |
| 1577 |
% The column separator (|\columnsep|) is initialized earlier in the class code. |
| 1578 |
% Please note that in one column mode we reverse the position of the margin paragraphs. |
| 1579 |
% |
| 1580 |
% \begin{macrocode} |
| 1581 |
\if@twocolumn\twocolumn\sloppy |
| 1582 |
\else\onecolumn\reversemarginpar\fi |
| 1583 |
% \end{macrocode} |
| 1584 |
% |
| 1585 |
% \subsection{Legacy} |
| 1586 |
% |
| 1587 |
% Unfortunately some widely spread packages still relie on this! |
| 1588 |
% |
| 1589 |
% \begin{macrocode} |
| 1590 |
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} |
| 1591 |
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} |
| 1592 |
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} |
| 1593 |
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} |
| 1594 |
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} |
| 1595 |
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\relax} |
| 1596 |
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\relax} |
| 1597 |
% \end{macrocode} |
| 1598 |
% |
| 1599 |
% \begin{macrocode} |
| 1600 |
%</chletter.cls> |
| 1601 |
% \end{macrocode} |
| 1602 |
% |
| 1603 |
% \pagebreak |
| 1604 |
% |
| 1605 |
% \section{Letter template} |
| 1606 |
% |
| 1607 |
% \setcounter{CodelineNo}{0} |
| 1608 |
% |
| 1609 |
% The following \LaTeX\ document is intended to be used as a template. It will also |
| 1610 |
% compile with the standard \textsf{letter} class and the older version of the |
| 1611 |
% \textsf{chletter} class.\bigskip |
| 1612 |
% |
| 1613 |
% Please note that the \textsf{chextras} companion package will simplify the preparation of |
| 1614 |
% Swiss documents by setting up linguistic packages, font encoding and document layout. |
| 1615 |
% Look at \textsf{chextras} documentation for further information. |
| 1616 |
% |
| 1617 |
% \begin{macrocode} |
| 1618 |
%<*chlettmp.tex> |
| 1619 |
% \end{macrocode} |
| 1620 |
% |
| 1621 |
% \begin{macrocode} |
| 1622 |
\documentclass{chletter} |
| 1623 |
|
| 1624 |
%%\usepackage[english,black]{chextras} |
| 1625 |
|
| 1626 |
\author{My name} |
| 1627 |
\address{My address\\My City} |
| 1628 |
\telephone{My phone\\My email} |
| 1629 |
\date{My location, \today} |
| 1630 |
|
| 1631 |
\begin{document} |
| 1632 |
\begin{letter}{Name\\Address\\City} |
| 1633 |
|
| 1634 |
\opening{Dear \toname,} |
| 1635 |
|
| 1636 |
Body text. |
| 1637 |
|
| 1638 |
\closing{Yours truly,} |
| 1639 |
|
| 1640 |
\encl{Enclosures} |
| 1641 |
\cc{Other recipients} |
| 1642 |
|
| 1643 |
\end{letter} |
| 1644 |
\end{document} |
| 1645 |
% \end{macrocode} |
| 1646 |
% \begin{macrocode} |
| 1647 |
%</chlettmp.tex> |
| 1648 |
% \end{macrocode} |
| 1649 |
% |
| 1650 |
% \pagebreak |
| 1651 |
% |
| 1652 |
% \Finale |
| 1653 |
% \PrintIndex |
| 1654 |
\endinput |
| 1655 |
|
| 1656 |
|