~ellisonbg/ipython/bugfixes0411409

« back to all changes in this revision

Viewing changes to doc/nbexample_latex.py

  • Committer: ville
  • Date: 2008-02-16 09:50:47 UTC
  • mto: (0.12.1 ipython_main)
  • mto: This revision was merged to the branch mainline in revision 990.
  • Revision ID: ville@ville-pc-20080216095047-500x6dluki1iz40o
initialization (no svn history)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from notebook.markup import latex
 
2
 
 
3
latex.document_class('article')
 
4
latex.title('This is a Python Notebook')
 
5
 
 
6
latex.section('A section title',label='sec:intro')
 
7
 
 
8
latex.text(r"""Below, we define a simple function
 
9
\begin{equation}
 
10
f: (x,y) \rightarrow x+y^2
 
11
\end{equation}""")
 
12
 
 
13
def f(x,y):
 
14
    return x+y**2
 
15
 
 
16
# since the .text method passes directly to latex, all markup could be input
 
17
# in that way if so desired
 
18
latex.text(r"""
 
19
\section{Another section}
 
20
 
 
21
More text...
 
22
 
 
23
And now a picture showing our important results...""")
 
24
 
 
25
latex.include_graphic('foo.png')