LaTeX/Letters - Wikibooks, open books for an open world (2024)

LaTeX

Getting Started
  1. Introduction
  2. Installation
  3. Installing Extra Packages
  4. Basics
  5. How to get help

Common Elements

  1. Document Structure
  2. Text Formatting
  3. Paragraph Formatting
  4. Colors
  5. Fonts
  6. List Structures
  7. Special Characters
  8. Internationalization
  9. Rotations
  10. Tables
  11. Title creation
  12. Page Layout
  13. Customizing Page Headers and Footers‎
  14. Importing Graphics
  15. Floats, Figures and Captions
  16. Footnotes and Margin Notes
  17. Hyperlinks
  18. Labels and Cross-referencing
  19. Initials

Mechanics

  1. Errors and Warnings
  2. Lengths
  3. Counters
  4. Boxes
  5. Rules and Struts

Technical Text

  1. Mathematics
  2. Advanced Mathematics
  3. Theorems
  4. Chemical Graphics
  5. Algorithms
  6. Source Code Listings
  7. Linguistics

Special Pages

  1. Indexing
  2. Glossary
  3. Bibliography Management
  4. More Bibliographies

Special Documents

  1. Scientific Reports (Bachelor Report, Master Thesis, Dissertation)
  2. Letters
  3. Presentations
  4. Teacher's Corner
  5. Curriculum Vitae
  6. Academic Journals (MLA, APA, etc.)

Creating Graphics

  1. Introducing Procedural Graphics
  2. MetaPost
  3. Picture
  4. PGF/TikZ
  5. PSTricks
  6. Xy-pic
  7. Creating 3D graphics

Programming

  1. Macros
  2. Plain TeX
  3. Creating Packages
  4. Creating Package Documentation
  5. Themes

Miscellaneous

  1. Modular Documents
  2. Collaborative Writing of LaTeX Documents
  3. Export To Other Formats

Help and Recommendations

  1. FAQ
  2. Tips and Tricks

Appendices

  1. Authors
  2. Links
  3. Package Reference
  4. Sample LaTeX documents
  5. Index
  6. Command Glossary

edit this boxedit the TOC

Sometimes the mundane things are the most painful. However, it doesn't have to be that way because of evolved, user-friendly templates. Thankfully, LaTeX allows for very quick letter writing, with little hassle.

Contents

  • 1 The letter class
  • 2 Envelopes
    • 2.1 Using the envlab package
    • 2.2 Using the geometry package
    • 2.3 Printing
  • 3 Windowed envelopes
  • 4 Reference: letter.cls commands
  • 5 Sources

The letter class

[edit | edit source]

To write letters use the standard document class letter.

You can write multiple letters in one LaTeX file - start each one with \begin{letter}{''recipient''} and end with \end{letter}. You can leave recipient blank. Each letter consists of four parts.

  1. Opening (like \opening{Dear Sir or Madam,} or \opening{Dear Kate,}).
  2. Main body (written as usual in LaTeX). If you want the same body in all the letters, you may want to consider putting the entire body in a new command like \newcommand{\BODY}{actual body} and then using \BODY in all the letters.
  3. Closing (like \closing{Yours sincerely,}).
    LaTeX will leave some space after closing for your hand-written signature; then it will put your name and surname, if you have declared them.
  4. Additional elements: post scripta, carbon copy and list of enclosures.

If you want your name, address and telephone number to appear in the letter, you have to declare them first signature, address and telephone.

The output letter will look like this:

Here is the example's code:

