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