2
$\begingroup$

I am trying to introduce a special superscript notation in mathematica but it does not work

Clear["Global`*"]
Needs["Notation`"]
Symbolize[ParsedBoxWrapper[SuperscriptBox["W", "(c)"]]]
W^(c) = 1

(* Set::write: Tag Power in W^c is Protected. >> *)
(* 1 *)

However, it works in the following case

Clear["Global`*"]
Needs["Notation`"]
Symbolize[ParsedBoxWrapper[SuperscriptBox["W", "_"]]]
W^(c) = 1

(* 1 *)

I don't understand that why it is not working in the first case! and I really need to just set that special notation not every superscript.

It should be mentioned that if one directly uses the Symbolize from notation palette there won't be any problem at all but the thing is that why the equivalent 2D command is not working properly.

$\endgroup$
6
  • 3
    $\begingroup$ Are you literally using Symbolize[ParsedBoxWrapper[SuperscriptBox["W", "_"]]] or the template generated by the palette? (I know if you cut and paste you get the ParsedBoxWrapper) I get no problems using the palette template but get the same problem using your 2D code $\endgroup$ Commented Mar 29, 2017 at 2:45
  • $\begingroup$ @MikeHoneychurch: I am using the 2D code. So it seems to be a bug or we are missing something! $\endgroup$ Commented Mar 29, 2017 at 3:19
  • 2
    $\begingroup$ use the palette. that is what it was designed for $\endgroup$ Commented Mar 29, 2017 at 4:17
  • $\begingroup$ @MikeHoneychurch: I got it from your previous comment but why the equivalent 2D code is not working! $\endgroup$ Commented Mar 29, 2017 at 14:11
  • 2
    $\begingroup$ You should check the box structure of W^(c) by using Cell | Show Expression and make sure your pattern is consistent. $\endgroup$
    – Carl Woll
    Commented Apr 5, 2017 at 15:25

1 Answer 1

4
$\begingroup$

I assume you've typed the following in a cell:

W Ctrl+6 ( c )

Then, go to the menu, and select Cell | Show Expression (or use Cmd+Shift+E on OSX).

You will find that the box structure is:

SuperscriptBox["W", RowBox[{"(", "c", ")"}]]

not

SuperscriptBox["W", "(c)"]

So, try using the above box structure instead.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.