1 .\" $Id: mdoc.7,v 1.75 2009/11/06 10:31:31 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.
17 .Dd $Mdocdate: November 6 2009 $
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). A numerical representation 3, 2, or 1
136 (bold, italic, and Roman, respectively) may be used instead.
138 These form is not recommended for
140 which encourages semantic annotation.
143 .Ss Predefined Strings
146 also defined a set of package-specific
147 .Dq predefined strings ,
149 .Sx Special Characters ,
150 demark special output characters and strings by way of input codes.
151 Predefined strings are escaped with the slash-asterisk,
161 for a complete list. Examples include
170 In non-literal free-form lines, consecutive blocks of whitespace are
171 pruned from input and added later in the output filter, if applicable:
172 .Bd -literal -offset indent
173 These spaces are pruned from input.
180 In macro lines, whitespace delimits arguments and is discarded. If
181 arguments are quoted, whitespace within the quotes is retained.
184 Blank lines are only permitted within literal contexts, as are lines
185 containing only whitespace. Tab characters are only acceptable when
188 or when in a literal context.
192 Macro arguments may be quoted with a double-quote to group
193 space-delimited terms or to retain blocks of whitespace. A quoted
194 argument begins with a double-quote preceded by whitespace. The next
195 double-quote not pair-wise adjacent to another double-quote terminates
196 the literal, regardless of surrounding whitespace.
205 Note that any quoted term, be it argument or macro, is indiscriminately
206 considered literal text. Thus, the following produces
208 .Bd -literal -offset indent
213 In free-form mode, quotes are regarded as opaque text.
216 There are several macros in
218 that require a date argument. The canonical form for dates is the
221 .D1 Cm Month Day , Year
225 value is an optionally zero-padded numeral. The
227 value is the full month name. The
229 value is the full four-digit year.
231 Reduced form dates are broken-down canonical form dates:
236 Some examples of valid dates follow:
238 .D1 "May, 2009" Pq reduced form
239 .D1 "2009" Pq reduced form
240 .D1 "May 20, 2009" Pq canonical form
243 Many macros support scaled widths for their arguments, such as
244 stipulating a two-inch list indentation with the following:
245 .Bd -literal -offset indent
250 The syntax for scaled widths is
251 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
252 where a decimal must be preceded or proceeded by at least one digit.
253 Negative numbers, while accepted, are truncated to zero. The following
254 scaling units are accepted:
256 .Bl -tag -width Ds -offset indent -compact
269 default vertical span
281 default horizontal span
286 Using anything other than
292 is necessarily non-portable across output media. See
299 document consists of a document prologue followed by one or more
302 The prologue, which consists of (in order) the
307 macros, is required for every document.
309 The first section (sections are denoted by
311 must be the NAME section, consisting of at least one
316 Following that, convention dictates specifying at least the SYNOPSIS and
317 DESCRIPTION sections, although this varies between manual sections.
319 The following is a well-formed skeleton
322 .Bd -literal -offset indent
329 \&.Nd a description goes here
330 \&.\e\*q The next is for sections 2 & 3 only.
341 utility processes files ...
342 \&.\e\*q .Sh IMPLEMENTATION NOTES
343 \&.\e\*q The next is for sections 1 & 8 only.
344 \&.\e\*q .Sh EXIT STATUS
345 \&.\e\*q The next is for sections 2, 3, & 9 only.
346 \&.\e\*q .Sh RETURN VALUES
347 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
348 \&.\e\*q .Sh ENVIRONMENT
350 \&.\e\*q .Sh EXAMPLES
351 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
352 \&.\e\*q .Sh DIAGNOSTICS
353 \&.\e\*q The next is for sections 2, 3, & 9 only.
355 \&.\e\*q .Sh SEE ALSO
356 \&.\e\*q .Xr foobar 1
357 \&.\e\*q .Sh STANDARDS
362 \&.\e\*q .Sh SECURITY CONSIDERATIONS
367 document are conventionally ordered as they appear above. Sections
368 should be composed as follows:
369 .Bl -ohang -offset Ds
371 The name(s) and a short description of the documented material. The
372 syntax for this as follows:
373 .Bd -literal -offset indent
377 \&.Nd a short description
382 macro(s) must precede the
387 The name of the library containing the documented material, which is
388 assumed to be a function in a section 2 or 3 manual. The syntax for
390 .Bd -literal -offset indent
399 Documents the utility invocation syntax, function call syntax, or device
402 For the first, utilities (sections 1, 6, and 8), this is
403 generally structured as follows:
404 .Bd -literal -offset indent
415 For the second, function calls (sections 2, 3, 9):
416 .Bd -literal -offset indent
417 \&.Vt extern const char *global;
420 \&.Fn foo "const char *src"
422 \&.Fn bar "const char *src"
425 And for the third, configurations (section 4):
426 .Bd -literal -offset indent
427 \&.Cd \*qit* at isa? port 0x2e\*q
428 \&.Cd \*qit* at isa? port 0x4e\*q
431 Manuals not in these sections generally don't need a
435 This expands upon the brief, one-line description in
437 It usually contains a break-down of the options (if documenting a
439 .Bd -literal -offset indent
440 The arguments are as follows:
441 \&.Bl \-tag \-width Ds
443 Print verbose information.
446 Manuals not documenting a command won't include the above fragment.
448 .It Em IMPLEMENTATION NOTES
449 Implementation-specific notes should be kept here. This is useful when
450 implementing standard functions that may have side effects or notable
451 algorithmic implications.
454 Command exit status for section 1, 6, and 8 manuals. This section is
457 which is used for functions. Historically, this information was
460 a practise that is now discouraged.
466 This section is the dual of
468 which is used for commands. It documents the return values of functions
469 in sections 2, 3, and 9.
475 Documents any usages of environment variables, e.g.,
482 Documents files used. It's helpful to document both the file and a
483 short description of how the file is used (created, modified, etc.).
489 Example usages. This often contains snippets of well-formed,
490 well-tested invocations. Make doubly sure that your examples work
494 Documents error conditions. This is most useful in section 4 manuals.
495 Historically, this section was used in place of
497 for manuals in sections 1, 6, and 8; however, this practise is
504 Documents error handling in sections 2, 3, and 9.
510 References other manuals with related topics. This section should exist
511 for most manuals. Cross-references should conventionally be ordered
512 first by section, then alphabetically.
518 References any standards implemented or used. If not adhering to any
521 section should be used instead.
527 The history of any manual without a
529 section should be described in this section.
532 Credits to authors, if applicable, should appear in this section.
533 Authors should generally be noted by both name and an e-mail address.
539 Explanations of common misuses and misunderstandings should be explained
543 Extant bugs should be described in this section.
545 .It Em SECURITY CONSIDERATIONS
546 Documents any security precautions that operators should consider.
552 Macros are one to three three characters in length and begin with a
555 at the beginning of the line. An arbitrary amount of whitespace may
556 sit between the control character and the macro name. Thus, the
557 following are equivalent:
558 .Bd -literal -offset indent
564 The syntax of a macro depends on its classification. In this section,
566 refers to macro arguments, which may be followed by zero or more
570 opens the scope of a macro; and if specified,
577 column indicates that the macro may be called subsequent to the initial
578 line-macro. If a macro is not callable, then its invocation after the
579 initial line macro is interpreted as opaque text, such that
587 column indicates whether the macro may be followed by further
588 (ostensibly callable) macros. If a macro is not parsable, subsequent
589 macro invocations on the line will be interpreted as opaque text.
594 column, if applicable, describes closure rules.
597 .Ss Block full-explicit
598 Multi-line scope closed by an explicit closing macro. All macros
599 contains bodies; only
602 .Bd -literal -offset indent
603 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
609 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
610 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
611 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
612 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
613 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
614 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
615 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
616 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
617 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
618 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
622 .Ss Block full-implicit
623 Multi-line scope closed by end-of-file or implicitly by another macro.
624 All macros have bodies; some
632 don't have heads; only one
637 .Bd -literal -offset indent
638 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
643 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
644 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
645 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
646 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
647 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
648 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
652 .Ss Block partial-explicit
653 Like block full-explicit, but also with single-line scope. Each
654 has at least a body and, in limited circumstances, a head
661 .Bd -literal -offset indent
662 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
664 \&.Yc \(lBtail...\(rB
666 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
667 \(lBbody...\(rB \&Yc \(lBtail...\(rB
671 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
672 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
673 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
674 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
675 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
676 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
677 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
678 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
679 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
680 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
681 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
682 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
683 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
684 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
685 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
686 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
687 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
688 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
689 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
690 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
691 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
692 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
693 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
694 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
695 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
696 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
700 .Ss Block partial-implicit
701 Like block full-implicit, but with single-line scope closed by
702 .Sx Reserved Characters
704 .Bd -literal -offset indent
705 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
709 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
710 .It Em Macro Ta Em Callable Ta Em Parsable
711 .It Sx \&Aq Ta Yes Ta Yes
712 .It Sx \&Bq Ta Yes Ta Yes
713 .It Sx \&Brq Ta Yes Ta Yes
714 .It Sx \&D1 Ta \&No Ta \&Yes
715 .It Sx \&Dl Ta \&No Ta Yes
716 .It Sx \&Dq Ta Yes Ta Yes
717 .It Sx \&Op Ta Yes Ta Yes
718 .It Sx \&Pq Ta Yes Ta Yes
719 .It Sx \&Ql Ta Yes Ta Yes
720 .It Sx \&Qq Ta Yes Ta Yes
721 .It Sx \&Sq Ta Yes Ta Yes
727 .Sx Reserved Characters ,
728 end of line, fixed argument lengths, and/or subsequent macros. In-line
729 macros have only text children. If a number (or inequality) of
732 then the macro accepts an arbitrary number of arguments.
733 .Bd -literal -offset indent
734 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
736 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
738 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
742 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
743 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
744 .It Sx \&%A Ta \&No Ta \&No Ta >0
745 .It Sx \&%B Ta \&No Ta \&No Ta >0
746 .It Sx \&%C Ta \&No Ta \&No Ta >0
747 .It Sx \&%D Ta \&No Ta \&No Ta >0
748 .It Sx \&%I Ta \&No Ta \&No Ta >0
749 .It Sx \&%J Ta \&No Ta \&No Ta >0
750 .It Sx \&%N Ta \&No Ta \&No Ta >0
751 .It Sx \&%O Ta \&No Ta \&No Ta >0
752 .It Sx \&%P Ta \&No Ta \&No Ta >0
753 .It Sx \&%Q Ta \&No Ta \&No Ta >0
754 .It Sx \&%R Ta \&No Ta \&No Ta >0
755 .It Sx \&%T Ta \&No Ta \&No Ta >0
756 .It Sx \&%U Ta \&No Ta \&No Ta >0
757 .It Sx \&%V Ta \&No Ta \&No Ta >0
758 .It Sx \&Ad Ta Yes Ta Yes Ta n
759 .It Sx \&An Ta Yes Ta Yes Ta n
760 .It Sx \&Ap Ta Yes Ta Yes Ta 0
761 .It Sx \&Ar Ta Yes Ta Yes Ta n
762 .It Sx \&At Ta Yes Ta Yes Ta 1
763 .It Sx \&Bsx Ta Yes Ta Yes Ta n
764 .It Sx \&Bt Ta \&No Ta \&No Ta 0
765 .It Sx \&Bx Ta Yes Ta Yes Ta n
766 .It Sx \&Cd Ta Yes Ta Yes Ta >0
767 .It Sx \&Cm Ta Yes Ta Yes Ta n
768 .It Sx \&Db Ta \&No Ta \&No Ta 1
769 .It Sx \&Dd Ta \&No Ta \&No Ta >0
770 .It Sx \&Dt Ta \&No Ta \&No Ta n
771 .It Sx \&Dv Ta Yes Ta Yes Ta n
772 .It Sx \&Dx Ta Yes Ta Yes Ta n
773 .It Sx \&Em Ta Yes Ta Yes Ta >0
774 .It Sx \&En Ta \&No Ta \&No Ta 0
775 .It Sx \&Er Ta Yes Ta Yes Ta >0
776 .It Sx \&Es Ta \&No Ta \&No Ta 0
777 .It Sx \&Ev Ta Yes Ta Yes Ta n
778 .It Sx \&Ex Ta \&No Ta \&No Ta n
779 .It Sx \&Fa Ta Yes Ta Yes Ta n
780 .It Sx \&Fd Ta \&No Ta \&No Ta >0
781 .It Sx \&Fl Ta Yes Ta Yes Ta n
782 .It Sx \&Fn Ta Yes Ta Yes Ta >0
783 .It Sx \&Fr Ta \&No Ta \&No Ta n
784 .It Sx \&Ft Ta Yes Ta Yes Ta n
785 .It Sx \&Fx Ta Yes Ta Yes Ta n
786 .It Sx \&Hf Ta \&No Ta \&No Ta n
787 .It Sx \&Ic Ta Yes Ta Yes Ta >0
788 .It Sx \&In Ta \&No Ta \&No Ta n
789 .It Sx \&Lb Ta \&No Ta \&No Ta 1
790 .It Sx \&Li Ta Yes Ta Yes Ta n
791 .It Sx \&Lk Ta Yes Ta Yes Ta n
792 .It Sx \&Lp Ta \&No Ta \&No Ta 0
793 .It Sx \&Ms Ta Yes Ta Yes Ta >0
794 .It Sx \&Mt Ta Yes Ta Yes Ta >0
795 .It Sx \&Nm Ta Yes Ta Yes Ta n
796 .It Sx \&No Ta Yes Ta Yes Ta 0
797 .It Sx \&Ns Ta Yes Ta Yes Ta 0
798 .It Sx \&Nx Ta Yes Ta Yes Ta n
799 .It Sx \&Os Ta \&No Ta \&No Ta n
800 .It Sx \&Ot Ta \&No Ta \&No Ta n
801 .It Sx \&Ox Ta Yes Ta Yes Ta n
802 .It Sx \&Pa Ta Yes Ta Yes Ta n
803 .It Sx \&Pf Ta \&No Ta Yes Ta 1
804 .It Sx \&Pp Ta \&No Ta \&No Ta 0
805 .It Sx \&Rv Ta \&No Ta \&No Ta n
806 .It Sx \&Sm Ta \&No Ta \&No Ta 1
807 .It Sx \&St Ta \&No Ta Yes Ta 1
808 .It Sx \&Sx Ta Yes Ta Yes Ta >0
809 .It Sx \&Sy Ta Yes Ta Yes Ta >0
810 .It Sx \&Tn Ta Yes Ta Yes Ta >0
811 .It Sx \&Ud Ta \&No Ta \&No Ta 0
812 .It Sx \&Ux Ta Yes Ta Yes Ta n
813 .It Sx \&Va Ta Yes Ta Yes Ta n
814 .It Sx \&Vt Ta Yes Ta Yes Ta >0
815 .It Sx \&Xr Ta Yes Ta Yes Ta >0, <3
816 .It Sx \&br Ta \&No Ta \&No Ta 0
817 .It Sx \&sp Ta \&No Ta \&No Ta 1
822 This section is a canonical reference of all macros, arranged
823 alphabetically. For the scoping of individual macros, see
829 block. Multiple authors should each be accorded their own
831 line. Author names should be ordered with full or abbreviated
832 forename(s) first, then full surname.
837 block. This macro may also be used in a non-bibliographic context when
838 referring to book titles.
841 Publication city or location of an
846 this macro is not implemented in
850 Publication date of an
852 block. This should follow the reduced or canonical form syntax
857 Publisher or issuer name of an
867 Issue number (usually for journals) of an
872 Optional information of an
877 Book or journal page number of an
882 Institutional author (school, government, etc.) of an
884 block. Multiple institutional authors should each be accorded their own
889 Technical report name of an
896 block. This macro may also be used in a non-bibliographical context
897 when referring to article titles.
900 URI of reference document.
910 block. Does not have any tail arguments.
913 Address construct: usually in the context of an computational address in
914 memory, not a physical (post) address.
917 .Bd -literal -offset indent
923 Author name. This macro may alternatively accepts the following
924 arguments, although these may not be specified along with a parameter:
925 .Bl -tag -width 12n -offset indent
927 Renders a line break before each author listing.
933 In the AUTHORS section, the default is not to split the first author
934 listing, but all subsequent author listings, whether or not they're
935 interspersed by other macros or text, are split. Thus, specifying
937 will cause the first listing also to be split. If not in the AUTHORS
938 section, the default is not to split.
941 .Bd -literal -offset indent
943 \&.An J. E. Hopcraft ,
952 are re-set when entering the AUTHORS section, so if one specifies
954 in the general document body, it must be re-specified in the AUTHORS
958 Begins a block enclosed by angled brackets. Does not have any head
962 .Bd -literal -offset indent
963 \&.Fl -key= Ns Ao Ar val Ac
970 Inserts an apostrophe without any surrounding white-space. This is
971 generally used as a grammatic device when referring to the verb form of
973 .Bd -literal -offset indent
978 Encloses its arguments in angled brackets.
981 .Bd -literal -offset indent
982 \&.Fl -key= Ns Aq Ar val
986 this macro is often abused for rendering URIs, which should instead use
990 or to note pre-processor
992 statements, which should use
999 Command arguments. If an argument is not provided, the string
1001 is used as a default.
1004 .Bd -literal -offset indent
1011 Formats an AT&T version. Accepts at most one parameter:
1012 .Bl -tag -width 12n -offset indent
1021 Note that these parameters do not begin with a hyphen.
1024 .Bd -literal -offset indent
1042 block. Does not have any tail arguments.
1045 Begins a display block. A display is collection of macros or text which
1046 may be collectively offset or justified in a manner different from that
1047 of the enclosing context. By default, the block is preceded by a
1050 Each display is associated with a type, which must be one of the
1051 following arguments:
1052 .Bl -tag -width 12n -offset indent
1054 Only left-justify the block.
1056 Do not justify the block at all.
1058 Left- and right-justify the block.
1063 Centre-justify each line.
1066 The type must be provided first. Secondary arguments are as follows:
1067 .Bl -tag -width 12n -offset indent
1068 .It Fl offset Ar width
1069 Offset by the value of
1071 which is interpreted as one of the following, specified in order:
1074 As one of the pre-defined strings
1076 the width of standard indentation;
1081 which has no effect ;
1083 which justifies to the right margin; and
1085 which aligns around an imagined centre axis.
1087 As a precalculated width for a named macro. The most popular is the
1093 As a scaling unit following the syntax described in
1094 .Sx Scaling Widths .
1096 As the calculated string length of the opaque string.
1099 If unset, it will revert to the value of
1102 .Sx Scaling Widths .
1104 Do not assert a vertical space before the block.
1108 before any text or macros within the block.
1112 .Bd -literal -offset indent
1113 \&.Bd \-unfilled \-offset two-indent \-compact
1128 Begins a block enclosed by square brackets. Does not have any head
1132 .Bd -literal -offset indent
1141 Encloses its arguments in square brackets.
1144 .Bd -literal -offset indent
1149 this macro is sometimes abused to emulate optional arguments for
1150 commands; the correct macros to use for this purpose are
1162 block. Does not have any tail arguments.
1165 Begins a block enclosed by curly braces. Does not have any head
1169 .Bd -literal -offset indent
1178 Encloses its arguments in curly braces.
1181 .Bd -literal -offset indent
1182 \&.Brq 1 , ... , Va n
1189 Format the BSD/OS version provided as an argument, or a default value if
1190 no argument is provided.
1193 .Bd -literal -offset indent
1210 .Dq is currently in beta test.
1213 Format the BSD version provided as an argument, or a default value if no
1214 argument is provided.
1217 .Bd -literal -offset indent
1233 Configuration declaration (suggested for use only in section four
1234 manuals). This denotes strings accepted by
1238 .Bd -literal -offset indent
1239 \&.Cd device le0 at scode?
1243 this macro is commonly abused by using quoted literals to retain
1244 white-space and align consecutive
1246 declarations. This practise is discouraged.
1249 Command modifiers. Useful when specifying configuration options or
1253 .Bd -literal -offset indent
1262 One-line indented display. This is formatted by the default rules and
1263 is useful for simple indented statements. It is followed by a newline.
1266 .Bd -literal -offset indent
1279 block. Does not have any tail arguments.
1282 Document date. This is the mandatory first macro of any
1284 manual. Its calling syntax is as follows:
1286 .D1 \. Ns Sx \&Dd Cm date
1292 which signifies the current manual revision date dictated by
1294 or instead a valid canonical date as specified by
1296 If a date does not conform, the current date is used instead.
1299 .Bd -literal -offset indent
1301 \&.Dd $\&Mdocdate: July 21 2007$
1311 One-line intended display. This is formatted as literal text and is
1312 useful for commands and invocations. It is followed by a newline.
1315 .Bd -literal -offset indent
1316 \&.Dl % mandoc mdoc.7 | less
1325 Begins a block enclosed by double quotes. Does not have any head
1329 .Bd -literal -offset indent
1330 \&.D1 Do April is the cruellest month Dc \e(em T.S. Eliot
1337 Encloses its arguments in double quotes.
1340 .Bd -literal -offset indent
1341 \&.Dq April is the cruellest month
1349 Document title. This is the mandatory second macro of any
1351 file. Its calling syntax is as follows:
1353 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1355 Its arguments are as follows:
1356 .Bl -tag -width Ds -offset Ds
1358 The document's title (name). This should be capitalised and is
1361 The manual section. This may be one of
1369 .Pq Perl libraries ,
1379 .Pq system utilities ,
1381 .Pq kernel functions ,
1383 .Pq X Window System ,
1385 .Pq X Window System ,
1395 It is also required and should correspond to the manual's filename
1398 This overrides the volume inferred from
1400 This field is optional, and if specified, must be one of
1402 .Pq users' supplementary documents ,
1404 .Pq programmers' supplementary documents ,
1406 .Pq administrators' supplementary documents ,
1408 .Pq system managers' manuals ,
1410 .Pq users' reference manuals ,
1412 .Pq programmers' reference manuals ,
1414 .Pq kernel manuals ,
1425 .Pq contributed manuals .
1427 This specifies a specific relevant architecture. If
1429 is not provided, it may be used in its place, else it may be used
1430 subsequent that. It, too, is optional. It must be one of
1461 .Bd -literal -offset indent
1474 Defined variables such as preprocessor constants.
1477 .Bd -literal -offset indent
1486 Format the DragonFly BSD version provided as an argument, or a default
1487 value if no argument is provided.
1490 .Bd -literal -offset indent
1511 Denotes text that should be emphasised. Note that this is a
1512 presentation term and should not be used for stylistically decorating
1516 .Bd -literal -offset indent
1524 Error constants (suggested for use only in section two manuals).
1527 .Bd -literal -offset indent
1538 Environmental variables such as those specified in
1542 .Bd -literal -offset indent
1548 Inserts text regarding a utility's exit values. This macro must have
1551 argument specified, then an optional
1555 is not provided, the document's name as stipulated in
1567 Format the FreeBSD version provided as an argument, or a default value
1568 if no argument is provided.
1571 .Bd -literal -offset indent
1593 Format a hyperlink. The calling syntax is as follows:
1595 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1598 .Bd -literal -offset indent
1599 \&.Lk http://bsd.lv "The BSD.lv Project"
1614 Format the NetBSD version provided as an argument, or a default value if
1615 no argument is provided.
1618 .Bd -literal -offset indent
1637 Document operating system version. This is the mandatory third macro of
1640 file. Its calling syntax is as follows:
1642 .D1 \. Ns Sx \&Os Op Cm system
1646 parameter specifies the relevant operating system or environment. Left
1647 unspecified, it defaults to the local operating system version. This is
1651 .Bd -literal -offset indent
1666 this macro has been deprecated.
1669 Format the OpenBSD version provided as an argument, or a default value
1670 if no argument is provided.
1673 .Bd -literal -offset indent
1702 block. Does not have any tail arguments.
1705 Begins a bibliographic
1707 block. Does not have any head arguments. The block macro may only
1723 child macros (at least one must be specified).
1726 .Bd -literal -offset indent
1728 \&.%A J. E. Hopcroft
1730 \&.%B Introduction to Automata Theory, Languages, and Computation
1731 \&.%I Addison-Wesley
1732 \&.%C Reading, Massachusettes
1739 block is used within a SEE ALSO section, a vertical space is asserted
1740 before the rendered output, else the block continues on the current
1756 Format the UNIX name. Accepts no argument.
1759 .Bd -literal -offset indent
1783 This section documents compatibility with other roff implementations, at
1784 this time limited to
1788 refers to those versions before the
1791 .Pq somewhere between 1.15 and 1.19 .
1796 Negative scaling units are now truncated to zero instead of creating
1797 interesting conditions, such as with
1801 scaling unit, while accepted, is rendered as the default unit.
1803 In quoted literals, groff allowed pair-wise double-quotes to produce a
1804 standalone double-quote in formatted output. This idiosyncratic
1805 behaviour is no longer applicable.
1815 argument is ignored. Since text is not right-justified,
1824 Blocks of whitespace are stripped from both macro and free-form text
1825 lines (except when in literal mode), while groff would retain whitespace
1826 in free-form text lines.
1828 Historic groff has many un-callable macros. Most of these (excluding
1829 some block-level macros) are now callable, conforming to the
1830 non-historic groff version.
1836 but is a proper delimiter in this implementation.
1839 is assumed for all lists (it wasn't in historic groff): any list may be
1842 lists will restart the sequence only for the sub-list.
1846 incorrectly by following it with a reserved character and expecting the
1847 delimiter to render. This is not supported.
1851 macro only produces the first parameter. This is no longer the case.
1863 reference was written by
1864 .An Kristaps Dzonsons Aq kristaps@kth.se .
1866 .\" XXX: this really isn't the place for these caveats.
1870 .\" There are many ambiguous parts of mdoc.
1873 .\" .Bl -dash -compact
1878 .\" as function arguments are variables.
1883 .\" as function return types are still types. Furthermore, the
1885 .\" should be removed and
1887 .\" which ostensibly follows it, should follow the same convention as
1891 .\" should formalise that only one or two arguments are acceptable: a
1892 .\" variable name and optional, preceding type.
1895 .\" is ambiguous. It's commonly used to indicate an include file in the
1896 .\" synopsis section.
1898 .\" should be used, instead.
1904 .\" makes sense. The remaining ones should be removed.
1910 .\" macros should be deprecated.
1914 .\" macro lacks clarity. It should be absolutely clear which title will
1915 .\" render when formatting the manual page.
1919 .\" should be provided for Linux (\(`a la
1924 .\" There's no way to refer to references in
1928 .\" The \-split and \-nosplit dictates via
1930 .\" are re-set when entering and leaving the AUTHORS section.