1 .\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler
2 .\" (faith@cs.unc.edu and dwheeler@ida.org)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" Modified Sun Jul 25 11:06:05 1993 by Rik Faith (faith@cs.unc.edu)
25 .\" Modified Sat Jun 8 00:39:52 1996 by aeb
26 .\" Modified Wed Jun 16 23:00:00 1999 by David A. Wheeler (dwheeler@ida.org)
27 .\" Modified Thu Jul 15 12:43:28 1999 by aeb
28 .\" Modified Sun Jan 6 18:26:25 2002 by Martin Schulze <joey@infodrom.org>
29 .\" Modified Tue Jul 27 20:12:02 2004 by Colin Watson <cjwatson@debian.org>
30 .\" 2007-05-30, mtk: various rewrites and moved much text to new man-pages.7.
32 .TH MAN 7 2007-05-30 "Linux" "Linux Programmer's Manual"
34 man \- macros to format man pages
36 .B groff \-Tascii \-man
48 This manual page explains the
50 macro package (often called the
53 This macro package should be used by developers when
54 writing or porting man pages for Linux.
55 It is fairly compatible with other
56 versions of this macro package, so porting man pages should not be a major
57 problem (exceptions include the NET-2 BSD release, which uses a totally
58 different macro package called mdoc; see
61 Note that NET-2 BSD mdoc man pages can be used with
63 simply by specifying the
70 option is, however, recommended, since this will automatically detect which
71 macro package is in use.
73 For conventions that should be employed when writing man pages
74 for the Linux \fIman-pages\fP package, see
77 The first command in a man page (after comment lines,
78 that is, lines that start with \fB.\\"\fP) should be
82 .I "title section date source manual"
85 For details of the arguments that should be supplied to the \fBTH\fP
89 Note that BSD mdoc-formatted pages begin with the
95 Sections are started with
97 followed by the heading name.
98 .\" The following doesn't seem to be required (see Debian bug 411303),
99 .\" If the name contains spaces and appears
100 .\" on the same line as
102 .\" then place the heading in double quotes.
104 The only mandatory heading is NAME, which should be the first section and
105 be followed on the next line by a one line description of the program:
112 It is extremely important that this format is followed, and that there is a
113 backslash before the single dash which follows the command name.
114 This syntax is used by the
116 program to create a database of short command descriptions for the
122 For a list of other sections that might appear in a manual page, see
125 The commands to select the type face are:
131 Bold alternating with italics
132 (especially useful for function specifications)
135 Bold alternating with Roman
136 (especially useful for referring to other
143 Italics alternating with bold
146 Italics alternating with Roman
149 Roman alternating with bold
152 Roman alternating with italics
155 Small alternating with bold
158 Small (useful for acronyms)
160 Traditionally, each command can have up to six arguments, but the GNU
161 implementation removes this limitation (you might still want to limit
162 yourself to 6 arguments for portability's sake).
163 Arguments are delimited by spaces.
164 Double quotes can be used to specify an argument which contains spaces.
165 All of the arguments will be printed next to each other without
166 intervening spaces, so that the
168 command can be used to specify a word in bold followed by a mark of
169 punctuation in Roman.
170 If no arguments are given, the command is applied to the following line
172 .SS "Other Macros and Strings"
174 Below are other relevant macros and predefined strings.
175 Unless noted otherwise, all macros
176 cause a break (end the current line of text).
177 Many of these macros set or use the "prevailing indent."
178 The "prevailing indent" value is set by any macro with the parameter
183 in which case the current prevailing indent will be used.
184 As a result, successive indented paragraphs can use the same indent without
185 respecifying the indent value.
186 A normal (nonindented) paragraph resets the prevailing indent value
187 to its default value (0.5 inches).
188 By default a given indent is measured in ens;
189 try to use ens or ems as units for
190 indents, since these will automatically adjust to font size changes.
191 The other key macro definitions are:
192 .SS "Normal Paragraphs"
197 (begin a new paragraph).
202 (begin a new paragraph).
205 Begin a new paragraph and reset prevailing indent.
206 .SS "Relative Margin Indent"
209 Start relative margin indent: moves the left margin
213 is omitted, the prevailing indent value is used).
214 A new prevailing indent is set to 0.5 inches.
215 As a result, all following paragraph(s) will be
216 indented until the corresponding
220 End relative margin indent and
221 restores the previous value of the prevailing indent.
222 .SS "Indented Paragraph Macros"
225 Begin paragraph with a hanging indent
226 (the first line of the paragraph is at the left margin of
227 normal paragraphs, and the rest of the paragraph's lines are indented).
230 Indented paragraph with optional hanging tag.
233 is omitted, the entire following paragraph is indented by
237 is provided, it is hung at the left margin
238 before the following indented paragraph
241 except the tag is included with the command instead of being on the
243 If the tag is too long, the text after the tag will be moved down to the
244 next line (text will not be lost or garbled).
245 For bulleted lists, use this macro with \e(bu (bullet) or \e(em (em dash)
246 as the tag, and for numbered lists, use the number or letter followed by
248 this simplifies translation to other formats.
251 Begin paragraph with hanging tag.
252 The tag is given on the next line, but
253 its results are like those of the
256 .SS "Hypertext Link Macros"
257 (Feature supported with
260 In order to use hypertext link macros, it is necessary to load the
267 .BI \&.URL " url link trailer"
268 Inserts a hypertext link to the URI (URL)
272 as the text of the link.
275 will be printed immediately afterwards.
276 When generating HTML this should translate into the HTML command
277 \fB<A HREF="\fP\fIurl\fP\fB">\fIlink\fP\fB</A>\fP\fItrailer\fP.
278 .\" The following is a kludge to get a paragraph into the listing.
281 This and other related macros are new, and
282 many tools won't do anything with them, but
283 since many tools (including troff) will simply ignore undefined macros
284 (or at worst insert their text) these are safe to insert.
285 .\" The following is a kludge to get a paragraph into the listing.
288 It can be useful to define your own
290 macro in manual pages for the benefit of those viewing it with a roff
293 That way, the URL, link text, and trailer text (if any) are still visible.
294 .\" The following is a kludge to get a paragraph into the listing.
301 \\\\$2 \\(laURL: \\\\$1 \\(ra\\\\$3
305 \&.if \\n[.g] .mso www.tmac
310 .I (later in the page)
312 This software comes from the
314 \&.URL "http://www.gnu.org/" "GNU Project" " of the"
316 \&.URL "http://www.fsf.org/" "Free Software Foundation" .
318 .\" The following is a kludge to get a paragraph into the listing.
325 macro package's definition of the URL macro will supersede the locally
328 A number of other link macros are available.
332 .SS "Miscellaneous Macros"
335 Reset tabs to default tab values (every 0.5 inches);
336 does not cause a break.
339 Set inter-paragraph vertical distance to d
340 (if omitted, d=0.4v);
341 does not cause a break.
348 but used for a subsection inside a section).
349 .SS "Predefined Strings"
352 package has the following predefined strings:
354 Registration Symbol: \*R
356 Change to default font size
358 Trademark Symbol: \*(Tm
360 Left angled double quote: \*(lq
362 Right angled double quote: \*(rq
366 is a troff macro package, in reality a large number of other tools
367 process man page files that don't implement all of troff's abilities.
368 Thus, it's best to avoid some of troff's more exotic abilities
369 where possible to permit these other tools to work correctly.
370 Avoid using the various troff preprocessors
371 (if you must, go ahead and use
377 commands instead for two-column tables).
378 Avoid using computations; most other tools can't process them.
379 Use simple commands that are easy to translate to other formats.
380 The following troff macros are believed to be safe (though in many cases
381 they will be ignored by translators):
408 You may also use many troff escape sequences (those sequences beginning
410 When you need to include the backslash character as normal text,
412 Other sequences you may use, where x or xx are any characters and N
413 is any digit, include:
429 Avoid using the escape sequences for drawing graphics.
431 Do not use the optional parameter for
434 Use only positive values for
439 with the same name as a macro in this or the
440 mdoc macro package with a different meaning; it's likely that
441 such redefinitions will be ignored.
442 Every positive indent
444 should be paired with a matching negative indent
445 (although you should be using the
452 should only have \(aqt\(aq or \(aqn\(aq as the condition.
455 that can be ignored should be used.
458 and the \fB\ef\fP escape sequence)
459 should only have the values 1, 2, 3, 4, R, I, B, P, or CW
460 (the ft command may also have no parameters).
462 If you use capabilities beyond these, check the
463 results carefully on several tools.
464 Once you've confirmed that the additional capability is safe,
465 let the maintainer of this
466 document know about the safe command or sequence
467 that should be added to this list.
469 .IR /usr/share/groff/ [*/] tmac/an.tmac
474 By all means include full URLs (or URIs) in the text itself;
477 can automatically turn them into hypertext links.
478 You can also use the new
480 macro to identify links to related information.
481 If you include URLs, use the full URL
482 (e.g., <http://www.kernelnotes.org>) to ensure that tools
483 can automatically find the URLs.
485 Tools processing these files should open the file and examine the first
486 nonwhitespace character.
487 A period (.) or single quote (') at the beginning
488 of a line indicates a troff-based file (such as man or mdoc).
489 A left angle bracket (<) indicates an SGML/XML-based
490 file (such as HTML or Docbook).
491 Anything else suggests simple ASCII
492 text (e.g., a "catman" result).
494 Many man pages begin with \fB\'\e"\fP followed by a
495 space and a list of characters,
496 indicating how the page is to be preprocessed.
497 For portability's sake to non-troff translators we recommend
498 that you avoid using anything other than
500 and Linux can detect that automatically.
501 However, you might want to include this information so your man page
502 can be handled by other (less capable) systems.
503 Here are the definitions of the preprocessors invoked by these characters:
524 Most of the macros describe formatting (e.g., font type and spacing) instead
525 of marking semantic content (e.g., this text is a reference to another page),
526 compared to formats like mdoc and DocBook (even HTML has more semantic
528 This situation makes it harder to vary the
530 format for different media,
531 to make the formatting consistent for a given media, and to automatically
532 insert cross-references.
533 By sticking to the safe subset described above, it should be easier to
534 automate transitioning to a different reference page format in the future.
541 .\" James Clark (jjc@jclark.com) wrote the implementation of the macro package.
543 .\" Rickard E. Faith (faith@cs.unc.edu) wrote the initial version of
544 .\" this manual page.
546 .\" Jens Schweikhardt (schweikh@noc.fdn.de) wrote the Linux Man-Page Mini-HOWTO
547 .\" (which influenced this manual page).
549 .\" David A. Wheeler (dwheeler@ida.org) heavily modified this
550 .\" manual page, such as adding detailed information on sections and macros.