I have a notebook I wish to set up where the sections are conceptually related to each other. But, I wish to isolate them from each other programmatically, so that they do not interfere with one another. A built-in method of doing this is to set the default context to CellGroup so that each group of cells has its own context. However, each section relies on the same set packages, and because one of them is quite large, I do not wish to reload the packages for each section. An option is to put each section in its own context manually using Begin and End, but I would rather avoid that if possible. Ideally, though, I would like to be able to load the packages in their own separate section and elevate them to the Global` (or equivalent) context. Any thoughts on how this can be accomplished?
|
|
||||
|
|
|
One possibility would be to modify the notebook's stylesheet so that
Then your package's context should be available to all the code:
|
|||||
|
|
Below Brett's answer:
Perhaps you know this but Packages are already loaded to a shared context in the sense that doing What remains is getting e.g.
Starting with
Or we could use a custom
Which will add any context created with |
|||
|
|


