Mathematica > Notebooks and Documents > Notebook Formatting & Styling > Stylesheets > Automatic Text Styling Features > AutoIndent >
Mathematica > Notebooks and Documents > Notebook Formatting & Styling > Text Styling > Automatic Text Styling Features > AutoIndent >

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.
Falsedo no indentation
Trueindent the same as the previous line
Automaticindent according to the structure of the expression (default)
  • With AutoIndent->True, tabs or spaces used for indentation on the previous line are explicitly inserted at the beginning of the new line.
  • Indentation after an \[IndentingNewLine] is automatically redone every time an expression is displayed.
Create a cell with AutoIndent->True:
Type some spaces at the beginning of a line:
When you press the
DynamicBox[ToBoxes[If[$OperatingSystem === MacOSX, Return, Enter], StandardForm], ImageSizeCache -> {35., {0., 9.}}]
key, Mathematica inserts the same indentation in the next line:
Create a cell with AutoIndent->Automatic:
Every time you press
DynamicBox[ToBoxes[If[$OperatingSystem === MacOSX, Return, Enter], StandardForm], ImageSizeCache -> {35., {0., 9.}}]
in this cell, Mathematica indents according to expression structure:
As you edit the cell further, the structural indentation shifts appropriately:
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 -> {35., {0., 9.}}]
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 -> {35., {0., 9.}}]
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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF