Next: reordering-with-insertribbon Prev: usual-code-in-doc Up: code-in-doc Top: Top

0.2.3.2. Code ribbons: the fancy stuff

Both of the above are shorthand notation for messier stuff going on underneath... Strictly speaking, the code in a particular document is made up of one or more ribbons of code. For example, As always, code to be extracted goes inside a `\begin{code}'...`\end{code}'; the optional argument after `\begin{code}' is the name of the code-ribbon to which the program-text belongs. The example above has two ribbons, `hello-goodbye' and `wimp'. You can extract any code-ribbon(s) you wish [see `lit2pgm''s -r option]; the disjoint pieces of a particular ribbon (e.g., `hello-goodbye' above) are catenated together in the order seen.

Usually, this ribbon-business is just a bother, so there is the good ol' default ribbon, `main'. For example, the way-you-normally-write-things:

is actually short for: Unsurprisingly, `main' is the default code-ribbon when one is in the ribbon-extraction business. Similarly, code included with `>' signs in the leftmost column ("Bird tracks") is just tacked onto the `main' ribbon, too: