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