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