Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.2K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

A button for subscipted variables

POSTED BY: Malcolm Woodruff
2 Replies

See if this works to turn your subscripted variables to symbols.

I had a similar question answered by Hans Milton at Need help using Notation Package.

POSTED BY: Jay Gourley

I was aware of the need to be careful with Symbolize. The problem was getting it to work in a buttonm which then forms part of a palette that sets up my Notebook the way I want it to do engineering calculations. With a little help from tech support and Notebook assistant, I have settled on the following code.

subscriptButton = DynamicModule[{isPressed = False},
    Button[
       Style[Subscript[X, y], FontSize -> 16],
       (
         isPressed = ! isPressed;
          Symbolize[ParsedBoxWrapper[SubscriptBox["_", "_"]]]
        ),
       Appearance -> {"DialogBox", "Palette"},
       FrameMargins -> 0,
       Background -> 
    Dynamic[If[isPressed, RGBColor[1, 0.9, 0.8], White]],
       ImageSize -> 92,
       Method -> "Queued"
   ],
    Initialization ->  Needs["Notation`"]
  ]
POSTED BY: Malcolm Woodruff
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard