Fixes

 * 1 wrong regex in `@@@CODE` statement (fixed both regex and source file)
 * 1 wrong heading `=====Heading=====` without spaces, need to be `===== Heading =====`
 * Many `\label{}` in equations, should just be `label{}`
 * Changed `\eqref{}` to `(ref{})` for greater compatibility with various formats
 * For latex, there was an error because of a figure with caption inside
   a box environment (or more precisely: a minipage cannot contain a figure
   environment in latex). I fixed this such that you don't get a box
   in latex format (through fancy use of the mako preprocessor), see
   comments around first `${bbox()}` command.
 * After using Mako, some serious problems with latex appeared since the
   file had Windows newlines `\r\n` and Mako fails on treating double
   backslash in align environments correctly. Remedy: run
   `doconce subst '\r\n' '\n' main.do.txt` to get Unix newline characters.
   Can be put in the compilation script.
 * Updated the compilation script with the latest options (requested by Johan)
   so the special substitution commands can be dropped.
 * I would typeset program names and file names using verbatim (backticks)
   rather than boldface (underscore). Verbatim handles underscores in the
   names too.

Some other comments for latex version:

 * Some programs have too long lines.
 * URLs become footnotes, so very long URLs to GitHub are best typeset
   by using `tinyurl.com` for the base URL and then appending the
   local path, as in `http://tinyurl.com/ugygh6z/chapter/programs_and_modules/myprog.py`.