- Indentation
-
An indentation may refer to:
- A notch, or deep recesses; for instance in a coastline, or a carving in rock
- The placement of text farther to the right to separate it from surrounding text.
The first meaning is also applied in hardness measurement as in indentation hardness.
For an example of the second meaning, this is an indentation of one non-breaking space:
Indented block because this is something
and this is an indentation of two non-breaking spaces:
Indented block 2
In the written form of many languages, an indentation is often used at the beginning of a line to signal the start of a new paragraph.
Outdentation is a neologism used in computer circles to describe placing text back to the left again.
Some languages (e.g. Hebrew and Arabic) are written right-to-left, and if indentation is used, in the above "left" and "right" should be swapped when referring to such languages.
Indentation in typesetting
There are two main types of first-line indent: normal and hanging. A "normal" indent indents the first line, as shown here, an indent of one centimeter:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.The other kind, a hanging indent, indents the rest of the text while leaving the first line in place; as shown here with a hanging indent of one centimeter:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Indentation in programming
Main article: Indent styleIn computer programming languages, indentation is used to format program source code to improve readability. Indentation is generally only of use to programmers; compilers and interpreters rarely care how much whitespace is present in between programming statements. However, certain programming languages rely on the use of indentation to demarcate programming structure, often using a variation of the off-side rule. The Haskell, Occam, and Python programming languages rely on indentation in this way.
Debates over where to indent, whether to use spaces or tabs, and how many spaces to use are often hotly debated among programmers, leading some to classify indentation as akin to a religious war.[1] Different indentation styles are commonly used. In 2006 a third method of indentation was proposed, called elastic tabstops.
Notes and references
Categories:
Wikimedia Foundation. 2010.