Re: Creating Palettes
- To: mathgroup at smc.vnet.net
- Subject: [mg86108] Re: Creating Palettes
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Sun, 2 Mar 2008 13:55:05 -0500 (EST)
- References: <fq8qi9$j5c$1@smc.vnet.net>
DOD wrote:
> I've just tried to create a palette in v6, it is much harder than it
> was in v5- is there a reason I can no longer "create a palette" from
> the edit menu, and then "generate from selection"? Anyway, I figured
> out the tedious way to do it v6, but it won't create buttons I want:
>
> CreatePalette[{PasteButton[a^2], PasteButton[b^2],
> PasteButton[a^3], PasteButton[b^3],
> PasteButton[(1 - a)], PasteButton[(1 - b)],
> PasteButton[(1 - a)^2], PasteButton[(1 - b)^2],
> PasteButton[(1 - a)^3], PasteButton[(1 - b)^3]
> }
> ];
>
> The parentheses around "(1-a)" and "(1-b)" are never created when I
> press the buttons, only "1-a" and "1-b", which is obviously a problem
> if I'm multiplying things. This defeats the purpose of the palette
> saving keystrokes. Is there anyway to do this?
>
If you want a paste button that represents multiplication then it is
probably best to use:
PasteButton[\[SelectionPlaceholder](1-a)]
Using this form of button, you can select an expression - say a+b and
get a correctly parenthesised product:
(a+b)(1-a)
David Bailey
http://www.dbaileyconsultancy.co.uk