Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I like to group the 2 parts of the If statement and others like it by using () to help me be able to still understand what my code is doing the next day I look at it.

I started to use 2D math in input cells, and it is a nice feature of Mathematica.

But noticed that () changes size depending on what is inside them. So I end up with non-symmetrical (different size) parentheses within the same logical grouping. An example will help show this:

enter image description here

Notice how the top () are small compared to the lower (). The code will look better on the screen if the sizes of these () are kept the same. (either both large, or both small, is not important, as long as the size is the same)

This happens with With and any other such command.

I know the () are not needed. I just use them to make the code easy to read. When I have complicated logic, these help me see the parts more clearly.

Here is the actual code that generated the above converted to InputForm in order to paste it here

Clear["Global`*"]
If[x == 1, x = 0, x = Sqrt[y^2] ]; 

Question is: Is there a way to control this aspect of the display in input cells for 2D math so that parentheses are the same even if using 2D math?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

If you want the height of the () in StandardForm input cells to be fixed to one character tall, modify the "StandardForm" style in corresponding stylesheet would help:

Cell[StyleData["StandardForm"], SpanMaxSize->0]

Note this will affect all spanning characters such as parentheses, brackets, braces and etc. Please do search span in document center for more relevant options and details.

share|improve this answer
add comment

Your Answer

 
discard

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.