1 .\" $Id: mdoc.7,v 1.78 2009/11/16 09:52:47 kristaps Exp $
3 .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
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.
24 .Nd mdoc language reference
30 language is used to format
33 manuals. In this reference document, we describe its syntax, structure,
34 and usage. Our reference implementation is
38 section describes compatibility with
44 document follows simple rules: lines beginning with the control
47 are parsed for macros. Other lines are interpreted within the scope of
49 .Bd -literal -offset indent
50 \&.Sh Macro lines change control state.
51 Other lines are interpreted within the current state.
57 documents may contain only graphable 7-bit ASCII characters, the space
58 character, and, in certain circumstances, the tab character. All
67 whether in a macro or free-form text line, is ignored to the end of
68 line. A macro line with only a control character and comment escape,
70 is also ignored. Macro lines with only a control charater and optionally
71 whitespace are stripped from input.
74 .Ss Reserved Characters
75 Within a macro line, the following characters are reserved:
77 .Bl -tag -width Ds -offset indent -compact
103 Use of reserved characters is described in
105 For general use in macro lines, these characters must either be escaped
106 with a non-breaking space
108 or, if applicable, an appropriate escape sequence used.
111 .Ss Special Characters
112 Special characters may occur in both macro and free-form lines.
113 Sequences begin with the escape character
115 followed by either an open-parenthesis
117 for two-character sequences; an open-bracket
119 for n-character sequences (terminated at a close-bracket
121 or a single one-character sequence. See
123 for a complete list. Examples include
132 Terms may be text-decorated using the
134 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
135 (revert to previous mode):
137 .D1 \efBbold\efR \efIitalic\efP
139 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
140 respectively) may be used instead. A text decoration is valid within
141 the current font scope only: if a macro opens a font scope alongside
142 its own scope, such as
145 in-scope invocations of
147 are only valid within the font scope of the macro. If
149 is specified outside of any font scope, such as in unenclosed, free-form
150 text, it will affect the remainder of the document.
152 Text may also be sized with the
154 escape, whose syntax is one of
156 for one-digit numerals;
160 for two-digit numerals; and
166 for arbitrary-digit numerals:
169 .D1 \es[+10]much bigger\es[-10]
170 .D1 \es+(10much bigger\es-(10
171 .D1 \es+'100'much much bigger\es-'100'
177 which encourages semantic annotation.
180 .Ss Predefined Strings
183 also defined a set of package-specific
184 .Dq predefined strings ,
186 .Sx Special Characters ,
187 demark special output characters and strings by way of input codes.
188 Predefined strings are escaped with the slash-asterisk,
198 for a complete list. Examples include
207 In non-literal free-form lines, consecutive blocks of whitespace are
208 pruned from input and added later in the output filter, if applicable:
209 .Bd -literal -offset indent
210 These spaces are pruned from input.
217 In macro lines, whitespace delimits arguments and is discarded. If
218 arguments are quoted, whitespace within the quotes is retained.
221 Blank lines are only permitted within literal contexts, as are lines
222 containing only whitespace. Tab characters are only acceptable when
225 or when in a literal context.
229 Macro arguments may be quoted with a double-quote to group
230 space-delimited terms or to retain blocks of whitespace. A quoted
231 argument begins with a double-quote preceded by whitespace. The next
232 double-quote not pair-wise adjacent to another double-quote terminates
233 the literal, regardless of surrounding whitespace.
242 Note that any quoted term, be it argument or macro, is indiscriminately
243 considered literal text. Thus, the following produces
245 .Bd -literal -offset indent
250 In free-form mode, quotes are regarded as opaque text.
253 There are several macros in
255 that require a date argument. The canonical form for dates is the
258 .D1 Cm Month Day , Year
262 value is an optionally zero-padded numeral. The
264 value is the full month name. The
266 value is the full four-digit year.
268 Reduced form dates are broken-down canonical form dates:
273 Some examples of valid dates follow:
275 .D1 "May, 2009" Pq reduced form
276 .D1 "2009" Pq reduced form
277 .D1 "May 20, 2009" Pq canonical form
280 Many macros support scaled widths for their arguments, such as
281 stipulating a two-inch list indentation with the following:
282 .Bd -literal -offset indent
287 The syntax for scaled widths is
288 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
289 where a decimal must be preceded or proceeded by at least one digit.
290 Negative numbers, while accepted, are truncated to zero. The following
291 scaling units are accepted:
293 .Bl -tag -width Ds -offset indent -compact
306 default vertical span
318 default horizontal span
323 Using anything other than
329 is necessarily non-portable across output media. See
336 document consists of a document prologue followed by one or more
339 The prologue, which consists of (in order) the
344 macros, is required for every document.
346 The first section (sections are denoted by
348 must be the NAME section, consisting of at least one
353 Following that, convention dictates specifying at least the SYNOPSIS and
354 DESCRIPTION sections, although this varies between manual sections.
356 The following is a well-formed skeleton
359 .Bd -literal -offset indent
366 \&.Nd a description goes here
367 \&.\e\*q The next is for sections 2 & 3 only.
378 utility processes files ...
379 \&.\e\*q .Sh IMPLEMENTATION NOTES
380 \&.\e\*q The next is for sections 1 & 8 only.
381 \&.\e\*q .Sh EXIT STATUS
382 \&.\e\*q The next is for sections 2, 3, & 9 only.
383 \&.\e\*q .Sh RETURN VALUES
384 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
385 \&.\e\*q .Sh ENVIRONMENT
387 \&.\e\*q .Sh EXAMPLES
388 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
389 \&.\e\*q .Sh DIAGNOSTICS
390 \&.\e\*q The next is for sections 2, 3, & 9 only.
392 \&.\e\*q .Sh SEE ALSO
393 \&.\e\*q .Xr foobar 1
394 \&.\e\*q .Sh STANDARDS
399 \&.\e\*q .Sh SECURITY CONSIDERATIONS
404 document are conventionally ordered as they appear above. Sections
405 should be composed as follows:
406 .Bl -ohang -offset Ds
408 The name(s) and a short description of the documented material. The
409 syntax for this as follows:
410 .Bd -literal -offset indent
414 \&.Nd a short description
419 macro(s) must precede the
424 The name of the library containing the documented material, which is
425 assumed to be a function in a section 2 or 3 manual. The syntax for
427 .Bd -literal -offset indent
436 Documents the utility invocation syntax, function call syntax, or device
439 For the first, utilities (sections 1, 6, and 8), this is
440 generally structured as follows:
441 .Bd -literal -offset indent
452 For the second, function calls (sections 2, 3, 9):
453 .Bd -literal -offset indent
454 \&.Vt extern const char *global;
457 \&.Fn foo "const char *src"
459 \&.Fn bar "const char *src"
462 And for the third, configurations (section 4):
463 .Bd -literal -offset indent
464 \&.Cd \*qit* at isa? port 0x2e\*q
465 \&.Cd \*qit* at isa? port 0x4e\*q
468 Manuals not in these sections generally don't need a
472 This expands upon the brief, one-line description in
474 It usually contains a break-down of the options (if documenting a
476 .Bd -literal -offset indent
477 The arguments are as follows:
478 \&.Bl \-tag \-width Ds
480 Print verbose information.
483 Manuals not documenting a command won't include the above fragment.
485 .It Em IMPLEMENTATION NOTES
486 Implementation-specific notes should be kept here. This is useful when
487 implementing standard functions that may have side effects or notable
488 algorithmic implications.
491 Command exit status for section 1, 6, and 8 manuals. This section is
494 which is used for functions. Historically, this information was
497 a practise that is now discouraged.
503 This section is the dual of
505 which is used for commands. It documents the return values of functions
506 in sections 2, 3, and 9.
512 Documents any usages of environment variables, e.g.,
519 Documents files used. It's helpful to document both the file and a
520 short description of how the file is used (created, modified, etc.).
526 Example usages. This often contains snippets of well-formed,
527 well-tested invocations. Make doubly sure that your examples work
531 Documents error conditions. This is most useful in section 4 manuals.
532 Historically, this section was used in place of
534 for manuals in sections 1, 6, and 8; however, this practise is
541 Documents error handling in sections 2, 3, and 9.
547 References other manuals with related topics. This section should exist
548 for most manuals. Cross-references should conventionally be ordered
549 first by section, then alphabetically.
555 References any standards implemented or used. If not adhering to any
558 section should be used instead.
564 The history of any manual without a
566 section should be described in this section.
569 Credits to authors, if applicable, should appear in this section.
570 Authors should generally be noted by both name and an e-mail address.
576 Explanations of common misuses and misunderstandings should be explained
580 Extant bugs should be described in this section.
582 .It Em SECURITY CONSIDERATIONS
583 Documents any security precautions that operators should consider.
589 Macros are one to three three characters in length and begin with a
592 at the beginning of the line. An arbitrary amount of whitespace may
593 sit between the control character and the macro name. Thus, the
594 following are equivalent:
595 .Bd -literal -offset indent
601 The syntax of a macro depends on its classification. In this section,
603 refers to macro arguments, which may be followed by zero or more
607 opens the scope of a macro; and if specified,
614 column indicates that the macro may be called subsequent to the initial
615 line-macro. If a macro is not callable, then its invocation after the
616 initial line macro is interpreted as opaque text, such that
624 column indicates whether the macro may be followed by further
625 (ostensibly callable) macros. If a macro is not parsable, subsequent
626 macro invocations on the line will be interpreted as opaque text.
631 column, if applicable, describes closure rules.
634 .Ss Block full-explicit
635 Multi-line scope closed by an explicit closing macro. All macros
636 contains bodies; only
639 .Bd -literal -offset indent
640 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
646 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
647 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
648 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
649 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
650 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
651 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
652 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
653 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
654 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
655 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
659 .Ss Block full-implicit
660 Multi-line scope closed by end-of-file or implicitly by another macro.
661 All macros have bodies; some
669 don't have heads; only one
674 .Bd -literal -offset indent
675 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
680 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
681 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
682 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
683 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
684 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
685 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
689 .Ss Block partial-explicit
690 Like block full-explicit, but also with single-line scope. Each
691 has at least a body and, in limited circumstances, a head
698 .Bd -literal -offset indent
699 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
701 \&.Yc \(lBtail...\(rB
703 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
704 \(lBbody...\(rB \&Yc \(lBtail...\(rB
708 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
709 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
710 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
711 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
712 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
713 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
714 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
715 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
716 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
717 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
718 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
719 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
720 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
721 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
722 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
723 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
724 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
725 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
726 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
727 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
728 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
729 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
730 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
731 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
732 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
733 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
737 .Ss Block partial-implicit
738 Like block full-implicit, but with single-line scope closed by
739 .Sx Reserved Characters
741 .Bd -literal -offset indent
742 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
746 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
747 .It Em Macro Ta Em Callable Ta Em Parsable
748 .It Sx \&Aq Ta Yes Ta Yes
749 .It Sx \&Bq Ta Yes Ta Yes
750 .It Sx \&Brq Ta Yes Ta Yes
751 .It Sx \&D1 Ta \&No Ta \&Yes
752 .It Sx \&Dl Ta \&No Ta Yes
753 .It Sx \&Dq Ta Yes Ta Yes
754 .It Sx \&Op Ta Yes Ta Yes
755 .It Sx \&Pq Ta Yes Ta Yes
756 .It Sx \&Ql Ta Yes Ta Yes
757 .It Sx \&Qq Ta Yes Ta Yes
758 .It Sx \&Sq Ta Yes Ta Yes
764 .Sx Reserved Characters ,
765 end of line, fixed argument lengths, and/or subsequent macros. In-line
766 macros have only text children. If a number (or inequality) of
769 then the macro accepts an arbitrary number of arguments.
770 .Bd -literal -offset indent
771 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
773 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
775 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
779 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
780 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
781 .It Sx \&%A Ta \&No Ta \&No Ta >0
782 .It Sx \&%B Ta \&No Ta \&No Ta >0
783 .It Sx \&%C Ta \&No Ta \&No Ta >0
784 .It Sx \&%D Ta \&No Ta \&No Ta >0
785 .It Sx \&%I Ta \&No Ta \&No Ta >0
786 .It Sx \&%J Ta \&No Ta \&No Ta >0
787 .It Sx \&%N Ta \&No Ta \&No Ta >0
788 .It Sx \&%O Ta \&No Ta \&No Ta >0
789 .It Sx \&%P Ta \&No Ta \&No Ta >0
790 .It Sx \&%Q Ta \&No Ta \&No Ta >0
791 .It Sx \&%R Ta \&No Ta \&No Ta >0
792 .It Sx \&%T Ta \&No Ta \&No Ta >0
793 .It Sx \&%U Ta \&No Ta \&No Ta >0
794 .It Sx \&%V Ta \&No Ta \&No Ta >0
795 .It Sx \&Ad Ta Yes Ta Yes Ta n
796 .It Sx \&An Ta Yes Ta Yes Ta n
797 .It Sx \&Ap Ta Yes Ta Yes Ta 0
798 .It Sx \&Ar Ta Yes Ta Yes Ta n
799 .It Sx \&At Ta Yes Ta Yes Ta 1
800 .It Sx \&Bsx Ta Yes Ta Yes Ta n
801 .It Sx \&Bt Ta \&No Ta \&No Ta 0
802 .It Sx \&Bx Ta Yes Ta Yes Ta n
803 .It Sx \&Cd Ta Yes Ta Yes Ta >0
804 .It Sx \&Cm Ta Yes Ta Yes Ta n
805 .It Sx \&Db Ta \&No Ta \&No Ta 1
806 .It Sx \&Dd Ta \&No Ta \&No Ta >0
807 .It Sx \&Dt Ta \&No Ta \&No Ta n
808 .It Sx \&Dv Ta Yes Ta Yes Ta n
809 .It Sx \&Dx Ta Yes Ta Yes Ta n
810 .It Sx \&Em Ta Yes Ta Yes Ta >0
811 .It Sx \&En Ta \&No Ta \&No Ta 0
812 .It Sx \&Er Ta Yes Ta Yes Ta >0
813 .It Sx \&Es Ta \&No Ta \&No Ta 0
814 .It Sx \&Ev Ta Yes Ta Yes Ta n
815 .It Sx \&Ex Ta \&No Ta \&No Ta n
816 .It Sx \&Fa Ta Yes Ta Yes Ta n
817 .It Sx \&Fd Ta \&No Ta \&No Ta >0
818 .It Sx \&Fl Ta Yes Ta Yes Ta n
819 .It Sx \&Fn Ta Yes Ta Yes Ta >0
820 .It Sx \&Fr Ta \&No Ta \&No Ta n
821 .It Sx \&Ft Ta Yes Ta Yes Ta n
822 .It Sx \&Fx Ta Yes Ta Yes Ta n
823 .It Sx \&Hf Ta \&No Ta \&No Ta n
824 .It Sx \&Ic Ta Yes Ta Yes Ta >0
825 .It Sx \&In Ta \&No Ta \&No Ta n
826 .It Sx \&Lb Ta \&No Ta \&No Ta 1
827 .It Sx \&Li Ta Yes Ta Yes Ta n
828 .It Sx \&Lk Ta Yes Ta Yes Ta n
829 .It Sx \&Lp Ta \&No Ta \&No Ta 0
830 .It Sx \&Ms Ta Yes Ta Yes Ta >0
831 .It Sx \&Mt Ta Yes Ta Yes Ta >0
832 .It Sx \&Nm Ta Yes Ta Yes Ta n
833 .It Sx \&No Ta Yes Ta Yes Ta 0
834 .It Sx \&Ns Ta Yes Ta Yes Ta 0
835 .It Sx \&Nx Ta Yes Ta Yes Ta n
836 .It Sx \&Os Ta \&No Ta \&No Ta n
837 .It Sx \&Ot Ta \&No Ta \&No Ta n
838 .It Sx \&Ox Ta Yes Ta Yes Ta n
839 .It Sx \&Pa Ta Yes Ta Yes Ta n
840 .It Sx \&Pf Ta \&No Ta Yes Ta 1
841 .It Sx \&Pp Ta \&No Ta \&No Ta 0
842 .It Sx \&Rv Ta \&No Ta \&No Ta n
843 .It Sx \&Sm Ta \&No Ta \&No Ta 1
844 .It Sx \&St Ta \&No Ta Yes Ta 1
845 .It Sx \&Sx Ta Yes Ta Yes Ta >0
846 .It Sx \&Sy Ta Yes Ta Yes Ta >0
847 .It Sx \&Tn Ta Yes Ta Yes Ta >0
848 .It Sx \&Ud Ta \&No Ta \&No Ta 0
849 .It Sx \&Ux Ta Yes Ta Yes Ta n
850 .It Sx \&Va Ta Yes Ta Yes Ta n
851 .It Sx \&Vt Ta Yes Ta Yes Ta >0
852 .It Sx \&Xr Ta Yes Ta Yes Ta >0, <3
853 .It Sx \&br Ta \&No Ta \&No Ta 0
854 .It Sx \&sp Ta \&No Ta \&No Ta 1
859 This section is a canonical reference of all macros, arranged
860 alphabetically. For the scoping of individual macros, see
866 block. Multiple authors should each be accorded their own
868 line. Author names should be ordered with full or abbreviated
869 forename(s) first, then full surname.
874 block. This macro may also be used in a non-bibliographic context when
875 referring to book titles.
878 Publication city or location of an
883 this macro is not implemented in
887 Publication date of an
889 block. This should follow the reduced or canonical form syntax
894 Publisher or issuer name of an
904 Issue number (usually for journals) of an
909 Optional information of an
914 Book or journal page number of an
919 Institutional author (school, government, etc.) of an
921 block. Multiple institutional authors should each be accorded their own
926 Technical report name of an
933 block. This macro may also be used in a non-bibliographical context
934 when referring to article titles.
937 URI of reference document.
947 block. Does not have any tail arguments.
950 Address construct: usually in the context of an computational address in
951 memory, not a physical (post) address.
954 .Bd -literal -offset indent
960 Author name. This macro may alternatively accepts the following
961 arguments, although these may not be specified along with a parameter:
962 .Bl -tag -width 12n -offset indent
964 Renders a line break before each author listing.
970 In the AUTHORS section, the default is not to split the first author
971 listing, but all subsequent author listings, whether or not they're
972 interspersed by other macros or text, are split. Thus, specifying
974 will cause the first listing also to be split. If not in the AUTHORS
975 section, the default is not to split.
978 .Bd -literal -offset indent
980 \&.An J. E. Hopcraft ,
989 are re-set when entering the AUTHORS section, so if one specifies
991 in the general document body, it must be re-specified in the AUTHORS
995 Begins a block enclosed by angled brackets. Does not have any head
999 .Bd -literal -offset indent
1000 \&.Fl -key= Ns Ao Ar val Ac
1007 Inserts an apostrophe without any surrounding white-space. This is
1008 generally used as a grammatic device when referring to the verb form of
1010 .Bd -literal -offset indent
1015 Encloses its arguments in angled brackets.
1018 .Bd -literal -offset indent
1019 \&.Fl -key= Ns Aq Ar val
1023 this macro is often abused for rendering URIs, which should instead use
1027 or to note pre-processor
1029 statements, which should use
1036 Command arguments. If an argument is not provided, the string
1038 is used as a default.
1041 .Bd -literal -offset indent
1048 Formats an AT&T version. Accepts at most one parameter:
1049 .Bl -tag -width 12n -offset indent
1058 Note that these parameters do not begin with a hyphen.
1061 .Bd -literal -offset indent
1079 block. Does not have any tail arguments.
1082 Begins a display block. A display is collection of macros or text which
1083 may be collectively offset or justified in a manner different from that
1084 of the enclosing context. By default, the block is preceded by a
1087 Each display is associated with a type, which must be one of the
1088 following arguments:
1089 .Bl -tag -width 12n -offset indent
1091 Only left-justify the block.
1093 Do not justify the block at all.
1095 Left- and right-justify the block.
1100 Centre-justify each line.
1103 The type must be provided first. Secondary arguments are as follows:
1104 .Bl -tag -width 12n -offset indent
1105 .It Fl offset Ar width
1106 Offset by the value of
1108 which is interpreted as one of the following, specified in order:
1111 As one of the pre-defined strings
1113 the width of standard indentation;
1118 which has no effect ;
1120 which justifies to the right margin; and
1122 which aligns around an imagined centre axis.
1124 As a precalculated width for a named macro. The most popular is the
1130 As a scaling unit following the syntax described in
1131 .Sx Scaling Widths .
1133 As the calculated string length of the opaque string.
1136 If unset, it will revert to the value of
1139 .Sx Scaling Widths .
1141 Do not assert a vertical space before the block.
1145 before any text or macros within the block.
1149 .Bd -literal -offset indent
1150 \&.Bd \-unfilled \-offset two-indent \-compact
1165 Begins a block enclosed by square brackets. Does not have any head
1169 .Bd -literal -offset indent
1178 Encloses its arguments in square brackets.
1181 .Bd -literal -offset indent
1186 this macro is sometimes abused to emulate optional arguments for
1187 commands; the correct macros to use for this purpose are
1199 block. Does not have any tail arguments.
1202 Begins a block enclosed by curly braces. Does not have any head
1206 .Bd -literal -offset indent
1215 Encloses its arguments in curly braces.
1218 .Bd -literal -offset indent
1219 \&.Brq 1 , ... , Va n
1226 Format the BSD/OS version provided as an argument, or a default value if
1227 no argument is provided.
1230 .Bd -literal -offset indent
1247 .Dq is currently in beta test.
1250 Format the BSD version provided as an argument, or a default value if no
1251 argument is provided.
1254 .Bd -literal -offset indent
1270 Configuration declaration (suggested for use only in section four
1271 manuals). This denotes strings accepted by
1275 .Bd -literal -offset indent
1276 \&.Cd device le0 at scode?
1280 this macro is commonly abused by using quoted literals to retain
1281 white-space and align consecutive
1283 declarations. This practise is discouraged.
1286 Command modifiers. Useful when specifying configuration options or
1290 .Bd -literal -offset indent
1299 One-line indented display. This is formatted by the default rules and
1300 is useful for simple indented statements. It is followed by a newline.
1303 .Bd -literal -offset indent
1316 block. Does not have any tail arguments.
1319 Document date. This is the mandatory first macro of any
1321 manual. Its calling syntax is as follows:
1323 .D1 \. Ns Sx \&Dd Cm date
1329 which signifies the current manual revision date dictated by
1331 or instead a valid canonical date as specified by
1333 If a date does not conform, the current date is used instead.
1336 .Bd -literal -offset indent
1338 \&.Dd $\&Mdocdate: July 21 2007$
1348 One-line intended display. This is formatted as literal text and is
1349 useful for commands and invocations. It is followed by a newline.
1352 .Bd -literal -offset indent
1353 \&.Dl % mandoc mdoc.7 | less
1362 Begins a block enclosed by double quotes. Does not have any head
1366 .Bd -literal -offset indent
1367 \&.D1 Do April is the cruellest month Dc \e(em T.S. Eliot
1374 Encloses its arguments in double quotes.
1377 .Bd -literal -offset indent
1378 \&.Dq April is the cruellest month
1386 Document title. This is the mandatory second macro of any
1388 file. Its calling syntax is as follows:
1390 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1392 Its arguments are as follows:
1393 .Bl -tag -width Ds -offset Ds
1395 The document's title (name). This should be capitalised and is
1398 The manual section. This may be one of
1406 .Pq Perl libraries ,
1416 .Pq system utilities ,
1418 .Pq kernel functions ,
1420 .Pq X Window System ,
1422 .Pq X Window System ,
1432 It is also required and should correspond to the manual's filename
1435 This overrides the volume inferred from
1437 This field is optional, and if specified, must be one of
1439 .Pq users' supplementary documents ,
1441 .Pq programmers' supplementary documents ,
1443 .Pq administrators' supplementary documents ,
1445 .Pq system managers' manuals ,
1447 .Pq users' reference manuals ,
1449 .Pq programmers' reference manuals ,
1451 .Pq kernel manuals ,
1462 .Pq contributed manuals .
1464 This specifies a specific relevant architecture. If
1466 is not provided, it may be used in its place, else it may be used
1467 subsequent that. It, too, is optional. It must be one of
1498 .Bd -literal -offset indent
1511 Defined variables such as preprocessor constants.
1514 .Bd -literal -offset indent
1523 Format the DragonFly BSD version provided as an argument, or a default
1524 value if no argument is provided.
1527 .Bd -literal -offset indent
1548 Denotes text that should be emphasised. Note that this is a
1549 presentation term and should not be used for stylistically decorating
1553 .Bd -literal -offset indent
1561 Error constants (suggested for use only in section two manuals).
1564 .Bd -literal -offset indent
1575 Environmental variables such as those specified in
1579 .Bd -literal -offset indent
1585 Inserts text regarding a utility's exit values. This macro must have
1588 argument specified, then an optional
1592 is not provided, the document's name as stipulated in
1604 Format the FreeBSD version provided as an argument, or a default value
1605 if no argument is provided.
1608 .Bd -literal -offset indent
1630 Format a hyperlink. The calling syntax is as follows:
1632 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1635 .Bd -literal -offset indent
1636 \&.Lk http://bsd.lv "The BSD.lv Project"
1651 Format the NetBSD version provided as an argument, or a default value if
1652 no argument is provided.
1655 .Bd -literal -offset indent
1674 Document operating system version. This is the mandatory third macro of
1677 file. Its calling syntax is as follows:
1679 .D1 \. Ns Sx \&Os Op Cm system
1683 parameter specifies the relevant operating system or environment. Left
1684 unspecified, it defaults to the local operating system version. This is
1688 .Bd -literal -offset indent
1703 this macro has been deprecated.
1706 Format the OpenBSD version provided as an argument, or a default value
1707 if no argument is provided.
1710 .Bd -literal -offset indent
1739 block. Does not have any tail arguments.
1742 Begins a bibliographic
1744 block. Does not have any head arguments. The block macro may only
1760 child macros (at least one must be specified).
1763 .Bd -literal -offset indent
1765 \&.%A J. E. Hopcroft
1767 \&.%B Introduction to Automata Theory, Languages, and Computation
1768 \&.%I Addison-Wesley
1769 \&.%C Reading, Massachusettes
1776 block is used within a SEE ALSO section, a vertical space is asserted
1777 before the rendered output, else the block continues on the current
1793 Format the UNIX name. Accepts no argument.
1796 .Bd -literal -offset indent
1820 This section documents compatibility with other roff implementations, at
1821 this time limited to
1825 refers to those versions before the
1828 .Pq somewhere between 1.15 and 1.19 .
1834 behaves strangely (even between versions) when specifying
1836 escapes within line-macro scopes. These aberrations have been
1839 Negative scaling units are now truncated to zero instead of creating
1840 interesting conditions, such as with
1845 scaling unit, while accepted, is rendered as the default unit.
1847 In quoted literals, groff allowed pair-wise double-quotes to produce a
1848 standalone double-quote in formatted output. This idiosyncratic
1849 behaviour is no longer applicable.
1860 argument is ignored. Since text is not right-justified,
1869 Blocks of whitespace are stripped from both macro and free-form text
1870 lines (except when in literal mode), while groff would retain whitespace
1871 in free-form text lines.
1873 Historic groff has many un-callable macros. Most of these (excluding
1874 some block-level macros) are now callable, conforming to the
1875 non-historic groff version.
1881 but is a proper delimiter in this implementation.
1885 is assumed for all lists (it wasn't in historic groff): any list may be
1888 lists will restart the sequence only for the sub-list.
1892 incorrectly by following it with a reserved character and expecting the
1893 delimiter to render. This is not supported.
1897 macro only produces the first parameter. This is no longer the case.
1909 reference was written by
1910 .An Kristaps Dzonsons Aq kristaps@kth.se .
1912 .\" XXX: this really isn't the place for these caveats.
1916 .\" There are many ambiguous parts of mdoc.
1919 .\" .Bl -dash -compact
1924 .\" as function arguments are variables.
1929 .\" as function return types are still types. Furthermore, the
1931 .\" should be removed and
1933 .\" which ostensibly follows it, should follow the same convention as
1937 .\" should formalise that only one or two arguments are acceptable: a
1938 .\" variable name and optional, preceding type.
1941 .\" is ambiguous. It's commonly used to indicate an include file in the
1942 .\" synopsis section.
1944 .\" should be used, instead.
1950 .\" makes sense. The remaining ones should be removed.
1956 .\" macros should be deprecated.
1960 .\" macro lacks clarity. It should be absolutely clear which title will
1961 .\" render when formatting the manual page.
1965 .\" should be provided for Linux (\(`a la
1970 .\" There's no way to refer to references in
1974 .\" The \-split and \-nosplit dictates via
1976 .\" are re-set when entering and leaving the AUTHORS section.