Hi Offray,

Those are very interesting experiments.  Thanks for posting them.  For
further comparison, I've taken your two examples and run them through
my process.  Here are some observations based on that, with the
disclaimer that TeXmacs is new to me.

1.  I output both your examples from within TeXmacs using  File >
Export > Latex.  I ran these through  tex4ht  to produce jsmath
without too many complaints and each produced final output.  The
titling information never came through (should be easy to fix) and the
"mouse-fold" stuff from the "tmparmod" environment consistently caused
complaints.  I would bet that tex4ht could provide a configuration
file for latex that is specific to TeXmacs.

2.  I ran my custom script on the output to convert to Sage
worksheets, the output is below, where I've renamed the files to tm-
minimal and tm-maximal.  There are obvious mistakes, but I think the
output is good enough to suggest fine-tuning would be successful.
Other than adding a title to each one, I haven't made any changes by
hand.
http://buzzard.ups.edu/sage/tm-minimal.sws
http://buzzard.ups.edu/sage/tm-maximal.sws

3.  It strikes me that TeXmacs should be a very good environment for
authoring Sage worksheets where the amount of mathematics and text is
proportionally greater than the amount of actual Sage code.
Especially for students new to TeX, Sage and the command-line.

4.  The PlasTeX html output is very nice, especially with the
navigation elements, etc.  However, the mathematical elements are
embedded graphics files.  I think a very strong advantage of jsmath is
that it avoids this approach, which has been taken by numerous such
converters, including Sphinx.  As a simple illustration, try
increasing the font size (Ctrl-+ in Firefox) in the PlasTeX HTML
versus the SWS jsmath above and you should see the jsmath fonts scale
nicely, while the math graphics files get the "jaggies".  It would
seem to me that it will be a lot of work to get PlasTeX html, with
graphics, into jsmath for a Sage worksheet.

5.  The TeXmacs file format is highly structured and clearly
delineates a Sage "session" along with "input" and "output" blocks
(use Document > View > Edit source tree).  From very limited poking
around, it would appear that there are hooks in TeXmacs to extend the
conversion process to Latex.  As an example, on my system

/usr/share/texmacs/TeXmacs/plugins/maxima/packages/session/maxima.ts

would appear to recognize a  maxima  session and extend the formatting
there.  The main hack in my process above is to mark off Sage cells
for conversion to cells in the sws output.  It would appear that it
may be straightforward to have TeXmacs flag any embedded Sage sessions
properly for further processing.  I could see a TeXmacs wrapping a
Sage session in (new) SageTeX environments, which would be useful in
their own right, since then TeXmacs could be a way to author SageTeX
documents.  It should then be straightforward to have  tex4ht
implement the SageTeX environments as cells properly formatted for the
sws format in the conversion to jsmath.

6.  So, off the top of my head, I could imagine:

(a)  Iron out any kinks in TeXmacs output, like the tmparmod
environment, or handle them in (c).

(b) Create a TeXmacs "package" to extend its Latex conversion to
properly mark off a sequence of Sage inputs and the possible output,
perhaps in cooperation with Dan Drake and SageTeX.

(c)  Add a configuration file to tex4ht which creates the text version
of a Sage worksheet from the output of (b).  Since  t4ht  already
builds  jsmath  this would mostly mean only adding support for SageTeX
macros built in (b).

(d)  Build a tool to package up the text from (c) into the sws format
(directories, archive format, etc).  I do this by hand now via cut/
paste into a new worksheet, but such a tool would be trivial.

7.  So in summary, this would have TeXmacs be the pretty front-end to
Latex, with Sage sessions built-in.  tex4ht would do 99% of the
conversion to sws format.  Authors could write in a helpful tool, with
the power of Sage at hand, and distribute the results as Sage
worksheets, again with Sage available to the reader.

Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To post to this group, send email to sage-edu@googlegroups.com
To unsubscribe from this group, send email to 
sage-edu+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-edu?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to