http://trac.sagemath.org/sage_trac/ticket/8105
Its not for the faint of heart. It should all work, but some assembly
is required. You need TeX for starters, and then you need a
relatively current installation of tex4ht (which probably means that
simply grabbing your distribution's package will *not* work), but I
have included fairly detailed instructions for installing it
yourself. Don't look inside the included Python script, just run
it. ;-)
I plan to make all of this as easy and streamlined as possible through
some combination of spkg's, notebook patches, TeX style files and
tex4ht configurations. Everything but writing your content for you.
Use the ticket for suggestions or comments, and add yourself to the cc
if you want to apprised of updates.
Rob
http://wiki.sagemath.org/devel/LatexToWorksheet
Also, Dana Ernst and Dan Drake report getting the minimal test example
working with stock installations of tex4ht (mactex, TeXLive 2009,
respectively), so the barrier to entry may not be so great.
Contributions of nontrivial examples to the wiki page are encouraged.
Thanks,
Rob
Experimentally I can process large documents (ie with multiple
sections, subsections) into a tarball that can be installed in your
notebook as a collection of linked worksheets, at the price of having
to install it as pristine new user (in order to control the worksheet
numbering and linking). My 900-page linear algebra text becomes
around 100 linked worksheets, comprising 700K as a tarball. This is
posted as an example on the project wiki page, though it takes some
care to install properly.
Thought-du-jour is to have authors handle the tex4ht conversion
themselves, with a post-processing hook used to create a tarball.
Tarball gets posted at author's site or a Sage site. Routines in the
notebook support pulling across the tarball, processing the contents
into worksheets, and they get installed in the user's notebook. A
recent post here [1] asked about distributing a reference manual for
an optional package. Though this was not the idea discussed there,
something similar with ReST format files might work along similar
lines to extend the library of reference materials available to users
in the notebook.
Rob
Wiki Page w/ Examples: http://wiki.sagemath.org/devel/LatexToWorksheet
Script, readme, support files: http://bitbucket.org/rbeezer/tex2sws/
[1] http://groups.google.com/group/sage-devel/browse_thread/thread/f3ef8b5fa107b73f
http://wiki.sagemath.org/devel/LatexToWorksheet
Download the "Approximating Polynomial Worksheet" example into a
notebook if you just want to get a feel for what this is all about.
(COPY the following link into the worksheet upload URL field.)
http://bit.ly/diWLVA
If you are able to test, I'd love to hear about successes and
failures, especially relative to heavy use of unicode characters.
Thanks, Rob
~~~~~~~~~~~~~~~~~~~
Recent Progress:
* I think unicode (UTF-8) characters are being handled properly. In
other words, if you can get tex4ht to handle your characters properly,
then I think they will survive the trip to your worksheet and
browser. Robert Marik is largely responsible for this. Maybe those
who write with a variety of accented characters will find this useful.
* LaTeX files created with sagetex seem to be digestible, and are a
natural for this conversion.
* Better decisions about what mathematics to leave for jsMath and what
to convert, thanks to code from Robert Marik.
* tikz graphics and "\includegraphics{}" both get translated
properly. tikz graphics get rendered as SVG, other file formats which
are "included" are converted to PNG automatically by tex4ht.
* Experimental code lets the conversion run as pure python,
independent of Sage or the notebook project.
To Do:
* Portable container for multiple, cross-linked worksheets.
* Notebook folders.