MathGroup Archive 1999

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

Search the Archive

Re: Using Utilities`Notation` in a package

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16185] Re: [mg16131] Using Utilities`Notation` in a package
  • From: Reinhold Kainhofer <reinhold>
  • Date: Tue, 2 Mar 1999 01:13:23 -0500
  • Organization: Tu Graz
  • References: <7b36fa$23r@smc.vnet.net> <199902270823.DAA05026@smc.vnet.net.>
  • Sender: owner-wri-mathgroup at wolfram.com

One possibility (that I use mostly, although it is not a good style) is to
include a 1^1; (using a real superscript) in every cell that contains a
Notation, Symbolize etc. call. This makes Mathematica save the complete box
structure to the package including the TagBox that is needed for Notation
(This TagBox is automatically created if you use the palette. Notation etc.
won't work without the TagBox!)

Reinhold




Nicolas B.E. Sawyer wrote:

> 1) How do I inlude this:-
>
> \!\(<< Utilities`Notation`; \nSymbolize[a\_n]; \)
> \!\(\*
>   RowBox[{
>     RowBox[{\(a[y_]\), ":=",
>       RowBox[{"StandardForm", "[",
>         RowBox[{
>           StyleBox["Subsuperscript",
>             "MR"],
>           StyleBox["[",
>             "MR"],
>           RowBox[{
>             StyleBox["a",
>               "TI"],
>             StyleBox[",",
>               "MR"], " ",
>             StyleBox["n",
>               "TI"],
>             StyleBox[",",
>               "TI"],
>             StyleBox["y",
>               "TI"]}],
>           StyleBox["]",
>             "MR"]}],
>         StyleBox["]",
>           "MR"]}]}],
>     StyleBox[";",
>       "MR"], "\n",
>     \(a[y_Real] := \(Interpolation[Table[{x, x^2}, {x, 0, 10}]]\)[y]\),
> ";",
>     \(a[y_Integer] := \(Interpolation[Table[{x, x^2}, {x, 0,
> 10}]]\)[y]\),
>     ";", "\n", \(Notation[a\_n\%y_ \[DoubleLeftRightArrow] a[y_]]\)}]\)
>
> in a package, so that
>
> In[89]:=
> \!\(a\_n\%x\n
>   a\_n\%4.\n
>   a\_n\%4\)
>
> gives
>
> Out[89]//StandardForm=
> \!\(\*
>   InterpretationBox[\(a\_n\%x\),
>     Subsuperscript[ a, n, x],
>     Editable->False]\)
> Out[90]=
> 16.
> Out[91]=
> 16






  • Prev by Date: Re: How to convert .eps to .gif ??
  • Next by Date: Sound with Mathematica
  • Previous by thread: cancel <7b8blf$52b@smc.vnet.net>
  • Next by thread: Re: Using Utilities`Notation` in a package