OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man7 / man.7
1 .\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler
2 .\" (faith@cs.unc.edu and dwheeler@ida.org)
3 .\"
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.
7 .\"
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.
12 .\"
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
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
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.
31 .\"
32 .TH MAN 7 2007-05-30 "Linux" "Linux Programmer's Manual"
33 .SH NAME
34 man \- macros to format man pages
35 .SH SYNOPSIS
36 .B groff \-Tascii \-man
37 .I file
38 \&...
39 .LP
40 .B groff \-Tps \-man
41 .I file
42 \&...
43 .LP
44 .B man
45 .RI [ section ]
46 .I title
47 .SH DESCRIPTION
48 This manual page explains the
49 .B "groff an.tmac"
50 macro package (often called the
51 .B man
52 macro package).
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
59 .BR mdoc (7)).
60 .PP
61 Note that NET-2 BSD mdoc man pages can be used with
62 .B groff
63 simply by specifying the
64 .B \-mdoc
65 option instead of the
66 .B \-man
67 option.
68 Using the
69 .B \-mandoc
70 option is, however, recommended, since this will automatically detect which
71 macro package is in use.
72 .PP
73 For conventions that should be employed when writing man pages
74 for the Linux \fIman-pages\fP package, see
75 .BR man-pages (7).
76 .SS Title line
77 The first command in a man page (after comment lines,
78 that is, lines that start with \fB.\\"\fP) should be
79 .RS
80 .sp
81 .B \&.TH
82 .I "title section date source manual"
83 .sp
84 .RE
85 For details of the arguments that should be supplied to the \fBTH\fP
86 command, see
87 .BR man-pages (7).
88 .PP
89 Note that BSD mdoc-formatted pages begin with the
90 .B Dd
91 command, not the
92 .B TH
93 command.
94 .SS Sections
95 Sections are started with
96 .B \&.SH
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
101 .\" .BR \&.SH ,
102 .\" then place the heading in double quotes.
103
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:
106 .RS
107 .sp
108 \&.SH NAME
109 .br
110 .sp
111 .RE
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
115 .BR makewhatis (8)
116 program to create a database of short command descriptions for the
117 .BR whatis (1)
118 and
119 .BR apropos (1)
120 commands.
121 .PP
122 For a list of other sections that might appear in a manual page, see
123 .BR man-pages (7).
124 .SS Fonts
125 The commands to select the type face are:
126 .TP 4
127 .B \&.B
128 Bold
129 .TP
130 .B \&.BI
131 Bold alternating with italics
132 (especially useful for function specifications)
133 .TP
134 .B \&.BR
135 Bold alternating with Roman
136 (especially useful for referring to other
137 manual pages)
138 .TP
139 .B \&.I
140 Italics
141 .TP
142 .B \&.IB
143 Italics alternating with bold
144 .TP
145 .B \&.IR
146 Italics alternating with Roman
147 .TP
148 .B \&.RB
149 Roman alternating with bold
150 .TP
151 .B \&.RI
152 Roman alternating with italics
153 .TP
154 .B \&.SB
155 Small alternating with bold
156 .TP
157 .B \&.SM
158 Small (useful for acronyms)
159 .LP
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
167 .B \&.BR
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
171 of text.
172 .SS "Other Macros and Strings"
173 .PP
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
179 .I i
180 below;
181 macros may omit
182 .I i
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"
193 .TP 9m
194 .B \&.LP
195 Same as
196 .B \&.PP
197 (begin a new paragraph).
198 .TP
199 .B \&.P
200 Same as
201 .B \&.PP
202 (begin a new paragraph).
203 .TP
204 .B \&.PP
205 Begin a new paragraph and reset prevailing indent.
206 .SS "Relative Margin Indent"
207 .TP 9m
208 .BI \&.RS " i"
209 Start relative margin indent: moves the left margin
210 .I i
211 to the right (if
212 .I i
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
217 .BR \&.RE .
218 .TP
219 .B \&.RE
220 End relative margin indent and
221 restores the previous value of the prevailing indent.
222 .SS "Indented Paragraph Macros"
223 .TP 9m
224 .BI \&.HP " i"
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).
228 .TP
229 .BI \&.IP " x i"
230 Indented paragraph with optional hanging tag.
231 If the tag
232 .I x
233 is omitted, the entire following paragraph is indented by
234 .IR i .
235 If the tag
236 .I x
237 is provided, it is hung at the left margin
238 before the following indented paragraph
239 (this is just like
240 .B \&.TP
241 except the tag is included with the command instead of being on the
242 following line).
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
247 a period as the tag;
248 this simplifies translation to other formats.
249 .TP
250 .BI \&.TP " i"
251 Begin paragraph with hanging tag.
252 The tag is given on the next line, but
253 its results are like those of the
254 .B \&.IP
255 command.
256 .SS "Hypertext Link Macros"
257 (Feature supported with
258 .B groff
259 only.)
260 In order to use hypertext link macros, it is necessary to load the
261 .B www.tmac
262 macro package.
263 Use the request
264 .B .mso www.tmac
265 to do this.
266 .TP 9m
267 .BI \&.URL " url link trailer"
268 Inserts a hypertext link to the URI (URL)
269 .IR url ,
270 with
271 .I link
272 as the text of the link.
273 The
274 .I trailer
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.
279 .TP
280 .B " "
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.
286 .TP
287 .B " "
288 It can be useful to define your own
289 .B URL
290 macro in manual pages for the benefit of those viewing it with a roff
291 viewer other than
292 .BR groff .
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.
295 .TP
296 .B " "
297 Here's an example:
298 .RS 1.5i
299 \&.de URL
300 .br
301 \\\\$2 \\(laURL: \\\\$1 \\(ra\\\\$3
302 .br
303 \&..
304 .br
305 \&.if \\n[.g] .mso www.tmac
306 .br
307 \&.TH
308 .I ...
309 .br
310 .I (later in the page)
311 .br
312 This software comes from the
313 .br
314 \&.URL "http://www.gnu.org/" "GNU Project" " of the"
315 .br
316 \&.URL "http://www.fsf.org/" "Free Software Foundation" .
317 .RE
318 .\" The following is a kludge to get a paragraph into the listing.
319 .TP
320 .B " "
321 In the above, if
322 .B groff
323 is being used, the
324 .B www.tmac
325 macro package's definition of the URL macro will supersede the locally
326 defined one.
327 .PP
328 A number of other link macros are available.
329 See
330 .BR groff_www (7)
331 for more details.
332 .SS "Miscellaneous Macros"
333 .TP 9m
334 .B \&.DT
335 Reset tabs to default tab values (every 0.5 inches);
336 does not cause a break.
337 .TP
338 .BI \&.PD " d"
339 Set inter-paragraph vertical distance to d
340 (if omitted, d=0.4v);
341 does not cause a break.
342 .TP
343 .BI \&.SS " t"
344 Subheading
345 .I t
346 (like
347 .BR \&.SH ,
348 but used for a subsection inside a section).
349 .SS "Predefined Strings"
350 The
351 .B man
352 package has the following predefined strings:
353 .IP \e*R
354 Registration Symbol: \*R
355 .IP \e*S
356 Change to default font size
357 .IP \e*(Tm
358 Trademark Symbol: \*(Tm
359 .IP \e*(lq
360 Left angled double quote: \*(lq
361 .IP \e*(rq
362 Right angled double quote: \*(rq
363 .SS "Safe Subset"
364 Although technically
365 .B man
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
372 .BR tbl (1),
373 but try to use the
374 .B IP
375 and
376 .B TP
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):
382 .BR \e" ,
383 .BR . ,
384 .BR ad ,
385 .BR bp ,
386 .BR br ,
387 .BR ce ,
388 .BR de ,
389 .BR ds ,
390 .BR el ,
391 .BR ie ,
392 .BR if ,
393 .BR fi ,
394 .BR ft ,
395 .BR hy ,
396 .BR ig ,
397 .BR in ,
398 .BR na ,
399 .BR ne ,
400 .BR nf ,
401 .BR nh ,
402 .BR ps ,
403 .BR so ,
404 .BR sp ,
405 .BR ti ,
406 .BR tr .
407 .PP
408 You may also use many troff escape sequences (those sequences beginning
409 with \e).
410 When you need to include the backslash character as normal text,
411 use \ee.
412 Other sequences you may use, where x or xx are any characters and N
413 is any digit, include:
414 .BR \e' ,
415 .BR \e` ,
416 .BR \e- ,
417 .BR \e. ,
418 .BR \e" ,
419 .BR \e% ,
420 .BR \e*x ,
421 .BR \e*(xx ,
422 .BR \e(xx ,
423 .BR \e$N ,
424 .BR \enx ,
425 .BR \en(xx ,
426 .BR \efx ,
427 and
428 .BR \ef(xx .
429 Avoid using the escape sequences for drawing graphics.
430 .PP
431 Do not use the optional parameter for
432 .B bp
433 (break page).
434 Use only positive values for
435 .B sp
436 (vertical space).
437 Don't define a macro
438 .RB ( de )
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
443 .RB ( in )
444 should be paired with a matching negative indent
445 (although you should be using the
446 .B RS
447 and
448 .B RE
449 macros instead).
450 The condition test
451 .RB ( if,ie )
452 should only have \(aqt\(aq or \(aqn\(aq as the condition.
453 Only translations
454 .RB ( tr )
455 that can be ignored should be used.
456 Font changes
457 .RB ( ft
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).
461 .PP
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.
468 .SH FILES
469 .IR /usr/share/groff/ [*/] tmac/an.tmac
470 .br
471 .I /usr/man/whatis
472 .SH NOTES
473 .PP
474 By all means include full URLs (or URIs) in the text itself;
475 some tools such as
476 .BR man2html (1)
477 can automatically turn them into hypertext links.
478 You can also use the new
479 .B URL
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.
484 .PP
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).
493 .PP
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
499 .BR tbl (1),
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:
504 .TP 3
505 .B e
506 eqn(1)
507 .TP
508 .B g
509 grap(1)
510 .TP
511 .B p
512 pic(1)
513 .TP
514 .B r
515 refer(1)
516 .TP
517 .B t
518 tbl(1)
519 .TP
520 .B v
521 vgrind(1)
522 .SH BUGS
523 .PP
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
527 markings).
528 This situation makes it harder to vary the
529 .B man
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.
535 .LP
536 The Sun macro
537 .B TX
538 is not implemented.
539 .\" .SH AUTHORS
540 .\" .IP \(em 3m
541 .\" James Clark (jjc@jclark.com) wrote the implementation of the macro package.
542 .\" .IP \(em
543 .\" Rickard E. Faith (faith@cs.unc.edu) wrote the initial version of
544 .\" this manual page.
545 .\" .IP \(em
546 .\" Jens Schweikhardt (schweikh@noc.fdn.de) wrote the Linux Man-Page Mini-HOWTO
547 .\" (which influenced this manual page).
548 .\" .IP \(em
549 .\" David A. Wheeler (dwheeler@ida.org) heavily modified this
550 .\" manual page, such as adding detailed information on sections and macros.
551 .SH "SEE ALSO"
552 .BR apropos (1),
553 .BR groff (1),
554 .BR man (1),
555 .BR man2html (1),
556 .BR whatis (1),
557 .BR groff_man (7),
558 .BR groff_www (7),
559 .BR man-pages (7),
560 .BR mdoc (7),
561 .BR mdoc.samples (7)