From: <jd...@us...> - 2007-11-03 12:32:03
|
Revision: 4100 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4100&view=rev Author: jdh2358 Date: 2007-11-03 05:31:59 -0700 (Sat, 03 Nov 2007) Log Message: ----------- added readme and exercise template Added Paths: ----------- trunk/py4science/workbook/README trunk/py4science/workbook/template.tex Added: trunk/py4science/workbook/README =================================================================== --- trunk/py4science/workbook/README (rev 0) +++ trunk/py4science/workbook/README 2007-11-03 12:31:59 UTC (rev 4100) @@ -0,0 +1,22 @@ +This is the workbook for the py4science course. It is made up of a +bunch of different units, each of which lives in a separate *.tex +file. To make a new unit, copy template.tex to yourfile.tex and fill +it in. We use the latex listing package for including python source +code. + +For every unit, create an example in ../examples/your_example.py, a +skeleton in ../examples/your_example_skel.py, and a symlink from +../examples/your_example_skel.py -> examples_skel/your_example.py +(../examples is in the top level of the py4science repository). If +there are any figures, you should create a PNG and EPS version of each +and add them to the fig subdirectory of the workbook directory. You +will need to svn add your tex file, example, skeleton, skeleton +symlink, and figures. + +You can build the workbook in skeleton form with + + > make skeletons # create workbook_skeletons.pdf + +and in solved form with + + > make solved # creates workbook_solved.pdf Added: trunk/py4science/workbook/template.tex =================================================================== --- trunk/py4science/workbook/template.tex (rev 0) +++ trunk/py4science/workbook/template.tex 2007-11-03 12:31:59 UTC (rev 4100) @@ -0,0 +1,37 @@ +\section{Your Example} +\label{sec:your_example} + +This is your introduction. Refer to python packages like +\texttt{numpy} and \texttt{matplotlib}, as well as functions like +\texttt{n.arange}, with ``texttt''. + +Refer to figures like Figure~\ref{fig:your_figure}. Your example code +should be included like. + +\lstinputlisting[label=code:your_example,caption={IGNORED}]{examples/your_example.py} + +and your figures should be saved in the \textff{fig} subdirectory with +a PNG and EPS version. You should include it like + +\begin{figure} +\begin{centering}\includegraphics[width=4in]{fig/your_example}\par\end{centering} + +\caption{\label{fig:your_example}Your figure caption here} +\end{figure} + +If you want to include python code inline, including ipython sessions use the following environment. I sometimes decorate ipython sessions with comments. + +\begin{listing} +# use namespaces! +In [1]: import numpy as n + +In [2]: x = n.random.rand(10) + +In [3]: x**2 +Out[3]: +array([ 0.08694464, 0.99225328, 0.05017794, 0.44827437, 0.25938905, + 0.10617795, 0.27397649, 0.33391573, 0.27975237, 0.06808894]) + +In [4]: + +\end{listing} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |