Re: Using Utilities`Notation` in a package
- To: mathgroup at smc.vnet.net
- Subject: [mg16287] Re: [mg16131] Using Utilities`Notation` in a package
- From: "Nicolas B.E. Sawyer" <nbes at eee.nott.ac.uk>
- Date: Sun, 7 Mar 1999 01:05:27 -0500
- Organization: University of Nottingham
- References: <7b36fa$23r@smc.vnet.net> <199902270823.DAA05026@smc.vnet.net.> <7bihla$cm$8@dragonfly.wolfram.com>
- Sender: owner-wri-mathgroup at wolfram.com
I've finally got there (after a number of e-mails to Reinhold
Kainhofer).
The 3.0.0 palette doesn't include Symbolize so I couldn't use it to
define my package. Even using an example package Reinhold sent me didn't
work with the Notation package I had. I've upgraded to 3.0.1 things
work.
There's just one quirk which I get on my PC when I show extra
information on my symbol "a subscript n" (having Symbolized it in a
package).
With a narrow notebook window, the second UnderBracket is not shown as a
character as can be seen by pasting the following into a notebook
a\[UnderBracket]Subscript\[UnderBracket\
]n = "Subscript symbol"
However, increase the width of the notebook before executing the cell to
show the symbol information and everything is fine, as can be seen by
pasting this result:-
a\[UnderBracket]Subscript\[UnderBracket]n = "Subscript symbol"
Reinhold Kainhofer wrote:
>
> 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
--
Nicolas B.E. Sawyer
Department of Electrical and Electronic Engineering,
University of Nottingham,
University Park,
Nottingham,
NG7 2RD.
Tel: +44 115 9515151 ext 12028
Fax: +44 115 9515616
E-mail: nbes at eee.nottingham.ac.uk