MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Setting global InputAutoReplacements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105162] Re: [mg105083] Setting global InputAutoReplacements
  • From: Leo Alekseyev <dnquark at gmail.com>
  • Date: Mon, 23 Nov 2009 06:50:28 -0500 (EST)
  • References: <4e3ad400911220323x4b1ebae2i708592923faf9b2f@mail.gmail.com>

Thanks for the clarification.  Originally I assumed your cell had to
replace the original one exactly where it appeared in the Core.nb
template -- which made the procedure needlessly complicated.

On Sun, Nov 22, 2009 at 6:40 PM, John Fultz <jfultz at wolfram.com> wrote:
> Format->Edit Stylesheet...
>
> Paste the cell I included.  For a single notebook, you're done.
>
> Click Install in the toolbar.  Choose a filename and install it.  That name will
> now show up in the Stylesheets menu.  Choose that stylesheet and it works.
>
> Or, choose the name of an existing stylesheet (like Default.nb).  This will,
> unfortunately require a restart of M-- to see it, but now it works for all
> notebooks using that stylesheet.
>
> These are much better than editing a stylesheet inside of the installation
> directory, a procedure I don't encourage.
>
> Sincerely,
>
> John Fultz
> jfultz at wolfram.com
> User Interface Group
> Wolfram Research, Inc.
>
>
> On Sun, 22 Nov 2009 06:23:16 -0500, Leo Alekseyev wrote:
>> John, much thanks for the quick reply.  Allow me to elaborate, for the
>> benefits of whoever might be interested in setting up replacement
>> aliases (I think they are very handy!)
>>
>> First, back up the existing Core.nb.
>> Then, open the options inspector, select "Core.nb"   from the first
>> drop-down box, and under Notebook Options -> File Options select
>> "Editable" and Saveable" (in that order).  Then in Core.nb expand
>> the last item, "Styles for Mathematica System-specific Elements" and
>> then expand "FormatType Styles".  Find local definitions for
>> StandardForm .
>>
>> At this point you could try fiddling with InputAutoReplacements via
>> the options inspector , but this results in an error (at least for
>> me).  So what you need to do is open Core.nb in a text editor, search
>> for the line Cell[StyleData["StandardForm"], and add custom
>> replacement (as per John's instruction).  Alternatively, select the
>> cell, go to Edit->Copy As cell expression, paste it in a text editor
>> somewhere, make the necessary modifications, paste the cell expression
>> back (interpreting it) and delete the old cell.  You are done!
>>
>> I hope this procedure is made easier in future versions :)
>>
>>
>>> This particular option isn't as easy to figure out or set as I'd like.
>>> Two
>>> clarifications...
>>>
>>> ParentList represents the ones which have been inherited from the
>>> notebook level
>>> (which, in this case, actually refers to replacements that are set
>>> globally
>>> throughout the system).
>>>
>>> And the settings for "->", ":>", etc., are actually set in the
>>> StandardForm
>>> style, not the Input style.
>>>
>>> So, to add the "abc"->"123' replacement, you'd add a StandardForm style
>>> cell to
>>> your stylesheet as follows...
>>>
>>> Cell[StyleData["StandardForm"],
>>> InputAutoReplacements->{
>>> "abc" -> "123", "->" -> "\[Rule]", ":>" -> "\[RuleDelayed]", "<=" ->
>>>  "\[LessEqual]", ">=" -> "\[GreaterEqual]", "!=" -> "\[NotEqual]"=
,
>>>  "==" -> "\[Equal]", ParentList}]
>>>
>>>
>>> Sincerely,
>>>
>>> John Fultz
>>> jfultz at wolfram.com
>>> User Interface Group
>>> Wolfram Research, Inc.
>
>
>
>


  • Prev by Date: Kernel crashes in ReplaceAll - with or without Maximize failure
  • Next by Date: Re: "If" syntax question
  • Previous by thread: Re: Setting global InputAutoReplacements
  • Next by thread: Help with algorithm to find rational roots of a bivariate equation?