I'm creating a large number of identical documents in LaTeX, with only the address changing (and the address will be only 1 of 5 possible )
So if my list of possible addresses is:
DC | 1600 Pennsylvania Avenue, Washington, DC
FV | 2014 Forest Hills Drive, Fayetteville, NC
NY | 1 World Trade Center, New York, NY
SP | 742 Evergreen Terrace, Springfield, USA
I want to be able to type (for example) \fillinadd{DC} and have it fill in the proper address in text, so if I were to have a letter like:
\documentclass{letter}
\signature{Maurice Moss}
\newcommand{\fillinadd}[1]{#1}
\begin{document}
\begin{letter}{
Fire Department \\
\fillinadd{DC}}
\opening{Dear Sir / Madam,}
Fire! Fire! Help me! 123 Carrendon Road. Looking forward to hearing from you.
\closing{All the best,}
\end{letter}
\end{document}
It would replace the "DC" with "1600 Pennsylvania Avenue, Washington, DC", but if I put in "SP" it would print 742 Evergreen Terrace instead.
Alternately, if there is a better way to identify these possible addresses (ie #1, #2, etc), I'm fine with using that.
\fromaddress{}to be either whatever I have inputted, or\DC{}if it's undefined. – Roger Filmyer Jul 03 '15 at 21:26\fromaddresswhere you put the address, and then have a line like so:\ifthenelse{\isundefined{\fromaddress}}{\newcommand{\fromaddress}{\DC}}{}that you can use. Finally, when running pdflatex, use something like this:pdflatex "\def\fromaddress{\NY} \input{resume.tex}"to change the address. – Roger Filmyer Jul 03 '15 at 21:55