mandoc: move to bin
[unleashed.git] / bin / mandoc / mdoc.5
blob643a2697812b7a57af53fa6c82e3179ef71a16df
1 .\"     $Id: mdoc.7,v 1.257 2015/11/05 12:06:45 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 .\"
19 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
20 .\" Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
21 .\"
22 .Dd $Mdocdate: November 5 2015 $
23 .Dt MDOC 5
24 .Os
25 .Sh NAME
26 .Nm mdoc
27 .Nd semantic markup language for formatting manual pages
28 .Sh DESCRIPTION
29 The
30 .Nm mdoc
31 language supports authoring of manual pages for the
32 .Xr man 1
33 utility by allowing semantic annotations of words, phrases,
34 page sections and complete manual pages.
35 Such annotations are used by formatting tools to achieve a uniform
36 presentation across all manuals written in
37 .Nm ,
38 and to support hyperlinking if supported by the output medium.
39 .Pp
40 This reference document describes the structure of manual pages
41 and the syntax and usage of the
42 .Nm
43 language.
44 The reference implementation of a parsing and formatting tool is
45 .Xr mandoc 1 ;
46 the
47 .Sx COMPATIBILITY
48 section describes compatibility with other implementations.
49 .Pp
50 In an
51 .Nm
52 document, lines beginning with the control character
53 .Sq \&.
54 are called
55 .Dq macro lines .
56 The first word is the macro name.
57 It consists of two or three letters.
58 Most macro names begin with a capital letter.
59 For a list of available macros, see
60 .Sx MACRO OVERVIEW .
61 The words following the macro name are arguments to the macro, optionally
62 including the names of other, callable macros; see
63 .Sx MACRO SYNTAX
64 for details.
65 .Pp
66 Lines not beginning with the control character are called
67 .Dq text lines .
68 They provide free-form text to be printed; the formatting of the text
69 depends on the respective processing context:
70 .Bd -literal -offset indent
71 \&.Sh Macro lines change control state.
72 Text lines are interpreted within the current state.
73 .Ed
74 .Pp
75 Many aspects of the basic syntax of the
76 .Nm
77 language are based on the
78 .Xr mandoc_roff 5
79 language; see the
80 .Em LANGUAGE SYNTAX
81 and
82 .Em MACRO SYNTAX
83 sections in the
84 .Xr mandoc_roff 5
85 manual for details, in particular regarding
86 comments, escape sequences, whitespace, and quoting.
87 However, using
88 .Xr mandoc_roff 5
89 requests in
90 .Nm
91 documents is discouraged;
92 .Xr mandoc 1
93 supports some of them merely for backward compatibility.
94 .Sh MANUAL STRUCTURE
95 A well-formed
96 .Nm
97 document consists of a document prologue followed by one or more
98 sections.
99 .Pp
100 The prologue, which consists of the
101 .Sx \&Dd ,
102 .Sx \&Dt ,
104 .Sx \&Os
105 macros in that order, is required for every document.
107 The first section (sections are denoted by
108 .Sx \&Sh )
109 must be the NAME section, consisting of at least one
110 .Sx \&Nm
111 followed by
112 .Sx \&Nd .
114 Following that, convention dictates specifying at least the
115 .Em SYNOPSIS
117 .Em DESCRIPTION
118 sections, although this varies between manual sections.
120 The following is a well-formed skeleton
122 file for a utility
123 .Qq progname :
124 .Bd -literal -offset indent
125 \&.Dd Jan 1, 1970
126 \&.Dt PROGNAME section
127 \&.Os
128 \&.Sh NAME
129 \&.Nm progname
130 \&.Nd one line about what it does
131 \&.\e\(dq .Sh LIBRARY
132 \&.\e\(dq For sections 2, 3, and 9 only.
133 \&.Sh SYNOPSIS
134 \&.Nm progname
135 \&.Op Fl options
136 \&.Ar
137 \&.Sh DESCRIPTION
139 \&.Nm
140 utility processes files ...
141 \&.\e\(dq .Sh IMPLEMENTATION NOTES
142 \&.\e\(dq .Sh RETURN VALUES
143 \&.\e\(dq For sections 2, 3, and 9 only.
144 \&.\e\(dq .Sh CONTEXT
145 \&.\e\(dq For section 9 functions only.
146 \&.\e\(dq .Sh ENVIRONMENT
147 \&.\e\(dq For sections 1, 1M, and 5.
148 \&.\e\(dq .Sh FILES
149 \&.\e\(dq .Sh EXIT STATUS
150 \&.\e\(dq For sections 1, 1M, and 5.
151 \&.\e\(dq .Sh EXAMPLES
152 \&.\e\(dq .Sh DIAGNOSTICS
153 \&.\e\(dq .Sh ERRORS
154 \&.\e\(dq For sections 2, 3, and 9 only.
155 \&.\e\(dq .Sh ARCHITECTURE
156 \&.\e\(dq .Sh CODE SET INDEPENDENCE
157 \&.\e\(dq For sections 1, 1M, and 3 only.
158 \&.\e\(dq .Sh INTERFACE STABILITY
159 \&.\e\(dq .Sh MT-LEVEL
160 \&.\e\(dq For sections 2 and 3 only.
161 \&.\e\(dq .Sh SECURITY
162 \&.\e\(dq .Sh SEE ALSO
163 \&.\e\(dq .Xr foobar 1
164 \&.\e\(dq .Sh STANDARDS
165 \&.\e\(dq .Sh HISTORY
166 \&.\e\(dq .Sh AUTHORS
167 \&.\e\(dq .Sh CAVEATS
168 \&.\e\(dq .Sh BUGS
171 The sections in an
173 document are conventionally ordered as they appear above.
174 Sections should be composed as follows:
175 .Bl -ohang -offset Ds
176 .It Em NAME
177 The name(s) and a one line description of the documented material.
178 The syntax for this as follows:
179 .Bd -literal -offset indent
180 \&.Nm name0 ,
181 \&.Nm name1 ,
182 \&.Nm name2
183 \&.Nd a one line description
186 Multiple
187 .Sq \&Nm
188 names should be separated by commas.
191 .Sx \&Nm
192 macro(s) must precede the
193 .Sx \&Nd
194 macro.
197 .Sx \&Nm
199 .Sx \&Nd .
200 .It Em LIBRARY
201 The name of the library containing the documented material, which is
202 assumed to be a function in a section 2, 3, or 9 manual.
203 The syntax for this is as follows:
204 .Bd -literal -offset indent
205 \&.Lb libarm
209 .Sx \&Lb .
210 .It Em SYNOPSIS
211 Documents the utility invocation syntax, function call syntax, or device
212 configuration.
214 For the first, utilities (sections 1 and 1M), this is
215 generally structured as follows:
216 .Bd -literal -offset indent
217 \&.Nm bar
218 \&.Op Fl v
219 \&.Op Fl o Ar file
220 \&.Op Ar
221 \&.Nm foo
222 \&.Op Fl v
223 \&.Op Fl o Ar file
224 \&.Op Ar
227 Commands should be ordered alphabetically.
229 For the second, function calls (sections 2, 3, 7I, 7P, 9):
230 .Bd -literal -offset indent
231 \&.In header.h
232 \&.Vt extern const char *global;
233 \&.Ft "char *"
234 \&.Fn foo "const char *src"
235 \&.Ft "char *"
236 \&.Fn bar "const char *src"
239 Ordering of
240 .Sx \&In ,
241 .Sx \&Vt ,
242 .Sx \&Fn ,
244 .Sx \&Fo
245 macros should follow C header-file conventions.
247 And for the third, configurations (section 7D):
248 .Bd -literal -offset indent
249 \&.Pa /dev/device_node
252 Manuals not in these sections generally don't need a
253 .Em SYNOPSIS .
255 Some macros are displayed differently in the
256 .Em SYNOPSIS
257 section, particularly
258 .Sx \&Nm ,
259 .Sx \&Cd ,
260 .Sx \&Fd ,
261 .Sx \&Fn ,
262 .Sx \&Fo ,
263 .Sx \&In ,
264 .Sx \&Vt ,
266 .Sx \&Ft .
267 All of these macros are output on their own line.
268 If two such dissimilar macros are pairwise invoked (except for
269 .Sx \&Ft
270 before
271 .Sx \&Fo
273 .Sx \&Fn ) ,
274 they are separated by a vertical space, unless in the case of
275 .Sx \&Fo ,
276 .Sx \&Fn ,
278 .Sx \&Ft ,
279 which are always separated by vertical space.
281 When text and macros following an
282 .Sx \&Nm
283 macro starting an input line span multiple output lines,
284 all output lines but the first will be indented to align
285 with the text immediately following the
286 .Sx \&Nm
287 macro, up to the next
288 .Sx \&Nm ,
289 .Sx \&Sh ,
291 .Sx \&Ss
292 macro or the end of an enclosing block, whichever comes first.
293 .It Em DESCRIPTION
294 This begins with an expansion of the brief, one line description in
295 .Em NAME :
296 .Bd -literal -offset indent
298 \&.Nm
299 utility does this, that, and the other.
302 It usually follows with a breakdown of the options (if documenting a
303 command), such as:
304 .Bd -literal -offset indent
305 The arguments are as follows:
306 \&.Bl \-tag \-width Ds
307 \&.It Fl v
308 Print verbose information.
309 \&.El
312 List the options in alphabetical order,
313 uppercase before lowercase for each letter and
314 with no regard to whether an option takes an argument.
315 Put digits in ascending order before all letter options.
317 Manuals not documenting a command won't include the above fragment.
319 Since the
320 .Em DESCRIPTION
321 section usually contains most of the text of a manual, longer manuals
322 often use the
323 .Sx \&Ss
324 macro to form subsections.
325 In very long manuals, the
326 .Em DESCRIPTION
327 may be split into multiple sections, each started by an
328 .Sx \&Sh
329 macro followed by a non-standard section name, and each having
330 several subsections, like in the present
332 manual.
333 .It Em IMPLEMENTATION NOTES
334 Implementation-specific notes should be kept here.
335 This is useful when implementing standard functions that may have side
336 effects or notable algorithmic implications.
337 .It Em RETURN VALUES
338 This section documents the
339 return values of functions in sections 2, 3, and 9.
342 .Sx \&Rv .
343 .It Em CONTEXT
344 This section lists the contexts in which functions can be called in section 9.
345 The contexts are user, kernel, or interrupt.
346 .It Em ENVIRONMENT
347 Lists the environment variables used by the utility,
348 and explains the syntax and semantics of their values.
350 .Xr environ 5
351 manual provides examples of typical content and formatting.
354 .Sx \&Ev .
355 .It Em FILES
356 Documents files used.
357 It's helpful to document both the file name and a short description of how
358 the file is used (created, modified, etc.).
361 .Sx \&Pa .
362 .It Em EXIT STATUS
363 This section documents the
364 command exit status for sections 1 and 1M.
365 Historically, this information was described in
366 .Em DIAGNOSTICS ,
367 a practise that is now discouraged.
370 .Sx \&Ex .
371 .It Em EXAMPLES
372 Example usages.
373 This often contains snippets of well-formed, well-tested invocations.
374 Make sure that examples work properly!
375 .It Em DIAGNOSTICS
376 Documents error and diagnostic messages displayed to the user or
377 sent to logs. Note that exit
378 status and return values should be documented in the
379 .Em EXIT STATUS
381 .Em RETURN VALUES
382 sections.
385 .Sx \&Bl
386 .Fl diag .
387 .It Em ERRORS
388 Documents error handling in sections 2, 3, and 9.
391 .Sx \&Er .
392 .It Em ARCHITECTURE
393 This section is usually absent, but will be present when the
394 interface is specific to one or more architectures.
395 .It Em CODE SET INDEPENDENCE
396 Indicates whether the interface operates correctly with various different
397 code sets.  True independent code sets will support not only ASCII and
398 Extended UNIX Codesets (EUC), but also other multi-byte encodings such as
399 UTF-8 and GB2312.
401 Generally there will be some limitations that are fairly standard.  See
402 .Xr standards 5 for more information about some of these.  Most interfaces
403 should support at least UTF-8 in addition to ASCII.
404 .It Em INTERFACE STABILITY
405 Indicates the level of commitment to the interface. Interfaces can be described
406 with in the following ways:
407 .Bl -tag -width Ds
408 .It Nm Standard
409 Indicates that the interface is defined by one or more standards bodies.
410 Generally, changes to the interface will be carefully managed to conform
411 to the relevant standards.  These interfaces are generally the most suitable
412 for use in portable programs.
413 .It Nm Committed
414 Indicates that the interface is intended to be preserved for the long-haul, and
415 will rarely, if ever change, and never without notification (barring
416 extraordinary and extenuating circumstances). These interfaces are
417 preferred over other interfaces with the exeception of
418 .Nm Standard
419 interfaces.
420 .It Nm Uncommitted
421 Indicates that the interface may change.  Generally, changes to these interfaces
422 should be infrequent, and some effort will be made to address compatibility
423 considerations when changing or removing such interfaces.  However, there is
424 no firm commitment to the preservation of the interface.  Most often this
425 is applied to interfaces where operational experience with the interface
426 is still limited and some need to change may be anticipated.
428 Consumers should expect to revalidate any
429 .Nm Uncommitted
430 interfaces when crossing release boundaries.  Products intended for
431 use on many releases or intended to support compatibility with future
432 releases should avoid these interfaces.
433 .It Nm Volatile
434 The interface can change at any time for any reason. Often this relates to
435 interfaces that are part of external software components that are still evolving
436 rapidly.  Consumers should not expect that the interface (either binary or
437 source level) will be unchanged from one release to the next.
438 .It Nm Not-an-Interface
439 Describes something that is specifically not intended for programmatic
440 consumption.  For example, specific human-readable output, or the layout
441 of graphical items on a user interface, may be described this way.  Generally
442 programmatic alternatives to these will be available, and should be used
443 when programmatic consumption is needed.
444 .It Nm Private
445 This is an internal interface.  Generally these interfaces should only be
446 used within the project, and should not be used by other programs or modules.
447 The interface can and will change without notice as the project needs, at
448 any time.
450 Most often, Private interfaces will lack any documentation whatsoever, and
451 generally any undocumented interface can be assumed to be Private.
452 .It Nm Obsolete
453 The interface is not intended for use in new projects or programs, and may
454 be removed at a future date.  The
455 .Nm Obsolete
456 word is a modifier that can
457 be applied to other commitment levels. For example an
458 .Nm Obsolete Committed
459 interface is unlikely to be removed or changed, but nonetheless new use
460 is discouraged (perhaps a better newer alternative is present).
462 .It Em MT-LEVEL
463 This section describes considerations for the interface when used within
464 programs that use multiple threads.  More discussion of these considerations
465 is made in the MT-Level section of
466 .Xr attributes 5 .
467 The interface can be described in the following ways.
468 .Bl -tag -width Ds
469 .It Nm Safe
470 Indicates the interface is safe for use within multiple threads.  There
471 may be additional caveats that apply, in which case those will be
472 described.  Note that some interfaces have semantics which may affect
473 other threads, but these should be an intrinsic part of the interface
474 rather than an unexpected side effect.  For example, closing a file in
475 one thread will cause that file to be closed in all threads.
476 .It Nm Unsafe
477 Indicates the interface is unsuitable for concurrent use within multiple
478 threads.  A threaded application may still make use of the interface, but
479 will be required to provide external synchronization means to ensure that
480 only a single thread calls the interface at a time.
481 .It Nm MT-Safe
482 Indicates that the interface is not only safe for concurrent use, but is
483 designed for such use.  For example, a
484 .Nm Safe
485 interface may make use of a global lock to provide safety, but at reduced
486 internal concurrency, whereas an
487 .Nm MT-Safe
488 interface will be designed to be efficient even when used concurrently.
489 .It Nm Async-Signal-Safe
490 Indicates that the library is safe for use within a signal handler.  An
491 .Nm MT-Safe
492 interface can be made
493 .Nm Async-Signal-Safe
494 by ensuring that it blocks signals when acquiring locks.
495 .It Nm Safe with Exceptions
496 As for
497 .Nm Safe
498 but with specific exceptions noted.
499 .It Nm MT-Safe with Exceptions
500 As for
501 .Nm MT-Safe
502 but with specific exceptions noted.
504 .It Em SECURITY
505 Documents any security precautions that operators should consider.
506 .It Em SEE ALSO
507 References other manuals with related topics.
508 This section should exist for most manuals.
509 Cross-references should conventionally be ordered first by section, then
510 alphabetically (ignoring case).
512 References to other documentation concerning the topic of the manual page,
513 for example authoritative books or journal articles, may also be
514 provided in this section.
517 .Sx \&Rs
519 .Sx \&Xr .
520 .It Em STANDARDS
521 References any standards implemented or used.
522 If not adhering to any standards, the
523 .Em HISTORY
524 section should be used instead.
527 .Sx \&St .
528 .It Em HISTORY
529 A brief history of the subject, including where it was first implemented,
530 and when it was ported to or reimplemented for the operating system at hand.
531 .It Em AUTHORS
532 Credits to the person or persons who wrote the code and/or documentation.
533 Authors should generally be noted by both name and email address.
536 .Sx \&An .
537 .It Em CAVEATS
538 Common misuses and misunderstandings should be explained
539 in this section.
540 .It Em BUGS
541 Known bugs, limitations, and work-arounds should be described
542 in this section.
544 .Sh MACRO OVERVIEW
545 This overview is sorted such that macros of similar purpose are listed
546 together, to help find the best macro for any given purpose.
547 Deprecated macros are not included in the overview, but can be found below
548 in the alphabetical
549 .Sx MACRO REFERENCE .
550 .Ss Document preamble and NAME section macros
551 .Bl -column "Brq, Bro, Brc" description
552 .It Sx \&Dd Ta document date: Ar month day , year
553 .It Sx \&Dt Ta document title: Ar TITLE SECTION Op Ar arch
554 .It Sx \&Os Ta operating system version: Op Ar system Op Ar version
555 .It Sx \&Nm Ta document name (one argument)
556 .It Sx \&Nd Ta document description (one line)
558 .Ss Sections and cross references
559 .Bl -column "Brq, Bro, Brc" description
560 .It Sx \&Sh Ta section header (one line)
561 .It Sx \&Ss Ta subsection header (one line)
562 .It Sx \&Sx Ta internal cross reference to a section or subsection
563 .It Sx \&Xr Ta cross reference to another manual page: Ar name section
564 .It Sx \&Pp , \&Lp Ta start a text paragraph (no arguments)
566 .Ss Displays and lists
567 .Bl -column "Brq, Bro, Brc" description
568 .It Sx \&Bd , \&Ed Ta display block:
569 .Fl Ar type
570 .Op Fl offset Ar width
571 .Op Fl compact
572 .It Sx \&D1 Ta indented display (one line)
573 .It Sx \&Dl Ta indented literal display (one line)
574 .It Sx \&Ql Ta in-line literal display: Ql text
575 .It Sx \&Bl , \&El Ta list block:
576 .Fl Ar type
577 .Op Fl width Ar val
578 .Op Fl offset Ar val
579 .Op Fl compact
580 .It Sx \&It Ta list item (syntax depends on Fl Ar type )
581 .It Sx \&Ta Ta table cell separator in Sx \&Bl Fl column No lists
582 .It Sx \&Rs , \&%* , \&Re Ta bibliographic block (references)
584 .Ss Spacing control
585 .Bl -column "Brq, Bro, Brc" description
586 .It Sx \&Pf Ta prefix, no following horizontal space (one argument)
587 .It Sx \&Ns Ta roman font, no preceding horizontal space (no arguments)
588 .It Sx \&Ap Ta apostrophe without surrounding whitespace (no arguments)
589 .It Sx \&Sm Ta switch horizontal spacing mode: Op Cm on | off
590 .It Sx \&Bk , \&Ek Ta keep block: Fl words
591 .It Sx \&br Ta force output line break in text mode (no arguments)
592 .It Sx \&sp Ta force vertical space: Op Ar height
594 .Ss Semantic markup for command line utilities:
595 .Bl -column "Brq, Bro, Brc" description
596 .It Sx \&Nm Ta start a SYNOPSIS block with the name of a utility
597 .It Sx \&Fl Ta command line options (flags) (>=0 arguments)
598 .It Sx \&Cm Ta command modifier (>0 arguments)
599 .It Sx \&Ar Ta command arguments (>=0 arguments)
600 .It Sx \&Op , \&Oo , \&Oc Ta optional syntax elements (enclosure)
601 .It Sx \&Ic Ta internal or interactive command (>0 arguments)
602 .It Sx \&Ev Ta environmental variable (>0 arguments)
603 .It Sx \&Pa Ta file system path (>=0 arguments)
605 .Ss Semantic markup for function libraries:
606 .Bl -column "Brq, Bro, Brc" description
607 .It Sx \&Lb Ta function library (one argument)
608 .It Sx \&In Ta include file (one argument)
609 .It Sx \&Fd Ta other preprocessor directive (>0 arguments)
610 .It Sx \&Ft Ta function type (>0 arguments)
611 .It Sx \&Fo , \&Fc Ta function block: Ar funcname
612 .It Sx \&Fn Ta function name:
613 .Op Ar functype
614 .Ar funcname
616 .Op Ar argtype
617 .Ar argname
619 .It Sx \&Fa Ta function argument (>0 arguments)
620 .It Sx \&Vt Ta variable type (>0 arguments)
621 .It Sx \&Va Ta variable name (>0 arguments)
622 .It Sx \&Dv Ta defined variable or preprocessor constant (>0 arguments)
623 .It Sx \&Er Ta error constant (>0 arguments)
624 .It Sx \&Ev Ta environmental variable (>0 arguments)
626 .Ss Various semantic markup:
627 .Bl -column "Brq, Bro, Brc" description
628 .It Sx \&An Ta author name (>0 arguments)
629 .It Sx \&Lk Ta hyperlink: Ar uri Op Ar name
630 .It Sx \&Mt Ta Do mailto Dc hyperlink: Ar address
631 .It Sx \&Cd Ta kernel configuration declaration (>0 arguments)
632 .It Sx \&Ad Ta memory address (>0 arguments)
633 .It Sx \&Ms Ta mathematical symbol (>0 arguments)
635 .Ss Physical markup
636 .Bl -column "Brq, Bro, Brc" description
637 .It Sx \&Em Ta italic font or underline (emphasis) (>0 arguments)
638 .It Sx \&Sy Ta boldface font (symbolic) (>0 arguments)
639 .It Sx \&Li Ta typewriter font (literal) (>0 arguments)
640 .It Sx \&No Ta return to roman font (normal) (no arguments)
641 .It Sx \&Bf , \&Ef Ta font block:
642 .Op Fl Ar type | Cm \&Em | \&Li | \&Sy
644 .Ss Physical enclosures
645 .Bl -column "Brq, Bro, Brc" description
646 .It Sx \&Dq , \&Do , \&Dc Ta enclose in typographic double quotes: Dq text
647 .It Sx \&Qq , \&Qo , \&Qc Ta enclose in typewriter double quotes: Qq text
648 .It Sx \&Sq , \&So , \&Sc Ta enclose in single quotes: Sq text
649 .It Sx \&Pq , \&Po , \&Pc Ta enclose in parentheses: Pq text
650 .It Sx \&Bq , \&Bo , \&Bc Ta enclose in square brackets: Bq text
651 .It Sx \&Brq , \&Bro , \&Brc Ta enclose in curly braces: Brq text
652 .It Sx \&Aq , \&Ao , \&Ac Ta enclose in angle brackets: Aq text
653 .It Sx \&Eo , \&Ec Ta generic enclosure
655 .Ss Text production
656 .Bl -column "Brq, Bro, Brc" description
657 .It Sx \&Ex Fl std Ta standard command exit values: Op Ar utility ...
658 .It Sx \&Rv Fl std Ta standard function return values: Op Ar function ...
659 .It Sx \&St Ta reference to a standards document (one argument)
660 .It Sx \&At Ta At
661 .It Sx \&Bx Ta Bx
662 .It Sx \&Bsx Ta Bsx
663 .It Sx \&Nx Ta Nx
664 .It Sx \&Fx Ta Fx
665 .It Sx \&Ox Ta Ox
666 .It Sx \&Dx Ta Dx
668 .Sh MACRO REFERENCE
669 This section is a canonical reference of all macros, arranged
670 alphabetically.
671 For the scoping of individual macros, see
672 .Sx MACRO SYNTAX .
673 .Ss \&%A
674 Author name of an
675 .Sx \&Rs
676 block.
677 Multiple authors should each be accorded their own
678 .Sx \%%A
679 line.
680 Author names should be ordered with full or abbreviated forename(s)
681 first, then full surname.
682 .Ss \&%B
683 Book title of an
684 .Sx \&Rs
685 block.
686 This macro may also be used in a non-bibliographic context when
687 referring to book titles.
688 .Ss \&%C
689 Publication city or location of an
690 .Sx \&Rs
691 block.
692 .Ss \&%D
693 Publication date of an
694 .Sx \&Rs
695 block.
696 Recommended formats of arguments are
697 .Ar month day , year
698 or just
699 .Ar year .
700 .Ss \&%I
701 Publisher or issuer name of an
702 .Sx \&Rs
703 block.
704 .Ss \&%J
705 Journal name of an
706 .Sx \&Rs
707 block.
708 .Ss \&%N
709 Issue number (usually for journals) of an
710 .Sx \&Rs
711 block.
712 .Ss \&%O
713 Optional information of an
714 .Sx \&Rs
715 block.
716 .Ss \&%P
717 Book or journal page number of an
718 .Sx \&Rs
719 block.
720 .Ss \&%Q
721 Institutional author (school, government, etc.) of an
722 .Sx \&Rs
723 block.
724 Multiple institutional authors should each be accorded their own
725 .Sx \&%Q
726 line.
727 .Ss \&%R
728 Technical report name of an
729 .Sx \&Rs
730 block.
731 .Ss \&%T
732 Article title of an
733 .Sx \&Rs
734 block.
735 This macro may also be used in a non-bibliographical context when
736 referring to article titles.
737 .Ss \&%U
738 URI of reference document.
739 .Ss \&%V
740 Volume number of an
741 .Sx \&Rs
742 block.
743 .Ss \&Ac
744 Close an
745 .Sx \&Ao
746 block.
747 Does not have any tail arguments.
748 .Ss \&Ad
749 Memory address.
750 Do not use this for postal addresses.
752 Examples:
753 .Dl \&.Ad [0,$]
754 .Dl \&.Ad 0x00000000
755 .Ss \&An
756 Author name.
757 Can be used both for the authors of the program, function, or driver
758 documented in the manual, or for the authors of the manual itself.
759 Requires either the name of an author or one of the following arguments:
761 .Bl -tag -width "-nosplitX" -offset indent -compact
762 .It Fl split
763 Start a new output line before each subsequent invocation of
764 .Sx \&An .
765 .It Fl nosplit
766 The opposite of
767 .Fl split .
770 The default is
771 .Fl nosplit .
772 The effect of selecting either of the
773 .Fl split
774 modes ends at the beginning of the
775 .Em AUTHORS
776 section.
777 In the
778 .Em AUTHORS
779 section, the default is
780 .Fl nosplit
781 for the first author listing and
782 .Fl split
783 for all other author listings.
785 Examples:
786 .Dl \&.An -nosplit
787 .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv
788 .Ss \&Ao
789 Begin a block enclosed by angle brackets.
790 Does not have any head arguments.
792 Examples:
793 .Dl \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
795 See also
796 .Sx \&Aq .
797 .Ss \&Ap
798 Inserts an apostrophe without any surrounding whitespace.
799 This is generally used as a grammatical device when referring to the verb
800 form of a function.
802 Examples:
803 .Dl \&.Fn execve \&Ap d
804 .Ss \&Aq
805 Encloses its arguments in angle brackets.
807 Examples:
808 .Dl \&.Fl -key= \&Ns \&Aq \&Ar val
810 .Em Remarks :
811 this macro is often abused for rendering URIs, which should instead use
812 .Sx \&Lk
814 .Sx \&Mt ,
815 or to note pre-processor
816 .Dq Li #include
817 statements, which should use
818 .Sx \&In .
820 See also
821 .Sx \&Ao .
822 .Ss \&Ar
823 Command arguments.
824 If an argument is not provided, the string
825 .Dq file ...\&
826 is used as a default.
828 Examples:
829 .Dl ".Fl o Ar file"
830 .Dl ".Ar"
831 .Dl ".Ar arg1 , arg2 ."
833 The arguments to the
834 .Sx \&Ar
835 macro are names and placeholders for command arguments;
836 for fixed strings to be passed verbatim as arguments, use
837 .Sx \&Fl
839 .Sx \&Cm .
840 .Ss \&At
841 Formats an
843 version.
844 Accepts one optional argument:
846 .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact
847 .It Cm v[1-7] | 32v
848 A version of
849 .At .
850 .It Cm III
851 .At III .
852 .It Cm V[.[1-4]]?
853 A version of
854 .At V .
857 Note that these arguments do not begin with a hyphen.
859 Examples:
860 .Dl \&.At
861 .Dl \&.At III
862 .Dl \&.At V.1
864 See also
865 .Sx \&Bsx ,
866 .Sx \&Bx ,
867 .Sx \&Dx ,
868 .Sx \&Fx ,
869 .Sx \&Nx ,
871 .Sx \&Ox .
872 .Ss \&Bc
873 Close a
874 .Sx \&Bo
875 block.
876 Does not have any tail arguments.
877 .Ss \&Bd
878 Begin a display block.
879 Its syntax is as follows:
880 .Bd -ragged -offset indent
881 .Pf \. Sx \&Bd
882 .Fl Ns Ar type
883 .Op Fl offset Ar width
884 .Op Fl compact
887 Display blocks are used to select a different indentation and
888 justification than the one used by the surrounding text.
889 They may contain both macro lines and text lines.
890 By default, a display block is preceded by a vertical space.
893 .Ar type
894 must be one of the following:
895 .Bl -tag -width 13n -offset indent
896 .It Fl centered
897 Produce one output line from each input line, and center-justify each line.
898 Using this display type is not recommended; many
900 implementations render it poorly.
901 .It Fl filled
902 Change the positions of line breaks to fill each line, and left- and
903 right-justify the resulting block.
904 .It Fl literal
905 Produce one output line from each input line,
906 and do not justify the block at all.
907 Preserve white space as it appears in the input.
908 Always use a constant-width font.
909 Use this for displaying source code.
910 .It Fl ragged
911 Change the positions of line breaks to fill each line, and left-justify
912 the resulting block.
913 .It Fl unfilled
914 The same as
915 .Fl literal ,
916 but using the same font as for normal text, which is a variable width font
917 if supported by the output device.
921 .Ar type
922 must be provided first.
923 Additional arguments may follow:
924 .Bl -tag -width 13n -offset indent
925 .It Fl offset Ar width
926 Indent the display by the
927 .Ar width ,
928 which may be one of the following:
929 .Bl -item
931 One of the pre-defined strings
932 .Cm indent ,
933 the width of a standard indentation (six constant width characters);
934 .Cm indent-two ,
935 twice
936 .Cm indent ;
937 .Cm left ,
938 which has no effect;
939 .Cm right ,
940 which justifies to the right margin; or
941 .Cm center ,
942 which aligns around an imagined center axis.
944 A macro invocation, which selects a predefined width
945 associated with that macro.
946 The most popular is the imaginary macro
947 .Ar \&Ds ,
948 which resolves to
949 .Sy 6n .
951 A scaling width as described in
952 .Xr mandoc_roff 5 .
954 An arbitrary string, which indents by the length of this string.
957 When the argument is missing,
958 .Fl offset
959 is ignored.
960 .It Fl compact
961 Do not assert vertical space before the display.
964 Examples:
965 .Bd -literal -offset indent
966 \&.Bd \-literal \-offset indent \-compact
967    Hello       world.
968 \&.Ed
971 See also
972 .Sx \&D1
974 .Sx \&Dl .
975 .Ss \&Bf
976 Change the font mode for a scoped block of text.
977 Its syntax is as follows:
978 .Bd -ragged -offset indent
979 .Pf \. Sx \&Bf
981 .Fl emphasis | literal | symbolic |
982 .Cm \&Em | \&Li | \&Sy
987 .Fl emphasis
989 .Cm \&Em
990 argument are equivalent, as are
991 .Fl symbolic
993 .Cm \&Sy ,
995 .Fl literal
997 .Cm \&Li .
998 Without an argument, this macro does nothing.
999 The font mode continues until broken by a new font mode in a nested
1000 scope or
1001 .Sx \&Ef
1002 is encountered.
1004 See also
1005 .Sx \&Li ,
1006 .Sx \&Ef ,
1007 .Sx \&Em ,
1009 .Sx \&Sy .
1010 .Ss \&Bk
1011 For each macro, keep its output together on the same output line,
1012 until the end of the macro or the end of the input line is reached,
1013 whichever comes first.
1014 Line breaks in text lines are unaffected.
1015 The syntax is as follows:
1017 .D1 Pf \. Sx \&Bk Fl words
1020 .Fl words
1021 argument is required; additional arguments are ignored.
1023 The following example will not break within each
1024 .Sx \&Op
1025 macro line:
1026 .Bd -literal -offset indent
1027 \&.Bk \-words
1028 \&.Op Fl f Ar flags
1029 \&.Op Fl o Ar output
1030 \&.Ek
1033 Be careful in using over-long lines within a keep block!
1034 Doing so will clobber the right margin.
1035 .Ss \&Bl
1036 Begin a list.
1037 Lists consist of items specified using the
1038 .Sx \&It
1039 macro, containing a head or a body or both.
1040 The list syntax is as follows:
1041 .Bd -ragged -offset indent
1042 .Pf \. Sx \&Bl
1043 .Fl Ns Ar type
1044 .Op Fl width Ar val
1045 .Op Fl offset Ar val
1046 .Op Fl compact
1047 .Op HEAD ...
1050 The list
1051 .Ar type
1052 is mandatory and must be specified first.
1054 .Fl width
1056 .Fl offset
1057 arguments accept macro names as described for
1058 .Sx \&Bd
1059 .Fl offset ,
1060 scaling widths as described in
1061 .Xr mandoc_roff 5 ,
1062 or use the length of the given string.
1064 .Fl offset
1065 is a global indentation for the whole list, affecting both item heads
1066 and bodies.
1067 For those list types supporting it, the
1068 .Fl width
1069 argument requests an additional indentation of item bodies,
1070 to be added to the
1071 .Fl offset .
1072 Unless the
1073 .Fl compact
1074 argument is specified, list entries are separated by vertical space.
1076 A list must specify one of the following list types:
1077 .Bl -tag -width 12n -offset indent
1078 .It Fl bullet
1079 No item heads can be specified, but a bullet will be printed at the head
1080 of each item.
1081 Item bodies start on the same output line as the bullet
1082 and are indented according to the
1083 .Fl width
1084 argument.
1085 .It Fl column
1086 A columnated list.
1088 .Fl width
1089 argument has no effect; instead, each argument specifies the width
1090 of one column, using either the scaling width syntax described in
1091 .Xr mandoc_roff 5
1092 or the string length of the argument.
1093 If the first line of the body of a
1094 .Fl column
1095 list is not an
1096 .Sx \&It
1097 macro line,
1098 .Sx \&It
1099 contexts spanning one input line each are implied until an
1100 .Sx \&It
1101 macro line is encountered, at which point items start being interpreted as
1102 described in the
1103 .Sx \&It
1104 documentation.
1105 .It Fl dash
1106 Like
1107 .Fl bullet ,
1108 except that dashes are used in place of bullets.
1109 .It Fl diag
1110 Like
1111 .Fl inset ,
1112 except that item heads are not parsed for macro invocations.
1113 Most often used in the
1114 .Em DIAGNOSTICS
1115 section with error constants in the item heads.
1116 .It Fl enum
1117 A numbered list.
1118 No item heads can be specified.
1119 Formatted like
1120 .Fl bullet ,
1121 except that cardinal numbers are used in place of bullets,
1122 starting at 1.
1123 .It Fl hang
1124 Like
1125 .Fl tag ,
1126 except that the first lines of item bodies are not indented, but follow
1127 the item heads like in
1128 .Fl inset
1129 lists.
1130 .It Fl hyphen
1131 Synonym for
1132 .Fl dash .
1133 .It Fl inset
1134 Item bodies follow items heads on the same line, using normal inter-word
1135 spacing.
1136 Bodies are not indented, and the
1137 .Fl width
1138 argument is ignored.
1139 .It Fl item
1140 No item heads can be specified, and none are printed.
1141 Bodies are not indented, and the
1142 .Fl width
1143 argument is ignored.
1144 .It Fl ohang
1145 Item bodies start on the line following item heads and are not indented.
1147 .Fl width
1148 argument is ignored.
1149 .It Fl tag
1150 Item bodies are indented according to the
1151 .Fl width
1152 argument.
1153 When an item head fits inside the indentation, the item body follows
1154 this head on the same output line.
1155 Otherwise, the body starts on the output line following the head.
1158 Lists may be nested within lists and displays.
1159 Nesting of
1160 .Fl column
1162 .Fl enum
1163 lists may not be portable.
1165 See also
1166 .Sx \&El
1168 .Sx \&It .
1169 .Ss \&Bo
1170 Begin a block enclosed by square brackets.
1171 Does not have any head arguments.
1173 Examples:
1174 .Bd -literal -offset indent -compact
1175 \&.Bo 1 ,
1176 \&.Dv BUFSIZ \&Bc
1179 See also
1180 .Sx \&Bq .
1181 .Ss \&Bq
1182 Encloses its arguments in square brackets.
1184 Examples:
1185 .Dl \&.Bq 1 , \&Dv BUFSIZ
1187 .Em Remarks :
1188 this macro is sometimes abused to emulate optional arguments for
1189 commands; the correct macros to use for this purpose are
1190 .Sx \&Op ,
1191 .Sx \&Oo ,
1193 .Sx \&Oc .
1195 See also
1196 .Sx \&Bo .
1197 .Ss \&Brc
1198 Close a
1199 .Sx \&Bro
1200 block.
1201 Does not have any tail arguments.
1202 .Ss \&Bro
1203 Begin a block enclosed by curly braces.
1204 Does not have any head arguments.
1206 Examples:
1207 .Bd -literal -offset indent -compact
1208 \&.Bro 1 , ... ,
1209 \&.Va n \&Brc
1212 See also
1213 .Sx \&Brq .
1214 .Ss \&Brq
1215 Encloses its arguments in curly braces.
1217 Examples:
1218 .Dl \&.Brq 1 , ... , \&Va n
1220 See also
1221 .Sx \&Bro .
1222 .Ss \&Bsx
1223 Format the
1224 .Bsx
1225 version provided as an argument, or a default value if
1226 no argument is provided.
1228 Examples:
1229 .Dl \&.Bsx 1.0
1230 .Dl \&.Bsx
1232 See also
1233 .Sx \&At ,
1234 .Sx \&Bx ,
1235 .Sx \&Dx ,
1236 .Sx \&Fx ,
1237 .Sx \&Nx ,
1239 .Sx \&Ox .
1240 .Ss \&Bt
1241 Supported only for compatibility, do not use this in new manuals.
1242 Prints
1243 .Dq is currently in beta test.
1244 .Ss \&Bx
1245 Format the
1247 version provided as an argument, or a default value if no
1248 argument is provided.
1250 Examples:
1251 .Dl \&.Bx 4.3 Tahoe
1252 .Dl \&.Bx 4.4
1253 .Dl \&.Bx
1255 See also
1256 .Sx \&At ,
1257 .Sx \&Bsx ,
1258 .Sx \&Dx ,
1259 .Sx \&Fx ,
1260 .Sx \&Nx ,
1262 .Sx \&Ox .
1263 .Ss \&Cd
1264 Kernel configuration declaration.  It is found in pages for
1266 and not used here.
1268 Examples:
1269 .Dl \&.Cd device le0 at scode?
1271 .Em Remarks :
1272 this macro is commonly abused by using quoted literals to retain
1273 whitespace and align consecutive
1274 .Sx \&Cd
1275 declarations.
1276 This practise is discouraged.
1277 .Ss \&Cm
1278 Command modifiers.
1279 Typically used for fixed strings passed as arguments, unless
1280 .Sx \&Fl
1281 is more appropriate.
1282 Also useful when specifying configuration options or keys.
1284 Examples:
1285 .Dl ".Nm mt Fl f Ar device Cm rewind"
1286 .Dl ".Nm ps Fl o Cm pid , Ns Cm command"
1287 .Dl ".Nm dd Cm if= Ns Ar file1 Cm of= Ns Ar file2"
1288 .Dl ".Cm IdentityFile Pa ~/.ssh/id_rsa"
1289 .Dl ".Cm LogLevel Dv DEBUG"
1290 .Ss \&D1
1291 One-line indented display.
1292 This is formatted by the default rules and is useful for simple indented
1293 statements.
1294 It is followed by a newline.
1296 Examples:
1297 .Dl \&.D1 \&Fl abcdefgh
1299 See also
1300 .Sx \&Bd
1302 .Sx \&Dl .
1303 .Ss \&Db
1304 This macro is obsolete.
1305 No replacement is needed.
1306 It is ignored by
1307 .Xr mandoc 1
1308 and groff including its arguments.
1309 It was formerly used to toggle a debugging mode.
1310 .Ss \&Dc
1311 Close a
1312 .Sx \&Do
1313 block.
1314 Does not have any tail arguments.
1315 .Ss \&Dd
1316 Document date for display in the page footer.
1317 This is the mandatory first macro of any
1319 manual.
1320 Its syntax is as follows:
1322 .D1 Pf \. Sx \&Dd Ar month day , year
1325 .Ar month
1326 is the full English month name, the
1327 .Ar day
1328 is an optionally zero-padded numeral, and the
1329 .Ar year
1330 is the full four-digit year.
1332 Other arguments are not portable; the
1333 .Xr mandoc 1
1334 utility handles them as follows:
1335 .Bl -dash -offset 3n -compact
1337 To have the date automatically filled in by the
1339 version of
1340 .Xr cvs 1 ,
1341 the special string
1342 .Dq $\&Mdocdate$
1343 can be given as an argument.
1345 The traditional, purely numeric
1346 .Xr man 5
1347 format
1348 .Ar year Ns \(en Ns Ar month Ns \(en Ns Ar day
1349 is accepted, too.
1351 If a date string cannot be parsed, it is used verbatim.
1353 If no date string is given, the current date is used.
1356 Examples:
1357 .Dl \&.Dd $\&Mdocdate$
1358 .Dl \&.Dd $\&Mdocdate: July 21 2007$
1359 .Dl \&.Dd July 21, 2007
1361 See also
1362 .Sx \&Dt
1364 .Sx \&Os .
1365 .Ss \&Dl
1366 One-line indented display.
1367 This is formatted as literal text and is useful for commands and
1368 invocations.
1369 It is followed by a newline.
1371 Examples:
1372 .Dl \&.Dl % mandoc mdoc.5 \e(ba less
1374 See also
1375 .Sx \&Ql ,
1376 .Sx \&Bd
1377 .Fl literal ,
1379 .Sx \&D1 .
1380 .Ss \&Do
1381 Begin a block enclosed by double quotes.
1382 Does not have any head arguments.
1384 Examples:
1385 .Bd -literal -offset indent -compact
1386 \&.Do
1387 April is the cruellest month
1388 \&.Dc
1389 \e(em T.S. Eliot
1392 See also
1393 .Sx \&Dq .
1394 .Ss \&Dq
1395 Encloses its arguments in
1396 .Dq typographic
1397 double-quotes.
1399 Examples:
1400 .Bd -literal -offset indent -compact
1401 \&.Dq April is the cruellest month
1402 \e(em T.S. Eliot
1405 See also
1406 .Sx \&Qq ,
1407 .Sx \&Sq ,
1409 .Sx \&Do .
1410 .Ss \&Dt
1411 Document title for display in the page header.
1412 This is the mandatory second macro of any
1414 file.
1415 Its syntax is as follows:
1416 .Bd -ragged -offset indent
1417 .Pf \. Sx \&Dt
1418 .Ar TITLE
1419 .Ar section
1420 .Op Ar arch
1423 Its arguments are as follows:
1424 .Bl -tag -width section -offset 2n
1425 .It Ar TITLE
1426 The document's title (name), defaulting to
1427 .Dq UNTITLED
1428 if unspecified.
1429 To achieve a uniform appearance of page header lines,
1430 it should by convention be all caps.
1431 .It Ar SECTION
1432 The manual section.
1433 It should correspond to the manual's filename suffix and defaults to
1434 the empty string if unspecified.
1435 This field is optional.
1436 To achieve a uniform appearance of page header lines,
1437 it should by convention be all caps.
1438 .It Ar arch
1439 This specifies the machine architecture a manual page applies to,
1440 where relevant.
1442 .Ss \&Dv
1443 Defined variables such as preprocessor constants, constant symbols,
1444 enumeration values, and so on.
1446 Examples:
1447 .Dl \&.Dv NULL
1448 .Dl \&.Dv BUFSIZ
1449 .Dl \&.Dv STDOUT_FILENO
1451 See also
1452 .Sx \&Er
1454 .Sx \&Ev
1455 for special-purpose constants,
1456 .Sx \&Va
1457 for variable symbols, and
1458 .Sx \&Fd
1459 for listing preprocessor variable definitions in the
1460 .Em SYNOPSIS .
1461 .Ss \&Dx
1462 Format the
1464 version provided as an argument, or a default
1465 value if no argument is provided.
1467 Examples:
1468 .Dl \&.Dx 2.4.1
1469 .Dl \&.Dx
1471 See also
1472 .Sx \&At ,
1473 .Sx \&Bsx ,
1474 .Sx \&Bx ,
1475 .Sx \&Fx ,
1476 .Sx \&Nx ,
1478 .Sx \&Ox .
1479 .Ss \&Ec
1480 Close a scope started by
1481 .Sx \&Eo .
1482 Its syntax is as follows:
1484 .D1 Pf \. Sx \&Ec Op Ar TERM
1487 .Ar TERM
1488 argument is used as the enclosure tail, for example, specifying \e(rq
1489 will emulate
1490 .Sx \&Dc .
1491 .Ss \&Ed
1492 End a display context started by
1493 .Sx \&Bd .
1494 .Ss \&Ef
1495 End a font mode context started by
1496 .Sx \&Bf .
1497 .Ss \&Ek
1498 End a keep context started by
1499 .Sx \&Bk .
1500 .Ss \&El
1501 End a list context started by
1502 .Sx \&Bl .
1504 See also
1505 .Sx \&Bl
1507 .Sx \&It .
1508 .Ss \&Em
1509 Request an italic font.
1510 If the output device does not provide that, underline.
1512 This is most often used for stress emphasis (not to be confused with
1513 importance, see
1514 .Sx \&Sy ) .
1515 In the rare cases where none of the semantic markup macros fit,
1516 it can also be used for technical terms and placeholders, except
1517 that for syntax elements,
1518 .Sx \&Sy
1520 .Sx \&Ar
1521 are preferred, respectively.
1523 Examples:
1524 .Bd -literal -compact -offset indent
1525 Selected lines are those
1526 \&.Em not
1527 matching any of the specified patterns.
1528 Some of the functions use a
1529 \&.Em hold space
1530 to save the pattern space for subsequent retrieval.
1533 See also
1534 .Sx \&Bf ,
1535 .Sx \&Li ,
1536 .Sx \&No ,
1538 .Sx \&Sy .
1539 .Ss \&En
1540 This macro is obsolete.
1542 .Sx \&Eo
1543 or any of the other enclosure macros.
1545 It encloses its argument in the delimiters specified by the last
1546 .Sx \&Es
1547 macro.
1548 .Ss \&Eo
1549 An arbitrary enclosure.
1550 Its syntax is as follows:
1552 .D1 Pf \. Sx \&Eo Op Ar TERM
1555 .Ar TERM
1556 argument is used as the enclosure head, for example, specifying \e(lq
1557 will emulate
1558 .Sx \&Do .
1559 .Ss \&Er
1560 Error constants for definitions of the
1561 .Va errno
1562 libc global variable.
1563 This is most often used in section 2 and 3 manual pages.
1565 Examples:
1566 .Dl \&.Er EPERM
1567 .Dl \&.Er ENOENT
1569 See also
1570 .Sx \&Dv
1571 for general constants.
1572 .Ss \&Es
1573 This macro is obsolete.
1575 .Sx \&Eo
1576 or any of the other enclosure macros.
1578 It takes two arguments, defining the delimiters to be used by subsequent
1579 .Sx \&En
1580 macros.
1581 .Ss \&Ev
1582 Environmental variables such as those specified in
1583 .Xr environ 5 .
1585 Examples:
1586 .Dl \&.Ev DISPLAY
1587 .Dl \&.Ev PATH
1589 See also
1590 .Sx \&Dv
1591 for general constants.
1592 .Ss \&Ex
1593 Insert a standard sentence regarding command exit values of 0 on success
1594 and >0 on failure.
1595 This is most often used in section 1 and 1M manual pages.
1596 Its syntax is as follows:
1598 .D1 Pf \. Sx \&Ex Fl std Op Ar utility ...
1601 .Ar utility
1602 is not specified, the document's name set by
1603 .Sx \&Nm
1604 is used.
1605 Multiple
1606 .Ar utility
1607 arguments are treated as separate utilities.
1609 See also
1610 .Sx \&Rv .
1611 .Ss \&Fa
1612 Function argument or parameter.
1613 Its syntax is as follows:
1614 .Bd -ragged -offset indent
1615 .Pf \. Sx \&Fa
1617 .Op Ar argtype
1618 .Op Ar argname
1619 .Qc Ar \&...
1622 Each argument may be a name and a type (recommended for the
1623 .Em SYNOPSIS
1624 section), a name alone (for function invocations),
1625 or a type alone (for function prototypes).
1626 If both a type and a name are given or if the type consists of multiple
1627 words, all words belonging to the same function argument have to be
1628 given in a single argument to the
1629 .Sx \&Fa
1630 macro.
1632 This macro is also used to specify the field name of a structure.
1634 Most often, the
1635 .Sx \&Fa
1636 macro is used in the
1637 .Em SYNOPSIS
1638 within
1639 .Sx \&Fo
1640 blocks when documenting multi-line function prototypes.
1641 If invoked with multiple arguments, the arguments are separated by a
1642 comma.
1643 Furthermore, if the following macro is another
1644 .Sx \&Fa ,
1645 the last argument will also have a trailing comma.
1647 Examples:
1648 .Dl \&.Fa \(dqconst char *p\(dq
1649 .Dl \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1650 .Dl \&.Fa \(dqchar *\(dq size_t
1652 See also
1653 .Sx \&Fo .
1654 .Ss \&Fc
1655 End a function context started by
1656 .Sx \&Fo .
1657 .Ss \&Fd
1658 Preprocessor directive, in particular for listing it in the
1659 .Em SYNOPSIS .
1660 Historically, it was also used to document include files.
1661 The latter usage has been deprecated in favour of
1662 .Sx \&In .
1664 Its syntax is as follows:
1665 .Bd -ragged -offset indent
1666 .Pf \. Sx \&Fd
1667 .Li # Ns Ar directive
1668 .Op Ar argument ...
1671 Examples:
1672 .Dl \&.Fd #define sa_handler __sigaction_u.__sa_handler
1673 .Dl \&.Fd #define SIO_MAXNFDS
1674 .Dl \&.Fd #ifdef FS_DEBUG
1675 .Dl \&.Ft void
1676 .Dl \&.Fn dbg_open \(dqconst char *\(dq
1677 .Dl \&.Fd #endif
1679 See also
1680 .Sx MANUAL STRUCTURE ,
1681 .Sx \&In ,
1683 .Sx \&Dv .
1684 .Ss \&Fl
1685 Command-line flag or option.
1686 Used when listing arguments to command-line utilities.
1687 Prints a fixed-width hyphen
1688 .Sq \-
1689 directly followed by each argument.
1690 If no arguments are provided, a hyphen is printed followed by a space.
1691 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1692 output.
1694 Examples:
1695 .Dl ".Fl R Op Fl H | L | P"
1696 .Dl ".Op Fl 1AaCcdFfgHhikLlmnopqRrSsTtux"
1697 .Dl ".Fl type Cm d Fl name Pa CVS"
1698 .Dl ".Fl Ar signal_number"
1699 .Dl ".Fl o Fl"
1701 See also
1702 .Sx \&Cm .
1703 .Ss \&Fn
1704 A function name.
1705 Its syntax is as follows:
1706 .Bd -ragged -offset indent
1707 .Pf . Sx \&Fn
1708 .Op Ar functype
1709 .Ar funcname
1710 .Op Oo Ar argtype Oc Ar argname
1713 Function arguments are surrounded in parenthesis and
1714 are delimited by commas.
1715 If no arguments are specified, blank parenthesis are output.
1716 In the
1717 .Em SYNOPSIS
1718 section, this macro starts a new output line,
1719 and a blank line is automatically inserted between function definitions.
1721 Examples:
1722 .Dl \&.Fn \(dqint funcname\(dq \(dqint arg0\(dq \(dqint arg1\(dq
1723 .Dl \&.Fn funcname \(dqint arg0\(dq
1724 .Dl \&.Fn funcname arg0
1726 .Bd -literal -offset indent -compact
1727 \&.Ft functype
1728 \&.Fn funcname
1731 When referring to a function documented in another manual page, use
1732 .Sx \&Xr
1733 instead.
1734 See also
1735 .Sx MANUAL STRUCTURE ,
1736 .Sx \&Fo ,
1738 .Sx \&Ft .
1739 .Ss \&Fo
1740 Begin a function block.
1741 This is a multi-line version of
1742 .Sx \&Fn .
1743 Its syntax is as follows:
1745 .D1 Pf \. Sx \&Fo Ar funcname
1747 Invocations usually occur in the following context:
1748 .Bd -ragged -offset indent
1749 .Pf \. Sx \&Ft Ar functype
1751 .Pf \. Sx \&Fo Ar funcname
1753 .Pf \. Sx \&Fa Qq Ar argtype Ar argname
1755 \&.\.\.
1757 .Pf \. Sx \&Fc
1761 .Sx \&Fo
1762 scope is closed by
1763 .Sx \&Fc .
1765 See also
1766 .Sx MANUAL STRUCTURE ,
1767 .Sx \&Fa ,
1768 .Sx \&Fc ,
1770 .Sx \&Ft .
1771 .Ss \&Fr
1772 This macro is obsolete.
1773 No replacement markup is needed.
1775 It was used to show numerical function return values in an italic font.
1776 .Ss \&Ft
1777 A function type.
1778 Its syntax is as follows:
1780 .D1 Pf \. Sx \&Ft Ar functype
1782 In the
1783 .Em SYNOPSIS
1784 section, a new output line is started after this macro.
1786 Examples:
1787 .Dl \&.Ft int
1788 .Bd -literal -offset indent -compact
1789 \&.Ft functype
1790 \&.Fn funcname
1793 See also
1794 .Sx MANUAL STRUCTURE ,
1795 .Sx \&Fn ,
1797 .Sx \&Fo .
1798 .Ss \&Fx
1799 Format the
1801 version provided as an argument, or a default value
1802 if no argument is provided.
1804 Examples:
1805 .Dl \&.Fx 7.1
1806 .Dl \&.Fx
1808 See also
1809 .Sx \&At ,
1810 .Sx \&Bsx ,
1811 .Sx \&Bx ,
1812 .Sx \&Dx ,
1813 .Sx \&Nx ,
1815 .Sx \&Ox .
1816 .Ss \&Hf
1817 This macro is not implemented in
1818 .Xr mandoc 1 .
1820 It was used to include the contents of a (header) file literally.
1821 The syntax was:
1823 .Dl Pf . Sx \&Hf Ar filename
1824 .Ss \&Ic
1825 Designate an internal or interactive command.
1826 This is similar to
1827 .Sx \&Cm
1828 but used for instructions rather than values.
1830 Examples:
1831 .Dl \&.Ic :wq
1832 .Dl \&.Ic hash
1833 .Dl \&.Ic alias
1835 Note that using
1836 .Sx \&Bd Fl literal
1838 .Sx \&D1
1839 is preferred for displaying code; the
1840 .Sx \&Ic
1841 macro is used when referring to specific instructions.
1842 .Ss \&In
1843 The name of an include file.
1844 This macro is most often used in section 2, 3, and 9 manual pages.
1846 When invoked as the first macro on an input line in the
1847 .Em SYNOPSIS
1848 section, the argument is displayed in angle brackets
1849 and preceded by
1850 .Qq #include ,
1851 and a blank line is inserted in front if there is a preceding
1852 function declaration.
1853 In other sections, it only encloses its argument in angle brackets
1854 and causes no line break.
1856 Examples:
1857 .Dl \&.In sys/types.h
1859 See also
1860 .Sx MANUAL STRUCTURE .
1861 .Ss \&It
1862 A list item.
1863 The syntax of this macro depends on the list type.
1865 Lists
1866 of type
1867 .Fl hang ,
1868 .Fl ohang ,
1869 .Fl inset ,
1871 .Fl diag
1872 have the following syntax:
1874 .D1 Pf \. Sx \&It Ar args
1876 Lists of type
1877 .Fl bullet ,
1878 .Fl dash ,
1879 .Fl enum ,
1880 .Fl hyphen
1882 .Fl item
1883 have the following syntax:
1885 .D1 Pf \. Sx \&It
1887 with subsequent lines interpreted within the scope of the
1888 .Sx \&It
1889 until either a closing
1890 .Sx \&El
1891 or another
1892 .Sx \&It .
1895 .Fl tag
1896 list has the following syntax:
1898 .D1 Pf \. Sx \&It Op Cm args
1900 Subsequent lines are interpreted as with
1901 .Fl bullet
1902 and family.
1903 The line arguments correspond to the list's left-hand side; body
1904 arguments correspond to the list's contents.
1907 .Fl column
1908 list is the most complicated.
1909 Its syntax is as follows:
1911 .D1 Pf \. Sx \&It Ar cell Op <TAB> Ar cell ...
1912 .D1 Pf \. Sx \&It Ar cell Op Sx \&Ta Ar cell ...
1914 The arguments consist of one or more lines of text and macros
1915 representing a complete table line.
1916 Cells within the line are delimited by tabs or by the special
1917 .Sx \&Ta
1918 block macro.
1919 The tab cell delimiter may only be used within the
1920 .Sx \&It
1921 line itself; on following lines, only the
1922 .Sx \&Ta
1923 macro can be used to delimit cells, and
1924 .Sx \&Ta
1925 is only recognised as a macro when called by other macros,
1926 not as the first macro on a line.
1928 Note that quoted strings may span tab-delimited cells on an
1929 .Sx \&It
1930 line.
1931 For example,
1933 .Dl .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1935 will preserve the semicolon whitespace except for the last.
1937 See also
1938 .Sx \&Bl .
1939 .Ss \&Lb
1940 Specify a library.
1941 The syntax is as follows:
1943 .D1 Pf \. Sx \&Lb Ar library
1946 .Ar library
1947 parameter may be a system library, such as
1948 .Cm libz
1950 .Cm libpam ,
1951 in which case a small library description is printed next to the linker
1952 invocation; or a custom library, in which case the library name is
1953 printed in quotes.
1954 This is most commonly used in the
1955 .Em SYNOPSIS
1956 section as described in
1957 .Sx MANUAL STRUCTURE .
1959 Examples:
1960 .Dl \&.Lb libz
1961 .Dl \&.Lb mdoc
1962 .Ss \&Li
1963 Denotes text that should be in a
1964 .Li literal
1965 font mode.
1966 Note that this is a presentation term and should not be used for
1967 stylistically decorating technical terms.
1969 On terminal output devices, this is often indistinguishable from
1970 normal text.
1972 See also
1973 .Sx \&Bf ,
1974 .Sx \&Em ,
1975 .Sx \&No ,
1977 .Sx \&Sy .
1978 .Ss \&Lk
1979 Format a hyperlink.
1980 Its syntax is as follows:
1982 .D1 Pf \. Sx \&Lk Ar uri Op Ar name
1984 Examples:
1985 .Dl \&.Lk http://bsd.lv \(dqThe BSD.lv Project\(dq
1986 .Dl \&.Lk http://bsd.lv
1988 See also
1989 .Sx \&Mt .
1990 .Ss \&Lp
1991 Synonym for
1992 .Sx \&Pp .
1993 .Ss \&Ms
1994 Display a mathematical symbol.
1995 Its syntax is as follows:
1997 .D1 Pf \. Sx \&Ms Ar symbol
1999 Examples:
2000 .Dl \&.Ms sigma
2001 .Dl \&.Ms aleph
2002 .Ss \&Mt
2003 Format a
2004 .Dq mailto:
2005 hyperlink.
2006 Its syntax is as follows:
2008 .D1 Pf \. Sx \&Mt Ar address
2010 Examples:
2011 .Dl \&.Mt discuss@manpages.bsd.lv
2012 .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv
2013 .Ss \&Nd
2014 A one line description of the manual's content.
2015 This is the mandatory last macro of the
2016 .Em NAME
2017 section and not appropriate for other sections.
2019 Examples:
2020 .Dl Pf . Sx \&Nd mdoc language reference
2021 .Dl Pf . Sx \&Nd format and display UNIX manuals
2024 .Sx \&Nd
2025 macro technically accepts child macros and terminates with a subsequent
2026 .Sx \&Sh
2027 invocation.
2028 Do not assume this behaviour: some
2029 .Xr whatis 1
2030 database generators are not smart enough to parse more than the line
2031 arguments and will display macros verbatim.
2033 See also
2034 .Sx \&Nm .
2035 .Ss \&Nm
2036 The name of the manual page, or \(em in particular in section 1
2037 pages \(em of an additional command or feature documented in
2038 the manual page.
2039 When first invoked, the
2040 .Sx \&Nm
2041 macro expects a single argument, the name of the manual page.
2042 Usually, the first invocation happens in the
2043 .Em NAME
2044 section of the page.
2045 The specified name will be remembered and used whenever the macro is
2046 called again without arguments later in the page.
2048 .Sx \&Nm
2049 macro uses
2050 .Sx Block full-implicit
2051 semantics when invoked as the first macro on an input line in the
2052 .Em SYNOPSIS
2053 section; otherwise, it uses ordinary
2054 .Sx In-line
2055 semantics.
2057 Examples:
2058 .Bd -literal -offset indent
2059 \&.Sh SYNOPSIS
2060 \&.Nm cat
2061 \&.Op Fl benstuv
2062 \&.Op Ar
2065 In the
2066 .Em SYNOPSIS
2067 of section 2, 3 and 9 manual pages, use the
2068 .Sx \&Fn
2069 macro rather than
2070 .Sx \&Nm
2071 to mark up the name of the manual page.
2072 .Ss \&No
2073 Normal text.
2074 Closes the scope of any preceding in-line macro.
2075 When used after physical formatting macros like
2076 .Sx \&Em
2078 .Sx \&Sy ,
2079 switches back to the standard font face and weight.
2080 Can also be used to embed plain text strings in macro lines
2081 using semantic annotation macros.
2083 Examples:
2084 .Dl ".Em italic , Sy bold , No and roman"
2086 .Bd -literal -offset indent -compact
2087 \&.Sm off
2088 \&.Cm :C No / Ar pattern No / Ar replacement No /
2089 \&.Sm on
2092 See also
2093 .Sx \&Em ,
2094 .Sx \&Li ,
2096 .Sx \&Sy .
2097 .Ss \&Ns
2098 Suppress a space between the output of the preceding macro
2099 and the following text or macro.
2100 Following invocation, input is interpreted as normal text
2101 just like after an
2102 .Sx \&No
2103 macro.
2105 This has no effect when invoked at the start of a macro line.
2107 Examples:
2108 .Dl ".Ar name Ns = Ns Ar value"
2109 .Dl ".Cm :M Ns Ar pattern"
2110 .Dl ".Fl o Ns Ar output"
2112 See also
2113 .Sx \&No
2115 .Sx \&Sm .
2116 .Ss \&Nx
2117 Format the
2119 version provided as an argument, or a default value if
2120 no argument is provided.
2122 Examples:
2123 .Dl \&.Nx 5.01
2124 .Dl \&.Nx
2126 See also
2127 .Sx \&At ,
2128 .Sx \&Bsx ,
2129 .Sx \&Bx ,
2130 .Sx \&Dx ,
2131 .Sx \&Fx ,
2133 .Sx \&Ox .
2134 .Ss \&Oc
2135 Close multi-line
2136 .Sx \&Oo
2137 context.
2138 .Ss \&Oo
2139 Multi-line version of
2140 .Sx \&Op .
2142 Examples:
2143 .Bd -literal -offset indent -compact
2144 \&.Oo
2145 \&.Op Fl flag Ns Ar value
2146 \&.Oc
2148 .Ss \&Op
2149 Optional part of a command line.
2150 Prints the argument(s) in brackets.
2151 This is most often used in the
2152 .Em SYNOPSIS
2153 section of section 1 and 1M manual pages.
2155 Examples:
2156 .Dl \&.Op \&Fl a \&Ar b
2157 .Dl \&.Op \&Ar a | b
2159 See also
2160 .Sx \&Oo .
2161 .Ss \&Os
2162 Operating system version for display in the page footer.
2163 This is the mandatory third macro of
2166 file.
2167 Its syntax is as follows:
2169 .D1 Pf \. Sx \&Os Op Ar system Op Ar version
2171 The optional
2172 .Ar system
2173 parameter specifies the relevant operating system or environment.
2174 It is suggested to leave it unspecified, in which case
2175 .Xr mandoc 1
2176 uses its
2177 .Fl Ios
2178 argument or, if that isn't specified either,
2179 .Fa sysname
2181 .Fa release
2182 as returned by
2183 .Xr uname 3 .
2185 Examples:
2186 .Dl \&.Os
2187 .Dl \&.Os KTH/CSC/TCS
2188 .Dl \&.Os BSD 4.3
2190 See also
2191 .Sx \&Dd
2193 .Sx \&Dt .
2194 .Ss \&Ot
2195 This macro is obsolete.
2197 .Sx \&Ft
2198 instead; with
2199 .Xr mandoc 1 ,
2200 both have the same effect.
2202 Historical
2204 packages described it as
2205 .Dq "old function type (FORTRAN)" .
2206 .Ss \&Ox
2207 Format the
2209 version provided as an argument, or a default value
2210 if no argument is provided.
2212 Examples:
2213 .Dl \&.Ox 4.5
2214 .Dl \&.Ox
2216 See also
2217 .Sx \&At ,
2218 .Sx \&Bsx ,
2219 .Sx \&Bx ,
2220 .Sx \&Dx ,
2221 .Sx \&Fx ,
2223 .Sx \&Nx .
2224 .Ss \&Pa
2225 An absolute or relative file system path, or a file or directory name.
2226 If an argument is not provided, the character
2227 .Sq \(ti
2228 is used as a default.
2230 Examples:
2231 .Dl \&.Pa /usr/bin/mandoc
2232 .Dl \&.Pa /usr/share/man/man5/mdoc.5
2234 See also
2235 .Sx \&Lk .
2236 .Ss \&Pc
2237 Close parenthesised context opened by
2238 .Sx \&Po .
2239 .Ss \&Pf
2240 Removes the space between its argument and the following macro.
2241 Its syntax is as follows:
2243 .D1 .Pf Ar prefix macro arguments ...
2245 This is equivalent to:
2247 .D1 .No \e& Ns Ar prefix No \&Ns Ar macro arguments ...
2250 .Ar prefix
2251 argument is not parsed for macro names or delimiters,
2252 but used verbatim as if it were escaped.
2254 Examples:
2255 .Dl ".Pf $ Ar variable_name"
2256 .Dl ".Pf . Ar macro_name"
2257 .Dl ".Pf 0x Ar hex_digits"
2259 See also
2260 .Sx \&Ns
2262 .Sx \&Sm .
2263 .Ss \&Po
2264 Multi-line version of
2265 .Sx \&Pq .
2266 .Ss \&Pp
2267 Break a paragraph.
2268 This will assert vertical space between prior and subsequent macros
2269 and/or text.
2271 Paragraph breaks are not needed before or after
2272 .Sx \&Sh
2274 .Sx \&Ss
2275 macros or before displays
2276 .Pq Sx \&Bd
2277 or lists
2278 .Pq Sx \&Bl
2279 unless the
2280 .Fl compact
2281 flag is given.
2282 .Ss \&Pq
2283 Parenthesised enclosure.
2285 See also
2286 .Sx \&Po .
2287 .Ss \&Qc
2288 Close quoted context opened by
2289 .Sx \&Qo .
2290 .Ss \&Ql
2291 In-line literal display.
2292 This can for example be used for complete command invocations and
2293 for multi-word code fragments when more specific markup is not
2294 appropriate and an indented display is not desired.
2295 While
2296 .Xr mandoc 1
2297 always encloses the arguments in single quotes, other formatters
2298 usually omit the quotes on non-terminal output devices when the
2299 arguments have three or more characters.
2301 See also
2302 .Sx \&Dl
2304 .Sx \&Bd
2305 .Fl literal .
2306 .Ss \&Qo
2307 Multi-line version of
2308 .Sx \&Qq .
2309 .Ss \&Qq
2310 Encloses its arguments in
2311 .Qq typewriter
2312 double-quotes.
2313 Consider using
2314 .Sx \&Dq .
2316 See also
2317 .Sx \&Dq ,
2318 .Sx \&Sq ,
2320 .Sx \&Qo .
2321 .Ss \&Re
2322 Close an
2323 .Sx \&Rs
2324 block.
2325 Does not have any tail arguments.
2326 .Ss \&Rs
2327 Begin a bibliographic
2328 .Pq Dq reference
2329 block.
2330 Does not have any head arguments.
2331 The block macro may only contain
2332 .Sx \&%A ,
2333 .Sx \&%B ,
2334 .Sx \&%C ,
2335 .Sx \&%D ,
2336 .Sx \&%I ,
2337 .Sx \&%J ,
2338 .Sx \&%N ,
2339 .Sx \&%O ,
2340 .Sx \&%P ,
2341 .Sx \&%Q ,
2342 .Sx \&%R ,
2343 .Sx \&%T ,
2344 .Sx \&%U ,
2346 .Sx \&%V
2347 child macros (at least one must be specified).
2349 Examples:
2350 .Bd -literal -offset indent -compact
2351 \&.Rs
2352 \&.%A J. E. Hopcroft
2353 \&.%A J. D. Ullman
2354 \&.%B Introduction to Automata Theory, Languages, and Computation
2355 \&.%I Addison-Wesley
2356 \&.%C Reading, Massachusetts
2357 \&.%D 1979
2358 \&.Re
2361 If an
2362 .Sx \&Rs
2363 block is used within a SEE ALSO section, a vertical space is asserted
2364 before the rendered output, else the block continues on the current
2365 line.
2366 .Ss \&Rv
2367 Insert a standard sentence regarding a function call's return value of 0
2368 on success and \-1 on error, with the
2369 .Va errno
2370 libc global variable set on error.
2371 Its syntax is as follows:
2373 .D1 Pf \. Sx \&Rv Fl std Op Ar function ...
2376 .Ar function
2377 is not specified, the document's name set by
2378 .Sx \&Nm
2379 is used.
2380 Multiple
2381 .Ar function
2382 arguments are treated as separate functions.
2384 See also
2385 .Sx \&Ex .
2386 .Ss \&Sc
2387 Close single-quoted context opened by
2388 .Sx \&So .
2389 .Ss \&Sh
2390 Begin a new section.
2391 For a list of conventional manual sections, see
2392 .Sx MANUAL STRUCTURE .
2393 These sections should be used unless it's absolutely necessary that
2394 custom sections be used.
2396 Section names should be unique so that they may be keyed by
2397 .Sx \&Sx .
2398 Although this macro is parsed, it should not consist of child node or it
2399 may not be linked with
2400 .Sx \&Sx .
2402 See also
2403 .Sx \&Pp ,
2404 .Sx \&Ss ,
2406 .Sx \&Sx .
2407 .Ss \&Sm
2408 Switches the spacing mode for output generated from macros.
2409 Its syntax is as follows:
2411 .D1 Pf \. Sx \&Sm Op Cm on | off
2413 By default, spacing is
2414 .Cm on .
2415 When switched
2416 .Cm off ,
2417 no white space is inserted between macro arguments and between the
2418 output generated from adjacent macros, but text lines
2419 still get normal spacing between words and sentences.
2421 When called without an argument, the
2422 .Sx \&Sm
2423 macro toggles the spacing mode.
2424 Using this is not recommended because it makes the code harder to read.
2425 .Ss \&So
2426 Multi-line version of
2427 .Sx \&Sq .
2428 .Ss \&Sq
2429 Encloses its arguments in
2430 .Sq typewriter
2431 single-quotes.
2433 See also
2434 .Sx \&Dq ,
2435 .Sx \&Qq ,
2437 .Sx \&So .
2438 .Ss \&Ss
2439 Begin a new subsection.
2440 Unlike with
2441 .Sx \&Sh ,
2442 there is no convention for the naming of subsections.
2443 Except
2444 .Em DESCRIPTION ,
2445 the conventional sections described in
2446 .Sx MANUAL STRUCTURE
2447 rarely have subsections.
2449 Sub-section names should be unique so that they may be keyed by
2450 .Sx \&Sx .
2451 Although this macro is parsed, it should not consist of child node or it
2452 may not be linked with
2453 .Sx \&Sx .
2455 See also
2456 .Sx \&Pp ,
2457 .Sx \&Sh ,
2459 .Sx \&Sx .
2460 .Ss \&St
2461 Replace an abbreviation for a standard with the full form.
2462 The following standards are recognised.
2463 Where multiple lines are given without a blank line in between,
2464 they all refer to the same standard, and using the first form
2465 is recommended.
2466 .Bl -tag -width 1n
2467 .It C language standards
2469 .Bl -tag -width "-p1003.1g-2000" -compact
2470 .It \-ansiC
2471 .St -ansiC
2472 .It \-ansiC-89
2473 .St -ansiC-89
2474 .It \-isoC
2475 .St -isoC
2476 .It \-isoC-90
2477 .St -isoC-90
2479 The original C standard.
2481 .It \-isoC-amd1
2482 .St -isoC-amd1
2484 .It \-isoC-tcor1
2485 .St -isoC-tcor1
2487 .It \-isoC-tcor2
2488 .St -isoC-tcor2
2490 .It \-isoC-99
2491 .St -isoC-99
2493 The second major version of the C language standard.
2495 .It \-isoC-2011
2496 .St -isoC-2011
2498 The third major version of the C language standard.
2500 .It POSIX.1 before the Single UNIX Specification
2502 .Bl -tag -width "-p1003.1g-2000" -compact
2503 .It \-p1003.1-88
2504 .St -p1003.1-88
2505 .It \-p1003.1
2506 .St -p1003.1
2508 The original POSIX standard, based on ANSI C.
2510 .It \-p1003.1-90
2511 .St -p1003.1-90
2512 .It \-iso9945-1-90
2513 .St -iso9945-1-90
2515 The first update of POSIX.1.
2517 .It \-p1003.1b-93
2518 .St -p1003.1b-93
2519 .It \-p1003.1b
2520 .St -p1003.1b
2522 Real-time extensions.
2524 .It \-p1003.1c-95
2525 .St -p1003.1c-95
2527 POSIX thread interfaces.
2529 .It \-p1003.1i-95
2530 .St -p1003.1i-95
2532 Technical Corrigendum.
2534 .It \-p1003.1-96
2535 .St -p1003.1-96
2536 .It \-iso9945-1-96
2537 .St -iso9945-1-96
2539 Includes POSIX.1-1990, 1b, 1c, and 1i.
2541 .It X/Open Portability Guide version 4 and related standards
2543 .Bl -tag -width "-p1003.1g-2000" -compact
2544 .It \-xpg3
2545 .St -xpg3
2547 An XPG4 precursor, published in 1989.
2549 .It \-p1003.2
2550 .St -p1003.2
2551 .It \-p1003.2-92
2552 .St -p1003.2-92
2553 .It \-iso9945-2-93
2554 .St -iso9945-2-93
2556 An XCU4 precursor.
2558 .It \-p1003.2a-92
2559 .St -p1003.2a-92
2561 Updates to POSIX.2.
2563 .It \-xpg4
2564 .St -xpg4
2566 Based on POSIX.1 and POSIX.2, published in 1992.
2568 .It Single UNIX Specification version 1 and related standards
2570 .Bl -tag -width "-p1003.1g-2000" -compact
2571 .It \-susv1
2572 .St -susv1
2573 .It \-xpg4.2
2574 .St -xpg4.2
2576 This standard was published in 1994.
2577 It was used as the basis for UNIX 95 certification.
2578 The following three refer to parts of it.
2580 .It \-xsh4.2
2581 .St -xsh4.2
2583 .It \-xcurses4.2
2584 .St -xcurses4.2
2586 .It \-p1003.1g-2000
2587 .St -p1003.1g-2000
2589 Networking APIs, including sockets.
2591 .It \-svid4
2592 .St -svid4 ,
2594 Published in 1995.
2596 .It Single UNIX Specification version 2 and related standards
2598 .Bl -tag -width "-p1003.1g-2000" -compact
2599 .It \-susv2
2600 .St -susv2
2601 This Standard was published in 1997
2602 and is also called X/Open Portability Guide version 5.
2603 It was used as the basis for UNIX 98 certification.
2604 The following refer to parts of it.
2606 .It \-xbd5
2607 .St -xbd5
2609 .It \-xsh5
2610 .St -xsh5
2612 .It \-xcu5
2613 .St -xcu5
2615 .It \-xns5
2616 .St -xns5
2617 .It \-xns5.2
2618 .St -xns5.2
2620 .It Single UNIX Specification version 3
2622 .Bl -tag -width "-p1003.1-2001" -compact
2623 .It \-p1003.1-2001
2624 .St -p1003.1-2001
2625 .It \-susv3
2626 .St -susv3
2628 This standard is based on C99, SUSv2, POSIX.1-1996, 1d, and 1j.
2629 It is also called X/Open Portability Guide version 6.
2630 It is used as the basis for UNIX 03 certification.
2632 .It \-p1003.1-2004
2633 .St -p1003.1-2004
2635 The second and last Technical Corrigendum.
2637 .It Single UNIX Specification version 4
2639 .Bl -tag -width "-p1003.1g-2000" -compact
2640 .It \-p1003.1-2008
2641 .St -p1003.1-2008
2642 .It \-susv4
2643 .St -susv4
2645 This standard is also called
2646 X/Open Portability Guide version 7.
2648 .It \-p1003.1-2013
2649 .St -p1003.1-2013
2651 This is the first Technical Corrigendum.
2653 .It Other standards
2655 .Bl -tag -width "-p1003.1g-2000" -compact
2656 .It \-ieee754
2657 .St -ieee754
2659 Floating-point arithmetic.
2661 .It \-iso8601
2662 .St -iso8601
2664 Representation of dates and times, published in 1988.
2666 .It \-iso8802-3
2667 .St -iso8802-3
2669 Ethernet local area networks.
2671 .It \-ieee1275-94
2672 .St -ieee1275-94
2675 .Ss \&Sx
2676 Reference a section or subsection in the same manual page.
2677 The referenced section or subsection name must be identical to the
2678 enclosed argument, including whitespace.
2680 Examples:
2681 .Dl \&.Sx MANUAL STRUCTURE
2683 See also
2684 .Sx \&Sh
2686 .Sx \&Ss .
2687 .Ss \&Sy
2688 Request a boldface font.
2690 This is most often used to indicate importance or seriousness (not to be
2691 confused with stress emphasis, see
2692 .Sx \&Em ) .
2693 When none of the semantic macros fit, it is also adequate for syntax
2694 elements that have to be given or that appear verbatim.
2696 Examples:
2697 .Bd -literal -compact -offset indent
2698 \&.Sy Warning :
2700 \&.Sy s
2701 appears in the owner permissions, set-user-ID mode is set.
2702 This utility replaces the former
2703 \&.Sy dumpdir
2704 program.
2707 See also
2708 .Sx \&Bf ,
2709 .Sx \&Em ,
2710 .Sx \&Li ,
2712 .Sx \&No .
2713 .Ss \&Ta
2714 Table cell separator in
2715 .Sx \&Bl Fl column
2716 lists; can only be used below
2717 .Sx \&It .
2718 .Ss \&Tn
2719 Supported only for compatibility, do not use this in new manuals.
2720 Even though the macro name
2721 .Pq Dq tradename
2722 suggests a semantic function, historic usage is inconsistent, mostly
2723 using it as a presentation-level macro to request a small caps font.
2724 .Ss \&Ud
2725 Supported only for compatibility, do not use this in new manuals.
2726 Prints out
2727 .Dq currently under development.
2728 .Ss \&Ux
2729 Supported only for compatibility, do not use this in new manuals.
2730 Prints out
2731 .Dq Ux .
2732 .Ss \&Va
2733 A variable name.
2735 Examples:
2736 .Dl \&.Va foo
2737 .Dl \&.Va const char *bar ;
2739 For function arguments and parameters, use
2740 .Sx \&Fa
2741 instead.
2742 For declarations of global variables in the
2743 .Em SYNOPSIS
2744 section, use
2745 .Sx \&Vt .
2746 .Ss \&Vt
2747 A variable type.
2749 This is also used for indicating global variables in the
2750 .Em SYNOPSIS
2751 section, in which case a variable name is also specified.
2752 Note that it accepts
2753 .Sx Block partial-implicit
2754 syntax when invoked as the first macro on an input line in the
2755 .Em SYNOPSIS
2756 section, else it accepts ordinary
2757 .Sx In-line
2758 syntax.
2759 In the former case, this macro starts a new output line,
2760 and a blank line is inserted in front if there is a preceding
2761 function definition or include directive.
2763 Examples:
2764 .Dl \&.Vt unsigned char
2765 .Dl \&.Vt extern const char * const sys_signame[] \&;
2767 For parameters in function prototypes, use
2768 .Sx \&Fa
2769 instead, for function return types
2770 .Sx \&Ft ,
2771 and for variable names outside the
2772 .Em SYNOPSIS
2773 section
2774 .Sx \&Va ,
2775 even when including a type with the name.
2776 See also
2777 .Sx MANUAL STRUCTURE .
2778 .Ss \&Xc
2779 Close a scope opened by
2780 .Sx \&Xo .
2781 .Ss \&Xo
2782 Extend the header of an
2783 .Sx \&It
2784 macro or the body of a partial-implicit block macro
2785 beyond the end of the input line.
2786 This macro originally existed to work around the 9-argument limit
2787 of historic
2788 .Xr mandoc_roff 5 .
2789 .Ss \&Xr
2790 Link to another manual
2791 .Pq Qq cross-reference .
2792 Its syntax is as follows:
2794 .D1 Pf \. Sx \&Xr Ar name Op section
2796 Cross reference the
2797 .Ar name
2799 .Ar section
2800 number of another man page;
2801 omitting the section number is rarely useful.
2803 Examples:
2804 .Dl \&.Xr mandoc 1
2805 .Dl \&.Xr mandoc 1 \&;
2806 .Dl \&.Xr mandoc 1 \&Ns s behaviour
2807 .Ss \&br
2808 Emits a line-break.
2809 This macro should not be used; it is implemented for compatibility with
2810 historical manuals.
2812 Consider using
2813 .Sx \&Pp
2814 in the event of natural paragraph breaks.
2815 .Ss \&sp
2816 Emits vertical space.
2817 This macro should not be used; it is implemented for compatibility with
2818 historical manuals.
2819 Its syntax is as follows:
2821 .D1 Pf \. Sx \&sp Op Ar height
2824 .Ar height
2825 argument is a scaling width as described in
2826 .Xr mandoc_roff 5 .
2827 If unspecified,
2828 .Sx \&sp
2829 asserts a single vertical space.
2830 .Sh MACRO SYNTAX
2831 The syntax of a macro depends on its classification.
2832 In this section,
2833 .Sq \-arg
2834 refers to macro arguments, which may be followed by zero or more
2835 .Sq parm
2836 parameters;
2837 .Sq \&Yo
2838 opens the scope of a macro; and if specified,
2839 .Sq \&Yc
2840 closes it out.
2843 .Em Callable
2844 column indicates that the macro may also be called by passing its name
2845 as an argument to another macro.
2846 For example,
2847 .Sq \&.Op \&Fl O \&Ar file
2848 produces
2849 .Sq Op Fl O Ar file .
2850 To prevent a macro call and render the macro name literally,
2851 escape it by prepending a zero-width space,
2852 .Sq \e& .
2853 For example,
2854 .Sq \&Op \e&Fl O
2855 produces
2856 .Sq Op \&Fl O .
2857 If a macro is not callable but its name appears as an argument
2858 to another macro, it is interpreted as opaque text.
2859 For example,
2860 .Sq \&.Fl \&Sh
2861 produces
2862 .Sq Fl \&Sh .
2865 .Em Parsed
2866 column indicates whether the macro may call other macros by receiving
2867 their names as arguments.
2868 If a macro is not parsed but the name of another macro appears
2869 as an argument, it is interpreted as opaque text.
2872 .Em Scope
2873 column, if applicable, describes closure rules.
2874 .Ss Block full-explicit
2875 Multi-line scope closed by an explicit closing macro.
2876 All macros contains bodies; only
2877 .Sx \&Bf
2879 .Pq optionally
2880 .Sx \&Bl
2881 contain a head.
2882 .Bd -literal -offset indent
2883 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
2884 \(lBbody...\(rB
2885 \&.Yc
2887 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXX" -offset indent
2888 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2889 .It Sx \&Bd  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ed
2890 .It Sx \&Bf  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ef
2891 .It Sx \&Bk  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ek
2892 .It Sx \&Bl  Ta    \&No     Ta    \&No     Ta    closed by Sx \&El
2893 .It Sx \&Ed  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bd
2894 .It Sx \&Ef  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bf
2895 .It Sx \&Ek  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bk
2896 .It Sx \&El  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bl
2898 .Ss Block full-implicit
2899 Multi-line scope closed by end-of-file or implicitly by another macro.
2900 All macros have bodies; some
2902 .Sx \&It Fl bullet ,
2903 .Fl hyphen ,
2904 .Fl dash ,
2905 .Fl enum ,
2906 .Fl item
2908 don't have heads; only one
2910 .Sx \&It
2912 .Sx \&Bl Fl column
2914 has multiple heads.
2915 .Bd -literal -offset indent
2916 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
2917 \(lBbody...\(rB
2919 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX" -offset indent
2920 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2921 .It Sx \&It Ta \&No Ta Yes  Ta closed by Sx \&It , Sx \&El
2922 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
2923 .It Sx \&Nm Ta \&No Ta Yes  Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
2924 .It Sx \&Sh Ta \&No Ta Yes  Ta closed by Sx \&Sh
2925 .It Sx \&Ss Ta \&No Ta Yes  Ta closed by Sx \&Sh , Sx \&Ss
2928 Note that the
2929 .Sx \&Nm
2930 macro is a
2931 .Sx Block full-implicit
2932 macro only when invoked as the first macro
2933 in a
2934 .Em SYNOPSIS
2935 section line, else it is
2936 .Sx In-line .
2937 .Ss Block partial-explicit
2938 Like block full-explicit, but also with single-line scope.
2939 Each has at least a body and, in limited circumstances, a head
2941 .Sx \&Fo ,
2942 .Sx \&Eo
2944 and/or tail
2945 .Pq Sx \&Ec .
2946 .Bd -literal -offset indent
2947 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
2948 \(lBbody...\(rB
2949 \&.Yc \(lBtail...\(rB
2951 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
2952 \(lBbody...\(rB \&Yc \(lBtail...\(rB
2954 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent
2955 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2956 .It Sx \&Ac  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Ao
2957 .It Sx \&Ao  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Ac
2958 .It Sx \&Bc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Bo
2959 .It Sx \&Bo  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Bc
2960 .It Sx \&Brc Ta    Yes      Ta    Yes      Ta    opened by Sx \&Bro
2961 .It Sx \&Bro Ta    Yes      Ta    Yes      Ta    closed by Sx \&Brc
2962 .It Sx \&Dc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Do
2963 .It Sx \&Do  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Dc
2964 .It Sx \&Ec  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Eo
2965 .It Sx \&Eo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Ec
2966 .It Sx \&Fc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Fo
2967 .It Sx \&Fo  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Fc
2968 .It Sx \&Oc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Oo
2969 .It Sx \&Oo  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Oc
2970 .It Sx \&Pc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Po
2971 .It Sx \&Po  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Pc
2972 .It Sx \&Qc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Oo
2973 .It Sx \&Qo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Oc
2974 .It Sx \&Re  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Rs
2975 .It Sx \&Rs  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Re
2976 .It Sx \&Sc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&So
2977 .It Sx \&So  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Sc
2978 .It Sx \&Xc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Xo
2979 .It Sx \&Xo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Xc
2981 .Ss Block partial-implicit
2982 Like block full-implicit, but with single-line scope closed by the
2983 end of the line.
2984 .Bd -literal -offset indent
2985 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
2987 .Bl -column "MacroX" "CallableX" "ParsedX" -offset indent
2988 .It Em Macro Ta Em Callable Ta Em Parsed
2989 .It Sx \&Aq  Ta    Yes      Ta    Yes
2990 .It Sx \&Bq  Ta    Yes      Ta    Yes
2991 .It Sx \&Brq Ta    Yes      Ta    Yes
2992 .It Sx \&D1  Ta    \&No     Ta    \&Yes
2993 .It Sx \&Dl  Ta    \&No     Ta    Yes
2994 .It Sx \&Dq  Ta    Yes      Ta    Yes
2995 .It Sx \&En  Ta    Yes      Ta    Yes
2996 .It Sx \&Op  Ta    Yes      Ta    Yes
2997 .It Sx \&Pq  Ta    Yes      Ta    Yes
2998 .It Sx \&Ql  Ta    Yes      Ta    Yes
2999 .It Sx \&Qq  Ta    Yes      Ta    Yes
3000 .It Sx \&Sq  Ta    Yes      Ta    Yes
3001 .It Sx \&Vt  Ta    Yes      Ta    Yes
3004 Note that the
3005 .Sx \&Vt
3006 macro is a
3007 .Sx Block partial-implicit
3008 only when invoked as the first macro
3009 in a
3010 .Em SYNOPSIS
3011 section line, else it is
3012 .Sx In-line .
3013 .Ss Special block macro
3015 .Sx \&Ta
3016 macro can only be used below
3017 .Sx \&It
3019 .Sx \&Bl Fl column
3020 lists.
3021 It delimits blocks representing table cells;
3022 these blocks have bodies, but no heads.
3023 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent
3024 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
3025 .It Sx \&Ta  Ta    Yes      Ta    Yes    Ta closed by Sx \&Ta , Sx \&It
3027 .Ss In-line
3028 Closed by the end of the line, fixed argument lengths,
3029 and/or subsequent macros.
3030 In-line macros have only text children.
3031 If a number (or inequality) of arguments is
3032 .Pq n ,
3033 then the macro accepts an arbitrary number of arguments.
3034 .Bd -literal -offset indent
3035 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB
3037 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
3039 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
3041 .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -offset indent
3042 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
3043 .It Sx \&%A  Ta    \&No     Ta    \&No     Ta    >0
3044 .It Sx \&%B  Ta    \&No     Ta    \&No     Ta    >0
3045 .It Sx \&%C  Ta    \&No     Ta    \&No     Ta    >0
3046 .It Sx \&%D  Ta    \&No     Ta    \&No     Ta    >0
3047 .It Sx \&%I  Ta    \&No     Ta    \&No     Ta    >0
3048 .It Sx \&%J  Ta    \&No     Ta    \&No     Ta    >0
3049 .It Sx \&%N  Ta    \&No     Ta    \&No     Ta    >0
3050 .It Sx \&%O  Ta    \&No     Ta    \&No     Ta    >0
3051 .It Sx \&%P  Ta    \&No     Ta    \&No     Ta    >0
3052 .It Sx \&%Q  Ta    \&No     Ta    \&No     Ta    >0
3053 .It Sx \&%R  Ta    \&No     Ta    \&No     Ta    >0
3054 .It Sx \&%T  Ta    \&No     Ta    \&No     Ta    >0
3055 .It Sx \&%U  Ta    \&No     Ta    \&No     Ta    >0
3056 .It Sx \&%V  Ta    \&No     Ta    \&No     Ta    >0
3057 .It Sx \&Ad  Ta    Yes      Ta    Yes      Ta    >0
3058 .It Sx \&An  Ta    Yes      Ta    Yes      Ta    >0
3059 .It Sx \&Ap  Ta    Yes      Ta    Yes      Ta    0
3060 .It Sx \&Ar  Ta    Yes      Ta    Yes      Ta    n
3061 .It Sx \&At  Ta    Yes      Ta    Yes      Ta    1
3062 .It Sx \&Bsx Ta    Yes      Ta    Yes      Ta    n
3063 .It Sx \&Bt  Ta    \&No     Ta    \&No     Ta    0
3064 .It Sx \&Bx  Ta    Yes      Ta    Yes      Ta    n
3065 .It Sx \&Cd  Ta    Yes      Ta    Yes      Ta    >0
3066 .It Sx \&Cm  Ta    Yes      Ta    Yes      Ta    >0
3067 .It Sx \&Db  Ta    \&No     Ta    \&No     Ta    1
3068 .It Sx \&Dd  Ta    \&No     Ta    \&No     Ta    n
3069 .It Sx \&Dt  Ta    \&No     Ta    \&No     Ta    n
3070 .It Sx \&Dv  Ta    Yes      Ta    Yes      Ta    >0
3071 .It Sx \&Dx  Ta    Yes      Ta    Yes      Ta    n
3072 .It Sx \&Em  Ta    Yes      Ta    Yes      Ta    >0
3073 .It Sx \&Er  Ta    Yes      Ta    Yes      Ta    >0
3074 .It Sx \&Es  Ta    Yes      Ta    Yes      Ta    2
3075 .It Sx \&Ev  Ta    Yes      Ta    Yes      Ta    >0
3076 .It Sx \&Ex  Ta    \&No     Ta    \&No     Ta    n
3077 .It Sx \&Fa  Ta    Yes      Ta    Yes      Ta    >0
3078 .It Sx \&Fd  Ta    \&No     Ta    \&No     Ta    >0
3079 .It Sx \&Fl  Ta    Yes      Ta    Yes      Ta    n
3080 .It Sx \&Fn  Ta    Yes      Ta    Yes      Ta    >0
3081 .It Sx \&Fr  Ta    Yes      Ta    Yes      Ta    >0
3082 .It Sx \&Ft  Ta    Yes      Ta    Yes      Ta    >0
3083 .It Sx \&Fx  Ta    Yes      Ta    Yes      Ta    n
3084 .It Sx \&Hf  Ta    \&No     Ta    \&No     Ta    n
3085 .It Sx \&Ic  Ta    Yes      Ta    Yes      Ta    >0
3086 .It Sx \&In  Ta    \&No     Ta    \&No     Ta    1
3087 .It Sx \&Lb  Ta    \&No     Ta    \&No     Ta    1
3088 .It Sx \&Li  Ta    Yes      Ta    Yes      Ta    >0
3089 .It Sx \&Lk  Ta    Yes      Ta    Yes      Ta    >0
3090 .It Sx \&Lp  Ta    \&No     Ta    \&No     Ta    0
3091 .It Sx \&Ms  Ta    Yes      Ta    Yes      Ta    >0
3092 .It Sx \&Mt  Ta    Yes      Ta    Yes      Ta    >0
3093 .It Sx \&Nm  Ta    Yes      Ta    Yes      Ta    n
3094 .It Sx \&No  Ta    Yes      Ta    Yes      Ta    0
3095 .It Sx \&Ns  Ta    Yes      Ta    Yes      Ta    0
3096 .It Sx \&Nx  Ta    Yes      Ta    Yes      Ta    n
3097 .It Sx \&Os  Ta    \&No     Ta    \&No     Ta    n
3098 .It Sx \&Ot  Ta    Yes      Ta    Yes      Ta    >0
3099 .It Sx \&Ox  Ta    Yes      Ta    Yes      Ta    n
3100 .It Sx \&Pa  Ta    Yes      Ta    Yes      Ta    n
3101 .It Sx \&Pf  Ta    Yes      Ta    Yes      Ta    1
3102 .It Sx \&Pp  Ta    \&No     Ta    \&No     Ta    0
3103 .It Sx \&Rv  Ta    \&No     Ta    \&No     Ta    n
3104 .It Sx \&Sm  Ta    \&No     Ta    \&No     Ta    <2
3105 .It Sx \&St  Ta    \&No     Ta    Yes      Ta    1
3106 .It Sx \&Sx  Ta    Yes      Ta    Yes      Ta    >0
3107 .It Sx \&Sy  Ta    Yes      Ta    Yes      Ta    >0
3108 .It Sx \&Tn  Ta    Yes      Ta    Yes      Ta    >0
3109 .It Sx \&Ud  Ta    \&No     Ta    \&No     Ta    0
3110 .It Sx \&Ux  Ta    Yes      Ta    Yes      Ta    n
3111 .It Sx \&Va  Ta    Yes      Ta    Yes      Ta    n
3112 .It Sx \&Vt  Ta    Yes      Ta    Yes      Ta    >0
3113 .It Sx \&Xr  Ta    Yes      Ta    Yes      Ta    >0
3114 .It Sx \&br  Ta    \&No     Ta    \&No     Ta    0
3115 .It Sx \&sp  Ta    \&No     Ta    \&No     Ta    1
3117 .Ss Delimiters
3118 When a macro argument consists of one single input character
3119 considered as a delimiter, the argument gets special handling.
3120 This does not apply when delimiters appear in arguments containing
3121 more than one character.
3122 Consequently, to prevent special handling and just handle it
3123 like any other argument, a delimiter can be escaped by prepending
3124 a zero-width space
3125 .Pq Sq \e& .
3126 In text lines, delimiters never need escaping, but may be used
3127 as normal punctuation.
3129 For many macros, when the leading arguments are opening delimiters,
3130 these delimiters are put before the macro scope,
3131 and when the trailing arguments are closing delimiters,
3132 these delimiters are put after the macro scope.
3133 For example,
3135 .D1 Pf \. \&Aq "( [ word ] ) ."
3137 renders as:
3139 .D1 Aq ( [ word ] ) .
3141 Opening delimiters are:
3143 .Bl -tag -width Ds -offset indent -compact
3144 .It \&(
3145 left parenthesis
3146 .It \&[
3147 left bracket
3150 Closing delimiters are:
3152 .Bl -tag -width Ds -offset indent -compact
3153 .It \&.
3154 period
3155 .It \&,
3156 comma
3157 .It \&:
3158 colon
3159 .It \&;
3160 semicolon
3161 .It \&)
3162 right parenthesis
3163 .It \&]
3164 right bracket
3165 .It \&?
3166 question mark
3167 .It \&!
3168 exclamation mark
3171 Note that even a period preceded by a backslash
3172 .Pq Sq \e.\&
3173 gets this special handling; use
3174 .Sq \e&.
3175 to prevent that.
3177 Many in-line macros interrupt their scope when they encounter
3178 delimiters, and resume their scope when more arguments follow that
3179 are not delimiters.
3180 For example,
3182 .D1 Pf \. \&Fl "a ( b | c \e*(Ba d ) e"
3184 renders as:
3186 .D1 Fl a ( b | c \*(Ba d ) e
3188 This applies to both opening and closing delimiters,
3189 and also to the middle delimiter:
3191 .Bl -tag -width Ds -offset indent -compact
3192 .It \&|
3193 vertical bar
3196 As a special case, the predefined string \e*(Ba is handled and rendered
3197 in the same way as a plain
3198 .Sq \&|
3199 character.
3200 Using this predefined string is not recommended in new manuals.
3201 .Ss Font handling
3204 documents, usage of semantic markup is recommended in order to have
3205 proper fonts automatically selected; only when no fitting semantic markup
3206 is available, consider falling back to
3207 .Sx Physical markup
3208 macros.
3209 Whenever any
3211 macro switches the
3212 .Xr mandoc_roff 5
3213 font mode, it will automatically restore the previous font when exiting
3214 its scope.
3215 Manually switching the font using the
3216 .Xr mandoc_roff 5
3217 .Ql \ef
3218 font escape sequences is never required.
3219 .Sh COMPATIBILITY
3220 This section provides an incomplete list of compatibility issues
3221 between mandoc and GNU troff
3222 .Pq Qq groff .
3224 The following problematic behaviour is found in groff:
3226 .Bl -dash -compact
3228 .Sx \&Dd
3229 with non-standard arguments behaves very strangely.
3230 When there are three arguments, they are printed verbatim.
3231 Any other number of arguments is replaced by the current date,
3232 but without any arguments the string
3233 .Dq Epoch
3234 is printed.
3236 .Sx \&Lk
3237 only accepts a single link-name argument; the remainder is misformatted.
3239 .Sx \&Pa
3240 does not format its arguments when used in the FILES section under
3241 certain list types.
3243 .Sx \&Ta
3244 can only be called by other macros, but not at the beginning of a line.
3246 .Sx \&%C
3247 is not implemented (up to and including groff-1.22.2).
3249 .Sq \ef
3250 .Pq font face
3252 .Sq \eF
3253 .Pq font family face
3254 .Sx Text Decoration
3255 escapes behave irregularly when specified within line-macro scopes.
3257 Negative scaling units return to prior lines.
3258 Instead, mandoc truncates them to zero.
3261 The following features are unimplemented in mandoc:
3263 .Bl -dash -compact
3265 .Sx \&Bd
3266 .Fl file Ar file
3267 is unsupported for security reasons.
3269 .Sx \&Bd
3270 .Fl filled
3271 does not adjust the right margin, but is an alias for
3272 .Sx \&Bd
3273 .Fl ragged .
3275 .Sx \&Bd
3276 .Fl literal
3277 does not use a literal font, but is an alias for
3278 .Sx \&Bd
3279 .Fl unfilled .
3281 .Sx \&Bd
3282 .Fl offset Cm center
3284 .Fl offset Cm right
3285 don't work.
3286 Groff does not implement centered and flush-right rendering either,
3287 but produces large indentations.
3289 .Sh SEE ALSO
3290 .Xr man 1 ,
3291 .Xr mandoc 1 ,
3292 .Xr eqn 5 ,
3293 .Xr man 5 ,
3294 .Xr mandoc_char 5 ,
3295 .Xr mandoc_roff 5 ,
3296 .Xr tbl 5
3297 .Sh HISTORY
3300 language first appeared as a troff macro package in
3301 .Bx 4.4 .
3302 It was later significantly updated by Werner Lemberg and Ruslan Ermilov
3303 in groff-1.17.
3304 The standalone implementation that is part of the
3305 .Xr mandoc 1
3306 utility written by Kristaps Dzonsons appeared in
3307 .Ox 4.6 .
3308 .Sh AUTHORS
3311 reference was written by
3312 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .