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