\documentclass{letter}\usepackage{hyperref}\signature{Joe Bloggs}\address{21 Bridge Street \\ Smallville \\ Dunwich DU3 4WE}\begin{document}\begin{letter}{Director \\ Doe \& Co \\ 35 Anthony Road\\ Newport \\ Ipswich IP3 5RT}\opening{Dear Sir or Madam:}I am writing to you on behalf of the Wikipedia project (http://www.wikipedia.org/),an endeavour to build a fully-fledged multilingual encyclopaedia in an entirelyopen manner, to ask for permission to use your copyrighted material.% The \ldots command produces dots in a way that will not upset% the typesetting of the document.\ldots That said, allow me to reiterate that your material will be used to the noble end ofproviding a free collection of knowledge for everyone; naturally enough, only if youagree. If that is the case, could you kindly fill in the attached form and post itback to me? We shall greatly appreciate it.Thank you for your time and consideration.I look forward to your reply.\closing{Yours Faithfully,}\psP.S. You can find the full text of GFDL license at\url{http://www.gnu.org/copyleft/fdl.html}.\encl{Copyright permission form}\end{letter}\end{document}

To move the closing and signature parts to the left, insert the following before \begin{document}:

\longindentation=0pt

The amount of space to the left can be adjusted by increasing the 0pt.

Envelopes

[edit | edit source]

Using the envlab package

[edit | edit source]

The envlab package provides customization to the \makelabels command, allowing the user to print on any of an assortment of labels or envelope sizes. For example, beginning your LaTeX file the following way produces a document which includes the letter and a business-size (#10) envelope on the following page.

\documentclass{letter}\usepackage[businessenvelope]{envlab}\makelabels

Refer to the envlab user guide for more information about this capable package. Note that the envlab package has issues displaying characters outside the base ASCII character set, see this bug report for more information.

Using the geometry package

[edit | edit source]

Here is a relatively simple envelope which uses the geometry package which is used because it vastly simplifies the task of rearranging things on the page (and the page itself).

% envelope.tex\documentclass{letter}\usepackage[left=1in,top=0.15in,papersize={4.125in,9.5in},landscape,twoside=false]{geometry}\setlength\parskip{0pt}\pagestyle{empty}\begin{document}FROM-NAMEFROM-STREET ADDRESSFROM-CITY, STATE, \ ZIP\vspace{1.0in}\large\setlength\parindent{3.6in}TO-NAMETO-STREET ADDRESSTO-CITY, STATE, \ ZIP\end{document}

Printing

[edit | edit source]

The above will certainly take care of the spacing but the actual printing is between you and your printer. One user reports that printing envelopes created with envlab is relatively painless. If you use the geometry package, you may find the following commands useful for printing the envelope.

$ pdflatex envelope.tex$ pdf2ps envelope.pdf$ lpr -o landscape envelope.ps

Alternatively, you can use the latex dvi output driver.

In the first line, dvips command converts the .dvi file produced by latex into a .ps (PostScript) file. In the second line, the PostScript file is sent to the printer.

$ latex envelope.tex && dvips -t unknown -T 9.5in,4.125in envelope.dvi$ lpr -o landscape envelope.ps

It is reported that pdflatex creates the right page size but not dvips despite what it says in the geometry manual. It will never work though unless your printer settings are adjusted to the correct page style. These settings depend on the printer filter you are using and in CUPS might be available on the lpr command line.

Windowed envelopes

[edit | edit source]

An alternative to separately printing addresses on envelopes is to use the letter class from the KOMA package. It supports additional features like folding marks and the correct address placement for windowed envelopes. Using the scrlttr2 document class from the KOMA package the example letter code is:

% koma_env.tex\documentclass[a4paper]{scrlttr2}\usepackage{lmodern}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}\usepackage[english]{babel}\usepackage{url}\setkomavar{fromname}{Joe Bloggs}\setkomavar{fromaddress}{21 Bridge Street\\ Smallville\\ Dunwich DU3 4WE}\setkomavar{fromphone}{0123 45679}\begin{document}\begin{letter}{Director \\ Doe \& Co \\ 35 Anthony Road\\ Newport \\ Ipswich IP3 5RT}\KOMAoptions{fromphone=true,fromfax=false}\setkomavar{subject}{Wikipedia}\setkomavar{customer}{2342}\opening{Dear Sir or Madam,}I am writing to you on behalf of the Wikipedia project(\url{http://www.wikipedia.org/}), an endeavour to build afully-fledged multilingual encyclopaedia in an entirely openmanner, to ask for permission to use your copyrighted material.\ldots That said, allow me to reiterate that your material will be usedto the noble end of providing a free collection of knowledge foreveryone; naturally enough, only if you agree. If that is thecase, could you kindly fill in the attached form and post it backto me? We shall greatly appreciate it. Thank you for your time and consideration.I look forward to your reply.\closing{Yours Faithfully,}\ps{P.S. You can find the full text of GFDL license at\url{http://www.gnu.org/copyleft/fdl.html}.}\encl{Copyright permission form}\end{letter}\end{document}

The output is generated via

$ pdflatex koma_env

Folding the print of the resulting file koma_env.pdf according the folding marks it can be placed into standardized windowed envelopes DIN C6/5, DL, C4, C5 or C6.

In addition to the default, the KOMA-package includes predefined format definitions for different standardized Swiss and Japanese letter formats.

Reference: letter.cls commands

[edit | edit source]

commanddescription
\name{}
\signature{}
\address{}
\location{}
\telephone{}
\makelabels
\stopbreaks
\startbreaks
\opening{}
\closing{}
\cc{}Start a parbox introduced with \ccname:
\encl{}Start a parbox introduced with \enclname:
\psBegins a new paragraph, normally at the close of the letter
\stopletter(empty)
\returnaddress(empty)
\startlabels
\mlabel{}{}
\descriptionlabel{}
\ccname"cc"
\enclname"encl"
\pagename"Page"
\headtoname"To"
\date{}Alter the date. See datetime package for alternative formattings.
\todayLong form date
environmentDescription
letter{}See main article
description
verse
quotation
quote

Sources

[edit | edit source]

LaTeX/Letters - Wikibooks, open books for an open world (4)

To do:

  • mention/introduce cdpbundl package (package for typesetting italian styled business letters)
Previous: More BibliographiesIndexNext: Presentations
LaTeX/Letters - Wikibooks, open books for an open world (2024)

References

Top Articles
Latest Posts
Article information

Author: Jerrold Considine

Last Updated:

Views: 5545

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.