\documentclass{article} \usepackage{tw,makeidx} \title{Hello World --- A Famous Program} \author{Corey Minyard} \date{\today} \makeindex \begin{document} \maketitle \section{Description} This program is the famous ``hello world'' program. Certainly we have all written one of these programs. \section{Code} \subsection{Start Macro} This is the main part of the program. @code <*> @ @ @endcode \subsection{Includes} This program needs \texttt{stdio.h} because it uses printf. @code #include @endcode \subsection{Routines} This program only has one routine, the main routine. @code @
@endcode \begin{twproc}{main} \Description The main routine. \ReturnValues \verb|int| - Program return code \SideEffects Well, it prints something! \Inputs \begin{twparmlist} \item[argc] Argument count \item[argv] The arguments \end{twparmlist} \StartCode @code
int main(int argc, char *argv) { @ @ } @endcode \subsection{Output Hello} This macro actually does the output. @code printf("hello world\n"); @endcode \subsection{Leave Program} This macro causes the program to exit. @code exit(0); @endcode \end{twproc} \printindex \end{document}