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