LaTeX letter template: write a formal letter
LaTeX has a built-in letter class. Set your\address and \signature, open aletter environment with the recipient's address, and write between \opening and \closing. LaTeX places the addresses, date and signature for you. Copy the template below, change the text and compile; no package is needed.
\documentclass{letter}
\signature{Jane Doe}
\address{12 High Street \\ Springfield \\ AB1 2CD}
\begin{document}
\begin{letter}{Mr John Smith \\ Acme Ltd \\ 1 Market Square \\ Springfield}
\opening{Dear Mr Smith,}
Thank you for your letter of 3 March. I am pleased to accept the offer.
\closing{Yours sincerely,}
\cc{HR Department}
\encl{Signed contract}
\end{letter}
\end{document}\\separates the lines of an address. More on line breaks in LaTeX new line.- The date is today's date. To fix it, add
\date{1 March 2026}before\begin{document}. \cc,\encland\psare optional and go after\closing.- One file can hold several letters: repeat the
letterenvironment, one per recipient.
A modern letter with KOMA-Script
The letter class puts your address at the top right, in the traditional British layout. For a letter with a letterhead, a subject line and an address that fits a window envelope (DIN 5008 by default), use KOMA-Script's scrlttr2.
\documentclass[paper=a4]{scrlttr2}
\setkomavar{fromname}{Jane Doe}
\setkomavar{fromaddress}{12 High Street\\Springfield}
\setkomavar{subject}{Job application}
\begin{document}
\begin{letter}{Acme Ltd\\1 Market Square\\Springfield}
\opening{Dear Sir or Madam,}
I am writing to apply for the post of engineer.
\closing{Yours faithfully,}
\end{letter}
\end{document}Other letter details are set the same way, with\setkomavar: for example place, orfromemail and fromphone, which show once you add the fromemail and fromphone class options.
Letter templates
- Formal letter templates, such as theProfessional Formal Letter and theDIN 5008 Letter.
- Cover letter templates for job applications, such as theFreeman Cover Letter. Many match a CV in theCV templates.
Related
Links and email addresses are covered inLaTeX hyperlinks, and text size inLaTeX font size.