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