Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Per this question, I have created a custom graphical control object which evaluates to a list of values. I would like to be able to create such an object quickly, rather than typing some command, pressing shift+enter, then copying the resulting object into wherever I want to use it. For example, something like typing \[Theta] which turns into θ... is it possible to create such a custom shorthand notation? (Even better, is it possible that when I start to type in a function which takes such a list as arguments, it pops up this control object for me to type the values in?)

share|improve this question
up vote 7 down vote accepted

Assuming you are referring to this control. You can

  • Evaluate in a separate cell each time and copy paste (you don't like this)
  • Write the command and evaluate in place
  • Copy the control once and paste it several times: remember the variables were localized so each will have its own copy and they won't interfere
  • Create a palette

    CreatePalette@PasteButton["Paste control", myControl["a"~CharacterRange~"g"]];
  • Create a toolbar

    AppendTo[CurrentValue[InputNotebook[], DockedCells], 
       ToBoxes@PasteButton["Paste control", 
  • Create an input alias, or an input auto replacement. Example of input alias (the other one is the same)

    AppendTo[CurrentValue[InputNotebook[], InputAliases], 
     "control" -> ToBoxes@myControl["a"~CharacterRange~"g"]]
share|improve this answer
Thanks, this lead me to find InputAutoReplacements which was what I wanted. Do you have any idea why it selects a random field/object in the box instead of highlighting the first text field when the replacement happens? – jtbandes Nov 24 '12 at 1:05
@jtbandes not off the top of my head. Generally \[SelectionPlaceholder]s are used to represent where the selection will go so you could try initializing the control with that character – Rojo Nov 24 '12 at 19:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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