1 .\" $Id: mdoc.7,v 1.108 2010/05/15 16:24:37 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: May 15 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
349 \&.Nd a description goes here
350 \&.\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
464 This expands upon the brief, one-line description in
466 It usually contains a break-down of the options (if documenting a
468 .Bd -literal -offset indent
469 The arguments are as follows:
470 \&.Bl \-tag \-width Ds
472 Print verbose information.
476 Manuals not documenting a command won't include the above fragment.
477 .It Em IMPLEMENTATION NOTES
478 Implementation-specific notes should be kept here.
479 This is useful when implementing standard functions that may have side
480 effects or notable algorithmic implications.
482 This section is the dual of
484 which is used for commands.
485 It documents the return values of functions in sections 2, 3, and 9.
490 Documents any usages of environment variables, e.g.,
496 Documents files used.
497 It's helpful to document both the file and a short description of how
498 the file is used (created, modified, etc.).
503 Command exit status for section 1, 6, and 8 manuals.
504 This section is the dual of
506 which is used for functions.
507 Historically, this information was described in
509 a practise that is now discouraged.
515 This often contains snippets of well-formed, well-tested invocations.
516 Make doubly sure that your examples work properly!
518 Documents error conditions.
519 This is most useful in section 4 manuals.
520 Historically, this section was used in place of
522 for manuals in sections 1, 6, and 8; however, this practise is
529 Documents error handling in sections 2, 3, and 9.
534 References other manuals with related topics.
535 This section should exist for most manuals.
536 Cross-references should conventionally be ordered first by section, then
542 References any standards implemented or used.
543 If not adhering to any standards, the
545 section should be used instead.
550 The history of any manual without a
552 section should be described in this section.
554 Credits to authors, if applicable, should appear in this section.
555 Authors should generally be noted by both name and an e-mail address.
560 Explanations of common misuses and misunderstandings should be explained
563 Extant bugs should be described in this section.
564 .It Em SECURITY CONSIDERATIONS
565 Documents any security precautions that operators should consider.
568 Macros are one to three three characters in length and begin with a
571 at the beginning of the line.
572 An arbitrary amount of whitespace may sit between the control character
574 Thus, the following are equivalent:
575 .Bd -literal -offset indent
580 The syntax of a macro depends on its classification.
583 refers to macro arguments, which may be followed by zero or more
587 opens the scope of a macro; and if specified,
593 column indicates that the macro may be called subsequent to the initial
595 If a macro is not callable, then its invocation after the initial line
596 macro is interpreted as opaque text, such that
603 column indicates whether the macro may be followed by further
604 (ostensibly callable) macros.
605 If a macro is not parsable, subsequent macro invocations on the line
606 will be interpreted as opaque text.
610 column, if applicable, describes closure rules.
611 .Ss Block full-explicit
612 Multi-line scope closed by an explicit closing macro.
613 All macros contains bodies; only
616 .Bd -literal -offset indent
617 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
622 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
623 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
624 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
625 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
626 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
627 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
628 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
629 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
630 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
631 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
633 .Ss Block full-implicit
634 Multi-line scope closed by end-of-file or implicitly by another macro.
635 All macros have bodies; some
643 don't have heads; only one
648 .Bd -literal -offset indent
649 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
653 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
654 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
655 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
656 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
657 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
658 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
660 .Ss Block partial-explicit
661 Like block full-explicit, but also with single-line scope.
662 Each has at least a body and, in limited circumstances, a head
669 .Bd -literal -offset indent
670 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
672 \&.Yc \(lBtail...\(rB
674 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
675 \(lBbody...\(rB \&Yc \(lBtail...\(rB
678 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
679 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
680 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
681 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
682 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
683 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
684 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
685 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
686 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
687 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
688 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
689 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
690 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
691 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
692 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
693 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
694 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
695 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
696 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
697 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
698 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
699 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
700 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
701 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
702 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
703 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
705 .Ss Block partial-implicit
706 Like block full-implicit, but with single-line scope closed by
707 .Sx Reserved Characters
709 .Bd -literal -offset indent
710 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
713 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
714 .It Em Macro Ta Em Callable Ta Em Parsable
715 .It Sx \&Aq Ta Yes Ta Yes
716 .It Sx \&Bq Ta Yes Ta Yes
717 .It Sx \&Brq Ta Yes Ta Yes
718 .It Sx \&D1 Ta \&No Ta \&Yes
719 .It Sx \&Dl Ta \&No Ta Yes
720 .It Sx \&Dq Ta Yes Ta Yes
721 .It Sx \&Op Ta Yes Ta Yes
722 .It Sx \&Pq Ta Yes Ta Yes
723 .It Sx \&Ql Ta Yes Ta Yes
724 .It Sx \&Qq Ta Yes Ta Yes
725 .It Sx \&Sq Ta Yes Ta Yes
726 .It Sx \&Vt Ta Yes Ta Yes
732 .Sx Block partial-implicit
733 only when invoked as the first macro
734 in a SYNOPSIS section line, else it is
738 .Sx Reserved Characters ,
739 end of line, fixed argument lengths, and/or subsequent macros.
740 In-line macros have only text children.
741 If a number (or inequality) of arguments is
743 then the macro accepts an arbitrary number of arguments.
744 .Bd -literal -offset indent
745 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
747 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
749 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
752 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
753 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
754 .It Sx \&%A Ta \&No Ta \&No Ta >0
755 .It Sx \&%B Ta \&No Ta \&No Ta >0
756 .It Sx \&%C Ta \&No Ta \&No Ta >0
757 .It Sx \&%D Ta \&No Ta \&No Ta >0
758 .It Sx \&%I Ta \&No Ta \&No Ta >0
759 .It Sx \&%J Ta \&No Ta \&No Ta >0
760 .It Sx \&%N Ta \&No Ta \&No Ta >0
761 .It Sx \&%O Ta \&No Ta \&No Ta >0
762 .It Sx \&%P Ta \&No Ta \&No Ta >0
763 .It Sx \&%Q Ta \&No Ta \&No Ta >0
764 .It Sx \&%R Ta \&No Ta \&No Ta >0
765 .It Sx \&%T Ta \&No Ta \&No Ta >0
766 .It Sx \&%U Ta \&No Ta \&No Ta >0
767 .It Sx \&%V Ta \&No Ta \&No Ta >0
768 .It Sx \&Ad Ta Yes Ta Yes Ta n
769 .It Sx \&An Ta Yes Ta Yes Ta n
770 .It Sx \&Ap Ta Yes Ta Yes Ta 0
771 .It Sx \&Ar Ta Yes Ta Yes Ta n
772 .It Sx \&At Ta Yes Ta Yes Ta 1
773 .It Sx \&Bsx Ta Yes Ta Yes Ta n
774 .It Sx \&Bt Ta \&No Ta \&No Ta 0
775 .It Sx \&Bx Ta Yes Ta Yes Ta n
776 .It Sx \&Cd Ta Yes Ta Yes Ta >0
777 .It Sx \&Cm Ta Yes Ta Yes Ta n
778 .It Sx \&Db Ta \&No Ta \&No Ta 1
779 .It Sx \&Dd Ta \&No Ta \&No Ta >0
780 .It Sx \&Dt Ta \&No Ta \&No Ta n
781 .It Sx \&Dv Ta Yes Ta Yes Ta n
782 .It Sx \&Dx Ta Yes Ta Yes Ta n
783 .It Sx \&Em Ta Yes Ta Yes Ta >0
784 .It Sx \&En Ta \&No Ta \&No Ta 0
785 .It Sx \&Er Ta Yes Ta Yes Ta >0
786 .It Sx \&Es Ta \&No Ta \&No Ta 0
787 .It Sx \&Ev Ta Yes Ta Yes Ta n
788 .It Sx \&Ex Ta \&No Ta \&No Ta n
789 .It Sx \&Fa Ta Yes Ta Yes Ta n
790 .It Sx \&Fd Ta \&No Ta \&No Ta >0
791 .It Sx \&Fl Ta Yes Ta Yes Ta n
792 .It Sx \&Fn Ta Yes Ta Yes Ta >0
793 .It Sx \&Fr Ta \&No Ta \&No Ta n
794 .It Sx \&Ft Ta Yes Ta Yes Ta n
795 .It Sx \&Fx Ta Yes Ta Yes Ta n
796 .It Sx \&Hf Ta \&No Ta \&No Ta n
797 .It Sx \&Ic Ta Yes Ta Yes Ta >0
798 .It Sx \&In Ta \&No Ta \&No Ta n
799 .It Sx \&Lb Ta \&No Ta \&No Ta 1
800 .It Sx \&Li Ta Yes Ta Yes Ta n
801 .It Sx \&Lk Ta Yes Ta Yes Ta n
802 .It Sx \&Lp Ta \&No Ta \&No Ta 0
803 .It Sx \&Ms Ta Yes Ta Yes Ta >0
804 .It Sx \&Mt Ta Yes Ta Yes Ta >0
805 .It Sx \&Nm Ta Yes Ta Yes Ta n
806 .It Sx \&No Ta Yes Ta Yes Ta 0
807 .It Sx \&Ns Ta Yes Ta Yes Ta 0
808 .It Sx \&Nx Ta Yes Ta Yes Ta n
809 .It Sx \&Os Ta \&No Ta \&No Ta n
810 .It Sx \&Ot Ta \&No Ta \&No Ta n
811 .It Sx \&Ox Ta Yes Ta Yes Ta n
812 .It Sx \&Pa Ta Yes Ta Yes Ta n
813 .It Sx \&Pf Ta Yes Ta Yes Ta 1
814 .It Sx \&Pp Ta \&No Ta \&No Ta 0
815 .It Sx \&Rv Ta \&No Ta \&No Ta n
816 .It Sx \&Sm Ta \&No Ta \&No Ta 1
817 .It Sx \&St Ta \&No Ta Yes Ta 1
818 .It Sx \&Sx Ta Yes Ta Yes Ta >0
819 .It Sx \&Sy Ta Yes Ta Yes Ta >0
820 .It Sx \&Tn Ta Yes Ta Yes Ta >0
821 .It Sx \&Ud Ta \&No Ta \&No Ta 0
822 .It Sx \&Ux Ta Yes Ta Yes Ta n
823 .It Sx \&Va Ta Yes Ta Yes Ta n
824 .It Sx \&Vt Ta Yes Ta Yes Ta >0
825 .It Sx \&Xr Ta Yes Ta Yes Ta >0
826 .It Sx \&br Ta \&No Ta \&No Ta 0
827 .It Sx \&sp Ta \&No Ta \&No Ta 1
830 This section is a canonical reference of all macros, arranged
832 For the scoping of individual macros, see
837 block. Multiple authors should each be accorded their own
839 line. Author names should be ordered with full or abbreviated
840 forename(s) first, then full surname.
844 block. This macro may also be used in a non-bibliographic context when
845 referring to book titles.
847 Publication city or location of an
852 this macro is not implemented in
855 Publication date of an
857 block. This should follow the reduced or canonical form syntax
861 Publisher or issuer name of an
869 Issue number (usually for journals) of an
873 Optional information of an
877 Book or journal page number of an
881 Institutional author (school, government, etc.) of an
883 block. Multiple institutional authors should each be accorded their own
887 Technical report name of an
893 block. This macro may also be used in a non-bibliographical context
894 when referring to article titles.
896 URI of reference document.
904 block. Does not have any tail arguments.
906 Address construct: usually in the context of an computational address in
907 memory, not a physical (post) address.
914 This macro may alternatively accepts the following arguments, although
915 these may not be specified along with a parameter:
916 .Bl -tag -width 12n -offset indent
918 Renders a line break before each author listing.
924 In the AUTHORS section, the default is not to split the first author
925 listing, but all subsequent author listings, whether or not they're
926 interspersed by other macros or text, are split.
929 will cause the first listing also to be split.
930 If not in the AUTHORS section, the default is not to split.
934 .D1 \&.An J. D. Ullman .
941 are re-set when entering the AUTHORS section, so if one specifies
943 in the general document body, it must be re-specified in the AUTHORS
946 Begins a block enclosed by angled brackets.
947 Does not have any head arguments.
950 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
955 Inserts an apostrophe without any surrounding white-space.
956 This is generally used as a grammatic device when referring to the verb
958 .Bd -literal -offset indent
962 Encloses its arguments in angled brackets.
965 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
968 this macro is often abused for rendering URIs, which should instead use
972 or to note pre-processor
974 statements, which should use
981 If an argument is not provided, the string
983 is used as a default.
986 .D1 \&.Fl o \&Ns \&Ar file1
988 .D1 \&.Ar arg1 , arg2 .
990 Formats an AT&T version.
991 Accepts at most one parameter:
992 .Bl -tag -width 12n -offset indent
1001 Note that these parameters do not begin with a hyphen.
1019 block. Does not have any tail arguments.
1021 Begins a display block.
1022 A display is collection of macros or text which may be collectively
1023 offset or justified in a manner different from that
1024 of the enclosing context.
1025 By default, the block is preceded by a vertical space.
1027 Each display is associated with a type, which must be one of the
1028 following arguments:
1029 .Bl -tag -width 12n -offset indent
1031 Only left-justify the block.
1033 Do not justify the block at all.
1035 Left- and right-justify the block.
1040 Centre-justify each line.
1043 The type must be provided first.
1044 Secondary arguments are as follows:
1045 .Bl -tag -width 12n -offset indent
1046 .It Fl offset Ar width
1047 Offset by the value of
1049 which is interpreted as one of the following, specified in order:
1052 As one of the pre-defined strings
1054 the width of standard indentation;
1059 which has no effect ;
1061 which justifies to the right margin; and
1063 which aligns around an imagined centre axis.
1065 As a precalculated width for a named macro.
1066 The most popular is the imaginary macro
1071 As a scaling unit following the syntax described in
1072 .Sx Scaling Widths .
1074 As the calculated string length of the opaque string.
1077 If unset, it will revert to the value of
1080 .Sx Scaling Widths .
1082 Do not assert a vertical space before the block.
1086 before any text or macros within the block.
1090 .Bd -literal -offset indent
1091 \&.Bd \-unfilled \-offset two-indent \-compact
1103 Begins a list composed of one or more list entries.
1104 A list is associated with a type, which is a required argument.
1107 defined per-type as accepting a literal or
1111 also accepting a literal or
1113 value setting the list's global offset; and
1115 suppressing the default vertical space printed before each list entry.
1116 A list entry is specified by the
1118 macro, which consists of a head and optional body (depending on the list
1120 A list must specify one of the following list types:
1121 .Bl -tag -width 12n -offset indent
1123 A list offset by a bullet.
1124 The head of list entries must be empty.
1125 List entry bodies are positioned after the bullet.
1128 argument varies the width of list bodies' left-margins.
1133 argument has no effect.
1134 The number of columns is specified as parameters to the
1137 These dictate the width of columns either as
1140 List entry bodies must be left empty.
1141 Column bodies have the following syntax:
1143 .D1 .It col1 <TAB> ... coln
1144 .D1 .It col1 Ta ... coln
1145 .D1 .It col1 <TAB> col2 Ta coln
1147 where columns may be separated by tabs, the literal string
1149 or a mixture of both.
1150 These are equivalent except that quoted sections propogate over tabs,
1153 .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq ;
1155 will preserve the semicolon whitespace except for the last.
1157 A list offset by a dash (hyphen).
1158 The head of list entries must be empty.
1159 List entry bodies are positioned past the dash.
1162 argument varies the width of list bodies' left-margins.
1166 but with additional formatting to the head.
1169 argument varies the width of list bodies' left-margins.
1171 An enumerated list offset by the enumeration from 1.
1172 The head of list entries must be empty.
1173 List entry bodies are positioned after the enumeration.
1176 argument varies the width of list bodies' left-margins.
1180 but instead of list bodies positioned after the head, they trail the
1184 argument varies the width of list bodies' left-margins.
1189 List bodies follow the list head.
1192 argument is ignored.
1194 This produces blocks of text.
1195 The head of list entries must be empty.
1198 argument is ignored.
1200 List bodies are positioned on the line following the head.
1203 argument is ignored.
1205 A list offset by list entry heads. List entry bodies are positioned
1206 after the head as specified by the
1211 Begins a block enclosed by square brackets.
1212 Does not have any head arguments.
1215 .Bd -literal -offset indent
1223 Encloses its arguments in square brackets.
1226 .D1 \&.Bq 1 , \&Dv BUFSIZ
1229 this macro is sometimes abused to emulate optional arguments for
1230 commands; the correct macros to use for this purpose are
1241 block. Does not have any tail arguments.
1243 Begins a block enclosed by curly braces.
1244 Does not have any head arguments.
1247 .Bd -literal -offset indent
1255 Encloses its arguments in curly braces.
1258 .D1 \&.Brq 1 , ... , \&Va n
1263 Format the BSD/OS version provided as an argument, or a default value if
1264 no argument is provided.
1281 .Dq is currently in beta test.
1283 Format the BSD version provided as an argument, or a default value if no
1284 argument is provided.
1300 Configuration declaration.
1301 This denotes strings accepted by
1305 .D1 \&.Cd device le0 at scode?
1308 this macro is commonly abused by using quoted literals to retain
1309 white-space and align consecutive
1312 This practise is discouraged.
1315 Useful when specifying configuration options or keys.
1318 .D1 \&.Cm ControlPath
1319 .D1 \&.Cm ControlMaster
1324 One-line indented display.
1325 This is formatted by the default rules and is useful for simple indented
1327 It is followed by a newline.
1330 .D1 \&.D1 \&Fl abcdefgh
1340 block. Does not have any tail arguments.
1343 This is the mandatory first macro of any
1346 Its calling syntax is as follows:
1348 .D1 \. Ns Sx \&Dd Cm date
1354 which signifies the current manual revision date dictated by
1356 or instead a valid canonical date as specified by
1358 If a date does not conform, the current date is used instead.
1361 .D1 \&.Dd $\&Mdocdate$
1362 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1363 .D1 \&.Dd July 21, 2007
1370 One-line intended display.
1371 This is formatted as literal text and is useful for commands and
1373 It is followed by a newline.
1376 .D1 \&.Dl % mandoc mdoc.7 | less
1383 Begins a block enclosed by double quotes. Does not have any head
1387 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1392 Encloses its arguments in double quotes.
1395 .Bd -literal -offset indent -compact
1396 \&.Dq April is the cruellest month
1404 This is the mandatory second macro of any
1407 Its calling syntax is as follows:
1409 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1411 Its arguments are as follows:
1412 .Bl -tag -width Ds -offset Ds
1414 The document's title (name).
1415 This should be capitalised and is required.
1426 .Pq Perl libraries ,
1436 .Pq system utilities ,
1438 .Pq kernel functions ,
1440 .Pq X Window System ,
1442 .Pq X Window System ,
1452 It is also required and should correspond to the manual's filename
1455 This overrides the volume inferred from
1457 This field is optional, and if specified, must be one of
1459 .Pq users' supplementary documents ,
1461 .Pq programmers' supplementary documents ,
1463 .Pq administrators' supplementary documents ,
1465 .Pq system managers' manuals ,
1467 .Pq users' reference manuals ,
1469 .Pq programmers' reference manuals ,
1471 .Pq kernel manuals ,
1482 .Pq contributed manuals .
1484 This specifies a specific relevant architecture.
1487 is not provided, it may be used in its place, else it may be used
1489 It, too, is optional.
1524 .D1 \&.Dt FOO 9 i386
1525 .D1 \&.Dt FOO 9 KM 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.
1650 The calling syntax is as follows:
1652 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1655 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1656 .D1 \&.Lk http://bsd.lv
1668 Format the NetBSD version provided as an argument, or a default value if
1669 no argument is provided.
1688 Document operating system version.
1689 This is the mandatory third macro of
1692 file. Its calling syntax is as follows:
1694 .D1 \. Ns Sx \&Os Op Cm system
1698 parameter specifies the relevant operating system or environment.
1699 Left unspecified, it defaults to the local operating system version.
1700 This is the suggested form.
1704 .D1 \&.Os KTH/CSC/TCS
1715 this macro has been deprecated.
1717 Format the OpenBSD version provided as an argument, or a default value
1718 if no argument is provided.
1747 Does not have any tail arguments.
1749 Begins a bibliographic
1752 Does not have any head arguments.
1753 The block macro may only contain
1768 child macros (at least one must be specified).
1771 .Bd -literal -offset indent -compact
1773 \&.%A J. E. Hopcroft
1775 \&.%B Introduction to Automata Theory, Languages, and Computation
1776 \&.%I Addison-Wesley
1777 \&.%C Reading, Massachusettes
1784 block is used within a SEE ALSO section, a vertical space is asserted
1785 before the rendered output, else the block continues on the current
1800 Format the UNIX name.
1801 Accepts no argument.
1818 This is also used for indicating global variables in the SYNOPSIS
1819 section, in which case a variable name is also specified.
1820 Note that it accepts
1821 .Sx Block partial-implicit
1822 syntax when invoked as the first macro in the SYNOPSIS section, else it
1827 Note that this should not be confused with
1829 which is used for function return types.
1832 .D1 \&.Vt unsigned char
1833 .D1 \&.Vt extern const char * const sys_signame[] ;
1840 Close a scope opened by
1843 Open an extension scope.
1844 This macro originally existed to extend the 9-argument limit of troff;
1845 since this limit has been lifted, the macro has been deprecated.
1847 Link to another manual
1848 .Pq Qq cross-reference .
1849 Its calling syntax is
1851 .D1 \. Ns Sx \&Xr Cm name section
1857 are the name and section of the linked manual.
1860 is followed by non-punctuation, an
1862 is inserted into the token stream.
1863 This behaviour is for compatibility with
1868 .D1 \&.Xr mandoc 1 ;
1869 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1873 This section documents compatibility between mandoc and other other
1874 troff implementations, at this time limited to GNU troff
1878 refers to groff versions before the
1881 .Pq somewhere between 1.15 and 1.19 .
1883 Heirloom troff, the other significant troff implementation accepting
1884 \-mdoc, is similar to historic groff.
1890 is no longer accepted.
1894 macro does not format its arguments when used in the FILES section under
1898 Historic groff does not print a dash for empty
1901 mandoc and newer groff implementations do.
1903 groff behaves irregularly when specifying
1906 within line-macro scopes.
1907 mandoc follows a consistent system.
1909 In mandoc, negative scaling units are truncated to zero; groff would
1910 move to prior lines.
1913 scaling unit, while accepted, is rendered as the default unit.
1915 In quoted literals, groff allowed pair-wise double-quotes to produce a
1916 standalone double-quote in formatted output.
1917 This idiosyncratic behaviour is not applicable in mandoc.
1926 in manodc. Furthermore, the
1928 argument is ignored.
1929 Lastly, since text is not right-justified in mandoc (or even groff),
1938 Historic groff has many un-callable macros.
1939 Most of these (excluding some block-level macros) are now callable.
1945 but has been a proper delimiter since then.
1948 is assumed for all lists (it wasn't in historic groff): any list may be
1951 lists will restart the sequence only for the sub-list.
1955 incorrectly by following it with a reserved character and expecting the
1956 delimiter to render.
1957 This is not supported in mandoc.
1961 macro only produces the first parameter.
1962 This is not the case in mandoc.
1970 macros were stipulated only to occur in certain manual sections.
1971 mandoc does not have these restrictions.
1973 Newer groff and mandoc print
1975 prior to unknown arguments of
1977 older groff did nothing.
1985 reference was written by
1986 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1988 .\" XXX: this really isn't the place for these caveats.
1992 .\" There are many ambiguous parts of mdoc.
1995 .\" .Bl -dash -compact
2000 .\" as function arguments are variables.
2005 .\" as function return types are still types. Furthermore, the
2007 .\" should be removed and
2009 .\" which ostensibly follows it, should follow the same convention as
2013 .\" should formalise that only one or two arguments are acceptable: a
2014 .\" variable name and optional, preceding type.
2017 .\" is ambiguous. It's commonly used to indicate an include file in the
2018 .\" synopsis section.
2020 .\" should be used, instead.
2026 .\" makes sense. The remaining ones should be removed.
2032 .\" macros should be deprecated.
2036 .\" macro lacks clarity. It should be absolutely clear which title will
2037 .\" render when formatting the manual page.
2041 .\" should be provided for Linux (\(`a la
2046 .\" There's no way to refer to references in
2050 .\" The \-split and \-nosplit dictates via
2052 .\" are re-set when entering and leaving the AUTHORS section.