3.4 ⁑Writing a Letter Using the isodoc Class
The isodoc class [21] differs from the classes described in the
previous sections in that instead of encasing the letter within the
body of an environment (such as letter
or
newlfm
) the letter is created using a command:
As with the other classes, a document may contain multiple letters. The optional argument ⟨recipient options⟩ is a key=value list of options to apply to this letter. The other argument ⟨contents⟩ contains the contents of the letter. General options can be set using:
Again, ⟨options⟩ is a key=value list. There are a lot of options available, so this section will only cover common settings. For full details, see the isodoc user guide [21]
You don't need to use babel with isodoc. Instead you
can set the language using the language
key. As of the
time of writing, available language options are:
en-GB
(default), en-US
, fr-FR
,
de-DE
, nl-NL
, nl-BE
, it-IT
,
es-ES
, ca-ES
, nb-NO
and sr-RS
.
The hyphen is optional so, for example, enGB
is the same as
en-GB
. For example, to switch to US English:
\setupdocument{language=en-US}
Options that set information about the sender include:
company
- Company name (or sender's name if a private document).
logoaddress
- Sender's address. If omitted it will be constructed from the following:
who
- Contact person's name.
street
- Sender's street.
city
- Sender's city.
zip
- Sender's zip or postcode.
countrycode
- Sender's country code.
country
- Sender's country name.
areacode
- Sender's area code.
cityzip
- Place the zip code after the city.
foreign
- If this key is used, the country name
will be added to the address, the zip code will be
prefixed with the country code and the telephone numbers will be
prefixed with the area code. (This isn't a boolean key, but if
you want to generate multiple letters with a mixture of national and
international addresses, you can switch this setting on and off
using
\foreigntrue
and\foreignfalse
.)
to
- The recipient's address. You can use \\ to break the lines.
return
- Include the return address in the address window.
returnaddress
- If the return address is too long for the address window, this key can be used to set a shorter version for the window.
Options that set the header information include:
yourletter
- If this letter is a reply to a letter from the recipient, this value is the date of the recipient's letter.
yourref
- The recipient's reference if this is a reply.
ourref
- The sender's reference.
date
- The date of this letter, which must
be in the form ⟨yyyy⟩-⟨mm⟩-⟨dd⟩
or ⟨yyyy⟩⟨mm⟩⟨dd⟩. This will be converted into
the format governed by the language setting (as specified by the
language
key described above). For example:\setupdocument{date={2014-03-01}}
indicates the first day of March, 2014.
forcedate
- May be used instead of the previous
key to force the data to be in a specific format. For example:
\setupdocument{forcedate={Sat 1st March, 2014}}
subject
- The subject of this letter.
Options that set the opening and closing information include:
opening
- The opening salutation.
closing
- The closing salutation.
signature
- The name of the sender as it should appear below the closing salutation.
enclosures
- Lists any enclosures accompanying the letter (may include \\ to start a newline).
copyto
- A “CC” list. Again this may include \\.
autograph
- This option governs the area between
the closing text and the signature text. The value may be one of:
- 0
- No space between the closing and signature text (default);
- 1
- Leaves a space between the closing and signature text for a handwritten signature;
- 2-9
- Inserts one of eight autograph images (see the isodoc manual [21] for further details).
Options that set the footer information include:
footer
- Enables the footer information.
phoneprefix
- Sets the phone prefix (defaults to 0).
phone
- The sender's phone number (omit the phone prefix).
cellphone
- The sender's mobile phone (omit the phone prefix).
fax
- The sender's fax number (omit the phone prefix).
email
- The sender's email address.
website
- The sender's web address.
There are other options that govern the layout. See the isodoc documentation [21] for further details. There are also other options that are concerned with invoices. These are described in §4.1 Writing an Invoice Using the isodoc Class.
The letter from Example 14 can be rewritten using the isodoc class as follows:
\documentclass[12pt]{isodoc} \setupdocument {% language={en-GB},% company={University of Somewhere},% who={Mr Big Head},% street={Academic Lane},% city={Some City},% zip={AB3 4YZ},% country={United Kingdom},% countrycode={GB},% areacode={44},% cityzip,% subject={A sample letter},% closing={Yours sincerely},% enclosures={Photocopy of something interesting\\ Photocopy of something rather dull},% signature={Big Head},% copyto={Prof Important Person\\Dr Bor Ing},% footer,% phone={123456789},% cellphone={712345678},% email={big.head@somewhere.ac.uk},% website={somewhere.ac.uk},% date={2014-03-01}% } \begin{document} \letter [% opening={Dear Mrs Canary},% to={Mrs Mabel Canary\\% 24 The Street\\% Some Village\\Some Town\\% Noshire\\AB1 2YZ},% ourref={ABC/123}% ]% {% This is an imaginary letter. This is the second paragraph of the letter. } \end{document}
(You can download
or
view
this example.) The
resulting document is shown in Figure 3.5.
There's no space between the closing text and signature as I didn't
use the autograph
option.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).