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