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