1 .\" $Id: mdoc.7,v 1.127 2010/06/27 13:30:51 schwarze 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 27 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 character 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 mark 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
340 sections, although this varies between manual sections.
342 The following is a well-formed skeleton
345 .Bd -literal -offset indent
351 \&.Nd a description goes here
352 \&.\e\*q The next is for sections 2, 3, & 9 only.
361 utility processes files ...
362 \&.\e\*q .Sh IMPLEMENTATION NOTES
363 \&.\e\*q The next is for sections 2, 3, & 9 only.
364 \&.\e\*q .Sh RETURN VALUES
365 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
366 \&.\e\*q .Sh ENVIRONMENT
368 \&.\e\*q The next is for sections 1 & 8 only.
369 \&.\e\*q .Sh EXIT STATUS
370 \&.\e\*q .Sh EXAMPLES
371 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
372 \&.\e\*q .Sh DIAGNOSTICS
373 \&.\e\*q The next is for sections 2, 3, & 9 only.
375 \&.\e\*q .Sh SEE ALSO
376 \&.\e\*q .Xr foobar 1
377 \&.\e\*q .Sh STANDARDS
382 \&.\e\*q .Sh SECURITY CONSIDERATIONS
387 document are conventionally ordered as they appear above.
388 Sections should be composed as follows:
389 .Bl -ohang -offset Ds
391 The name(s) and a short description of the documented material.
392 The syntax for this as follows:
393 .Bd -literal -offset indent
397 \&.Nd a short description
402 macro(s) must precede the
411 The name of the library containing the documented material, which is
412 assumed to be a function in a section 2, 3, or 9 manual.
413 The syntax for this is as follows:
414 .Bd -literal -offset indent
421 Documents the utility invocation syntax, function call syntax, or device
424 For the first, utilities (sections 1, 6, and 8), this is
425 generally structured as follows:
426 .Bd -literal -offset indent
437 For the second, function calls (sections 2, 3, 9):
438 .Bd -literal -offset indent
439 \&.Vt extern const char *global;
442 \&.Fn foo "const char *src"
444 \&.Fn bar "const char *src"
447 And for the third, configurations (section 4):
448 .Bd -literal -offset indent
449 \&.Cd \*qit* at isa? port 0x2e\*q
450 \&.Cd \*qit* at isa? port 0x4e\*q
453 Manuals not in these sections generally don't need a
456 Some macros are displayed differently in the
458 section, particularly
468 All of these macros are output on their own line. If two such
469 dissimilar macros are pair-wise invoked (except for
475 they are separated by a vertical space, unless in the case of
480 which are always separated by vertical space.
482 This expands upon the brief, one-line description in
484 It usually contains a break-down of the options (if documenting a
486 .Bd -literal -offset indent
487 The arguments are as follows:
488 \&.Bl \-tag \-width Ds
490 Print verbose information.
494 Manuals not documenting a command won't include the above fragment.
495 .It Em IMPLEMENTATION NOTES
496 Implementation-specific notes should be kept here.
497 This is useful when implementing standard functions that may have side
498 effects or notable algorithmic implications.
500 This section is the dual of
502 which is used for commands.
503 It documents the return values of functions in sections 2, 3, and 9.
508 Documents any usages of environment variables, e.g.,
514 Documents files used.
515 It's helpful to document both the file and a short description of how
516 the file is used (created, modified, etc.).
521 Command exit status for section 1, 6, and 8 manuals.
522 This section is the dual of
524 which is used for functions.
525 Historically, this information was described in
527 a practise that is now discouraged.
533 This often contains snippets of well-formed, well-tested invocations.
534 Make doubly sure that your examples work properly!
536 Documents error conditions.
537 This is most useful in section 4 manuals.
538 Historically, this section was used in place of
540 for manuals in sections 1, 6, and 8; however, this practise is
547 Documents error handling in sections 2, 3, and 9.
552 References other manuals with related topics.
553 This section should exist for most manuals.
554 Cross-references should conventionally be ordered first by section, then
560 References any standards implemented or used.
561 If not adhering to any standards, the
563 section should be used instead.
568 The history of any manual without a
570 section should be described in this section.
572 Credits to authors, if applicable, should appear in this section.
573 Authors should generally be noted by both name and an e-mail address.
578 Explanations of common misuses and misunderstandings should be explained
581 Extant bugs should be described in this section.
582 .It Em SECURITY CONSIDERATIONS
583 Documents any security precautions that operators should consider.
586 Macros are one to three three characters in length and begin with a
589 at the beginning of the line.
590 An arbitrary amount of whitespace may sit between the control character
592 Thus, the following are equivalent:
593 .Bd -literal -offset indent
598 The syntax of a macro depends on its classification.
601 refers to macro arguments, which may be followed by zero or more
605 opens the scope of a macro; and if specified,
611 column indicates that the macro may be called subsequent to the initial
613 If a macro is not callable, then its invocation after the initial line
614 macro is interpreted as opaque text, such that
621 column indicates whether the macro may be followed by further
622 (ostensibly callable) macros.
623 If a macro is not parsable, subsequent macro invocations on the line
624 will be interpreted as opaque text.
628 column, if applicable, describes closure rules.
629 .Ss Block full-explicit
630 Multi-line scope closed by an explicit closing macro.
631 All macros contains bodies; only
634 .Bd -literal -offset indent
635 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
640 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
641 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
642 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
643 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
644 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
645 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
646 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
647 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
648 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
649 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
651 .Ss Block full-implicit
652 Multi-line scope closed by end-of-file or implicitly by another macro.
653 All macros have bodies; some
661 don't have heads; only one
666 .Bd -literal -offset indent
667 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
671 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
672 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
673 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
674 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
675 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
676 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
678 .Ss Block partial-explicit
679 Like block full-explicit, but also with single-line scope.
680 Each has at least a body and, in limited circumstances, a head
687 .Bd -literal -offset indent
688 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
690 \&.Yc \(lBtail...\(rB
692 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
693 \(lBbody...\(rB \&Yc \(lBtail...\(rB
696 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
697 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
698 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
699 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
700 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
701 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
702 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
703 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
704 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
705 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
706 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
707 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
708 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
709 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
710 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
711 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
712 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
713 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
714 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
715 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
716 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
717 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
718 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
719 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
720 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
721 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
723 .Ss Block partial-implicit
724 Like block full-implicit, but with single-line scope closed by
725 .Sx Reserved Characters
727 .Bd -literal -offset indent
728 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
731 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
732 .It Em Macro Ta Em Callable Ta Em Parsable
733 .It Sx \&Aq Ta Yes Ta Yes
734 .It Sx \&Bq Ta Yes Ta Yes
735 .It Sx \&Brq Ta Yes Ta Yes
736 .It Sx \&D1 Ta \&No Ta \&Yes
737 .It Sx \&Dl Ta \&No Ta Yes
738 .It Sx \&Dq Ta Yes Ta Yes
739 .It Sx \&Op Ta Yes Ta Yes
740 .It Sx \&Pq Ta Yes Ta Yes
741 .It Sx \&Ql Ta Yes Ta Yes
742 .It Sx \&Qq Ta Yes Ta Yes
743 .It Sx \&Sq Ta Yes Ta Yes
744 .It Sx \&Vt Ta Yes Ta Yes
750 .Sx Block partial-implicit
751 only when invoked as the first macro
754 section line, else it is
758 .Sx Reserved Characters ,
759 end of line, fixed argument lengths, and/or subsequent macros.
760 In-line macros have only text children.
761 If a number (or inequality) of arguments is
763 then the macro accepts an arbitrary number of arguments.
764 .Bd -literal -offset indent
765 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
767 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
769 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
772 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
773 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
774 .It Sx \&%A Ta \&No Ta \&No Ta >0
775 .It Sx \&%B Ta \&No Ta \&No Ta >0
776 .It Sx \&%C Ta \&No Ta \&No Ta >0
777 .It Sx \&%D Ta \&No Ta \&No Ta >0
778 .It Sx \&%I Ta \&No Ta \&No Ta >0
779 .It Sx \&%J Ta \&No Ta \&No Ta >0
780 .It Sx \&%N Ta \&No Ta \&No Ta >0
781 .It Sx \&%O Ta \&No Ta \&No Ta >0
782 .It Sx \&%P Ta \&No Ta \&No Ta >0
783 .It Sx \&%Q Ta \&No Ta \&No Ta >0
784 .It Sx \&%R Ta \&No Ta \&No Ta >0
785 .It Sx \&%T Ta \&No Ta \&No Ta >0
786 .It Sx \&%U Ta \&No Ta \&No Ta >0
787 .It Sx \&%V Ta \&No Ta \&No Ta >0
788 .It Sx \&Ad Ta Yes Ta Yes Ta n
789 .It Sx \&An Ta Yes Ta Yes Ta n
790 .It Sx \&Ap Ta Yes Ta Yes Ta 0
791 .It Sx \&Ar Ta Yes Ta Yes Ta n
792 .It Sx \&At Ta Yes Ta Yes Ta 1
793 .It Sx \&Bsx Ta Yes Ta Yes Ta n
794 .It Sx \&Bt Ta \&No Ta \&No Ta 0
795 .It Sx \&Bx Ta Yes Ta Yes Ta n
796 .It Sx \&Cd Ta Yes Ta Yes Ta >0
797 .It Sx \&Cm Ta Yes Ta Yes Ta n
798 .It Sx \&Db Ta \&No Ta \&No Ta 1
799 .It Sx \&Dd Ta \&No Ta \&No Ta >0
800 .It Sx \&Dt Ta \&No Ta \&No Ta n
801 .It Sx \&Dv Ta Yes Ta Yes Ta n
802 .It Sx \&Dx Ta Yes Ta Yes Ta n
803 .It Sx \&Em Ta Yes Ta Yes Ta >0
804 .It Sx \&En Ta \&No Ta \&No Ta 0
805 .It Sx \&Er Ta Yes Ta Yes Ta >0
806 .It Sx \&Es Ta \&No Ta \&No Ta 0
807 .It Sx \&Ev Ta Yes Ta Yes Ta n
808 .It Sx \&Ex Ta \&No Ta \&No Ta n
809 .It Sx \&Fa Ta Yes Ta Yes Ta n
810 .It Sx \&Fd Ta \&No Ta \&No Ta >0
811 .It Sx \&Fl Ta Yes Ta Yes Ta n
812 .It Sx \&Fn Ta Yes Ta Yes Ta >0
813 .It Sx \&Fr Ta \&No Ta \&No Ta n
814 .It Sx \&Ft Ta Yes Ta Yes Ta n
815 .It Sx \&Fx Ta Yes Ta Yes Ta n
816 .It Sx \&Hf Ta \&No Ta \&No Ta n
817 .It Sx \&Ic Ta Yes Ta Yes Ta >0
818 .It Sx \&In Ta \&No Ta \&No Ta n
819 .It Sx \&Lb Ta \&No Ta \&No Ta 1
820 .It Sx \&Li Ta Yes Ta Yes Ta n
821 .It Sx \&Lk Ta Yes Ta Yes Ta n
822 .It Sx \&Lp Ta \&No Ta \&No Ta 0
823 .It Sx \&Ms Ta Yes Ta Yes Ta >0
824 .It Sx \&Mt Ta Yes Ta Yes Ta >0
825 .It Sx \&Nm Ta Yes Ta Yes Ta n
826 .It Sx \&No Ta Yes Ta Yes Ta 0
827 .It Sx \&Ns Ta Yes Ta Yes Ta 0
828 .It Sx \&Nx Ta Yes Ta Yes Ta n
829 .It Sx \&Os Ta \&No Ta \&No Ta n
830 .It Sx \&Ot Ta \&No Ta \&No Ta n
831 .It Sx \&Ox Ta Yes Ta Yes Ta n
832 .It Sx \&Pa Ta Yes Ta Yes Ta n
833 .It Sx \&Pf Ta Yes Ta Yes Ta 1
834 .It Sx \&Pp Ta \&No Ta \&No Ta 0
835 .It Sx \&Rv Ta \&No Ta \&No Ta n
836 .It Sx \&Sm Ta \&No Ta \&No Ta 1
837 .It Sx \&St Ta \&No Ta Yes Ta 1
838 .It Sx \&Sx Ta Yes Ta Yes Ta >0
839 .It Sx \&Sy Ta Yes Ta Yes Ta >0
840 .It Sx \&Tn Ta Yes Ta Yes Ta >0
841 .It Sx \&Ud Ta \&No Ta \&No Ta 0
842 .It Sx \&Ux Ta Yes Ta Yes Ta n
843 .It Sx \&Va Ta Yes Ta Yes Ta n
844 .It Sx \&Vt Ta Yes Ta Yes Ta >0
845 .It Sx \&Xr Ta Yes Ta Yes Ta >0
846 .It Sx \&br Ta \&No Ta \&No Ta 0
847 .It Sx \&sp Ta \&No Ta \&No Ta 1
850 This section is a canonical reference of all macros, arranged
852 For the scoping of individual macros, see
857 block. Multiple authors should each be accorded their own
859 line. Author names should be ordered with full or abbreviated
860 forename(s) first, then full surname.
864 block. This macro may also be used in a non-bibliographic context when
865 referring to book titles.
867 Publication city or location of an
872 this macro is not implemented in
875 Publication date of an
877 block. This should follow the reduced or canonical form syntax
881 Publisher or issuer name of an
889 Issue number (usually for journals) of an
893 Optional information of an
897 Book or journal page number of an
901 Institutional author (school, government, etc.) of an
903 block. Multiple institutional authors should each be accorded their own
907 Technical report name of an
913 block. This macro may also be used in a non-bibliographical context
914 when referring to article titles.
916 URI of reference document.
924 block. Does not have any tail arguments.
926 Address construct: usually in the context of an computational address in
927 memory, not a physical (post) address.
934 This macro may alternatively accepts the following arguments, although
935 these may not be specified along with a parameter:
936 .Bl -tag -width 12n -offset indent
938 Renders a line break before each author listing.
944 In the AUTHORS section, the default is not to split the first author
945 listing, but all subsequent author listings, whether or not they're
946 interspersed by other macros or text, are split.
949 will cause the first listing also to be split.
950 If not in the AUTHORS section, the default is not to split.
954 .D1 \&.An J. D. Ullman .
961 are re-set when entering the AUTHORS section, so if one specifies
963 in the general document body, it must be re-specified in the AUTHORS
966 Begins a block enclosed by angled brackets.
967 Does not have any head arguments.
970 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
975 Inserts an apostrophe without any surrounding white-space.
976 This is generally used as a grammatical device when referring to the verb
978 .Bd -literal -offset indent
982 Encloses its arguments in angled brackets.
985 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
988 this macro is often abused for rendering URIs, which should instead use
992 or to note pre-processor
994 statements, which should use
1001 If an argument is not provided, the string
1003 is used as a default.
1006 .D1 \&.Fl o \&Ns \&Ar file1
1008 .D1 \&.Ar arg1 , arg2 .
1010 Formats an AT&T version.
1011 Accepts at most one parameter:
1012 .Bl -tag -width 12n -offset indent
1021 Note that these parameters do not begin with a hyphen.
1039 block. Does not have any tail arguments.
1041 Begins a display block.
1042 A display is collection of macros or text which may be collectively
1043 offset or justified in a manner different from that
1044 of the enclosing context.
1045 By default, the block is preceded by a vertical space.
1047 Each display is associated with a type, which must be one of the
1048 following arguments:
1049 .Bl -tag -width 12n -offset indent
1051 Only left-justify the block.
1053 Do not justify the block at all.
1055 Left- and right-justify the block.
1060 Centre-justify each line.
1063 The type must be provided first.
1064 Secondary arguments are as follows:
1065 .Bl -tag -width 12n -offset indent
1066 .It Fl offset Ar width
1067 Offset by the value of
1069 which is interpreted as one of the following, specified in order:
1072 As one of the pre-defined strings
1074 the width of standard indentation;
1079 which has no effect ;
1081 which justifies to the right margin; and
1083 which aligns around an imagined centre axis.
1085 As a precalculated width for a named macro.
1086 The most popular is the imaginary macro
1091 As a scaling unit following the syntax described in
1092 .Sx Scaling Widths .
1094 As the calculated string length of the opaque string.
1097 If not provided an argument, it will be ignored.
1099 Do not assert a vertical space before the block.
1103 before any text or macros within the block.
1107 .Bd -literal -offset indent
1108 \&.Bd \-unfilled \-offset two-indent \-compact
1119 Begins a keep block, containing a collection of macros or text
1120 to be kept together in the output.
1121 One argument is required; additional arguments are ignored.
1122 Currently, the only argument implemented is
1124 requesting to keep together all words of the contained text
1125 on the same output line.
1128 argument to keep together all lines of the contained text
1129 on the same page has been desired for a long time,
1130 but has never been implemented.
1133 .Bd -literal -offset indent
1135 \&.Op o Ar output_file
1139 Begins a list composed of one or more list entries.
1140 A list is associated with a type, which is a required argument.
1143 defined per-type as accepting a literal or
1147 also accepting a literal or
1149 value setting the list's global offset; and
1151 suppressing the default vertical space printed before each list entry.
1152 A list entry is specified by the
1154 macro, which consists of a head and optional body (depending on the list
1156 A list must specify one of the following list types:
1157 .Bl -tag -width 12n -offset indent
1159 A list offset by a bullet.
1160 The head of list entries must be empty.
1161 List entry bodies are positioned after the bullet.
1164 argument varies the width of list bodies' left-margins.
1169 argument has no effect.
1170 The number of columns is specified as parameters to the
1173 These dictate the width of columns either as
1176 If the initial macro of a
1182 context spanning each line is implied until an
1184 line macro is encountered, at which point list bodies are interpreted as
1189 A list offset by a dash (hyphen).
1190 The head of list entries must be empty.
1191 List entry bodies are positioned past the dash.
1194 argument varies the width of list bodies' left-margins.
1198 but with additional formatting to the head.
1201 argument varies the width of list bodies' left-margins.
1203 An enumerated list offset by the enumeration from 1.
1204 The head of list entries must be empty.
1205 List entry bodies are positioned after the enumeration.
1208 argument varies the width of list bodies' left-margins.
1212 but instead of list bodies positioned after the head, they trail the
1216 argument varies the width of list bodies' left-margins.
1221 List bodies follow the list head.
1224 argument is ignored.
1226 This produces blocks of text.
1227 The head of list entries must be empty.
1230 argument is ignored.
1232 List bodies are positioned on the line following the head.
1235 argument is ignored.
1237 A list offset by list entry heads. List entry bodies are positioned
1238 after the head as specified by the
1246 Begins a block enclosed by square brackets.
1247 Does not have any head arguments.
1250 .Bd -literal -offset indent
1258 Encloses its arguments in square brackets.
1261 .D1 \&.Bq 1 , \&Dv BUFSIZ
1264 this macro is sometimes abused to emulate optional arguments for
1265 commands; the correct macros to use for this purpose are
1276 block. Does not have any tail arguments.
1278 Begins a block enclosed by curly braces.
1279 Does not have any head arguments.
1282 .Bd -literal -offset indent
1290 Encloses its arguments in curly braces.
1293 .D1 \&.Brq 1 , ... , \&Va n
1298 Format the BSD/OS version provided as an argument, or a default value if
1299 no argument is provided.
1316 .Dq is currently in beta test.
1318 Format the BSD version provided as an argument, or a default value if no
1319 argument is provided.
1335 Configuration declaration.
1336 This denotes strings accepted by
1340 .D1 \&.Cd device le0 at scode?
1343 this macro is commonly abused by using quoted literals to retain
1344 white-space and align consecutive
1347 This practise is discouraged.
1350 Useful when specifying configuration options or keys.
1353 .D1 \&.Cm ControlPath
1354 .D1 \&.Cm ControlMaster
1359 One-line indented display.
1360 This is formatted by the default rules and is useful for simple indented
1362 It is followed by a newline.
1365 .D1 \&.D1 \&Fl abcdefgh
1372 Start a debugging context.
1373 This macro is parsed, but generally ignored.
1374 Its syntax is as follows:
1376 .D1 Pf \. Sx \&Db Cm on | off
1380 block. Does not have any tail arguments.
1383 This is the mandatory first macro of any
1386 Its syntax is as follows:
1388 .D1 Pf \. Sx \&Dd Cm date
1394 which signifies the current manual revision date dictated by
1396 or instead a valid canonical date as specified by
1398 If a date does not conform, the current date is used instead.
1401 .D1 \&.Dd $\&Mdocdate$
1402 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1403 .D1 \&.Dd July 21, 2007
1410 One-line intended display.
1411 This is formatted as literal text and is useful for commands and
1413 It is followed by a newline.
1416 .D1 \&.Dl % mandoc mdoc.7 | less
1423 Begins a block enclosed by double quotes. Does not have any head
1427 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1432 Encloses its arguments in double quotes.
1435 .Bd -literal -offset indent -compact
1436 \&.Dq April is the cruellest month
1444 This is the mandatory second macro of any
1447 Its syntax is as follows:
1448 .Bd -ragged -offset indent
1454 .Op Cm volume | arch
1459 Its arguments are as follows:
1460 .Bl -tag -width Ds -offset Ds
1462 The document's title (name), defaulting to
1465 It should be capitalised.
1476 .Pq Perl libraries ,
1486 .Pq system utilities ,
1488 .Pq kernel functions ,
1490 .Pq X Window System ,
1492 .Pq X Window System ,
1502 It should correspond to the manual's filename suffix and defaults to
1506 This overrides the volume inferred from
1508 This field is optional, and if specified, must be one of
1510 .Pq users' supplementary documents ,
1512 .Pq programmers' supplementary documents ,
1514 .Pq administrators' supplementary documents ,
1516 .Pq system managers' manuals ,
1518 .Pq users' reference manuals ,
1520 .Pq programmers' reference manuals ,
1522 .Pq kernel manuals ,
1533 .Pq contributed manuals .
1535 This specifies a specific relevant architecture.
1538 is not provided, it may be used in its place, else it may be used
1540 It, too, is optional.
1575 .D1 \&.Dt FOO 9 i386
1582 Defined variables such as preprocessor constants.
1586 .D1 \&.Dv STDOUT_FILENO
1591 Format the DragonFly BSD version provided as an argument, or a default
1592 value if no argument is provided.
1611 Ends a keep context started by
1614 Ends a list context started by
1622 Denotes text that should be emphasised.
1623 Note that this is a presentation term and should not be used for
1624 stylistically decorating technical terms.
1632 Display error constants.
1642 Environmental variables such as those specified in
1649 Inserts text regarding a utility's exit values.
1650 This macro must have first the
1652 argument specified, then an optional
1656 is not provided, the document's name as stipulated in
1661 Its syntax is as follows:
1662 .Bd -ragged -offset indent
1668 This may be invoked for names with or without the corresponding type.
1669 It is also used to specify the field name of a structure.
1672 macro is used in the
1676 section when documenting multi-line function prototypes.
1677 If invoked with multiple arguments, the arguments are separated by a
1679 Furthermore, if the following macro is another
1681 the last argument will also have a trailing comma.
1684 .D1 \&.Fa \(dqconst char *p\(dq
1685 .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1692 Historically used to document include files.
1693 This usage has been deprecated in favour of
1695 Do not use this macro.
1698 .Sx MANUAL STRUCTURE
1703 Used when listing arguments to command-line utilities.
1704 Prints a fixed-width hyphen
1706 directly followed by each argument.
1707 If no arguments are provided, a hyphen is printed followed by a space.
1708 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1715 .D1 \&.Op \&Fl o \&Ns \&Ar file
1721 Its syntax is as follows:
1722 .Bd -ragged -offset indent
1726 .Op Oo Cm argtype Oc Cm argname
1729 Function arguments are surrounded in parenthesis and
1730 are delimited by commas.
1731 If no arguments are specified, blank parenthesis are output.
1734 .D1 \&.Fn "int funcname" "int arg0" "int arg1"
1735 .D1 \&.Fn funcname "int arg0"
1736 .D1 \&.Fn funcname arg0
1737 .Bd -literal -offset indent -compact
1743 .Sx MANUAL STRUCTURE
1747 Begin a function block.
1748 This is a multi-line version of
1750 Its syntax is as follows:
1752 .D1 Pf \. Sx \&Fo Cm funcname
1754 Invocations usually occur in the following context:
1755 .Bd -ragged -offset indent
1756 .Pf \. Sx \&Ft Cm functype
1758 .Pf \. Sx \&Fo Cm funcname
1760 .Pf \. Sx \&Fa Oo Cm argtype Oc Cm argname
1772 .Sx MANUAL STRUCTURE ,
1778 Its syntax is as follows:
1780 .D1 Pf \. Sx \&Ft Cm functype
1784 .Bd -literal -offset indent -compact
1790 .Sx MANUAL STRUCTURE ,
1795 Format the FreeBSD version provided as an argument, or a default value
1796 if no argument is provided.
1819 section (only if invoked as the line macro), the first argument is
1822 the arguments is enclosed in angled braces.
1828 .Sx MANUAL STRUCTURE .
1831 The syntax of this macro depends on the list type.
1840 have the following syntax:
1842 .D1 Pf \. Sx \&It Cm args
1851 have the following syntax:
1855 with subsequent lines interpreted within the scope of the
1857 until either a closing
1864 list has the following syntax:
1866 .D1 Pf \. Sx \&It Op Cm args
1868 Subsequent lines are interpreted as with
1871 The line arguments correspond to the list's left-hand side; body
1872 arguments correspond to the list's contents.
1876 list is the most complicated.
1877 Its syntax is as follows:
1879 .D1 Pf \. Sx \&It Op Cm args
1883 are phrases, a mix of macros and text corresponding to a line column,
1884 delimited by tabs or the special
1887 Lines subsequent the
1889 are interpreted within the scope of the last phrase.
1890 Calling the pseudo-macro
1892 will open a new phrase scope (this must occur on a macro line to be
1893 interpreted as a macro). Note that the tab phrase delimiter may only be
1897 Subsequent this, only the
1899 pseudo-macro may be used to delimit phrases.
1900 Furthermore, note that quoted sections propagate over tab-delimited
1905 .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1907 will preserve the semicolon whitespace except for the last.
1913 The syntax is as follows:
1915 .D1 Pf \. Sx \&Lb Cm library
1919 parameter may be a system library, such as
1923 in which case a small library description is printed next to the linker
1924 invocation; or a custom library, in which case the library name is
1926 This is most commonly used in the
1928 section as described in
1929 .Sx MANUAL STRUCTURE .
1937 Its syntax is as follows:
1939 .D1 Pf \. Sx \&Lk Cm uri Op Cm name
1942 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1943 .D1 \&.Lk http://bsd.lv
1953 Its syntax is as follows:
1955 .D1 Pf \. Sx \&Mt Cm address
1958 .D1 \&.Mt discuss@manpages.bsd.lv
1964 Format the NetBSD version provided as an argument, or a default value if
1965 no argument is provided.
1984 Document operating system version.
1985 This is the mandatory third macro of
1989 Its syntax is as follows:
1991 .D1 Pf \. Sx \&Os Op Cm system
1995 parameter specifies the relevant operating system or environment.
1996 Left unspecified, it defaults to the local operating system version.
1997 This is the suggested form.
2001 .D1 \&.Os KTH/CSC/TCS
2012 this macro has been deprecated.
2014 Format the OpenBSD version provided as an argument, or a default value
2015 if no argument is provided.
2044 Does not have any tail arguments.
2046 Begins a bibliographic
2049 Does not have any head arguments.
2050 The block macro may only contain
2066 child macros (at least one must be specified).
2069 .Bd -literal -offset indent -compact
2071 \&.%A J. E. Hopcroft
2073 \&.%B Introduction to Automata Theory, Languages, and Computation
2074 \&.%I Addison-Wesley
2075 \&.%C Reading, Massachusettes
2082 block is used within a SEE ALSO section, a vertical space is asserted
2083 before the rendered output, else the block continues on the current
2098 .Dq currently under development.
2100 Format the UNIX name.
2101 Accepts no argument.
2118 This is also used for indicating global variables in the
2120 section, in which case a variable name is also specified.
2121 Note that it accepts
2122 .Sx Block partial-implicit
2123 syntax when invoked as the first macro in the
2125 section, else it accepts ordinary
2129 Note that this should not be confused with
2131 which is used for function return types.
2134 .D1 \&.Vt unsigned char
2135 .D1 \&.Vt extern const char * const sys_signame[] \&;
2138 .Sx MANUAL STRUCTURE
2142 Close a scope opened by
2145 Open an extension scope.
2146 This macro originally existed to extend the 9-argument limit of troff;
2147 since this limit has been lifted, the macro has been deprecated.
2149 Link to another manual
2150 .Pq Qq cross-reference .
2151 Its syntax is as follows:
2153 .D1 Pf \. Sx \&Xr Cm name section
2159 are the name and section of the linked manual.
2162 is followed by non-punctuation, an
2164 is inserted into the token stream.
2165 This behaviour is for compatibility with
2170 .D1 \&.Xr mandoc 1 \&;
2171 .D1 \&.Xr mandoc 1 \&Ns s behaviour
2175 This section documents compatibility between mandoc and other other
2176 troff implementations, at this time limited to GNU troff
2180 refers to groff versions before the
2183 .Pq somewhere between 1.15 and 1.19 .
2185 Heirloom troff, the other significant troff implementation accepting
2186 \-mdoc, is similar to historic groff.
2190 Old groff fails to assert a newline before
2191 .Sx \&Bd Fl ragged compact .
2193 groff behaves inconsistently when encountering
2197 regarding spacing between arguments.
2198 In mandoc, this is not the case: each argument is consistently followed
2199 by a single space and the trailing
2201 suppresses prior spacing.
2203 groff behaves inconsistently when encountering
2209 at times newline(s) are suppressed depending on whether a prior
2212 In mandoc, this is not the case.
2217 for the normalised behaviour.
2219 Historic groff does not break before an
2221 when not invoked as the line macro in the
2225 Historic groff formats the
2227 badly: trailing arguments are trashed and
2229 is not specially treated.
2231 groff does not accept the
2233 pseudo-macro as a line macro.
2238 is no longer accepted.
2242 macro does not format its arguments when used in the FILES section under
2246 Historic groff does not print a dash for empty
2249 mandoc and newer groff implementations do.
2251 groff behaves irregularly when specifying
2254 within line-macro scopes.
2255 mandoc follows a consistent system.
2257 In mandoc, negative scaling units are truncated to zero; groff would
2258 move to prior lines.
2261 scaling unit, while accepted, is rendered as the default unit.
2263 In quoted literals, groff allowed pair-wise double-quotes to produce a
2264 standalone double-quote in formatted output.
2265 This idiosyncratic behaviour is not applicable in mandoc.
2269 .Fl offset Ar center
2272 are disregarded in mandoc.
2275 argument is not supported in mandoc.
2276 Lastly, since text is not right-justified in mandoc (or even groff),
2285 Historic groff has many un-callable macros.
2286 Most of these (excluding some block-level macros) are now callable.
2292 but has been a proper delimiter since then.
2295 is assumed for all lists (it wasn't in historic groff): any list may be
2298 lists will restart the sequence only for the sub-list.
2302 incorrectly by following it with a reserved character and expecting the
2303 delimiter to render.
2304 This is not supported in mandoc.
2312 macros were stipulated only to occur in certain manual sections.
2313 mandoc does not have these restrictions.
2315 Newer groff and mandoc print
2317 prior to unknown arguments of
2319 older groff did nothing.
2327 reference was written by
2328 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
2330 .\" XXX: this really isn't the place for these caveats.
2334 .\" There are many ambiguous parts of mdoc.
2337 .\" .Bl -dash -compact
2342 .\" as function arguments are variables.
2347 .\" as function return types are still types. Furthermore, the
2349 .\" should be removed and
2351 .\" which ostensibly follows it, should follow the same convention as
2355 .\" should formalise that only one or two arguments are acceptable: a
2356 .\" variable name and optional, preceding type.
2359 .\" is ambiguous. It's commonly used to indicate an include file in the
2360 .\" synopsis section.
2362 .\" should be used, instead.
2368 .\" makes sense. The remaining ones should be removed.
2374 .\" macros should be deprecated.
2378 .\" macro lacks clarity. It should be absolutely clear which title will
2379 .\" render when formatting the manual page.
2383 .\" should be provided for Linux (\(`a la
2388 .\" There's no way to refer to references in
2392 .\" The \-split and \-nosplit dictates via
2394 .\" are re-set when entering and leaving the AUTHORS section.