]> git.cameronkatri.com Git - mandoc.git/blob - mdoc.7
Note that `Dd' can be empty. This found following a thread on discuss@
[mandoc.git] / mdoc.7
1 .\" $Id: mdoc.7,v 1.142 2010/07/26 13:45:49 kristaps Exp $
2 .\"
3 .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
5 .\"
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .Dd $Mdocdate: July 26 2010 $
19 .Dt MDOC 7
20 .Os
21 .Sh NAME
22 .Nm mdoc
23 .Nd mdoc language reference
24 .Sh DESCRIPTION
25 The
26 .Nm mdoc
27 language is used to format
28 .Bx
29 .Ux
30 manuals.
31 In this reference document, we describe its syntax, structure, and
32 usage.
33 Our reference implementation is mandoc; the
34 .Sx COMPATIBILITY
35 section describes compatibility with other troff \-mdoc implementations.
36 .Pp
37 An
38 .Nm
39 document follows simple rules: lines beginning with the control
40 character
41 .Sq \.
42 are parsed for macros.
43 Other lines are interpreted within the scope of
44 prior macros:
45 .Bd -literal -offset indent
46 \&.Sh Macro lines change control state.
47 Other lines are interpreted within the current state.
48 .Ed
49 .Sh LANGUAGE SYNTAX
50 .Nm
51 documents may contain only graphable 7-bit ASCII characters, the space
52 character, and, in certain circumstances, the tab character.
53 All manuals must have
54 .Ux
55 line terminators.
56 .Ss Comments
57 Text following a
58 .Sq \e\*q ,
59 whether in a macro or free-form text line, is ignored to the end of
60 line.
61 A macro line with only a control character and comment escape,
62 .Sq \&.\e\*q ,
63 is also ignored.
64 Macro lines with only a control character and optionally whitespace are
65 stripped from input.
66 .Ss Reserved Characters
67 Within a macro line, the following characters are reserved:
68 .Pp
69 .Bl -tag -width Ds -offset indent -compact
70 .It \&.
71 .Pq period
72 .It \&,
73 .Pq comma
74 .It \&:
75 .Pq colon
76 .It \&;
77 .Pq semicolon
78 .It \&(
79 .Pq left-parenthesis
80 .It \&)
81 .Pq right-parenthesis
82 .It \&[
83 .Pq left-bracket
84 .It \&]
85 .Pq right-bracket
86 .It \&?
87 .Pq question
88 .It \&!
89 .Pq exclamation
90 .It \&|
91 .Pq vertical bar
92 .El
93 .Pp
94 Use of reserved characters is described in
95 .Sx MACRO SYNTAX .
96 For general use in macro lines, these characters can either be escaped
97 with a non-breaking space
98 .Pq Sq \e&
99 or, if applicable, an appropriate escape sequence can be used.
100 .Ss Special Characters
101 Special characters may occur in both macro and free-form lines.
102 Sequences begin with the escape character
103 .Sq \e
104 followed by either an open-parenthesis
105 .Sq \&(
106 for two-character sequences; an open-bracket
107 .Sq \&[
108 for n-character sequences (terminated at a close-bracket
109 .Sq \&] ) ;
110 or a single one-character sequence.
111 See
112 .Xr mandoc_char 7
113 for a complete list.
114 Examples include
115 .Sq \e(em
116 .Pq em-dash
117 and
118 .Sq \ee
119 .Pq back-slash .
120 .Ss Text Decoration
121 Terms may be text-decorated using the
122 .Sq \ef
123 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
124 (revert to previous mode):
125 .Pp
126 .D1 \efBbold\efR \efIitalic\efP
127 .Pp
128 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
129 respectively) may be used instead.
130 A text decoration is valid within
131 the current font scope only: if a macro opens a font scope alongside
132 its own scope, such as
133 .Sx \&Bf
134 .Cm \&Sy ,
135 in-scope invocations of
136 .Sq \ef
137 are only valid within the font scope of the macro.
138 If
139 .Sq \ef
140 is specified outside of any font scope, such as in unenclosed, free-form
141 text, it will affect the remainder of the document.
142 .Pp
143 Note this form is
144 .Em not
145 recommended for
146 .Nm ,
147 which encourages semantic annotation.
148 .Ss Predefined Strings
149 Historically,
150 .Xr groff 1
151 also defined a set of package-specific
152 .Dq predefined strings ,
153 which, like
154 .Sx Special Characters ,
155 mark special output characters and strings by way of input codes.
156 Predefined strings are escaped with the slash-asterisk,
157 .Sq \e* :
158 single-character
159 .Sq \e*X ,
160 two-character
161 .Sq \e*(XX ,
162 and N-character
163 .Sq \e*[N] .
164 See
165 .Xr mandoc_char 7
166 for a complete list.
167 Examples include
168 .Sq \e*(Am
169 .Pq ampersand
170 and
171 .Sq \e*(Ba
172 .Pq vertical bar .
173 .Ss Whitespace
174 Whitespace consists of the space character.
175 In free-form lines, whitespace is preserved within a line; un-escaped
176 trailing spaces are stripped from input (unless in a literal context).
177 Blank free-form lines, which may include whitespace, are only permitted
178 within literal contexts.
179 .Pp
180 In macro lines, whitespace delimits arguments and is discarded.
181 If arguments are quoted, whitespace within the quotes is retained.
182 .Ss Quotation
183 Macro arguments may be quoted with double-quotes to group
184 space-delimited terms or to retain blocks of whitespace.
185 A quoted argument begins with a double-quote preceded by whitespace.
186 The next double-quote not pair-wise adjacent to another double-quote
187 terminates the literal, regardless of surrounding whitespace.
188 .Pp
189 Note that any quoted text, even if it would cause a macro invocation
190 when unquoted, is considered literal text.
191 Thus, the following produces
192 .Sq Op "Fl a" :
193 .Bd -literal -offset indent
194 \&.Op "Fl a"
195 .Ed
196 .Pp
197 In free-form mode, quotes are regarded as opaque text.
198 .Ss Dates
199 There are several macros in
200 .Nm
201 that require a date argument.
202 The canonical form for dates is the American format:
203 .Pp
204 .D1 Cm Month Day , Year
205 .Pp
206 The
207 .Cm Day
208 value is an optionally zero-padded numeral.
209 The
210 .Cm Month
211 value is the full month name.
212 The
213 .Cm Year
214 value is the full four-digit year.
215 .Pp
216 Reduced form dates are broken-down canonical form dates:
217 .Pp
218 .D1 Cm Month , Year
219 .D1 Cm Year
220 .Pp
221 Some examples of valid dates follow:
222 .Pp
223 .D1 "May, 2009" Pq reduced form
224 .D1 "2009" Pq reduced form
225 .D1 "May 20, 2009" Pq canonical form
226 .Ss Scaling Widths
227 Many macros support scaled widths for their arguments, such as
228 stipulating a two-inch list indentation with the following:
229 .Bd -literal -offset indent
230 \&.Bl -tag -width 2i
231 .Ed
232 .Pp
233 The syntax for scaled widths is
234 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
235 where a decimal must be preceded or proceeded by at least one digit.
236 Negative numbers, while accepted, are truncated to zero.
237 The following scaling units are accepted:
238 .Pp
239 .Bl -tag -width Ds -offset indent -compact
240 .It c
241 centimetre
242 .It i
243 inch
244 .It P
245 pica (~1/6 inch)
246 .It p
247 point (~1/72 inch)
248 .It f
249 synonym for
250 .Sq u
251 .It v
252 default vertical span
253 .It m
254 width of rendered
255 .Sq m
256 .Pq em
257 character
258 .It n
259 width of rendered
260 .Sq n
261 .Pq en
262 character
263 .It u
264 default horizontal span
265 .It M
266 mini-em (~1/100 em)
267 .El
268 .Pp
269 Using anything other than
270 .Sq m ,
271 .Sq n ,
272 .Sq u ,
273 or
274 .Sq v
275 is necessarily non-portable across output media.
276 See
277 .Sx COMPATIBILITY .
278 .Ss Sentence Spacing
279 When composing a manual, make sure that your sentences end at the end of
280 a line.
281 By doing so, front-ends will be able to apply the proper amount of
282 spacing after the end of sentence (unescaped) period, exclamation mark,
283 or question mark followed by zero or more non-sentence closing
284 delimiters (
285 .Ns Sq \&) ,
286 .Sq \&] ,
287 .Sq \&' ,
288 .Sq \&" ) .
289 .Pp
290 The proper spacing is also intelligently preserved if a sentence ends at
291 the boundary of a macro line, e.g.,
292 .Pp
293 .D1 \&Xr mandoc 1 \.
294 .D1 \&Fl T \&Ns \&Cm ascii \.
295 .Sh MANUAL STRUCTURE
296 A well-formed
297 .Nm
298 document consists of a document prologue followed by one or more
299 sections.
300 .Pp
301 The prologue, which consists of the
302 .Sx \&Dd ,
303 .Sx \&Dt ,
304 and
305 .Sx \&Os
306 macros in that order, is required for every document.
307 .Pp
308 The first section (sections are denoted by
309 .Sx \&Sh )
310 must be the NAME section, consisting of at least one
311 .Sx \&Nm
312 followed by
313 .Sx \&Nd .
314 .Pp
315 Following that, convention dictates specifying at least the
316 .Em SYNOPSIS
317 and
318 .Em DESCRIPTION
319 sections, although this varies between manual sections.
320 .Pp
321 The following is a well-formed skeleton
322 .Nm
323 file:
324 .Bd -literal -offset indent
325 \&.Dd $\&Mdocdate$
326 \&.Dt mdoc 7
327 \&.Os
328 \&.Sh NAME
329 \&.Nm foo
330 \&.Nd a description goes here
331 \&.\e\*q The next is for sections 2, 3, & 9 only.
332 \&.\e\*q .Sh LIBRARY
333 \&.Sh SYNOPSIS
334 \&.Nm foo
335 \&.Op Fl options
336 \&.Ar
337 \&.Sh DESCRIPTION
338 The
339 \&.Nm
340 utility processes files ...
341 \&.\e\*q .Sh IMPLEMENTATION NOTES
342 \&.\e\*q The next is for sections 2, 3, & 9 only.
343 \&.\e\*q .Sh RETURN VALUES
344 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
345 \&.\e\*q .Sh ENVIRONMENT
346 \&.\e\*q .Sh FILES
347 \&.\e\*q The next is for sections 1 & 8 only.
348 \&.\e\*q .Sh EXIT STATUS
349 \&.\e\*q .Sh EXAMPLES
350 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
351 \&.\e\*q .Sh DIAGNOSTICS
352 \&.\e\*q The next is for sections 2, 3, & 9 only.
353 \&.\e\*q .Sh ERRORS
354 \&.\e\*q .Sh SEE ALSO
355 \&.\e\*q .Xr foobar 1
356 \&.\e\*q .Sh STANDARDS
357 \&.\e\*q .Sh HISTORY
358 \&.\e\*q .Sh AUTHORS
359 \&.\e\*q .Sh CAVEATS
360 \&.\e\*q .Sh BUGS
361 \&.\e\*q .Sh SECURITY CONSIDERATIONS
362 .Ed
363 .Pp
364 The sections in a
365 .Nm
366 document are conventionally ordered as they appear above.
367 Sections should be composed as follows:
368 .Bl -ohang -offset Ds
369 .It Em NAME
370 The name(s) and a one-line description of the documented material.
371 The syntax for this as follows:
372 .Bd -literal -offset indent
373 \&.Nm name0
374 \&.Nm name1
375 \&.Nm name2
376 \&.Nd a one-line description
377 .Ed
378 .Pp
379 The
380 .Sx \&Nm
381 macro(s) must precede the
382 .Sx \&Nd
383 macro.
384 .Pp
385 See
386 .Sx \&Nm
387 and
388 .Sx \&Nd .
389 .It Em LIBRARY
390 The name of the library containing the documented material, which is
391 assumed to be a function in a section 2, 3, or 9 manual.
392 The syntax for this is as follows:
393 .Bd -literal -offset indent
394 \&.Lb libarm
395 .Ed
396 .Pp
397 See
398 .Sx \&Lb .
399 .It Em SYNOPSIS
400 Documents the utility invocation syntax, function call syntax, or device
401 configuration.
402 .Pp
403 For the first, utilities (sections 1, 6, and 8), this is
404 generally structured as follows:
405 .Bd -literal -offset indent
406 \&.Nm foo
407 \&.Op Fl v
408 \&.Op Fl o Ar file
409 \&.Op Ar
410 \&.Nm bar
411 \&.Op Fl v
412 \&.Op Fl o Ar file
413 \&.Op Ar
414 .Ed
415 .Pp
416 For the second, function calls (sections 2, 3, 9):
417 .Bd -literal -offset indent
418 \&.Vt extern const char *global;
419 \&.In header.h
420 \&.Ft "char *"
421 \&.Fn foo "const char *src"
422 \&.Ft "char *"
423 \&.Fn bar "const char *src"
424 .Ed
425 .Pp
426 And for the third, configurations (section 4):
427 .Bd -literal -offset indent
428 \&.Cd \*qit* at isa? port 0x2e\*q
429 \&.Cd \*qit* at isa? port 0x4e\*q
430 .Ed
431 .Pp
432 Manuals not in these sections generally don't need a
433 .Em SYNOPSIS .
434 .Pp
435 Some macros are displayed differently in the
436 .Em SYNOPSIS
437 section, particularly
438 .Sx \&Nm ,
439 .Sx \&Cd ,
440 .Sx \&Fd ,
441 .Sx \&Fn ,
442 .Sx \&Fo ,
443 .Sx \&In ,
444 .Sx \&Vt ,
445 and
446 .Sx \&Ft .
447 All of these macros are output on their own line.
448 If two such dissimilar macros are pair-wise invoked (except for
449 .Sx \&Ft
450 before
451 .Sx \&Fo
452 or
453 .Sx \&Fn ) ,
454 they are separated by a vertical space, unless in the case of
455 .Sx \&Fo ,
456 .Sx \&Fn ,
457 and
458 .Sx \&Ft ,
459 which are always separated by vertical space.
460 .Pp
461 When text and macros following an
462 .Sx \&Nm
463 macro starting an input line span multiple output lines,
464 all output lines but the first will be indented to align
465 with the text immediately following the
466 .Sx \&Nm
467 macro, up to the next
468 .Sx \&Nm ,
469 .Sx \&Sh ,
470 or
471 .Sx \&Ss
472 macro or the end of an enclosing block, whichever comes first.
473 .It Em DESCRIPTION
474 This expands upon the brief, one-line description in
475 .Em NAME .
476 It usually contains a break-down of the options (if documenting a
477 command), such as:
478 .Bd -literal -offset indent
479 The arguments are as follows:
480 \&.Bl \-tag \-width Ds
481 \&.It Fl v
482 Print verbose information.
483 \&.El
484 .Ed
485 .Pp
486 Manuals not documenting a command won't include the above fragment.
487 .It Em IMPLEMENTATION NOTES
488 Implementation-specific notes should be kept here.
489 This is useful when implementing standard functions that may have side
490 effects or notable algorithmic implications.
491 .It Em RETURN VALUES
492 This section is the dual of
493 .Em EXIT STATUS ,
494 which is used for commands.
495 It documents the return values of functions in sections 2, 3, and 9.
496 .Pp
497 See
498 .Sx \&Rv .
499 .It Em ENVIRONMENT
500 Lists the environment variables used by the utility,
501 and explains the syntax and semantics of their values.
502 The
503 .Xr environ 7
504 manual provides examples of typical content and formatting.
505 .Pp
506 See
507 .Sx \&Ev .
508 .It Em FILES
509 Documents files used.
510 It's helpful to document both the file name and a short description of how
511 the file is used (created, modified, etc.).
512 .Pp
513 See
514 .Sx \&Pa .
515 .It Em EXIT STATUS
516 Command exit status for section 1, 6, and 8 manuals.
517 This section is the dual of
518 .Em RETURN VALUES ,
519 which is used for functions.
520 Historically, this information was described in
521 .Em DIAGNOSTICS ,
522 a practise that is now discouraged.
523 .Pp
524 See
525 .Sx \&Ex .
526 .It Em EXAMPLES
527 Example usages.
528 This often contains snippets of well-formed, well-tested invocations.
529 Make doubly sure that your examples work properly!
530 .It Em DIAGNOSTICS
531 Documents error conditions.
532 This is most useful in section 4 manuals.
533 Historically, this section was used in place of
534 .Em EXIT STATUS
535 for manuals in sections 1, 6, and 8; however, this practise is
536 discouraged.
537 .Pp
538 See
539 .Sx \&Bl
540 .Fl diag .
541 .It Em ERRORS
542 Documents error handling in sections 2, 3, and 9.
543 .Pp
544 See
545 .Sx \&Er .
546 .It Em SEE ALSO
547 References other manuals with related topics.
548 This section should exist for most manuals.
549 Cross-references should conventionally be ordered first by section, then
550 alphabetically.
551 .Pp
552 See
553 .Sx \&Xr .
554 .It Em STANDARDS
555 References any standards implemented or used.
556 If not adhering to any standards, the
557 .Em HISTORY
558 section should be used instead.
559 .Pp
560 See
561 .Sx \&St .
562 .It Em HISTORY
563 The history of any manual without a
564 .Em STANDARDS
565 section should be described in this section.
566 .It Em AUTHORS
567 Credits to authors, if applicable, should appear in this section.
568 Authors should generally be noted by both name and email address.
569 .Pp
570 See
571 .Sx \&An .
572 .It Em CAVEATS
573 Common misuses and misunderstandings should be explained
574 in this section.
575 .It Em BUGS
576 Known bugs, limitations and work-arounds should be described
577 in this section.
578 .It Em SECURITY CONSIDERATIONS
579 Documents any security precautions that operators should consider.
580 .El
581 .Sh MACRO SYNTAX
582 Macros are one to three three characters in length and begin with a
583 control character,
584 .Sq \&. ,
585 at the beginning of the line.
586 An arbitrary amount of whitespace may sit between the control character
587 and the macro name.
588 Thus, the following are equivalent:
589 .Bd -literal -offset indent
590 \&.Pp
591 \&.\ \ \ \&Pp
592 .Ed
593 .Pp
594 The syntax of a macro depends on its classification.
595 In this section,
596 .Sq \-arg
597 refers to macro arguments, which may be followed by zero or more
598 .Sq parm
599 parameters;
600 .Sq \&Yo
601 opens the scope of a macro; and if specified,
602 .Sq \&Yc
603 closes it out.
604 .Pp
605 The
606 .Em Callable
607 column indicates that the macro may be called subsequent to the initial
608 line-macro.
609 If a macro is not callable, then its invocation after the initial line
610 macro is interpreted as opaque text, such that
611 .Sq \&.Fl \&Sh
612 produces
613 .Sq Fl \&Sh .
614 .Pp
615 The
616 .Em Parsed
617 column indicates whether the macro may be followed by further
618 (ostensibly callable) macros.
619 If a macro is not parsed, subsequent macro invocations on the line
620 will be interpreted as opaque text.
621 .Pp
622 The
623 .Em Scope
624 column, if applicable, describes closure rules.
625 .Ss Block full-explicit
626 Multi-line scope closed by an explicit closing macro.
627 All macros contains bodies; only
628 .Sx \&Bf
629 contains a head.
630 .Bd -literal -offset indent
631 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
632 \(lBbody...\(rB
633 \&.Yc
634 .Ed
635 .Pp
636 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXX"
637 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
638 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
639 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
640 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
641 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
642 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
643 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
644 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
645 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
646 .El
647 .Ss Block full-implicit
648 Multi-line scope closed by end-of-file or implicitly by another macro.
649 All macros have bodies; some
650 .Po
651 .Sx \&It Fl bullet ,
652 .Fl hyphen ,
653 .Fl dash ,
654 .Fl enum ,
655 .Fl item
656 .Pc
657 don't have heads; only one
658 .Po
659 .Sx \&It
660 in
661 .Sx \&Bl Fl column
662 .Pc
663 has multiple heads.
664 .Bd -literal -offset indent
665 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
666 \(lBbody...\(rB
667 .Ed
668 .Pp
669 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX"
670 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
671 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
672 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
673 .It Sx \&Nm Ta \&No Ta Yes Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
674 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
675 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
676 .El
677 .Pp
678 Note that the
679 .Sx \&Nm
680 macro is a
681 .Sx Block full-implicit
682 macro only when invoked as the first macro
683 in a
684 .Em SYNOPSIS
685 section line, else it is
686 .Sx In-line .
687 .Ss Block partial-explicit
688 Like block full-explicit, but also with single-line scope.
689 Each has at least a body and, in limited circumstances, a head
690 .Po
691 .Sx \&Fo ,
692 .Sx \&Eo
693 .Pc
694 and/or tail
695 .Pq Sx \&Ec .
696 .Bd -literal -offset indent
697 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
698 \(lBbody...\(rB
699 \&.Yc \(lBtail...\(rB
700
701 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
702 \(lBbody...\(rB \&Yc \(lBtail...\(rB
703 .Ed
704 .Pp
705 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -compact -offset indent
706 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
707 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
708 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
709 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
710 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
711 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
712 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
713 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
714 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
715 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
716 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
717 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
718 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
719 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
720 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
721 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
722 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
723 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
724 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
725 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
726 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
727 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
728 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
729 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
730 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
731 .El
732 .Ss Block partial-implicit
733 Like block full-implicit, but with single-line scope closed by
734 .Sx Reserved Characters
735 or end of line.
736 .Bd -literal -offset indent
737 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
738 .Ed
739 .Pp
740 .Bl -column "MacroX" "CallableX" "ParsedX" -compact -offset indent
741 .It Em Macro Ta Em Callable Ta Em Parsed
742 .It Sx \&Aq Ta Yes Ta Yes
743 .It Sx \&Bq Ta Yes Ta Yes
744 .It Sx \&Brq Ta Yes Ta Yes
745 .It Sx \&D1 Ta \&No Ta \&Yes
746 .It Sx \&Dl Ta \&No Ta Yes
747 .It Sx \&Dq Ta Yes Ta Yes
748 .It Sx \&Op Ta Yes Ta Yes
749 .It Sx \&Pq Ta Yes Ta Yes
750 .It Sx \&Ql Ta Yes Ta Yes
751 .It Sx \&Qq Ta Yes Ta Yes
752 .It Sx \&Sq Ta Yes Ta Yes
753 .It Sx \&Vt Ta Yes Ta Yes
754 .El
755 .Pp
756 Note that the
757 .Sx \&Vt
758 macro is a
759 .Sx Block partial-implicit
760 only when invoked as the first macro
761 in a
762 .Em SYNOPSIS
763 section line, else it is
764 .Sx In-line .
765 .Ss In-line
766 Closed by
767 .Sx Reserved Characters ,
768 end of line, fixed argument lengths, and/or subsequent macros.
769 In-line macros have only text children.
770 If a number (or inequality) of arguments is
771 .Pq n ,
772 then the macro accepts an arbitrary number of arguments.
773 .Bd -literal -offset indent
774 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
775
776 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
777
778 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
779 .Ed
780 .Pp
781 .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -compact -offset indent
782 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
783 .It Sx \&%A Ta \&No Ta \&No Ta >0
784 .It Sx \&%B Ta \&No Ta \&No Ta >0
785 .It Sx \&%C Ta \&No Ta \&No Ta >0
786 .It Sx \&%D Ta \&No Ta \&No Ta >0
787 .It Sx \&%I Ta \&No Ta \&No Ta >0
788 .It Sx \&%J Ta \&No Ta \&No Ta >0
789 .It Sx \&%N Ta \&No Ta \&No Ta >0
790 .It Sx \&%O Ta \&No Ta \&No Ta >0
791 .It Sx \&%P Ta \&No Ta \&No Ta >0
792 .It Sx \&%Q Ta \&No Ta \&No Ta >0
793 .It Sx \&%R Ta \&No Ta \&No Ta >0
794 .It Sx \&%T Ta \&No Ta \&No Ta >0
795 .It Sx \&%U Ta \&No Ta \&No Ta >0
796 .It Sx \&%V Ta \&No Ta \&No Ta >0
797 .It Sx \&Ad Ta Yes Ta Yes Ta n
798 .It Sx \&An Ta Yes Ta Yes Ta n
799 .It Sx \&Ap Ta Yes Ta Yes Ta 0
800 .It Sx \&Ar Ta Yes Ta Yes Ta n
801 .It Sx \&At Ta Yes Ta Yes Ta 1
802 .It Sx \&Bsx Ta Yes Ta Yes Ta n
803 .It Sx \&Bt Ta \&No Ta \&No Ta 0
804 .It Sx \&Bx Ta Yes Ta Yes Ta n
805 .It Sx \&Cd Ta Yes Ta Yes Ta >0
806 .It Sx \&Cm Ta Yes Ta Yes Ta n
807 .It Sx \&Db Ta \&No Ta \&No Ta 1
808 .It Sx \&Dd Ta \&No Ta \&No Ta n
809 .It Sx \&Dt Ta \&No Ta \&No Ta n
810 .It Sx \&Dv Ta Yes Ta Yes Ta n
811 .It Sx \&Dx Ta Yes Ta Yes Ta n
812 .It Sx \&Em Ta Yes Ta Yes Ta >0
813 .It Sx \&En Ta \&No Ta \&No Ta 0
814 .It Sx \&Er Ta Yes Ta Yes Ta >0
815 .It Sx \&Es Ta \&No Ta \&No Ta 0
816 .It Sx \&Ev Ta Yes Ta Yes Ta n
817 .It Sx \&Ex Ta \&No Ta \&No Ta n
818 .It Sx \&Fa Ta Yes Ta Yes Ta n
819 .It Sx \&Fd Ta \&No Ta \&No Ta >0
820 .It Sx \&Fl Ta Yes Ta Yes Ta n
821 .It Sx \&Fn Ta Yes Ta Yes Ta >0
822 .It Sx \&Fr Ta \&No Ta \&No Ta n
823 .It Sx \&Ft Ta Yes Ta Yes Ta n
824 .It Sx \&Fx Ta Yes Ta Yes Ta n
825 .It Sx \&Hf Ta \&No Ta \&No Ta n
826 .It Sx \&Ic Ta Yes Ta Yes Ta >0
827 .It Sx \&In Ta \&No Ta \&No Ta n
828 .It Sx \&Lb Ta \&No Ta \&No Ta 1
829 .It Sx \&Li Ta Yes Ta Yes Ta n
830 .It Sx \&Lk Ta Yes Ta Yes Ta n
831 .It Sx \&Lp Ta \&No Ta \&No Ta 0
832 .It Sx \&Ms Ta Yes Ta Yes Ta >0
833 .It Sx \&Mt Ta Yes Ta Yes Ta >0
834 .It Sx \&Nm Ta Yes Ta Yes Ta n
835 .It Sx \&No Ta Yes Ta Yes Ta 0
836 .It Sx \&Ns Ta Yes Ta Yes Ta 0
837 .It Sx \&Nx Ta Yes Ta Yes Ta n
838 .It Sx \&Os Ta \&No Ta \&No Ta n
839 .It Sx \&Ot Ta \&No Ta \&No Ta n
840 .It Sx \&Ox Ta Yes Ta Yes Ta n
841 .It Sx \&Pa Ta Yes Ta Yes Ta n
842 .It Sx \&Pf Ta Yes Ta Yes Ta 1
843 .It Sx \&Pp Ta \&No Ta \&No Ta 0
844 .It Sx \&Rv Ta \&No Ta \&No Ta n
845 .It Sx \&Sm Ta \&No Ta \&No Ta 1
846 .It Sx \&St Ta \&No Ta Yes Ta 1
847 .It Sx \&Sx Ta Yes Ta Yes Ta >0
848 .It Sx \&Sy Ta Yes Ta Yes Ta >0
849 .It Sx \&Tn Ta Yes Ta Yes Ta >0
850 .It Sx \&Ud Ta \&No Ta \&No Ta 0
851 .It Sx \&Ux Ta Yes Ta Yes Ta n
852 .It Sx \&Va Ta Yes Ta Yes Ta n
853 .It Sx \&Vt Ta Yes Ta Yes Ta >0
854 .It Sx \&Xr Ta Yes Ta Yes Ta >0
855 .It Sx \&br Ta \&No Ta \&No Ta 0
856 .It Sx \&sp Ta \&No Ta \&No Ta 1
857 .El
858 .Sh REFERENCE
859 This section is a canonical reference of all macros, arranged
860 alphabetically.
861 For the scoping of individual macros, see
862 .Sx MACRO SYNTAX .
863 .Ss \&%A
864 Author name of an
865 .Sx \&Rs
866 block.
867 Multiple authors should each be accorded their own
868 .Sx \%%A
869 line.
870 Author names should be ordered with full or abbreviated forename(s)
871 first, then full surname.
872 .Ss \&%B
873 Book title of an
874 .Sx \&Rs
875 block.
876 This macro may also be used in a non-bibliographic context when
877 referring to book titles.
878 .Ss \&%C
879 Publication city or location of an
880 .Sx \&Rs
881 block.
882 .Pp
883 .Em Remarks :
884 this macro is not implemented in
885 .Xr groff 1 .
886 .Ss \&%D
887 Publication date of an
888 .Sx \&Rs
889 block.
890 This should follow the reduced or canonical form syntax described in
891 .Sx Dates .
892 .Ss \&%I
893 Publisher or issuer name of an
894 .Sx \&Rs
895 block.
896 .Ss \&%J
897 Journal name of an
898 .Sx \&Rs
899 block.
900 .Ss \&%N
901 Issue number (usually for journals) of an
902 .Sx \&Rs
903 block.
904 .Ss \&%O
905 Optional information of an
906 .Sx \&Rs
907 block.
908 .Ss \&%P
909 Book or journal page number of an
910 .Sx \&Rs
911 block.
912 .Ss \&%Q
913 Institutional author (school, government, etc.) of an
914 .Sx \&Rs
915 block.
916 Multiple institutional authors should each be accorded their own
917 .Sx \&%Q
918 line.
919 .Ss \&%R
920 Technical report name of an
921 .Sx \&Rs
922 block.
923 .Ss \&%T
924 Article title of an
925 .Sx \&Rs
926 block.
927 This macro may also be used in a non-bibliographical context when
928 referring to article titles.
929 .Ss \&%U
930 URI of reference document.
931 .Ss \&%V
932 Volume number of an
933 .Sx \&Rs
934 block.
935 .Ss \&Ac
936 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 .D1 \&.Ad [0,$]
946 .D1 \&.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 .D1 \&.An -nosplit
977 .D1 \&.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 .D1 \&.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 .D1 \&.Fn execve \&Ap d
994 .Ss \&Aq
995 Encloses its arguments in angle brackets.
996 .Pp
997 Examples:
998 .D1 \&.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 .D1 \&.Fl o \&Ns \&Ar file1
1020 .D1 \&.Ar
1021 .D1 \&.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 .D1 \&.At
1039 .D1 \&.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 started by 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 .D1 \&.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 .D1 \&.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 .D1 \&.Bsx 1.0
1385 .D1 \&.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 .D1 \&.Bx 4.4
1405 .D1 \&.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 .D1 \&.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 .D1 \&.Cm ControlPath
1436 .D1 \&.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 .D1 \&.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 .D1 \&.Dd $\&Mdocdate$
1487 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1488 .D1 \&.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 .D1 \&.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 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 .D1 \&.Dt FOO 1
1669 .D1 \&.Dt FOO 4 KM
1670 .D1 \&.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 .D1 \&.Dv BUFSIZ
1681 .D1 \&.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 .D1 \&.Dx 2.4.1
1691 .D1 \&.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 .D1 \&.Em Warnings!
1738 .D1 \&.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 .D1 \&.Er EPERM
1764 .D1 \&.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 .D1 \&.Ev DISPLAY
1776 .D1 \&.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 .D1 \&.Fa \(dqconst char *p\(dq
1817 .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1818 .D1 \&.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 .D1 \&.Fl a b c
1847 .D1 \&.Fl \&Pf a b
1848 .D1 \&.Fl
1849 .D1 \&.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 .D1 \&.Fn "int funcname" "int arg0" "int arg1"
1869 .D1 \&.Fn funcname "int arg0"
1870 .D1 \&.Fn funcname arg0
1871 .Bd -literal -offset indent -compact
1872 \&.Ft functype
1873 \&.Fn funcname
1874 .Ed
1875 .Pp
1876 See also
1877 .Sx MANUAL STRUCTURE
1878 and
1879 .Sx \&Ft .
1880 .Ss \&Fo
1881 Begin a function block.
1882 This is a multi-line version of
1883 .Sx \&Fn .
1884 Its syntax is as follows:
1885 .Pp
1886 .D1 Pf \. Sx \&Fo Cm funcname
1887 .Pp
1888 Invocations usually occur in the following context:
1889 .Bd -ragged -offset indent
1890 .Pf \. Sx \&Ft Cm functype
1891 .br
1892 .Pf \. Sx \&Fo Cm funcname
1893 .br
1894 .Pf \. Sx \&Fa Oo Cm argtype Oc Cm argname
1895 .br
1896 \.\.\.
1897 .br
1898 .Pf \. Sx \&Fc
1899 .Ed
1900 .Pp
1901 A
1902 .Sx \&Fo
1903 scope is closed by
1904 .Pp
1905 See also
1906 .Sx MANUAL STRUCTURE ,
1907 .Sx \&Fa ,
1908 .Sx \&Fc ,
1909 and
1910 .Sx \&Ft .
1911 .Ss \&Ft
1912 A function type.
1913 Its syntax is as follows:
1914 .Pp
1915 .D1 Pf \. Sx \&Ft Cm functype
1916 .Pp
1917 Examples:
1918 .D1 \&.Ft int
1919 .Bd -literal -offset indent -compact
1920 \&.Ft functype
1921 \&.Fn funcname
1922 .Ed
1923 .Pp
1924 See also
1925 .Sx MANUAL STRUCTURE ,
1926 .Sx \&Fn ,
1927 and
1928 .Sx \&Fo .
1929 .Ss \&Fx
1930 Format the FreeBSD version provided as an argument, or a default value
1931 if no argument is provided.
1932 .Pp
1933 Examples:
1934 .D1 \&.Fx 7.1
1935 .D1 \&.Fx
1936 .Pp
1937 See also
1938 .Sx \&At ,
1939 .Sx \&Bsx ,
1940 .Sx \&Bx ,
1941 .Sx \&Dx ,
1942 .Sx \&Nx ,
1943 .Sx \&Ox ,
1944 and
1945 .Sx \&Ux .
1946 .Ss \&Hf
1947 This macro is obsolete and not implemented.
1948 .Ss \&Ic
1949 Designate an internal or interactive command.
1950 This is similar to
1951 .Sx \&Cm
1952 but used for instructions rather than values.
1953 .Pp
1954 Examples:
1955 .D1 \&.Ic hash
1956 .D1 \&.Ic alias
1957 .Pp
1958 Note that using
1959 .Sx \&Bd No Fl literal
1960 or
1961 .Sx \&D1
1962 is preferred for displaying code; the
1963 .Sx \&Ic
1964 macro is used when referring to specific instructions.
1965 .Ss \&In
1966 An
1967 .Dq include
1968 file.
1969 In the
1970 .Em SYNOPSIS
1971 section (only if invoked as the line macro), the first argument is
1972 preceded by
1973 .Dq #include ,
1974 the arguments is enclosed in angle brackets.
1975 .Pp
1976 Examples:
1977 .D1 \&.In sys/types
1978 .Pp
1979 See also
1980 .Sx MANUAL STRUCTURE .
1981 .Ss \&It
1982 A list item.
1983 The syntax of this macro depends on the list type.
1984 .Pp
1985 Lists
1986 of type
1987 .Fl hang ,
1988 .Fl ohang ,
1989 .Fl inset ,
1990 and
1991 .Fl diag
1992 have the following syntax:
1993 .Pp
1994 .D1 Pf \. Sx \&It Cm args
1995 .Pp
1996 Lists of type
1997 .Fl bullet ,
1998 .Fl dash ,
1999 .Fl enum ,
2000 .Fl hyphen
2001 and
2002 .Fl item
2003 have the following syntax:
2004 .Pp
2005 .D1 Pf \. Sx \&It
2006 .Pp
2007 with subsequent lines interpreted within the scope of the
2008 .Sx \&It
2009 until either a closing
2010 .Sx \&El
2011 or another
2012 .Sx \&It .
2013 .Pp
2014 The
2015 .Fl tag
2016 list has the following syntax:
2017 .Pp
2018 .D1 Pf \. Sx \&It Op Cm args
2019 .Pp
2020 Subsequent lines are interpreted as with
2021 .Fl bullet
2022 and family.
2023 The line arguments correspond to the list's left-hand side; body
2024 arguments correspond to the list's contents.
2025 .Pp
2026 The
2027 .Fl column
2028 list is the most complicated.
2029 Its syntax is as follows:
2030 .Pp
2031 .D1 Pf \. Sx \&It Op Cm args
2032 .Pp
2033 The
2034 .Cm args
2035 are phrases, a mix of macros and text corresponding to a line column,
2036 delimited by tabs or the special
2037 .Sq \&Ta
2038 pseudo-macro.
2039 Lines subsequent the
2040 .Sx \&It
2041 are interpreted within the scope of the last phrase.
2042 Calling the pseudo-macro
2043 .Sq \&Ta
2044 will open a new phrase scope (this must occur on a macro line to be
2045 interpreted as a macro).
2046 Note that the tab phrase delimiter may only be used within the
2047 .Sx \&It
2048 line itself.
2049 Subsequent this, only the
2050 .Sq \&Ta
2051 pseudo-macro may be used to delimit phrases.
2052 Furthermore, note that quoted sections propagate over tab-delimited
2053 phrases on an
2054 .Sx \&It ,
2055 for example,
2056 .Pp
2057 .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
2058 .Pp
2059 will preserve the semicolon whitespace except for the last.
2060 .Pp
2061 See also
2062 .Sx \&Bl .
2063 .Ss \&Lb
2064 Specify a library.
2065 The syntax is as follows:
2066 .Pp
2067 .D1 Pf \. Sx \&Lb Cm library
2068 .Pp
2069 The
2070 .Cm library
2071 parameter may be a system library, such as
2072 .Cm libz
2073 or
2074 .Cm libpam ,
2075 in which case a small library description is printed next to the linker
2076 invocation; or a custom library, in which case the library name is
2077 printed in quotes.
2078 This is most commonly used in the
2079 .Em SYNOPSIS
2080 section as described in
2081 .Sx MANUAL STRUCTURE .
2082 .Pp
2083 Examples:
2084 .D1 \&.Lb libz
2085 .D1 \&.Lb mdoc
2086 .Ss \&Li
2087 Denotes text that should be in a literal font mode.
2088 Note that this is a presentation term and should not be used for
2089 stylistically decorating technical terms.
2090 .Pp
2091 See also
2092 .Sx \&Bf ,
2093 .Sx \&Sy ,
2094 and
2095 .Sx \&Em .
2096 .Ss \&Lk
2097 Format a hyperlink.
2098 Its syntax is as follows:
2099 .Pp
2100 .D1 Pf \. Sx \&Lk Cm uri Op Cm name
2101 .Pp
2102 Examples:
2103 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
2104 .D1 \&.Lk http://bsd.lv
2105 .Pp
2106 See also
2107 .Sx \&Mt .
2108 .Ss \&Lp
2109 Synonym for
2110 .Sx \&Pp .
2111 .Ss \&Ms
2112 Display a mathematical symbol.
2113 Its syntax is as follows:
2114 .Pp
2115 .D1 Pf \. Sx \&Ms Cm symbol
2116 .Pp
2117 Examples:
2118 .D1 \&.Ms sigma
2119 .D1 \&.Ms aleph
2120 .Ss \&Mt
2121 Format a
2122 .Dq mailto:
2123 hyperlink.
2124 Its syntax is as follows:
2125 .Pp
2126 .D1 Pf \. Sx \&Mt Cm address
2127 .Pp
2128 Examples:
2129 .D1 \&.Mt discuss@manpages.bsd.lv
2130 .Ss \&Nd
2131 A one-line description of the manual's content.
2132 This may only be invoked in the
2133 .Em SYNOPSIS
2134 section subsequent the
2135 .Sx \&Nm
2136 macro.
2137 .Pp
2138 Examples:
2139 .D1 \&.Sx \&Nd mdoc language reference
2140 .D1 \&.Sx \&Nd format and display UNIX manuals
2141 .Pp
2142 The
2143 .Sx \&Nd
2144 macro technically accepts child macros and terminates with a subsequent
2145 .Sx \&Sh
2146 invocation.
2147 Do not assume this behaviour: some
2148 .Xr whatis 1
2149 database generators are not smart enough to parse more than the line
2150 arguments and will display macros verbatim.
2151 .Pp
2152 See also
2153 .Sx \&Nm .
2154 .Ss \&Nm
2155 The name of the manual page, or \(em in particular in section 1, 6,
2156 and 8 pages \(em of an additional command or feature documented in
2157 the manual page.
2158 When first invoked, the
2159 .Sx \&Nm
2160 macro expects a single argument, the name of the manual page.
2161 Usually, the first invocation happens in the
2162 .Em NAME
2163 section of the page.
2164 The specified name will be remembered and used whenever the macro is
2165 called again without arguments later in the page.
2166 The
2167 .Sx \&Nm
2168 macro uses
2169 .Sx Block full-implicit
2170 semantics when invoked as the first macro on an input line in the
2171 .Em SYNOPSIS
2172 section; otherwise, it uses ordinary
2173 .Sx In-line
2174 semantics.
2175 .Pp
2176 Examples:
2177 .Bd -literal -offset indent
2178 \&.Sh SYNOPSIS
2179 \&.Nm cat
2180 \&.Op Fl benstuv
2181 \&.Op Ar
2182 .Ed
2183 .Pp
2184 In the
2185 .Em SYNOPSIS
2186 of section 2, 3 and 9 manual pages, use the
2187 .Sx \&Fn
2188 macro rather than
2189 .Sx \&Nm
2190 to mark up the name of the manual page.
2191 .Ss \&No
2192 A
2193 .Dq noop
2194 macro used to terminate prior macro contexts.
2195 .Pp
2196 Examples:
2197 .D1 \&.Sx \&Fl ab \&No cd \&Fl ef
2198 .Ss \&Ns
2199 Suppress a space.
2200 Following invocation, text is interpreted as free-form text until a
2201 macro is encountered.
2202 .Pp
2203 Examples:
2204 .D1 \&.Fl o \&Ns \&Ar output
2205 .Pp
2206 See also
2207 .Sx \&No
2208 and
2209 .Sx \&Sm .
2210 .Ss \&Nx
2211 Format the NetBSD version provided as an argument, or a default value if
2212 no argument is provided.
2213 .Pp
2214 Examples:
2215 .D1 \&.Nx 5.01
2216 .D1 \&.Nx
2217 .Pp
2218 See also
2219 .Sx \&At ,
2220 .Sx \&Bsx ,
2221 .Sx \&Bx ,
2222 .Sx \&Dx ,
2223 .Sx \&Fx ,
2224 .Sx \&Ox ,
2225 and
2226 .Sx \&Ux .
2227 .Ss \&Oc
2228 Close multi-line
2229 .Sx \&Oo
2230 context.
2231 .Ss \&Oo
2232 Multi-line version of
2233 .Sx \&Op .
2234 .Pp
2235 Examples:
2236 .Bd -literal -offset indent -compact
2237 \&.Oo
2238 \&.Op Fl flag Ns Ar value
2239 \&.Oc
2240 .Ed
2241 .Ss \&Op
2242 Command-line option.
2243 Used when listing options to command-line utilities.
2244 Prints the argument(s) in brackets.
2245 .Pp
2246 Examples:
2247 .D1 \&.Op \&Fl a \&Ar b
2248 .D1 \&.Op \&Ar a | b
2249 .Pp
2250 See also
2251 .Sx \&Oo .
2252 .Ss \&Os
2253 Document operating system version.
2254 This is the mandatory third macro of
2255 any
2256 .Nm
2257 file.
2258 Its syntax is as follows:
2259 .Pp
2260 .D1 Pf \. Sx \&Os Op Cm system
2261 .Pp
2262 The optional
2263 .Cm system
2264 parameter specifies the relevant operating system or environment.
2265 Left unspecified, it defaults to the local operating system version.
2266 This is the suggested form.
2267 .Pp
2268 Examples:
2269 .D1 \&.Os
2270 .D1 \&.Os KTH/CSC/TCS
2271 .D1 \&.Os BSD 4.3
2272 .Pp
2273 See also
2274 .Sx \&Dd
2275 and
2276 .Sx \&Dt .
2277 .Ss \&Ot
2278 Unknown usage.
2279 .Pp
2280 .Em Remarks :
2281 this macro has been deprecated.
2282 .Ss \&Ox
2283 Format the OpenBSD version provided as an argument, or a default value
2284 if no argument is provided.
2285 .Pp
2286 Examples:
2287 .D1 \&.Ox 4.5
2288 .D1 \&.Ox
2289 .Pp
2290 See also
2291 .Sx \&At ,
2292 .Sx \&Bsx ,
2293 .Sx \&Bx ,
2294 .Sx \&Dx ,
2295 .Sx \&Fx ,
2296 .Sx \&Nx ,
2297 and
2298 .Sx \&Ux .
2299 .Ss \&Pa
2300 A file-system path.
2301 .Pp
2302 Examples:
2303 .D1 \&.Pa /usr/bin/mandoc
2304 .D1 \&.Pa /usr/share/man/man7/mdoc.7
2305 .Pp
2306 See also
2307 .Sx \&Lk .
2308 .Ss \&Pc
2309 Close parenthesised context opened by
2310 .Sx \&Po .
2311 .Ss \&Pf
2312 Removes the space
2313 .Pq Dq prefix
2314 between its arguments.
2315 Its syntax is as follows:
2316 .Pp
2317 .D1 Pf \. \&Pf Cm prefix suffix
2318 .Pp
2319 The
2320 .Cm suffix
2321 argument may be a macro.
2322 .Pp
2323 Examples:
2324 .D1 \&.Pf \e. \&Sx \&Pf \&Cm prefix suffix
2325 .Ss \&Po
2326 Multi-line version of
2327 .Sx \&Pq .
2328 .Ss \&Pp
2329 Break a paragraph.
2330 This will assert vertical space between prior and subsequent macros
2331 and/or text.
2332 .Ss \&Pq
2333 Parenthesised enclosure.
2334 .Pp
2335 See also
2336 .Sx \&Po .
2337 .Ss \&Qc
2338 Close quoted context opened by
2339 .Sx \&Qo .
2340 .Ss \&Ql
2341 Format a single-quoted literal.
2342 See also
2343 .Sx \&Qq
2344 and
2345 .Sx \&Sq .
2346 .Ss \&Qo
2347 Multi-line version of
2348 .Sx \&Qq .
2349 .Ss \&Qq
2350 Encloses its arguments in
2351 .Dq typewriter
2352 double-quotes.
2353 Consider using
2354 .Sx \&Dq .
2355 .Pp
2356 See also
2357 .Sx \&Dq ,
2358 .Sx \&Sq ,
2359 and
2360 .Sx \&Qo .
2361 .Ss \&Re
2362 Close an
2363 .Sx \&Rs
2364 block.
2365 Does not have any tail arguments.
2366 .Ss \&Rs
2367 Begin a bibliographic
2368 .Pq Dq reference
2369 block.
2370 Does not have any head arguments.
2371 The block macro may only contain
2372 .Sx \&%A ,
2373 .Sx \&%B ,
2374 .Sx \&%C ,
2375 .Sx \&%D ,
2376 .Sx \&%I ,
2377 .Sx \&%J ,
2378 .Sx \&%N ,
2379 .Sx \&%O ,
2380 .Sx \&%P ,
2381 .Sx \&%Q ,
2382 .Sx \&%R ,
2383 .Sx \&%T ,
2384 .Sx \&%U ,
2385 and
2386 .Sx \&%V
2387 child macros (at least one must be specified).
2388 .Pp
2389 Examples:
2390 .Bd -literal -offset indent -compact
2391 \&.Rs
2392 \&.%A J. E. Hopcroft
2393 \&.%A J. D. Ullman
2394 \&.%B Introduction to Automata Theory, Languages, and Computation
2395 \&.%I Addison-Wesley
2396 \&.%C Reading, Massachusettes
2397 \&.%D 1979
2398 \&.Re
2399 .Ed
2400 .Pp
2401 If an
2402 .Sx \&Rs
2403 block is used within a SEE ALSO section, a vertical space is asserted
2404 before the rendered output, else the block continues on the current
2405 line.
2406 .Ss \&Rv
2407 Inserts text regarding a function call's return value.
2408 This macro must consist of the
2409 .Fl std
2410 argument followed by an optional
2411 .Ar function .
2412 If
2413 .Ar function
2414 is not provided, the document's name as stipulated by the first
2415 .Sx \&Nm
2416 is provided.
2417 .Pp
2418 See also
2419 .Sx \&Ex .
2420 .Ss \&Sc
2421 Close single-quoted context opened by
2422 .Sx \&So .
2423 .Ss \&Sh
2424 Begin a new section.
2425 For a list of conventional manual sections, see
2426 .Sx MANUAL STRUCTURE .
2427 These sections should be used unless it's absolutely necessary that
2428 custom sections be used.
2429 .Pp
2430 Section names should be unique so that they may be keyed by
2431 .Sx \&Sx .
2432 .Pp
2433 See also
2434 .Sx \&Pp ,
2435 .Sx \&Ss ,
2436 and
2437 .Sx \&Sx .
2438 .Ss \&Sm
2439 Switches the spacing mode for output generated from macros.
2440 Its syntax is as follows:
2441 .Pp
2442 .D1 Pf \. Sx \&Sm Cm on | off
2443 .Pp
2444 By default, spacing is
2445 .Cm on .
2446 When switched
2447 .Cm off ,
2448 no white space is inserted between macro arguments and between the
2449 output generated from adjacent macros, but free-form text lines
2450 still get normal spacing between words and sentences.
2451 .Ss \&So
2452 Multi-line version of
2453 .Sx \&Sq .
2454 .Ss \&Sq
2455 Encloses its arguments in
2456 .Dq typewriter
2457 single-quotes.
2458 .Pp
2459 See also
2460 .Sx \&Dq ,
2461 .Sx \&Qq ,
2462 and
2463 .Sx \&So .
2464 .Ss \&Ss
2465 Begin a new sub-section.
2466 Unlike with
2467 .Sx \&Sh ,
2468 there's no convention for sub-sections.
2469 Conventional sections, as described in
2470 .Sx MANUAL STRUCTURE ,
2471 rarely have sub-sections.
2472 .Pp
2473 Sub-section names should be unique so that they may be keyed by
2474 .Sx \&Sx .
2475 .Pp
2476 See also
2477 .Sx \&Pp ,
2478 .Sx \&Sh ,
2479 and
2480 .Sx \&Sx .
2481 .Ss \&St
2482 Replace an abbreviation for a standard with the full form.
2483 The following standards are recognised:
2484 .Pp
2485 .Bl -tag -width "-p1003.1g-2000X" -compact
2486 .It \-p1003.1-88
2487 .St -p1003.1-88
2488 .It \-p1003.1-90
2489 .St -p1003.1-90
2490 .It \-p1003.1-96
2491 .St -p1003.1-96
2492 .It \-p1003.1-2001
2493 .St -p1003.1-2001
2494 .It \-p1003.1-2004
2495 .St -p1003.1-2004
2496 .It \-p1003.1-2008
2497 .St -p1003.1-2008
2498 .It \-p1003.1
2499 .St -p1003.1
2500 .It \-p1003.1b
2501 .St -p1003.1b
2502 .It \-p1003.1b-93
2503 .St -p1003.1b-93
2504 .It \-p1003.1c-95
2505 .St -p1003.1c-95
2506 .It \-p1003.1g-2000
2507 .St -p1003.1g-2000
2508 .It \-p1003.1i-95
2509 .St -p1003.1i-95
2510 .It \-p1003.2-92
2511 .St -p1003.2-92
2512 .It \-p1003.2a-92
2513 .St -p1003.2a-92
2514 .It \-p1387.2-95
2515 .St -p1387.2-95
2516 .It \-p1003.2
2517 .St -p1003.2
2518 .It \-p1387.2
2519 .St -p1387.2
2520 .It \-isoC
2521 .St -isoC
2522 .It \-isoC-90
2523 .St -isoC-90
2524 .It \-isoC-amd1
2525 .St -isoC-amd1
2526 .It \-isoC-tcor1
2527 .St -isoC-tcor1
2528 .It \-isoC-tcor2
2529 .St -isoC-tcor2
2530 .It \-isoC-99
2531 .St -isoC-99
2532 .It \-iso9945-1-90
2533 .St -iso9945-1-90
2534 .It \-iso9945-1-96
2535 .St -iso9945-1-96
2536 .It \-iso9945-2-93
2537 .St -iso9945-2-93
2538 .It \-ansiC
2539 .St -ansiC
2540 .It \-ansiC-89
2541 .St -ansiC-89
2542 .It \-ansiC-99
2543 .St -ansiC-99
2544 .It \-ieee754
2545 .St -ieee754
2546 .It \-iso8802-3
2547 .St -iso8802-3
2548 .It \-ieee1275-94
2549 .St -ieee1275-94
2550 .It \-xpg3
2551 .St -xpg3
2552 .It \-xpg4
2553 .St -xpg4
2554 .It \-xpg4.2
2555 .St -xpg4.2
2556 .St -xpg4.3
2557 .It \-xbd5
2558 .St -xbd5
2559 .It \-xcu5
2560 .St -xcu5
2561 .It \-xsh5
2562 .St -xsh5
2563 .It \-xns5
2564 .St -xns5
2565 .It \-xns5.2
2566 .St -xns5.2
2567 .It \-xns5.2d2.0
2568 .St -xns5.2d2.0
2569 .It \-xcurses4.2
2570 .St -xcurses4.2
2571 .It \-susv2
2572 .St -susv2
2573 .It \-susv3
2574 .St -susv3
2575 .It \-svid4
2576 .St -svid4
2577 .El
2578 .Ss \&Sx
2579 Reference a section or sub-section.
2580 The referenced section or sub-section name must be identical to the
2581 enclosed argument, including whitespace.
2582 .Pp
2583 Examples:
2584 .D1 \&.Sx MANUAL STRUCTURE
2585 .Ss \&Sy
2586 Format enclosed arguments in symbolic
2587 .Pq Dq boldface .
2588 Note that this is a presentation term and should not be used for
2589 stylistically decorating technical terms.
2590 .Pp
2591 See also
2592 .Sx \&Bf ,
2593 .Sx \&Li ,
2594 and
2595 .Sx \&Em .
2596 .Ss \&Tn
2597 Format a tradename.
2598 .Pp
2599 Examples:
2600 .D1 \&.Tn IBM
2601 .Ss \&Ud
2602 Prints out
2603 .Dq currently under development.
2604 .Ss \&Ux
2605 Format the UNIX name.
2606 Accepts no argument.
2607 .Pp
2608 Examples:
2609 .D1 \&.Ux
2610 .Pp
2611 See also
2612 .Sx \&At ,
2613 .Sx \&Bsx ,
2614 .Sx \&Bx ,
2615 .Sx \&Dx ,
2616 .Sx \&Fx ,
2617 .Sx \&Nx ,
2618 and
2619 .Sx \&Ox .
2620 .Ss \&Va
2621 A variable name.
2622 .Pp
2623 Examples:
2624 .D1 \&.Va foo
2625 .D1 \&.Va const char *bar ;
2626 .Ss \&Vt
2627 A variable type.
2628 This is also used for indicating global variables in the
2629 .Em SYNOPSIS
2630 section, in which case a variable name is also specified.
2631 Note that it accepts
2632 .Sx Block partial-implicit
2633 syntax when invoked as the first macro in the
2634 .Em SYNOPSIS
2635 section, else it accepts ordinary
2636 .Sx In-line
2637 syntax.
2638 .Pp
2639 Note that this should not be confused with
2640 .Sx \&Ft ,
2641 which is used for function return types.
2642 .Pp
2643 Examples:
2644 .D1 \&.Vt unsigned char
2645 .D1 \&.Vt extern const char * const sys_signame[] \&;
2646 .Pp
2647 See also
2648 .Sx MANUAL STRUCTURE
2649 and
2650 .Sx \&Va .
2651 .Ss \&Xc
2652 Close a scope opened by
2653 .Sx \&Xo .
2654 .Ss \&Xo
2655 Open an extension scope.
2656 This macro originally existed to extend the 9-argument limit of troff;
2657 since this limit has been lifted, the macro has been deprecated.
2658 .Ss \&Xr
2659 Link to another manual
2660 .Pq Qq cross-reference .
2661 Its syntax is as follows:
2662 .Pp
2663 .D1 Pf \. Sx \&Xr Cm name section
2664 .Pp
2665 The
2666 .Cm name
2667 and
2668 .Cm section
2669 are the name and section of the linked manual.
2670 If
2671 .Cm section
2672 is followed by non-punctuation, an
2673 .Sx \&Ns
2674 is inserted into the token stream.
2675 This behaviour is for compatibility with
2676 .Xr groff 1 .
2677 .Pp
2678 Examples:
2679 .D1 \&.Xr mandoc 1
2680 .D1 \&.Xr mandoc 1 \&;
2681 .D1 \&.Xr mandoc 1 \&Ns s behaviour
2682 .Ss \&br
2683 Emits a line-break.
2684 This macro should not be used; it is implemented for compatibility with
2685 historical manuals.
2686 .Pp
2687 Consider using
2688 .Sx \&Pp
2689 in the event of natural paragraph breaks.
2690 .Ss \&sp
2691 Emits vertical space.
2692 This macro should not be used; it is implemented for compatibility with
2693 historical manuals.
2694 Its syntax is as follows:
2695 .Pp
2696 .D1 Pf \. Sx \&sp Op Cm height
2697 .Pp
2698 The
2699 .Cm height
2700 argument must be formatted as described in
2701 .Sx Scaling Widths .
2702 If unspecified,
2703 .Sx \&sp
2704 asserts a single vertical space.
2705 .Sh COMPATIBILITY
2706 This section documents compatibility between mandoc and other other
2707 troff implementations, at this time limited to GNU troff
2708 .Pq Qq groff .
2709 The term
2710 .Qq historic groff
2711 refers to groff versions before the
2712 .Pa doc.tmac
2713 file re-write
2714 .Pq somewhere between 1.15 and 1.19 .
2715 .Pp
2716 Heirloom troff, the other significant troff implementation accepting
2717 \-mdoc, is similar to historic groff.
2718 .Pp
2719 .Bl -dash -compact
2720 .It
2721 An empty
2722 .Sq \&Dd
2723 macro in groff prints
2724 .Dq Epoch .
2725 In mandoc, it resolves to the current date.
2726 .It
2727 The \es (font size), \em (font colour), and \eM (font filling colour)
2728 font decoration escapes are all discarded in mandoc.
2729 .It
2730 Old groff fails to assert a newline before
2731 .Sx \&Bd Fl ragged compact .
2732 .It
2733 groff behaves inconsistently when encountering
2734 .Pf non- Sx \&Fa
2735 children of
2736 .Sx \&Fo
2737 regarding spacing between arguments.
2738 In mandoc, this is not the case: each argument is consistently followed
2739 by a single space and the trailing
2740 .Sq \&)
2741 suppresses prior spacing.
2742 .It
2743 groff behaves inconsistently when encountering
2744 .Sx \&Ft
2745 and
2746 .Sx \&Fn
2747 in the
2748 .Em SYNOPSIS :
2749 at times newline(s) are suppressed depending on whether a prior
2750 .Sx \&Fn
2751 has been invoked.
2752 In mandoc, this is not the case.
2753 See
2754 .Sx \&Ft
2755 and
2756 .Sx \&Fn
2757 for the normalised behaviour.
2758 .It
2759 Historic groff does not break before an
2760 .Sx \&Fn
2761 when not invoked as the line macro in the
2762 .Em SYNOPSIS
2763 section.
2764 .It
2765 Historic groff formats the
2766 .Sx \&In
2767 badly: trailing arguments are trashed and
2768 .Em SYNOPSIS
2769 is not specially treated.
2770 .It
2771 groff does not accept the
2772 .Sq \&Ta
2773 pseudo-macro as a line macro.
2774 mandoc does.
2775 .It
2776 The comment syntax
2777 .Sq \e\."
2778 is no longer accepted.
2779 .It
2780 In groff, the
2781 .Sx \&Pa
2782 macro does not format its arguments when used in the FILES section under
2783 certain list types.
2784 mandoc does.
2785 .It
2786 Historic groff does not print a dash for empty
2787 .Sx \&Fl
2788 arguments.
2789 mandoc and newer groff implementations do.
2790 .It
2791 groff behaves irregularly when specifying
2792 .Sq \ef
2793 .Sx Text Decoration
2794 within line-macro scopes.
2795 mandoc follows a consistent system.
2796 .It
2797 In mandoc, negative scaling units are truncated to zero; groff would
2798 move to prior lines.
2799 Furthermore, the
2800 .Sq f
2801 scaling unit, while accepted, is rendered as the default unit.
2802 .It
2803 In quoted literals, groff allowed pair-wise double-quotes to produce a
2804 standalone double-quote in formatted output.
2805 This idiosyncratic behaviour is not applicable in mandoc.
2806 .It
2807 Display offsets
2808 .Sx \&Bd
2809 .Fl offset Ar center
2810 and
2811 .Fl offset Ar right
2812 are disregarded in mandoc.
2813 Furthermore, troff specifies a
2814 .Fl file Ar file
2815 argument that is not supported in mandoc.
2816 Lastly, since text is not right-justified in mandoc (or even groff),
2817 .Fl ragged
2818 and
2819 .Fl filled
2820 are aliases, as are
2821 .Fl literal
2822 and
2823 .Fl unfilled .
2824 .It
2825 Historic groff has many un-callable macros.
2826 Most of these (excluding some block-level macros) are now callable.
2827 .It
2828 The vertical bar
2829 .Sq \(ba
2830 made historic groff
2831 .Qq go orbital
2832 but has been a proper delimiter since then.
2833 .It
2834 .Sx \&It Fl nested
2835 is assumed for all lists (it wasn't in historic groff): any list may be
2836 nested and
2837 .Fl enum
2838 lists will restart the sequence only for the sub-list.
2839 .It
2840 Some manuals use
2841 .Sx \&Li
2842 incorrectly by following it with a reserved character and expecting the
2843 delimiter to render.
2844 This is not supported in mandoc.
2845 .It
2846 In groff, the
2847 .Sx \&Cd ,
2848 .Sx \&Er ,
2849 .Sx \&Ex ,
2850 and
2851 .Sx \&Rv
2852 macros were stipulated only to occur in certain manual sections.
2853 mandoc does not have these restrictions.
2854 .It
2855 Newer groff and mandoc print
2856 .Qq AT&T UNIX
2857 prior to unknown arguments of
2858 .Sx \&At ;
2859 older groff did nothing.
2860 .El
2861 .Sh SEE ALSO
2862 .Xr mandoc 1 ,
2863 .Xr mandoc_char 7
2864 .Sh AUTHORS
2865 The
2866 .Nm
2867 reference was written by
2868 .An Kristaps Dzonsons Aq kristaps@bsd.lv .