2012/1/8 Ondřej Čertík <ondrej.cer...@gmail.com>: > I now routinely use SymPy in the book, just an example from a few days ago: > > http://theoretical-physics.net/dev/src/math/groups.html#example-i > > Scroll a few pages for the longer script + output. I would love to > make this interactive using the ipython notebook eventually.
Neat! > Hopefully it will not be too much work to port all sympy/python > examples into some interactive form. Indeed, it's very easy. You can import any .py file into the notebook by dragging it into the dashboard file area. If it's a simple script it becomes one big cell, but it's very easy to put cell markers in the .py file yourself to ease the initial import. The following is the minimal script that will import correctly as a notebook, nicely split into cells: # <nbformat>2</nbformat> # <codecell> """A simple cell with a docstring""" # <markdowncell> # Some text in a markdown cell # <codecell> # A cell with code def f(x): return x # <codecell> # Another cell with code def g(x): pass etc... So: take your sympy examples, add the format marker at the top and then put # <codecell> markers where you want them, and presto! Sympy notebooks that you can then export in your makefile back to rST. Just put the ipynb->rst rule in your makefile and use the exporter in the gist I pointed above for now; we'll add a clean version of that to ipython soon. > However, I need to figure out how to make sphinx produce solid results > in latex, so that the printed version of the book looks professional. Certainly! Best of luck, this is excellent work and will be super useful. Cheers, f -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.