Re: Symbolize Problem
- To: mathgroup at smc.vnet.net
- Subject: [mg69682] Re: [mg69678] Symbolize Problem
- From: "Chris Chiasson" <chris at chiasson.name>
- Date: Thu, 21 Sep 2006 07:28:52 -0400 (EDT)
- References: <200609200644.CAA24480@smc.vnet.net>
I went through a phase with the Notation package too. It is quite
useful, but I recommend just working directly with Format + MakeBoxes
and MakeExpression if you're going to change things. Think of the
Notation package as a graphical wrapper for defining
MakeBoxes/MakeExpression rules via the notebook interface instead of
typing everything out. Anyway, you could probably guess how to define
the correct MakeExpression rule just from looking at the source code
you provided to us.
MakeExpression[RowBox[{SuperscriptBox["\[Del]","2"],whatever_String}],_]:=
MakeExpression["delSquared"<>whatever]
I strongly caution you to stay away from MakeExpression. Just think of
the problems WRI has with TraditionalForm input - and they invented
the Mathematica box model. Format & MakeBoxes, OOTH, are nice
functions for formatting your output.
On 9/20/06, Peter <pjcrosbie at attglobal.net> wrote:
> I am attempting to write more readable code by defining some custom
> symbols. I can get simple constructions to sumbolize but I fail on
> anything too complicated. For example,
>
> Symbolize[$B"&(B_]
>
> Cell[BoxData[
> RowBox[{"Symbolize", "[",
> TagBox["\[EmptyDownTriangle]_",
> NotationBoxTag,
> TagStyle->"NotationTemplateStyle"], "]"}]], "Input"]
>
> Works fine and symbolizes things like $B"&(Bf without problems.
>
> However, if I add a superscript to the $B"&(B as in
>
> Cell[BoxData[
> RowBox[{"Symbolize", "[",
> TagBox[
> RowBox[{
> SuperscriptBox["\[EmptyDownTriangle]", "2"], "_"}],
> NotationBoxTag,
> TagStyle->"NotationTemplateStyle"], "]"}]], "Input"]
>
> then the symbol following the $B"&(B^2 is always interpreted as a
> multiplication.
>
> Any ideas would be really helpful.
>
>
--
http://chris.chiasson.name/
- References:
- Symbolize Problem
- From: "Peter" <pjcrosbie@attglobal.net>
- Symbolize Problem