Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: [Novice] Automatic bracketing and Defaults Setup

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31569] Re: [Novice] Automatic bracketing and Defaults Setup
  • From: "P.J. Hinton" <paulh at wolfram.com>
  • Date: Wed, 14 Nov 2001 03:41:44 -0500 (EST)
  • Organization: "Wolfram Research, Inc."
  • Sender: owner-wri-mathgroup at wolfram.com

On Sun, 11 Nov 2001 Nospam_homh at momentum.chem.queensu.ca wrote:

> Could any kind soul out there show me if there is a way to have Mathematica
> (v4) set up such that everytime one enters brackets, their corresponding
> (closing) ones automatically appear?
>
> For example,
>
> Enter:  f = [
>
> Appears: f = [_]
>               ^
>           cursor is here
>
>
>  ... Steps later ...
>
>
> Enter:  f = [[{(Sin[
>
> Appears: f = [[{(Sin[_])}]]
>                      ^
>                cursor is here
>
>
> Also, I have searched the Math book, google, and wolfram and couldn't find
> any hints on how to have the magnification, the font family and font size set
> up as defaults ( I assumed that it is in the init.m file). It would be great
> if people can post their own favourite setups and beginners can use them as
> a start.
>
> Any help would be appreciated.

There is no feature as you describe.  However, it is possible to script
such an action and put the functionality under a button in a palette.  To
see how this is done, paste the following expression in a notebook.

ButtonBox[
    "[\[Placeholder]]",
    ButtonFunction :>
      NotebookWrite[
        InputNotebook[],
        RowBox[{"[", "\[Placeholder]", "]"}],
        Placeholder
        ],
    ButtonEvaluator -> None,
    Active -> True
    ] // DisplayForm

Evaluate the expression, which will generate a button.  Select the button
and then click on the front end menu command:

	File -> Generate Palette from Selection

This will create the palette.  This palette may be saved as a notebook
file.

To use the palette, simply click on the button whenever you would enter a
left square bracket.  This will paste a matched set of brackets and set
the edit caret in between the brackets.

-- 
P.J. Hinton
User Interface Programmer                         paulh at wolfram.com
Wolfram Research, Inc.



  • Prev by Date: Re: Built-in functions to C code
  • Next by Date: Zero does not equal zero et al.
  • Previous by thread: Re: [Novice] Automatic bracketing and Defaults Setup
  • Next by thread: Rendering Error in Raster and RasterArray