troff

Are trailing whitespaces important in Troff manual files?


I couldn't find a specification of the troff file format. Does the removal of trailing whitespaces have an effect?


Solution

  • The groff manual chapter 5 says, for reading normal text:

    Extra spaces between words are preserved, but spaces at the end of lines are ignored.

    (There are some exceptions such as when defining strings with .ds). You can experiment yourself:

    echo -e 'a      b    \nc d' | nroff -man | cat -vet
    a      b c d$
    $