cexcerpt(1)

NAME

cexcerpt - extract tagged code chunks for verbatim inclusion in documentation

SYNOPSIS
cexcerpt file.c dir

DESCRIPTION
cexcerpt processes a C source file file.c, extracts tagged excerpts, and puts these excerpts in a file in directory dir.

An excerpt is marked with special comments in the C file, as in this example:
/*::cexcerpt::my_example::begin::*/
  while (esl_sq_Read(sqfp, sq) == eslOK)
    { n++; }
/*::cexcerpt::my_example::end::*/

The tag's format is "::cexcerpt::<tag>::begin::" (or end). The tag is used to construct the file name, as <tag>.tex. In the example, the tag my_example creates a file my_example.tex in dir.

All the text between the cexcerpt tags is put in the file. In addition, this text is wrapped in a {cchunk} environment. So in the example above, my_example.tex will contain:
 \begin{cchunk}
   while (esl_sq_Read(sqfp, sq) == eslOK)
    { n++; }
 \end{cchunk}

This file can then be included in a LaTeX file, with \input{<dir>/<tag>}.

For best results, the C source should be free of TAB characters. "M-x untabify" on the region to clean them out.

Cexcerpts can't overlap or nest in any way in the C file; only one can be active at any given time.

OPTIONS
Currently none.