Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Learning the system' topicStudent Support Forum > General > "Learning the system"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Forum Moderator
email me
04/05/98 09:02am

> How do I set up MMA to initialize a .nb when I load it. When I save a .nb and the exit MMA, and then restart and reload the .nb, I'm not in the same environment. I.e., loading of add-ons and function definitions are forgotten. I find I have to reload Statistics each time, and re-execute function definitions. Is there some way to keep the environment (Context?) between sessions?
> Thanks. Thomas

You can mark the cells you wish to have evaluated on startup as initialization cells using Cell | Cell Properties. Once you do that, you will have several options:

- When you save the file you will have the option to create an AutoSave package which will be a companion package to your notebook which can be loaded using Get or Needs (you may have to attend to the location of the file to make sure that location is in $Path). The AutoSave package will be updated each time you save your notebook changes to reflect the initialization cells that are in the notebook.

- If you do not create the AutoSave package you can evaluate the initialization
cells after opening by evaluating the first one and then responding to the
dialog that asks if you wish to evaluate all the initialization cells.

You can also change the behavior of the FrontEnd so that initialization cells
are automatically evaluated when you open the notebook by changing the option
Notebook Options | Evaluation Options | InitializationCellLoading to True.
You can also turn off the dialog by changing the option,
Notebook Options | Evaluation Options | InitializationCellLoading to False

Tom Zeller
Forum Moderator

URL: ,

Subject (listing for 'Learning the system')
Author Date Posted
Learning the system Mark Riste 10/24/98 07:19am
Re: Initializing a Notebook Forum Modera... 04/05/98 09:02am
Re: Learning the system Casey Mann 10/26/98 05:53am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic