Yes, if it is running on the user's computer. If it is running on a
web page though, e.g., http://sagenb.org, then no, you definitely
can't do nasty shell level stuff on the user's computer.
Have you used TexMacs? It sounds like that may be something you'd be
very interested in, especially since you can execute Sage cells in it.
I had an inclination in this direction today when I was doing some
number theory research. I was developing an algorithm, partly doing
experiments in the notebook, and tracking all my progress in an emacs
latex document, ocassionally copying and pasting from the "Text" view
of a worksheet to verbatim blocks in emacs. For me, it would have
been very useful if the following were possible:
1. There were text cells between the compute cells, but their
contents were 100% latex, and stayed that way. Compute cells would be
exactly as is.
2. A process running in the background would latex a version of the
contents of my worksheet that would get written to disk regularly as a
100% valid latex document. It would have all the compute cells nicely
typeset in verbatim blocks (or something nicer), and everything
between compute cells would 100% be copied into this latex document.
3. I Preview program would run showing the nicely typeset form of
the latex document.
4. The possibility to also directly edit the latex document, and
have the Sage notebook server notice this and refresh the worksheet
based on those edits. This would make it easy to do big reorganize of
the document, search and replace throughout, a complicated emacs macro
With 1-4 above, I could typeset 100% correctly absolutely any latex
document with no funny business, but would have Sage I/O nicely
integrated in the document. I could chose to ignore the pdf preview,
or look at it when I want to.
The above would actually be fairly easy to implement, IMHO. This
would only be something that works on your own local desktop of
Note that this still has the old fashioned non WYSIWYG "write the doc
in one model, view typeset version in another" model. But I really
like having total control over my latex documents, with all my
standard macros, bibtex, etc., and this would make that possible,
while still embedding a complete sage worksheet session.
One issue that is not treated above is that a worksheet is typically a
lot shorter than a latex document, for me. For example, in what I was
doing earlier today the latex document was 32 typeset pages long. It
would thus also be very nice to easily be able to link multiple
worksheets together (maybe via ordered folders and cross references
Anyway, I'm guessing part of the point of this discussion is that some
people see that the Sage notebook could have an additional broader
role as a different kind of Latex editing environment (different than
say Lyx or Texmacs or Emacs).
Regarding Texmacs, that is an odd program -- some people hate it and
some people really love it. You can usually tell which you will be
within a few minutes. Note that what I describe above is *hugely*
different than either Texmacs or Lyx, in that one would have 100%
control and be able to edit any latex document however you want. It
would be more like maybe TexShop on the Mac or WinEdt on Windows, or
maybe Kyle on Linux (I've used all three of TexShop, WinEdt, and Kyle
a lot, by the way).
> With #1-4 in place for locally-running Sage, I'd hope the Notebook
> would still have the capacity to render some text cells in html (from
> latex), leave others in plain latex text, and of course letting non-
> Latex users retain FCKeditor.
I feel obligated to point out that Sage uses TinyMCE, not FCKeditor.
I think this is a great conversation to have. Thanks for bringing up