Message Boards Message Boards

0
|
4962 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Is there a command to evaluate the initialisation cells?

Posted 11 years ago
Hi!

I was woundering if there is a command (in the sense of a mathematica input line) to evaluate all initialisation cells? I would find this really handy.

cheers!
POSTED BY: Gernot H
2 Replies
It sounds like the best solution to your problem might be to just create a package file (a plain text file with .m extension) containing the initialization commands and read in that package file with Get[].  The simplest way to do this is the following:
  1. Open the notebook containing the initialization cells
  2. Go to Format -> Option Inspector
  3. In the first drop-down choose "Selected Notebook" and type AutoGeneratedPackage in the search box
  4. Set the option value for AutoGeneratedPackage to Automatic
  5. Now save the notebook.  From now on whenever you save the notebook the contents of the initialization cells will be written into a package file located in the same directory as the notebook.
That said, it is possible to programmatically invoke any menu function and evaluating the initialization cells is available in the Evaluation menu.  But I'm not sure this is a good solution to your actual problem.
POSTED BY: Szabolcs Horvát
Posted 11 years ago
Hi there, and thanks for the reply.

The second thing you mentioned sounds like what I was looking for. I will try that. Thanks!
POSTED BY: Gernot H
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract