Hi LyX developers!

Enthused with use of R (via Sweave) in LyX I started to also look for 
integration of SAGE (see http://www.sagemath.org). Since Python is used the 
integration should be doable. However, luckily much has already been done with 
the SageTeX (see last example at http://www.sagemath.org/tour-research.html and
http://www.ctan.org/tex-archive/macros/latex/contrib/sagetex/). This is really
a nice interface for CAS (free as well as comercial ones!). 

One adds LaTeX markup such as \sage{}, \sageplot{},  begin{sageblock} ... 
\end{sageblock} etc. to a LaTeX file (for more see docs at 
http://www.ctan.org/get/macros/latex/contrib/sagetex/sagetexpackage.pdf).
Then the compilation is done via:

latex file.tex
sage file.sage
latex file.tex 
...

First steps creates the sage script (file.sage) which needs to be evaluated 
with sage. The third step is a start of a "normal" LaTeX compilation.

Does anyone have any idea how we could use this directly in LyX? If there
would be a special file format, we could use the same thing as with Sweave
(see http://cran.r-project.org/contrib/extra/lyx/). Since the first step is
a LaTeX run and the file is a "pure" LaTeX markup, I do not know how to tell
LyX to run latex and sage before a "normal" LaTeX compilation.

Working example of SageTeX is in sage-*/examples/latex_embed folder of a SAGE
distribution. See the following blog post on howto install SAGE under Linux.

http://ggorjan.blogspot.com/2008/09/sage-open-source-mathematics-software.html

Regards, Gregor

Reply via email to