Ask Your Question
1

default startup options for sage notebook

asked 2011-09-08 20:56:10 +0100

Kabi gravatar image

I am trying to set some default options for the sage notebook. An example is:

latex = Latex(density=90, pdflatex=True)

This is for getting smaller output images in the notebook from %latex cells.

Right now I set this option manually, but my problem is that reset() also resets this option. Is there some way to set default options/settings to avoid having settings like this repeated numerous times in each worksheet?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2011-09-12 09:40:57 +0100

niles gravatar image

I don't know if there's such a setting, but here's an idea to get close to what you want: You could put the commands you want in a separate file, which you load at the beginning of each worksheet (you could use %auto to automatically evaluate that cell when you open the worksheet too). At least you wouldn't have to copy and paste a long list of commands for each new worksheet, and if you update the defaults they would be automatically updated for all worksheets.

edit flag offensive delete link more
0

answered 2011-09-13 05:12:33 +0100

Kabi gravatar image

updated 2011-09-13 05:13:04 +0100

I have done something similar to what you suggest to solve this. I have defined the following in init.sage, which is run every time a worksheet opens:

def clear():
    reset()
    attach('~/.sage/init.sage')

I can then use clear() instead of reset(), and all other functions and options put in init.sage will be available all the time. But thanks for pointing me in the right direction.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-09-08 20:56:10 +0100

Seen: 661 times

Last updated: Sep 13 '11