ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 13 Sep 2011 05:12:33 +0200default startup options for sage notebookhttps://ask.sagemath.org/question/8310/default-startup-options-for-sage-notebook/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?Thu, 08 Sep 2011 20:56:10 +0200https://ask.sagemath.org/question/8310/default-startup-options-for-sage-notebook/Answer by Kabi for <p>I am trying to set some default options for the sage notebook. An example is:</p>
<pre><code>latex = Latex(density=90, pdflatex=True)
</code></pre>
<p>This is for getting smaller output images in the notebook from %latex cells.</p>
<p>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?</p>
https://ask.sagemath.org/question/8310/default-startup-options-for-sage-notebook/?answer=12645#post-id-12645I 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.Tue, 13 Sep 2011 05:12:33 +0200https://ask.sagemath.org/question/8310/default-startup-options-for-sage-notebook/?answer=12645#post-id-12645Answer by niles for <p>I am trying to set some default options for the sage notebook. An example is:</p>
<pre><code>latex = Latex(density=90, pdflatex=True)
</code></pre>
<p>This is for getting smaller output images in the notebook from %latex cells.</p>
<p>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?</p>
https://ask.sagemath.org/question/8310/default-startup-options-for-sage-notebook/?answer=12640#post-id-12640I 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.Mon, 12 Sep 2011 09:40:57 +0200https://ask.sagemath.org/question/8310/default-startup-options-for-sage-notebook/?answer=12640#post-id-12640