3.3 ⁑Writing a Letter Using the newlfm Class
The newlfm class [107] provides the newlfm
environment
where ⟨text⟩ is the body of the letter. The salutation text and recipient's name and address all need to be specified before this environment.
The date of the letter defaults to the current date (via
\today
) but can be set using:
The salutation text is specified via:
For example
The closing text is specified via:
For example
\closeline{Yours sincerely}
The recipient's name is specified via:
For example:
The recipient's address is specified via:
For example:
The sender's name is specified via:
For example:
The sender's address is specified via:
For example
The sender's phone number is specified via:
For example
\phonefrom{0123456789}
The sender's email address is specified via:
For example
\emailfrom{big.head@somewhere.ac.uk}
The subject text is specified via:
For example:
\regarding{sample letter}
The postscript is specified via:
For example:
The post-postscript is specified via:
For example:
The “CC” list is specified via:
For example:
The list of enclosures is specified via:
For example:
There are other commands as well. See the newlfm documentation [107] for further details.
The newlfm class comes with a number of predefined letter
styles, which can be set via the class options:
busletter
, busletternofrom
,
stdletter
, stdletterfrom
. The “nofrom”
styles don't display the sender's address. The business letter
“busletter”
styles
use a different alignment to the standard “stdletter” styles.
Alternatively, the letter style can be set via:
Other letter-related options that can be set using \newlfmP
(or in the class option list) are listed in
Table 3.3.
Here's a simple letter using the newlfm class:
\documentclass[stdletter]{newlfm} \usepackage[british]{babel} \newlfmP{orderfromtodate,sigcenter,addrfromphone,addrfromemail} \nameto{Mrs Mabel Canary} \addrto{24 The Street\\ Some Village\\Some Town\\ Noshire\\AB1 2YZ} \namefrom{Mr Big Head} \addrfrom{University of Somewhere\\Some City\\AB3 4YZ} \emailfrom{big.head@somewhere.ac.uk} \phonefrom{0123456789} \regarding{A sample letter} \greetto{Dear Mrs Canary} \closeline{Yours sincerely} \cclist{Prof Important Person\\Dr Bor Ing} \encllist{Photocopy of something interesting\\ Photocopy of something rather dull} \psitem{this is a postscript} \begin{document} \begin{newlfm} This is an imaginary letter. This is the second paragraph of the letter. \end{newlfm} \end{document}
(You can download or view this example.) The resulting document is shown in Figure 3.4.
Create the document from Example 15 and try adjusting some of the options given in Table 3.3.
For the More Adventurous
As with Exercise 8, use one of the commands described in §2.8 Fetching Data From a Given Row to fetch the recipient's details from the sample people.csv file or the people SQL table rather than explicitly typing them into the document. You can download or view a solution.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).