Next: ribbons-details Prev: code-in-doc Up: code-in-doc Top: Top

0.2.3.1. The usual ways to put code in a documents

The most straightforward way to do this is to put all the code in a file in one or more `\begin{code}' ... `\end{code}' environments -- the code can then be extracted (in the order it appears in the text) and fed to your favourite compiler/interpreter/whatever.

An equivalent notation preferred by some is "Bird tracks", so-called because it started with Richard Bird (and because Cordy calls them that); lines starting with a `>' are extracted; for example:

is equivalent to: A block of Bird-tracked code lines must have a blank line before and after (not having one usually indicates a typo).

COMMENT:-----------------------

ToDo: Simon wants to know how code looks in (a) a LaTeX'd document and (b) an Info'd document. -------------------------------