Another example of LaTeX macrosIntroduction to LaTeX macrosWhat good are macros?A macro example from Mother Goose

A macro example from Mother Goose

For illustration, here is a somewhat silly example of using LaTeX macros. See if you can determine what the following LaTeX file will produce. Then use the mouse to cut and paste the example into a text editor, save the example as a file named goose.tex, and execute the commands latex goose and xdvi goose & in a terminal window to see if you are right. 


\documentclass[12pt]{article}

\title{A rhyme from Mother Goose}

\newcommand{\pea}{Pease porridge}
\newcommand{\heiss}{hot}
\newcommand{\kalt}{cold}
\newcommand{\pot}{in the pot nine days old}
\newcommand{\some}{Some like it}

\begin{document}

\maketitle

\begin{verse} 
\pea{} \heiss,\\ 
\pea{} \kalt,\\ 
\pea{} \pot.\\ 
\some{} \heiss,\\ 
\some{} \kalt,\\ 
\some{} \pot.  
\end{verse}

\end{document}

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.
 
Another example of LaTeX macrosIntroduction to LaTeX macrosWhat good are macros?A macro example from Mother Goose