]> git.cameronkatri.com Git - mandoc.git/blob - mdoc.7
Made `Dt' default to LOCAL and UNKNOWN instead of local and unknown (note case).
[mandoc.git] / mdoc.7
1 .\" $Id: mdoc.7,v 1.111 2010/05/30 11:00:53 kristaps Exp $
2 .\"
3 .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate: May 30 2010 $
18 .Dt MDOC 7
19 .Os
20 .Sh NAME
21 .Nm mdoc
22 .Nd mdoc language reference
23 .Sh DESCRIPTION
24 The
25 .Nm mdoc
26 language is used to format
27 .Bx
28 .Ux
29 manuals. In this reference document, we describe its syntax, structure,
30 and usage. Our reference implementation is mandoc; the
31 .Sx COMPATIBILITY
32 section describes compatibility with other troff \-mdoc implementations.
33 .Pp
34 An
35 .Nm
36 document follows simple rules: lines beginning with the control
37 character
38 .Sq \.
39 are parsed for macros. Other lines are interpreted within the scope of
40 prior macros:
41 .Bd -literal -offset indent
42 \&.Sh Macro lines change control state.
43 Other lines are interpreted within the current state.
44 .Ed
45 .Sh LANGUAGE SYNTAX
46 .Nm
47 documents may contain only graphable 7-bit ASCII characters, the space
48 character, and, in certain circumstances, the tab character. All
49 manuals must have
50 .Ux
51 line terminators.
52 .Ss Comments
53 Text following a
54 .Sq \e" ,
55 whether in a macro or free-form text line, is ignored to the end of
56 line. A macro line with only a control character and comment escape,
57 .Sq \&.\e" ,
58 is also ignored. Macro lines with only a control charater and optionally
59 whitespace are stripped from input.
60 .Ss Reserved Characters
61 Within a macro line, the following characters are reserved:
62 .Pp
63 .Bl -tag -width Ds -offset indent -compact
64 .It \&.
65 .Pq period
66 .It \&,
67 .Pq comma
68 .It \&:
69 .Pq colon
70 .It \&;
71 .Pq semicolon
72 .It \&(
73 .Pq left-parenthesis
74 .It \&)
75 .Pq right-parenthesis
76 .It \&[
77 .Pq left-bracket
78 .It \&]
79 .Pq right-bracket
80 .It \&?
81 .Pq question
82 .It \&!
83 .Pq exclamation
84 .It \&|
85 .Pq vertical bar
86 .El
87 .Pp
88 Use of reserved characters is described in
89 .Sx MACRO SYNTAX .
90 For general use in macro lines, these characters must either be escaped
91 with a non-breaking space
92 .Pq Sq \e&
93 or, if applicable, an appropriate escape sequence used.
94 .Ss Special Characters
95 Special characters may occur in both macro and free-form lines.
96 Sequences begin with the escape character
97 .Sq \e
98 followed by either an open-parenthesis
99 .Sq \&(
100 for two-character sequences; an open-bracket
101 .Sq \&[
102 for n-character sequences (terminated at a close-bracket
103 .Sq \&] ) ;
104 or a single one-character sequence.
105 See
106 .Xr mandoc_char 7
107 for a complete list.
108 Examples include
109 .Sq \e(em
110 .Pq em-dash
111 and
112 .Sq \ee
113 .Pq back-slash .
114 .Ss Text Decoration
115 Terms may be text-decorated using the
116 .Sq \ef
117 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
118 (revert to previous mode):
119 .Pp
120 .D1 \efBbold\efR \efIitalic\efP
121 .Pp
122 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
123 respectively) may be used instead.
124 A text decoration is valid within
125 the current font scope only: if a macro opens a font scope alongside
126 its own scope, such as
127 .Sx \&Bf
128 .Cm \&Sy ,
129 in-scope invocations of
130 .Sq \ef
131 are only valid within the font scope of the macro.
132 If
133 .Sq \ef
134 is specified outside of any font scope, such as in unenclosed, free-form
135 text, it will affect the remainder of the document.
136 .Pp
137 Text may also be sized with the
138 .Sq \es
139 escape, whose syntax is one of
140 .Sq \es+-n
141 for one-digit numerals;
142 .Sq \es(+-nn
143 or
144 .Sq \es+-(nn
145 for two-digit numerals; and
146 .Sq \es[+-N] ,
147 .Sq \es+-[N] ,
148 .Sq \es'+-N' ,
149 or
150 .Sq \es+-'N'
151 for arbitrary-digit numerals:
152 .Pp
153 .D1 \es+1bigger\es-1
154 .D1 \es[+10]much bigger\es[-10]
155 .D1 \es+(10much bigger\es-(10
156 .D1 \es+'100'much much bigger\es-'100'
157 .Pp
158 Note these forms are
159 .Em not
160 recommended for
161 .Nm ,
162 which encourages semantic annotation.
163 .Ss Predefined Strings
164 Historically,
165 .Xr groff 1
166 also defined a set of package-specific
167 .Dq predefined strings ,
168 which, like
169 .Sx Special Characters ,
170 demark special output characters and strings by way of input codes.
171 Predefined strings are escaped with the slash-asterisk,
172 .Sq \e* :
173 single-character
174 .Sq \e*X ,
175 two-character
176 .Sq \e*(XX ,
177 and N-character
178 .Sq \e*[N] .
179 See
180 .Xr mandoc_char 7
181 for a complete list.
182 Examples include
183 .Sq \e*(Am
184 .Pq ampersand
185 and
186 .Sq \e*(Ba
187 .Pq vertical bar .
188 .Ss Whitespace
189 Whitespace consists of the space character.
190 In free-form lines, whitespace is preserved within a line; un-escaped
191 trailing spaces are stripped from input (unless in a literal context).
192 Blank free-form lines, which may include whitespace, are only permitted
193 within literal contexts.
194 .Pp
195 In macro lines, whitespace delimits arguments and is discarded.
196 If arguments are quoted, whitespace within the quotes is retained.
197 .Ss Quotation
198 Macro arguments may be quoted with a double-quote to group
199 space-delimited terms or to retain blocks of whitespace.
200 A quoted argument begins with a double-quote preceded by whitespace.
201 The next double-quote not pair-wise adjacent to another double-quote
202 terminates the literal, regardless of surrounding whitespace.
203 .Pp
204 This produces tokens
205 .Sq a" ,
206 .Sq b c ,
207 .Sq de ,
208 and
209 .Sq fg" .
210 Note that any quoted term, be it argument or macro, is indiscriminately
211 considered literal text.
212 Thus, the following produces
213 .Sq \&Em a :
214 .Bd -literal -offset indent
215 \&.Em "Em a"
216 .Ed
217 .Pp
218 In free-form mode, quotes are regarded as opaque text.
219 .Ss Dates
220 There are several macros in
221 .Nm
222 that require a date argument.
223 The canonical form for dates is the American format:
224 .Pp
225 .D1 Cm Month Day , Year
226 .Pp
227 The
228 .Cm Day
229 value is an optionally zero-padded numeral.
230 The
231 .Cm Month
232 value is the full month name.
233 The
234 .Cm Year
235 value is the full four-digit year.
236 .Pp
237 Reduced form dates are broken-down canonical form dates:
238 .Pp
239 .D1 Cm Month , Year
240 .D1 Cm Year
241 .Pp
242 Some examples of valid dates follow:
243 .Pp
244 .D1 "May, 2009" Pq reduced form
245 .D1 "2009" Pq reduced form
246 .D1 "May 20, 2009" Pq canonical form
247 .Ss Scaling Widths
248 Many macros support scaled widths for their arguments, such as
249 stipulating a two-inch list indentation with the following:
250 .Bd -literal -offset indent
251 \&.Bl -tag -width 2i
252 .Ed
253 .Pp
254 The syntax for scaled widths is
255 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
256 where a decimal must be preceded or proceeded by at least one digit.
257 Negative numbers, while accepted, are truncated to zero.
258 The following scaling units are accepted:
259 .Pp
260 .Bl -tag -width Ds -offset indent -compact
261 .It c
262 centimetre
263 .It i
264 inch
265 .It P
266 pica (~1/6 inch)
267 .It p
268 point (~1/72 inch)
269 .It f
270 synonym for
271 .Sq u
272 .It v
273 default vertical span
274 .It m
275 width of rendered
276 .Sq m
277 .Pq em
278 character
279 .It n
280 width of rendered
281 .Sq n
282 .Pq en
283 character
284 .It u
285 default horizontal span
286 .It M
287 mini-em (~1/100 em)
288 .El
289 .Pp
290 Using anything other than
291 .Sq m ,
292 .Sq n ,
293 .Sq u ,
294 or
295 .Sq v
296 is necessarily non-portable across output media.
297 See
298 .Sx COMPATIBILITY .
299 .Ss Sentence Spacing
300 When composing a manual, make sure that your sentences end at the end of
301 a line.
302 By doing so, front-ends will be able to apply the proper amount of
303 spacing after the end of sentence (unescaped) period, exclamation mark,
304 or question mark followed by zero or more non-sentence closing
305 delimiters (
306 .Ns Sq \&) ,
307 .Sq \&] ,
308 .Sq \&' ,
309 .Sq \&" ) .
310 .Pp
311 The proper spacing is also intelligently preserved if a sentence ends at
312 the boundary of a macro line, e.g.,
313 .Pp
314 .D1 \&Xr mandoc 1 \.
315 .D1 \&Fl T \&Ns \&Cm ascii \.
316 .Sh MANUAL STRUCTURE
317 A well-formed
318 .Nm
319 document consists of a document prologue followed by one or more
320 sections.
321 .Pp
322 The prologue, which consists of (in order) the
323 .Sx \&Dd ,
324 .Sx \&Dt ,
325 and
326 .Sx \&Os
327 macros, is required for every document.
328 .Pp
329 The first section (sections are denoted by
330 .Sx \&Sh )
331 must be the NAME section, consisting of at least one
332 .Sx \&Nm
333 followed by
334 .Sx \&Nd .
335 .Pp
336 Following that, convention dictates specifying at least the SYNOPSIS and
337 DESCRIPTION sections, although this varies between manual sections.
338 .Pp
339 The following is a well-formed skeleton
340 .Nm
341 file:
342 .Bd -literal -offset indent
343 \&.Dd $\&Mdocdate$
344 \&.Dt mdoc 7
345 \&.Os
346 \&.
347 \&.Sh NAME
348 \&.Nm foo
349 \&.Nd a description goes here
350 \&.\e\*q The next is for sections 2, 3, & 9 only.
351 \&.\e\*q .Sh LIBRARY
352 \&.
353 \&.Sh SYNOPSIS
354 \&.Nm foo
355 \&.Op Fl options
356 \&.Ar
357 \&.
358 \&.Sh DESCRIPTION
359 The
360 \&.Nm
361 utility processes files ...
362 \&.\e\*q .Sh IMPLEMENTATION NOTES
363 \&.\e\*q The next is for sections 2, 3, & 9 only.
364 \&.\e\*q .Sh RETURN VALUES
365 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
366 \&.\e\*q .Sh ENVIRONMENT
367 \&.\e\*q .Sh FILES
368 \&.\e\*q The next is for sections 1 & 8 only.
369 \&.\e\*q .Sh EXIT STATUS
370 \&.\e\*q .Sh EXAMPLES
371 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
372 \&.\e\*q .Sh DIAGNOSTICS
373 \&.\e\*q The next is for sections 2, 3, & 9 only.
374 \&.\e\*q .Sh ERRORS
375 \&.\e\*q .Sh SEE ALSO
376 \&.\e\*q .Xr foobar 1
377 \&.\e\*q .Sh STANDARDS
378 \&.\e\*q .Sh HISTORY
379 \&.\e\*q .Sh AUTHORS
380 \&.\e\*q .Sh CAVEATS
381 \&.\e\*q .Sh BUGS
382 \&.\e\*q .Sh SECURITY CONSIDERATIONS
383 .Ed
384 .Pp
385 The sections in a
386 .Nm
387 document are conventionally ordered as they appear above.
388 Sections should be composed as follows:
389 .Bl -ohang -offset Ds
390 .It Em NAME
391 The name(s) and a short description of the documented material.
392 The syntax for this as follows:
393 .Bd -literal -offset indent
394 \&.Nm name0
395 \&.Nm name1
396 \&.Nm name2
397 \&.Nd a short description
398 .Ed
399 .Pp
400 The
401 .Sx \&Nm
402 macro(s) must precede the
403 .Sx \&Nd
404 macro.
405 .Pp
406 See
407 .Sx \&Nm
408 and
409 .Sx \&Nd .
410 .It Em LIBRARY
411 The name of the library containing the documented material, which is
412 assumed to be a function in a section 2, 3, or 9 manual.
413 The syntax for this is as follows:
414 .Bd -literal -offset indent
415 \&.Lb libarm
416 .Ed
417 .Pp
418 See
419 .Sx \&Lb .
420 .It Em SYNOPSIS
421 Documents the utility invocation syntax, function call syntax, or device
422 configuration.
423 .Pp
424 For the first, utilities (sections 1, 6, and 8), this is
425 generally structured as follows:
426 .Bd -literal -offset indent
427 \&.Nm foo
428 \&.Op Fl v
429 \&.Op Fl o Ar file
430 \&.Op Ar
431 \&.Nm bar
432 \&.Op Fl v
433 \&.Op Fl o Ar file
434 \&.Op Ar
435 .Ed
436 .Pp
437 For the second, function calls (sections 2, 3, 9):
438 .Bd -literal -offset indent
439 \&.Vt extern const char *global;
440 \&.In header.h
441 \&.Ft "char *"
442 \&.Fn foo "const char *src"
443 \&.Ft "char *"
444 \&.Fn bar "const char *src"
445 .Ed
446 .Pp
447 And for the third, configurations (section 4):
448 .Bd -literal -offset indent
449 \&.Cd \*qit* at isa? port 0x2e\*q
450 \&.Cd \*qit* at isa? port 0x4e\*q
451 .Ed
452 .Pp
453 Manuals not in these sections generally don't need a
454 .Em SYNOPSIS .
455 .Pp
456 See
457 .Sx \&Op ,
458 .Sx \&Cd ,
459 .Sx \&Fn ,
460 .Sx \&Ft ,
461 and
462 .Sx \&Vt .
463 .It Em DESCRIPTION
464 This expands upon the brief, one-line description in
465 .Em NAME .
466 It usually contains a break-down of the options (if documenting a
467 command), such as:
468 .Bd -literal -offset indent
469 The arguments are as follows:
470 \&.Bl \-tag \-width Ds
471 \&.It Fl v
472 Print verbose information.
473 \&.El
474 .Ed
475 .Pp
476 Manuals not documenting a command won't include the above fragment.
477 .It Em IMPLEMENTATION NOTES
478 Implementation-specific notes should be kept here.
479 This is useful when implementing standard functions that may have side
480 effects or notable algorithmic implications.
481 .It Em RETURN VALUES
482 This section is the dual of
483 .Em EXIT STATUS ,
484 which is used for commands.
485 It documents the return values of functions in sections 2, 3, and 9.
486 .Pp
487 See
488 .Sx \&Rv .
489 .It Em ENVIRONMENT
490 Documents any usages of environment variables, e.g.,
491 .Xr environ 7 .
492 .Pp
493 See
494 .Sx \&Ev .
495 .It Em FILES
496 Documents files used.
497 It's helpful to document both the file and a short description of how
498 the file is used (created, modified, etc.).
499 .Pp
500 See
501 .Sx \&Pa .
502 .It Em EXIT STATUS
503 Command exit status for section 1, 6, and 8 manuals.
504 This section is the dual of
505 .Em RETURN VALUES ,
506 which is used for functions.
507 Historically, this information was described in
508 .Em DIAGNOSTICS ,
509 a practise that is now discouraged.
510 .Pp
511 See
512 .Sx \&Ex .
513 .It Em EXAMPLES
514 Example usages.
515 This often contains snippets of well-formed, well-tested invocations.
516 Make doubly sure that your examples work properly!
517 .It Em DIAGNOSTICS
518 Documents error conditions.
519 This is most useful in section 4 manuals.
520 Historically, this section was used in place of
521 .Em EXIT STATUS
522 for manuals in sections 1, 6, and 8; however, this practise is
523 discouraged.
524 .Pp
525 See
526 .Sx \&Bl
527 .Fl diag .
528 .It Em ERRORS
529 Documents error handling in sections 2, 3, and 9.
530 .Pp
531 See
532 .Sx \&Er .
533 .It Em SEE ALSO
534 References other manuals with related topics.
535 This section should exist for most manuals.
536 Cross-references should conventionally be ordered first by section, then
537 alphabetically.
538 .Pp
539 See
540 .Sx \&Xr .
541 .It Em STANDARDS
542 References any standards implemented or used.
543 If not adhering to any standards, the
544 .Em HISTORY
545 section should be used instead.
546 .Pp
547 See
548 .Sx \&St .
549 .It Em HISTORY
550 The history of any manual without a
551 .Em STANDARDS
552 section should be described in this section.
553 .It Em AUTHORS
554 Credits to authors, if applicable, should appear in this section.
555 Authors should generally be noted by both name and an e-mail address.
556 .Pp
557 See
558 .Sx \&An .
559 .It Em CAVEATS
560 Explanations of common misuses and misunderstandings should be explained
561 in this section.
562 .It Em BUGS
563 Extant bugs should be described in this section.
564 .It Em SECURITY CONSIDERATIONS
565 Documents any security precautions that operators should consider.
566 .El
567 .Sh MACRO SYNTAX
568 Macros are one to three three characters in length and begin with a
569 control character ,
570 .Sq \&. ,
571 at the beginning of the line.
572 An arbitrary amount of whitespace may sit between the control character
573 and the macro name.
574 Thus, the following are equivalent:
575 .Bd -literal -offset indent
576 \&.Pp
577 \&.\ \ \ \&Pp
578 .Ed
579 .Pp
580 The syntax of a macro depends on its classification.
581 In this section,
582 .Sq \-arg
583 refers to macro arguments, which may be followed by zero or more
584 .Sq parm
585 parameters;
586 .Sq \&Yo
587 opens the scope of a macro; and if specified,
588 .Sq \&Yc
589 closes it out.
590 .Pp
591 The
592 .Em Callable
593 column indicates that the macro may be called subsequent to the initial
594 line-macro.
595 If a macro is not callable, then its invocation after the initial line
596 macro is interpreted as opaque text, such that
597 .Sq \&.Fl \&Sh
598 produces
599 .Sq Fl \&Sh .
600 .Pp
601 The
602 .Em Parsable
603 column indicates whether the macro may be followed by further
604 (ostensibly callable) macros.
605 If a macro is not parsable, subsequent macro invocations on the line
606 will be interpreted as opaque text.
607 .Pp
608 The
609 .Em Scope
610 column, if applicable, describes closure rules.
611 .Ss Block full-explicit
612 Multi-line scope closed by an explicit closing macro.
613 All macros contains bodies; only
614 .Sx \&Bf
615 contains a head.
616 .Bd -literal -offset indent
617 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
618 \(lBbody...\(rB
619 \&.Yc
620 .Ed
621 .Pp
622 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
623 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
624 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
625 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
626 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
627 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
628 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
629 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
630 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
631 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
632 .El
633 .Ss Block full-implicit
634 Multi-line scope closed by end-of-file or implicitly by another macro.
635 All macros have bodies; some
636 .Po
637 .Sx \&It Fl bullet ,
638 .Fl hyphen ,
639 .Fl dash ,
640 .Fl enum ,
641 .Fl item
642 .Pc
643 don't have heads; only one
644 .Po
645 .Sx \&It Fl column
646 .Pc
647 has multiple heads.
648 .Bd -literal -offset indent
649 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
650 \(lBbody...\(rB
651 .Ed
652 .Pp
653 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
654 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
655 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
656 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
657 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
658 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
659 .El
660 .Ss Block partial-explicit
661 Like block full-explicit, but also with single-line scope.
662 Each has at least a body and, in limited circumstances, a head
663 .Po
664 .Sx \&Fo ,
665 .Sx \&Eo
666 .Pc
667 and/or tail
668 .Pq Sx \&Ec .
669 .Bd -literal -offset indent
670 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
671 \(lBbody...\(rB
672 \&.Yc \(lBtail...\(rB
673
674 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
675 \(lBbody...\(rB \&Yc \(lBtail...\(rB
676 .Ed
677 .Pp
678 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
679 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
680 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
681 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
682 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
683 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
684 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
685 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
686 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
687 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
688 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
689 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
690 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
691 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
692 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
693 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
694 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
695 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
696 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
697 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
698 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
699 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
700 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
701 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
702 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
703 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
704 .El
705 .Ss Block partial-implicit
706 Like block full-implicit, but with single-line scope closed by
707 .Sx Reserved Characters
708 or end of line.
709 .Bd -literal -offset indent
710 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
711 .Ed
712 .Pp
713 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
714 .It Em Macro Ta Em Callable Ta Em Parsable
715 .It Sx \&Aq Ta Yes Ta Yes
716 .It Sx \&Bq Ta Yes Ta Yes
717 .It Sx \&Brq Ta Yes Ta Yes
718 .It Sx \&D1 Ta \&No Ta \&Yes
719 .It Sx \&Dl Ta \&No Ta Yes
720 .It Sx \&Dq Ta Yes Ta Yes
721 .It Sx \&Op Ta Yes Ta Yes
722 .It Sx \&Pq Ta Yes Ta Yes
723 .It Sx \&Ql Ta Yes Ta Yes
724 .It Sx \&Qq Ta Yes Ta Yes
725 .It Sx \&Sq Ta Yes Ta Yes
726 .It Sx \&Vt Ta Yes Ta Yes
727 .El
728 .Pp
729 Note that the
730 .Sx \&Vt
731 macro is a
732 .Sx Block partial-implicit
733 only when invoked as the first macro
734 in a
735 .Em SYNOPSIS
736 section line, else it is
737 .Sx In-line .
738 .Ss In-line
739 Closed by
740 .Sx Reserved Characters ,
741 end of line, fixed argument lengths, and/or subsequent macros.
742 In-line macros have only text children.
743 If a number (or inequality) of arguments is
744 .Pq n ,
745 then the macro accepts an arbitrary number of arguments.
746 .Bd -literal -offset indent
747 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
748
749 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
750
751 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
752 .Ed
753 .Pp
754 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
755 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
756 .It Sx \&%A Ta \&No Ta \&No Ta >0
757 .It Sx \&%B Ta \&No Ta \&No Ta >0
758 .It Sx \&%C Ta \&No Ta \&No Ta >0
759 .It Sx \&%D Ta \&No Ta \&No Ta >0
760 .It Sx \&%I Ta \&No Ta \&No Ta >0
761 .It Sx \&%J Ta \&No Ta \&No Ta >0
762 .It Sx \&%N Ta \&No Ta \&No Ta >0
763 .It Sx \&%O Ta \&No Ta \&No Ta >0
764 .It Sx \&%P Ta \&No Ta \&No Ta >0
765 .It Sx \&%Q Ta \&No Ta \&No Ta >0
766 .It Sx \&%R Ta \&No Ta \&No Ta >0
767 .It Sx \&%T Ta \&No Ta \&No Ta >0
768 .It Sx \&%U Ta \&No Ta \&No Ta >0
769 .It Sx \&%V Ta \&No Ta \&No Ta >0
770 .It Sx \&Ad Ta Yes Ta Yes Ta n
771 .It Sx \&An Ta Yes Ta Yes Ta n
772 .It Sx \&Ap Ta Yes Ta Yes Ta 0
773 .It Sx \&Ar Ta Yes Ta Yes Ta n
774 .It Sx \&At Ta Yes Ta Yes Ta 1
775 .It Sx \&Bsx Ta Yes Ta Yes Ta n
776 .It Sx \&Bt Ta \&No Ta \&No Ta 0
777 .It Sx \&Bx Ta Yes Ta Yes Ta n
778 .It Sx \&Cd Ta Yes Ta Yes Ta >0
779 .It Sx \&Cm Ta Yes Ta Yes Ta n
780 .It Sx \&Db Ta \&No Ta \&No Ta 1
781 .It Sx \&Dd Ta \&No Ta \&No Ta >0
782 .It Sx \&Dt Ta \&No Ta \&No Ta n
783 .It Sx \&Dv Ta Yes Ta Yes Ta n
784 .It Sx \&Dx Ta Yes Ta Yes Ta n
785 .It Sx \&Em Ta Yes Ta Yes Ta >0
786 .It Sx \&En Ta \&No Ta \&No Ta 0
787 .It Sx \&Er Ta Yes Ta Yes Ta >0
788 .It Sx \&Es Ta \&No Ta \&No Ta 0
789 .It Sx \&Ev Ta Yes Ta Yes Ta n
790 .It Sx \&Ex Ta \&No Ta \&No Ta n
791 .It Sx \&Fa Ta Yes Ta Yes Ta n
792 .It Sx \&Fd Ta \&No Ta \&No Ta >0
793 .It Sx \&Fl Ta Yes Ta Yes Ta n
794 .It Sx \&Fn Ta Yes Ta Yes Ta >0
795 .It Sx \&Fr Ta \&No Ta \&No Ta n
796 .It Sx \&Ft Ta Yes Ta Yes Ta n
797 .It Sx \&Fx Ta Yes Ta Yes Ta n
798 .It Sx \&Hf Ta \&No Ta \&No Ta n
799 .It Sx \&Ic Ta Yes Ta Yes Ta >0
800 .It Sx \&In Ta \&No Ta \&No Ta n
801 .It Sx \&Lb Ta \&No Ta \&No Ta 1
802 .It Sx \&Li Ta Yes Ta Yes Ta n
803 .It Sx \&Lk Ta Yes Ta Yes Ta n
804 .It Sx \&Lp Ta \&No Ta \&No Ta 0
805 .It Sx \&Ms Ta Yes Ta Yes Ta >0
806 .It Sx \&Mt Ta Yes Ta Yes Ta >0
807 .It Sx \&Nm Ta Yes Ta Yes Ta n
808 .It Sx \&No Ta Yes Ta Yes Ta 0
809 .It Sx \&Ns Ta Yes Ta Yes Ta 0
810 .It Sx \&Nx Ta Yes Ta Yes Ta n
811 .It Sx \&Os Ta \&No Ta \&No Ta n
812 .It Sx \&Ot Ta \&No Ta \&No Ta n
813 .It Sx \&Ox Ta Yes Ta Yes Ta n
814 .It Sx \&Pa Ta Yes Ta Yes Ta n
815 .It Sx \&Pf Ta Yes Ta Yes Ta 1
816 .It Sx \&Pp Ta \&No Ta \&No Ta 0
817 .It Sx \&Rv Ta \&No Ta \&No Ta n
818 .It Sx \&Sm Ta \&No Ta \&No Ta 1
819 .It Sx \&St Ta \&No Ta Yes Ta 1
820 .It Sx \&Sx Ta Yes Ta Yes Ta >0
821 .It Sx \&Sy Ta Yes Ta Yes Ta >0
822 .It Sx \&Tn Ta Yes Ta Yes Ta >0
823 .It Sx \&Ud Ta \&No Ta \&No Ta 0
824 .It Sx \&Ux Ta Yes Ta Yes Ta n
825 .It Sx \&Va Ta Yes Ta Yes Ta n
826 .It Sx \&Vt Ta Yes Ta Yes Ta >0
827 .It Sx \&Xr Ta Yes Ta Yes Ta >0
828 .It Sx \&br Ta \&No Ta \&No Ta 0
829 .It Sx \&sp Ta \&No Ta \&No Ta 1
830 .El
831 .Sh REFERENCE
832 This section is a canonical reference of all macros, arranged
833 alphabetically.
834 For the scoping of individual macros, see
835 .Sx MACRO SYNTAX .
836 .Ss \&%A
837 Author name of an
838 .Sx \&Rs
839 block. Multiple authors should each be accorded their own
840 .Sx \%%A
841 line. Author names should be ordered with full or abbreviated
842 forename(s) first, then full surname.
843 .Ss \&%B
844 Book title of an
845 .Sx \&Rs
846 block. This macro may also be used in a non-bibliographic context when
847 referring to book titles.
848 .Ss \&%C
849 Publication city or location of an
850 .Sx \&Rs
851 block.
852 .Pp
853 .Em Remarks :
854 this macro is not implemented in
855 .Xr groff 1 .
856 .Ss \&%D
857 Publication date of an
858 .Sx \&Rs
859 block. This should follow the reduced or canonical form syntax
860 described in
861 .Sx Dates .
862 .Ss \&%I
863 Publisher or issuer name of an
864 .Sx \&Rs
865 block.
866 .Ss \&%J
867 Journal name of an
868 .Sx \&Rs
869 block.
870 .Ss \&%N
871 Issue number (usually for journals) of an
872 .Sx \&Rs
873 block.
874 .Ss \&%O
875 Optional information of an
876 .Sx \&Rs
877 block.
878 .Ss \&%P
879 Book or journal page number of an
880 .Sx \&Rs
881 block.
882 .Ss \&%Q
883 Institutional author (school, government, etc.) of an
884 .Sx \&Rs
885 block. Multiple institutional authors should each be accorded their own
886 .Sx \&%Q
887 line.
888 .Ss \&%R
889 Technical report name of an
890 .Sx \&Rs
891 block.
892 .Ss \&%T
893 Article title of an
894 .Sx \&Rs
895 block. This macro may also be used in a non-bibliographical context
896 when referring to article titles.
897 .Ss \&%U
898 URI of reference document.
899 .Ss \&%V
900 Volume number of an
901 .Sx \&Rs
902 block.
903 .Ss \&Ac
904 Closes an
905 .Sx \&Ao
906 block. Does not have any tail arguments.
907 .Ss \&Ad
908 Address construct: usually in the context of an computational address in
909 memory, not a physical (post) address.
910 .Pp
911 Examples:
912 .D1 \&.Ad [0,$]
913 .D1 \&.Ad 0x00000000
914 .Ss \&An
915 Author name.
916 This macro may alternatively accepts the following arguments, although
917 these may not be specified along with a parameter:
918 .Bl -tag -width 12n -offset indent
919 .It Fl split
920 Renders a line break before each author listing.
921 .It Fl nosplit
922 The opposite of
923 .Fl split .
924 .El
925 .Pp
926 In the AUTHORS section, the default is not to split the first author
927 listing, but all subsequent author listings, whether or not they're
928 interspersed by other macros or text, are split.
929 Thus, specifying
930 .Fl split
931 will cause the first listing also to be split.
932 If not in the AUTHORS section, the default is not to split.
933 .Pp
934 Examples:
935 .D1 \&.An -nosplit
936 .D1 \&.An J. D. Ullman .
937 .Pp
938 .Em Remarks :
939 the effects of
940 .Fl split
941 or
942 .Fl nosplit
943 are re-set when entering the AUTHORS section, so if one specifies
944 .Sx \&An Fl nosplit
945 in the general document body, it must be re-specified in the AUTHORS
946 section.
947 .Ss \&Ao
948 Begins a block enclosed by angled brackets.
949 Does not have any head arguments.
950 .Pp
951 Examples:
952 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
953 .Pp
954 See also
955 .Sx \&Aq .
956 .Ss \&Ap
957 Inserts an apostrophe without any surrounding white-space.
958 This is generally used as a grammatic device when referring to the verb
959 form of a function:
960 .Bd -literal -offset indent
961 \&.Fn execve Ap d
962 .Ed
963 .Ss \&Aq
964 Encloses its arguments in angled brackets.
965 .Pp
966 Examples:
967 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
968 .Pp
969 .Em Remarks :
970 this macro is often abused for rendering URIs, which should instead use
971 .Sx \&Lk
972 or
973 .Sx \&Mt ,
974 or to note pre-processor
975 .Dq Li #include
976 statements, which should use
977 .Sx \&In .
978 .Pp
979 See also
980 .Sx \&Ao .
981 .Ss \&Ar
982 Command arguments.
983 If an argument is not provided, the string
984 .Dq file ...
985 is used as a default.
986 .Pp
987 Examples:
988 .D1 \&.Fl o \&Ns \&Ar file1
989 .D1 \&.Ar
990 .D1 \&.Ar arg1 , arg2 .
991 .Ss \&At
992 Formats an AT&T version.
993 Accepts at most one parameter:
994 .Bl -tag -width 12n -offset indent
995 .It Cm v[1-7] | 32v
996 A version of
997 .At .
998 .It Cm V[.[1-4]]?
999 A system version of
1000 .At .
1001 .El
1002 .Pp
1003 Note that these parameters do not begin with a hyphen.
1004 .Pp
1005 Examples:
1006 .D1 \&.At
1007 .D1 \&.At V.1
1008 .Pp
1009 See also
1010 .Sx \&Bsx ,
1011 .Sx \&Bx ,
1012 .Sx \&Dx ,
1013 .Sx \&Fx ,
1014 .Sx \&Nx ,
1015 .Sx \&Ox ,
1016 and
1017 .Sx \&Ux .
1018 .Ss \&Bc
1019 Closes a
1020 .Sx \&Bo
1021 block. Does not have any tail arguments.
1022 .Ss \&Bd
1023 Begins a display block.
1024 A display is collection of macros or text which may be collectively
1025 offset or justified in a manner different from that
1026 of the enclosing context.
1027 By default, the block is preceded by a vertical space.
1028 .Pp
1029 Each display is associated with a type, which must be one of the
1030 following arguments:
1031 .Bl -tag -width 12n -offset indent
1032 .It Fl ragged
1033 Only left-justify the block.
1034 .It Fl unfilled
1035 Do not justify the block at all.
1036 .It Fl filled
1037 Left- and right-justify the block.
1038 .It Fl literal
1039 Alias for
1040 .Fl unfilled .
1041 .It Fl centered
1042 Centre-justify each line.
1043 .El
1044 .Pp
1045 The type must be provided first.
1046 Secondary arguments are as follows:
1047 .Bl -tag -width 12n -offset indent
1048 .It Fl offset Ar width
1049 Offset by the value of
1050 .Ar width ,
1051 which is interpreted as one of the following, specified in order:
1052 .Bl -item
1053 .It
1054 As one of the pre-defined strings
1055 .Ar indent ,
1056 the width of standard indentation;
1057 .Ar indent-two ,
1058 twice
1059 .Ar indent ;
1060 .Ar left ,
1061 which has no effect ;
1062 .Ar right ,
1063 which justifies to the right margin; and
1064 .Ar center ,
1065 which aligns around an imagined centre axis.
1066 .It
1067 As a precalculated width for a named macro.
1068 The most popular is the imaginary macro
1069 .Ar \&Ds ,
1070 which resolves to
1071 .Ar 6n .
1072 .It
1073 As a scaling unit following the syntax described in
1074 .Sx Scaling Widths .
1075 .It
1076 As the calculated string length of the opaque string.
1077 .El
1078 .Pp
1079 If unset, it will revert to the value of
1080 .Ar 8n
1081 as described in
1082 .Sx Scaling Widths .
1083 .It Fl compact
1084 Do not assert a vertical space before the block.
1085 .It Fl file Ar file
1086 Prepend the file
1087 .Ar file
1088 before any text or macros within the block.
1089 .El
1090 .Pp
1091 Examples:
1092 .Bd -literal -offset indent
1093 \&.Bd \-unfilled \-offset two-indent \-compact
1094 Hello world.
1095 \&.Ed
1096 .Ed
1097 .Pp
1098 See also
1099 .Sx \&D1
1100 and
1101 .Sx \&Dl .
1102 .Ss \&Bf
1103 .Ss \&Bk
1104 .Ss \&Bl
1105 Begins a list composed of one or more list entries.
1106 A list is associated with a type, which is a required argument.
1107 Other arguments are
1108 .Fl width ,
1109 defined per-type as accepting a literal or
1110 .Sx Scaling Widths
1111 value;
1112 .Fl offset ,
1113 also accepting a literal or
1114 .Sx Scaling Widths
1115 value setting the list's global offset; and
1116 .Fl compact ,
1117 suppressing the default vertical space printed before each list entry.
1118 A list entry is specified by the
1119 .Sx \&It
1120 macro, which consists of a head and optional body (depending on the list
1121 type).
1122 A list must specify one of the following list types:
1123 .Bl -tag -width 12n -offset indent
1124 .It Fl bullet
1125 A list offset by a bullet.
1126 The head of list entries must be empty.
1127 List entry bodies are positioned after the bullet.
1128 The
1129 .Fl width
1130 argument varies the width of list bodies' left-margins.
1131 .It Fl column
1132 A columnated list.
1133 The
1134 .Fl width
1135 argument has no effect.
1136 The number of columns is specified as parameters to the
1137 .Sx \&Bl
1138 macro.
1139 These dictate the width of columns either as
1140 .Sx Scaling Widths
1141 or literal text.
1142 List entry bodies must be left empty.
1143 Column bodies have the following syntax:
1144 .Pp
1145 .D1 .It col1 <TAB> ... coln
1146 .D1 .It col1 Ta ... coln
1147 .D1 .It col1 <TAB> col2 Ta coln
1148 .Pp
1149 where columns may be separated by tabs, the literal string
1150 .Qq Ta ,
1151 or a mixture of both.
1152 These are equivalent except that quoted sections propogate over tabs,
1153 for example,
1154 .Pp
1155 .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq ;
1156 .Pp
1157 will preserve the semicolon whitespace except for the last.
1158 .It Fl dash
1159 A list offset by a dash (hyphen).
1160 The head of list entries must be empty.
1161 List entry bodies are positioned past the dash.
1162 The
1163 .Fl width
1164 argument varies the width of list bodies' left-margins.
1165 .It Fl diag
1166 Like
1167 .Fl inset ,
1168 but with additional formatting to the head.
1169 The
1170 .Fl width
1171 argument varies the width of list bodies' left-margins.
1172 .It Fl enum
1173 An enumerated list offset by the enumeration from 1.
1174 The head of list entries must be empty.
1175 List entry bodies are positioned after the enumeration.
1176 The
1177 .Fl width
1178 argument varies the width of list bodies' left-margins.
1179 .It Fl hang
1180 Like
1181 .Fl tag ,
1182 but instead of list bodies positioned after the head, they trail the
1183 head text.
1184 The
1185 .Fl width
1186 argument varies the width of list bodies' left-margins.
1187 .It Fl hyphen
1188 Synonym for
1189 .Fl dash .
1190 .It Fl inset
1191 List bodies follow the list head.
1192 The
1193 .Fl width
1194 argument is ignored.
1195 .It Fl item
1196 This produces blocks of text.
1197 The head of list entries must be empty.
1198 The
1199 .Fl width
1200 argument is ignored.
1201 .It Fl ohang
1202 List bodies are positioned on the line following the head.
1203 The
1204 .Fl width
1205 argument is ignored.
1206 .It Fl tag
1207 A list offset by list entry heads. List entry bodies are positioned
1208 after the head as specified by the
1209 .Fl width
1210 argument.
1211 .El
1212 .Ss \&Bo
1213 Begins a block enclosed by square brackets.
1214 Does not have any head arguments.
1215 .Pp
1216 Examples:
1217 .Bd -literal -offset indent
1218 \&.Bo 1 ,
1219 \&.Dv BUFSIZ \&Bc
1220 .Ed
1221 .Pp
1222 See also
1223 .Sx \&Bq .
1224 .Ss \&Bq
1225 Encloses its arguments in square brackets.
1226 .Pp
1227 Examples:
1228 .D1 \&.Bq 1 , \&Dv BUFSIZ
1229 .Pp
1230 .Em Remarks :
1231 this macro is sometimes abused to emulate optional arguments for
1232 commands; the correct macros to use for this purpose are
1233 .Sx \&Op ,
1234 .Sx \&Oo ,
1235 and
1236 .Sx \&Oc .
1237 .Pp
1238 See also
1239 .Sx \&Bo .
1240 .Ss \&Brc
1241 Closes a
1242 .Sx \&Bro
1243 block. Does not have any tail arguments.
1244 .Ss \&Bro
1245 Begins a block enclosed by curly braces.
1246 Does not have any head arguments.
1247 .Pp
1248 Examples:
1249 .Bd -literal -offset indent
1250 \&.Bro 1 , ... ,
1251 \&.Va n \&Brc
1252 .Ed
1253 .Pp
1254 See also
1255 .Sx \&Brq .
1256 .Ss \&Brq
1257 Encloses its arguments in curly braces.
1258 .Pp
1259 Examples:
1260 .D1 \&.Brq 1 , ... , \&Va n
1261 .Pp
1262 See also
1263 .Sx \&Bro .
1264 .Ss \&Bsx
1265 Format the BSD/OS version provided as an argument, or a default value if
1266 no argument is provided.
1267 .Pp
1268 Examples:
1269 .D1 \&.Bsx 1.0
1270 .D1 \&.Bsx
1271 .Pp
1272 See also
1273 .Sx \&At ,
1274 .Sx \&Bx ,
1275 .Sx \&Dx ,
1276 .Sx \&Fx ,
1277 .Sx \&Nx ,
1278 .Sx \&Ox ,
1279 and
1280 .Sx \&Ux .
1281 .Ss \&Bt
1282 Prints
1283 .Dq is currently in beta test.
1284 .Ss \&Bx
1285 Format the BSD version provided as an argument, or a default value if no
1286 argument is provided.
1287 .Pp
1288 Examples:
1289 .D1 \&.Bx 4.4
1290 .D1 \&.Bx
1291 .Pp
1292 See also
1293 .Sx \&At ,
1294 .Sx \&Bsx ,
1295 .Sx \&Dx ,
1296 .Sx \&Fx ,
1297 .Sx \&Nx ,
1298 .Sx \&Ox ,
1299 and
1300 .Sx \&Ux .
1301 .Ss \&Cd
1302 Configuration declaration.
1303 This denotes strings accepted by
1304 .Xr config 8 .
1305 .Pp
1306 Examples:
1307 .D1 \&.Cd device le0 at scode?
1308 .Pp
1309 .Em Remarks :
1310 this macro is commonly abused by using quoted literals to retain
1311 white-space and align consecutive
1312 .Sx \&Cd
1313 declarations.
1314 This practise is discouraged.
1315 .Ss \&Cm
1316 Command modifiers.
1317 Useful when specifying configuration options or keys.
1318 .Pp
1319 Examples:
1320 .D1 \&.Cm ControlPath
1321 .D1 \&.Cm ControlMaster
1322 .Pp
1323 See also
1324 .Sx \&Fl .
1325 .Ss \&D1
1326 One-line indented display.
1327 This is formatted by the default rules and is useful for simple indented
1328 statements.
1329 It is followed by a newline.
1330 .Pp
1331 Examples:
1332 .D1 \&.D1 \&Fl abcdefgh
1333 .Pp
1334 See also
1335 .Sx \&Bd
1336 and
1337 .Sx \&Dl .
1338 .Ss \&Db
1339 .Ss \&Dc
1340 Closes a
1341 .Sx \&Do
1342 block. Does not have any tail arguments.
1343 .Ss \&Dd
1344 Document date.
1345 This is the mandatory first macro of any
1346 .Nm
1347 manual.
1348 Its calling syntax is as follows:
1349 .Pp
1350 .D1 \. Ns Sx \&Dd Cm date
1351 .Pp
1352 The
1353 .Cm date
1354 field may be either
1355 .Ar $\&Mdocdate$ ,
1356 which signifies the current manual revision date dictated by
1357 .Xr cvs 1 ,
1358 or instead a valid canonical date as specified by
1359 .Sx Dates .
1360 If a date does not conform, the current date is used instead.
1361 .Pp
1362 Examples:
1363 .D1 \&.Dd $\&Mdocdate$
1364 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1365 .D1 \&.Dd July 21, 2007
1366 .Pp
1367 See also
1368 .Sx \&Dt
1369 and
1370 .Sx \&Os .
1371 .Ss \&Dl
1372 One-line intended display.
1373 This is formatted as literal text and is useful for commands and
1374 invocations.
1375 It is followed by a newline.
1376 .Pp
1377 Examples:
1378 .D1 \&.Dl % mandoc mdoc.7 | less
1379 .Pp
1380 See also
1381 .Sx \&Bd
1382 and
1383 .Sx \&D1 .
1384 .Ss \&Do
1385 Begins a block enclosed by double quotes. Does not have any head
1386 arguments.
1387 .Pp
1388 Examples:
1389 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1390 .Pp
1391 See also
1392 .Sx \&Dq .
1393 .Ss \&Dq
1394 Encloses its arguments in double quotes.
1395 .Pp
1396 Examples:
1397 .Bd -literal -offset indent -compact
1398 \&.Dq April is the cruellest month
1399 \e(em T.S. Eliot
1400 .Ed
1401 .Pp
1402 See also
1403 .Sx \&Do .
1404 .Ss \&Dt
1405 Document title.
1406 This is the mandatory second macro of any
1407 .Nm
1408 file.
1409 Its calling syntax is as follows:
1410 .Pp
1411 .D1 \. Ns Sx \&Dt Op Cm title Op Cm section Op Cm volume | arch
1412 .Pp
1413 Its arguments are as follows:
1414 .Bl -tag -width Ds -offset Ds
1415 .It Cm title
1416 The document's title (name), defaulting to
1417 .Qq UNKNOWN
1418 if unspecified.
1419 It should be capitalised.
1420 .It Cm section
1421 The manual section.
1422 This may be one of
1423 .Ar 1
1424 .Pq utilities ,
1425 .Ar 2
1426 .Pq system calls ,
1427 .Ar 3
1428 .Pq libraries ,
1429 .Ar 3p
1430 .Pq Perl libraries ,
1431 .Ar 4
1432 .Pq devices ,
1433 .Ar 5
1434 .Pq file formats ,
1435 .Ar 6
1436 .Pq games ,
1437 .Ar 7
1438 .Pq miscellaneous ,
1439 .Ar 8
1440 .Pq system utilities ,
1441 .Ar 9
1442 .Pq kernel functions ,
1443 .Ar X11
1444 .Pq X Window System ,
1445 .Ar X11R6
1446 .Pq X Window System ,
1447 .Ar unass
1448 .Pq unassociated ,
1449 .Ar local
1450 .Pq local system ,
1451 .Ar draft
1452 .Pq draft manual ,
1453 or
1454 .Ar paper
1455 .Pq paper .
1456 It should correspond to the manual's filename suffix and defaults to
1457 .Qq 1
1458 if unspecified.
1459 .It Cm volume
1460 This overrides the volume inferred from
1461 .Ar section .
1462 This field is optional, and if specified, must be one of
1463 .Ar USD
1464 .Pq users' supplementary documents ,
1465 .Ar PS1
1466 .Pq programmers' supplementary documents ,
1467 .Ar AMD
1468 .Pq administrators' supplementary documents ,
1469 .Ar SMM
1470 .Pq system managers' manuals ,
1471 .Ar URM
1472 .Pq users' reference manuals ,
1473 .Ar PRM
1474 .Pq programmers' reference manuals ,
1475 .Ar KM
1476 .Pq kernel manuals ,
1477 .Ar IND
1478 .Pq master index ,
1479 .Ar MMI
1480 .Pq master index ,
1481 .Ar LOCAL
1482 .Pq local manuals ,
1483 .Ar LOC
1484 .Pq local manuals ,
1485 or
1486 .Ar CON
1487 .Pq contributed manuals .
1488 .It Cm arch
1489 This specifies a specific relevant architecture.
1490 If
1491 .Cm volume
1492 is not provided, it may be used in its place, else it may be used
1493 subsequent that.
1494 It, too, is optional.
1495 It must be one of
1496 .Ar alpha ,
1497 .Ar amd64 ,
1498 .Ar amiga ,
1499 .Ar arc ,
1500 .Ar arm ,
1501 .Ar armish ,
1502 .Ar aviion ,
1503 .Ar hp300 ,
1504 .Ar hppa ,
1505 .Ar hppa64 ,
1506 .Ar i386 ,
1507 .Ar landisk ,
1508 .Ar loongson ,
1509 .Ar luna88k ,
1510 .Ar mac68k ,
1511 .Ar macppc ,
1512 .Ar mvme68k ,
1513 .Ar mvme88k ,
1514 .Ar mvmeppc ,
1515 .Ar pmax ,
1516 .Ar sgi ,
1517 .Ar socppc ,
1518 .Ar sparc ,
1519 .Ar sparc64 ,
1520 .Ar sun3 ,
1521 .Ar vax ,
1522 or
1523 .Ar zaurus .
1524 .El
1525 .Pp
1526 Examples:
1527 .D1 \&.Dt FOO 1
1528 .D1 \&.Dt FOO 4 KM
1529 .D1 \&.Dt FOO 9 i386
1530 .Pp
1531 See also
1532 .Sx \&Dd
1533 and
1534 .Sx \&Os .
1535 .Ss \&Dv
1536 Defined variables such as preprocessor constants.
1537 .Pp
1538 Examples:
1539 .D1 \&.Dv BUFSIZ
1540 .D1 \&.Dv STDOUT_FILENO
1541 .Pp
1542 See also
1543 .Sx \&Er .
1544 .Ss \&Dx
1545 Format the DragonFly BSD version provided as an argument, or a default
1546 value if no argument is provided.
1547 .Pp
1548 Examples:
1549 .D1 \&.Dx 2.4.1
1550 .D1 \&.Dx
1551 .Pp
1552 See also
1553 .Sx \&At ,
1554 .Sx \&Bsx ,
1555 .Sx \&Bx ,
1556 .Sx \&Fx ,
1557 .Sx \&Nx ,
1558 .Sx \&Ox ,
1559 and
1560 .Sx \&Ux .
1561 .Ss \&Ec
1562 .Ss \&Ed
1563 .Ss \&Ef
1564 .Ss \&Ek
1565 .Ss \&El
1566 .Ss \&Em
1567 Denotes text that should be emphasised.
1568 Note that this is a presentation term and should not be used for
1569 stylistically decorating technical terms.
1570 .Pp
1571 Examples:
1572 .D1 \&.Em Warnings!
1573 .D1 \&.Em Remarks :
1574 .Ss \&En
1575 .Ss \&Eo
1576 .Ss \&Er
1577 Display error constants.
1578 .Pp
1579 Examples:
1580 .D1 \&.Er EPERM
1581 .D1 \&.Er ENOENT
1582 .Pp
1583 See also
1584 .Sx \&Dv .
1585 .Ss \&Es
1586 .Ss \&Ev
1587 Environmental variables such as those specified in
1588 .Xr environ 7 .
1589 .Pp
1590 Examples:
1591 .D1 \&.Ev DISPLAY
1592 .D1 \&.Ev PATH
1593 .Ss \&Ex
1594 Inserts text regarding a utility's exit values.
1595 This macro must have first the
1596 .Fl std
1597 argument specified, then an optional
1598 .Ar utility .
1599 If
1600 .Ar utility
1601 is not provided, the document's name as stipulated in
1602 .Sx \&Nm
1603 is provided.
1604 .Ss \&Fa
1605 .Ss \&Fc
1606 .Ss \&Fd
1607 .Ss \&Fl
1608 Command-line flag.
1609 Used when listing arguments to command-line utilities.
1610 Prints a fixed-width hyphen
1611 .Sq \-
1612 directly followed by each argument.
1613 If no arguments are provided, a hyphen is printed followed by a space.
1614 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1615 output.
1616 .Pp
1617 Examples:
1618 .D1 \&.Fl a b c
1619 .D1 \&.Fl \&Pf a b
1620 .D1 \&.Fl
1621 .D1 \&.Op \&Fl o \&Ns \&Ar file
1622 .Pp
1623 See also
1624 .Sx \&Cm .
1625 .Ss \&Fn
1626 .Ss \&Fo
1627 .Ss \&Fr
1628 .Ss \&Ft
1629 .Ss \&Fx
1630 Format the FreeBSD version provided as an argument, or a default value
1631 if no argument is provided.
1632 .Pp
1633 Examples:
1634 .D1 \&.Fx 7.1
1635 .D1 \&.Fx
1636 .Pp
1637 See also
1638 .Sx \&At ,
1639 .Sx \&Bsx ,
1640 .Sx \&Bx ,
1641 .Sx \&Dx ,
1642 .Sx \&Nx ,
1643 .Sx \&Ox ,
1644 and
1645 .Sx \&Ux .
1646 .Ss \&Hf
1647 .Ss \&Ic
1648 .Ss \&In
1649 .Ss \&It
1650 .Ss \&Lb
1651 Specify a library.
1652 The calling syntax is as follows:
1653 .Pp
1654 .D1 \. Ns Sx \&Lb Cm library
1655 .Pp
1656 The
1657 .Cm library
1658 parameter may be a system library, such as
1659 .Cm libz
1660 or
1661 .Cm libpam ,
1662 in which case a small library description is printed next to the linker
1663 invocation; or a custom library, in which case the library name is
1664 printed in quotes.
1665 This is most commonly used in the
1666 .Em SYNOPSIS
1667 section as described in
1668 .Sx MANUAL STRUCTURE .
1669 .Pp
1670 Examples:
1671 .D1 \&.Lb libz
1672 .D1 \&.Lb mdoc
1673 .Ss \&Li
1674 .Ss \&Lk
1675 Format a hyperlink.
1676 The calling syntax is as follows:
1677 .Pp
1678 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1679 .Pp
1680 Examples:
1681 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1682 .D1 \&.Lk http://bsd.lv
1683 .Pp
1684 See also
1685 .Sx \&Mt .
1686 .Ss \&Lp
1687 .Ss \&Ms
1688 .Ss \&Mt
1689 .Ss \&Nd
1690 .Ss \&Nm
1691 .Ss \&No
1692 .Ss \&Ns
1693 .Ss \&Nx
1694 Format the NetBSD version provided as an argument, or a default value if
1695 no argument is provided.
1696 .Pp
1697 Examples:
1698 .D1 \&.Nx 5.01
1699 .D1 \&.Nx
1700 .Pp
1701 See also
1702 .Sx \&At ,
1703 .Sx \&Bsx ,
1704 .Sx \&Bx ,
1705 .Sx \&Dx ,
1706 .Sx \&Fx ,
1707 .Sx \&Ox ,
1708 and
1709 .Sx \&Ux .
1710 .Ss \&Oc
1711 .Ss \&Oo
1712 .Ss \&Op
1713 .Ss \&Os
1714 Document operating system version.
1715 This is the mandatory third macro of
1716 any
1717 .Nm
1718 file. Its calling syntax is as follows:
1719 .Pp
1720 .D1 \. Ns Sx \&Os Op Cm system
1721 .Pp
1722 The optional
1723 .Cm system
1724 parameter specifies the relevant operating system or environment.
1725 Left unspecified, it defaults to the local operating system version.
1726 This is the suggested form.
1727 .Pp
1728 Examples:
1729 .D1 \&.Os
1730 .D1 \&.Os KTH/CSC/TCS
1731 .D1 \&.Os BSD 4.3
1732 .Pp
1733 See also
1734 .Sx \&Dd
1735 and
1736 .Sx \&Dt .
1737 .Ss \&Ot
1738 Unknown usage.
1739 .Pp
1740 .Em Remarks :
1741 this macro has been deprecated.
1742 .Ss \&Ox
1743 Format the OpenBSD version provided as an argument, or a default value
1744 if no argument is provided.
1745 .Pp
1746 Examples:
1747 .D1 \&.Ox 4.5
1748 .D1 \&.Ox
1749 .Pp
1750 See also
1751 .Sx \&At ,
1752 .Sx \&Bsx ,
1753 .Sx \&Bx ,
1754 .Sx \&Dx ,
1755 .Sx \&Fx ,
1756 .Sx \&Nx ,
1757 and
1758 .Sx \&Ux .
1759 .Ss \&Pa
1760 .Ss \&Pc
1761 .Ss \&Pf
1762 .Ss \&Po
1763 .Ss \&Pp
1764 .Ss \&Pq
1765 .Ss \&Qc
1766 .Ss \&Ql
1767 .Ss \&Qo
1768 .Ss \&Qq
1769 .Ss \&Re
1770 Closes a
1771 .Sx \&Rs
1772 block.
1773 Does not have any tail arguments.
1774 .Ss \&Rs
1775 Begins a bibliographic
1776 .Pq Dq reference
1777 block.
1778 Does not have any head arguments.
1779 The block macro may only contain
1780 .Sx \&%A ,
1781 .Sx \&%B ,
1782 .Sx \&%C ,
1783 .Sx \&%D ,
1784 .Sx \&%I ,
1785 .Sx \&%J ,
1786 .Sx \&%N ,
1787 .Sx \&%O ,
1788 .Sx \&%P ,
1789 .Sx \&%Q ,
1790 .Sx \&%R ,
1791 .Sx \&%T ,
1792 and
1793 .Sx \&%V
1794 child macros (at least one must be specified).
1795 .Pp
1796 Examples:
1797 .Bd -literal -offset indent -compact
1798 \&.Rs
1799 \&.%A J. E. Hopcroft
1800 \&.%A J. D. Ullman
1801 \&.%B Introduction to Automata Theory, Languages, and Computation
1802 \&.%I Addison-Wesley
1803 \&.%C Reading, Massachusettes
1804 \&.%D 1979
1805 \&.Re
1806 .Ed
1807 .Pp
1808 If an
1809 .Sx \&Rs
1810 block is used within a SEE ALSO section, a vertical space is asserted
1811 before the rendered output, else the block continues on the current
1812 line.
1813 .Ss \&Rv
1814 .Ss \&Sc
1815 .Ss \&Sh
1816 .Ss \&Sm
1817 .Ss \&So
1818 .Ss \&Sq
1819 .Ss \&Ss
1820 .Ss \&St
1821 .Ss \&Sx
1822 .Ss \&Sy
1823 .Ss \&Tn
1824 .Ss \&Ud
1825 Prints out
1826 .Dq currently under development.
1827 .Ss \&Ux
1828 Format the UNIX name.
1829 Accepts no argument.
1830 .Pp
1831 Examples:
1832 .D1 \&.Ux
1833 .Pp
1834 See also
1835 .Sx \&At ,
1836 .Sx \&Bsx ,
1837 .Sx \&Bx ,
1838 .Sx \&Dx ,
1839 .Sx \&Fx ,
1840 .Sx \&Nx ,
1841 and
1842 .Sx \&Ox .
1843 .Ss \&Va
1844 .Ss \&Vt
1845 A variable type.
1846 This is also used for indicating global variables in the SYNOPSIS
1847 section, in which case a variable name is also specified.
1848 Note that it accepts
1849 .Sx Block partial-implicit
1850 syntax when invoked as the first macro in the SYNOPSIS section, else it
1851 accepts ordinary
1852 .Sx In-line
1853 syntax.
1854 .Pp
1855 Note that this should not be confused with
1856 .Sx \&Ft ,
1857 which is used for function return types.
1858 .Pp
1859 Examples:
1860 .D1 \&.Vt unsigned char
1861 .D1 \&.Vt extern const char * const sys_signame[] ;
1862 .Pp
1863 See also
1864 .Sx \&Ft
1865 and
1866 .Sx \&Va .
1867 .Ss \&Xc
1868 Close a scope opened by
1869 .Sx \&Xo .
1870 .Ss \&Xo
1871 Open an extension scope.
1872 This macro originally existed to extend the 9-argument limit of troff;
1873 since this limit has been lifted, the macro has been deprecated.
1874 .Ss \&Xr
1875 Link to another manual
1876 .Pq Qq cross-reference .
1877 Its calling syntax is
1878 .Pp
1879 .D1 \. Ns Sx \&Xr Cm name section
1880 .Pp
1881 The
1882 .Cm name
1883 and
1884 .Cm section
1885 are the name and section of the linked manual.
1886 If
1887 .Cm section
1888 is followed by non-punctuation, an
1889 .Sx \&Ns
1890 is inserted into the token stream.
1891 This behaviour is for compatibility with
1892 .Xr groff 1 .
1893 .Pp
1894 Examples:
1895 .D1 \&.Xr mandoc 1
1896 .D1 \&.Xr mandoc 1 ;
1897 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1898 .Ss \&br
1899 .Ss \&sp
1900 .Sh COMPATIBILITY
1901 This section documents compatibility between mandoc and other other
1902 troff implementations, at this time limited to GNU troff
1903 .Pq Qq groff .
1904 The term
1905 .Qq historic groff
1906 refers to groff versions before the
1907 .Pa doc.tmac
1908 file re-write
1909 .Pq somewhere between 1.15 and 1.19 .
1910 .Pp
1911 Heirloom troff, the other significant troff implementation accepting
1912 \-mdoc, is similar to historic groff.
1913 .Pp
1914 .Bl -dash -compact
1915 .It
1916 The comment syntax
1917 .Sq \e."
1918 is no longer accepted.
1919 .It
1920 In groff, the
1921 .Sx \&Pa
1922 macro does not format its arguments when used in the FILES section under
1923 certain list types.
1924 mandoc does.
1925 .It
1926 Historic groff does not print a dash for empty
1927 .Sx \&Fl
1928 arguments.
1929 mandoc and newer groff implementations do.
1930 .It
1931 groff behaves irregularly when specifying
1932 .Sq \ef
1933 .Sx Text Decoration
1934 within line-macro scopes.
1935 mandoc follows a consistent system.
1936 .It
1937 In mandoc, negative scaling units are truncated to zero; groff would
1938 move to prior lines.
1939 Furthermore, the
1940 .Sq f
1941 scaling unit, while accepted, is rendered as the default unit.
1942 .It
1943 In quoted literals, groff allowed pair-wise double-quotes to produce a
1944 standalone double-quote in formatted output.
1945 This idiosyncratic behaviour is not applicable in mandoc.
1946 .It
1947 Display types
1948 .Sx \&Bd
1949 .Fl center
1950 and
1951 .Fl right
1952 are aliases for
1953 .Fl left
1954 in manodc. Furthermore, the
1955 .Fl file Ar file
1956 argument is ignored.
1957 Lastly, since text is not right-justified in mandoc (or even groff),
1958 .Fl ragged
1959 and
1960 .Fl filled
1961 are aliases, as are
1962 .Fl literal
1963 and
1964 .Fl unfilled .
1965 .It
1966 Historic groff has many un-callable macros.
1967 Most of these (excluding some block-level macros) are now callable.
1968 .It
1969 The vertical bar
1970 .Sq \(ba
1971 made historic groff
1972 .Qq go orbital
1973 but has been a proper delimiter since then.
1974 .It
1975 .Sx \&It Fl nested
1976 is assumed for all lists (it wasn't in historic groff): any list may be
1977 nested and
1978 .Fl enum
1979 lists will restart the sequence only for the sub-list.
1980 .It
1981 Some manuals use
1982 .Sx \&Li
1983 incorrectly by following it with a reserved character and expecting the
1984 delimiter to render.
1985 This is not supported in mandoc.
1986 .It
1987 In groff, the
1988 .Sx \&Fo
1989 macro only produces the first parameter.
1990 This is not the case in mandoc.
1991 .It
1992 In groff, the
1993 .Sx \&Cd ,
1994 .Sx \&Er ,
1995 .Sx \&Ex ,
1996 and
1997 .Sx \&Rv
1998 macros were stipulated only to occur in certain manual sections.
1999 mandoc does not have these restrictions.
2000 .It
2001 Newer groff and mandoc print
2002 .Qq AT&T UNIX
2003 prior to unknown arguments of
2004 .Sx \&At ;
2005 older groff did nothing.
2006 .El
2007 .Sh SEE ALSO
2008 .Xr mandoc 1 ,
2009 .Xr mandoc_char 7
2010 .Sh AUTHORS
2011 The
2012 .Nm
2013 reference was written by
2014 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
2015 .\"
2016 .\" XXX: this really isn't the place for these caveats.
2017 .\" .
2018 .\" .
2019 .\" .Sh CAVEATS
2020 .\" There are many ambiguous parts of mdoc.
2021 .\" .
2022 .\" .Pp
2023 .\" .Bl -dash -compact
2024 .\" .It
2025 .\" .Sq \&Fa
2026 .\" should be
2027 .\" .Sq \&Va
2028 .\" as function arguments are variables.
2029 .\" .It
2030 .\" .Sq \&Ft
2031 .\" should be
2032 .\" .Sq \&Vt
2033 .\" as function return types are still types. Furthermore, the
2034 .\" .Sq \&Ft
2035 .\" should be removed and
2036 .\" .Sq \&Fo ,
2037 .\" which ostensibly follows it, should follow the same convention as
2038 .\" .Sq \&Va .
2039 .\" .It
2040 .\" .Sq \&Va
2041 .\" should formalise that only one or two arguments are acceptable: a
2042 .\" variable name and optional, preceding type.
2043 .\" .It
2044 .\" .Sq \&Fd
2045 .\" is ambiguous. It's commonly used to indicate an include file in the
2046 .\" synopsis section.
2047 .\" .Sq \&In
2048 .\" should be used, instead.
2049 .\" .It
2050 .\" Only the
2051 .\" .Sq \-literal
2052 .\" argument to
2053 .\" .Sq \&Bd
2054 .\" makes sense. The remaining ones should be removed.
2055 .\" .It
2056 .\" The
2057 .\" .Sq \&Xo
2058 .\" and
2059 .\" .Sq \&Xc
2060 .\" macros should be deprecated.
2061 .\" .It
2062 .\" The
2063 .\" .Sq \&Dt
2064 .\" macro lacks clarity. It should be absolutely clear which title will
2065 .\" render when formatting the manual page.
2066 .\" .It
2067 .\" A
2068 .\" .Sq \&Lx
2069 .\" should be provided for Linux (\(`a la
2070 .\" .Sq \&Ox ,
2071 .\" .Sq \&Nx
2072 .\" etc.).
2073 .\" .It
2074 .\" There's no way to refer to references in
2075 .\" .Sq \&Rs/Re
2076 .\" blocks.
2077 .\" .It
2078 .\" The \-split and \-nosplit dictates via
2079 .\" .Sq \&An
2080 .\" are re-set when entering and leaving the AUTHORS section.
2081 .\" .El
2082 .\" .