]> git.cameronkatri.com Git - mandoc.git/blob - mdoc.7
Added serial comma.
[mandoc.git] / mdoc.7
1 .\" $Id: mdoc.7,v 1.147 2010/08/07 10:26:07 kristaps Exp $
2 .\"
3 .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
5 .\"
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .Dd $Mdocdate: August 7 2010 $
19 .Dt MDOC 7
20 .Os
21 .Sh NAME
22 .Nm mdoc
23 .Nd mdoc language reference
24 .Sh DESCRIPTION
25 The
26 .Nm mdoc
27 language is used to format
28 .Bx
29 .Ux
30 manuals.
31 This reference document describes its syntax, structure, and
32 usage.
33 The reference implementation is
34 .Xr mandoc 1 ;
35 the
36 .Sx COMPATIBILITY
37 section describes compatibility with other troff \-mdoc implementations.
38 .Pp
39 An
40 .Nm
41 document follows simple rules: lines beginning with the control
42 character
43 .Sq \.
44 are parsed for macros.
45 Other lines are interpreted within the scope of
46 prior macros:
47 .Bd -literal -offset indent
48 \&.Sh Macro lines change control state.
49 Other lines are interpreted within the current state.
50 .Ed
51 .Sh LANGUAGE SYNTAX
52 .Nm
53 documents may contain only graphable 7-bit ASCII characters, the space
54 character, and, in certain circumstances, the tab character.
55 All manuals must have
56 .Ux
57 line terminators.
58 .Ss Comments
59 Text following a
60 .Sq \e\*q ,
61 whether in a macro or free-form text line, is ignored to the end of
62 line.
63 A macro line with only a control character and comment escape,
64 .Sq \&.\e\*q ,
65 is also ignored.
66 Macro lines with only a control character and optional whitespace are
67 stripped from input.
68 .Ss Reserved Characters
69 Within a macro line, the following characters are reserved:
70 .Pp
71 .Bl -tag -width Ds -offset indent -compact
72 .It \&.
73 .Pq period
74 .It \&,
75 .Pq comma
76 .It \&:
77 .Pq colon
78 .It \&;
79 .Pq semicolon
80 .It \&(
81 .Pq left-parenthesis
82 .It \&)
83 .Pq right-parenthesis
84 .It \&[
85 .Pq left-bracket
86 .It \&]
87 .Pq right-bracket
88 .It \&?
89 .Pq question
90 .It \&!
91 .Pq exclamation
92 .It \&|
93 .Pq vertical bar
94 .El
95 .Pp
96 Use of reserved characters is described in
97 .Sx MACRO SYNTAX .
98 For general use in macro lines, these characters can either be escaped
99 with a non-breaking space
100 .Pq Sq \e&
101 or, if applicable, an appropriate escape sequence can be used.
102 .Ss Special Characters
103 Special characters may occur in both macro and free-form lines.
104 Sequences begin with the escape character
105 .Sq \e
106 followed by either an open-parenthesis
107 .Sq \&(
108 for two-character sequences; an open-bracket
109 .Sq \&[
110 for n-character sequences (terminated at a close-bracket
111 .Sq \&] ) ;
112 or a single one character sequence.
113 See
114 .Xr mandoc_char 7
115 for a complete list.
116 Examples include
117 .Sq \e(em
118 .Pq em-dash
119 and
120 .Sq \ee
121 .Pq back-slash .
122 .Ss Text Decoration
123 Terms may be text-decorated using the
124 .Sq \ef
125 escape followed by an indicator: B (bold), I (italic), R (Roman), or P
126 (revert to previous mode):
127 .Pp
128 .D1 \efBbold\efR \efIitalic\efP
129 .Pp
130 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
131 respectively) may be used instead.
132 A text decoration is valid within
133 the current font scope only: if a macro opens a font scope alongside
134 its own scope, such as
135 .Sx \&Bf
136 .Cm \&Sy ,
137 in-scope invocations of
138 .Sq \ef
139 are only valid within the font scope of the macro.
140 If
141 .Sq \ef
142 is specified outside of any font scope, such as in unenclosed, free-form
143 text, it will affect the remainder of the document.
144 .Pp
145 Note this form is
146 .Em not
147 recommended for
148 .Nm ,
149 which encourages semantic annotation.
150 .Ss Predefined Strings
151 Historically,
152 troff
153 also defined a set of package-specific
154 .Dq predefined strings ,
155 which, like
156 .Sx Special Characters ,
157 mark special output characters and strings by way of input codes.
158 Predefined strings are escaped with the slash-asterisk,
159 .Sq \e* :
160 single-character
161 .Sq \e*X ,
162 two-character
163 .Sq \e*(XX ,
164 and N-character
165 .Sq \e*[N] .
166 See
167 .Xr mandoc_char 7
168 for a complete list.
169 Examples include
170 .Sq \e*(Am
171 .Pq ampersand
172 and
173 .Sq \e*(Ba
174 .Pq vertical bar .
175 .Ss Whitespace
176 Whitespace consists of the space character.
177 In free-form lines, whitespace is preserved within a line; unescaped
178 trailing spaces are stripped from input (unless in a literal context).
179 Blank free-form lines, which may include whitespace, are only permitted
180 within literal contexts.
181 .Pp
182 In macro lines, whitespace delimits arguments and is discarded.
183 If arguments are quoted, whitespace within the quotes is retained.
184 .Ss Quotation
185 Macro arguments may be quoted with double-quotes to group
186 space-delimited terms or to retain blocks of whitespace.
187 A quoted argument begins with a double-quote preceded by whitespace.
188 The next double-quote not pairwise adjacent to another double-quote
189 terminates the literal, regardless of surrounding whitespace.
190 .Pp
191 Note that any quoted text, even if it would cause a macro invocation
192 when unquoted, is considered literal text.
193 Thus, the following produces
194 .Sq Op "Fl a" :
195 .Bd -literal -offset indent
196 \&.Op "Fl a"
197 .Ed
198 .Pp
199 In free-form mode, quotes are regarded as opaque text.
200 .Ss Dates
201 There are several macros in
202 .Nm
203 that require a date argument.
204 The canonical form for dates is the American format:
205 .Pp
206 .D1 Cm Month Day , Year
207 .Pp
208 The
209 .Cm Day
210 value is an optionally zero-padded numeral.
211 The
212 .Cm Month
213 value is the full month name.
214 The
215 .Cm Year
216 value is the full four-digit year.
217 .Pp
218 Reduced form dates are broken-down canonical form dates:
219 .Pp
220 .D1 Cm Month , Year
221 .D1 Cm Year
222 .Pp
223 Some examples of valid dates follow:
224 .Pp
225 .D1 "May, 2009" Pq reduced form
226 .D1 "2009" Pq reduced form
227 .D1 "May 20, 2009" Pq canonical form
228 .Ss Scaling Widths
229 Many macros support scaled widths for their arguments, such as
230 stipulating a two-inch list indentation with the following:
231 .Bd -literal -offset indent
232 \&.Bl -tag -width 2i
233 .Ed
234 .Pp
235 The syntax for scaled widths is
236 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
237 where a decimal must be preceded or proceeded by at least one digit.
238 Negative numbers, while accepted, are truncated to zero.
239 The following scaling units are accepted:
240 .Pp
241 .Bl -tag -width Ds -offset indent -compact
242 .It c
243 centimetre
244 .It i
245 inch
246 .It P
247 pica (~1/6 inch)
248 .It p
249 point (~1/72 inch)
250 .It f
251 synonym for
252 .Sq u
253 .It v
254 default vertical span
255 .It m
256 width of rendered
257 .Sq m
258 .Pq em
259 character
260 .It n
261 width of rendered
262 .Sq n
263 .Pq en
264 character
265 .It u
266 default horizontal span
267 .It M
268 mini-em (~1/100 em)
269 .El
270 .Pp
271 Using anything other than
272 .Sq m ,
273 .Sq n ,
274 .Sq u ,
275 or
276 .Sq v
277 is necessarily non-portable across output media.
278 See
279 .Sx COMPATIBILITY .
280 .Ss Sentence Spacing
281 When composing a manual, make sure that sentences end at the end of
282 a line.
283 By doing so, front-ends will be able to apply the proper amount of
284 spacing after the end of sentence (unescaped) period, exclamation mark,
285 or question mark followed by zero or more non-sentence closing
286 delimiters (
287 .Ns Sq \&) ,
288 .Sq \&] ,
289 .Sq \&' ,
290 .Sq \&" ) .
291 .Pp
292 The proper spacing is also intelligently preserved if a sentence ends at
293 the boundary of a macro line.
294 For example:
295 .Pp
296 .D1 \&Xr mandoc 1 \.
297 .D1 \&Fl T \&Ns \&Cm ascii \.
298 .Sh MANUAL STRUCTURE
299 A well-formed
300 .Nm
301 document consists of a document prologue followed by one or more
302 sections.
303 .Pp
304 The prologue, which consists of the
305 .Sx \&Dd ,
306 .Sx \&Dt ,
307 and
308 .Sx \&Os
309 macros in that order, is required for every document.
310 .Pp
311 The first section (sections are denoted by
312 .Sx \&Sh )
313 must be the NAME section, consisting of at least one
314 .Sx \&Nm
315 followed by
316 .Sx \&Nd .
317 .Pp
318 Following that, convention dictates specifying at least the
319 .Em SYNOPSIS
320 and
321 .Em DESCRIPTION
322 sections, although this varies between manual sections.
323 .Pp
324 The following is a well-formed skeleton
325 .Nm
326 file:
327 .Bd -literal -offset indent
328 \&.Dd $\&Mdocdate$
329 \&.Dt mdoc 7
330 \&.Os
331 \&.Sh NAME
332 \&.Nm foo
333 \&.Nd a description goes here
334 \&.\e\*q The next is for sections 2, 3, & 9 only.
335 \&.\e\*q .Sh LIBRARY
336 \&.Sh SYNOPSIS
337 \&.Nm foo
338 \&.Op Fl options
339 \&.Ar
340 \&.Sh DESCRIPTION
341 The
342 \&.Nm
343 utility processes files ...
344 \&.\e\*q .Sh IMPLEMENTATION NOTES
345 \&.\e\*q The next is for sections 2, 3, & 9 only.
346 \&.\e\*q .Sh RETURN VALUES
347 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
348 \&.\e\*q .Sh ENVIRONMENT
349 \&.\e\*q .Sh FILES
350 \&.\e\*q The next is for sections 1 & 8 only.
351 \&.\e\*q .Sh EXIT STATUS
352 \&.\e\*q .Sh EXAMPLES
353 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
354 \&.\e\*q .Sh DIAGNOSTICS
355 \&.\e\*q The next is for sections 2, 3, & 9 only.
356 \&.\e\*q .Sh ERRORS
357 \&.\e\*q .Sh SEE ALSO
358 \&.\e\*q .Xr foobar 1
359 \&.\e\*q .Sh STANDARDS
360 \&.\e\*q .Sh HISTORY
361 \&.\e\*q .Sh AUTHORS
362 \&.\e\*q .Sh CAVEATS
363 \&.\e\*q .Sh BUGS
364 \&.\e\*q .Sh SECURITY CONSIDERATIONS
365 .Ed
366 .Pp
367 The sections in an
368 .Nm
369 document are conventionally ordered as they appear above.
370 Sections should be composed as follows:
371 .Bl -ohang -offset Ds
372 .It Em NAME
373 The name(s) and a one line description of the documented material.
374 The syntax for this as follows:
375 .Bd -literal -offset indent
376 \&.Nm name0 ,
377 \&.Nm name1 ,
378 \&.Nm name2
379 \&.Nd a one line description
380 .Ed
381 .Pp
382 The
383 .Sx \&Nm
384 macro(s) must precede the
385 .Sx \&Nd
386 macro.
387 .Pp
388 See
389 .Sx \&Nm
390 and
391 .Sx \&Nd .
392 .It Em LIBRARY
393 The name of the library containing the documented material, which is
394 assumed to be a function in a section 2, 3, or 9 manual.
395 The syntax for this is as follows:
396 .Bd -literal -offset indent
397 \&.Lb libarm
398 .Ed
399 .Pp
400 See
401 .Sx \&Lb .
402 .It Em SYNOPSIS
403 Documents the utility invocation syntax, function call syntax, or device
404 configuration.
405 .Pp
406 For the first, utilities (sections 1, 6, and 8), this is
407 generally structured as follows:
408 .Bd -literal -offset indent
409 \&.Nm foo
410 \&.Op Fl v
411 \&.Op Fl o Ar file
412 \&.Op Ar
413 \&.Nm bar
414 \&.Op Fl v
415 \&.Op Fl o Ar file
416 \&.Op Ar
417 .Ed
418 .Pp
419 For the second, function calls (sections 2, 3, 9):
420 .Bd -literal -offset indent
421 \&.In header.h
422 \&.Vt extern const char *global;
423 \&.Ft "char *"
424 \&.Fn foo "const char *src"
425 \&.Ft "char *"
426 \&.Fn bar "const char *src"
427 .Ed
428 .Pp
429 And for the third, configurations (section 4):
430 .Bd -literal -offset indent
431 \&.Cd \*qit* at isa? port 0x2e\*q
432 \&.Cd \*qit* at isa? port 0x4e\*q
433 .Ed
434 .Pp
435 Manuals not in these sections generally don't need a
436 .Em SYNOPSIS .
437 .Pp
438 Some macros are displayed differently in the
439 .Em SYNOPSIS
440 section, particularly
441 .Sx \&Nm ,
442 .Sx \&Cd ,
443 .Sx \&Fd ,
444 .Sx \&Fn ,
445 .Sx \&Fo ,
446 .Sx \&In ,
447 .Sx \&Vt ,
448 and
449 .Sx \&Ft .
450 All of these macros are output on their own line.
451 If two such dissimilar macros are pairwise invoked (except for
452 .Sx \&Ft
453 before
454 .Sx \&Fo
455 or
456 .Sx \&Fn ) ,
457 they are separated by a vertical space, unless in the case of
458 .Sx \&Fo ,
459 .Sx \&Fn ,
460 and
461 .Sx \&Ft ,
462 which are always separated by vertical space.
463 .Pp
464 When text and macros following an
465 .Sx \&Nm
466 macro starting an input line span multiple output lines,
467 all output lines but the first will be indented to align
468 with the text immediately following the
469 .Sx \&Nm
470 macro, up to the next
471 .Sx \&Nm ,
472 .Sx \&Sh ,
473 or
474 .Sx \&Ss
475 macro or the end of an enclosing block, whichever comes first.
476 .It Em DESCRIPTION
477 This expands upon the brief, one line description in
478 .Em NAME .
479 It usually contains a breakdown of the options (if documenting a
480 command), such as:
481 .Bd -literal -offset indent
482 The arguments are as follows:
483 \&.Bl \-tag \-width Ds
484 \&.It Fl v
485 Print verbose information.
486 \&.El
487 .Ed
488 .Pp
489 Manuals not documenting a command won't include the above fragment.
490 .It Em IMPLEMENTATION NOTES
491 Implementation-specific notes should be kept here.
492 This is useful when implementing standard functions that may have side
493 effects or notable algorithmic implications.
494 .It Em RETURN VALUES
495 This section documents the
496 return values of functions in sections 2, 3, and 9.
497 .Pp
498 See
499 .Sx \&Rv .
500 .It Em ENVIRONMENT
501 Lists the environment variables used by the utility,
502 and explains the syntax and semantics of their values.
503 The
504 .Xr environ 7
505 manual provides examples of typical content and formatting.
506 .Pp
507 See
508 .Sx \&Ev .
509 .It Em FILES
510 Documents files used.
511 It's helpful to document both the file name and a short description of how
512 the file is used (created, modified, etc.).
513 .Pp
514 See
515 .Sx \&Pa .
516 .It Em EXIT STATUS
517 This section documents the
518 command exit status for section 1, 6, and 8 utilities.
519 Historically, this information was described in
520 .Em DIAGNOSTICS ,
521 a practise that is now discouraged.
522 .Pp
523 See
524 .Sx \&Ex .
525 .It Em EXAMPLES
526 Example usages.
527 This often contains snippets of well-formed, well-tested invocations.
528 Make sure that examples work properly!
529 .It Em DIAGNOSTICS
530 Documents error conditions.
531 This is most useful in section 4 manuals.
532 Historically, this section was used in place of
533 .Em EXIT STATUS
534 for manuals in sections 1, 6, and 8; however, this practise is
535 discouraged.
536 .Pp
537 See
538 .Sx \&Bl
539 .Fl diag .
540 .It Em ERRORS
541 Documents error handling in sections 2, 3, and 9.
542 .Pp
543 See
544 .Sx \&Er .
545 .It Em SEE ALSO
546 References other manuals with related topics.
547 This section should exist for most manuals.
548 Cross-references should conventionally be ordered first by section, then
549 alphabetically.
550 .Pp
551 See
552 .Sx \&Xr .
553 .It Em STANDARDS
554 References any standards implemented or used.
555 If not adhering to any standards, the
556 .Em HISTORY
557 section should be used instead.
558 .Pp
559 See
560 .Sx \&St .
561 .It Em HISTORY
562 A brief history of the subject, including where support first appeared.
563 .It Em AUTHORS
564 Credits to the person or persons who wrote the code and/or documentation.
565 Authors should generally be noted by both name and email address.
566 .Pp
567 See
568 .Sx \&An .
569 .It Em CAVEATS
570 Common misuses and misunderstandings should be explained
571 in this section.
572 .It Em BUGS
573 Known bugs, limitations, and work-arounds should be described
574 in this section.
575 .It Em SECURITY CONSIDERATIONS
576 Documents any security precautions that operators should consider.
577 .El
578 .Sh MACRO SYNTAX
579 Macros are one to three three characters in length and begin with a
580 control character,
581 .Sq \&. ,
582 at the beginning of the line.
583 An arbitrary amount of whitespace may sit between the control character
584 and the macro name.
585 Thus, the following are equivalent:
586 .Bd -literal -offset indent
587 \&.Pp
588 \&.\ \ \ \&Pp
589 .Ed
590 .Pp
591 The syntax of a macro depends on its classification.
592 In this section,
593 .Sq \-arg
594 refers to macro arguments, which may be followed by zero or more
595 .Sq parm
596 parameters;
597 .Sq \&Yo
598 opens the scope of a macro; and if specified,
599 .Sq \&Yc
600 closes it out.
601 .Pp
602 The
603 .Em Callable
604 column indicates that the macro may be called subsequent to the initial
605 line-macro.
606 If a macro is not callable, then its invocation after the initial line
607 macro is interpreted as opaque text, such that
608 .Sq \&.Fl \&Sh
609 produces
610 .Sq Fl \&Sh .
611 .Pp
612 The
613 .Em Parsed
614 column indicates whether the macro may be followed by further
615 (ostensibly callable) macros.
616 If a macro is not parsed, subsequent macro invocations on the line
617 will be interpreted as opaque text.
618 .Pp
619 The
620 .Em Scope
621 column, if applicable, describes closure rules.
622 .Ss Block full-explicit
623 Multi-line scope closed by an explicit closing macro.
624 All macros contains bodies; only
625 .Sx \&Bf
626 contains a head.
627 .Bd -literal -offset indent
628 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
629 \(lBbody...\(rB
630 \&.Yc
631 .Ed
632 .Pp
633 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXX"
634 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
635 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
636 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
637 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
638 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
639 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
640 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
641 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
642 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
643 .El
644 .Ss Block full-implicit
645 Multi-line scope closed by end-of-file or implicitly by another macro.
646 All macros have bodies; some
647 .Po
648 .Sx \&It Fl bullet ,
649 .Fl hyphen ,
650 .Fl dash ,
651 .Fl enum ,
652 .Fl item
653 .Pc
654 don't have heads; only one
655 .Po
656 .Sx \&It
657 in
658 .Sx \&Bl Fl column
659 .Pc
660 has multiple heads.
661 .Bd -literal -offset indent
662 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
663 \(lBbody...\(rB
664 .Ed
665 .Pp
666 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX"
667 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
668 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
669 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
670 .It Sx \&Nm Ta \&No Ta Yes Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
671 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
672 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
673 .El
674 .Pp
675 Note that the
676 .Sx \&Nm
677 macro is a
678 .Sx Block full-implicit
679 macro only when invoked as the first macro
680 in a
681 .Em SYNOPSIS
682 section line, else it is
683 .Sx In-line .
684 .Ss Block partial-explicit
685 Like block full-explicit, but also with single-line scope.
686 Each has at least a body and, in limited circumstances, a head
687 .Po
688 .Sx \&Fo ,
689 .Sx \&Eo
690 .Pc
691 and/or tail
692 .Pq Sx \&Ec .
693 .Bd -literal -offset indent
694 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
695 \(lBbody...\(rB
696 \&.Yc \(lBtail...\(rB
697
698 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
699 \(lBbody...\(rB \&Yc \(lBtail...\(rB
700 .Ed
701 .Pp
702 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -compact -offset indent
703 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
704 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
705 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
706 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
707 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
708 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
709 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
710 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
711 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
712 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
713 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
714 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
715 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
716 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
717 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
718 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
719 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
720 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
721 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
722 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
723 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
724 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
725 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
726 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
727 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
728 .El
729 .Ss Block partial-implicit
730 Like block full-implicit, but with single-line scope closed by
731 .Sx Reserved Characters
732 or end of line.
733 .Bd -literal -offset indent
734 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
735 .Ed
736 .Pp
737 .Bl -column "MacroX" "CallableX" "ParsedX" -compact -offset indent
738 .It Em Macro Ta Em Callable Ta Em Parsed
739 .It Sx \&Aq Ta Yes Ta Yes
740 .It Sx \&Bq Ta Yes Ta Yes
741 .It Sx \&Brq Ta Yes Ta Yes
742 .It Sx \&D1 Ta \&No Ta \&Yes
743 .It Sx \&Dl Ta \&No Ta Yes
744 .It Sx \&Dq Ta Yes Ta Yes
745 .It Sx \&Op Ta Yes Ta Yes
746 .It Sx \&Pq Ta Yes Ta Yes
747 .It Sx \&Ql Ta Yes Ta Yes
748 .It Sx \&Qq Ta Yes Ta Yes
749 .It Sx \&Sq Ta Yes Ta Yes
750 .It Sx \&Vt Ta Yes Ta Yes
751 .El
752 .Pp
753 Note that the
754 .Sx \&Vt
755 macro is a
756 .Sx Block partial-implicit
757 only when invoked as the first macro
758 in a
759 .Em SYNOPSIS
760 section line, else it is
761 .Sx In-line .
762 .Ss In-line
763 Closed by
764 .Sx Reserved Characters ,
765 end of line, fixed argument lengths, and/or subsequent macros.
766 In-line macros have only text children.
767 If a number (or inequality) of arguments is
768 .Pq n ,
769 then the macro accepts an arbitrary number of arguments.
770 .Bd -literal -offset indent
771 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB
772
773 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
774
775 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
776 .Ed
777 .Pp
778 .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -compact -offset indent
779 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
780 .It Sx \&%A Ta \&No Ta \&No Ta >0
781 .It Sx \&%B Ta \&No Ta \&No Ta >0
782 .It Sx \&%C Ta \&No Ta \&No Ta >0
783 .It Sx \&%D Ta \&No Ta \&No Ta >0
784 .It Sx \&%I Ta \&No Ta \&No Ta >0
785 .It Sx \&%J Ta \&No Ta \&No Ta >0
786 .It Sx \&%N Ta \&No Ta \&No Ta >0
787 .It Sx \&%O Ta \&No Ta \&No Ta >0
788 .It Sx \&%P Ta \&No Ta \&No Ta >0
789 .It Sx \&%Q Ta \&No Ta \&No Ta >0
790 .It Sx \&%R Ta \&No Ta \&No Ta >0
791 .It Sx \&%T Ta \&No Ta \&No Ta >0
792 .It Sx \&%U Ta \&No Ta \&No Ta >0
793 .It Sx \&%V Ta \&No Ta \&No Ta >0
794 .It Sx \&Ad Ta Yes Ta Yes Ta n
795 .It Sx \&An Ta Yes Ta Yes Ta n
796 .It Sx \&Ap Ta Yes Ta Yes Ta 0
797 .It Sx \&Ar Ta Yes Ta Yes Ta n
798 .It Sx \&At Ta Yes Ta Yes Ta 1
799 .It Sx \&Bsx Ta Yes Ta Yes Ta n
800 .It Sx \&Bt Ta \&No Ta \&No Ta 0
801 .It Sx \&Bx Ta Yes Ta Yes Ta n
802 .It Sx \&Cd Ta Yes Ta Yes Ta >0
803 .It Sx \&Cm Ta Yes Ta Yes Ta n
804 .It Sx \&Db Ta \&No Ta \&No Ta 1
805 .It Sx \&Dd Ta \&No Ta \&No Ta n
806 .It Sx \&Dt Ta \&No Ta \&No Ta n
807 .It Sx \&Dv Ta Yes Ta Yes Ta n
808 .It Sx \&Dx Ta Yes Ta Yes Ta n
809 .It Sx \&Em Ta Yes Ta Yes Ta >0
810 .It Sx \&En Ta \&No Ta \&No Ta 0
811 .It Sx \&Er Ta Yes Ta Yes Ta >0
812 .It Sx \&Es Ta \&No Ta \&No Ta 0
813 .It Sx \&Ev Ta Yes Ta Yes Ta n
814 .It Sx \&Ex Ta \&No Ta \&No Ta n
815 .It Sx \&Fa Ta Yes Ta Yes Ta n
816 .It Sx \&Fd Ta \&No Ta \&No Ta >0
817 .It Sx \&Fl Ta Yes Ta Yes Ta n
818 .It Sx \&Fn Ta Yes Ta Yes Ta >0
819 .It Sx \&Fr Ta \&No Ta \&No Ta n
820 .It Sx \&Ft Ta Yes Ta Yes Ta n
821 .It Sx \&Fx Ta Yes Ta Yes Ta n
822 .It Sx \&Hf Ta \&No Ta \&No Ta n
823 .It Sx \&Ic Ta Yes Ta Yes Ta >0
824 .It Sx \&In Ta \&No Ta \&No Ta n
825 .It Sx \&Lb Ta \&No Ta \&No Ta 1
826 .It Sx \&Li Ta Yes Ta Yes Ta n
827 .It Sx \&Lk Ta Yes Ta Yes Ta n
828 .It Sx \&Lp Ta \&No Ta \&No Ta 0
829 .It Sx \&Ms Ta Yes Ta Yes Ta >0
830 .It Sx \&Mt Ta Yes Ta Yes Ta >0
831 .It Sx \&Nm Ta Yes Ta Yes Ta n
832 .It Sx \&No Ta Yes Ta Yes Ta 0
833 .It Sx \&Ns Ta Yes Ta Yes Ta 0
834 .It Sx \&Nx Ta Yes Ta Yes Ta n
835 .It Sx \&Os Ta \&No Ta \&No Ta n
836 .It Sx \&Ot Ta \&No Ta \&No Ta n
837 .It Sx \&Ox Ta Yes Ta Yes Ta n
838 .It Sx \&Pa Ta Yes Ta Yes Ta n
839 .It Sx \&Pf Ta Yes Ta Yes Ta 1
840 .It Sx \&Pp Ta \&No Ta \&No Ta 0
841 .It Sx \&Rv Ta \&No Ta \&No Ta n
842 .It Sx \&Sm Ta \&No Ta \&No Ta 1
843 .It Sx \&St Ta \&No Ta Yes Ta 1
844 .It Sx \&Sx Ta Yes Ta Yes Ta >0
845 .It Sx \&Sy Ta Yes Ta Yes Ta >0
846 .It Sx \&Tn Ta Yes Ta Yes Ta >0
847 .It Sx \&Ud Ta \&No Ta \&No Ta 0
848 .It Sx \&Ux Ta Yes Ta Yes Ta n
849 .It Sx \&Va Ta Yes Ta Yes Ta n
850 .It Sx \&Vt Ta Yes Ta Yes Ta >0
851 .It Sx \&Xr Ta Yes Ta Yes Ta >0
852 .It Sx \&br Ta \&No Ta \&No Ta 0
853 .It Sx \&sp Ta \&No Ta \&No Ta 1
854 .El
855 .Sh REFERENCE
856 This section is a canonical reference of all macros, arranged
857 alphabetically.
858 For the scoping of individual macros, see
859 .Sx MACRO SYNTAX .
860 .Ss \&%A
861 Author name of an
862 .Sx \&Rs
863 block.
864 Multiple authors should each be accorded their own
865 .Sx \%%A
866 line.
867 Author names should be ordered with full or abbreviated forename(s)
868 first, then full surname.
869 .Ss \&%B
870 Book title of an
871 .Sx \&Rs
872 block.
873 This macro may also be used in a non-bibliographic context when
874 referring to book titles.
875 .Ss \&%C
876 Publication city or location of an
877 .Sx \&Rs
878 block.
879 .Ss \&%D
880 Publication date of an
881 .Sx \&Rs
882 block.
883 This should follow the reduced or canonical form syntax described in
884 .Sx Dates .
885 .Ss \&%I
886 Publisher or issuer name of an
887 .Sx \&Rs
888 block.
889 .Ss \&%J
890 Journal name of an
891 .Sx \&Rs
892 block.
893 .Ss \&%N
894 Issue number (usually for journals) of an
895 .Sx \&Rs
896 block.
897 .Ss \&%O
898 Optional information of an
899 .Sx \&Rs
900 block.
901 .Ss \&%P
902 Book or journal page number of an
903 .Sx \&Rs
904 block.
905 .Ss \&%Q
906 Institutional author (school, government, etc.) of an
907 .Sx \&Rs
908 block.
909 Multiple institutional authors should each be accorded their own
910 .Sx \&%Q
911 line.
912 .Ss \&%R
913 Technical report name of an
914 .Sx \&Rs
915 block.
916 .Ss \&%T
917 Article title of an
918 .Sx \&Rs
919 block.
920 This macro may also be used in a non-bibliographical context when
921 referring to article titles.
922 .Ss \&%U
923 URI of reference document.
924 .Ss \&%V
925 Volume number of an
926 .Sx \&Rs
927 block.
928 .Ss \&Ac
929 Close an
930 .Sx \&Ao
931 block.
932 Does not have any tail arguments.
933 .Ss \&Ad
934 Memory address.
935 Do not use this for postal addresses.
936 .Pp
937 Examples:
938 .D1 \&.Ad [0,$]
939 .D1 \&.Ad 0x00000000
940 .Ss \&An
941 Author name.
942 Requires either the name of an author or one of the following arguments:
943 .Pp
944 .Bl -tag -width "-nosplitX" -offset indent -compact
945 .It Fl split
946 Start a new output line before each subsequent invocation of
947 .Sx \&An .
948 .It Fl nosplit
949 The opposite of
950 .Fl split .
951 .El
952 .Pp
953 The default is
954 .Fl nosplit .
955 The effect of selecting either of the
956 .Fl split
957 modes ends at the beginning of the
958 .Em AUTHORS
959 section.
960 In the
961 .Em AUTHORS
962 section, the default is
963 .Fl nosplit
964 for the first author listing and
965 .Fl split
966 for all other author listings.
967 .Pp
968 Examples:
969 .D1 \&.An -nosplit
970 .D1 \&.An Kristaps Dzonsons \&Aq kristaps@bsd.lv
971 .Ss \&Ao
972 Begin a block enclosed by angle brackets.
973 Does not have any head arguments.
974 .Pp
975 Examples:
976 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
977 .Pp
978 See also
979 .Sx \&Aq .
980 .Ss \&Ap
981 Inserts an apostrophe without any surrounding whitespace.
982 This is generally used as a grammatical device when referring to the verb
983 form of a function.
984 .Pp
985 Examples:
986 .D1 \&.Fn execve \&Ap d
987 .Ss \&Aq
988 Encloses its arguments in angle brackets.
989 .Pp
990 Examples:
991 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
992 .Pp
993 .Em Remarks :
994 this macro is often abused for rendering URIs, which should instead use
995 .Sx \&Lk
996 or
997 .Sx \&Mt ,
998 or to note pre-processor
999 .Dq Li #include
1000 statements, which should use
1001 .Sx \&In .
1002 .Pp
1003 See also
1004 .Sx \&Ao .
1005 .Ss \&Ar
1006 Command arguments.
1007 If an argument is not provided, the string
1008 .Dq file ...\&
1009 is used as a default.
1010 .Pp
1011 Examples:
1012 .D1 \&.Fl o \&Ns \&Ar file1
1013 .D1 \&.Ar
1014 .D1 \&.Ar arg1 , arg2 .
1015 .Ss \&At
1016 Formats an AT&T version.
1017 Accepts one optional argument:
1018 .Pp
1019 .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact
1020 .It Cm v[1-7] | 32v
1021 A version of
1022 .At .
1023 .It Cm V[.[1-4]]?
1024 A version of
1025 .At V .
1026 .El
1027 .Pp
1028 Note that these arguments do not begin with a hyphen.
1029 .Pp
1030 Examples:
1031 .D1 \&.At
1032 .D1 \&.At V.1
1033 .Pp
1034 See also
1035 .Sx \&Bsx ,
1036 .Sx \&Bx ,
1037 .Sx \&Dx ,
1038 .Sx \&Fx ,
1039 .Sx \&Nx ,
1040 .Sx \&Ox ,
1041 and
1042 .Sx \&Ux .
1043 .Ss \&Bc
1044 Close a
1045 .Sx \&Bo
1046 block.
1047 Does not have any tail arguments.
1048 .Ss \&Bd
1049 Begin a display block.
1050 Its syntax is as follows:
1051 .Bd -ragged -offset indent
1052 .Pf \. Sx \&Bd
1053 .Fl Ns Ar type
1054 .Op Fl offset Ar width
1055 .Op Fl compact
1056 .Ed
1057 .Pp
1058 Display blocks are used to select a different indentation and
1059 justification than the one used by the surrounding text.
1060 They may contain both macro lines and free-form text lines.
1061 By default, a display block is preceded by a vertical space.
1062 .Pp
1063 The
1064 .Ar type
1065 must be one of the following:
1066 .Bl -tag -width 13n -offset indent
1067 .It Fl centered
1068 Centre-justify each line.
1069 Using this display type is not recommended; many
1070 .Nm
1071 implementations render it poorly.
1072 .It Fl filled
1073 Left- and right-justify the block.
1074 .It Fl literal
1075 Do not justify the block at all.
1076 Preserve white space as it appears in the input.
1077 .It Fl ragged
1078 Only left-justify the block.
1079 .It Fl unfilled
1080 An alias for
1081 .Fl literal .
1082 .El
1083 .Pp
1084 The
1085 .Ar type
1086 must be provided first.
1087 Additional arguments may follow:
1088 .Bl -tag -width 13n -offset indent
1089 .It Fl offset Ar width
1090 Indent the display by the
1091 .Ar width ,
1092 which may be one of the following:
1093 .Bl -item
1094 .It
1095 One of the pre-defined strings
1096 .Cm indent ,
1097 the width of standard indentation;
1098 .Cm indent-two ,
1099 twice
1100 .Cm indent ;
1101 .Cm left ,
1102 which has no effect;
1103 .Cm right ,
1104 which justifies to the right margin; or
1105 .Cm center ,
1106 which aligns around an imagined centre axis.
1107 .It
1108 A macro invocation, which selects a predefined width
1109 associated with that macro.
1110 The most popular is the imaginary macro
1111 .Ar \&Ds ,
1112 which resolves to
1113 .Sy 6n .
1114 .It
1115 A width using the syntax described in
1116 .Sx Scaling Widths .
1117 .It
1118 An arbitrary string, which indents by the length of this string.
1119 .El
1120 .Pp
1121 When the argument is missing,
1122 .Fl offset
1123 is ignored.
1124 .It Fl compact
1125 Do not assert vertical space before the display.
1126 .El
1127 .Pp
1128 Examples:
1129 .Bd -literal -offset indent
1130 \&.Bd \-literal \-offset indent \-compact
1131 Hello world.
1132 \&.Ed
1133 .Ed
1134 .Pp
1135 See also
1136 .Sx \&D1
1137 and
1138 .Sx \&Dl .
1139 .Ss \&Bf
1140 Change the font mode for a scoped block of text.
1141 Its syntax is as follows:
1142 .Bd -ragged -offset indent
1143 .Pf \. Sx \&Bf
1144 .Oo
1145 .Fl emphasis | literal | symbolic |
1146 .Cm \&Em | \&Li | \&Sy
1147 .Oc
1148 .Ed
1149 .Pp
1150 The
1151 .Fl emphasis
1152 and
1153 .Cm \&Em
1154 argument are equivalent, as are
1155 .Fl symbolic
1156 and
1157 .Cm \&Sy ,
1158 and
1159 .Fl literal
1160 and
1161 .Cm \&Li .
1162 Without an argument, this macro does nothing.
1163 The font mode continues until broken by a new font mode in a nested
1164 scope or
1165 .Sx \&Ef
1166 is encountered.
1167 .Pp
1168 See also
1169 .Sx \&Li ,
1170 .Sx \&Ef ,
1171 .Sx \&Em ,
1172 and
1173 .Sx \&Sy .
1174 .Ss \&Bk
1175 Keep the output generated from each macro input line together
1176 on one single output line.
1177 Line breaks in free-form text lines are unaffected.
1178 The syntax is as follows:
1179 .Pp
1180 .D1 Pf \. Sx \&Bk Fl words
1181 .Pp
1182 The
1183 .Fl words
1184 argument is required; additional arguments are ignored.
1185 .Pp
1186 The following example will not break within each
1187 .Sx \&Op
1188 macro line:
1189 .Bd -literal -offset indent
1190 \&.Bk \-words
1191 \&.Op Fl f Ar flags
1192 \&.Op Fl o Ar output
1193 \&.Ek
1194 .Ed
1195 .Pp
1196 Be careful in using over-long lines within a keep block!
1197 Doing so will clobber the right margin.
1198 .Ss \&Bl
1199 Begin a list.
1200 Lists consist of items started by the
1201 .Sx \&It
1202 macro, containing a head or a body or both.
1203 The list syntax is as follows:
1204 .Bd -ragged -offset indent
1205 .Pf \. Sx \&Bl
1206 .Fl Ns Ar type
1207 .Op Fl width Ar val
1208 .Op Fl offset Ar val
1209 .Op Fl compact
1210 .Op HEAD ...
1211 .Ed
1212 .Pp
1213 The list
1214 .Ar type
1215 is mandatory and must be specified first.
1216 The
1217 .Fl width
1218 and
1219 .Fl offset
1220 arguments accept
1221 .Sx Scaling Widths
1222 or use the length of the given string.
1223 The
1224 .Fl offset
1225 is a global indentation for the whole list, affecting both item heads
1226 and bodies.
1227 For those list types supporting it, the
1228 .Fl width
1229 argument requests an additional indentation of item bodies,
1230 to be added to the
1231 .Fl offset .
1232 Unless the
1233 .Fl compact
1234 argument is specified, list entries are separated by vertical space.
1235 .Pp
1236 A list must specify one of the following list types:
1237 .Bl -tag -width 12n -offset indent
1238 .It Fl bullet
1239 No item heads can be specified, but a bullet will be printed at the head
1240 of each item.
1241 Item bodies start on the same output line as the bullet
1242 and are indented according to the
1243 .Fl width
1244 argument.
1245 .It Fl column
1246 A columnated list.
1247 The
1248 .Fl width
1249 argument has no effect; instead, each argument specifies the width
1250 of one column, using either the
1251 .Sx Scaling Widths
1252 syntax or the string length of the argument.
1253 If the first line of the body of a
1254 .Fl column
1255 list is not an
1256 .Sx \&It
1257 macro line,
1258 .Sx \&It
1259 contexts spanning one input line each are implied until an
1260 .Sx \&It
1261 macro line is encountered, at which point items start being interpreted as
1262 described in the
1263 .Sx \&It
1264 documentation.
1265 .It Fl dash
1266 Like
1267 .Fl bullet ,
1268 except that dashes are used in place of bullets.
1269 .It Fl diag
1270 Like
1271 .Fl inset ,
1272 except that item heads are not parsed for macro invocations.
1273 .\" but with additional formatting to the head.
1274 .It Fl enum
1275 A numbered list.
1276 Formatted like
1277 .Fl bullet ,
1278 except that cardinal numbers are used in place of bullets,
1279 starting at 1.
1280 .It Fl hang
1281 Like
1282 .Fl tag ,
1283 except that the first lines of item bodies are not indented, but follow
1284 the item heads like in
1285 .Fl inset
1286 lists.
1287 .It Fl hyphen
1288 Synonym for
1289 .Fl dash .
1290 .It Fl inset
1291 Item bodies follow items heads on the same line, using normal inter-word
1292 spacing.
1293 Bodies are not indented, and the
1294 .Fl width
1295 argument is ignored.
1296 .It Fl item
1297 No item heads can be specified, and none are printed.
1298 Bodies are not indented, and the
1299 .Fl width
1300 argument is ignored.
1301 .It Fl ohang
1302 Item bodies start on the line following item heads and are not indented.
1303 The
1304 .Fl width
1305 argument is ignored.
1306 .It Fl tag
1307 Item bodies are indented according to the
1308 .Fl width
1309 argument.
1310 When an item head fits inside the indentation, the item body follows
1311 this head on the same output line.
1312 Otherwise, the body starts on the output line following the head.
1313 .El
1314 .Pp
1315 See also
1316 .Sx \&El
1317 and
1318 .Sx \&It .
1319 .Ss \&Bo
1320 Begin a block enclosed by square brackets.
1321 Does not have any head arguments.
1322 .Pp
1323 Examples:
1324 .Bd -literal -offset indent -compact
1325 \&.Bo 1 ,
1326 \&.Dv BUFSIZ \&Bc
1327 .Ed
1328 .Pp
1329 See also
1330 .Sx \&Bq .
1331 .Ss \&Bq
1332 Encloses its arguments in square brackets.
1333 .Pp
1334 Examples:
1335 .D1 \&.Bq 1 , \&Dv BUFSIZ
1336 .Pp
1337 .Em Remarks :
1338 this macro is sometimes abused to emulate optional arguments for
1339 commands; the correct macros to use for this purpose are
1340 .Sx \&Op ,
1341 .Sx \&Oo ,
1342 and
1343 .Sx \&Oc .
1344 .Pp
1345 See also
1346 .Sx \&Bo .
1347 .Ss \&Brc
1348 Close a
1349 .Sx \&Bro
1350 block.
1351 Does not have any tail arguments.
1352 .Ss \&Bro
1353 Begin a block enclosed by curly braces.
1354 Does not have any head arguments.
1355 .Pp
1356 Examples:
1357 .Bd -literal -offset indent -compact
1358 \&.Bro 1 , ... ,
1359 \&.Va n \&Brc
1360 .Ed
1361 .Pp
1362 See also
1363 .Sx \&Brq .
1364 .Ss \&Brq
1365 Encloses its arguments in curly braces.
1366 .Pp
1367 Examples:
1368 .D1 \&.Brq 1 , ... , \&Va n
1369 .Pp
1370 See also
1371 .Sx \&Bro .
1372 .Ss \&Bsx
1373 Format the BSD/OS version provided as an argument, or a default value if
1374 no argument is provided.
1375 .Pp
1376 Examples:
1377 .D1 \&.Bsx 1.0
1378 .D1 \&.Bsx
1379 .Pp
1380 See also
1381 .Sx \&At ,
1382 .Sx \&Bx ,
1383 .Sx \&Dx ,
1384 .Sx \&Fx ,
1385 .Sx \&Nx ,
1386 .Sx \&Ox ,
1387 and
1388 .Sx \&Ux .
1389 .Ss \&Bt
1390 Prints
1391 .Dq is currently in beta test .
1392 .Ss \&Bx
1393 Format the BSD version provided as an argument, or a default value if no
1394 argument is provided.
1395 .Pp
1396 Examples:
1397 .D1 \&.Bx 4.4
1398 .D1 \&.Bx
1399 .Pp
1400 See also
1401 .Sx \&At ,
1402 .Sx \&Bsx ,
1403 .Sx \&Dx ,
1404 .Sx \&Fx ,
1405 .Sx \&Nx ,
1406 .Sx \&Ox ,
1407 and
1408 .Sx \&Ux .
1409 .Ss \&Cd
1410 Kernel configuration declaration.
1411 This denotes strings accepted by
1412 .Xr config 8 .
1413 .Pp
1414 Examples:
1415 .D1 \&.Cd device le0 at scode?
1416 .Pp
1417 .Em Remarks :
1418 this macro is commonly abused by using quoted literals to retain
1419 whitespace and align consecutive
1420 .Sx \&Cd
1421 declarations.
1422 This practise is discouraged.
1423 .Ss \&Cm
1424 Command modifiers.
1425 Useful when specifying configuration options or keys.
1426 .Pp
1427 Examples:
1428 .D1 \&.Cm ControlPath
1429 .D1 \&.Cm ControlMaster
1430 .Pp
1431 See also
1432 .Sx \&Fl .
1433 .Ss \&D1
1434 One-line indented display.
1435 This is formatted by the default rules and is useful for simple indented
1436 statements.
1437 It is followed by a newline.
1438 .Pp
1439 Examples:
1440 .D1 \&.D1 \&Fl abcdefgh
1441 .Pp
1442 See also
1443 .Sx \&Bd
1444 and
1445 .Sx \&Dl .
1446 .Ss \&Db
1447 Switch debugging mode.
1448 Its syntax is as follows:
1449 .Pp
1450 .D1 Pf \. Sx \&Db Cm on | off
1451 .Pp
1452 This macro is ignored by
1453 .Xr mandoc 1 .
1454 .Ss \&Dc
1455 Close a
1456 .Sx \&Do
1457 block.
1458 Does not have any tail arguments.
1459 .Ss \&Dd
1460 Document date.
1461 This is the mandatory first macro of any
1462 .Nm
1463 manual.
1464 Its syntax is as follows:
1465 .Pp
1466 .D1 Pf \. Sx \&Dd Op Ar date
1467 .Pp
1468 The
1469 .Ar date
1470 may be either
1471 .Ar $\&Mdocdate$ ,
1472 which signifies the current manual revision date dictated by
1473 .Xr cvs 1 ,
1474 or instead a valid canonical date as specified by
1475 .Sx Dates .
1476 If a date does not conform or is empty, the current date is used.
1477 .Pp
1478 Examples:
1479 .D1 \&.Dd $\&Mdocdate$
1480 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1481 .D1 \&.Dd July 21, 2007
1482 .Pp
1483 See also
1484 .Sx \&Dt
1485 and
1486 .Sx \&Os .
1487 .Ss \&Dl
1488 One-line intended display.
1489 This is formatted as literal text and is useful for commands and
1490 invocations.
1491 It is followed by a newline.
1492 .Pp
1493 Examples:
1494 .D1 \&.Dl % mandoc mdoc.7 \e(ba less
1495 .Pp
1496 See also
1497 .Sx \&Bd
1498 and
1499 .Sx \&D1 .
1500 .Ss \&Do
1501 Begin a block enclosed by double quotes.
1502 Does not have any head arguments.
1503 .Pp
1504 Examples:
1505 .Bd -literal -offset indent -compact
1506 \&.Do
1507 April is the cruellest month
1508 \&.Dc
1509 \e(em T.S. Eliot
1510 .Ed
1511 .Pp
1512 See also
1513 .Sx \&Dq .
1514 .Ss \&Dq
1515 Encloses its arguments in
1516 .Dq typographic
1517 double-quotes.
1518 .Pp
1519 Examples:
1520 .Bd -literal -offset indent -compact
1521 \&.Dq April is the cruellest month
1522 \e(em T.S. Eliot
1523 .Ed
1524 .Pp
1525 See also
1526 .Sx \&Qq ,
1527 .Sx \&Sq ,
1528 and
1529 .Sx \&Do .
1530 .Ss \&Dt
1531 Document title.
1532 This is the mandatory second macro of any
1533 .Nm
1534 file.
1535 Its syntax is as follows:
1536 .Bd -ragged -offset indent
1537 .Pf \. Sx \&Dt
1538 .Oo
1539 .Ar title
1540 .Oo
1541 .Ar section
1542 .Op Ar volume | arch
1543 .Oc
1544 .Oc
1545 .Ed
1546 .Pp
1547 Its arguments are as follows:
1548 .Bl -tag -width Ds -offset Ds
1549 .It Ar title
1550 The document's title (name), defaulting to
1551 .Dq UNKNOWN
1552 if unspecified.
1553 It should be capitalised.
1554 .It Ar section
1555 The manual section.
1556 This may be one of
1557 .Ar 1
1558 .Pq utilities ,
1559 .Ar 2
1560 .Pq system calls ,
1561 .Ar 3
1562 .Pq libraries ,
1563 .Ar 3p
1564 .Pq Perl libraries ,
1565 .Ar 4
1566 .Pq devices ,
1567 .Ar 5
1568 .Pq file formats ,
1569 .Ar 6
1570 .Pq games ,
1571 .Ar 7
1572 .Pq miscellaneous ,
1573 .Ar 8
1574 .Pq system utilities ,
1575 .Ar 9
1576 .Pq kernel functions ,
1577 .Ar X11
1578 .Pq X Window System ,
1579 .Ar X11R6
1580 .Pq X Window System ,
1581 .Ar unass
1582 .Pq unassociated ,
1583 .Ar local
1584 .Pq local system ,
1585 .Ar draft
1586 .Pq draft manual ,
1587 or
1588 .Ar paper
1589 .Pq paper .
1590 It should correspond to the manual's filename suffix and defaults to
1591 .Dq 1
1592 if unspecified.
1593 .It Ar volume
1594 This overrides the volume inferred from
1595 .Ar section .
1596 This field is optional, and if specified, must be one of
1597 .Ar USD
1598 .Pq users' supplementary documents ,
1599 .Ar PS1
1600 .Pq programmers' supplementary documents ,
1601 .Ar AMD
1602 .Pq administrators' supplementary documents ,
1603 .Ar SMM
1604 .Pq system managers' manuals ,
1605 .Ar URM
1606 .Pq users' reference manuals ,
1607 .Ar PRM
1608 .Pq programmers' reference manuals ,
1609 .Ar KM
1610 .Pq kernel manuals ,
1611 .Ar IND
1612 .Pq master index ,
1613 .Ar MMI
1614 .Pq master index ,
1615 .Ar LOCAL
1616 .Pq local manuals ,
1617 .Ar LOC
1618 .Pq local manuals ,
1619 or
1620 .Ar CON
1621 .Pq contributed manuals .
1622 .It Ar arch
1623 This specifies a specific relevant architecture.
1624 If
1625 .Ar volume
1626 is not provided, it may be used in its place, else it may be used
1627 subsequent that.
1628 It, too, is optional.
1629 It must be one of
1630 .Ar alpha ,
1631 .Ar amd64 ,
1632 .Ar amiga ,
1633 .Ar arc ,
1634 .Ar arm ,
1635 .Ar armish ,
1636 .Ar aviion ,
1637 .Ar hp300 ,
1638 .Ar hppa ,
1639 .Ar hppa64 ,
1640 .Ar i386 ,
1641 .Ar landisk ,
1642 .Ar loongson ,
1643 .Ar luna88k ,
1644 .Ar mac68k ,
1645 .Ar macppc ,
1646 .Ar mvme68k ,
1647 .Ar mvme88k ,
1648 .Ar mvmeppc ,
1649 .Ar pmax ,
1650 .Ar sgi ,
1651 .Ar socppc ,
1652 .Ar sparc ,
1653 .Ar sparc64 ,
1654 .Ar sun3 ,
1655 .Ar vax ,
1656 or
1657 .Ar zaurus .
1658 .El
1659 .Pp
1660 Examples:
1661 .D1 \&.Dt FOO 1
1662 .D1 \&.Dt FOO 4 KM
1663 .D1 \&.Dt FOO 9 i386
1664 .Pp
1665 See also
1666 .Sx \&Dd
1667 and
1668 .Sx \&Os .
1669 .Ss \&Dv
1670 Defined variables such as preprocessor constants.
1671 .Pp
1672 Examples:
1673 .D1 \&.Dv BUFSIZ
1674 .D1 \&.Dv STDOUT_FILENO
1675 .Pp
1676 See also
1677 .Sx \&Er .
1678 .Ss \&Dx
1679 Format the DragonFly BSD version provided as an argument, or a default
1680 value if no argument is provided.
1681 .Pp
1682 Examples:
1683 .D1 \&.Dx 2.4.1
1684 .D1 \&.Dx
1685 .Pp
1686 See also
1687 .Sx \&At ,
1688 .Sx \&Bsx ,
1689 .Sx \&Bx ,
1690 .Sx \&Fx ,
1691 .Sx \&Nx ,
1692 .Sx \&Ox ,
1693 and
1694 .Sx \&Ux .
1695 .Ss \&Ec
1696 Close a scope started by
1697 .Sx \&Eo .
1698 Its syntax is as follows:
1699 .Pp
1700 .D1 Pf \. Sx \&Ec Op Ar TERM
1701 .Pp
1702 The
1703 .Ar TERM
1704 argument is used as the enclosure tail, for example, specifying \e(rq
1705 will emulate
1706 .Sx \&Dc .
1707 .Ss \&Ed
1708 End a display context started by
1709 .Sx \&Bd .
1710 .Ss \&Ef
1711 End a font mode context started by
1712 .Sx \&Bf .
1713 .Ss \&Ek
1714 End a keep context started by
1715 .Sx \&Bk .
1716 .Ss \&El
1717 End a list context started by
1718 .Sx \&Bl .
1719 .Pp
1720 See also
1721 .Sx \&Bl
1722 and
1723 .Sx \&It .
1724 .Ss \&Em
1725 Denotes text that should be emphasised.
1726 Note that this is a presentation term and should not be used for
1727 stylistically decorating technical terms.
1728 .Pp
1729 Examples:
1730 .D1 \&.Em Warnings!
1731 .D1 \&.Em Remarks :
1732 .Pp
1733 See also
1734 .Sx \&Bf ,
1735 .Sx \&Sy ,
1736 and
1737 .Sx \&Li .
1738 .Ss \&En
1739 This macro is obsolete and not implemented in
1740 .Xr mandoc 1 .
1741 .Ss \&Eo
1742 An arbitrary enclosure.
1743 Its syntax is as follows:
1744 .Pp
1745 .D1 Pf \. Sx \&Eo Op Ar TERM
1746 .Pp
1747 The
1748 .Ar TERM
1749 argument is used as the enclosure head, for example, specifying \e(lq
1750 will emulate
1751 .Sx \&Do .
1752 .Ss \&Er
1753 Display error constants.
1754 .Pp
1755 Examples:
1756 .D1 \&.Er EPERM
1757 .D1 \&.Er ENOENT
1758 .Pp
1759 See also
1760 .Sx \&Dv .
1761 .Ss \&Es
1762 This macro is obsolete and not implemented.
1763 .Ss \&Ev
1764 Environmental variables such as those specified in
1765 .Xr environ 7 .
1766 .Pp
1767 Examples:
1768 .D1 \&.Ev DISPLAY
1769 .D1 \&.Ev PATH
1770 .Ss \&Ex
1771 Insert a standard sentence regarding exit values.
1772 Its syntax is as follows:
1773 .Pp
1774 .D1 Pf \. Sx \&Ex Fl std Op Ar utility
1775 .Pp
1776 When
1777 .Ar utility
1778 is not specified, the document's name set by
1779 .Sx \&Nm
1780 is used.
1781 .Pp
1782 See also
1783 .Sx \&Rv .
1784 .Ss \&Fa
1785 Function argument.
1786 Its syntax is as follows:
1787 .Bd -ragged -offset indent
1788 .Pf \. Sx \&Fa
1789 .Op Cm argtype
1790 .Cm argname
1791 .Ed
1792 .Pp
1793 This may be invoked for names with or without the corresponding type.
1794 It is also used to specify the field name of a structure.
1795 Most often, the
1796 .Sx \&Fa
1797 macro is used in the
1798 .Em SYNOPSIS
1799 within
1800 .Sx \&Fo
1801 section when documenting multi-line function prototypes.
1802 If invoked with multiple arguments, the arguments are separated by a
1803 comma.
1804 Furthermore, if the following macro is another
1805 .Sx \&Fa ,
1806 the last argument will also have a trailing comma.
1807 .Pp
1808 Examples:
1809 .D1 \&.Fa \(dqconst char *p\(dq
1810 .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1811 .D1 \&.Fa foo
1812 .Pp
1813 See also
1814 .Sx \&Fo .
1815 .Ss \&Fc
1816 End a function context started by
1817 .Sx \&Fo .
1818 .Ss \&Fd
1819 Historically used to document include files.
1820 This usage has been deprecated in favour of
1821 .Sx \&In .
1822 Do not use this macro.
1823 .Pp
1824 See also
1825 .Sx MANUAL STRUCTURE
1826 and
1827 .Sx \&In .
1828 .Ss \&Fl
1829 Command-line flag.
1830 Used when listing arguments to command-line utilities.
1831 Prints a fixed-width hyphen
1832 .Sq \-
1833 directly followed by each argument.
1834 If no arguments are provided, a hyphen is printed followed by a space.
1835 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1836 output.
1837 .Pp
1838 Examples:
1839 .D1 \&.Fl a b c
1840 .D1 \&.Fl \&Pf a b
1841 .D1 \&.Fl
1842 .D1 \&.Op \&Fl o \&Ns \&Ar file
1843 .Pp
1844 See also
1845 .Sx \&Cm .
1846 .Ss \&Fn
1847 A function name.
1848 Its syntax is as follows:
1849 .Bd -ragged -offset indent
1850 .Pf \. Ns Sx \&Fn
1851 .Op Cm functype
1852 .Cm funcname
1853 .Op Oo Cm argtype Oc Cm argname
1854 .Ed
1855 .Pp
1856 Function arguments are surrounded in parenthesis and
1857 are delimited by commas.
1858 If no arguments are specified, blank parenthesis are output.
1859 .Pp
1860 Examples:
1861 .D1 \&.Fn "int funcname" "int arg0" "int arg1"
1862 .D1 \&.Fn funcname "int arg0"
1863 .D1 \&.Fn funcname arg0
1864 .Bd -literal -offset indent -compact
1865 \&.Ft functype
1866 \&.Fn funcname
1867 .Ed
1868 .Pp
1869 See also
1870 .Sx MANUAL STRUCTURE
1871 and
1872 .Sx \&Ft .
1873 .Ss \&Fo
1874 Begin a function block.
1875 This is a multi-line version of
1876 .Sx \&Fn .
1877 Its syntax is as follows:
1878 .Pp
1879 .D1 Pf \. Sx \&Fo Cm funcname
1880 .Pp
1881 Invocations usually occur in the following context:
1882 .Bd -ragged -offset indent
1883 .Pf \. Sx \&Ft Cm functype
1884 .br
1885 .Pf \. Sx \&Fo Cm funcname
1886 .br
1887 .Pf \. Sx \&Fa Oo Cm argtype Oc Cm argname
1888 .br
1889 \.\.\.
1890 .br
1891 .Pf \. Sx \&Fc
1892 .Ed
1893 .Pp
1894 A
1895 .Sx \&Fo
1896 scope is closed by
1897 .Pp
1898 See also
1899 .Sx MANUAL STRUCTURE ,
1900 .Sx \&Fa ,
1901 .Sx \&Fc ,
1902 and
1903 .Sx \&Ft .
1904 .Ss \&Ft
1905 A function type.
1906 Its syntax is as follows:
1907 .Pp
1908 .D1 Pf \. Sx \&Ft Cm functype
1909 .Pp
1910 Examples:
1911 .D1 \&.Ft int
1912 .Bd -literal -offset indent -compact
1913 \&.Ft functype
1914 \&.Fn funcname
1915 .Ed
1916 .Pp
1917 See also
1918 .Sx MANUAL STRUCTURE ,
1919 .Sx \&Fn ,
1920 and
1921 .Sx \&Fo .
1922 .Ss \&Fx
1923 Format the
1924 .Fx
1925 version provided as an argument, or a default value
1926 if no argument is provided.
1927 .Pp
1928 Examples:
1929 .D1 \&.Fx 7.1
1930 .D1 \&.Fx
1931 .Pp
1932 See also
1933 .Sx \&At ,
1934 .Sx \&Bsx ,
1935 .Sx \&Bx ,
1936 .Sx \&Dx ,
1937 .Sx \&Nx ,
1938 .Sx \&Ox ,
1939 and
1940 .Sx \&Ux .
1941 .Ss \&Hf
1942 This macro is obsolete and not implemented.
1943 .Ss \&Ic
1944 Designate an internal or interactive command.
1945 This is similar to
1946 .Sx \&Cm
1947 but used for instructions rather than values.
1948 .Pp
1949 Examples:
1950 .D1 \&.Ic hash
1951 .D1 \&.Ic alias
1952 .Pp
1953 Note that using
1954 .Sx \&Bd Fl literal
1955 or
1956 .Sx \&D1
1957 is preferred for displaying code; the
1958 .Sx \&Ic
1959 macro is used when referring to specific instructions.
1960 .Ss \&In
1961 An
1962 .Dq include
1963 file.
1964 In the
1965 .Em SYNOPSIS
1966 section (only if invoked as the line macro), the first argument is
1967 preceded by
1968 .Dq #include ,
1969 the arguments is enclosed in angle brackets.
1970 .Pp
1971 Examples:
1972 .D1 \&.In sys/types
1973 .Pp
1974 See also
1975 .Sx MANUAL STRUCTURE .
1976 .Ss \&It
1977 A list item.
1978 The syntax of this macro depends on the list type.
1979 .Pp
1980 Lists
1981 of type
1982 .Fl hang ,
1983 .Fl ohang ,
1984 .Fl inset ,
1985 and
1986 .Fl diag
1987 have the following syntax:
1988 .Pp
1989 .D1 Pf \. Sx \&It Cm args
1990 .Pp
1991 Lists of type
1992 .Fl bullet ,
1993 .Fl dash ,
1994 .Fl enum ,
1995 .Fl hyphen
1996 and
1997 .Fl item
1998 have the following syntax:
1999 .Pp
2000 .D1 Pf \. Sx \&It
2001 .Pp
2002 with subsequent lines interpreted within the scope of the
2003 .Sx \&It
2004 until either a closing
2005 .Sx \&El
2006 or another
2007 .Sx \&It .
2008 .Pp
2009 The
2010 .Fl tag
2011 list has the following syntax:
2012 .Pp
2013 .D1 Pf \. Sx \&It Op Cm args
2014 .Pp
2015 Subsequent lines are interpreted as with
2016 .Fl bullet
2017 and family.
2018 The line arguments correspond to the list's left-hand side; body
2019 arguments correspond to the list's contents.
2020 .Pp
2021 The
2022 .Fl column
2023 list is the most complicated.
2024 Its syntax is as follows:
2025 .Pp
2026 .D1 Pf \. Sx \&It Op Cm args
2027 .Pp
2028 The
2029 .Cm args
2030 are phrases, a mix of macros and text corresponding to a line column,
2031 delimited by tabs or the special
2032 .Sq \&Ta
2033 pseudo-macro.
2034 Lines subsequent the
2035 .Sx \&It
2036 are interpreted within the scope of the last phrase.
2037 Calling the pseudo-macro
2038 .Sq \&Ta
2039 will open a new phrase scope (this must occur on a macro line to be
2040 interpreted as a macro).
2041 Note that the tab phrase delimiter may only be used within the
2042 .Sx \&It
2043 line itself.
2044 Subsequent this, only the
2045 .Sq \&Ta
2046 pseudo-macro may be used to delimit phrases.
2047 Furthermore, note that quoted sections propagate over tab-delimited
2048 phrases on an
2049 .Sx \&It ,
2050 for example,
2051 .Pp
2052 .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
2053 .Pp
2054 will preserve the semicolon whitespace except for the last.
2055 .Pp
2056 See also
2057 .Sx \&Bl .
2058 .Ss \&Lb
2059 Specify a library.
2060 The syntax is as follows:
2061 .Pp
2062 .D1 Pf \. Sx \&Lb Cm library
2063 .Pp
2064 The
2065 .Cm library
2066 parameter may be a system library, such as
2067 .Cm libz
2068 or
2069 .Cm libpam ,
2070 in which case a small library description is printed next to the linker
2071 invocation; or a custom library, in which case the library name is
2072 printed in quotes.
2073 This is most commonly used in the
2074 .Em SYNOPSIS
2075 section as described in
2076 .Sx MANUAL STRUCTURE .
2077 .Pp
2078 Examples:
2079 .D1 \&.Lb libz
2080 .D1 \&.Lb mdoc
2081 .Ss \&Li
2082 Denotes text that should be in a literal font mode.
2083 Note that this is a presentation term and should not be used for
2084 stylistically decorating technical terms.
2085 .Pp
2086 See also
2087 .Sx \&Bf ,
2088 .Sx \&Sy ,
2089 and
2090 .Sx \&Em .
2091 .Ss \&Lk
2092 Format a hyperlink.
2093 Its syntax is as follows:
2094 .Pp
2095 .D1 Pf \. Sx \&Lk Cm uri Op Cm name
2096 .Pp
2097 Examples:
2098 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
2099 .D1 \&.Lk http://bsd.lv
2100 .Pp
2101 See also
2102 .Sx \&Mt .
2103 .Ss \&Lp
2104 Synonym for
2105 .Sx \&Pp .
2106 .Ss \&Ms
2107 Display a mathematical symbol.
2108 Its syntax is as follows:
2109 .Pp
2110 .D1 Pf \. Sx \&Ms Cm symbol
2111 .Pp
2112 Examples:
2113 .D1 \&.Ms sigma
2114 .D1 \&.Ms aleph
2115 .Ss \&Mt
2116 Format a
2117 .Dq mailto:
2118 hyperlink.
2119 Its syntax is as follows:
2120 .Pp
2121 .D1 Pf \. Sx \&Mt Cm address
2122 .Pp
2123 Examples:
2124 .D1 \&.Mt discuss@manpages.bsd.lv
2125 .Ss \&Nd
2126 A one line description of the manual's content.
2127 This may only be invoked in the
2128 .Em SYNOPSIS
2129 section subsequent the
2130 .Sx \&Nm
2131 macro.
2132 .Pp
2133 Examples:
2134 .D1 \&.Sx \&Nd mdoc language reference
2135 .D1 \&.Sx \&Nd format and display UNIX manuals
2136 .Pp
2137 The
2138 .Sx \&Nd
2139 macro technically accepts child macros and terminates with a subsequent
2140 .Sx \&Sh
2141 invocation.
2142 Do not assume this behaviour: some
2143 .Xr whatis 1
2144 database generators are not smart enough to parse more than the line
2145 arguments and will display macros verbatim.
2146 .Pp
2147 See also
2148 .Sx \&Nm .
2149 .Ss \&Nm
2150 The name of the manual page, or \(em in particular in section 1, 6,
2151 and 8 pages \(em of an additional command or feature documented in
2152 the manual page.
2153 When first invoked, the
2154 .Sx \&Nm
2155 macro expects a single argument, the name of the manual page.
2156 Usually, the first invocation happens in the
2157 .Em NAME
2158 section of the page.
2159 The specified name will be remembered and used whenever the macro is
2160 called again without arguments later in the page.
2161 The
2162 .Sx \&Nm
2163 macro uses
2164 .Sx Block full-implicit
2165 semantics when invoked as the first macro on an input line in the
2166 .Em SYNOPSIS
2167 section; otherwise, it uses ordinary
2168 .Sx In-line
2169 semantics.
2170 .Pp
2171 Examples:
2172 .Bd -literal -offset indent
2173 \&.Sh SYNOPSIS
2174 \&.Nm cat
2175 \&.Op Fl benstuv
2176 \&.Op Ar
2177 .Ed
2178 .Pp
2179 In the
2180 .Em SYNOPSIS
2181 of section 2, 3 and 9 manual pages, use the
2182 .Sx \&Fn
2183 macro rather than
2184 .Sx \&Nm
2185 to mark up the name of the manual page.
2186 .Ss \&No
2187 A
2188 .Dq noop
2189 macro used to terminate prior macro contexts.
2190 .Pp
2191 Examples:
2192 .D1 \&.Sx \&Fl ab \&No cd \&Fl ef
2193 .Ss \&Ns
2194 Suppress a space.
2195 Following invocation, text is interpreted as free-form text until a
2196 macro is encountered.
2197 .Pp
2198 Examples:
2199 .D1 \&.Fl o \&Ns \&Ar output
2200 .Pp
2201 See also
2202 .Sx \&No
2203 and
2204 .Sx \&Sm .
2205 .Ss \&Nx
2206 Format the
2207 .Nx
2208 version provided as an argument, or a default value if
2209 no argument is provided.
2210 .Pp
2211 Examples:
2212 .D1 \&.Nx 5.01
2213 .D1 \&.Nx
2214 .Pp
2215 See also
2216 .Sx \&At ,
2217 .Sx \&Bsx ,
2218 .Sx \&Bx ,
2219 .Sx \&Dx ,
2220 .Sx \&Fx ,
2221 .Sx \&Ox ,
2222 and
2223 .Sx \&Ux .
2224 .Ss \&Oc
2225 Close multi-line
2226 .Sx \&Oo
2227 context.
2228 .Ss \&Oo
2229 Multi-line version of
2230 .Sx \&Op .
2231 .Pp
2232 Examples:
2233 .Bd -literal -offset indent -compact
2234 \&.Oo
2235 \&.Op Fl flag Ns Ar value
2236 \&.Oc
2237 .Ed
2238 .Ss \&Op
2239 Command-line option.
2240 Used when listing options to command-line utilities.
2241 Prints the argument(s) in brackets.
2242 .Pp
2243 Examples:
2244 .D1 \&.Op \&Fl a \&Ar b
2245 .D1 \&.Op \&Ar a | b
2246 .Pp
2247 See also
2248 .Sx \&Oo .
2249 .Ss \&Os
2250 Document operating system version.
2251 This is the mandatory third macro of
2252 any
2253 .Nm
2254 file.
2255 Its syntax is as follows:
2256 .Pp
2257 .D1 Pf \. Sx \&Os Op Cm system Op Cm version
2258 .Pp
2259 The optional
2260 .Cm system
2261 parameter specifies the relevant operating system or environment.
2262 Left unspecified, it defaults to the local operating system version.
2263 This is the suggested form.
2264 .Pp
2265 Examples:
2266 .D1 \&.Os
2267 .D1 \&.Os KTH/CSC/TCS
2268 .D1 \&.Os BSD 4.3
2269 .Pp
2270 See also
2271 .Sx \&Dd
2272 and
2273 .Sx \&Dt .
2274 .Ss \&Ot
2275 Unknown usage.
2276 .Pp
2277 .Em Remarks :
2278 this macro has been deprecated.
2279 .Ss \&Ox
2280 Format the
2281 .Ox
2282 version provided as an argument, or a default value
2283 if no argument is provided.
2284 .Pp
2285 Examples:
2286 .D1 \&.Ox 4.5
2287 .D1 \&.Ox
2288 .Pp
2289 See also
2290 .Sx \&At ,
2291 .Sx \&Bsx ,
2292 .Sx \&Bx ,
2293 .Sx \&Dx ,
2294 .Sx \&Fx ,
2295 .Sx \&Nx ,
2296 and
2297 .Sx \&Ux .
2298 .Ss \&Pa
2299 A file-system path.
2300 .Pp
2301 Examples:
2302 .D1 \&.Pa /usr/bin/mandoc
2303 .D1 \&.Pa /usr/share/man/man7/mdoc.7
2304 .Pp
2305 See also
2306 .Sx \&Lk .
2307 .Ss \&Pc
2308 Close parenthesised context opened by
2309 .Sx \&Po .
2310 .Ss \&Pf
2311 Removes the space
2312 .Pq Dq prefix
2313 between its arguments.
2314 Its syntax is as follows:
2315 .Pp
2316 .D1 Pf \. \&Pf Cm prefix suffix
2317 .Pp
2318 The
2319 .Cm suffix
2320 argument may be a macro.
2321 .Pp
2322 Examples:
2323 .D1 \&.Pf \e. \&Sx \&Pf \&Cm prefix suffix
2324 .Ss \&Po
2325 Multi-line version of
2326 .Sx \&Pq .
2327 .Ss \&Pp
2328 Break a paragraph.
2329 This will assert vertical space between prior and subsequent macros
2330 and/or text.
2331 .Ss \&Pq
2332 Parenthesised enclosure.
2333 .Pp
2334 See also
2335 .Sx \&Po .
2336 .Ss \&Qc
2337 Close quoted context opened by
2338 .Sx \&Qo .
2339 .Ss \&Ql
2340 Format a single-quoted literal.
2341 See also
2342 .Sx \&Qq
2343 and
2344 .Sx \&Sq .
2345 .Ss \&Qo
2346 Multi-line version of
2347 .Sx \&Qq .
2348 .Ss \&Qq
2349 Encloses its arguments in
2350 .Dq typewriter
2351 double-quotes.
2352 Consider using
2353 .Sx \&Dq .
2354 .Pp
2355 See also
2356 .Sx \&Dq ,
2357 .Sx \&Sq ,
2358 and
2359 .Sx \&Qo .
2360 .Ss \&Re
2361 Close an
2362 .Sx \&Rs
2363 block.
2364 Does not have any tail arguments.
2365 .Ss \&Rs
2366 Begin a bibliographic
2367 .Pq Dq reference
2368 block.
2369 Does not have any head arguments.
2370 The block macro may only contain
2371 .Sx \&%A ,
2372 .Sx \&%B ,
2373 .Sx \&%C ,
2374 .Sx \&%D ,
2375 .Sx \&%I ,
2376 .Sx \&%J ,
2377 .Sx \&%N ,
2378 .Sx \&%O ,
2379 .Sx \&%P ,
2380 .Sx \&%Q ,
2381 .Sx \&%R ,
2382 .Sx \&%T ,
2383 .Sx \&%U ,
2384 and
2385 .Sx \&%V
2386 child macros (at least one must be specified).
2387 .Pp
2388 Examples:
2389 .Bd -literal -offset indent -compact
2390 \&.Rs
2391 \&.%A J. E. Hopcroft
2392 \&.%A J. D. Ullman
2393 \&.%B Introduction to Automata Theory, Languages, and Computation
2394 \&.%I Addison-Wesley
2395 \&.%C Reading, Massachusettes
2396 \&.%D 1979
2397 \&.Re
2398 .Ed
2399 .Pp
2400 If an
2401 .Sx \&Rs
2402 block is used within a SEE ALSO section, a vertical space is asserted
2403 before the rendered output, else the block continues on the current
2404 line.
2405 .Ss \&Rv
2406 Inserts text regarding a function call's return value.
2407 This macro must consist of the
2408 .Fl std
2409 argument followed by an optional
2410 .Ar function .
2411 If
2412 .Ar function
2413 is not provided, the document's name as stipulated by the first
2414 .Sx \&Nm
2415 is provided.
2416 .Pp
2417 See also
2418 .Sx \&Ex .
2419 .Ss \&Sc
2420 Close single-quoted context opened by
2421 .Sx \&So .
2422 .Ss \&Sh
2423 Begin a new section.
2424 For a list of conventional manual sections, see
2425 .Sx MANUAL STRUCTURE .
2426 These sections should be used unless it's absolutely necessary that
2427 custom sections be used.
2428 .Pp
2429 Section names should be unique so that they may be keyed by
2430 .Sx \&Sx .
2431 .Pp
2432 See also
2433 .Sx \&Pp ,
2434 .Sx \&Ss ,
2435 and
2436 .Sx \&Sx .
2437 .Ss \&Sm
2438 Switches the spacing mode for output generated from macros.
2439 Its syntax is as follows:
2440 .Pp
2441 .D1 Pf \. Sx \&Sm Cm on | off
2442 .Pp
2443 By default, spacing is
2444 .Cm on .
2445 When switched
2446 .Cm off ,
2447 no white space is inserted between macro arguments and between the
2448 output generated from adjacent macros, but free-form text lines
2449 still get normal spacing between words and sentences.
2450 .Ss \&So
2451 Multi-line version of
2452 .Sx \&Sq .
2453 .Ss \&Sq
2454 Encloses its arguments in
2455 .Dq typewriter
2456 single-quotes.
2457 .Pp
2458 See also
2459 .Sx \&Dq ,
2460 .Sx \&Qq ,
2461 and
2462 .Sx \&So .
2463 .Ss \&Ss
2464 Begin a new sub-section.
2465 Unlike with
2466 .Sx \&Sh ,
2467 there's no convention for sub-sections.
2468 Conventional sections, as described in
2469 .Sx MANUAL STRUCTURE ,
2470 rarely have sub-sections.
2471 .Pp
2472 Sub-section names should be unique so that they may be keyed by
2473 .Sx \&Sx .
2474 .Pp
2475 See also
2476 .Sx \&Pp ,
2477 .Sx \&Sh ,
2478 and
2479 .Sx \&Sx .
2480 .Ss \&St
2481 Replace an abbreviation for a standard with the full form.
2482 The following standards are recognised:
2483 .Pp
2484 .Bl -tag -width "-p1003.1g-2000X" -compact
2485 .It \-p1003.1-88
2486 .St -p1003.1-88
2487 .It \-p1003.1-90
2488 .St -p1003.1-90
2489 .It \-p1003.1-96
2490 .St -p1003.1-96
2491 .It \-p1003.1-2001
2492 .St -p1003.1-2001
2493 .It \-p1003.1-2004
2494 .St -p1003.1-2004
2495 .It \-p1003.1-2008
2496 .St -p1003.1-2008
2497 .It \-p1003.1
2498 .St -p1003.1
2499 .It \-p1003.1b
2500 .St -p1003.1b
2501 .It \-p1003.1b-93
2502 .St -p1003.1b-93
2503 .It \-p1003.1c-95
2504 .St -p1003.1c-95
2505 .It \-p1003.1g-2000
2506 .St -p1003.1g-2000
2507 .It \-p1003.1i-95
2508 .St -p1003.1i-95
2509 .It \-p1003.2-92
2510 .St -p1003.2-92
2511 .It \-p1003.2a-92
2512 .St -p1003.2a-92
2513 .It \-p1387.2-95
2514 .St -p1387.2-95
2515 .It \-p1003.2
2516 .St -p1003.2
2517 .It \-p1387.2
2518 .St -p1387.2
2519 .It \-isoC
2520 .St -isoC
2521 .It \-isoC-90
2522 .St -isoC-90
2523 .It \-isoC-amd1
2524 .St -isoC-amd1
2525 .It \-isoC-tcor1
2526 .St -isoC-tcor1
2527 .It \-isoC-tcor2
2528 .St -isoC-tcor2
2529 .It \-isoC-99
2530 .St -isoC-99
2531 .It \-iso9945-1-90
2532 .St -iso9945-1-90
2533 .It \-iso9945-1-96
2534 .St -iso9945-1-96
2535 .It \-iso9945-2-93
2536 .St -iso9945-2-93
2537 .It \-ansiC
2538 .St -ansiC
2539 .It \-ansiC-89
2540 .St -ansiC-89
2541 .It \-ansiC-99
2542 .St -ansiC-99
2543 .It \-ieee754
2544 .St -ieee754
2545 .It \-iso8802-3
2546 .St -iso8802-3
2547 .It \-ieee1275-94
2548 .St -ieee1275-94
2549 .It \-xpg3
2550 .St -xpg3
2551 .It \-xpg4
2552 .St -xpg4
2553 .It \-xpg4.2
2554 .St -xpg4.2
2555 .St -xpg4.3
2556 .It \-xbd5
2557 .St -xbd5
2558 .It \-xcu5
2559 .St -xcu5
2560 .It \-xsh5
2561 .St -xsh5
2562 .It \-xns5
2563 .St -xns5
2564 .It \-xns5.2
2565 .St -xns5.2
2566 .It \-xns5.2d2.0
2567 .St -xns5.2d2.0
2568 .It \-xcurses4.2
2569 .St -xcurses4.2
2570 .It \-susv2
2571 .St -susv2
2572 .It \-susv3
2573 .St -susv3
2574 .It \-svid4
2575 .St -svid4
2576 .El
2577 .Ss \&Sx
2578 Reference a section or sub-section.
2579 The referenced section or sub-section name must be identical to the
2580 enclosed argument, including whitespace.
2581 .Pp
2582 Examples:
2583 .D1 \&.Sx MANUAL STRUCTURE
2584 .Ss \&Sy
2585 Format enclosed arguments in symbolic
2586 .Pq Dq boldface .
2587 Note that this is a presentation term and should not be used for
2588 stylistically decorating technical terms.
2589 .Pp
2590 See also
2591 .Sx \&Bf ,
2592 .Sx \&Li ,
2593 and
2594 .Sx \&Em .
2595 .Ss \&Tn
2596 Format a tradename.
2597 .Pp
2598 Examples:
2599 .D1 \&.Tn IBM
2600 .Ss \&Ud
2601 Prints out
2602 .Dq currently under development .
2603 .Ss \&Ux
2604 Format the UNIX name.
2605 Accepts no argument.
2606 .Pp
2607 Examples:
2608 .D1 \&.Ux
2609 .Pp
2610 See also
2611 .Sx \&At ,
2612 .Sx \&Bsx ,
2613 .Sx \&Bx ,
2614 .Sx \&Dx ,
2615 .Sx \&Fx ,
2616 .Sx \&Nx ,
2617 and
2618 .Sx \&Ox .
2619 .Ss \&Va
2620 A variable name.
2621 .Pp
2622 Examples:
2623 .D1 \&.Va foo
2624 .D1 \&.Va const char *bar ;
2625 .Ss \&Vt
2626 A variable type.
2627 This is also used for indicating global variables in the
2628 .Em SYNOPSIS
2629 section, in which case a variable name is also specified.
2630 Note that it accepts
2631 .Sx Block partial-implicit
2632 syntax when invoked as the first macro in the
2633 .Em SYNOPSIS
2634 section, else it accepts ordinary
2635 .Sx In-line
2636 syntax.
2637 .Pp
2638 Note that this should not be confused with
2639 .Sx \&Ft ,
2640 which is used for function return types.
2641 .Pp
2642 Examples:
2643 .D1 \&.Vt unsigned char
2644 .D1 \&.Vt extern const char * const sys_signame[] \&;
2645 .Pp
2646 See also
2647 .Sx MANUAL STRUCTURE
2648 and
2649 .Sx \&Va .
2650 .Ss \&Xc
2651 Close a scope opened by
2652 .Sx \&Xo .
2653 .Ss \&Xo
2654 Open an extension scope.
2655 This macro originally existed to extend the 9-argument limit of troff;
2656 since this limit has been lifted, the macro has been deprecated.
2657 .Ss \&Xr
2658 Link to another manual
2659 .Pq Qq cross-reference .
2660 Its syntax is as follows:
2661 .Pp
2662 .D1 Pf \. Sx \&Xr Cm name section
2663 .Pp
2664 The
2665 .Cm name
2666 and
2667 .Cm section
2668 are the name and section of the linked manual.
2669 If
2670 .Cm section
2671 is followed by non-punctuation, an
2672 .Sx \&Ns
2673 is inserted into the token stream.
2674 This behaviour is for compatibility with
2675 .Xr groff 1 .
2676 .Pp
2677 Examples:
2678 .D1 \&.Xr mandoc 1
2679 .D1 \&.Xr mandoc 1 \&;
2680 .D1 \&.Xr mandoc 1 \&Ns s behaviour
2681 .Ss \&br
2682 Emits a line-break.
2683 This macro should not be used; it is implemented for compatibility with
2684 historical manuals.
2685 .Pp
2686 Consider using
2687 .Sx \&Pp
2688 in the event of natural paragraph breaks.
2689 .Ss \&sp
2690 Emits vertical space.
2691 This macro should not be used; it is implemented for compatibility with
2692 historical manuals.
2693 Its syntax is as follows:
2694 .Pp
2695 .D1 Pf \. Sx \&sp Op Cm height
2696 .Pp
2697 The
2698 .Cm height
2699 argument must be formatted as described in
2700 .Sx Scaling Widths .
2701 If unspecified,
2702 .Sx \&sp
2703 asserts a single vertical space.
2704 .Sh COMPATIBILITY
2705 This section documents compatibility between mandoc and other other
2706 troff implementations, at this time limited to GNU troff
2707 .Pq Qq groff .
2708 The term
2709 .Qq historic groff
2710 refers to groff versions before the
2711 .Pa doc.tmac
2712 file re-write
2713 .Pq somewhere between 1.15 and 1.19 .
2714 .Pp
2715 Heirloom troff, the other significant troff implementation accepting
2716 \-mdoc, is similar to historic groff.
2717 .Pp
2718 .Bl -dash -compact
2719 .It
2720 The
2721 .Sq \&%C
2722 macro is not implemented in GNU troff.
2723 .It
2724 An empty
2725 .Sq \&Dd
2726 macro in groff prints
2727 .Dq Epoch .
2728 In mandoc, it resolves to the current date.
2729 .It
2730 The \es (font size), \em (font colour), and \eM (font filling colour)
2731 font decoration escapes are all discarded in mandoc.
2732 .It
2733 Old groff fails to assert a newline before
2734 .Sx \&Bd Fl ragged compact .
2735 .It
2736 groff behaves inconsistently when encountering
2737 .Pf non- Sx \&Fa
2738 children of
2739 .Sx \&Fo
2740 regarding spacing between arguments.
2741 In mandoc, this is not the case: each argument is consistently followed
2742 by a single space and the trailing
2743 .Sq \&)
2744 suppresses prior spacing.
2745 .It
2746 groff behaves inconsistently when encountering
2747 .Sx \&Ft
2748 and
2749 .Sx \&Fn
2750 in the
2751 .Em SYNOPSIS :
2752 at times newline(s) are suppressed depending on whether a prior
2753 .Sx \&Fn
2754 has been invoked.
2755 In mandoc, this is not the case.
2756 See
2757 .Sx \&Ft
2758 and
2759 .Sx \&Fn
2760 for the normalised behaviour.
2761 .It
2762 Historic groff does not break before an
2763 .Sx \&Fn
2764 when not invoked as the line macro in the
2765 .Em SYNOPSIS
2766 section.
2767 .It
2768 Historic groff formats the
2769 .Sx \&In
2770 badly: trailing arguments are trashed and
2771 .Em SYNOPSIS
2772 is not specially treated.
2773 .It
2774 groff does not accept the
2775 .Sq \&Ta
2776 pseudo-macro as a line macro.
2777 mandoc does.
2778 .It
2779 The comment syntax
2780 .Sq \e\."
2781 is no longer accepted.
2782 .It
2783 In groff, the
2784 .Sx \&Pa
2785 macro does not format its arguments when used in the FILES section under
2786 certain list types.
2787 mandoc does.
2788 .It
2789 Historic groff does not print a dash for empty
2790 .Sx \&Fl
2791 arguments.
2792 mandoc and newer groff implementations do.
2793 .It
2794 groff behaves irregularly when specifying
2795 .Sq \ef
2796 .Sx Text Decoration
2797 within line-macro scopes.
2798 mandoc follows a consistent system.
2799 .It
2800 In mandoc, negative scaling units are truncated to zero; groff would
2801 move to prior lines.
2802 Furthermore, the
2803 .Sq f
2804 scaling unit, while accepted, is rendered as the default unit.
2805 .It
2806 In quoted literals, groff allowed pairwise double-quotes to produce a
2807 standalone double-quote in formatted output.
2808 This idiosyncratic behaviour is not applicable in mandoc.
2809 .It
2810 Display offsets
2811 .Sx \&Bd
2812 .Fl offset Ar center
2813 and
2814 .Fl offset Ar right
2815 are disregarded in mandoc.
2816 Furthermore, troff specifies a
2817 .Fl file Ar file
2818 argument that is not supported in mandoc.
2819 Lastly, since text is not right-justified in mandoc (or even groff),
2820 .Fl ragged
2821 and
2822 .Fl filled
2823 are aliases, as are
2824 .Fl literal
2825 and
2826 .Fl unfilled .
2827 .It
2828 Historic groff has many un-callable macros.
2829 Most of these (excluding some block-level macros) are now callable.
2830 .It
2831 The vertical bar
2832 .Sq \(ba
2833 made historic groff
2834 .Qq go orbital
2835 but has been a proper delimiter since then.
2836 .It
2837 .Sx \&It Fl nested
2838 is assumed for all lists (it wasn't in historic groff): any list may be
2839 nested and
2840 .Fl enum
2841 lists will restart the sequence only for the sub-list.
2842 .It
2843 Some manuals use
2844 .Sx \&Li
2845 incorrectly by following it with a reserved character and expecting the
2846 delimiter to render.
2847 This is not supported in mandoc.
2848 .It
2849 In groff, the
2850 .Sx \&Cd ,
2851 .Sx \&Er ,
2852 .Sx \&Ex ,
2853 and
2854 .Sx \&Rv
2855 macros were stipulated only to occur in certain manual sections.
2856 mandoc does not have these restrictions.
2857 .It
2858 Newer groff and mandoc print
2859 .Qq AT&T UNIX
2860 prior to unknown arguments of
2861 .Sx \&At ;
2862 older groff did nothing.
2863 .El
2864 .Sh SEE ALSO
2865 .Xr mandoc 1 ,
2866 .Xr mandoc_char 7
2867 .Sh AUTHORS
2868 The
2869 .Nm
2870 reference was written by
2871 .An Kristaps Dzonsons Aq kristaps@bsd.lv .