MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: notebooks default context

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112298] Re: notebooks default context
  • From: Chris Degnen <degnen at cwgsy.net>
  • Date: Wed, 8 Sep 2010 00:59:04 -0400 (EDT)
  • References: <i64kfg$39a$1@smc.vnet.net>

You may find this post from David Reiss helpful:

http://forums.wolfram.com/mathgroup/archive/2009/Jul/msg00530.html



On Sep 7, 7:01 am, apjs64 <apj... at gmail.com> wrote:
> 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!



  • Prev by Date: Re: user-defined functions in KeyEventTranslations.tr
  • Next by Date: A slow start
  • Previous by thread: Re: notebooks default context
  • Next by thread: Re: notebooks default context