On Tue, 16 Nov 2010 at 10:37AM -0800, craigp wrote:
> I'm thinking of using sage to write various kinds of technical docs
> (math in particular, naturally). I've just started to learn Latex, but
> I find some of aspects of that limiting (macros in particular).

"Limiting" is an amusing choice of words, since TeX's macros constitute
a Turing-complete programming language.

> 1) I'd like to use rst (restructured text) for other docs, eg: a trac
> wiki. Ideally, I'd like to embed sage into wiki pages (perhaps with an
> option to save-as latex, pdf, etc). I noticed trac is an optional part
> of the sage distribution, but it isn't clear whether this supports
> embedding rst/sage (exactly as sage's manuals are written). Is this
> supported, and if not, is anyone working in this direction, or would
> there be interest if I wrote a trac plugin to accomplish this?

I'm not sure precisely what you mean here, but AFAIK the optional Trac
package doesn't do anything special with embedding Sage into ReST.

Do you want to embed Sage into ReST in the same way that SageTeX embeds
Sage into LaTeX, or that Sweave embeds R into LaTeX? That is, you have
special bits in the text that are somehow processed and replaced by the
results of the corresponding Sage computations. There is nothing like
that for ReST that I know of, but I'd love to hear about it.

> 2) Is there support for introspection in sage? For example, could I
> query a notebook/worksheet/session to find all definitions and
> references to vector defined functions, or functions starting with a
> certain name, or 4*4 complex-valued matrices, etc?

Yes. If you have a function, add a question mark and evaluate the cell.
Try 

sin?

or

search_def?

If you add two question marks, you get the corresponding source code.
Above you say that you want to query a "notebook/worksheet/session"
about these things; I don't know any way to limit something like
search_def to the current session, although there is extensive tab
completion available.

Dan

--
---  Dan Drake
-----  http://mathsci.kaist.ac.kr/~drake
-------

Attachment: signature.asc
Description: Digital signature

Reply via email to