Go to the previous, next section.

Indenting text

Troff provides two ways to indent text. The first is for indenting the first line of paragraphs, and the second is for indenting examples, lists, and similar information.

To indent the first line of paragraphs, include the following command in your file immediately before each paragraph that is to be indented:

`.PP'

A file whose paragraph's first lines were to be indented might look like this:

.PP
Once upon a time, a long time ago, there was a
little girl named Goldilocks.  She lived near
a big forest that was full of wonderful trails.
.PP
One day, Goldilocks went for a very long walk on
one of the trails.  Pretty soon, she came upon
a lovely house in a clearing.

The first line of each paragraph, starting with "Once" and "One" will be indented.

To indent examples, lists, etc., include the following command in your file directly before the text that is to be indented:

.in indentation

Replace indentation with the amount you want the left margin to be indented. For example, if you had an example you wanted to indent, like the Goldilocks example, your file would look something like this:

.in 0.5i
.PP
Once upon a time, a long time ago, there was a
little girl named Goldilocks.  She lived near
a big forest that was full of wonderful trails.
.PP
One day, Goldilocks went for a very long walk on
one of the trails.  Pretty soon, she came upon
a lovely house in a clearing.

The left margin in this example would stay indented one-half inch until you included a second indent command to set it back to zero.

Go to the previous, next section.