Introduction to Letter Writing in LaTeX
While LaTeX is famous for its ability to handle complex mathematical formulas and massive academic theses, it is also an exceptional tool for professional correspondence. Using the dedicated letter class, you can create documents that are perfectly typeset, follow formal standards, and maintain a consistent look across all your professional communications.
One of the main advantages of using LaTeX for letters is the separation of content from style. You provide the information (the recipient, the address, the body text), and LaTeX handles the margins, spacing, and placement of elements like the date and signature according to professional standards.
The Basic Structure of a Letter
To write a letter, you use the \documentclass{letter}. Unlike the article class, the letter class expects specific commands that define the sender and the recipient before you begin the actual body of the message.
Here is the most basic skeleton of a LaTeX letter:
\documentclass{letter}
% 1. Sender Information
\address{123 Your Street \\ City, State, ZIP}
\signature{Your Name}
\begin{document}
% 2. Recipient Information
\begin{letter}{Recipient Name \\ Their Street Address \\ Their City, State}
\opening{Dear Recipient,}
This is the body of the letter. LaTeX handles the margins and spacing automatically.
\closing{Sincerely,}
\end{letter}
\end{document}Key Components Explained:
\address{...}: This defines your (the sender's) return address. Use\\to create new lines.\signature{...}: This is the name that will appear under your closing (e.g., "Sincerely"). LaTeX leaves enough vertical space above this name for your physical signature.\begin{letter}{...}: This environment wraps each individual letter. The curly braces{}contain the recipient's name and address.\opening{...}: This generates the formal salutation.\closing{...}: This generates the sign-off and adds the space for your signature.
Note: A single LaTeX file can contain multiple
letterenvironments. This is useful if you need to send the same or similar letters to multiple people at once while keeping your return address and signature settings consistent.
Crafting a Formal Business Letter
In a professional setting, you might need to include more than just the body text. LaTeX provides built-in commands for the date, enclosures, and carbon copies (cc).
By default, LaTeX uses the current date via \today. If you need to specify a different date, you can use the \date{...} command in the preamble.
\documentclass[11pt]{letter}
\address{Department of Physics \\ University of Science \\ Cambridge, MA 02139}
\signature{Dr. Jane Doe}
\date{October 24, 2023}
\begin{document}
\begin{letter}{Hiring Committee \\ Tech Solutions Inc. \\ San Francisco, CA 94105}
\opening{To Whom It May Concern,}
I am writing to formally recommend John Smith for the position of Senior Analyst at your firm. Having worked with John for over five years, I can testify to his exceptional analytical skills and dedication.
During his tenure at our laboratory, he pioneered several techniques that reduced our processing time by 20\%. I believe he would be a valuable asset to your team.
\closing{Best regards,}
\encl{John Smith's Curriculum Vitae \\ Project Performance Report}
\cc{John Smith}
\end{letter}
\end{document}Advanced Elements:
\encl{...}: Used at the end of the letter to list "Enclosures" (documents included in the envelope).\cc{...}: Used to list people who are receiving a carbon copy of the letter.- Document Options: Using
[11pt]or[12pt]in the\documentclasshelps adjust readability depending on the length of your content.
Personalizing the Layout
Standard LaTeX letters can sometimes look a bit plain. You can enhance the professional look by adding a logo or creating a custom letterhead. To include a logo, you will need the graphicx package.
To place a logo at the top of your return address, you can include the image command directly within the \address command.
\documentclass{letter}
\usepackage{graphicx}
\address{
\includegraphics[width=2cm]{company_logo.png} \\
\textbf{Global Innovations Ltd.} \\
456 Enterprise Way \\
London, UK
}
\signature{Mark Spencer \\ \textit{Chief Technology Officer}}
\begin{document}
\begin{letter}{The Patent Office \\ Southampton}
\opening{Dear Sir/Madam,}
Please find the attached documentation regarding our latest patent application...
\closing{Respectfully,}
\end{letter}
\end{document}Best Practice: When adding a logo, ensure the image file is in the same folder as your
.texfile. Use thewidthparameter in\includegraphicsto prevent the logo from taking up half the page.
Best Practices and Common Pitfalls
To ensure your letters look professional and compile without errors, keep these tips in mind:
- Address Line Breaks: Always use the double backslash
\\to separate lines in the\addressand recipient blocks. LaTeX will treat them as a single long line otherwise. - The Empty Signature: If you are sending a digital letter and want to use an image of your signature, you can put the
\includegraphicscommand inside the\signaturecommand:\signature{\includegraphics{sig.png} \\ Your Name}. - Indentation: The
letterclass usually disables paragraph indentation and instead adds vertical space between paragraphs. This is the standard for modern business letters. - Avoid Manual Spacing: Try not to use
\vspaceor\newlinecommands excessively. Theletterclass is designed to balance the text on the page automatically. If your letter is very short, LaTeX will vertically center it to make the page look full.
Beyond the Standard Class: KOMA-Script
While the default letter class is excellent for beginners, you may eventually find it a bit restrictive (for example, it's difficult to align the address for windowed envelopes).
For more advanced users, the KOMA-Script collection offers a more powerful class called scrlttr2. It allows for incredibly detailed control over every element of the letter, including "variables" for phone numbers, email addresses, and website URLs.
A quick look at how scrlttr2 differs:
\documentclass[paper=a4, fontsize=11pt]{scrlttr2}
% Set variables
\setkomavar{fromname}{Sarah Jenkins}
\setkomavar{fromaddress}{789 Maple Lane \\ Smallville}
\setkomavar{subject}{Inquiry regarding Invoice #12345}
\begin{document}
\begin{letter}{Customer Support \\ Big Box Store}
\opening{To whom it may concern,}
I am writing regarding a discrepancy in my recent billing statement...
\closing{Sincerely,}
\end{letter}
\end{document}If you are just starting, stick to the standard letter class. Once you feel comfortable and need to send letters that fit specific regional standards (like DIN for Germany or US business standards), look into scrlttr2.
Summary Checklist
- Use
\documentclass{letter}. - Define
\addressand\signaturein the preamble. - Place recipient info inside
\begin{letter}{...}. - Use
\openingand\closingfor the formal bits. - Compile and enjoy a perfectly formatted, professional document!
