Thanks Dan. Now I have a harder (I suspect) question...
I have quite a long Sage script which does a complicated computation I
have been working on with a student of mine (in case anyone is
interested it computes explicit models for three modular curves of
level 13, all of genus 3!). In my normal way I have a plain .sage
file which I can read in, which outputs useful info as it goes, and
which also contains a lot of comments about what it is doing. As the
script has grown, so too have the comments, to the extent that they
vastly outnumber lines of code.
I should probably convert this into a worksheet with the comments as
nice text cells. But as an alternative and an experiment I started
making it into a sagetex document -- we might even write up this
computation at some point after all. However, there are a few lines
near the beginning of the script which take a while to run (a minute
or two), and I became impatient at having to wait that time every time
I had to rerun Sage after adding to the latex file.
Wouldn't it be nice if somehow the Sage process which does the
computations required for sagetex to be kept running so that when
recompiling the latex, only new lines would be computed and not
everything from scratch? Or perhaps this is a silly idea and I should
just use a worksheet and output the whole thing to pdf when finished.
John