# automatically add Global to $ContextPath for all notebooks when using CellContext->Notebook I have some definitions in my init.m. E.g. my init.m contains this: hex[n_]:=BaseForm[n,16];  I know that Mathematica puts this in the Global context, and in a default configuration, each notebook's $Context is Global and its $ContextPath also contains Global. So my definitions are automatically available in any notebook I create. However, I prefer the CellContext->Notebook option so each of my notebooks automatically gets its own private context. The problem is that this option (obviously) changes $Context to something other than Global, and it also removes Global from $ContextPath. So my init.m definitions are not automatically available in any notebook I create. Now, I could type Globalhex when I want to use my hex function, or I could do AppendTo[$ContextPath, "Global"] in each notebook. But I would rather have Global added to each notebook's $ContextPath automatically. Is there a way to get Global into each notebook's $ContextPath automatically? Or is there some other way I can make my personal definitions available to each notebook automatically while using the CellContext->Notebook option?

-
–  rm -rf Oct 19 '12 at 4:40

Probably the simplest method would be to define your init.m functions in the System context itself as this is always accessible no matter the CellContext. For example:
Systemhex[n_] := BaseForm[n, 16]

Another strategy would be to put all your custom functions in a package or custom context (e.g. MyTools) and use CellProlog as described by Brett Champion in the question linked above to add this context to $ContextPath for all cells. - I guess I will go with using CellProlog to append "Global" to my $ContextPath. Thanks for your answer. –  rob mayoff Oct 19 '12 at 19:09