On 4/23/07, didier deshommes <[EMAIL PROTECTED]> wrote: > > Hi there, > I've noticed 2 problems with tne notebook:
These are both design decisions rather than bugs. > -- When running sage in notebook mode from a directory other than > SAGE_ROOT (btw, I'm glad I can finally do this), One could run the notebook from any directory ever since the notebook was first released. > SAGE reads/writes my > worksheets in $CURR_DIR/sage_notebook. That's the design. If you type "sage -notebook" or type the notebook command but don't give a directory name, then the default notebook sage_notebook in the current directory is created and run. The same is true for the wiki (e.g., type wiki() to run a wiki from the current directory). > For example, iI'm running SAGE from: > {{{ > /home/dfdeshom/custom/sage/devel/sage-main > }}} > > Running sage in notebook mode, I read this on top of the page: > {{{ > SAGE Notebook running from /home/dfdeshom/custom/sage/devel/sage-main/ > sage_notebook. > }}} > And in fact, a directory is created and my worksheet is there. Is > there any way to prevent this? Maybe there should be a NOTEBOOK_DIR > variable set so that every worksheet created is forced to live in > SAGE_ROOT/sage_notebook? How do you start the notebook? Do you type "notebook()" from in SAGE or do you type "sage -notebook" on the command line? If you start the notebook from the command line, you might just create a little shell script that cd's to SAGE_ROOT and then runs "sage -notebook": cd /home/dfdeshom/custom/sage/ ./sage -notebook > -- When running SAGE from $SAGE_ROOT, every time I create a new > worksheet, it is created in "GAP mode" (a new feature in 2.4.2, I > think). The mode thing has been in SAGE since when the notebook was introduced. But the interface to use it is sucks, as you've discovered. I'm amazed I haven't improved it yet, but I've been so busy with other things. > This does not happen when I run it from a non-standard > directory. How do I get out of this mode? >From in SAGE do this: sage: notebook(system="sage") At some point you must have typed notebook(system="gap") which sets that copy of the notebook to create GAP worksheets by default. You can also do notebook(system="maple") so that SAGE will create only maple worksheets by default. Existing worksheets in the notebook aren't affected -- just new ones use the given system (and always will in the future). This is actually a pretty cool feature; my impression is that a lot of people use SAGE mainly for this feature. > On a related note, how is GAP mode implemented in the notebook? I've > been dreaming of writing Maple programs via the notebook since Maple's > own worksheet mode gets in my way (es) Just try notebook(system="maple"). Actually anyone can easily make modes for anything -- if you start sage after typing notebook(system="foo"), then all input cells get passed to foo.eval(...) and the result gets displayed. That's it. So if you add a foo object with an eval method, you get the option of a foo mode. E.g., Bobby Moretti easily made a jsmath mode this way; in fact, just try notebook(system="jsmath") to get jsmath notebooks. You can always go from one mode to another in a given worksheet by putting %modename at the top. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---