OSDN Git Service

4ed6f4d36aa0009b2c818b4a58a4f4fd77d7fee3
[linuxjm/LDP_man-pages.git] / original / man7 / mdoc.7
1 .\" Copyright (c) 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)mdoc.7      8.2 (Berkeley) 12/30/93
33 .\"     $Id: mdoc.7,v 1.8 1998/12/04 00:51:17 jkoshy Exp $
34 .\"
35 .\" The December 30, 1993 version
36 .\" Modified by David A. Wheeler (dwheeler@ida.org) on 1999-07-11
37 .\" to conform to Linux.
38 .\"
39 .\"
40 .Dd July 11, 1999
41 .Dt MDOC 7
42 .Os Linux
43 .Sh NAME
44 .Nm mdoc
45 .Nd quick reference guide for the
46 .Nm \-mdoc
47 macro package
48 .Sh SYNOPSIS
49 .Nm groff
50 .Fl m Ns Ar doc
51 .Ar files ...
52 .Sh DESCRIPTION
53 The
54 .Nm \-mdoc
55 package is a set of content-based and domain-based macros
56 used to format the
57 .Bx
58 man pages.
59 The macro names and their meanings are
60 listed below for quick reference; for
61 a detailed explanation on using the package,
62 see the tutorial sampler
63 .Xr mdoc.samples 7 .
64 .Pp
65 Note that this is not the usual macro package for Linux documentation,
66 although it is used for documentation of several widely used programs;
67 see
68 .Xr man 7 .
69 .Pp
70 The macros are described in two groups, the first
71 includes the structural and physical page layout macros.
72 The second contains the manual and general text domain
73 macros which differentiate the
74 .Nm \-mdoc
75 package from other
76 .Xr troff
77 formatting packages.
78 .Sh PAGE STRUCTURE DOMAIN
79 .Ss Title Macros
80 To create a valid manual page, these three macros, in this order,
81 are required:
82 .Bl -tag -width "xxxx.Os OPERATINGxSYSTEM [version/release]" -compact
83 .It Li "\&.Dd  " Ar "Month day, year"
84 Document date.
85 .It Li "\&.Dt  " Ar "DOCUMENT_TITLE [section] [volume]"
86 Title, in upper case.
87 .It Li "\&.Os  " Ar "OPERATING_SYSTEM [version/release]"
88 Operating system
89 .Pq Tn BSD .
90 .El
91 .Ss Page Layout Macros
92 Section headers, paragraph breaks, lists and displays.
93 .Bl -tag -width flag -compact
94 .It Li \&.Sh
95 Section Headers.
96 Valid headers, in the order of presentation:
97 .Bl -tag -width "RETURN VALUE" -compact
98 .It Ar NAME
99 Name section, should include the
100 .Ql \&.Nm
101 or
102 .Ql \&.Fn
103 and the
104 .Ql \&.Nd
105 macros.
106 .It Ar SYNOPSIS
107 Usage.
108 .It Ar DESCRIPTION
109 General description, should include
110 options and parameters.
111 .It Ar RETURN VALUE
112 Sections two and three function calls.
113 .It Ar ENVIRONMENT
114 Describe environment variables.
115 .It Ar FILES
116 Files associated with the subject.
117 .It Ar EXAMPLES
118 Examples and suggestions.
119 .It Ar DIAGNOSTICS
120 Normally used for section four device interface diagnostics.
121 .It Ar ERRORS
122 Sections two and three error and signal
123 handling.
124 .It Ar SEE ALSO
125 Cross references and citations.
126 .It Ar CONFORMING TO
127 Conformance to standards if applicable.
128 .It Ar HISTORY
129 If a standard is not applicable, the history
130 of the subject should be given.
131 .It Ar BUGS
132 Gotchas and caveats.
133 .It Ar other
134 Customized headers may be added at
135 the authors discretion.
136 .El
137 .It Li \&.Ss
138 Subsection Headers.
139 .It Li \&.Pp
140 Paragraph Break.
141 Vertical space (one line).
142 .It Li \&.D1
143 (D-one) Display-one
144 Indent and display one text line.
145 .It Li \&.Dl
146 (D-ell) Display-one literal.
147 Indent and display one line of literal text.
148 .It Li \&.Bd
149 Begin-display block.
150 Display options:
151 .Bl -tag -width "xoffset string " -compact
152 .It Fl ragged
153 Unjustified (ragged edges).
154 .It Fl filled
155 Justified.
156 .It Fl literal
157 Literal text or code.
158 .It Fl file Ar name
159 Read in named
160 .Ar file
161 and display.
162 .It Fl offset Ar string
163 Offset display.
164 Acceptable
165 .Ar string
166 values:
167 .Bl -tag -width indent-two -compact
168 .It Ar left
169 Align block on left (default).
170 .It Ar center
171 Approximate center margin.
172 .It Ar indent
173 Six constant width spaces (a tab).
174 .It Ar indent-two
175 Two tabs.
176 .It Ar right
177 Left aligns block 2 inches from
178 right.
179 .It Ar xx Ns Cm n
180 Where
181 .Ar xx
182 is a number from
183 .No \&4 Ns Cm n
184 to
185 .No \&9\&9 Ns Cm n .
186 .It Ar Aa
187 Where
188 .Ar Aa
189 is a callable macro name.
190 .It Ar string
191 The width of
192 .Ar string
193 is used.
194 .El
195 .El
196 .It Li \&.Ed
197 End-display (matches \&.Bd).
198 .It Li \&.Bl
199 Begin-list.
200 Create lists or columns.
201 Options:
202 .Bl -tag -width flag -compact
203 .It Ar List-types
204 .Bl -column xbullet -compact
205 .It Fl bullet Ta "Bullet Item List"
206 .It Fl item Ta "Unlabeled List"
207 .It Fl enum Ta "Enumerated List"
208 .It Fl tag Ta "Tag Labeled List"
209 .It Fl diag Ta "Diagnostic List"
210 .It Fl hang Ta "Hanging Labeled List"
211 .It Fl ohang Ta "Overhanging Labeled List"
212 .It Fl inset Ta "Inset or Run-on Labeled List"
213 .El
214 .It List-parameters
215 .Bl -tag -width "xcompact " -compact
216 .It Fl offset
217 (All lists.) See
218 .Ql \&.Bd
219 begin-display above.
220 .It Fl width
221 .Pf ( Fl tag
222 and
223 .Fl hang
224 lists only.)
225 See
226 .Ql \&.Bd .
227 .It Fl compact
228 (All lists.)
229 Suppresses blank lines.
230 .El
231 .El
232 .It Li \&.El
233 End-list.
234 .It Li \&.It
235 List item.
236 .El
237 .Sh MANUAL AND GENERAL TEXT DOMAIN MACROS
238 The manual and general text domain macros are special in that
239 most of them are parsed for callable macros
240 for example:
241 .Bl -tag -width ".Op Fl s Ar filex" -offset indent
242 .It Li "\&.Op Fl s Ar file"
243 Produces
244 .Op Fl s Ar file
245 .El
246 .Pp
247 In this example, the option enclosure macro
248 .Ql \&.Op
249 is parsed, and calls the callable content macro
250 .Ql \&Fl
251 which operates on the argument
252 .Ql s
253 and then calls the callable content macro
254 .Ql \&Ar
255 which operates on the argument
256 .Ql file .
257 Some macros may be callable, but are not parsed and vice versa.
258 These macros are indicated in the
259 .Em parsed
260 and
261 .Em callable
262 columns below.
263 .Pp
264 Unless stated, manual domain macros share a common syntax:
265 .Pp
266 .Dl \&.Va argument [\ .\ ,\ ;\ :\ (\ )\ [\ ]\ argument \...\ ]
267 .Pp
268 .Sy Note :
269 Opening and closing
270 punctuation characters are only recognized as such if they are presented
271 one at a time.
272 The string
273 .Ql "),"
274 is not recognized as punctuation and will be output with a leading white
275 space and in what ever font the calling macro uses.
276 The
277 argument list
278 .Ql "] ) ,"
279 is recognized as three sequential closing punctuation characters
280 and a leading white space is not output between the characters
281 and the previous argument (if any).
282 The special meaning of a punctuation character may be escaped
283 with the string
284 .Ql \e& .
285 For example the following string,
286 .Bl -tag -width "&.Ar file1\ , file2\ , file3\ )\ ." -offset indent
287 .It Li "\&.Ar file1\ , file2\ , file3\ )\ ."
288 Produces
289 .Ar file1 , file2 , file3 ) .
290 .El
291 .ne 1i
292 .Ss Manual Domain Macros
293 .Bl -column "Name" "Parsed" Callable" -compact
294 .It Em Name     Parsed  Callable        Description
295 .It Li \&Ad Ta Yes Ta Yes Ta "Address. (This macro may be deprecated.)"
296 .It Li \&An Ta Yes Ta Yes Ta "Author name."
297 .It Li \&Ar Ta Yes Ta Yes Ta "Command-line argument."
298 .It Li \&Cd Ta \&No Ta \&No Ta "Configuration declaration (section four only)."
299 .It Li \&Cm Ta Yes Ta Yes Ta "Command-line argument modifier."
300 .It Li \&Dv Ta Yes Ta Yes Ta "Defined variable (source code)."
301 .It Li \&Er Ta Yes Ta Yes Ta "Error number (source code)."
302 .It Li \&Ev Ta Yes Ta Yes Ta "Environment variable."
303 .It Li \&Fa Ta Yes Ta Yes Ta "Function argument."
304 .It Li \&Fd Ta Yes Ta Yes Ta "Function declaration."
305 .It Li \&Fn Ta Yes Ta Yes Ta "Function call (also .Fo and .Fc)."
306 .It Li \&Ic Ta Yes Ta Yes Ta "Interactive command."
307 .It Li \&Li Ta Yes Ta Yes Ta "Literal text."
308 .It Li \&Nm Ta Yes Ta Yes Ta "Command name."
309 .It Li \&Op Ta Yes Ta Yes Ta "Option (also .Oo and .Oc)."
310 .It Li \&Ot Ta Yes Ta Yes Ta "Old style function type (Fortran only)."
311 .It Li \&Pa Ta Yes Ta Yes Ta "Pathname or filename."
312 .It Li \&St Ta Yes Ta Yes Ta "Standards (\-p1003.2, \-p1003.1 or \-ansiC)"
313 .It Li \&Va Ta Yes Ta Yes Ta "Variable name."
314 .It Li \&Vt Ta Yes Ta Yes Ta "Variable type (Fortran only)."
315 .It Li \&Xr Ta Yes Ta Yes Ta "Manual Page Cross Reference."
316 .El
317 .Ss General Text Domain Macros
318 .Bl -column "Name" "Parsed" Callable" -compact
319 .It Em "Name    Parsed  Callable        Description"
320 .It Li \&%A Ta Yes Ta \&No Ta "Reference author."
321 .It Li \&%B Ta Yes Ta Yes Ta "Reference book title."
322 .It Li \&%\&C Ta \&No Ta \&No Ta "Reference place of publishing (city)."
323 .It Li \&%\&D Ta \&No Ta \&No Ta "Reference date."
324 .It Li \&%J Ta Yes Ta Yes Ta "Reference journal title."
325 .It Li \&%N Ta \&No Ta \&No Ta "Reference issue number."
326 .It Li \&%\&O Ta \&No Ta \&No Ta "Reference optional information."
327 .It Li \&%P Ta \&No Ta \&No Ta "Reference page number(s)."
328 .It Li \&%R Ta \&No Ta \&No Ta "Reference report Name."
329 .It Li \&%T Ta Yes Ta Yes Ta "Reference article title."
330 .It Li \&%V Ta \&No Ta \&No Ta "Reference volume."
331 .It Li \&Ac Ta Yes Ta Yes Ta "Angle close quote."
332 .It Li \&Ao Ta Yes Ta Yes Ta "Angle open quote."
333 .It Li \&Ap Ta Yes Ta Yes Ta "Apostrophe."
334 .It Li \&Aq Ta Yes Ta Yes Ta "Angle quote."
335 .It Li \&At Ta \&No Ta \&No Ta Tn "AT&T UNIX"
336 .It Li \&Bc Ta Yes Ta Yes Ta "Bracket close quote."
337 .It Li \&Bf Ta \&No Ta \&No Ta "Begin font mode."
338 .It Li \&Bo Ta Yes Ta Yes Ta "Bracket open quote."
339 .It Li \&Bq Ta Yes Ta Yes Ta "Bracket quote."
340 .It Li \&Bx Ta Yes Ta Yes Ta Bx .
341 .It Li \&Db Ta \&No Ta \&No Ta "Debug (default is \\*qoff\\*q)"
342 .It Li \&Dc Ta Yes Ta Yes Ta "Double close quote."
343 .It Li \&Do Ta Yes Ta Yes Ta "Double open quote."
344 .It Li \&Dq Ta Yes Ta Yes Ta "Double quote."
345 .It Li \&Ec Ta Yes Ta Yes Ta "Enclose string close quote."
346 .It Li \&Ef Ta \&No Ta \&No Ta "End font mode."
347 .It Li \&Em Ta Yes Ta Yes Ta "Emphasis (traditional English)."
348 .It Li \&Eo Ta Yes Ta Yes Ta "Enclose string open quote."
349 .It Li \&Fx Ta \&No Ta \&No Ta Tn "FreeBSD operating system"
350 .It Li \&No Ta Yes Ta Yes Ta "Normal text (no-op)."
351 .It Li \&Ns Ta Yes Ta Yes Ta "No space."
352 .It Li \&Pc Ta Yes Ta Yes Ta "Parenthesis close quote."
353 .It Li \&Pf Ta Yes Ta \&No Ta "Prefix string."
354 .It Li \&Po Ta Yes Ta Yes Ta "Parenthesis open quote."
355 .It Li \&Pq Ta Yes Ta Yes Ta "Parentheses quote."
356 .It Li \&Qc Ta Yes Ta Yes Ta "Straight Double close quote."
357 .It Li \&Ql Ta Yes Ta Yes Ta "Quoted literal."
358 .It Li \&Qo Ta Yes Ta Yes Ta "Straight Double open quote."
359 .It Li \&Qq Ta Yes Ta Yes Ta "Straight Double quote."
360 .It Li \&Re Ta \&No Ta \&No Ta "Reference end."
361 .It Li \&Rs Ta \&No Ta \&No Ta "Reference start."
362 .It Li \&Rv Ta \&No Ta \&No Ta "Return values (sections two and three only)."
363 .It Li \&Sc Ta Yes Ta Yes Ta "Single close quote."
364 .It Li \&So Ta Yes Ta Yes Ta "Single open quote."
365 .It Li \&Sq Ta Yes Ta Yes Ta "Single quote."
366 .It Li \&Sm Ta \&No Ta \&No Ta "Space mode (default is \\*qon\\*q)"
367 .It Li \&Sx Ta Yes Ta Yes Ta "Section Cross Reference."
368 .It Li \&Sy Ta Yes Ta Yes Ta "Symbolic (traditional English)."
369 .It Li \&Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)."
370 .It Li \&Ux Ta Yes Ta Yes Ta Ux
371 .It Li \&Xc Ta Yes Ta Yes Ta "Extend argument list close."
372 .It Li \&Xo Ta Yes Ta Yes Ta "Extend argument list open."
373 .El
374 .\" .It Sy \&Hf Ta \&No Ta \&No Ta "Include file with header"
375 .Pp
376 Macro names ending in
377 .Ql q
378 quote remaining items on the argument list.
379 Macro names ending in
380 .Ql o
381 begin a quote which may span more than one line of input and
382 are close quoted with the matching macro name ending in
383 .Ql c .
384 Enclosure macros may be nested and are limited to
385 eight arguments.
386 .Pp
387 Note: the extended argument list macros
388 .Pf ( Ql \&.Xo ,
389 .Ql \&.Xc )
390 and the function enclosure macros
391 .Pf ( Ql \&.Fo ,
392 .Ql \&.Fc )
393 are irregular.
394 The extended list macros are used when the number of macro arguments
395 would exceed the
396 .Xr troff
397 limitation of nine arguments.
398 .Pp
399 The macros UR (starting a URI/URL hypertext reference), UE (ending one),
400 and UN (identifying a target for a reference) are also available.
401 See
402 .Xr man 7
403 for more information on these macros.
404 .\" The following does not apply on Linux:
405 .\" .Sh CONFIGURATION
406 .\" For site specific configuration of the macro package,
407 .\" see the file
408 .\" .Pa /usr/src/share/tmac/README .
409 .Sh FILES
410 .Bl -tag -width "tmac.doc-ditroff" -compact
411 .It Pa doc.tmac
412 Manual and general text domain macros.
413 .It Pa tmac/doc-common
414 Common structural macros and definitions.
415 .It Pa tmac/doc-nroff
416 Site dependent
417 .Xr nroff
418 style file.
419 .It Pa tmac/doc-ditroff
420 Site dependent
421 .Xr troff
422 style file.
423 .It Pa tmac/doc-syms
424 Special defines (such as the standards macro).
425 .El
426 .Sh "SEE ALSO"
427 .Xr groff_mdoc 7 ,
428 .Xr mdoc.samples 7 ,
429 .Xr man 7 ,
430 .Xr man-pages 7
431 .Sh COLOPHON
432 This page is part of release 3.32 of the Linux
433 .Em man-pages
434 project.
435 A description of the project,
436 and information about reporting bugs,
437 can be found at
438 http://www.kernel.org/doc/man-pages/.