# Template a Cover letter using macros?

I'd like to create a cover letter where I can insert the company name, and various other consistent pieces of information as a macro to be expanded when the document is compiled. I'm very new to LaTeX, but I'm certain this can be done with a macro; how can I do this?

I'd like it to be this sort of thing:

\define{compname}{European XFEL}{European X-Ray Free Electron Laser}


So that when some command reading compname is compiled it spits out the long or short form.

-

## 1 Answer

There are lots of ways of doing this. The glossaries package is pretty good for defining acronyms (things with long and short versions), but it might be overkill for this.

You could just do

\documentclass{letter}
\newcommand{\shortname}{}
\newcommand{\longname}{}

\compname{European XFEL}{European X-Ray Free Electron Laser}
\begin{document}
The short version of the name is: \shortname

The long version of the name is: \longname
\end{document}

-
I did not realise how simple that would be. Fantastic. –  Pureferret Feb 2 '12 at 17:35