This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

InitializationCell

InitializationCell
is an option for Cell which specifies whether the cell should be tagged to be evaluated by the Mathematica kernel when the notebook that contains it is opened.
  • Additional front end options determine the precise behavior of initialization cells when a notebook is opened.
  • When you first save a notebook that contains initialization cells, you have the option to make a parallel auto-generated .m package that contains only the contents of the initialization cells. The package is by default automatically updated whenever the initialization cells in the notebook are changed and saved again.
Create and save a notebook that has an input cell marked as initialization:
Initialization cells are useful when you reopen the saved notebook:
You can use EvaluationEvaluate Initialization Cells to evaluate initialization cells:
Or, when you evaluate any cell, Mathematica asks if you want to evaluate the initialization cells:
If you choose Yes, initialization cells are evaluated:
Create and save a notebook that has an input cell marked as initialization:
In[2]:=
Click for copyable input
Initialization cells are useful when you reopen the saved notebook:
You can use EvaluationEvaluate Initialization Cells to evaluate initialization cells:
Or, when you evaluate any cell, Mathematica asks if you want to evaluate the initialization cells:
If you choose Yes, initialization cells are evaluated:
New in 3