1

I'm trying to set up a letter that is going to several addresses. I had an idea of writing the names and mark them with a \label{}, then to insert them wherever I need them in the letter. Example:

John\label{name} Doe jada jada jada...
...
...

Now John should appear in the text again.

Is this possible, if so what kind of reference should use?

  • 1
    Welcome to TeX.SX: Perhaps something like in my answer to this question here: http://tex.stackexchange.com/questions/271062/labeling-a-text-and-referencing-it-later? –  Nov 11 '15 at 19:17

1 Answers1

1

If I'm understanding correctly, you want to define your recipient's name once and refer to it many times, so that you can change the recipient's name more easily. The nicest way to do that is a \newcommand: in the following example, every \Recipient is converted to the text John Doe.

\documentclass{article}
\newcommand{\Recipient}{John Doe}
\begin{document}
Dear \Recipient, your name is \Recipient. Have a nice day! (and so on)
\end{document}

Now, to send this to a different person, you only have to change one line.

Arun Debray
  • 7,126
  • 2
  • 30
  • 54