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