I often correct homework by checking the calculations in Mathematica. Sometimes you would like to have two solutions open at once. However often defined symbols such as f
or phi
regularly overlap between the two notebooks.
Is there a way to separate them other than using different symbols in every notebook?
Is it possible to separate some variables yet share others between notebooks?
Answer
May be this, I have not tried it, but it sounds like this is what you are looking for (if I understood you correctly):
Evaluation menu -> Notebook's Default Context -> Unique to This Notebook.
So, you do the above for each notebook.
I found this in the daily Mathematica tip webpage: http://twitter.com/mathematicatip
Update
If you want to do it programatically from within a notebook, run SetOptions[EvaluationNotebook[], CellContext -> Notebook]
.
Update 2
To set this automatically for all new notebooks, open the Options Inspector (Ctrl/Command+Shift+O), and change the scope to "Global Preferences." Then, the option CellContext is found under Cell Options -> Evaluation Options. Change it to "Notebook."
Comments
Post a Comment