From d6dceb1a3b9a189123aff07690af6532e4e3599f Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 16 Aug 2017 09:48:20 +0200 Subject: [PATCH] man-pages.7: Expand the guidance on formatting code snippets Signed-off-by: Michael Kerrisk --- man7/man-pages.7 | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/man7/man-pages.7 b/man7/man-pages.7 index 2870c2db8..696a52254 100644 --- a/man7/man-pages.7 +++ b/man7/man-pages.7 @@ -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.