Skip to main content
1 of 3

Automatically load init.m without sharing CellContext

I'm trying to set up Mathematica such that all functions/variables defined in my init.m are automatically loaded into any new notebook I open. This works as a default, but I would also ideally like to set my CellContext to Notebook, such that notebook-specific functions/variables are not shared. However, doing this also makes init.m functions not work across new notebooks. I've tried figuring out how to do this with packages, but I haven't been able to find a clear resource on how I would set this up for my purposes.

To be succinct, what is the best way to set up a central file like init.m that is automatically loaded with each new notebook, but such that notebooks have their own context? Thanks for any advice/guidance you can give.