LaTeX macros for mathematicsIntroduction to LaTeX macrosA macro example from Mother GooseAnother example of LaTeX macros

Another example of LaTeX macros

Here is a (slightly) less silly exercise on using LaTeX macros.

Suppose that you have just received (lucky you!) a number of gifts on some special occasion: a birthday, or a baby shower, or a wedding. Now you have the social obligation of writing "bread and butter" notes of thanks. 

Take the following letter template and use \newcommand to define all the control sequences containing capital letters. (Do not define any of the control sequences having no capital letters, for they are all internal LaTeX commands.) Then save your letter as butter.tex and run latex butter and xdvi butter & to see what your thank-you note looks like. (This is an example of using a \documentclass other than article.)

\documentclass[12pt]{letter}

%% Put your \newcommand statements here.
%% For example:
\newcommand{\MyName}{Don Joe}

              
%% Do not make any changes below this line!

\address{\MyStreetAddress\\ 
         \MyCity}
\signature{\MyName}

\begin{document}

\begin{letter}{}

\opening{Dear \GiftGiver,}

\ExpressionOfGratitude{} for the \Adjective{} \Gift.
It is just what I need to give 
a special touch to my \LivingQuarters.

Whenever I look at your \Gift, I will think of you \Adverb.

\AnotherExpressionOfGratitude.

\closing{\ClosingAdverb,}

\end{letter}

\end{document}

The output might look something like the following.

sample letter image


logo The Math 696 course pages were last modified April 5, 2005.
These pages are copyright © 1995-2005 by Harold P. Boas. All rights reserved.
 
LaTeX macros for mathematicsIntroduction to LaTeX macrosA macro example from Mother GooseAnother example of LaTeX macros