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