next up previous contents index
Next: The <lalLaTeX> environment Up: Examples of how to Previous: Examples of how to   Contents   Index

The <lalVerbatim> environment

As an example, look at the code fragment in the source file lal/packages/tdfilter/src/CreateZPGFilter.c.

    /* <lalVerbatim file="CreateZPGFilterCP"> */
    void CreateCOMPLEX8ZPGFilter(LALStatus          *stat,
                                 COMPLEX8ZPGFilter **output,
                                 INT4              numZeros,
                                 INT4              numPoles)
    /* </lalVerbatim> */
When laldoc parses the source file, it produces the following output in the file CreateZPGFilterCP.tex

\vspace{-1ex}
\mbox{}\marginpar{\tiny\texttt{l.51}\\\texttt{CreateZPGFilter.c}}
\vspace{-3ex}
(backslash)begin{verbatim}
void CreateCOMPLEX8ZPGFilter(LALStatus         *stat,
                             COMPLEX8ZPGFilter **output,
                             INT4              numZeros,
                             INT4              numPoles)
(backslash)end{verbatim}

This is then included in the LATEX documentation with an \input{CreateZPGFilterCP} command, yielding the following output:



void CreateCOMPLEX8ZPGFilter(LALStatus         *stat,
                             COMPLEX8ZPGFilter **output,
                             INT4              numZeros,
                             INT4              numPoles)

The marginpar on the far right tells the line number and file name where the fragment came from.

Note the naming convention used for the file where the extracted code was stored: the base name comes from the file where it was extracted (here CreateZPGFilter), followed by a ``C'' (in this case to denote that it came from the .c file). Use This Naming Convention! This will avoid most name-space collisions. In this case, the the ``P'' is for function prototype.



LAL test account 2003-10-23