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