First-line indentation (source code)

= First-line indentation

\b[First-line indentation] shifts the beginning of the first formatted line of a <text paragraph> relative to its normal starting edge. In a left-to-right layout, a positive indent reserves space on the left; the corresponding starting edge is on the right in a right-to-left layout. In <CSS>, `text-indent` controls this placement.<Text in Cascading Style Sheets Level 2 Revision 2 by World Wide Web Consortium>[§16.1: first formatted line, starting edge and indentation]{ref}

In a simple left-to-right column of width $W=40$ with indentation $d=10$, the first line begins at $x=10$ and has available <typesetting line width> $W-d=30$. Later lines can begin at $x=0$ and use all 40 units. A negative indent $d=-5$ instead places the start at $x=-5$, extending into the margin if no other layout constraint intervenes.

This changes the first line's geometry without adding printable <glyphs>. Replacing the indent by several stored spaces would couple the result to <word spacing>, white-space processing and the chosen <computer font>. A <line breaking> model can represent the change explicitly through its sequence of <typesetting line widths>.