Document Classesletter | Serial Letters

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
bobbylou
Posts: 18
Joined: Tue Apr 21, 2009 6:54 pm

letter | Serial Letters

Post by bobbylou »

Hi,

I am writing a letter in LaTeX that I want to send to a number of different recipients. The catch is that I want to send a slightly different version of the letter depending on the recipient: for example, in the letter to be sent to Ms. XX I'd like the body of the letter to say Ms. XX and in the letter to be sent to Mr. YY I'd like the body of the letter to say Mr. YY. I have searched google and can't seem to find a way to do this. Here's an example of some code:

Code: Select all

\documentclass{letter}

\signature{Me}
\address{Me \\ My address}

\begin{document}

\def \body {I'd like it to say "Ms. XX" or "Mr. YY" depending on the letter, as below.}

\begin{letter}
{Ms. XX \\ Ms. XX's address}
\opening{Dear Ms. XX:}
\body
\closing{Sincerely,}
\end{letter}

\begin{letter}
{Mr. YY \\ Mr. YY's address}
\opening{Dear Mr. YY:}
\body
\closing{Sincerely,}
\end{letter}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

letter | Serial Letters

Post by localghost »

The »scrlttr2« class from KOMA-Script supports serial letters. The manual has the details.


Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply