Ask Your Question

default startup options for sage notebook

asked 2011-09-08 13:56:10 -0500

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

answered 2011-09-12 02:40:57 -0500

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

answered 2011-09-12 22:12:33 -0500

Kabi gravatar image

updated 2011-09-12 22:13:04 -0500

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():

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


Asked: 2011-09-08 13:56:10 -0500

Seen: 297 times

Last updated: Sep 12 '11