]> git.cameronkatri.com Git - mandoc.git/blob - mdoc.7
Explicitly account for \*(Ba when checking for delims. Noted by Jason McIntyre via...
[mandoc.git] / mdoc.7
1 .\" $Id: mdoc.7,v 1.98 2010/05/08 22:26:39 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: May 8 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 charater 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. See
105 .Xr mandoc_char 7
106 for a complete list. Examples include
107 .Sq \e(em
108 .Pq em-dash
109 and
110 .Sq \ee
111 .Pq back-slash .
112 .Ss Text Decoration
113 Terms may be text-decorated using the
114 .Sq \ef
115 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
116 (revert to previous mode):
117 .Pp
118 .D1 \efBbold\efR \efIitalic\efP
119 .Pp
120 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
121 respectively) may be used instead. A text decoration is valid within
122 the current font scope only: if a macro opens a font scope alongside
123 its own scope, such as
124 .Sx \&Bf
125 .Cm \&Sy ,
126 in-scope invocations of
127 .Sq \ef
128 are only valid within the font scope of the macro. If
129 .Sq \ef
130 is specified outside of any font scope, such as in unenclosed, free-form
131 text, it will affect the remainder of the document.
132 .Pp
133 Text may also be sized with the
134 .Sq \es
135 escape, whose syntax is one of
136 .Sq \es+-n
137 for one-digit numerals;
138 .Sq \es(+-nn
139 or
140 .Sq \es+-(nn
141 for two-digit numerals; and
142 .Sq \es[+-N] ,
143 .Sq \es+-[N] ,
144 .Sq \es'+-N' ,
145 or
146 .Sq \es+-'N'
147 for arbitrary-digit numerals:
148 .Pp
149 .D1 \es+1bigger\es-1
150 .D1 \es[+10]much bigger\es[-10]
151 .D1 \es+(10much bigger\es-(10
152 .D1 \es+'100'much much bigger\es-'100'
153 .Pp
154 Note these forms are
155 .Em not
156 recommended for
157 .Nm ,
158 which encourages semantic annotation.
159 .Ss Predefined Strings
160 Historically,
161 .Xr groff 1
162 also defined a set of package-specific
163 .Dq predefined strings ,
164 which, like
165 .Sx Special Characters ,
166 demark special output characters and strings by way of input codes.
167 Predefined strings are escaped with the slash-asterisk,
168 .Sq \e* :
169 single-character
170 .Sq \e*X ,
171 two-character
172 .Sq \e*(XX ,
173 and N-character
174 .Sq \e*[N] .
175 See
176 .Xr mandoc_char 7
177 for a complete list. Examples include
178 .Sq \e*(Am
179 .Pq ampersand
180 and
181 .Sq \e*(Ba
182 .Pq vertical bar .
183 .Ss Whitespace
184 Whitespace consists of the space character.
185 In free-form lines, whitespace is preserved within a line; un-escaped
186 trailing spaces are stripped from input (unless in a literal context).
187 Blank free-form lines, which may include whitespace, are only permitted
188 within literal contexts.
189 .Pp
190 In macro lines, whitespace delimits arguments and is discarded. If
191 arguments are quoted, whitespace within the quotes is retained.
192 .Ss Quotation
193 Macro arguments may be quoted with a double-quote to group
194 space-delimited terms or to retain blocks of whitespace. A quoted
195 argument begins with a double-quote preceded by whitespace. The next
196 double-quote not pair-wise adjacent to another double-quote terminates
197 the literal, regardless of surrounding whitespace.
198 .Pp
199 This produces tokens
200 .Sq a" ,
201 .Sq b c ,
202 .Sq de ,
203 and
204 .Sq fg" .
205 Note that any quoted term, be it argument or macro, is indiscriminately
206 considered literal text. Thus, the following produces
207 .Sq \&Em a :
208 .Bd -literal -offset indent
209 \&.Em "Em a"
210 .Ed
211 .Pp
212 In free-form mode, quotes are regarded as opaque text.
213 .Ss Dates
214 There are several macros in
215 .Nm
216 that require a date argument. The canonical form for dates is the
217 American format:
218 .Pp
219 .D1 Cm Month Day , Year
220 .Pp
221 The
222 .Cm Day
223 value is an optionally zero-padded numeral. The
224 .Cm Month
225 value is the full month name. The
226 .Cm Year
227 value is the full four-digit year.
228 .Pp
229 Reduced form dates are broken-down canonical form dates:
230 .Pp
231 .D1 Cm Month , Year
232 .D1 Cm Year
233 .Pp
234 Some examples of valid dates follow:
235 .Pp
236 .D1 "May, 2009" Pq reduced form
237 .D1 "2009" Pq reduced form
238 .D1 "May 20, 2009" Pq canonical form
239 .Ss Scaling Widths
240 Many macros support scaled widths for their arguments, such as
241 stipulating a two-inch list indentation with the following:
242 .Bd -literal -offset indent
243 \&.Bl -tag -width 2i
244 .Ed
245 .Pp
246 The syntax for scaled widths is
247 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
248 where a decimal must be preceded or proceeded by at least one digit.
249 Negative numbers, while accepted, are truncated to zero. The following
250 scaling units are accepted:
251 .Pp
252 .Bl -tag -width Ds -offset indent -compact
253 .It c
254 centimetre
255 .It i
256 inch
257 .It P
258 pica (~1/6 inch)
259 .It p
260 point (~1/72 inch)
261 .It f
262 synonym for
263 .Sq u
264 .It v
265 default vertical span
266 .It m
267 width of rendered
268 .Sq m
269 .Pq em
270 character
271 .It n
272 width of rendered
273 .Sq n
274 .Pq en
275 character
276 .It u
277 default horizontal span
278 .It M
279 mini-em (~1/100 em)
280 .El
281 .Pp
282 Using anything other than
283 .Sq m ,
284 .Sq n ,
285 .Sq u ,
286 or
287 .Sq v
288 is necessarily non-portable across output media. See
289 .Sx COMPATIBILITY .
290 .Sh MANUAL STRUCTURE
291 A well-formed
292 .Nm
293 document consists of a document prologue followed by one or more
294 sections.
295 .Pp
296 The prologue, which consists of (in order) the
297 .Sx \&Dd ,
298 .Sx \&Dt ,
299 and
300 .Sx \&Os
301 macros, is required for every document.
302 .Pp
303 The first section (sections are denoted by
304 .Sx \&Sh )
305 must be the NAME section, consisting of at least one
306 .Sx \&Nm
307 followed by
308 .Sx \&Nd .
309 .Pp
310 Following that, convention dictates specifying at least the SYNOPSIS and
311 DESCRIPTION sections, although this varies between manual sections.
312 .Pp
313 The following is a well-formed skeleton
314 .Nm
315 file:
316 .Bd -literal -offset indent
317 \&.Dd $\&Mdocdate$
318 \&.Dt mdoc 7
319 \&.Os
320 \&.
321 \&.Sh NAME
322 \&.Nm foo
323 \&.Nd a description goes here
324 \&.\e\*q The next is for sections 2 & 3 only.
325 \&.\e\*q .Sh LIBRARY
326 \&.
327 \&.Sh SYNOPSIS
328 \&.Nm foo
329 \&.Op Fl options
330 \&.Ar
331 \&.
332 \&.Sh DESCRIPTION
333 The
334 \&.Nm
335 utility processes files ...
336 \&.\e\*q .Sh IMPLEMENTATION NOTES
337 \&.\e\*q The next is for sections 1 & 8 only.
338 \&.\e\*q .Sh EXIT STATUS
339 \&.\e\*q The next is for sections 2, 3, & 9 only.
340 \&.\e\*q .Sh RETURN VALUES
341 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
342 \&.\e\*q .Sh ENVIRONMENT
343 \&.\e\*q .Sh FILES
344 \&.\e\*q .Sh EXAMPLES
345 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
346 \&.\e\*q .Sh DIAGNOSTICS
347 \&.\e\*q The next is for sections 2, 3, & 9 only.
348 \&.\e\*q .Sh ERRORS
349 \&.\e\*q .Sh SEE ALSO
350 \&.\e\*q .Xr foobar 1
351 \&.\e\*q .Sh STANDARDS
352 \&.\e\*q .Sh HISTORY
353 \&.\e\*q .Sh AUTHORS
354 \&.\e\*q .Sh CAVEATS
355 \&.\e\*q .Sh BUGS
356 \&.\e\*q .Sh SECURITY CONSIDERATIONS
357 .Ed
358 .Pp
359 The sections in a
360 .Nm
361 document are conventionally ordered as they appear above. Sections
362 should be composed as follows:
363 .Bl -ohang -offset Ds
364 .It Em NAME
365 The name(s) and a short description of the documented material. The
366 syntax for this as follows:
367 .Bd -literal -offset indent
368 \&.Nm name0
369 \&.Nm name1
370 \&.Nm name2
371 \&.Nd a short description
372 .Ed
373 .Pp
374 The
375 .Sx \&Nm
376 macro(s) must precede the
377 .Sx \&Nd
378 macro.
379 .Pp
380 See
381 .Sx \&Nm
382 and
383 .Sx \&Nd .
384 .It Em LIBRARY
385 The name of the library containing the documented material, which is
386 assumed to be a function in a section 2 or 3 manual. The syntax for
387 this is as follows:
388 .Bd -literal -offset indent
389 \&.Lb libarm
390 .Ed
391 .Pp
392 See
393 .Sx \&Lb .
394 .It Em SYNOPSIS
395 Documents the utility invocation syntax, function call syntax, or device
396 configuration.
397 .Pp
398 For the first, utilities (sections 1, 6, and 8), this is
399 generally structured as follows:
400 .Bd -literal -offset indent
401 \&.Nm foo
402 \&.Op Fl v
403 \&.Op Fl o Ar file
404 \&.Op Ar
405 \&.Nm bar
406 \&.Op Fl v
407 \&.Op Fl o Ar file
408 \&.Op Ar
409 .Ed
410 .Pp
411 For the second, function calls (sections 2, 3, 9):
412 .Bd -literal -offset indent
413 \&.Vt extern const char *global;
414 \&.In header.h
415 \&.Ft "char *"
416 \&.Fn foo "const char *src"
417 \&.Ft "char *"
418 \&.Fn bar "const char *src"
419 .Ed
420 .Pp
421 And for the third, configurations (section 4):
422 .Bd -literal -offset indent
423 \&.Cd \*qit* at isa? port 0x2e\*q
424 \&.Cd \*qit* at isa? port 0x4e\*q
425 .Ed
426 .Pp
427 Manuals not in these sections generally don't need a
428 .Em SYNOPSIS .
429 .Pp
430 See
431 .Sx \&Op ,
432 .Sx \&Cd ,
433 .Sx \&Fn ,
434 .Sx \&Ft ,
435 and
436 .Sx \&Vt .
437 .It Em DESCRIPTION
438 This expands upon the brief, one-line description in
439 .Em NAME .
440 It usually contains a break-down of the options (if documenting a
441 command), such as:
442 .Bd -literal -offset indent
443 The arguments are as follows:
444 \&.Bl \-tag \-width Ds
445 \&.It Fl v
446 Print verbose information.
447 \&.El
448 .Ed
449 .Pp
450 Manuals not documenting a command won't include the above fragment.
451 .It Em IMPLEMENTATION NOTES
452 Implementation-specific notes should be kept here. This is useful when
453 implementing standard functions that may have side effects or notable
454 algorithmic implications.
455 .It Em EXIT STATUS
456 Command exit status for section 1, 6, and 8 manuals. This section is
457 the dual of
458 .Em RETURN VALUES ,
459 which is used for functions. Historically, this information was
460 described in
461 .Em DIAGNOSTICS ,
462 a practise that is now discouraged.
463 .Pp
464 See
465 .Sx \&Ex .
466 .It Em RETURN VALUES
467 This section is the dual of
468 .Em EXIT STATUS ,
469 which is used for commands. It documents the return values of functions
470 in sections 2, 3, and 9.
471 .Pp
472 See
473 .Sx \&Rv .
474 .It Em ENVIRONMENT
475 Documents any usages of environment variables, e.g.,
476 .Xr environ 7 .
477 .Pp
478 See
479 .Sx \&Ev .
480 .It Em FILES
481 Documents files used. It's helpful to document both the file and a
482 short description of how the file is used (created, modified, etc.).
483 .Pp
484 See
485 .Sx \&Pa .
486 .It Em EXAMPLES
487 Example usages. This often contains snippets of well-formed,
488 well-tested invocations. Make doubly sure that your examples work
489 properly!
490 .It Em DIAGNOSTICS
491 Documents error conditions. This is most useful in section 4 manuals.
492 Historically, this section was used in place of
493 .Em EXIT STATUS
494 for manuals in sections 1, 6, and 8; however, this practise is
495 discouraged.
496 .Pp
497 See
498 .Sx \&Bl
499 .Fl diag .
500 .It Em ERRORS
501 Documents error handling in sections 2, 3, and 9.
502 .Pp
503 See
504 .Sx \&Er .
505 .It Em SEE ALSO
506 References other manuals with related topics. This section should exist
507 for most manuals. Cross-references should conventionally be ordered
508 first by section, then alphabetically.
509 .Pp
510 See
511 .Sx \&Xr .
512 .It Em STANDARDS
513 References any standards implemented or used. If not adhering to any
514 standards, the
515 .Em HISTORY
516 section should be used instead.
517 .Pp
518 See
519 .Sx \&St .
520 .It Em HISTORY
521 The history of any manual without a
522 .Em STANDARDS
523 section should be described in this section.
524 .It Em AUTHORS
525 Credits to authors, if applicable, should appear in this section.
526 Authors should generally be noted by both name and an e-mail address.
527 .Pp
528 See
529 .Sx \&An .
530 .It Em CAVEATS
531 Explanations of common misuses and misunderstandings should be explained
532 in this section.
533 .It Em BUGS
534 Extant bugs should be described in this section.
535 .It Em SECURITY CONSIDERATIONS
536 Documents any security precautions that operators should consider.
537 .El
538 .Sh MACRO SYNTAX
539 Macros are one to three three characters in length and begin with a
540 control character ,
541 .Sq \&. ,
542 at the beginning of the line. An arbitrary amount of whitespace may
543 sit between the control character and the macro name. Thus, the
544 following are equivalent:
545 .Bd -literal -offset indent
546 \&.Pp
547 \&.\ \ \ \&Pp
548 .Ed
549 .Pp
550 The syntax of a macro depends on its classification. In this section,
551 .Sq \-arg
552 refers to macro arguments, which may be followed by zero or more
553 .Sq parm
554 parameters;
555 .Sq \&Yo
556 opens the scope of a macro; and if specified,
557 .Sq \&Yc
558 closes it out.
559 .Pp
560 The
561 .Em Callable
562 column indicates that the macro may be called subsequent to the initial
563 line-macro. If a macro is not callable, then its invocation after the
564 initial line macro is interpreted as opaque text, such that
565 .Sq \&.Fl \&Sh
566 produces
567 .Sq Fl \&Sh .
568 .Pp
569 The
570 .Em Parsable
571 column indicates whether the macro may be followed by further
572 (ostensibly callable) macros. If a macro is not parsable, subsequent
573 macro invocations on the line will be interpreted as opaque text.
574 .Pp
575 The
576 .Em Scope
577 column, if applicable, describes closure rules.
578 .Ss Block full-explicit
579 Multi-line scope closed by an explicit closing macro. All macros
580 contains bodies; only
581 .Sx \&Bf
582 contains a head.
583 .Bd -literal -offset indent
584 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
585 \(lBbody...\(rB
586 \&.Yc
587 .Ed
588 .Pp
589 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
590 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
591 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
592 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
593 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
594 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
595 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
596 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
597 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
598 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
599 .El
600 .Ss Block full-implicit
601 Multi-line scope closed by end-of-file or implicitly by another macro.
602 All macros have bodies; some
603 .Po
604 .Sx \&It Fl bullet ,
605 .Fl hyphen ,
606 .Fl dash ,
607 .Fl enum ,
608 .Fl item
609 .Pc
610 don't have heads; only one
611 .Po
612 .Sx \&It Fl column
613 .Pc
614 has multiple heads.
615 .Bd -literal -offset indent
616 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
617 \(lBbody...\(rB
618 .Ed
619 .Pp
620 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
621 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
622 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
623 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
624 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
625 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
626 .El
627 .Ss Block partial-explicit
628 Like block full-explicit, but also with single-line scope. Each
629 has at least a body and, in limited circumstances, a head
630 .Po
631 .Sx \&Fo ,
632 .Sx \&Eo
633 .Pc
634 and/or tail
635 .Pq Sx \&Ec .
636 .Bd -literal -offset indent
637 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
638 \(lBbody...\(rB
639 \&.Yc \(lBtail...\(rB
640
641 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
642 \(lBbody...\(rB \&Yc \(lBtail...\(rB
643 .Ed
644 .Pp
645 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
646 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
647 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
648 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
649 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
650 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
651 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
652 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
653 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
654 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
655 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
656 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
657 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
658 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
659 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
660 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
661 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
662 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
663 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
664 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
665 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
666 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
667 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
668 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
669 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
670 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
671 .El
672 .Ss Block partial-implicit
673 Like block full-implicit, but with single-line scope closed by
674 .Sx Reserved Characters
675 or end of line.
676 .Bd -literal -offset indent
677 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
678 .Ed
679 .Pp
680 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
681 .It Em Macro Ta Em Callable Ta Em Parsable
682 .It Sx \&Aq Ta Yes Ta Yes
683 .It Sx \&Bq Ta Yes Ta Yes
684 .It Sx \&Brq Ta Yes Ta Yes
685 .It Sx \&D1 Ta \&No Ta \&Yes
686 .It Sx \&Dl Ta \&No Ta Yes
687 .It Sx \&Dq Ta Yes Ta Yes
688 .It Sx \&Op Ta Yes Ta Yes
689 .It Sx \&Pq Ta Yes Ta Yes
690 .It Sx \&Ql Ta Yes Ta Yes
691 .It Sx \&Qq Ta Yes Ta Yes
692 .It Sx \&Sq Ta Yes Ta Yes
693 .It Sx \&Vt Ta Yes Ta Yes
694 .El
695 .Pp
696 Note that the
697 .Sx \&Vt
698 macro is a
699 .Sx Block partial-implicit
700 only when invoked as the first macro
701 in a SYNOPSIS section line, else it is
702 .Sx In-line .
703 .Ss In-line
704 Closed by
705 .Sx Reserved Characters ,
706 end of line, fixed argument lengths, and/or subsequent macros. In-line
707 macros have only text children. If a number (or inequality) of
708 arguments is
709 .Pq n ,
710 then the macro accepts an arbitrary number of arguments.
711 .Bd -literal -offset indent
712 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
713
714 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
715
716 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
717 .Ed
718 .Pp
719 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
720 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
721 .It Sx \&%A Ta \&No Ta \&No Ta >0
722 .It Sx \&%B Ta \&No Ta \&No Ta >0
723 .It Sx \&%C Ta \&No Ta \&No Ta >0
724 .It Sx \&%D Ta \&No Ta \&No Ta >0
725 .It Sx \&%I Ta \&No Ta \&No Ta >0
726 .It Sx \&%J Ta \&No Ta \&No Ta >0
727 .It Sx \&%N Ta \&No Ta \&No Ta >0
728 .It Sx \&%O Ta \&No Ta \&No Ta >0
729 .It Sx \&%P Ta \&No Ta \&No Ta >0
730 .It Sx \&%Q Ta \&No Ta \&No Ta >0
731 .It Sx \&%R Ta \&No Ta \&No Ta >0
732 .It Sx \&%T Ta \&No Ta \&No Ta >0
733 .It Sx \&%U Ta \&No Ta \&No Ta >0
734 .It Sx \&%V Ta \&No Ta \&No Ta >0
735 .It Sx \&Ad Ta Yes Ta Yes Ta n
736 .It Sx \&An Ta Yes Ta Yes Ta n
737 .It Sx \&Ap Ta Yes Ta Yes Ta 0
738 .It Sx \&Ar Ta Yes Ta Yes Ta n
739 .It Sx \&At Ta Yes Ta Yes Ta 1
740 .It Sx \&Bsx Ta Yes Ta Yes Ta n
741 .It Sx \&Bt Ta \&No Ta \&No Ta 0
742 .It Sx \&Bx Ta Yes Ta Yes Ta n
743 .It Sx \&Cd Ta Yes Ta Yes Ta >0
744 .It Sx \&Cm Ta Yes Ta Yes Ta n
745 .It Sx \&Db Ta \&No Ta \&No Ta 1
746 .It Sx \&Dd Ta \&No Ta \&No Ta >0
747 .It Sx \&Dt Ta \&No Ta \&No Ta n
748 .It Sx \&Dv Ta Yes Ta Yes Ta n
749 .It Sx \&Dx Ta Yes Ta Yes Ta n
750 .It Sx \&Em Ta Yes Ta Yes Ta >0
751 .It Sx \&En Ta \&No Ta \&No Ta 0
752 .It Sx \&Er Ta Yes Ta Yes Ta >0
753 .It Sx \&Es Ta \&No Ta \&No Ta 0
754 .It Sx \&Ev Ta Yes Ta Yes Ta n
755 .It Sx \&Ex Ta \&No Ta \&No Ta n
756 .It Sx \&Fa Ta Yes Ta Yes Ta n
757 .It Sx \&Fd Ta \&No Ta \&No Ta >0
758 .It Sx \&Fl Ta Yes Ta Yes Ta n
759 .It Sx \&Fn Ta Yes Ta Yes Ta >0
760 .It Sx \&Fr Ta \&No Ta \&No Ta n
761 .It Sx \&Ft Ta Yes Ta Yes Ta n
762 .It Sx \&Fx Ta Yes Ta Yes Ta n
763 .It Sx \&Hf Ta \&No Ta \&No Ta n
764 .It Sx \&Ic Ta Yes Ta Yes Ta >0
765 .It Sx \&In Ta \&No Ta \&No Ta n
766 .It Sx \&Lb Ta \&No Ta \&No Ta 1
767 .It Sx \&Li Ta Yes Ta Yes Ta n
768 .It Sx \&Lk Ta Yes Ta Yes Ta n
769 .It Sx \&Lp Ta \&No Ta \&No Ta 0
770 .It Sx \&Ms Ta Yes Ta Yes Ta >0
771 .It Sx \&Mt Ta Yes Ta Yes Ta >0
772 .It Sx \&Nm Ta Yes Ta Yes Ta n
773 .It Sx \&No Ta Yes Ta Yes Ta 0
774 .It Sx \&Ns Ta Yes Ta Yes Ta 0
775 .It Sx \&Nx Ta Yes Ta Yes Ta n
776 .It Sx \&Os Ta \&No Ta \&No Ta n
777 .It Sx \&Ot Ta \&No Ta \&No Ta n
778 .It Sx \&Ox Ta Yes Ta Yes Ta n
779 .It Sx \&Pa Ta Yes Ta Yes Ta n
780 .It Sx \&Pf Ta Yes Ta Yes Ta 1
781 .It Sx \&Pp Ta \&No Ta \&No Ta 0
782 .It Sx \&Rv Ta \&No Ta \&No Ta n
783 .It Sx \&Sm Ta \&No Ta \&No Ta 1
784 .It Sx \&St Ta \&No Ta Yes Ta 1
785 .It Sx \&Sx Ta Yes Ta Yes Ta >0
786 .It Sx \&Sy Ta Yes Ta Yes Ta >0
787 .It Sx \&Tn Ta Yes Ta Yes Ta >0
788 .It Sx \&Ud Ta \&No Ta \&No Ta 0
789 .It Sx \&Ux Ta Yes Ta Yes Ta n
790 .It Sx \&Va Ta Yes Ta Yes Ta n
791 .It Sx \&Vt Ta Yes Ta Yes Ta >0
792 .It Sx \&Xr Ta Yes Ta Yes Ta >0
793 .It Sx \&br Ta \&No Ta \&No Ta 0
794 .It Sx \&sp Ta \&No Ta \&No Ta 1
795 .El
796 .Sh REFERENCE
797 This section is a canonical reference of all macros, arranged
798 alphabetically. For the scoping of individual macros, see
799 .Sx MACRO SYNTAX .
800 .Ss \&%A
801 Author name of an
802 .Sx \&Rs
803 block. Multiple authors should each be accorded their own
804 .Sx \%%A
805 line. Author names should be ordered with full or abbreviated
806 forename(s) first, then full surname.
807 .Ss \&%B
808 Book title of an
809 .Sx \&Rs
810 block. This macro may also be used in a non-bibliographic context when
811 referring to book titles.
812 .Ss \&%C
813 Publication city or location of an
814 .Sx \&Rs
815 block.
816 .Pp
817 .Em Remarks :
818 this macro is not implemented in
819 .Xr groff 1 .
820 .Ss \&%D
821 Publication date of an
822 .Sx \&Rs
823 block. This should follow the reduced or canonical form syntax
824 described in
825 .Sx Dates .
826 .Ss \&%I
827 Publisher or issuer name of an
828 .Sx \&Rs
829 block.
830 .Ss \&%J
831 Journal name of an
832 .Sx \&Rs
833 block.
834 .Ss \&%N
835 Issue number (usually for journals) of an
836 .Sx \&Rs
837 block.
838 .Ss \&%O
839 Optional information of an
840 .Sx \&Rs
841 block.
842 .Ss \&%P
843 Book or journal page number of an
844 .Sx \&Rs
845 block.
846 .Ss \&%Q
847 Institutional author (school, government, etc.) of an
848 .Sx \&Rs
849 block. Multiple institutional authors should each be accorded their own
850 .Sx \&%Q
851 line.
852 .Ss \&%R
853 Technical report name of an
854 .Sx \&Rs
855 block.
856 .Ss \&%T
857 Article title of an
858 .Sx \&Rs
859 block. This macro may also be used in a non-bibliographical context
860 when referring to article titles.
861 .Ss \&%U
862 URI of reference document.
863 .Ss \&%V
864 Volume number of an
865 .Sx \&Rs
866 block.
867 .Ss \&Ac
868 Closes an
869 .Sx \&Ao
870 block. Does not have any tail arguments.
871 .Ss \&Ad
872 Address construct: usually in the context of an computational address in
873 memory, not a physical (post) address.
874 .Pp
875 Examples:
876 .D1 \&.Ad [0,$]
877 .D1 \&.Ad 0x00000000
878 .Ss \&An
879 Author name. This macro may alternatively accepts the following
880 arguments, although these may not be specified along with a parameter:
881 .Bl -tag -width 12n -offset indent
882 .It Fl split
883 Renders a line break before each author listing.
884 .It Fl nosplit
885 The opposite of
886 .Fl split .
887 .El
888 .Pp
889 In the AUTHORS section, the default is not to split the first author
890 listing, but all subsequent author listings, whether or not they're
891 interspersed by other macros or text, are split. Thus, specifying
892 .Fl split
893 will cause the first listing also to be split. If not in the AUTHORS
894 section, the default is not to split.
895 .Pp
896 Examples:
897 .D1 \&.An -nosplit
898 .D1 \&.An J. D. Ullman .
899 .Pp
900 .Em Remarks :
901 the effects of
902 .Fl split
903 or
904 .Fl nosplit
905 are re-set when entering the AUTHORS section, so if one specifies
906 .Sx \&An Fl nosplit
907 in the general document body, it must be re-specified in the AUTHORS
908 section.
909 .Ss \&Ao
910 Begins a block enclosed by angled brackets. Does not have any head
911 arguments.
912 .Pp
913 Examples:
914 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
915 .Pp
916 See also
917 .Sx \&Aq .
918 .Ss \&Ap
919 Inserts an apostrophe without any surrounding white-space. This is
920 generally used as a grammatic device when referring to the verb form of
921 a function:
922 .Bd -literal -offset indent
923 \&.Fn execve Ap d
924 .Ed
925 .Ss \&Aq
926 Encloses its arguments in angled brackets.
927 .Pp
928 Examples:
929 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
930 .Pp
931 .Em Remarks :
932 this macro is often abused for rendering URIs, which should instead use
933 .Sx \&Lk
934 or
935 .Sx \&Mt ,
936 or to note pre-processor
937 .Dq Li #include
938 statements, which should use
939 .Sx \&In .
940 .Pp
941 See also
942 .Sx \&Ao .
943 .Ss \&Ar
944 Command arguments. If an argument is not provided, the string
945 .Dq file ...
946 is used as a default.
947 .Pp
948 Examples:
949 .D1 \&.Fl o \&Ns \&Ar file1
950 .D1 \&.Ar
951 .D1 \&.Ar arg1 , arg2 .
952 .Ss \&At
953 Formats an AT&T version. Accepts at most one parameter:
954 .Bl -tag -width 12n -offset indent
955 .It Cm v[1-7] | 32v
956 A version of
957 .At .
958 .It Cm V[.[1-4]]?
959 A system version of
960 .At .
961 .El
962 .Pp
963 Note that these parameters do not begin with a hyphen.
964 .Pp
965 Examples:
966 .D1 \&.At
967 .D1 \&.At V.1
968 .Pp
969 See also
970 .Sx \&Bsx ,
971 .Sx \&Bx ,
972 .Sx \&Dx ,
973 .Sx \&Fx ,
974 .Sx \&Nx ,
975 .Sx \&Ox ,
976 and
977 .Sx \&Ux .
978 .Ss \&Bc
979 Closes a
980 .Sx \&Bo
981 block. Does not have any tail arguments.
982 .Ss \&Bd
983 Begins a display block. A display is collection of macros or text which
984 may be collectively offset or justified in a manner different from that
985 of the enclosing context. By default, the block is preceded by a
986 vertical space.
987 .Pp
988 Each display is associated with a type, which must be one of the
989 following arguments:
990 .Bl -tag -width 12n -offset indent
991 .It Fl ragged
992 Only left-justify the block.
993 .It Fl unfilled
994 Do not justify the block at all.
995 .It Fl filled
996 Left- and right-justify the block.
997 .It Fl literal
998 Alias for
999 .Fl unfilled .
1000 .It Fl centered
1001 Centre-justify each line.
1002 .El
1003 .Pp
1004 The type must be provided first. Secondary arguments are as follows:
1005 .Bl -tag -width 12n -offset indent
1006 .It Fl offset Ar width
1007 Offset by the value of
1008 .Ar width ,
1009 which is interpreted as one of the following, specified in order:
1010 .Bl -item
1011 .It
1012 As one of the pre-defined strings
1013 .Ar indent ,
1014 the width of standard indentation;
1015 .Ar indent-two ,
1016 twice
1017 .Ar indent ;
1018 .Ar left ,
1019 which has no effect ;
1020 .Ar right ,
1021 which justifies to the right margin; and
1022 .Ar center ,
1023 which aligns around an imagined centre axis.
1024 .It
1025 As a precalculated width for a named macro. The most popular is the
1026 imaginary macro
1027 .Ar \&Ds ,
1028 which resolves to
1029 .Ar 6n .
1030 .It
1031 As a scaling unit following the syntax described in
1032 .Sx Scaling Widths .
1033 .It
1034 As the calculated string length of the opaque string.
1035 .El
1036 .Pp
1037 If unset, it will revert to the value of
1038 .Ar 8n
1039 as described in
1040 .Sx Scaling Widths .
1041 .It Fl compact
1042 Do not assert a vertical space before the block.
1043 .It Fl file Ar file
1044 Prepend the file
1045 .Ar file
1046 before any text or macros within the block.
1047 .El
1048 .Pp
1049 Examples:
1050 .Bd -literal -offset indent
1051 \&.Bd \-unfilled \-offset two-indent \-compact
1052 Hello world.
1053 \&.Ed
1054 .Ed
1055 .Pp
1056 See also
1057 .Sx \&D1
1058 and
1059 .Sx \&Dl .
1060 .Ss \&Bf
1061 .Ss \&Bk
1062 .Ss \&Bl
1063 .\" Begins a list composed of one or more list entries. A list entry is
1064 .\" specified by the
1065 .\" .Sx \&It
1066 .\" macro, which consists of a head and optional body. By default, a list
1067 .\" is preceded by a blank line. A list must specify one of the following
1068 .\" list types:
1069 .\" .Bl -tag -width 12n
1070 .\" .It Fl bullet
1071 .\" A list offset by a bullet. The head of list entries must be empty.
1072 .\" List entry bodies are justified after the bullet.
1073 .\" .It Fl column
1074 .\" A columnated list. The number of columns is specified as arguments to
1075 .\" the
1076 .\" .Sx \&Bl
1077 .\" macro (the deprecated form of following the invocation of
1078 .\" .Fl column
1079 .\" is also accepted). Arguments dictate the width of columns specified in
1080 .\" list entries. List entry bodies must be left empty. Columns specified
1081 .\" in the list entry head are justified to their position in the sequence
1082 .\" of columns.
1083 .\" .It Fl dash
1084 .\" A list offset by a dash (hyphen). The head of list entries must be
1085 .\" empty. List entry bodies are justified past the dash.
1086 .\" .It Fl diag
1087 .\" Like
1088 .\" .Fl inset
1089 .\" lists, but with additional formatting to the head.
1090 .\" .It Fl enum
1091 .\" A list offset by a number indicating list entry position. The head of
1092 .\" list entries must be empty. List entry bodies are justified past the
1093 .\" enumeration.
1094 .\" .It Fl hang
1095 .\" Like
1096 .\" .Fl tag ,
1097 .\" but instead of list bodies justifying to the head on the first line,
1098 .\" they trail the head text.
1099 .\" .It Fl hyphen
1100 .\" Synonym for
1101 .\" .Fl dash .
1102 .\" .It Fl inset
1103 .\" Like
1104 .\" .Fl tag ,
1105 .\" but list entry bodies aren't justified.
1106 .\" .It Fl item
1107 .\" An un-justified list. This produces blocks of text.
1108 .\" .It Fl ohang
1109 .\" List bodies are placed on the line following the head.
1110 .\" .It Fl tag
1111 .\" A list offset by list entry heads. List entry bodies are justified
1112 .\" after the head.
1113 .\" .El
1114 .\" .Pp
1115 .\" More...
1116 .\" .
1117 .Ss \&Bo
1118 Begins a block enclosed by square brackets. Does not have any head
1119 arguments.
1120 .Pp
1121 Examples:
1122 .Bd -literal -offset indent
1123 \&.Bo 1 ,
1124 \&.Dv BUFSIZ \&Bc
1125 .Ed
1126 .Pp
1127 See also
1128 .Sx \&Bq .
1129 .Ss \&Bq
1130 Encloses its arguments in square brackets.
1131 .Pp
1132 Examples:
1133 .D1 \&.Bq 1 , \&Dv BUFSIZ
1134 .Pp
1135 .Em Remarks :
1136 this macro is sometimes abused to emulate optional arguments for
1137 commands; the correct macros to use for this purpose are
1138 .Sx \&Op ,
1139 .Sx \&Oo ,
1140 and
1141 .Sx \&Oc .
1142 .Pp
1143 See also
1144 .Sx \&Bo .
1145 .Ss \&Brc
1146 Closes a
1147 .Sx \&Bro
1148 block. Does not have any tail arguments.
1149 .Ss \&Bro
1150 Begins a block enclosed by curly braces. Does not have any head
1151 arguments.
1152 .Pp
1153 Examples:
1154 .Bd -literal -offset indent
1155 \&.Bro 1 , ... ,
1156 \&.Va n \&Brc
1157 .Ed
1158 .Pp
1159 See also
1160 .Sx \&Brq .
1161 .Ss \&Brq
1162 Encloses its arguments in curly braces.
1163 .Pp
1164 Examples:
1165 .D1 \&.Brq 1 , ... , \&Va n
1166 .Pp
1167 See also
1168 .Sx \&Bro .
1169 .Ss \&Bsx
1170 Format the BSD/OS version provided as an argument, or a default value if
1171 no argument is provided.
1172 .Pp
1173 Examples:
1174 .D1 \&.Bsx 1.0
1175 .D1 \&.Bsx
1176 .Pp
1177 See also
1178 .Sx \&At ,
1179 .Sx \&Bx ,
1180 .Sx \&Dx ,
1181 .Sx \&Fx ,
1182 .Sx \&Nx ,
1183 .Sx \&Ox ,
1184 and
1185 .Sx \&Ux .
1186 .Ss \&Bt
1187 Prints
1188 .Dq is currently in beta test.
1189 .Ss \&Bx
1190 Format the BSD version provided as an argument, or a default value if no
1191 argument is provided.
1192 .Pp
1193 Examples:
1194 .D1 \&.Bx 4.4
1195 .D1 \&.Bx
1196 .Pp
1197 See also
1198 .Sx \&At ,
1199 .Sx \&Bsx ,
1200 .Sx \&Dx ,
1201 .Sx \&Fx ,
1202 .Sx \&Nx ,
1203 .Sx \&Ox ,
1204 and
1205 .Sx \&Ux .
1206 .Ss \&Cd
1207 Configuration declaration. This denotes strings accepted by
1208 .Xr config 8 .
1209 .Pp
1210 Examples:
1211 .D1 \&.Cd device le0 at scode?
1212 .Pp
1213 .Em Remarks :
1214 this macro is commonly abused by using quoted literals to retain
1215 white-space and align consecutive
1216 .Sx \&Cd
1217 declarations. This practise is discouraged.
1218 .Ss \&Cm
1219 Command modifiers. Useful when specifying configuration options or
1220 keys.
1221 .Pp
1222 Examples:
1223 .D1 \&.Cm ControlPath
1224 .D1 \&.Cm ControlMaster
1225 .Pp
1226 See also
1227 .Sx \&Fl .
1228 .Ss \&D1
1229 One-line indented display. This is formatted by the default rules and
1230 is useful for simple indented statements. It is followed by a newline.
1231 .Pp
1232 Examples:
1233 .D1 \&.D1 \&Fl abcdefgh
1234 .Pp
1235 See also
1236 .Sx \&Bd
1237 and
1238 .Sx \&Dl .
1239 .Ss \&Db
1240 .Ss \&Dc
1241 Closes a
1242 .Sx \&Do
1243 block. Does not have any tail arguments.
1244 .Ss \&Dd
1245 Document date. This is the mandatory first macro of any
1246 .Nm
1247 manual. Its calling syntax is as follows:
1248 .Pp
1249 .D1 \. Ns Sx \&Dd Cm date
1250 .Pp
1251 The
1252 .Cm date
1253 field may be either
1254 .Ar $\&Mdocdate$ ,
1255 which signifies the current manual revision date dictated by
1256 .Xr cvs 1 ,
1257 or instead a valid canonical date as specified by
1258 .Sx Dates .
1259 If a date does not conform, the current date is used instead.
1260 .Pp
1261 Examples:
1262 .D1 \&.Dd $\&Mdocdate$
1263 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1264 .D1 \&.Dd July 21, 2007
1265 .Pp
1266 See also
1267 .Sx \&Dt
1268 and
1269 .Sx \&Os .
1270 .Ss \&Dl
1271 One-line intended display. This is formatted as literal text and is
1272 useful for commands and invocations. It is followed by a newline.
1273 .Pp
1274 Examples:
1275 .D1 \&.Dl % mandoc mdoc.7 | less
1276 .Pp
1277 See also
1278 .Sx \&Bd
1279 and
1280 .Sx \&D1 .
1281 .Ss \&Do
1282 Begins a block enclosed by double quotes. Does not have any head
1283 arguments.
1284 .Pp
1285 Examples:
1286 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1287 .Pp
1288 See also
1289 .Sx \&Dq .
1290 .Ss \&Dq
1291 Encloses its arguments in double quotes.
1292 .Pp
1293 Examples:
1294 .Bd -literal -offset indent -compact
1295 \&.Dq April is the cruellest month
1296 \e(em T.S. Eliot
1297 .Ed
1298 .Pp
1299 See also
1300 .Sx \&Do .
1301 .Ss \&Dt
1302 Document title. This is the mandatory second macro of any
1303 .Nm
1304 file. Its calling syntax is as follows:
1305 .Pp
1306 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1307 .Pp
1308 Its arguments are as follows:
1309 .Bl -tag -width Ds -offset Ds
1310 .It Cm title
1311 The document's title (name). This should be capitalised and is
1312 required.
1313 .It Cm section
1314 The manual section. This may be one of
1315 .Ar 1
1316 .Pq utilities ,
1317 .Ar 2
1318 .Pq system calls ,
1319 .Ar 3
1320 .Pq libraries ,
1321 .Ar 3p
1322 .Pq Perl libraries ,
1323 .Ar 4
1324 .Pq devices ,
1325 .Ar 5
1326 .Pq file formats ,
1327 .Ar 6
1328 .Pq games ,
1329 .Ar 7
1330 .Pq miscellaneous ,
1331 .Ar 8
1332 .Pq system utilities ,
1333 .Ar 9
1334 .Pq kernel functions ,
1335 .Ar X11
1336 .Pq X Window System ,
1337 .Ar X11R6
1338 .Pq X Window System ,
1339 .Ar unass
1340 .Pq unassociated ,
1341 .Ar local
1342 .Pq local system ,
1343 .Ar draft
1344 .Pq draft manual ,
1345 or
1346 .Ar paper
1347 .Pq paper .
1348 It is also required and should correspond to the manual's filename
1349 suffix.
1350 .It Cm volume
1351 This overrides the volume inferred from
1352 .Ar section .
1353 This field is optional, and if specified, must be one of
1354 .Ar USD
1355 .Pq users' supplementary documents ,
1356 .Ar PS1
1357 .Pq programmers' supplementary documents ,
1358 .Ar AMD
1359 .Pq administrators' supplementary documents ,
1360 .Ar SMM
1361 .Pq system managers' manuals ,
1362 .Ar URM
1363 .Pq users' reference manuals ,
1364 .Ar PRM
1365 .Pq programmers' reference manuals ,
1366 .Ar KM
1367 .Pq kernel manuals ,
1368 .Ar IND
1369 .Pq master index ,
1370 .Ar MMI
1371 .Pq master index ,
1372 .Ar LOCAL
1373 .Pq local manuals ,
1374 .Ar LOC
1375 .Pq local manuals ,
1376 or
1377 .Ar CON
1378 .Pq contributed manuals .
1379 .It Cm arch
1380 This specifies a specific relevant architecture. If
1381 .Cm volume
1382 is not provided, it may be used in its place, else it may be used
1383 subsequent that. It, too, is optional. It must be one of
1384 .Ar alpha ,
1385 .Ar amd64 ,
1386 .Ar amiga ,
1387 .Ar arc ,
1388 .Ar arm ,
1389 .Ar armish ,
1390 .Ar aviion ,
1391 .Ar hp300 ,
1392 .Ar hppa ,
1393 .Ar hppa64 ,
1394 .Ar i386 ,
1395 .Ar landisk ,
1396 .Ar loongson ,
1397 .Ar luna88k ,
1398 .Ar mac68k ,
1399 .Ar macppc ,
1400 .Ar mvme68k ,
1401 .Ar mvme88k ,
1402 .Ar mvmeppc ,
1403 .Ar pmax ,
1404 .Ar sgi ,
1405 .Ar socppc ,
1406 .Ar sparc ,
1407 .Ar sparc64 ,
1408 .Ar sun3 ,
1409 .Ar vax ,
1410 or
1411 .Ar zaurus .
1412 .El
1413 .Pp
1414 Examples:
1415 .D1 \&.Dt FOO 1
1416 .D1 \&.Dt FOO 4 KM
1417 .D1 \&.Dt FOO 9 i386
1418 .D1 \&.Dt FOO 9 KM i386
1419 .Pp
1420 See also
1421 .Sx \&Dd
1422 and
1423 .Sx \&Os .
1424 .Ss \&Dv
1425 Defined variables such as preprocessor constants.
1426 .Pp
1427 Examples:
1428 .D1 \&.Dv BUFSIZ
1429 .D1 \&.Dv STDOUT_FILENO
1430 .Pp
1431 See also
1432 .Sx \&Er .
1433 .Ss \&Dx
1434 Format the DragonFly BSD version provided as an argument, or a default
1435 value if no argument is provided.
1436 .Pp
1437 Examples:
1438 .D1 \&.Dx 2.4.1
1439 .D1 \&.Dx
1440 .Pp
1441 See also
1442 .Sx \&At ,
1443 .Sx \&Bsx ,
1444 .Sx \&Bx ,
1445 .Sx \&Fx ,
1446 .Sx \&Nx ,
1447 .Sx \&Ox ,
1448 and
1449 .Sx \&Ux .
1450 .Ss \&Ec
1451 .Ss \&Ed
1452 .Ss \&Ef
1453 .Ss \&Ek
1454 .Ss \&El
1455 .Ss \&Em
1456 Denotes text that should be emphasised. Note that this is a
1457 presentation term and should not be used for stylistically decorating
1458 technical terms.
1459 .Pp
1460 Examples:
1461 .D1 \&.Em Warnings!
1462 .D1 \&.Em Remarks :
1463 .Ss \&En
1464 .Ss \&Eo
1465 .Ss \&Er
1466 Display error constants.
1467 .Pp
1468 Examples:
1469 .D1 \&.Er EPERM
1470 .D1 \&.Er ENOENT
1471 .Pp
1472 See also
1473 .Sx \&Dv .
1474 .Ss \&Es
1475 .Ss \&Ev
1476 Environmental variables such as those specified in
1477 .Xr environ 7 .
1478 .Pp
1479 Examples:
1480 .D1 \&.Ev DISPLAY
1481 .D1 \&.Ev PATH
1482 .Ss \&Ex
1483 Inserts text regarding a utility's exit values. This macro must have
1484 first the
1485 .Fl std
1486 argument specified, then an optional
1487 .Ar utility .
1488 If
1489 .Ar utility
1490 is not provided, the document's name as stipulated in
1491 .Sx \&Nm
1492 is provided.
1493 .Ss \&Fa
1494 .Ss \&Fc
1495 .Ss \&Fd
1496 .Ss \&Fl
1497 Command-line flag. Used when listing arguments to command-line
1498 utilities. Prints a fixed-width hyphen
1499 .Sq \-
1500 directly followed by each argument. If no arguments are provided, a hyphen is
1501 printed followed by a space. If the argument is a macro, a hyphen is
1502 prefixed to the subsequent macro output.
1503 .Pp
1504 Examples:
1505 .D1 \&.Fl a b c
1506 .D1 \&.Fl \&Pf a b
1507 .D1 \&.Fl
1508 .D1 \&.Op \&Fl o \&Ns \&Ar file
1509 .Pp
1510 See also
1511 .Sx \&Cm .
1512 .Ss \&Fn
1513 .Ss \&Fo
1514 .Ss \&Fr
1515 .Ss \&Ft
1516 .Ss \&Fx
1517 Format the FreeBSD version provided as an argument, or a default value
1518 if no argument is provided.
1519 .Pp
1520 Examples:
1521 .D1 \&.Fx 7.1
1522 .D1 \&.Fx
1523 .Pp
1524 See also
1525 .Sx \&At ,
1526 .Sx \&Bsx ,
1527 .Sx \&Bx ,
1528 .Sx \&Dx ,
1529 .Sx \&Nx ,
1530 .Sx \&Ox ,
1531 and
1532 .Sx \&Ux .
1533 .Ss \&Hf
1534 .Ss \&Ic
1535 .Ss \&In
1536 .Ss \&It
1537 .Ss \&Lb
1538 .Ss \&Li
1539 .Ss \&Lk
1540 Format a hyperlink. The calling syntax is as follows:
1541 .Pp
1542 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1543 .Pp
1544 Examples:
1545 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1546 .D1 \&.Lk http://bsd.lv
1547 .Pp
1548 See also
1549 .Sx \&Mt .
1550 .Ss \&Lp
1551 .Ss \&Ms
1552 .Ss \&Mt
1553 .Ss \&Nd
1554 .Ss \&Nm
1555 .Ss \&No
1556 .Ss \&Ns
1557 .Ss \&Nx
1558 Format the NetBSD version provided as an argument, or a default value if
1559 no argument is provided.
1560 .Pp
1561 Examples:
1562 .D1 \&.Nx 5.01
1563 .D1 \&.Nx
1564 .Pp
1565 See also
1566 .Sx \&At ,
1567 .Sx \&Bsx ,
1568 .Sx \&Bx ,
1569 .Sx \&Dx ,
1570 .Sx \&Fx ,
1571 .Sx \&Ox ,
1572 and
1573 .Sx \&Ux .
1574 .Ss \&Oc
1575 .Ss \&Oo
1576 .Ss \&Op
1577 .Ss \&Os
1578 Document operating system version. This is the mandatory third macro of
1579 any
1580 .Nm
1581 file. Its calling syntax is as follows:
1582 .Pp
1583 .D1 \. Ns Sx \&Os Op Cm system
1584 .Pp
1585 The optional
1586 .Cm system
1587 parameter specifies the relevant operating system or environment. Left
1588 unspecified, it defaults to the local operating system version. This is
1589 the suggested form.
1590 .Pp
1591 Examples:
1592 .D1 \&.Os
1593 .D1 \&.Os KTH/CSC/TCS
1594 .D1 \&.Os BSD 4.3
1595 .Pp
1596 See also
1597 .Sx \&Dd
1598 and
1599 .Sx \&Dt .
1600 .Ss \&Ot
1601 Unknown usage.
1602 .Pp
1603 .Em Remarks :
1604 this macro has been deprecated.
1605 .Ss \&Ox
1606 Format the OpenBSD version provided as an argument, or a default value
1607 if no argument is provided.
1608 .Pp
1609 Examples:
1610 .D1 \&.Ox 4.5
1611 .D1 \&.Ox
1612 .Pp
1613 See also
1614 .Sx \&At ,
1615 .Sx \&Bsx ,
1616 .Sx \&Bx ,
1617 .Sx \&Dx ,
1618 .Sx \&Fx ,
1619 .Sx \&Nx ,
1620 and
1621 .Sx \&Ux .
1622 .Ss \&Pa
1623 .Ss \&Pc
1624 .Ss \&Pf
1625 .Ss \&Po
1626 .Ss \&Pp
1627 .Ss \&Pq
1628 .Ss \&Qc
1629 .Ss \&Ql
1630 .Ss \&Qo
1631 .Ss \&Qq
1632 .Ss \&Re
1633 Closes a
1634 .Sx \&Rs
1635 block. Does not have any tail arguments.
1636 .Ss \&Rs
1637 Begins a bibliographic
1638 .Pq Dq reference
1639 block. Does not have any head arguments. The block macro may only
1640 contain
1641 .Sx \&%A ,
1642 .Sx \&%B ,
1643 .Sx \&%C ,
1644 .Sx \&%D ,
1645 .Sx \&%I ,
1646 .Sx \&%J ,
1647 .Sx \&%N ,
1648 .Sx \&%O ,
1649 .Sx \&%P ,
1650 .Sx \&%Q ,
1651 .Sx \&%R ,
1652 .Sx \&%T ,
1653 and
1654 .Sx \&%V
1655 child macros (at least one must be specified).
1656 .Pp
1657 Examples:
1658 .Bd -literal -offset indent -compact
1659 \&.Rs
1660 \&.%A J. E. Hopcroft
1661 \&.%A J. D. Ullman
1662 \&.%B Introduction to Automata Theory, Languages, and Computation
1663 \&.%I Addison-Wesley
1664 \&.%C Reading, Massachusettes
1665 \&.%D 1979
1666 \&.Re
1667 .Ed
1668 .Pp
1669 If an
1670 .Sx \&Rs
1671 block is used within a SEE ALSO section, a vertical space is asserted
1672 before the rendered output, else the block continues on the current
1673 line.
1674 .Ss \&Rv
1675 .Ss \&Sc
1676 .Ss \&Sh
1677 .Ss \&Sm
1678 .Ss \&So
1679 .Ss \&Sq
1680 .Ss \&Ss
1681 .Ss \&St
1682 .Ss \&Sx
1683 .Ss \&Sy
1684 .Ss \&Tn
1685 .Ss \&Ud
1686 .Ss \&Ux
1687 Format the UNIX name. Accepts no argument.
1688 .Pp
1689 Examples:
1690 .D1 \&.Ux
1691 .Pp
1692 See also
1693 .Sx \&At ,
1694 .Sx \&Bsx ,
1695 .Sx \&Bx ,
1696 .Sx \&Dx ,
1697 .Sx \&Fx ,
1698 .Sx \&Nx ,
1699 and
1700 .Sx \&Ox .
1701 .Ss \&Va
1702 .Ss \&Vt
1703 A variable type. This is also used for indicating global variables in the
1704 SYNOPSIS section, in which case a variable name is also specified. Note that
1705 it accepts
1706 .Sx Block partial-implicit
1707 syntax when invoked as the first macro in the SYNOPSIS section, else it
1708 accepts ordinary
1709 .Sx In-line
1710 syntax.
1711 .Pp
1712 Note that this should not be confused with
1713 .Sx \&Ft ,
1714 which is used for function return types.
1715 .Pp
1716 Examples:
1717 .D1 \&.Vt unsigned char
1718 .D1 \&.Vt extern const char * const sys_signame[] ;
1719 .Pp
1720 See also
1721 .Sx \&Ft
1722 and
1723 .Sx \&Va .
1724 .Ss \&Xc
1725 Close a scope opened by
1726 .Sx \&Xo .
1727 .Ss \&Xo
1728 Open an extension scope. This macro originally existed to extend the
1729 9-argument limit of troff; since this limit has been lifted, the macro
1730 has been deprecated.
1731 .Ss \&Xr
1732 Link to another manual
1733 .Pq Qq cross-reference .
1734 Its calling syntax is
1735 .Pp
1736 .D1 \. Ns Sx \&Xr Cm name section
1737 .Pp
1738 The
1739 .Cm name
1740 and
1741 .Cm section
1742 are the name and section of the linked manual. If
1743 .Cm section
1744 is followed by non-punctuation, an
1745 .Sx \&Ns
1746 is inserted into the token stream. This behaviour is for compatibility
1747 with
1748 .Xr groff 1 .
1749 .Pp
1750 Examples:
1751 .D1 \&.Xr mandoc 1
1752 .D1 \&.Xr mandoc 1 ;
1753 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1754 .Ss \&br
1755 .Ss \&sp
1756 .Sh COMPATIBILITY
1757 This section documents compatibility between mandoc and other other
1758 troff implementations, at this time limited to GNU troff
1759 .Pq Qq groff .
1760 The term
1761 .Qq historic groff
1762 refers to groff versions before the
1763 .Pa doc.tmac
1764 file re-write
1765 .Pq somewhere between 1.15 and 1.19 .
1766 .Pp
1767 Heirloom troff, the other significant troff implementation accepting
1768 \-mdoc, is similar to historic groff.
1769 .Pp
1770 .Bl -dash -compact
1771 .It
1772 The comment syntax
1773 .Sq \e."
1774 is no longer accepted.
1775 .It
1776 In groff, the
1777 .Sx \&Pa
1778 macro does not format its arguments when used in the FILES section under
1779 certain list types. mandoc does.
1780 .It
1781 Historic groff does not print a dash for empty
1782 .Sx \&Fl
1783 arguments. mandoc and newer groff implementations do.
1784 .It
1785 groff behaves irregularly when specifying
1786 .Sq \ef
1787 .Sx Text Decoration
1788 within line-macro scopes. mandoc follows a consistent system.
1789 .It
1790 In mandoc, negative scaling units are truncated to zero; groff would
1791 move to prior lines. Furthermore, the
1792 .Sq f
1793 scaling unit, while accepted, is rendered as the default unit.
1794 .It
1795 In quoted literals, groff allowed pair-wise double-quotes to produce a
1796 standalone double-quote in formatted output. This idiosyncratic
1797 behaviour is not applicable in mandoc.
1798 .It
1799 Display types
1800 .Sx \&Bd
1801 .Fl center
1802 and
1803 .Fl right
1804 are aliases for
1805 .Fl left
1806 in manodc. Furthermore, the
1807 .Fl file Ar file
1808 argument is ignored. Lastly, since text is not right-justified in
1809 mandoc (or even groff),
1810 .Fl ragged
1811 and
1812 .Fl filled
1813 are aliases, as are
1814 .Fl literal
1815 and
1816 .Fl unfilled .
1817 .It
1818 Historic groff has many un-callable macros. Most of these (excluding
1819 some block-level macros) are now callable.
1820 .It
1821 The vertical bar
1822 .Sq \(ba
1823 made historic groff
1824 .Qq go orbital
1825 but has been a proper delimiter since then.
1826 .It
1827 .Sx \&It Fl nested
1828 is assumed for all lists (it wasn't in historic groff): any list may be
1829 nested and
1830 .Fl enum
1831 lists will restart the sequence only for the sub-list.
1832 .It
1833 Some manuals use
1834 .Sx \&Li
1835 incorrectly by following it with a reserved character and expecting the
1836 delimiter to render. This is not supported in mandoc.
1837 .It
1838 In groff, the
1839 .Sx \&Fo
1840 macro only produces the first parameter. This is not the case in
1841 mandoc.
1842 .It
1843 In groff, the
1844 .Sx \&Cd ,
1845 .Sx \&Er ,
1846 and
1847 .Sx \&Ex
1848 macros were stipulated only to occur in certain manual sections. mandoc
1849 does not have these restrictions.
1850 .El
1851 .Sh SEE ALSO
1852 .Xr mandoc 1 ,
1853 .Xr mandoc_char 7
1854 .Sh AUTHORS
1855 The
1856 .Nm
1857 reference was written by
1858 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1859 .\"
1860 .\" XXX: this really isn't the place for these caveats.
1861 .\" .
1862 .\" .
1863 .\" .Sh CAVEATS
1864 .\" There are many ambiguous parts of mdoc.
1865 .\" .
1866 .\" .Pp
1867 .\" .Bl -dash -compact
1868 .\" .It
1869 .\" .Sq \&Fa
1870 .\" should be
1871 .\" .Sq \&Va
1872 .\" as function arguments are variables.
1873 .\" .It
1874 .\" .Sq \&Ft
1875 .\" should be
1876 .\" .Sq \&Vt
1877 .\" as function return types are still types. Furthermore, the
1878 .\" .Sq \&Ft
1879 .\" should be removed and
1880 .\" .Sq \&Fo ,
1881 .\" which ostensibly follows it, should follow the same convention as
1882 .\" .Sq \&Va .
1883 .\" .It
1884 .\" .Sq \&Va
1885 .\" should formalise that only one or two arguments are acceptable: a
1886 .\" variable name and optional, preceding type.
1887 .\" .It
1888 .\" .Sq \&Fd
1889 .\" is ambiguous. It's commonly used to indicate an include file in the
1890 .\" synopsis section.
1891 .\" .Sq \&In
1892 .\" should be used, instead.
1893 .\" .It
1894 .\" Only the
1895 .\" .Sq \-literal
1896 .\" argument to
1897 .\" .Sq \&Bd
1898 .\" makes sense. The remaining ones should be removed.
1899 .\" .It
1900 .\" The
1901 .\" .Sq \&Xo
1902 .\" and
1903 .\" .Sq \&Xc
1904 .\" macros should be deprecated.
1905 .\" .It
1906 .\" The
1907 .\" .Sq \&Dt
1908 .\" macro lacks clarity. It should be absolutely clear which title will
1909 .\" render when formatting the manual page.
1910 .\" .It
1911 .\" A
1912 .\" .Sq \&Lx
1913 .\" should be provided for Linux (\(`a la
1914 .\" .Sq \&Ox ,
1915 .\" .Sq \&Nx
1916 .\" etc.).
1917 .\" .It
1918 .\" There's no way to refer to references in
1919 .\" .Sq \&Rs/Re
1920 .\" blocks.
1921 .\" .It
1922 .\" The \-split and \-nosplit dictates via
1923 .\" .Sq \&An
1924 .\" are re-set when entering and leaving the AUTHORS section.
1925 .\" .El
1926 .\" .