1 .\" $Id: mdoc.7,v 1.257 2015/11/05 12:06:45 schwarze Exp $
3 .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010, 2011, 2013 Ingo Schwarze <schwarze@openbsd.org>
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.
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.
19 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
20 .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
22 .Dd $Mdocdate: November 5 2015 $
27 .Nd semantic markup language for formatting manual pages
31 language supports authoring of manual pages for the
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
38 and to support hyperlinking if supported by the output medium.
40 This reference document describes the structure of manual pages
41 and the syntax and usage of the
44 The reference implementation of a parsing and formatting tool is
48 section describes compatibility with other implementations.
52 document, lines beginning with the control character
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
61 The words following the macro name are arguments to the macro, optionally
62 including the names of other, callable macros; see
66 Lines not beginning with the control character are called
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.
75 Many aspects of the basic syntax of the
77 language are based on the
85 manual for details, in particular regarding
86 comments, escape sequences, whitespace, and quoting.
91 documents is discouraged;
93 supports some of them merely for backward compatibility.
97 document consists of a document prologue followed by one or more
100 The prologue, which consists of the
105 macros in that order, is required for every document.
107 The first section (sections are denoted by
109 must be the NAME section, consisting of at least one
114 Following that, convention dictates specifying at least the
118 sections, although this varies between manual sections.
120 The following is a well-formed skeleton
124 .Bd -literal -offset indent
126 \&.Dt PROGNAME section
130 \&.Nd one line about what it does
131 \&.\e\(dq .Sh LIBRARY
132 \&.\e\(dq For sections 2, 3, and 9 only.
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.
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
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
173 document are conventionally ordered as they appear above.
174 Sections should be composed as follows:
175 .Bl -ohang -offset Ds
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
183 \&.Nd a one line description
188 names should be separated by commas.
192 macro(s) must precede the
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
211 Documents the utility invocation syntax, function call syntax, or device
214 For the first, utilities (sections 1 and 1M), this is
215 generally structured as follows:
216 .Bd -literal -offset indent
227 Commands should be ordered alphabetically.
229 For the second, function calls (sections 2, 3, 7I, 7P, 9):
230 .Bd -literal -offset indent
232 \&.Vt extern const char *global;
234 \&.Fn foo "const char *src"
236 \&.Fn bar "const char *src"
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
255 Some macros are displayed differently in the
257 section, particularly
267 All of these macros are output on their own line.
268 If two such dissimilar macros are pairwise invoked (except for
274 they are separated by a vertical space, unless in the case of
279 which are always separated by vertical space.
281 When text and macros following an
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
287 macro, up to the next
292 macro or the end of an enclosing block, whichever comes first.
294 This begins with an expansion of the brief, one line description in
296 .Bd -literal -offset indent
299 utility does this, that, and the other.
302 It usually follows with a breakdown of the options (if documenting a
304 .Bd -literal -offset indent
305 The arguments are as follows:
306 \&.Bl \-tag \-width Ds
308 Print verbose information.
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.
321 section usually contains most of the text of a manual, longer manuals
324 macro to form subsections.
325 In very long manuals, the
327 may be split into multiple sections, each started by an
329 macro followed by a non-standard section name, and each having
330 several subsections, like in the present
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.
338 This section documents the
339 return values of functions in sections 2, 3, and 9.
344 This section lists the contexts in which functions can be called in section 9.
345 The contexts are user, kernel, or interrupt.
347 Lists the environment variables used by the utility,
348 and explains the syntax and semantics of their values.
351 manual provides examples of typical content and formatting.
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.).
363 This section documents the
364 command exit status for sections 1 and 1M.
365 Historically, this information was described in
367 a practise that is now discouraged.
373 This often contains snippets of well-formed, well-tested invocations.
374 Make sure that examples work properly!
376 Documents error and diagnostic messages displayed to the user or
378 Note that exit status and return values should be documented in the
388 Documents error handling in sections 2, 3, and 9.
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
398 True independent code sets will support not only ASCII and Extended UNIX
399 Codesets (EUC), but also other multi-byte encodings such as UTF-8 and GB2312.
401 Generally there will be some limitations that are fairly standard.
404 for more information about some of these.
405 Most interfaces should support at least UTF-8 in addition to ASCII.
406 .It Em INTERFACE STABILITY
407 Indicates the level of commitment to the interface.
408 Interfaces can be described with in the following ways:
411 Indicates that the interface is defined by one or more standards bodies.
412 Generally, changes to the interface will be carefully managed to conform
413 to the relevant standards.
414 These interfaces are generally the most suitable for use in portable programs.
416 Indicates that the interface is intended to be preserved for the long-haul, and
417 will rarely, if ever change, and never without notification (barring
418 extraordinary and extenuating circumstances).
419 These interfaces are preferred over other interfaces with the exeception of
423 Indicates that the interface may change.
424 Generally, changes to these interfaces should be infrequent, and some effort
425 will be made to address compatibility considerations when changing or removing
427 However, there is no firm commitment to the preservation of the interface.
428 Most often this is applied to interfaces where operational experience with the
429 interface is still limited and some need to change may be anticipated.
431 Consumers should expect to revalidate any
433 interfaces when crossing release boundaries.
434 Products intended for use on many releases or intended to support compatibility
435 with future releases should avoid these interfaces.
437 The interface can change at any time for any reason.
438 Often this relates to interfaces that are part of external software components
439 that are still evolving rapidly.
440 Consumers should not expect that the interface (either binary or source level)
441 will be unchanged from one release to the next.
442 .It Nm Not-an-Interface
443 Describes something that is specifically not intended for programmatic
445 For example, specific human-readable output, or the layout of graphical items on
446 a user interface, may be described this way.
447 Generally programmatic alternatives to these will be available, and should be
448 used when programmatic consumption is needed.
450 This is an internal interface.
451 Generally these interfaces should only be used within the project, and should
452 not be used by other programs or modules.
453 The interface can and will change without notice as the project needs, at any
456 Most often, Private interfaces will lack any documentation whatsoever, and
457 generally any undocumented interface can be assumed to be Private.
459 The interface is not intended for use in new projects or programs, and may
460 be removed at a future date.
463 word is a modifier that can
464 be applied to other commitment levels.
466 .Nm Obsolete Committed
467 interface is unlikely to be removed or changed, but nonetheless new use
468 is discouraged (perhaps a better newer alternative is present).
471 This section describes considerations for the interface when used within
472 programs that use multiple threads.
473 More discussion of these considerations is made in the MT-Level section of
475 The interface can be described in the following ways.
478 Indicates the interface is safe for use within multiple threads.
479 There may be additional caveats that apply, in which case those will be
481 Note that some interfaces have semantics which may affect other threads, but
482 these should be an intrinsic part of the interface rather than an unexpected
484 For example, closing a file in one thread will cause that file to be closed in
487 Indicates the interface is unsuitable for concurrent use within multiple
489 A threaded application may still make use of the interface, but will be required
490 to provide external synchronization means to ensure that only a single thread
491 calls the interface at a time.
493 Indicates that the interface is not only safe for concurrent use, but is
494 designed for such use.
497 interface may make use of a global lock to provide safety, but at reduced
498 internal concurrency, whereas an
500 interface will be designed to be efficient even when used concurrently.
501 .It Nm Async-Signal-Safe
502 Indicates that the library is safe for use within a signal handler.
505 interface can be made
506 .Nm Async-Signal-Safe
507 by ensuring that it blocks signals when acquiring locks.
508 .It Nm Safe with Exceptions
511 but with specific exceptions noted.
512 .It Nm MT-Safe with Exceptions
515 but with specific exceptions noted.
518 Documents any security precautions that operators should consider.
520 References other manuals with related topics.
521 This section should exist for most manuals.
522 Cross-references should conventionally be ordered first by section, then
523 alphabetically (ignoring case).
525 References to other documentation concerning the topic of the manual page,
526 for example authoritative books or journal articles, may also be
527 provided in this section.
534 References any standards implemented or used.
535 If not adhering to any standards, the
537 section should be used instead.
542 A brief history of the subject, including where it was first implemented,
543 and when it was ported to or reimplemented for the operating system at hand.
545 Credits to the person or persons who wrote the code and/or documentation.
546 Authors should generally be noted by both name and email address.
551 Common misuses and misunderstandings should be explained
554 Known bugs, limitations, and work-arounds should be described
558 This overview is sorted such that macros of similar purpose are listed
559 together, to help find the best macro for any given purpose.
560 Deprecated macros are not included in the overview, but can be found below
562 .Sx MACRO REFERENCE .
563 .Ss Document preamble and NAME section macros
564 .Bl -column "Brq, Bro, Brc" description
565 .It Sx \&Dd Ta document date: Ar month day , year
566 .It Sx \&Dt Ta document title: Ar TITLE SECTION Op Ar arch
567 .It Sx \&Os Ta operating system version: Op Ar system Op Ar version
568 .It Sx \&Nm Ta document name (one argument)
569 .It Sx \&Nd Ta document description (one line)
571 .Ss Sections and cross references
572 .Bl -column "Brq, Bro, Brc" description
573 .It Sx \&Sh Ta section header (one line)
574 .It Sx \&Ss Ta subsection header (one line)
575 .It Sx \&Sx Ta internal cross reference to a section or subsection
576 .It Sx \&Xr Ta cross reference to another manual page: Ar name section
577 .It Sx \&Pp , \&Lp Ta start a text paragraph (no arguments)
579 .Ss Displays and lists
580 .Bl -column "Brq, Bro, Brc" description
581 .It Sx \&Bd , \&Ed Ta display block:
583 .Op Fl offset Ar width
585 .It Sx \&D1 Ta indented display (one line)
586 .It Sx \&Dl Ta indented literal display (one line)
587 .It Sx \&Ql Ta in-line literal display: Ql text
588 .It Sx \&Bl , \&El Ta list block:
593 .It Sx \&It Ta list item (syntax depends on Fl Ar type )
594 .It Sx \&Ta Ta table cell separator in Sx \&Bl Fl column No lists
595 .It Sx \&Rs , \&%* , \&Re Ta bibliographic block (references)
598 .Bl -column "Brq, Bro, Brc" description
599 .It Sx \&Pf Ta prefix, no following horizontal space (one argument)
600 .It Sx \&Ns Ta roman font, no preceding horizontal space (no arguments)
601 .It Sx \&Ap Ta apostrophe without surrounding whitespace (no arguments)
602 .It Sx \&Sm Ta switch horizontal spacing mode: Op Cm on | off
603 .It Sx \&Bk , \&Ek Ta keep block: Fl words
604 .It Sx \&br Ta force output line break in text mode (no arguments)
605 .It Sx \&sp Ta force vertical space: Op Ar height
607 .Ss Semantic markup for command line utilities:
608 .Bl -column "Brq, Bro, Brc" description
609 .It Sx \&Nm Ta start a SYNOPSIS block with the name of a utility
610 .It Sx \&Fl Ta command line options (flags) (>=0 arguments)
611 .It Sx \&Cm Ta command modifier (>0 arguments)
612 .It Sx \&Ar Ta command arguments (>=0 arguments)
613 .It Sx \&Op , \&Oo , \&Oc Ta optional syntax elements (enclosure)
614 .It Sx \&Ic Ta internal or interactive command (>0 arguments)
615 .It Sx \&Ev Ta environmental variable (>0 arguments)
616 .It Sx \&Pa Ta file system path (>=0 arguments)
618 .Ss Semantic markup for function libraries:
619 .Bl -column "Brq, Bro, Brc" description
620 .It Sx \&Lb Ta function library (one argument)
621 .It Sx \&In Ta include file (one argument)
622 .It Sx \&Fd Ta other preprocessor directive (>0 arguments)
623 .It Sx \&Ft Ta function type (>0 arguments)
624 .It Sx \&Fo , \&Fc Ta function block: Ar funcname
625 .It Sx \&Fn Ta function name:
632 .It Sx \&Fa Ta function argument (>0 arguments)
633 .It Sx \&Vt Ta variable type (>0 arguments)
634 .It Sx \&Va Ta variable name (>0 arguments)
635 .It Sx \&Dv Ta defined variable or preprocessor constant (>0 arguments)
636 .It Sx \&Er Ta error constant (>0 arguments)
637 .It Sx \&Ev Ta environmental variable (>0 arguments)
639 .Ss Various semantic markup:
640 .Bl -column "Brq, Bro, Brc" description
641 .It Sx \&An Ta author name (>0 arguments)
642 .It Sx \&Lk Ta hyperlink: Ar uri Op Ar name
643 .It Sx \&Mt Ta Do mailto Dc hyperlink: Ar address
644 .It Sx \&Cd Ta kernel configuration declaration (>0 arguments)
645 .It Sx \&Ad Ta memory address (>0 arguments)
646 .It Sx \&Ms Ta mathematical symbol (>0 arguments)
649 .Bl -column "Brq, Bro, Brc" description
650 .It Sx \&Em Ta italic font or underline (emphasis) (>0 arguments)
651 .It Sx \&Sy Ta boldface font (symbolic) (>0 arguments)
652 .It Sx \&Li Ta typewriter font (literal) (>0 arguments)
653 .It Sx \&No Ta return to roman font (normal) (no arguments)
654 .It Sx \&Bf , \&Ef Ta font block:
655 .Op Fl Ar type | Cm \&Em | \&Li | \&Sy
657 .Ss Physical enclosures
658 .Bl -column "Brq, Bro, Brc" description
659 .It Sx \&Dq , \&Do , \&Dc Ta enclose in typographic double quotes: Dq text
660 .It Sx \&Qq , \&Qo , \&Qc Ta enclose in typewriter double quotes: Qq text
661 .It Sx \&Sq , \&So , \&Sc Ta enclose in single quotes: Sq text
662 .It Sx \&Pq , \&Po , \&Pc Ta enclose in parentheses: Pq text
663 .It Sx \&Bq , \&Bo , \&Bc Ta enclose in square brackets: Bq text
664 .It Sx \&Brq , \&Bro , \&Brc Ta enclose in curly braces: Brq text
665 .It Sx \&Aq , \&Ao , \&Ac Ta enclose in angle brackets: Aq text
666 .It Sx \&Eo , \&Ec Ta generic enclosure
669 .Bl -column "Brq, Bro, Brc" description
670 .It Sx \&Ex Fl std Ta standard command exit values: Op Ar utility ...
671 .It Sx \&Rv Fl std Ta standard function return values: Op Ar function ...
672 .It Sx \&St Ta reference to a standards document (one argument)
682 This section is a canonical reference of all macros, arranged
684 For the scoping of individual macros, see
690 Multiple authors should each be accorded their own
693 Author names should be ordered with full or abbreviated forename(s)
694 first, then full surname.
699 This macro may also be used in a non-bibliographic context when
700 referring to book titles.
702 Publication city or location of an
706 Publication date of an
709 Recommended formats of arguments are
714 Publisher or issuer name of an
722 Issue number (usually for journals) of an
726 Optional information of an
730 Book or journal page number of an
734 Institutional author (school, government, etc.) of an
737 Multiple institutional authors should each be accorded their own
741 Technical report name of an
748 This macro may also be used in a non-bibliographical context when
749 referring to article titles.
751 URI of reference document.
760 Does not have any tail arguments.
763 Do not use this for postal addresses.
770 Can be used both for the authors of the program, function, or driver
771 documented in the manual, or for the authors of the manual itself.
772 Requires either the name of an author or one of the following arguments:
774 .Bl -tag -width "-nosplitX" -offset indent -compact
776 Start a new output line before each subsequent invocation of
785 The effect of selecting either of the
787 modes ends at the beginning of the
792 section, the default is
794 for the first author listing and
796 for all other author listings.
800 .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv
802 Begin a block enclosed by angle brackets.
803 Does not have any head arguments.
806 .Dl \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
811 Inserts an apostrophe without any surrounding whitespace.
812 This is generally used as a grammatical device when referring to the verb
816 .Dl \&.Fn execve \&Ap d
818 Encloses its arguments in angle brackets.
821 .Dl \&.Fl -key= \&Ns \&Aq \&Ar val
824 this macro is often abused for rendering URIs, which should instead use
828 or to note pre-processor
830 statements, which should use
837 If an argument is not provided, the string
839 is used as a default.
844 .Dl ".Ar arg1 , arg2 ."
848 macro are names and placeholders for command arguments;
849 for fixed strings to be passed verbatim as arguments, use
857 Accepts one optional argument:
859 .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact
870 Note that these arguments do not begin with a hyphen.
889 Does not have any tail arguments.
891 Begin a display block.
892 Its syntax is as follows:
893 .Bd -ragged -offset indent
896 .Op Fl offset Ar width
900 Display blocks are used to select a different indentation and
901 justification than the one used by the surrounding text.
902 They may contain both macro lines and text lines.
903 By default, a display block is preceded by a vertical space.
907 must be one of the following:
908 .Bl -tag -width 13n -offset indent
910 Produce one output line from each input line, and center-justify each line.
911 Using this display type is not recommended; many
913 implementations render it poorly.
915 Change the positions of line breaks to fill each line, and left- and
916 right-justify the resulting block.
918 Produce one output line from each input line,
919 and do not justify the block at all.
920 Preserve white space as it appears in the input.
921 Always use a constant-width font.
922 Use this for displaying source code.
924 Change the positions of line breaks to fill each line, and left-justify
929 but using the same font as for normal text, which is a variable width font
930 if supported by the output device.
935 must be provided first.
936 Additional arguments may follow:
937 .Bl -tag -width 13n -offset indent
938 .It Fl offset Ar width
939 Indent the display by the
941 which may be one of the following:
944 One of the pre-defined strings
946 the width of a standard indentation (six constant width characters);
953 which justifies to the right margin; or
955 which aligns around an imagined center axis.
957 A macro invocation, which selects a predefined width
958 associated with that macro.
959 The most popular is the imaginary macro
964 A scaling width as described in
967 An arbitrary string, which indents by the length of this string.
970 When the argument is missing,
974 Do not assert vertical space before the display.
978 .Bd -literal -offset indent
979 \&.Bd \-literal \-offset indent \-compact
989 Change the font mode for a scoped block of text.
990 Its syntax is as follows:
991 .Bd -ragged -offset indent
994 .Fl emphasis | literal | symbolic |
995 .Cm \&Em | \&Li | \&Sy
1003 argument are equivalent, as are
1011 Without an argument, this macro does nothing.
1012 The font mode continues until broken by a new font mode in a nested
1024 For each macro, keep its output together on the same output line,
1025 until the end of the macro or the end of the input line is reached,
1026 whichever comes first.
1027 Line breaks in text lines are unaffected.
1028 The syntax is as follows:
1030 .D1 Pf \. Sx \&Bk Fl words
1034 argument is required; additional arguments are ignored.
1036 The following example will not break within each
1039 .Bd -literal -offset indent
1042 \&.Op Fl o Ar output
1046 Be careful in using over-long lines within a keep block!
1047 Doing so will clobber the right margin.
1050 Lists consist of items specified using the
1052 macro, containing a head or a body or both.
1053 The list syntax is as follows:
1054 .Bd -ragged -offset indent
1058 .Op Fl offset Ar val
1065 is mandatory and must be specified first.
1070 arguments accept macro names as described for
1073 scaling widths as described in
1075 or use the length of the given string.
1078 is a global indentation for the whole list, affecting both item heads
1080 For those list types supporting it, the
1082 argument requests an additional indentation of item bodies,
1087 argument is specified, list entries are separated by vertical space.
1089 A list must specify one of the following list types:
1090 .Bl -tag -width 12n -offset indent
1092 No item heads can be specified, but a bullet will be printed at the head
1094 Item bodies start on the same output line as the bullet
1095 and are indented according to the
1102 argument has no effect; instead, each argument specifies the width
1103 of one column, using either the scaling width syntax described in
1105 or the string length of the argument.
1106 If the first line of the body of a
1112 contexts spanning one input line each are implied until an
1114 macro line is encountered, at which point items start being interpreted as
1121 except that dashes are used in place of bullets.
1125 except that item heads are not parsed for macro invocations.
1126 Most often used in the
1128 section with error constants in the item heads.
1131 No item heads can be specified.
1134 except that cardinal numbers are used in place of bullets,
1139 except that the first lines of item bodies are not indented, but follow
1140 the item heads like in
1147 Item bodies follow items heads on the same line, using normal inter-word
1149 Bodies are not indented, and the
1151 argument is ignored.
1153 No item heads can be specified, and none are printed.
1154 Bodies are not indented, and the
1156 argument is ignored.
1158 Item bodies start on the line following item heads and are not indented.
1161 argument is ignored.
1163 Item bodies are indented according to the
1166 When an item head fits inside the indentation, the item body follows
1167 this head on the same output line.
1168 Otherwise, the body starts on the output line following the head.
1171 Lists may be nested within lists and displays.
1176 lists may not be portable.
1183 Begin a block enclosed by square brackets.
1184 Does not have any head arguments.
1187 .Bd -literal -offset indent -compact
1195 Encloses its arguments in square brackets.
1198 .Dl \&.Bq 1 , \&Dv BUFSIZ
1201 this macro is sometimes abused to emulate optional arguments for
1202 commands; the correct macros to use for this purpose are
1214 Does not have any tail arguments.
1216 Begin a block enclosed by curly braces.
1217 Does not have any head arguments.
1220 .Bd -literal -offset indent -compact
1228 Encloses its arguments in curly braces.
1231 .Dl \&.Brq 1 , ... , \&Va n
1238 version provided as an argument, or a default value if
1239 no argument is provided.
1254 Supported only for compatibility, do not use this in new manuals.
1256 .Dq is currently in beta test.
1260 version provided as an argument, or a default value if no
1261 argument is provided.
1277 Kernel configuration declaration.
1278 It is found in pages for
1283 .Dl \&.Cd device le0 at scode?
1286 this macro is commonly abused by using quoted literals to retain
1287 whitespace and align consecutive
1290 This practise is discouraged.
1293 Typically used for fixed strings passed as arguments, unless
1295 is more appropriate.
1296 Also useful when specifying configuration options or keys.
1299 .Dl ".Nm mt Fl f Ar device Cm rewind"
1300 .Dl ".Nm ps Fl o Cm pid , Ns Cm command"
1301 .Dl ".Nm dd Cm if= Ns Ar file1 Cm of= Ns Ar file2"
1302 .Dl ".Cm IdentityFile Pa ~/.ssh/id_rsa"
1303 .Dl ".Cm LogLevel Dv DEBUG"
1305 One-line indented display.
1306 This is formatted by the default rules and is useful for simple indented
1308 It is followed by a newline.
1311 .Dl \&.D1 \&Fl abcdefgh
1318 This macro is obsolete.
1319 No replacement is needed.
1322 and groff including its arguments.
1323 It was formerly used to toggle a debugging mode.
1328 Does not have any tail arguments.
1330 Document date for display in the page footer.
1331 This is the mandatory first macro of any
1334 Its syntax is as follows:
1336 .D1 Pf \. Sx \&Dd Ar month day , year
1340 is the full English month name, the
1342 is an optionally zero-padded numeral, and the
1344 is the full four-digit year.
1346 Other arguments are not portable; the
1348 utility handles them as follows:
1349 .Bl -dash -offset 3n -compact
1351 To have the date automatically filled in by the
1357 can be given as an argument.
1359 The traditional, purely numeric
1362 .Ar year Ns \(en Ns Ar month Ns \(en Ns Ar day
1365 If a date string cannot be parsed, it is used verbatim.
1367 If no date string is given, the current date is used.
1371 .Dl \&.Dd $\&Mdocdate$
1372 .Dl \&.Dd $\&Mdocdate: July 21 2007$
1373 .Dl \&.Dd July 21, 2007
1380 One-line indented display.
1381 This is formatted as literal text and is useful for commands and
1383 It is followed by a newline.
1386 .Dl \&.Dl % mandoc mdoc.5 \e(ba less
1395 Begin a block enclosed by double quotes.
1396 Does not have any head arguments.
1399 .Bd -literal -offset indent -compact
1401 April is the cruellest month
1409 Encloses its arguments in
1414 .Bd -literal -offset indent -compact
1415 \&.Dq April is the cruellest month
1425 Document title for display in the page header.
1426 This is the mandatory second macro of any
1429 Its syntax is as follows:
1430 .Bd -ragged -offset indent
1437 Its arguments are as follows:
1438 .Bl -tag -width section -offset 2n
1440 The document's title (name), defaulting to
1443 To achieve a uniform appearance of page header lines,
1444 it should by convention be all caps.
1447 It should correspond to the manual's filename suffix and defaults to
1448 the empty string if unspecified.
1449 This field is optional.
1450 To achieve a uniform appearance of page header lines,
1451 it should by convention be all caps.
1453 This specifies the machine architecture a manual page applies to,
1457 Defined variables such as preprocessor constants, constant symbols,
1458 enumeration values, and so on.
1463 .Dl \&.Dv STDOUT_FILENO
1469 for special-purpose constants,
1471 for variable symbols, and
1473 for listing preprocessor variable definitions in the
1478 version provided as an argument, or a default
1479 value if no argument is provided.
1494 Close a scope started by
1496 Its syntax is as follows:
1498 .D1 Pf \. Sx \&Ec Op Ar TERM
1502 argument is used as the enclosure tail, for example, specifying \e(rq
1506 End a display context started by
1509 End a font mode context started by
1512 End a keep context started by
1515 End a list context started by
1523 Request an italic font.
1524 If the output device does not provide that, underline.
1526 This is most often used for stress emphasis (not to be confused with
1529 In the rare cases where none of the semantic markup macros fit,
1530 it can also be used for technical terms and placeholders, except
1531 that for syntax elements,
1535 are preferred, respectively.
1538 .Bd -literal -compact -offset indent
1539 Selected lines are those
1541 matching any of the specified patterns.
1542 Some of the functions use a
1544 to save the pattern space for subsequent retrieval.
1554 This macro is obsolete.
1557 or any of the other enclosure macros.
1559 It encloses its argument in the delimiters specified by the last
1563 An arbitrary enclosure.
1564 Its syntax is as follows:
1566 .D1 Pf \. Sx \&Eo Op Ar TERM
1570 argument is used as the enclosure head, for example, specifying \e(lq
1574 Error constants for definitions of the
1576 libc global variable.
1577 This is most often used in section 2 and 3 manual pages.
1585 for general constants.
1587 This macro is obsolete.
1590 or any of the other enclosure macros.
1592 It takes two arguments, defining the delimiters to be used by subsequent
1596 Environmental variables such as those specified in
1605 for general constants.
1607 Insert a standard sentence regarding command exit values of 0 on success
1609 This is most often used in section 1 and 1M manual pages.
1610 Its syntax is as follows:
1612 .D1 Pf \. Sx \&Ex Fl std Op Ar utility ...
1616 is not specified, the document's name set by
1621 arguments are treated as separate utilities.
1626 Function argument or parameter.
1627 Its syntax is as follows:
1628 .Bd -ragged -offset indent
1636 Each argument may be a name and a type (recommended for the
1638 section), a name alone (for function invocations),
1639 or a type alone (for function prototypes).
1640 If both a type and a name are given or if the type consists of multiple
1641 words, all words belonging to the same function argument have to be
1642 given in a single argument to the
1646 This macro is also used to specify the field name of a structure.
1650 macro is used in the
1654 blocks when documenting multi-line function prototypes.
1655 If invoked with multiple arguments, the arguments are separated by a
1657 Furthermore, if the following macro is another
1659 the last argument will also have a trailing comma.
1662 .Dl \&.Fa \(dqconst char *p\(dq
1663 .Dl \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1664 .Dl \&.Fa \(dqchar *\(dq size_t
1669 End a function context started by
1672 Preprocessor directive, in particular for listing it in the
1674 Historically, it was also used to document include files.
1675 The latter usage has been deprecated in favour of
1678 Its syntax is as follows:
1679 .Bd -ragged -offset indent
1681 .Li # Ns Ar directive
1686 .Dl \&.Fd #define sa_handler __sigaction_u.__sa_handler
1687 .Dl \&.Fd #define SIO_MAXNFDS
1688 .Dl \&.Fd #ifdef FS_DEBUG
1690 .Dl \&.Fn dbg_open \(dqconst char *\(dq
1694 .Sx MANUAL STRUCTURE ,
1699 Command-line flag or option.
1700 Used when listing arguments to command-line utilities.
1701 Prints a fixed-width hyphen
1703 directly followed by each argument.
1704 If no arguments are provided, a hyphen is printed followed by a space.
1705 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1709 .Dl ".Fl R Op Fl H | L | P"
1710 .Dl ".Op Fl 1AaCcdFfgHhikLlmnopqRrSsTtux"
1711 .Dl ".Fl type Cm d Fl name Pa CVS"
1712 .Dl ".Fl Ar signal_number"
1719 Its syntax is as follows:
1720 .Bd -ragged -offset indent
1724 .Op Oo Ar argtype Oc Ar argname
1727 Function arguments are surrounded in parenthesis and
1728 are delimited by commas.
1729 If no arguments are specified, blank parenthesis are output.
1732 section, this macro starts a new output line,
1733 and a blank line is automatically inserted between function definitions.
1736 .Dl \&.Fn \(dqint funcname\(dq \(dqint arg0\(dq \(dqint arg1\(dq
1737 .Dl \&.Fn funcname \(dqint arg0\(dq
1738 .Dl \&.Fn funcname arg0
1740 .Bd -literal -offset indent -compact
1745 When referring to a function documented in another manual page, use
1749 .Sx MANUAL STRUCTURE ,
1754 Begin a function block.
1755 This is a multi-line version of
1757 Its syntax is as follows:
1759 .D1 Pf \. Sx \&Fo Ar funcname
1761 Invocations usually occur in the following context:
1762 .Bd -ragged -offset indent
1763 .Pf \. Sx \&Ft Ar functype
1765 .Pf \. Sx \&Fo Ar funcname
1767 .Pf \. Sx \&Fa Qq Ar argtype Ar argname
1780 .Sx MANUAL STRUCTURE ,
1786 This macro is obsolete.
1787 No replacement markup is needed.
1789 It was used to show numerical function return values in an italic font.
1792 Its syntax is as follows:
1794 .D1 Pf \. Sx \&Ft Ar functype
1798 section, a new output line is started after this macro.
1802 .Bd -literal -offset indent -compact
1808 .Sx MANUAL STRUCTURE ,
1815 version provided as an argument, or a default value
1816 if no argument is provided.
1831 This macro is not implemented in
1834 It was used to include the contents of a (header) file literally.
1837 .Dl Pf . Sx \&Hf Ar filename
1839 Designate an internal or interactive command.
1842 but used for instructions rather than values.
1853 is preferred for displaying code; the
1855 macro is used when referring to specific instructions.
1857 The name of an include file.
1858 This macro is most often used in section 2, 3, and 9 manual pages.
1860 When invoked as the first macro on an input line in the
1862 section, the argument is displayed in angle brackets
1865 and a blank line is inserted in front if there is a preceding
1866 function declaration.
1867 In other sections, it only encloses its argument in angle brackets
1868 and causes no line break.
1871 .Dl \&.In sys/types.h
1874 .Sx MANUAL STRUCTURE .
1877 The syntax of this macro depends on the list type.
1886 have the following syntax:
1888 .D1 Pf \. Sx \&It Ar args
1897 have the following syntax:
1901 with subsequent lines interpreted within the scope of the
1903 until either a closing
1910 list has the following syntax:
1912 .D1 Pf \. Sx \&It Op Cm args
1914 Subsequent lines are interpreted as with
1917 The line arguments correspond to the list's left-hand side; body
1918 arguments correspond to the list's contents.
1922 list is the most complicated.
1923 Its syntax is as follows:
1925 .D1 Pf \. Sx \&It Ar cell Op <TAB> Ar cell ...
1926 .D1 Pf \. Sx \&It Ar cell Op Sx \&Ta Ar cell ...
1928 The arguments consist of one or more lines of text and macros
1929 representing a complete table line.
1930 Cells within the line are delimited by tabs or by the special
1933 The tab cell delimiter may only be used within the
1935 line itself; on following lines, only the
1937 macro can be used to delimit cells, and
1939 is only recognised as a macro when called by other macros,
1940 not as the first macro on a line.
1942 Note that quoted strings may span tab-delimited cells on an
1947 .Dl .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1949 will preserve the semicolon whitespace except for the last.
1955 The syntax is as follows:
1957 .D1 Pf \. Sx \&Lb Ar library
1961 parameter may be a system library, such as
1965 in which case a small library description is printed next to the linker
1966 invocation; or a custom library, in which case the library name is
1968 This is most commonly used in the
1970 section as described in
1971 .Sx MANUAL STRUCTURE .
1977 Denotes text that should be in a
1980 Note that this is a presentation term and should not be used for
1981 stylistically decorating technical terms.
1983 On terminal output devices, this is often indistinguishable from
1994 Its syntax is as follows:
1996 .D1 Pf \. Sx \&Lk Ar uri Op Ar name
1999 .Dl \&.Lk http://bsd.lv \(dqThe BSD.lv Project\(dq
2000 .Dl \&.Lk http://bsd.lv
2008 Display a mathematical symbol.
2009 Its syntax is as follows:
2011 .D1 Pf \. Sx \&Ms Ar symbol
2020 Its syntax is as follows:
2022 .D1 Pf \. Sx \&Mt Ar address
2025 .Dl \&.Mt discuss@manpages.bsd.lv
2026 .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv
2028 A one line description of the manual's content.
2029 This is the mandatory last macro of the
2031 section and not appropriate for other sections.
2034 .Dl Pf . Sx \&Nd mdoc language reference
2035 .Dl Pf . Sx \&Nd format and display UNIX manuals
2039 macro technically accepts child macros and terminates with a subsequent
2042 Do not assume this behaviour: some
2044 database generators are not smart enough to parse more than the line
2045 arguments and will display macros verbatim.
2050 The name of the manual page, or \(em in particular in section 1
2051 pages \(em of an additional command or feature documented in
2053 When first invoked, the
2055 macro expects a single argument, the name of the manual page.
2056 Usually, the first invocation happens in the
2058 section of the page.
2059 The specified name will be remembered and used whenever the macro is
2060 called again without arguments later in the page.
2064 .Sx Block full-implicit
2065 semantics when invoked as the first macro on an input line in the
2067 section; otherwise, it uses ordinary
2072 .Bd -literal -offset indent
2081 of section 2, 3 and 9 manual pages, use the
2085 to mark up the name of the manual page.
2088 Closes the scope of any preceding in-line macro.
2089 When used after physical formatting macros like
2093 switches back to the standard font face and weight.
2094 Can also be used to embed plain text strings in macro lines
2095 using semantic annotation macros.
2098 .Dl ".Em italic , Sy bold , No and roman"
2100 .Bd -literal -offset indent -compact
2102 \&.Cm :C No / Ar pattern No / Ar replacement No /
2112 Suppress a space between the output of the preceding macro
2113 and the following text or macro.
2114 Following invocation, input is interpreted as normal text
2119 This has no effect when invoked at the start of a macro line.
2122 .Dl ".Ar name Ns = Ns Ar value"
2123 .Dl ".Cm :M Ns Ar pattern"
2124 .Dl ".Fl o Ns Ar output"
2133 version provided as an argument, or a default value if
2134 no argument is provided.
2153 Multi-line version of
2157 .Bd -literal -offset indent -compact
2159 \&.Op Fl flag Ns Ar value
2163 Optional part of a command line.
2164 Prints the argument(s) in brackets.
2165 This is most often used in the
2167 section of section 1 and 1M manual pages.
2170 .Dl \&.Op \&Fl a \&Ar b
2171 .Dl \&.Op \&Ar a | b
2176 Operating system version for display in the page footer.
2177 This is the mandatory third macro of
2181 Its syntax is as follows:
2183 .D1 Pf \. Sx \&Os Op Ar system Op Ar version
2187 parameter specifies the relevant operating system or environment.
2188 It is suggested to leave it unspecified, in which case
2192 argument or, if that isn't specified either,
2201 .Dl \&.Os KTH/CSC/TCS
2209 This macro is obsolete.
2214 both have the same effect.
2218 packages described it as
2219 .Dq "old function type (FORTRAN)" .
2223 version provided as an argument, or a default value
2224 if no argument is provided.
2239 An absolute or relative file system path, or a file or directory name.
2240 If an argument is not provided, the character
2242 is used as a default.
2245 .Dl \&.Pa /usr/bin/mandoc
2246 .Dl \&.Pa /usr/share/man/man5/mdoc.5
2251 Close parenthesised context opened by
2254 Removes the space between its argument and the following macro.
2255 Its syntax is as follows:
2257 .D1 .Pf Ar prefix macro arguments ...
2259 This is equivalent to:
2261 .D1 .No \e& Ns Ar prefix No \&Ns Ar macro arguments ...
2265 argument is not parsed for macro names or delimiters,
2266 but used verbatim as if it were escaped.
2269 .Dl ".Pf $ Ar variable_name"
2270 .Dl ".Pf . Ar macro_name"
2271 .Dl ".Pf 0x Ar hex_digits"
2278 Multi-line version of
2282 This will assert vertical space between prior and subsequent macros
2285 Paragraph breaks are not needed before or after
2289 macros or before displays
2297 Parenthesised enclosure.
2302 Close quoted context opened by
2305 In-line literal display.
2306 This can for example be used for complete command invocations and
2307 for multi-word code fragments when more specific markup is not
2308 appropriate and an indented display is not desired.
2311 always encloses the arguments in single quotes, other formatters
2312 usually omit the quotes on non-terminal output devices when the
2313 arguments have three or more characters.
2321 Multi-line version of
2324 Encloses its arguments in
2339 Does not have any tail arguments.
2341 Begin a bibliographic
2344 Does not have any head arguments.
2345 The block macro may only contain
2361 child macros (at least one must be specified).
2364 .Bd -literal -offset indent -compact
2366 \&.%A J. E. Hopcroft
2368 \&.%B Introduction to Automata Theory, Languages, and Computation
2369 \&.%I Addison-Wesley
2370 \&.%C Reading, Massachusetts
2377 block is used within a SEE ALSO section, a vertical space is asserted
2378 before the rendered output, else the block continues on the current
2381 Insert a standard sentence regarding a function call's return value of 0
2382 on success and \-1 on error, with the
2384 libc global variable set on error.
2385 Its syntax is as follows:
2387 .D1 Pf \. Sx \&Rv Fl std Op Ar function ...
2391 is not specified, the document's name set by
2396 arguments are treated as separate functions.
2401 Close single-quoted context opened by
2404 Begin a new section.
2405 For a list of conventional manual sections, see
2406 .Sx MANUAL STRUCTURE .
2407 These sections should be used unless it's absolutely necessary that
2408 custom sections be used.
2410 Section names should be unique so that they may be keyed by
2412 Although this macro is parsed, it should not consist of child node or it
2413 may not be linked with
2422 Switches the spacing mode for output generated from macros.
2423 Its syntax is as follows:
2425 .D1 Pf \. Sx \&Sm Op Cm on | off
2427 By default, spacing is
2431 no white space is inserted between macro arguments and between the
2432 output generated from adjacent macros, but text lines
2433 still get normal spacing between words and sentences.
2435 When called without an argument, the
2437 macro toggles the spacing mode.
2438 Using this is not recommended because it makes the code harder to read.
2440 Multi-line version of
2443 Encloses its arguments in
2453 Begin a new subsection.
2456 there is no convention for the naming of subsections.
2459 the conventional sections described in
2460 .Sx MANUAL STRUCTURE
2461 rarely have subsections.
2463 Sub-section names should be unique so that they may be keyed by
2465 Although this macro is parsed, it should not consist of child node or it
2466 may not be linked with
2475 Replace an abbreviation for a standard with the full form.
2476 The following standards are recognised.
2477 Where multiple lines are given without a blank line in between,
2478 they all refer to the same standard, and using the first form
2481 .It C language standards
2483 .Bl -tag -width "-p1003.1g-2000" -compact
2493 The original C standard.
2507 The second major version of the C language standard.
2512 The third major version of the C language standard.
2514 .It POSIX.1 before the Single UNIX Specification
2516 .Bl -tag -width "-p1003.1g-2000" -compact
2522 The original POSIX standard, based on ANSI C.
2529 The first update of POSIX.1.
2536 Real-time extensions.
2541 POSIX thread interfaces.
2546 Technical Corrigendum.
2553 Includes POSIX.1-1990, 1b, 1c, and 1i.
2555 .It X/Open Portability Guide version 4 and related standards
2557 .Bl -tag -width "-p1003.1g-2000" -compact
2561 An XPG4 precursor, published in 1989.
2580 Based on POSIX.1 and POSIX.2, published in 1992.
2582 .It Single UNIX Specification version 1 and related standards
2584 .Bl -tag -width "-p1003.1g-2000" -compact
2590 This standard was published in 1994.
2591 It was used as the basis for UNIX 95 certification.
2592 The following three refer to parts of it.
2603 Networking APIs, including sockets.
2610 .It Single UNIX Specification version 2 and related standards
2612 .Bl -tag -width "-p1003.1g-2000" -compact
2615 This Standard was published in 1997
2616 and is also called X/Open Portability Guide version 5.
2617 It was used as the basis for UNIX 98 certification.
2618 The following refer to parts of it.
2634 .It Single UNIX Specification version 3
2636 .Bl -tag -width "-p1003.1-2001" -compact
2642 This standard is based on C99, SUSv2, POSIX.1-1996, 1d, and 1j.
2643 It is also called X/Open Portability Guide version 6.
2644 It is used as the basis for UNIX 03 certification.
2649 The second and last Technical Corrigendum.
2651 .It Single UNIX Specification version 4
2653 .Bl -tag -width "-p1003.1g-2000" -compact
2659 This standard is also called
2660 X/Open Portability Guide version 7.
2665 This is the first Technical Corrigendum.
2669 .Bl -tag -width "-p1003.1g-2000" -compact
2673 Floating-point arithmetic.
2678 Representation of dates and times, published in 1988.
2683 Ethernet local area networks.
2690 Reference a section or subsection in the same manual page.
2691 The referenced section or subsection name must be identical to the
2692 enclosed argument, including whitespace.
2695 .Dl \&.Sx MANUAL STRUCTURE
2702 Request a boldface font.
2704 This is most often used to indicate importance or seriousness (not to be
2705 confused with stress emphasis, see
2707 When none of the semantic macros fit, it is also adequate for syntax
2708 elements that have to be given or that appear verbatim.
2711 .Bd -literal -compact -offset indent
2715 appears in the owner permissions, set-user-ID mode is set.
2716 This utility replaces the former
2728 Table cell separator in
2730 lists; can only be used below
2733 Supported only for compatibility, do not use this in new manuals.
2734 Even though the macro name
2736 suggests a semantic function, historic usage is inconsistent, mostly
2737 using it as a presentation-level macro to request a small caps font.
2739 Supported only for compatibility, do not use this in new manuals.
2741 .Dq currently under development.
2743 Supported only for compatibility, do not use this in new manuals.
2751 .Dl \&.Va const char *bar ;
2753 For function arguments and parameters, use
2756 For declarations of global variables in the
2763 This is also used for indicating global variables in the
2765 section, in which case a variable name is also specified.
2766 Note that it accepts
2767 .Sx Block partial-implicit
2768 syntax when invoked as the first macro on an input line in the
2770 section, else it accepts ordinary
2773 In the former case, this macro starts a new output line,
2774 and a blank line is inserted in front if there is a preceding
2775 function definition or include directive.
2778 .Dl \&.Vt unsigned char
2779 .Dl \&.Vt extern const char * const sys_signame[] \&;
2781 For parameters in function prototypes, use
2783 instead, for function return types
2785 and for variable names outside the
2789 even when including a type with the name.
2791 .Sx MANUAL STRUCTURE .
2793 Close a scope opened by
2796 Extend the header of an
2798 macro or the body of a partial-implicit block macro
2799 beyond the end of the input line.
2800 This macro originally existed to work around the 9-argument limit
2804 Link to another manual
2805 .Pq Qq cross-reference .
2806 Its syntax is as follows:
2808 .D1 Pf \. Sx \&Xr Ar name Op section
2814 number of another man page;
2815 omitting the section number is rarely useful.
2819 .Dl \&.Xr mandoc 1 \&;
2820 .Dl \&.Xr mandoc 1 \&Ns s behaviour
2823 This macro should not be used; it is implemented for compatibility with
2828 in the event of natural paragraph breaks.
2830 Emits vertical space.
2831 This macro should not be used; it is implemented for compatibility with
2833 Its syntax is as follows:
2835 .D1 Pf \. Sx \&sp Op Ar height
2839 argument is a scaling width as described in
2843 asserts a single vertical space.
2845 The syntax of a macro depends on its classification.
2848 refers to macro arguments, which may be followed by zero or more
2852 opens the scope of a macro; and if specified,
2858 column indicates that the macro may also be called by passing its name
2859 as an argument to another macro.
2861 .Sq \&.Op \&Fl O \&Ar file
2863 .Sq Op Fl O Ar file .
2864 To prevent a macro call and render the macro name literally,
2865 escape it by prepending a zero-width space,
2871 If a macro is not callable but its name appears as an argument
2872 to another macro, it is interpreted as opaque text.
2880 column indicates whether the macro may call other macros by receiving
2881 their names as arguments.
2882 If a macro is not parsed but the name of another macro appears
2883 as an argument, it is interpreted as opaque text.
2887 column, if applicable, describes closure rules.
2888 .Ss Block full-explicit
2889 Multi-line scope closed by an explicit closing macro.
2890 All macros contains bodies; only
2896 .Bd -literal -offset indent
2897 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
2901 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXX" -offset indent
2902 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2903 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
2904 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
2905 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
2906 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
2907 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
2908 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
2909 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
2910 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
2912 .Ss Block full-implicit
2913 Multi-line scope closed by end-of-file or implicitly by another macro.
2914 All macros have bodies; some
2916 .Sx \&It Fl bullet ,
2922 don't have heads; only one
2929 .Bd -literal -offset indent
2930 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
2933 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX" -offset indent
2934 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2935 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
2936 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
2937 .It Sx \&Nm Ta \&No Ta Yes Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
2938 .It Sx \&Sh Ta \&No Ta Yes Ta closed by Sx \&Sh
2939 .It Sx \&Ss Ta \&No Ta Yes Ta closed by Sx \&Sh , Sx \&Ss
2945 .Sx Block full-implicit
2946 macro only when invoked as the first macro
2949 section line, else it is
2951 .Ss Block partial-explicit
2952 Like block full-explicit, but also with single-line scope.
2953 Each has at least a body and, in limited circumstances, a head
2960 .Bd -literal -offset indent
2961 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
2963 \&.Yc \(lBtail...\(rB
2965 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
2966 \(lBbody...\(rB \&Yc \(lBtail...\(rB
2968 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent
2969 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2970 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
2971 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
2972 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
2973 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
2974 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
2975 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
2976 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
2977 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
2978 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
2979 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
2980 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
2981 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
2982 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
2983 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
2984 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
2985 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
2986 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
2987 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
2988 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
2989 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
2990 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
2991 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
2992 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
2993 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
2995 .Ss Block partial-implicit
2996 Like block full-implicit, but with single-line scope closed by the
2998 .Bd -literal -offset indent
2999 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
3001 .Bl -column "MacroX" "CallableX" "ParsedX" -offset indent
3002 .It Em Macro Ta Em Callable Ta Em Parsed
3003 .It Sx \&Aq Ta Yes Ta Yes
3004 .It Sx \&Bq Ta Yes Ta Yes
3005 .It Sx \&Brq Ta Yes Ta Yes
3006 .It Sx \&D1 Ta \&No Ta \&Yes
3007 .It Sx \&Dl Ta \&No Ta Yes
3008 .It Sx \&Dq Ta Yes Ta Yes
3009 .It Sx \&En Ta Yes Ta Yes
3010 .It Sx \&Op Ta Yes Ta Yes
3011 .It Sx \&Pq Ta Yes Ta Yes
3012 .It Sx \&Ql Ta Yes Ta Yes
3013 .It Sx \&Qq Ta Yes Ta Yes
3014 .It Sx \&Sq Ta Yes Ta Yes
3015 .It Sx \&Vt Ta Yes Ta Yes
3021 .Sx Block partial-implicit
3022 only when invoked as the first macro
3025 section line, else it is
3027 .Ss Special block macro
3030 macro can only be used below
3035 It delimits blocks representing table cells;
3036 these blocks have bodies, but no heads.
3037 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent
3038 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
3039 .It Sx \&Ta Ta Yes Ta Yes Ta closed by Sx \&Ta , Sx \&It
3042 Closed by the end of the line, fixed argument lengths,
3043 and/or subsequent macros.
3044 In-line macros have only text children.
3045 If a number (or inequality) of arguments is
3047 then the macro accepts an arbitrary number of arguments.
3048 .Bd -literal -offset indent
3049 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB
3051 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
3053 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
3055 .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -offset indent
3056 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
3057 .It Sx \&%A Ta \&No Ta \&No Ta >0
3058 .It Sx \&%B Ta \&No Ta \&No Ta >0
3059 .It Sx \&%C Ta \&No Ta \&No Ta >0
3060 .It Sx \&%D Ta \&No Ta \&No Ta >0
3061 .It Sx \&%I Ta \&No Ta \&No Ta >0
3062 .It Sx \&%J Ta \&No Ta \&No Ta >0
3063 .It Sx \&%N Ta \&No Ta \&No Ta >0
3064 .It Sx \&%O Ta \&No Ta \&No Ta >0
3065 .It Sx \&%P Ta \&No Ta \&No Ta >0
3066 .It Sx \&%Q Ta \&No Ta \&No Ta >0
3067 .It Sx \&%R Ta \&No Ta \&No Ta >0
3068 .It Sx \&%T Ta \&No Ta \&No Ta >0
3069 .It Sx \&%U Ta \&No Ta \&No Ta >0
3070 .It Sx \&%V Ta \&No Ta \&No Ta >0
3071 .It Sx \&Ad Ta Yes Ta Yes Ta >0
3072 .It Sx \&An Ta Yes Ta Yes Ta >0
3073 .It Sx \&Ap Ta Yes Ta Yes Ta 0
3074 .It Sx \&Ar Ta Yes Ta Yes Ta n
3075 .It Sx \&At Ta Yes Ta Yes Ta 1
3076 .It Sx \&Bsx Ta Yes Ta Yes Ta n
3077 .It Sx \&Bt Ta \&No Ta \&No Ta 0
3078 .It Sx \&Bx Ta Yes Ta Yes Ta n
3079 .It Sx \&Cd Ta Yes Ta Yes Ta >0
3080 .It Sx \&Cm Ta Yes Ta Yes Ta >0
3081 .It Sx \&Db Ta \&No Ta \&No Ta 1
3082 .It Sx \&Dd Ta \&No Ta \&No Ta n
3083 .It Sx \&Dt Ta \&No Ta \&No Ta n
3084 .It Sx \&Dv Ta Yes Ta Yes Ta >0
3085 .It Sx \&Dx Ta Yes Ta Yes Ta n
3086 .It Sx \&Em Ta Yes Ta Yes Ta >0
3087 .It Sx \&Er Ta Yes Ta Yes Ta >0
3088 .It Sx \&Es Ta Yes Ta Yes Ta 2
3089 .It Sx \&Ev Ta Yes Ta Yes Ta >0
3090 .It Sx \&Ex Ta \&No Ta \&No Ta n
3091 .It Sx \&Fa Ta Yes Ta Yes Ta >0
3092 .It Sx \&Fd Ta \&No Ta \&No Ta >0
3093 .It Sx \&Fl Ta Yes Ta Yes Ta n
3094 .It Sx \&Fn Ta Yes Ta Yes Ta >0
3095 .It Sx \&Fr Ta Yes Ta Yes Ta >0
3096 .It Sx \&Ft Ta Yes Ta Yes Ta >0
3097 .It Sx \&Fx Ta Yes Ta Yes Ta n
3098 .It Sx \&Hf Ta \&No Ta \&No Ta n
3099 .It Sx \&Ic Ta Yes Ta Yes Ta >0
3100 .It Sx \&In Ta \&No Ta \&No Ta 1
3101 .It Sx \&Lb Ta \&No Ta \&No Ta 1
3102 .It Sx \&Li Ta Yes Ta Yes Ta >0
3103 .It Sx \&Lk Ta Yes Ta Yes Ta >0
3104 .It Sx \&Lp Ta \&No Ta \&No Ta 0
3105 .It Sx \&Ms Ta Yes Ta Yes Ta >0
3106 .It Sx \&Mt Ta Yes Ta Yes Ta >0
3107 .It Sx \&Nm Ta Yes Ta Yes Ta n
3108 .It Sx \&No Ta Yes Ta Yes Ta 0
3109 .It Sx \&Ns Ta Yes Ta Yes Ta 0
3110 .It Sx \&Nx Ta Yes Ta Yes Ta n
3111 .It Sx \&Os Ta \&No Ta \&No Ta n
3112 .It Sx \&Ot Ta Yes Ta Yes Ta >0
3113 .It Sx \&Ox Ta Yes Ta Yes Ta n
3114 .It Sx \&Pa Ta Yes Ta Yes Ta n
3115 .It Sx \&Pf Ta Yes Ta Yes Ta 1
3116 .It Sx \&Pp Ta \&No Ta \&No Ta 0
3117 .It Sx \&Rv Ta \&No Ta \&No Ta n
3118 .It Sx \&Sm Ta \&No Ta \&No Ta <2
3119 .It Sx \&St Ta \&No Ta Yes Ta 1
3120 .It Sx \&Sx Ta Yes Ta Yes Ta >0
3121 .It Sx \&Sy Ta Yes Ta Yes Ta >0
3122 .It Sx \&Tn Ta Yes Ta Yes Ta >0
3123 .It Sx \&Ud Ta \&No Ta \&No Ta 0
3124 .It Sx \&Ux Ta Yes Ta Yes Ta n
3125 .It Sx \&Va Ta Yes Ta Yes Ta n
3126 .It Sx \&Vt Ta Yes Ta Yes Ta >0
3127 .It Sx \&Xr Ta Yes Ta Yes Ta >0
3128 .It Sx \&br Ta \&No Ta \&No Ta 0
3129 .It Sx \&sp Ta \&No Ta \&No Ta 1
3132 When a macro argument consists of one single input character
3133 considered as a delimiter, the argument gets special handling.
3134 This does not apply when delimiters appear in arguments containing
3135 more than one character.
3136 Consequently, to prevent special handling and just handle it
3137 like any other argument, a delimiter can be escaped by prepending
3140 In text lines, delimiters never need escaping, but may be used
3141 as normal punctuation.
3143 For many macros, when the leading arguments are opening delimiters,
3144 these delimiters are put before the macro scope,
3145 and when the trailing arguments are closing delimiters,
3146 these delimiters are put after the macro scope.
3149 .D1 Pf \. \&Aq "( [ word ] ) ."
3153 .D1 Aq ( [ word ] ) .
3155 Opening delimiters are:
3157 .Bl -tag -width Ds -offset indent -compact
3164 Closing delimiters are:
3166 .Bl -tag -width Ds -offset indent -compact
3185 Note that even a period preceded by a backslash
3187 gets this special handling; use
3191 Many in-line macros interrupt their scope when they encounter
3192 delimiters, and resume their scope when more arguments follow that
3196 .D1 Pf \. \&Fl "a ( b | c \e*(Ba d ) e"
3200 .D1 Fl a ( b | c \*(Ba d ) e
3202 This applies to both opening and closing delimiters,
3203 and also to the middle delimiter:
3205 .Bl -tag -width Ds -offset indent -compact
3210 As a special case, the predefined string \e*(Ba is handled and rendered
3211 in the same way as a plain
3214 Using this predefined string is not recommended in new manuals.
3218 documents, usage of semantic markup is recommended in order to have
3219 proper fonts automatically selected; only when no fitting semantic markup
3220 is available, consider falling back to
3227 font mode, it will automatically restore the previous font when exiting
3229 Manually switching the font using the
3232 font escape sequences is never required.
3234 This section provides an incomplete list of compatibility issues
3235 between mandoc and GNU troff
3238 The following problematic behaviour is found in groff:
3243 with non-standard arguments behaves very strangely.
3244 When there are three arguments, they are printed verbatim.
3245 Any other number of arguments is replaced by the current date,
3246 but without any arguments the string
3251 only accepts a single link-name argument; the remainder is misformatted.
3254 does not format its arguments when used in the FILES section under
3258 can only be called by other macros, but not at the beginning of a line.
3261 is not implemented (up to and including groff-1.22.2).
3267 .Pq font family face
3269 escapes behave irregularly when specified within line-macro scopes.
3271 Negative scaling units return to prior lines.
3272 Instead, mandoc truncates them to zero.
3275 The following features are unimplemented in mandoc:
3281 is unsupported for security reasons.
3285 does not adjust the right margin, but is an alias for
3291 does not use a literal font, but is an alias for
3296 .Fl offset Cm center
3300 Groff does not implement centered and flush-right rendering either,
3301 but produces large indentations.
3314 language first appeared as a troff macro package in
3316 It was later significantly updated by Werner Lemberg and Ruslan Ermilov
3318 The standalone implementation that is part of the
3320 utility written by Kristaps Dzonsons appeared in
3325 reference was written by
3326 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .