AutoIndent

AutoIndent
is an option for Style and Cell that specifies what automatic indentation should be done at the beginning of a new line after an explicit return character has been entered.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Create a cell with AutoIndent->True:

In[1]:=
Click for copyable input

Type some spaces at the beginning of a line:

When you press the DynamicBox[ToBoxes[If[$OperatingSystem === MacOSX, Return, Enter], StandardForm], ImageSizeCache -> {30., {0., 8.}}] key, Mathematica inserts the same indentation in the next line:

Create a cell with AutoIndent->Automatic:

In[1]:=
Click for copyable input

Every time you press DynamicBox[ToBoxes[If[$OperatingSystem === MacOSX, Return, Enter], StandardForm], ImageSizeCache -> {30., {0., 8.}}] in this cell, Mathematica indents according to expression structure:

As you edit the cell further, the structural indentation shifts appropriately:

New in 3 | Last modified in 4
New to Mathematica? Find your learning path »
Have a question? Ask support »