notebooks default context
- To: mathgroup at smc.vnet.net
- Subject: [mg112261] notebooks default context
- From: apjs64 <apjs64 at gmail.com>
- Date: Tue, 7 Sep 2010 02:01:28 -0400 (EDT)
Firstly a problem, my packages (.m) keep having their context reset
to global every time I open them to edit rather than "unique to each
cell" to which I have previously set them to.
THIS IS THE QUESTION (rest waffle)
I would like to set a notebooks default context to "Unique to each
cell" in a notebook initialisation cell. Usually I use "Unique to this
notebook" from the menu (which is fine and persists), however on
occasion I would like to tighten things up.
------------
WAFFLE
------------
I think I don't clearly understand the use of the Package` context
instructions. My basic package setup is as follows (which works):
BeginPackage[ "Package`"]
Begin[ "Public`"]
preProcess`outNB[nb_] = "something";
End[];
Begin[ "Private`"]
End[]
End[]
so this is could be one source of the problem.
This is part of a general question on good programming technique in
mathematica. My instinct is that for non-trivial notebooks and
packages "unique to cell" is the best method and the results should
then be put into a context for the notebook to make them available to
other cells.
-------------------------------------------------
eg Notebook : aParabola.nb
----------------
cell:
a = 132
t = .5
aParabola`arcLength = a * (t * Sqrt[1 + t^2] + Log[t + Sqrt[1 +
t^2]]);
------------------
Is there a best practice? I know this is a messy question, I hope it
is clear.
Regards,
Jeremy Duncan
Regarding a previous post on fonts I now use:
SetOptions[$FrontEnd, FontFamily->"Arial"];
SetOptions[$FrontEnd, FontSize->10];
as soon as you ask the question, the solution suddenly becomes clear!