Menu

[r6218]: / trunk / py4science / workbook / template.tex  Maximize  Restore  History

Download this file

37 lines (25 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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}]{problems/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}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.