Writing A Letter In Latex - Texblog

  • About
    • Cookie Policy
  • Code Snippets
    • Beamer (presentation)
    • Figures
    • Lists
    • Standard classes
    • Tables
  • Consulting
  • LaTeX Installation
  • Posting Questions
  • TeX/LaTeX Resources

Letters are still rarely written in Latex, even though its so simple and straight forward. With this post we hope to convince at least some people to write letters using Latex. The advantages are obvious, you get a standard layout (which can be changed if necessary), the output is in PDF-format and last but not least, Latex is fun!

The following is a sample code, which can be used for writing a letter in Latex.

\documentclass{letter} \signature{Your name} \address{Street \\ City \\ Country} \begin{document} \begin{letter}{Company name \\ Street\\ City\\ Country} \opening{Dear Sir or Madam:} \dots \closing{Yours Faithfully,} \ps{P.S. Here goes your ps.} \encl{Enclosures.} \end{letter} \end{document}

Example output

latex-example-letter

For more space before or after paragraphs, openings or closings use \vspace{1cm}.

For a complete list of available commands or if you need to change margins, have a look at the letter style file (letter.sty)

Share this:

  • X
  • Facebook
  • Reddit
  • LinkedIn
  • Email

Related

50 Comments

  1. arbitblogs

    29. August 2007 at 8:12

    Dude whoever u are u are doing a great help here…i was recently initiated into the world of TeX… Never turned to Word again. I have always been wanting to know how to write letters in LaTeX… Thanks for the tip…i really didnt know it was this damn simple…

    Reply
  2. Simon Tyrberg

    16. October 2007 at 9:34

    Thanks for the tip – one question though: is it possible to somehow include pictures in letters? It seems when I’m trying that the “figure” environment isn’t defined when you use the “letter” documentclass.

    Reply
  3. aalderinkg

    19. October 2007 at 9:37

    There are a lot of different styles out there to help with writing letters. I’m from the Netherlands and the dutch TUG (TeX User Group) provides a style for dutch letters. It is the only way for me now to write letters. It looks very professional. It also supplies info like a reference number and a “in response to” field.

    Reply
  4. tom

    25. October 2007 at 9:36

    @Simon

    You can include figures in letters, but it seems indeed that the floating environment is not working. Try this: 1.

    \usepackage{graphicx}

    2.

    \includegraphics[scale=...]{yourFile}

    without the floating environment “figure”. It works fine for me, you can center the image, but not add caption and label.

    Hope this helps, Tom

    Reply
    • vicky

      20. November 2011 at 8:31

      Hi simon,

      This site has always helped. Ur comment did help dis tym!

      Regards Vicky

      Reply
  5. pastcounts

    29. October 2007 at 20:01

    You could also try the letter format in KOMA-script bundle; it provides replacement for all the basic document classes, with nice additional formatting options. The letter class is especially powerful, and I guess its full potential could only be realised in business environments, but it has served well for my personal needs, also. KOMA-script classes are present at least in MixTex, TeX-Live and teTeX.

    Reply
  6. dicktaid

    20. April 2008 at 11:14

    I tried to use the letter-class but couldn’t get it working. This simple guide whoever solved my problems. I didn’t know it was this simple! Thanks!

    Reply
  7. Gilberto

    10. May 2008 at 8:03

    I’m also new to TeX and LaTeX (as well as to Aquamacs) and I’m loving it. I’m two weeks into this and I’m really looking forward to not using Word or even Pages and OpenOffice again. Thanks for the instructions on how to make letters!!!

    Reply
  8. Lorenzo

    12. September 2008 at 9:24

    Thanks! I needed a quick template for writing a letter in Latex and the one you provided really helped 🙂

    Reply
  9. Paul

    16. November 2008 at 12:16

    I’m can’t get the telephone number to display using \telephone{2342}. I’ve tried adding the command \pagestyle{firstpage} but that dosen’t work. Any ideas?

    Also, I would like the closing text eg “Yours faithfully” flushed left – not centered. How do I do that? Cheers.

    Reply
    • tom

      6. January 2009 at 22:06

      Hi Paul,

      When I define the \telephone{}, it displays in the bottom right corner. If you would like it to be part of your address, just use an additional line in the address command. Now for your second question, I tried to flush it left. You can actually do it without a major effort, by simply using \name{…} instead of \address{…}. The trade-off is that your address is no more located above the date, but below your signature. Up to you to decide what suits you the better.

      Cheers, Tom.

      Reply
    • Summa

      19. February 2011 at 12:08

      You get both the phone number and the closing flushed left when the letter is formatted for use with a letterhead. You get this when you don’t use the \address command. When you use \address the letter is formatted as a personal letter, without a phone number.

      Reply
  10. Seamus

    19. March 2009 at 0:21

    You can left-align the closing by using \longindentation=0pt before your \begin{document}.

    Reply
    • Konstantin Tolstikhin

      28. March 2016 at 6:25

      Thanks!!!

      Reply
  11. Pablo

    20. August 2009 at 14:18

    Thanks for this blog. VERY USEFUL. I just finished writing my thesis in LaTeX, a 267 page document with lots of figures and tables, but I needed to write a letter and I was totally blocked. I never went back to WORD and I wasn’t about to succumb. Your letter example got me going again with a simple but elegant letter, thanks.

    Reply
  12. christie

    4. January 2010 at 0:56

    do bibliographies work in letters? can’t seem to get it working.

    Reply
  13. Writing a letter in LaTeX « The Daily Information Struggle

    5. March 2010 at 13:29

    […] not going to copy any details, this blog post says all that is needed […]

    Reply
  14. Maggie

    3. May 2010 at 22:02

    I am trying include a .jpg picture of my signature between the closing and my name in the standard \documentclass{letter} and cannot get any figure to load in at all. Any ideas? I tried what was described before with \usepackage{graphicx} and then just put in \includegraphics{largesignature.jpg} but it has not worked.

    Reply
    • tom

      4. May 2010 at 17:53

      Hi there,

      It would be helpful to see a minimal example of the relevant Latex code. I tried in my code and it worked, no problem. Take a look at my post on how to add your signature as an image to a letter.

      Reply
  15. Latex letter signature as image « Blog on Latex Matters

    4. May 2010 at 17:50

    […] the signature{Your name} declaration (see this sample letter) and just replace the closing{Yours Faithfully,} […]

    Reply
  16. Anil Duggirala

    10. June 2010 at 17:05

    Thanks for that. I have found a template for writing cover letters and cvs, here http://www.math.uic.edu/~hurder/math589/vita.html download the .zip and take a look at the letter template .tex.

    Reply
  17. CB

    16. September 2010 at 2:25

    To add to Seamus’ left-align signature comment, you can also left align the address and date using: http://stackoverflow.com/questions/1809882/latex-letter-from-address-left-aligned

    Reply
  18. sarvesh

    23. July 2011 at 12:00

    I am trying to make the first letter capital for encl. used in letter latex as By using \encl{Certificates} output appear as encl. Certificates. Is there any way to display “Encl. Certificates” instead of “encl. Certificates” in letter? Please help me.

    Reply
    • tom

      25. July 2011 at 4:33

      Hi Sarvesh,

      You can redefine it using: \renewcommand{\enclname}{Encl}.

      Cheers, Tom.

      Reply
  19. mrtumtum

    8. October 2011 at 19:23

    Nice job, hth another user

    \documentclass{letter} \signature{Michael Reavey\\Librarian} \address{Potter Thomas Promise Academy \\Philadelphia, Pennsylvania} \begin{document} \begin{letter}{Candidate Selection Committee} \opening{Dear Sir or Madam:} \dots \closing{Sincerely,} \end{letter} \end{document}

    I’m using auctex got rid of the first three lines in the buffer when starting emacs and your code compiled right away.

    Reply
  20. Demis

    11. November 2011 at 0:25

    I was busy looking around this page for the *.tex template bundle, or whatever package I need – Until I realized i was already looking at it in your few lines of code!

    Awesome! Thanks!!!

    Reply
  21. Kai Hendry

    21. November 2011 at 3:20

    Hi there, I have a letter template for Xetex which supports unicode fairly well here:

    https://github.com/kaihendry/letterly

    Enjoy,

    Reply
  22. Santosh

    27. March 2012 at 8:51

    Hi Tom, Thanks for the post. It is indeed very convenient to use latex for writing letters.

    It seems that the letter environment inserts the date by default. How can I tell it not to include the date.

    My preamble is bare minimum and it only contains: \documentclass{letter}

    Reply
    • tom

      27. March 2012 at 8:59

      Hey Santosh,

      Thanks for your questions. Adding \date{} as the first line within the letter environment will prevent the date from being shown.

      \begin{letter}{Company name...} \date{} ... \end{letter}

      Best, Tom.

      Reply
      • Santosh

        27. March 2012 at 9:07

        Thanks, It worked.

  23. kuanghan

    29. September 2012 at 16:02

    Thanks a lot! This is really useful.

    Reply
  24. Gregory Nash

    12. October 2012 at 22:18

    I’m using latex instead of email because I want to be able to refer to my figures within text instead of attaching them and hoping my reader knows which one I’m talking about. i want to keep things informal, so i’d prefer to write a letter, but i’m going to have to use the report class or something in order to have figures. can’t some latex guru just copy and paste some code so that i can have my cake and eat it too?

    Reply
    • tom

      13. October 2012 at 17:27

      Hmmm, not sure I understand what you need exactly. You may find my code samples on figures and standard classes useful. Cheers, Tom.

      Reply
  25. Larry Dickson

    21. October 2013 at 16:10

    Hi, Is there any way (other than inserting artificial spaces in the address) to make the address line up with the closing?

    Reply
    • tom

      22. October 2013 at 13:24

      Hi Larry, I can’t help you with that, sorry. I’d suggest you use an alternative package. See here for some options, e.g. newlfm.

      Since the letter class is old and not very popular, I’ll try to write a post on one of the newer packages…

      Cheers, Tom

      Reply
  26. Sam

    19. November 2014 at 20:59

    Someone asked long ago but it has not been answered: How can a citations and a bibliograohy be added to a letter?

    Reply
    • tom

      25. November 2014 at 7:54

      Hi Sam,

      You might find the answer to a similar question on tex.SX useful.

      Best, Tom

      Reply
  27. Clément

    8. March 2015 at 23:12

    I have a 403 on the file new.pdf

    Reply
    • tom

      10. March 2015 at 14:36

      Thanks! This should be fixed now.

      Reply
  28. Apurba Paul

    20. August 2015 at 17:00

    How to add subject before the opening?

    Reply
    • tom

      21. August 2015 at 14:48

      Hi there,

      A possible solution, although not ideal, is to include the subject in the opening:

      \opening{\textbf{Some fancy subject}\\\newline Dear Sir or Madam:}

      Alternatively, you might use the more flexible KOMA script letter class: scrlttr2.

      HTH, Tom

      Reply
  29. Reinhard Neuwirth

    18. April 2016 at 12:17

    How can I control the date of the letter? Today’s date seems to be inserted automatically.

    Reply
    • tom

      21. April 2016 at 9:40

      Hi Reinhard,

      Use the date macro in the preamble:

      \date{April 20, 2016}

      Cheers, Tom

      Reply
      • Reinhard Neuwirth

        21. April 2016 at 11:50

        Thanks Tom.

      • Reinhard Neuwirth

        21. April 2016 at 12:02

        While we are on the subject, do you know if there is a way to override \today in document classes other than letter. The trick you suggested seems to work for the letter class only.

      • tom

        26. April 2016 at 13:25

        Which class do you use? It works for the standard document classes: article, report, and book. Here’s an example:

        \documentclass[11pt]{article} \begin{document} \title{Some fancy title} \author{Myself} \date{April 20, 2016} \maketitle \end{document}
  30. Russell Horwood

    30. January 2018 at 10:56

    Why is the closing and the signature centre aligned? I’ve never seen that on any letter ever before.

    Reply
    • tom

      30. January 2018 at 12:50

      Hi Russell,

      Thanks for your comment. The positioning of signature is done through indentation rather alignment. Not sure what the reason is, perhaps an outdated style. To change it, set \longindentation to zero:

      \longindentation=0pt

      Best, Tom

      Reply
  31. tejasshettyblog

    7. March 2019 at 9:20

    How does one include a subject line?

    Reply
    • tom

      19. March 2019 at 12:11

      A possible solution is to use one of the standard macros. For example:

      \opening{\textbf{Subject: subject...}\\Dear Sir or Madam:} Reply

Leave a ReplyCancel reply

Consulting

Need help with your thesis or book project? Let’s discuss.

Email Address

Subscribe

Join 6,571 other subscribers doi2bib

Top Posts & Pages

  • Greek letters in text without changing to math mode
  • Changing the font size in LaTeX
  • Adding line numbers to documents
  • Crop figures with includegraphics
  • Multi-column and multi-row cells in LaTeX tables

Tags

addcontentsline array article bibliography Bibtex & biblatex book caption chapter citation cite code color definecolor description documentclass draft enumerate equation fancyhdr figure graphicx hyperref includegraphics item itemize label landscape LaTeX letter listoffigures listoftables math minipage reference renewcommand report section subfigure table tableofcontent tabular text TikZ usepackage xcolor

Tag » How To Write An Example With Letter Latex