On Sat, Jan 7, 2012 at 9:10 PM, Fernando Perez <fperez....@gmail.com> wrote: > 2012/1/7 Ondřej Čertík <ondrej.cer...@gmail.com>: >> So I think that is doable. I think the only problem is with: >> >> * equations and section references >> * literature (bibtex), especially accross files >> >> >> However, it just occured to me, that almost all of the problems could >> be fixed by simply merging all the .rst files into one by my own >> script, and only then giving it to Sphinx. Then the only problem to >> fix is: >> >> * bibtex >> * modify the latex template so that the thesis conforms to the school >> format requirements. >> >> I think that's what I'll do. > > True, and it may be the right solution for you. Though it would be > great if instead of needing manual post-processing with extra tools, > this was possible out of the box in sphinx. > > It's trivial to export an ipython notebook to rst, so if these things > were possible within sphinx, the combination of sphinx and ipython > would make it very, very easy to create complex documents like your > book or a thesis but with sections that have code and plots produced > from notebooks. All you'd need is in your makefile to have a rule > > %.rst : %.ipynb > ipython nbexport --sphinx $< > > [ note, right now 'ipython nbexport' doesn't really exist, but the > basics are just this: https://gist.github.com/1569580 and we'll have > it soon in a more clean implementation] > > Your sphinx project could then consist of a mixture of hand-written > .rst files and ipynb ones for the compute-heavy stuff.
I hope to be able to somehow import the .rst file, possibly with some specific .rst "hints", like ".. ipynb::". > > Obviously one could carry around your script as an extra tool, but the > more this works out of the box, the easier gaining widespread adoption > it will be. > > Still, do let us know how it goes and please do post any additional > tools you develop for this; we're likely to reuse them :) Definitely. I can promise that I will try to use sphinx and do my best to make it work (given my timeframe) for my job. If nothing, just having it in .rst makes it easy for me to reuse most parts of it and simply add it to my book. 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. Hopefully it will not be too much work to port all sympy/python examples into some interactive form. 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. Ondrej -- 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.