28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

360 Chapter 16. Letters<br />

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{letter}}<br />

\ProcessOptions<br />

\LoadClass[a4paper]{letter}<br />

This completes the preliminaries. So far, we have read in the st<strong>and</strong>ard<br />

letter class, along with the package ifthen, <strong>and</strong> defined a new option<br />

that is not present in the original class. Otherwise, all options <strong>and</strong><br />

functions are unchanged, so far.<br />

We now define the new ‘name’ comm<strong>and</strong>s <strong>to</strong> contain language-sensitive<br />

text, such as ‘Subject’, which are not provided for in the basic class. The<br />

actual definitions will be executed by two comm<strong>and</strong>s \englishnames <strong>and</strong><br />

\germannames.<br />

\newcomm<strong>and</strong>{\englishnames}{%<br />

\newcomm<strong>and</strong>{\yrefname}{\textsl{Your Ref.}}<br />

\newcomm<strong>and</strong>{\ymailname}{\textsl{Your letter from}}<br />

\newcomm<strong>and</strong>{\myrefname}{\textsl{Our Ref.}}<br />

\newcomm<strong>and</strong>{\subjectname}{\textsl{Subject}}<br />

\newcomm<strong>and</strong>{\telephonename}{Telephone}<br />

\newcomm<strong>and</strong>{\stationname}{Train Station}<br />

\newcomm<strong>and</strong>{\germanname}{GERMANY}<br />

\newcomm<strong>and</strong>{\telcode}{[49]-5556-401}<br />

\newcomm<strong>and</strong>{\postcode}{D--37191}<br />

}<br />

\newcomm<strong>and</strong>{\germannames}{%<br />

. . . . . . . . . . . . . . . . . . . . .<br />

\newcomm<strong>and</strong>{\telcode}{(05556) 401}<br />

\newcomm<strong>and</strong>{\postcode}{37191}<br />

}<br />

\ifthenelse{\boolean{@german}}<br />

{\RequirePackage{german}\germannames}{\englishnames}<br />

The last lines test whether the flag @german has been set (by the option<br />

german), <strong>and</strong> if so, the package german is loaded, <strong>and</strong> the German names<br />

are defined, otherwise the English names. The package german already<br />

translates the st<strong>and</strong>ard names comm<strong>and</strong>s \<strong>to</strong>name, \head<strong>to</strong>name, <strong>and</strong><br />

\pagename, so they are not included in \germannames.<br />

Having settled the language problem, we now attack those comm<strong>and</strong>s<br />

for entering extra information in the header. Each of these s<strong>to</strong>res its<br />

text argument in an internal comm<strong>and</strong> for future use. First the internal<br />

s<strong>to</strong>rage comm<strong>and</strong>s must be created.<br />

\newcomm<strong>and</strong>{\@yref}{} \newcomm<strong>and</strong>{\@ymail}{}<br />

\newcomm<strong>and</strong>{\@myref}{} \newcomm<strong>and</strong>{\@subject}{}<br />

\newcomm<strong>and</strong>{\@internet}{}<br />

\newcomm<strong>and</strong>{\yref}[1]{\renewcomm<strong>and</strong>{\@yref}{\yrefname: #1}}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!