2
$\begingroup$

From an answer to Keyboard entry of square bracketed matrices in text cells, How to? ,

I cribbed this code:

CurrentValue[EvaluationNotebook[], InputAliases] = 
  DeleteDuplicates@
   Append[CurrentValue[EvaluationNotebook[], InputAliases], 
    "bmat" -> 
     RowBox[{StyleBox["[", SpanMaxSize -> Infinity], 
       GridBox[{{"\[SelectionPlaceholder]", 
          "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"}}], 
       StyleBox["]", SpanMaxSize -> Infinity]}]];

It works OK, but sometimes Mathematica delets the SpanMaxSize directive when automatically reformatting. There may be a way to prevent that, but (I think) I would prefer that square brackets acted the same as parentheses, by default. Is there a way to make that happen?

Am I likely to regret doing so? That is, is there some compelling reason that square brackets (or curly brackets) are not "stretchy" by default?

Version 10.4.0 for Microsoft Windows (64-bit) (February 26, 2016)


Edit to add image showing surprising consequence of getting what I asked for. Not a show stopper, but ... enter image description here

$\endgroup$
1
$\begingroup$

This works for me in version 10.1:

SetOptions[$FrontEndSession, SpanMaxSize -> Infinity]

enter image description here

Change $FrontEndSession to $FrontEnd to make the setting persistent, or replace it with EvaluationNotebook[] to limit it to a single Notebook.

Off hand I cannot think of any problem this would cause; I believe it is simply a stylistic choice.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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