1 .\" $Id: mdoc.7,v 1.114 2010/06/03 14:29:52 kristaps Exp $
3 .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: June 3 2010 $
22 .Nd mdoc language reference
26 language is used to format
29 manuals. In this reference document, we describe its syntax, structure,
30 and usage. Our reference implementation is mandoc; the
32 section describes compatibility with other troff \-mdoc implementations.
36 document follows simple rules: lines beginning with the control
39 are parsed for macros. Other lines are interpreted within the scope of
41 .Bd -literal -offset indent
42 \&.Sh Macro lines change control state.
43 Other lines are interpreted within the current state.
47 documents may contain only graphable 7-bit ASCII characters, the space
48 character, and, in certain circumstances, the tab character. All
55 whether in a macro or free-form text line, is ignored to the end of
56 line. A macro line with only a control character and comment escape,
58 is also ignored. Macro lines with only a control charater and optionally
59 whitespace are stripped from input.
60 .Ss Reserved Characters
61 Within a macro line, the following characters are reserved:
63 .Bl -tag -width Ds -offset indent -compact
88 Use of reserved characters is described in
90 For general use in macro lines, these characters must either be escaped
91 with a non-breaking space
93 or, if applicable, an appropriate escape sequence used.
94 .Ss Special Characters
95 Special characters may occur in both macro and free-form lines.
96 Sequences begin with the escape character
98 followed by either an open-parenthesis
100 for two-character sequences; an open-bracket
102 for n-character sequences (terminated at a close-bracket
104 or a single one-character sequence.
115 Terms may be text-decorated using the
117 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
118 (revert to previous mode):
120 .D1 \efBbold\efR \efIitalic\efP
122 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
123 respectively) may be used instead.
124 A text decoration is valid within
125 the current font scope only: if a macro opens a font scope alongside
126 its own scope, such as
129 in-scope invocations of
131 are only valid within the font scope of the macro.
134 is specified outside of any font scope, such as in unenclosed, free-form
135 text, it will affect the remainder of the document.
137 Text may also be sized with the
139 escape, whose syntax is one of
141 for one-digit numerals;
145 for two-digit numerals; and
151 for arbitrary-digit numerals:
154 .D1 \es[+10]much bigger\es[-10]
155 .D1 \es+(10much bigger\es-(10
156 .D1 \es+'100'much much bigger\es-'100'
162 which encourages semantic annotation.
163 .Ss Predefined Strings
166 also defined a set of package-specific
167 .Dq predefined strings ,
169 .Sx Special Characters ,
170 demark special output characters and strings by way of input codes.
171 Predefined strings are escaped with the slash-asterisk,
189 Whitespace consists of the space character.
190 In free-form lines, whitespace is preserved within a line; un-escaped
191 trailing spaces are stripped from input (unless in a literal context).
192 Blank free-form lines, which may include whitespace, are only permitted
193 within literal contexts.
195 In macro lines, whitespace delimits arguments and is discarded.
196 If arguments are quoted, whitespace within the quotes is retained.
198 Macro arguments may be quoted with a double-quote to group
199 space-delimited terms or to retain blocks of whitespace.
200 A quoted argument begins with a double-quote preceded by whitespace.
201 The next double-quote not pair-wise adjacent to another double-quote
202 terminates the literal, regardless of surrounding whitespace.
210 Note that any quoted term, be it argument or macro, is indiscriminately
211 considered literal text.
212 Thus, the following produces
214 .Bd -literal -offset indent
218 In free-form mode, quotes are regarded as opaque text.
220 There are several macros in
222 that require a date argument.
223 The canonical form for dates is the American format:
225 .D1 Cm Month Day , Year
229 value is an optionally zero-padded numeral.
232 value is the full month name.
235 value is the full four-digit year.
237 Reduced form dates are broken-down canonical form dates:
242 Some examples of valid dates follow:
244 .D1 "May, 2009" Pq reduced form
245 .D1 "2009" Pq reduced form
246 .D1 "May 20, 2009" Pq canonical form
248 Many macros support scaled widths for their arguments, such as
249 stipulating a two-inch list indentation with the following:
250 .Bd -literal -offset indent
254 The syntax for scaled widths is
255 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
256 where a decimal must be preceded or proceeded by at least one digit.
257 Negative numbers, while accepted, are truncated to zero.
258 The following scaling units are accepted:
260 .Bl -tag -width Ds -offset indent -compact
273 default vertical span
285 default horizontal span
290 Using anything other than
296 is necessarily non-portable across output media.
300 When composing a manual, make sure that your sentences end at the end of
302 By doing so, front-ends will be able to apply the proper amount of
303 spacing after the end of sentence (unescaped) period, exclamation mark,
304 or question mark followed by zero or more non-sentence closing
311 The proper spacing is also intelligently preserved if a sentence ends at
312 the boundary of a macro line, e.g.,
315 .D1 \&Fl T \&Ns \&Cm ascii \.
319 document consists of a document prologue followed by one or more
322 The prologue, which consists of (in order) the
327 macros, is required for every document.
329 The first section (sections are denoted by
331 must be the NAME section, consisting of at least one
336 Following that, convention dictates specifying at least the SYNOPSIS and
337 DESCRIPTION sections, although this varies between manual sections.
339 The following is a well-formed skeleton
342 .Bd -literal -offset indent
348 \&.Nd a description goes here
349 \&.\e\*q The next is for sections 2, 3, & 9 only.
358 utility processes files ...
359 \&.\e\*q .Sh IMPLEMENTATION NOTES
360 \&.\e\*q The next is for sections 2, 3, & 9 only.
361 \&.\e\*q .Sh RETURN VALUES
362 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
363 \&.\e\*q .Sh ENVIRONMENT
365 \&.\e\*q The next is for sections 1 & 8 only.
366 \&.\e\*q .Sh EXIT STATUS
367 \&.\e\*q .Sh EXAMPLES
368 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
369 \&.\e\*q .Sh DIAGNOSTICS
370 \&.\e\*q The next is for sections 2, 3, & 9 only.
372 \&.\e\*q .Sh SEE ALSO
373 \&.\e\*q .Xr foobar 1
374 \&.\e\*q .Sh STANDARDS
379 \&.\e\*q .Sh SECURITY CONSIDERATIONS
384 document are conventionally ordered as they appear above.
385 Sections should be composed as follows:
386 .Bl -ohang -offset Ds
388 The name(s) and a short description of the documented material.
389 The syntax for this as follows:
390 .Bd -literal -offset indent
394 \&.Nd a short description
399 macro(s) must precede the
408 The name of the library containing the documented material, which is
409 assumed to be a function in a section 2, 3, or 9 manual.
410 The syntax for this is as follows:
411 .Bd -literal -offset indent
418 Documents the utility invocation syntax, function call syntax, or device
421 For the first, utilities (sections 1, 6, and 8), this is
422 generally structured as follows:
423 .Bd -literal -offset indent
434 For the second, function calls (sections 2, 3, 9):
435 .Bd -literal -offset indent
436 \&.Vt extern const char *global;
439 \&.Fn foo "const char *src"
441 \&.Fn bar "const char *src"
444 And for the third, configurations (section 4):
445 .Bd -literal -offset indent
446 \&.Cd \*qit* at isa? port 0x2e\*q
447 \&.Cd \*qit* at isa? port 0x4e\*q
450 Manuals not in these sections generally don't need a
461 This expands upon the brief, one-line description in
463 It usually contains a break-down of the options (if documenting a
465 .Bd -literal -offset indent
466 The arguments are as follows:
467 \&.Bl \-tag \-width Ds
469 Print verbose information.
473 Manuals not documenting a command won't include the above fragment.
474 .It Em IMPLEMENTATION NOTES
475 Implementation-specific notes should be kept here.
476 This is useful when implementing standard functions that may have side
477 effects or notable algorithmic implications.
479 This section is the dual of
481 which is used for commands.
482 It documents the return values of functions in sections 2, 3, and 9.
487 Documents any usages of environment variables, e.g.,
493 Documents files used.
494 It's helpful to document both the file and a short description of how
495 the file is used (created, modified, etc.).
500 Command exit status for section 1, 6, and 8 manuals.
501 This section is the dual of
503 which is used for functions.
504 Historically, this information was described in
506 a practise that is now discouraged.
512 This often contains snippets of well-formed, well-tested invocations.
513 Make doubly sure that your examples work properly!
515 Documents error conditions.
516 This is most useful in section 4 manuals.
517 Historically, this section was used in place of
519 for manuals in sections 1, 6, and 8; however, this practise is
526 Documents error handling in sections 2, 3, and 9.
531 References other manuals with related topics.
532 This section should exist for most manuals.
533 Cross-references should conventionally be ordered first by section, then
539 References any standards implemented or used.
540 If not adhering to any standards, the
542 section should be used instead.
547 The history of any manual without a
549 section should be described in this section.
551 Credits to authors, if applicable, should appear in this section.
552 Authors should generally be noted by both name and an e-mail address.
557 Explanations of common misuses and misunderstandings should be explained
560 Extant bugs should be described in this section.
561 .It Em SECURITY CONSIDERATIONS
562 Documents any security precautions that operators should consider.
565 Macros are one to three three characters in length and begin with a
568 at the beginning of the line.
569 An arbitrary amount of whitespace may sit between the control character
571 Thus, the following are equivalent:
572 .Bd -literal -offset indent
577 The syntax of a macro depends on its classification.
580 refers to macro arguments, which may be followed by zero or more
584 opens the scope of a macro; and if specified,
590 column indicates that the macro may be called subsequent to the initial
592 If a macro is not callable, then its invocation after the initial line
593 macro is interpreted as opaque text, such that
600 column indicates whether the macro may be followed by further
601 (ostensibly callable) macros.
602 If a macro is not parsable, subsequent macro invocations on the line
603 will be interpreted as opaque text.
607 column, if applicable, describes closure rules.
608 .Ss Block full-explicit
609 Multi-line scope closed by an explicit closing macro.
610 All macros contains bodies; only
613 .Bd -literal -offset indent
614 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
619 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
620 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
621 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
622 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
623 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
624 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
625 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
626 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
627 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
628 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
630 .Ss Block full-implicit
631 Multi-line scope closed by end-of-file or implicitly by another macro.
632 All macros have bodies; some
640 don't have heads; only one
645 .Bd -literal -offset indent
646 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
650 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
651 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
652 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
653 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
654 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
655 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
657 .Ss Block partial-explicit
658 Like block full-explicit, but also with single-line scope.
659 Each has at least a body and, in limited circumstances, a head
666 .Bd -literal -offset indent
667 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
669 \&.Yc \(lBtail...\(rB
671 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
672 \(lBbody...\(rB \&Yc \(lBtail...\(rB
675 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
676 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
677 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
678 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
679 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
680 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
681 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
682 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
683 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
684 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
685 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
686 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
687 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
688 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
689 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
690 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
691 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
692 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
693 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
694 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
695 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
696 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
697 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
698 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
699 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
700 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
702 .Ss Block partial-implicit
703 Like block full-implicit, but with single-line scope closed by
704 .Sx Reserved Characters
706 .Bd -literal -offset indent
707 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
710 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
711 .It Em Macro Ta Em Callable Ta Em Parsable
712 .It Sx \&Aq Ta Yes Ta Yes
713 .It Sx \&Bq Ta Yes Ta Yes
714 .It Sx \&Brq Ta Yes Ta Yes
715 .It Sx \&D1 Ta \&No Ta \&Yes
716 .It Sx \&Dl Ta \&No Ta Yes
717 .It Sx \&Dq Ta Yes Ta Yes
718 .It Sx \&Op Ta Yes Ta Yes
719 .It Sx \&Pq Ta Yes Ta Yes
720 .It Sx \&Ql Ta Yes Ta Yes
721 .It Sx \&Qq Ta Yes Ta Yes
722 .It Sx \&Sq Ta Yes Ta Yes
723 .It Sx \&Vt Ta Yes Ta Yes
729 .Sx Block partial-implicit
730 only when invoked as the first macro
733 section line, else it is
737 .Sx Reserved Characters ,
738 end of line, fixed argument lengths, and/or subsequent macros.
739 In-line macros have only text children.
740 If a number (or inequality) of arguments is
742 then the macro accepts an arbitrary number of arguments.
743 .Bd -literal -offset indent
744 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
746 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
748 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
751 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
752 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
753 .It Sx \&%A Ta \&No Ta \&No Ta >0
754 .It Sx \&%B Ta \&No Ta \&No Ta >0
755 .It Sx \&%C Ta \&No Ta \&No Ta >0
756 .It Sx \&%D Ta \&No Ta \&No Ta >0
757 .It Sx \&%I Ta \&No Ta \&No Ta >0
758 .It Sx \&%J Ta \&No Ta \&No Ta >0
759 .It Sx \&%N Ta \&No Ta \&No Ta >0
760 .It Sx \&%O Ta \&No Ta \&No Ta >0
761 .It Sx \&%P Ta \&No Ta \&No Ta >0
762 .It Sx \&%Q Ta \&No Ta \&No Ta >0
763 .It Sx \&%R Ta \&No Ta \&No Ta >0
764 .It Sx \&%T Ta \&No Ta \&No Ta >0
765 .It Sx \&%U Ta \&No Ta \&No Ta >0
766 .It Sx \&%V Ta \&No Ta \&No Ta >0
767 .It Sx \&Ad Ta Yes Ta Yes Ta n
768 .It Sx \&An Ta Yes Ta Yes Ta n
769 .It Sx \&Ap Ta Yes Ta Yes Ta 0
770 .It Sx \&Ar Ta Yes Ta Yes Ta n
771 .It Sx \&At Ta Yes Ta Yes Ta 1
772 .It Sx \&Bsx Ta Yes Ta Yes Ta n
773 .It Sx \&Bt Ta \&No Ta \&No Ta 0
774 .It Sx \&Bx Ta Yes Ta Yes Ta n
775 .It Sx \&Cd Ta Yes Ta Yes Ta >0
776 .It Sx \&Cm Ta Yes Ta Yes Ta n
777 .It Sx \&Db Ta \&No Ta \&No Ta 1
778 .It Sx \&Dd Ta \&No Ta \&No Ta >0
779 .It Sx \&Dt Ta \&No Ta \&No Ta n
780 .It Sx \&Dv Ta Yes Ta Yes Ta n
781 .It Sx \&Dx Ta Yes Ta Yes Ta n
782 .It Sx \&Em Ta Yes Ta Yes Ta >0
783 .It Sx \&En Ta \&No Ta \&No Ta 0
784 .It Sx \&Er Ta Yes Ta Yes Ta >0
785 .It Sx \&Es Ta \&No Ta \&No Ta 0
786 .It Sx \&Ev Ta Yes Ta Yes Ta n
787 .It Sx \&Ex Ta \&No Ta \&No Ta n
788 .It Sx \&Fa Ta Yes Ta Yes Ta n
789 .It Sx \&Fd Ta \&No Ta \&No Ta >0
790 .It Sx \&Fl Ta Yes Ta Yes Ta n
791 .It Sx \&Fn Ta Yes Ta Yes Ta >0
792 .It Sx \&Fr Ta \&No Ta \&No Ta n
793 .It Sx \&Ft Ta Yes Ta Yes Ta n
794 .It Sx \&Fx Ta Yes Ta Yes Ta n
795 .It Sx \&Hf Ta \&No Ta \&No Ta n
796 .It Sx \&Ic Ta Yes Ta Yes Ta >0
797 .It Sx \&In Ta \&No Ta \&No Ta n
798 .It Sx \&Lb Ta \&No Ta \&No Ta 1
799 .It Sx \&Li Ta Yes Ta Yes Ta n
800 .It Sx \&Lk Ta Yes Ta Yes Ta n
801 .It Sx \&Lp Ta \&No Ta \&No Ta 0
802 .It Sx \&Ms Ta Yes Ta Yes Ta >0
803 .It Sx \&Mt Ta Yes Ta Yes Ta >0
804 .It Sx \&Nm Ta Yes Ta Yes Ta n
805 .It Sx \&No Ta Yes Ta Yes Ta 0
806 .It Sx \&Ns Ta Yes Ta Yes Ta 0
807 .It Sx \&Nx Ta Yes Ta Yes Ta n
808 .It Sx \&Os Ta \&No Ta \&No Ta n
809 .It Sx \&Ot Ta \&No Ta \&No Ta n
810 .It Sx \&Ox Ta Yes Ta Yes Ta n
811 .It Sx \&Pa Ta Yes Ta Yes Ta n
812 .It Sx \&Pf Ta Yes Ta Yes Ta 1
813 .It Sx \&Pp Ta \&No Ta \&No Ta 0
814 .It Sx \&Rv Ta \&No Ta \&No Ta n
815 .It Sx \&Sm Ta \&No Ta \&No Ta 1
816 .It Sx \&St Ta \&No Ta Yes Ta 1
817 .It Sx \&Sx Ta Yes Ta Yes Ta >0
818 .It Sx \&Sy Ta Yes Ta Yes Ta >0
819 .It Sx \&Tn Ta Yes Ta Yes Ta >0
820 .It Sx \&Ud Ta \&No Ta \&No Ta 0
821 .It Sx \&Ux Ta Yes Ta Yes Ta n
822 .It Sx \&Va Ta Yes Ta Yes Ta n
823 .It Sx \&Vt Ta Yes Ta Yes Ta >0
824 .It Sx \&Xr Ta Yes Ta Yes Ta >0
825 .It Sx \&br Ta \&No Ta \&No Ta 0
826 .It Sx \&sp Ta \&No Ta \&No Ta 1
829 This section is a canonical reference of all macros, arranged
831 For the scoping of individual macros, see
836 block. Multiple authors should each be accorded their own
838 line. Author names should be ordered with full or abbreviated
839 forename(s) first, then full surname.
843 block. This macro may also be used in a non-bibliographic context when
844 referring to book titles.
846 Publication city or location of an
851 this macro is not implemented in
854 Publication date of an
856 block. This should follow the reduced or canonical form syntax
860 Publisher or issuer name of an
868 Issue number (usually for journals) of an
872 Optional information of an
876 Book or journal page number of an
880 Institutional author (school, government, etc.) of an
882 block. Multiple institutional authors should each be accorded their own
886 Technical report name of an
892 block. This macro may also be used in a non-bibliographical context
893 when referring to article titles.
895 URI of reference document.
903 block. Does not have any tail arguments.
905 Address construct: usually in the context of an computational address in
906 memory, not a physical (post) address.
913 This macro may alternatively accepts the following arguments, although
914 these may not be specified along with a parameter:
915 .Bl -tag -width 12n -offset indent
917 Renders a line break before each author listing.
923 In the AUTHORS section, the default is not to split the first author
924 listing, but all subsequent author listings, whether or not they're
925 interspersed by other macros or text, are split.
928 will cause the first listing also to be split.
929 If not in the AUTHORS section, the default is not to split.
933 .D1 \&.An J. D. Ullman .
940 are re-set when entering the AUTHORS section, so if one specifies
942 in the general document body, it must be re-specified in the AUTHORS
945 Begins a block enclosed by angled brackets.
946 Does not have any head arguments.
949 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
954 Inserts an apostrophe without any surrounding white-space.
955 This is generally used as a grammatic device when referring to the verb
957 .Bd -literal -offset indent
961 Encloses its arguments in angled brackets.
964 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
967 this macro is often abused for rendering URIs, which should instead use
971 or to note pre-processor
973 statements, which should use
980 If an argument is not provided, the string
982 is used as a default.
985 .D1 \&.Fl o \&Ns \&Ar file1
987 .D1 \&.Ar arg1 , arg2 .
989 Formats an AT&T version.
990 Accepts at most one parameter:
991 .Bl -tag -width 12n -offset indent
1000 Note that these parameters do not begin with a hyphen.
1018 block. Does not have any tail arguments.
1020 Begins a display block.
1021 A display is collection of macros or text which may be collectively
1022 offset or justified in a manner different from that
1023 of the enclosing context.
1024 By default, the block is preceded by a vertical space.
1026 Each display is associated with a type, which must be one of the
1027 following arguments:
1028 .Bl -tag -width 12n -offset indent
1030 Only left-justify the block.
1032 Do not justify the block at all.
1034 Left- and right-justify the block.
1039 Centre-justify each line.
1042 The type must be provided first.
1043 Secondary arguments are as follows:
1044 .Bl -tag -width 12n -offset indent
1045 .It Fl offset Ar width
1046 Offset by the value of
1048 which is interpreted as one of the following, specified in order:
1051 As one of the pre-defined strings
1053 the width of standard indentation;
1058 which has no effect ;
1060 which justifies to the right margin; and
1062 which aligns around an imagined centre axis.
1064 As a precalculated width for a named macro.
1065 The most popular is the imaginary macro
1070 As a scaling unit following the syntax described in
1071 .Sx Scaling Widths .
1073 As the calculated string length of the opaque string.
1076 If unset, it will revert to the value of
1079 .Sx Scaling Widths .
1081 Do not assert a vertical space before the block.
1085 before any text or macros within the block.
1089 .Bd -literal -offset indent
1090 \&.Bd \-unfilled \-offset two-indent \-compact
1102 Begins a list composed of one or more list entries.
1103 A list is associated with a type, which is a required argument.
1106 defined per-type as accepting a literal or
1110 also accepting a literal or
1112 value setting the list's global offset; and
1114 suppressing the default vertical space printed before each list entry.
1115 A list entry is specified by the
1117 macro, which consists of a head and optional body (depending on the list
1119 A list must specify one of the following list types:
1120 .Bl -tag -width 12n -offset indent
1122 A list offset by a bullet.
1123 The head of list entries must be empty.
1124 List entry bodies are positioned after the bullet.
1127 argument varies the width of list bodies' left-margins.
1132 argument has no effect.
1133 The number of columns is specified as parameters to the
1136 These dictate the width of columns either as
1139 If the initial macro of a
1145 context spanning each line is implied until an
1147 line macro is encountered, at which point list bodies are interpreted as
1152 A list offset by a dash (hyphen).
1153 The head of list entries must be empty.
1154 List entry bodies are positioned past the dash.
1157 argument varies the width of list bodies' left-margins.
1161 but with additional formatting to the head.
1164 argument varies the width of list bodies' left-margins.
1166 An enumerated list offset by the enumeration from 1.
1167 The head of list entries must be empty.
1168 List entry bodies are positioned after the enumeration.
1171 argument varies the width of list bodies' left-margins.
1175 but instead of list bodies positioned after the head, they trail the
1179 argument varies the width of list bodies' left-margins.
1184 List bodies follow the list head.
1187 argument is ignored.
1189 This produces blocks of text.
1190 The head of list entries must be empty.
1193 argument is ignored.
1195 List bodies are positioned on the line following the head.
1198 argument is ignored.
1200 A list offset by list entry heads. List entry bodies are positioned
1201 after the head as specified by the
1209 Begins a block enclosed by square brackets.
1210 Does not have any head arguments.
1213 .Bd -literal -offset indent
1221 Encloses its arguments in square brackets.
1224 .D1 \&.Bq 1 , \&Dv BUFSIZ
1227 this macro is sometimes abused to emulate optional arguments for
1228 commands; the correct macros to use for this purpose are
1239 block. Does not have any tail arguments.
1241 Begins a block enclosed by curly braces.
1242 Does not have any head arguments.
1245 .Bd -literal -offset indent
1253 Encloses its arguments in curly braces.
1256 .D1 \&.Brq 1 , ... , \&Va n
1261 Format the BSD/OS version provided as an argument, or a default value if
1262 no argument is provided.
1279 .Dq is currently in beta test.
1281 Format the BSD version provided as an argument, or a default value if no
1282 argument is provided.
1298 Configuration declaration.
1299 This denotes strings accepted by
1303 .D1 \&.Cd device le0 at scode?
1306 this macro is commonly abused by using quoted literals to retain
1307 white-space and align consecutive
1310 This practise is discouraged.
1313 Useful when specifying configuration options or keys.
1316 .D1 \&.Cm ControlPath
1317 .D1 \&.Cm ControlMaster
1322 One-line indented display.
1323 This is formatted by the default rules and is useful for simple indented
1325 It is followed by a newline.
1328 .D1 \&.D1 \&Fl abcdefgh
1338 block. Does not have any tail arguments.
1341 This is the mandatory first macro of any
1344 Its calling syntax is as follows:
1346 .D1 \. Ns Sx \&Dd Cm date
1352 which signifies the current manual revision date dictated by
1354 or instead a valid canonical date as specified by
1356 If a date does not conform, the current date is used instead.
1359 .D1 \&.Dd $\&Mdocdate$
1360 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1361 .D1 \&.Dd July 21, 2007
1368 One-line intended display.
1369 This is formatted as literal text and is useful for commands and
1371 It is followed by a newline.
1374 .D1 \&.Dl % mandoc mdoc.7 | less
1381 Begins a block enclosed by double quotes. Does not have any head
1385 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1390 Encloses its arguments in double quotes.
1393 .Bd -literal -offset indent -compact
1394 \&.Dq April is the cruellest month
1402 This is the mandatory second macro of any
1405 Its calling syntax is as follows:
1407 .D1 \. Ns Sx \&Dt Op Cm title Op Cm section Op Cm volume | arch
1409 Its arguments are as follows:
1410 .Bl -tag -width Ds -offset Ds
1412 The document's title (name), defaulting to
1415 It should be capitalised.
1426 .Pq Perl libraries ,
1436 .Pq system utilities ,
1438 .Pq kernel functions ,
1440 .Pq X Window System ,
1442 .Pq X Window System ,
1452 It should correspond to the manual's filename suffix and defaults to
1456 This overrides the volume inferred from
1458 This field is optional, and if specified, must be one of
1460 .Pq users' supplementary documents ,
1462 .Pq programmers' supplementary documents ,
1464 .Pq administrators' supplementary documents ,
1466 .Pq system managers' manuals ,
1468 .Pq users' reference manuals ,
1470 .Pq programmers' reference manuals ,
1472 .Pq kernel manuals ,
1483 .Pq contributed manuals .
1485 This specifies a specific relevant architecture.
1488 is not provided, it may be used in its place, else it may be used
1490 It, too, is optional.
1525 .D1 \&.Dt FOO 9 i386
1532 Defined variables such as preprocessor constants.
1536 .D1 \&.Dv STDOUT_FILENO
1541 Format the DragonFly BSD version provided as an argument, or a default
1542 value if no argument is provided.
1563 Denotes text that should be emphasised.
1564 Note that this is a presentation term and should not be used for
1565 stylistically decorating technical terms.
1573 Display error constants.
1583 Environmental variables such as those specified in
1590 Inserts text regarding a utility's exit values.
1591 This macro must have first the
1593 argument specified, then an optional
1597 is not provided, the document's name as stipulated in
1605 Used when listing arguments to command-line utilities.
1606 Prints a fixed-width hyphen
1608 directly followed by each argument.
1609 If no arguments are provided, a hyphen is printed followed by a space.
1610 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1617 .D1 \&.Op \&Fl o \&Ns \&Ar file
1626 Format the FreeBSD version provided as an argument, or a default value
1627 if no argument is provided.
1646 A list item. The syntax of this macro depends on the list type.
1655 have the following calling syntax:
1657 .D1 \. Ns Sx \&It Cm args
1666 have the following calling syntax:
1670 with subsequent lines interpreted within the scope of the
1672 until either a closing
1681 .D1 \. Ns Sx \&It Op Cm args
1683 with subsequent lines interpreted as with
1686 The line arguments correspond to the list's left-hand side; body
1687 arguments correspond to the list's contents.
1691 list is the most complicated.
1694 .D1 \. Ns Sx \&It Op Cm args
1698 are phrases, a mix of macros and text corresponding to a line column,
1699 delimited by tabs or the special
1702 Lines subsequent the
1704 are interpreted within the scope of the last phrase.
1705 Calling the pseudo-macro
1707 will open a new phrase scope (this must occur on a macro line to be
1708 interpreted as a macro). Note that the tab phrase delimiter may only be
1712 Subsequent this, only the
1714 pseudo-macro may be used to delimit phrases.
1715 Furthermore, note that quoted sections propogate over tab-delimited
1720 .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq ;
1722 will preserve the semicolon whitespace except for the last.
1728 The calling syntax is as follows:
1730 .D1 \. Ns Sx \&Lb Cm library
1734 parameter may be a system library, such as
1738 in which case a small library description is printed next to the linker
1739 invocation; or a custom library, in which case the library name is
1741 This is most commonly used in the
1743 section as described in
1744 .Sx MANUAL STRUCTURE .
1752 The calling syntax is as follows:
1754 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1757 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1758 .D1 \&.Lk http://bsd.lv
1770 Format the NetBSD version provided as an argument, or a default value if
1771 no argument is provided.
1790 Document operating system version.
1791 This is the mandatory third macro of
1794 file. Its calling syntax is as follows:
1796 .D1 \. Ns Sx \&Os Op Cm system
1800 parameter specifies the relevant operating system or environment.
1801 Left unspecified, it defaults to the local operating system version.
1802 This is the suggested form.
1806 .D1 \&.Os KTH/CSC/TCS
1817 this macro has been deprecated.
1819 Format the OpenBSD version provided as an argument, or a default value
1820 if no argument is provided.
1849 Does not have any tail arguments.
1851 Begins a bibliographic
1854 Does not have any head arguments.
1855 The block macro may only contain
1870 child macros (at least one must be specified).
1873 .Bd -literal -offset indent -compact
1875 \&.%A J. E. Hopcroft
1877 \&.%B Introduction to Automata Theory, Languages, and Computation
1878 \&.%I Addison-Wesley
1879 \&.%C Reading, Massachusettes
1886 block is used within a SEE ALSO section, a vertical space is asserted
1887 before the rendered output, else the block continues on the current
1902 .Dq currently under development.
1904 Format the UNIX name.
1905 Accepts no argument.
1922 This is also used for indicating global variables in the SYNOPSIS
1923 section, in which case a variable name is also specified.
1924 Note that it accepts
1925 .Sx Block partial-implicit
1926 syntax when invoked as the first macro in the SYNOPSIS section, else it
1931 Note that this should not be confused with
1933 which is used for function return types.
1936 .D1 \&.Vt unsigned char
1937 .D1 \&.Vt extern const char * const sys_signame[] ;
1944 Close a scope opened by
1947 Open an extension scope.
1948 This macro originally existed to extend the 9-argument limit of troff;
1949 since this limit has been lifted, the macro has been deprecated.
1951 Link to another manual
1952 .Pq Qq cross-reference .
1953 Its calling syntax is
1955 .D1 \. Ns Sx \&Xr Cm name section
1961 are the name and section of the linked manual.
1964 is followed by non-punctuation, an
1966 is inserted into the token stream.
1967 This behaviour is for compatibility with
1972 .D1 \&.Xr mandoc 1 ;
1973 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1977 This section documents compatibility between mandoc and other other
1978 troff implementations, at this time limited to GNU troff
1982 refers to groff versions before the
1985 .Pq somewhere between 1.15 and 1.19 .
1987 Heirloom troff, the other significant troff implementation accepting
1988 \-mdoc, is similar to historic groff.
1994 is no longer accepted.
1998 macro does not format its arguments when used in the FILES section under
2002 Historic groff does not print a dash for empty
2005 mandoc and newer groff implementations do.
2007 groff behaves irregularly when specifying
2010 within line-macro scopes.
2011 mandoc follows a consistent system.
2013 In mandoc, negative scaling units are truncated to zero; groff would
2014 move to prior lines.
2017 scaling unit, while accepted, is rendered as the default unit.
2019 In quoted literals, groff allowed pair-wise double-quotes to produce a
2020 standalone double-quote in formatted output.
2021 This idiosyncratic behaviour is not applicable in mandoc.
2030 in manodc. Furthermore, the
2032 argument is ignored.
2033 Lastly, since text is not right-justified in mandoc (or even groff),
2042 Historic groff has many un-callable macros.
2043 Most of these (excluding some block-level macros) are now callable.
2049 but has been a proper delimiter since then.
2052 is assumed for all lists (it wasn't in historic groff): any list may be
2055 lists will restart the sequence only for the sub-list.
2059 incorrectly by following it with a reserved character and expecting the
2060 delimiter to render.
2061 This is not supported in mandoc.
2065 macro only produces the first parameter.
2066 This is not the case in mandoc.
2074 macros were stipulated only to occur in certain manual sections.
2075 mandoc does not have these restrictions.
2077 Newer groff and mandoc print
2079 prior to unknown arguments of
2081 older groff did nothing.
2089 reference was written by
2090 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
2092 .\" XXX: this really isn't the place for these caveats.
2096 .\" There are many ambiguous parts of mdoc.
2099 .\" .Bl -dash -compact
2104 .\" as function arguments are variables.
2109 .\" as function return types are still types. Furthermore, the
2111 .\" should be removed and
2113 .\" which ostensibly follows it, should follow the same convention as
2117 .\" should formalise that only one or two arguments are acceptable: a
2118 .\" variable name and optional, preceding type.
2121 .\" is ambiguous. It's commonly used to indicate an include file in the
2122 .\" synopsis section.
2124 .\" should be used, instead.
2130 .\" makes sense. The remaining ones should be removed.
2136 .\" macros should be deprecated.
2140 .\" macro lacks clarity. It should be absolutely clear which title will
2141 .\" render when formatting the manual page.
2145 .\" should be provided for Linux (\(`a la
2150 .\" There's no way to refer to references in
2154 .\" The \-split and \-nosplit dictates via
2156 .\" are re-set when entering and leaving the AUTHORS section.