man-pages.7: Expand the guidance on formatting code snippets

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-08-16 09:48:20 +02:00
parent efeece0465
commit d6dceb1a3b
1 changed files with 26 additions and 1 deletions

View File

@ -635,7 +635,32 @@ When structure definitions, shell session logs, and so on are included
in running text, indent them by 4 spaces (i.e., a block enclosed by
.I ".in\ +4n"
and
.IR ".in" ).
.IR ".in" ),
format them using the
.I .EX
and
.I EE
macros, and surround them with suitable paragraph markers (either
.I .PP
or
.IR .IP ).
For example:
.PP
.in +4n
.EX
.PP
.in +4n
.EX
int
main(int argc, char *argv[])
{
return 0;
}
.EE
.in
.PP
.EE
.in
.SS Preferred terms
The following table lists some preferred terms to use in man pages,
mainly to ensure consistency across pages.