User guide production??

John, I've been meaning to ask you ... how did you produce

    > the very fine User Guide? Is that TeXmacs? LyX? raw
    > LaTeX? ConTeXt? emacs magic?

I'm using latex with the excellent listings package-
http://www.atscire.de/index.php?nav=products/listings. It knows
python syntax, and can do string, comment, keyword highlighting and
more.

You can see the latex src that created the user's guide by checking
out users_guide from matplotlib CVS, or visiting
matplotlib download | SourceForge.net . The
README file in that directory contains more information.

For much of the user's guide, I keep the python code in external files
and include them in a special verbatim environment that does syntax
highlighting with , eg

\lstinputlisting[linerange=1-12,caption={Wild and wonderful ways to specify colors;
  see Figure~\ref{fig:color_demo}},
label=lst:color_demo]{code/color_demo.py}

The linerange is used to leave some boilerplate at the beginning and
end of the file (eg some savefig calls to generate the accompanying
figures in eps and png). This helps insure that the python code in
the manual actually runs, since it is the same code used to generate
the figures for the guide.

    > Is there some slick way of getting the listings from the
    > command line window into the document, especially with the
    > comments colorized? I'm writing a small local guide, and
    > was wondering ...

By "the command line window" do you mean the python shell? If so,
you'll have to do some special tweaks to handle the >>> prompt, but
the listings packages is very sophisticated, and can ignore prefixes
or add them, etc.... There is a fairly comprehensive manual. Or did
you mean something else?

JDH

Did you make full matplotlib and/or scipy language definitions?
If so, are they available?
Alan Isaac

PS I found this list in the docs,
which is of course part of the answer to my question.

{axes, axis, bar, cla, clf, clim, close, cohere, colorbar,
    colors, csd, draw, errorbar, figimage, figlegend, figtext, figure,
    fill, gca, gcf, gci, get, get_current_fig_manager,
    get_plot_commands, gray, grid, hist, hlines, hold, imshow, jet,
    legend, load, loglog, pcolor, pcolor_classic, plot, plot_date,
    plotting, psd, raise_msg_to_str, rc, rcdefaults, save, savefig,
    scatter, scatter_classic, semilogx, semilogy, set, specgram, stem,
    subplot, table, text, title, vlines, xlabel, ylabel},

···

On Sat, 15 Jan 2005, John Hunter apparently wrote:

I'm using latex with the excellent listings package-
http://www.atscire.de/index.php?nav=products/listings. It knows
python syntax, and can do string, comment, keyword highlighting and
more.