1 .\" $Id: mdoc.7,v 1.73 2009/11/02 11:39:40 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 2 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), or P and R
135 (Roman, or reset). This form is not recommended for
137 which encourages semantic, not presentation, annotation.
140 .Ss Predefined Strings
143 also defined a set of package-specific
144 .Dq predefined strings ,
146 .Sx Special Characters ,
147 demark special output characters and strings by way of input codes.
148 Predefined strings are escaped with the slash-asterisk,
158 for a complete list. Examples include
167 In non-literal free-form lines, consecutive blocks of whitespace are
168 pruned from input and added later in the output filter, if applicable:
169 .Bd -literal -offset indent
170 These spaces are pruned from input.
177 In macro lines, whitespace delimits arguments and is discarded. If
178 arguments are quoted, whitespace within the quotes is retained.
181 Blank lines are only permitted within literal contexts, as are lines
182 containing only whitespace. Tab characters are only acceptable when
185 or when in a literal context.
189 Macro arguments may be quoted with a double-quote to group
190 space-delimited terms or to retain blocks of whitespace. A quoted
191 argument begins with a double-quote preceded by whitespace. The next
192 double-quote not pair-wise adjacent to another double-quote terminates
193 the literal, regardless of surrounding whitespace.
202 Note that any quoted term, be it argument or macro, is indiscriminately
203 considered literal text. Thus, the following produces
205 .Bd -literal -offset indent
210 In free-form mode, quotes are regarded as opaque text.
213 There are several macros in
215 that require a date argument. The canonical form for dates is the
218 .D1 Cm Month Day , Year
222 value is an optionally zero-padded numeral. The
224 value is the full month name. The
226 value is the full four-digit year.
228 Reduced form dates are broken-down canonical form dates:
233 Some examples of valid dates follow:
235 .D1 "May, 2009" Pq reduced form
236 .D1 "2009" Pq reduced form
237 .D1 "May 20, 2009" Pq canonical form
240 Many macros support scaled widths for their arguments, such as
241 stipulating a two-inch list indentation with the following:
242 .Bd -literal -offset indent
247 The syntax for scaled widths is
248 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
249 where a decimal must be preceded or proceeded by at least one digit.
250 Negative numbers, while accepted, are truncated to zero. The following
251 scaling units are accepted:
253 .Bl -tag -width Ds -offset indent -compact
266 default vertical span
278 default horizontal span
283 Using anything other than
289 is necessarily non-portable across output media. See
296 document consists of a document prologue followed by one or more
299 The prologue, which consists of (in order) the
304 macros, is required for every document.
306 The first section (sections are denoted by
308 must be the NAME section, consisting of at least one
313 Following that, convention dictates specifying at least the SYNOPSIS and
314 DESCRIPTION sections, although this varies between manual sections.
316 The following is a well-formed skeleton
319 .Bd -literal -offset indent
326 \&.Nd a description goes here
327 \&.\e\*q The next is for sections 2 & 3 only.
338 utility processes files ...
339 \&.\e\*q .Sh IMPLEMENTATION NOTES
340 \&.\e\*q The next is for sections 1 & 8 only.
341 \&.\e\*q .Sh EXIT STATUS
342 \&.\e\*q The next is for sections 2, 3, & 9 only.
343 \&.\e\*q .Sh RETURN VALUES
344 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
345 \&.\e\*q .Sh ENVIRONMENT
347 \&.\e\*q .Sh EXAMPLES
348 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
349 \&.\e\*q .Sh DIAGNOSTICS
350 \&.\e\*q The next is for sections 2, 3, & 9 only.
352 \&.\e\*q .Sh SEE ALSO
353 \&.\e\*q .Xr foobar 1
354 \&.\e\*q .Sh STANDARDS
359 \&.\e\*q .Sh SECURITY CONSIDERATIONS
364 document are conventionally ordered as they appear above. Sections
365 should be composed as follows:
366 .Bl -ohang -offset Ds
368 The name(s) and a short description of the documented material. The
369 syntax for this as follows:
370 .Bd -literal -offset indent
374 \&.Nd a short description
379 macro(s) must precede the
384 The name of the library containing the documented material, which is
385 assumed to be a function in a section 2 or 3 manual. The syntax for
387 .Bd -literal -offset indent
396 Documents the utility invocation syntax, function call syntax, or device
399 For the first, utilities (sections 1, 6, and 8), this is
400 generally structured as follows:
401 .Bd -literal -offset indent
412 For the second, function calls (sections 2, 3, 9):
413 .Bd -literal -offset indent
414 \&.Vt extern const char *global;
417 \&.Fn foo "const char *src"
419 \&.Fn bar "const char *src"
422 And for the third, configurations (section 4):
423 .Bd -literal -offset indent
424 \&.Cd \*qit* at isa? port 0x2e\*q
425 \&.Cd \*qit* at isa? port 0x4e\*q
428 Manuals not in these sections generally don't need a
432 This expands upon the brief, one-line description in
434 It usually contains a break-down of the options (if documenting a
436 .Bd -literal -offset indent
437 The arguments are as follows:
438 \&.Bl \-tag \-width Ds
440 Print verbose information.
443 Manuals not documenting a command won't include the above fragment.
445 .It Em IMPLEMENTATION NOTES
446 Implementation-specific notes should be kept here. This is useful when
447 implementing standard functions that may have side effects or notable
448 algorithmic implications.
451 Command exit status for section 1, 6, and 8 manuals. This section is
454 which is used for functions. Historically, this information was
457 a practise that is now discouraged.
463 This section is the dual of
465 which is used for commands. It documents the return values of functions
466 in sections 2, 3, and 9.
472 Documents any usages of environment variables, e.g.,
479 Documents files used. It's helpful to document both the file and a
480 short description of how the file is used (created, modified, etc.).
486 Example usages. This often contains snippets of well-formed,
487 well-tested invocations. Make doubly sure that your examples work
491 Documents error conditions. This is most useful in section 4 manuals.
492 Historically, this section was used in place of
494 for manuals in sections 1, 6, and 8; however, this practise is
501 Documents error handling in sections 2, 3, and 9.
507 References other manuals with related topics. This section should exist
508 for most manuals. Cross-references should conventionally be ordered
509 first by section, then alphabetically.
515 References any standards implemented or used. If not adhering to any
518 section should be used instead.
524 The history of any manual without a
526 section should be described in this section.
529 Credits to authors, if applicable, should appear in this section.
530 Authors should generally be noted by both name and an e-mail address.
536 Explanations of common misuses and misunderstandings should be explained
540 Extant bugs should be described in this section.
542 .It Em SECURITY CONSIDERATIONS
543 Documents any security precautions that operators should consider.
549 Macros are one to three three characters in length and begin with a
552 at the beginning of the line. An arbitrary amount of whitespace may
553 sit between the control character and the macro name. Thus, the
554 following are equivalent:
555 .Bd -literal -offset indent
561 The syntax of a macro depends on its classification. In this section,
563 refers to macro arguments, which may be followed by zero or more
567 opens the scope of a macro; and if specified,
574 column indicates that the macro may be called subsequent to the initial
575 line-macro. If a macro is not callable, then its invocation after the
576 initial line macro is interpreted as opaque text, such that
584 column indicates whether the macro may be followed by further
585 (ostensibly callable) macros. If a macro is not parsable, subsequent
586 macro invocations on the line will be interpreted as opaque text.
591 column, if applicable, describes closure rules.
594 .Ss Block full-explicit
595 Multi-line scope closed by an explicit closing macro. All macros
596 contains bodies; only
599 .Bd -literal -offset indent
600 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
606 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
607 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
608 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
609 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
610 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
611 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
612 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
613 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
614 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
615 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
619 .Ss Block full-implicit
620 Multi-line scope closed by end-of-file or implicitly by another macro.
621 All macros have bodies; some
629 don't have heads; only one
634 .Bd -literal -offset indent
635 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
640 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
641 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
642 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
643 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
644 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
645 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
649 .Ss Block partial-explicit
650 Like block full-explicit, but also with single-line scope. Each
651 has at least a body and, in limited circumstances, a head
658 .Bd -literal -offset indent
659 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
661 \&.Yc \(lBtail...\(rB
663 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
664 \(lBbody...\(rB \&Yc \(lBtail...\(rB
668 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
669 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
670 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
671 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
672 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
673 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
674 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
675 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
676 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
677 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
678 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
679 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
680 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
681 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
682 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
683 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
684 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
685 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
686 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
687 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
688 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
689 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
690 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
691 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
692 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
693 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
697 .Ss Block partial-implicit
698 Like block full-implicit, but with single-line scope closed by
699 .Sx Reserved Characters
701 .Bd -literal -offset indent
702 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
706 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
707 .It Em Macro Ta Em Callable Ta Em Parsable
708 .It Sx \&Aq Ta Yes Ta Yes
709 .It Sx \&Bq Ta Yes Ta Yes
710 .It Sx \&Brq Ta Yes Ta Yes
711 .It Sx \&D1 Ta \&No Ta \&Yes
712 .It Sx \&Dl Ta \&No Ta Yes
713 .It Sx \&Dq Ta Yes Ta Yes
714 .It Sx \&Op Ta Yes Ta Yes
715 .It Sx \&Pq Ta Yes Ta Yes
716 .It Sx \&Ql Ta Yes Ta Yes
717 .It Sx \&Qq Ta Yes Ta Yes
718 .It Sx \&Sq Ta Yes Ta Yes
724 .Sx Reserved Characters ,
725 end of line, fixed argument lengths, and/or subsequent macros. In-line
726 macros have only text children. If a number (or inequality) of
729 then the macro accepts an arbitrary number of arguments.
730 .Bd -literal -offset indent
731 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
733 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
735 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
739 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
740 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
741 .It Sx \&%A Ta \&No Ta \&No Ta >0
742 .It Sx \&%B Ta \&No Ta \&No Ta >0
743 .It Sx \&%C Ta \&No Ta \&No Ta >0
744 .It Sx \&%D Ta \&No Ta \&No Ta >0
745 .It Sx \&%I Ta \&No Ta \&No Ta >0
746 .It Sx \&%J Ta \&No Ta \&No Ta >0
747 .It Sx \&%N Ta \&No Ta \&No Ta >0
748 .It Sx \&%O Ta \&No Ta \&No Ta >0
749 .It Sx \&%P Ta \&No Ta \&No Ta >0
750 .It Sx \&%Q Ta \&No Ta \&No Ta >0
751 .It Sx \&%R Ta \&No Ta \&No Ta >0
752 .It Sx \&%T Ta \&No Ta \&No Ta >0
753 .It Sx \&%U Ta \&No Ta \&No Ta >0
754 .It Sx \&%V Ta \&No Ta \&No Ta >0
755 .It Sx \&Ad Ta Yes Ta Yes Ta n
756 .It Sx \&An Ta Yes Ta Yes Ta n
757 .It Sx \&Ap Ta Yes Ta Yes Ta 0
758 .It Sx \&Ar Ta Yes Ta Yes Ta n
759 .It Sx \&At Ta Yes Ta Yes Ta 1
760 .It Sx \&Bsx Ta Yes Ta Yes Ta n
761 .It Sx \&Bt Ta \&No Ta \&No Ta 0
762 .It Sx \&Bx Ta Yes Ta Yes Ta n
763 .It Sx \&Cd Ta Yes Ta Yes Ta >0
764 .It Sx \&Cm Ta Yes Ta Yes Ta n
765 .It Sx \&Db Ta \&No Ta \&No Ta 1
766 .It Sx \&Dd Ta \&No Ta \&No Ta >0
767 .It Sx \&Dt Ta \&No Ta \&No Ta n
768 .It Sx \&Dv Ta Yes Ta Yes Ta n
769 .It Sx \&Dx Ta Yes Ta Yes Ta n
770 .It Sx \&Em Ta Yes Ta Yes Ta >0
771 .It Sx \&En Ta \&No Ta \&No Ta 0
772 .It Sx \&Er Ta Yes Ta Yes Ta >0
773 .It Sx \&Es Ta \&No Ta \&No Ta 0
774 .It Sx \&Ev Ta Yes Ta Yes Ta n
775 .It Sx \&Ex Ta \&No Ta \&No Ta n
776 .It Sx \&Fa Ta Yes Ta Yes Ta n
777 .It Sx \&Fd Ta \&No Ta \&No Ta >0
778 .It Sx \&Fl Ta Yes Ta Yes Ta n
779 .It Sx \&Fn Ta Yes Ta Yes Ta >0
780 .It Sx \&Fr Ta \&No Ta \&No Ta n
781 .It Sx \&Ft Ta Yes Ta Yes Ta n
782 .It Sx \&Fx Ta Yes Ta Yes Ta n
783 .It Sx \&Hf Ta \&No Ta \&No Ta n
784 .It Sx \&Ic Ta Yes Ta Yes Ta >0
785 .It Sx \&In Ta \&No Ta \&No Ta n
786 .It Sx \&Lb Ta \&No Ta \&No Ta 1
787 .It Sx \&Li Ta Yes Ta Yes Ta n
788 .It Sx \&Lk Ta Yes Ta Yes Ta n
789 .It Sx \&Lp Ta \&No Ta \&No Ta 0
790 .It Sx \&Ms Ta Yes Ta Yes Ta >0
791 .It Sx \&Mt Ta Yes Ta Yes Ta >0
792 .It Sx \&Nm Ta Yes Ta Yes Ta n
793 .It Sx \&No Ta Yes Ta Yes Ta 0
794 .It Sx \&Ns Ta Yes Ta Yes Ta 0
795 .It Sx \&Nx Ta Yes Ta Yes Ta n
796 .It Sx \&Os Ta \&No Ta \&No Ta n
797 .It Sx \&Ot Ta \&No Ta \&No Ta n
798 .It Sx \&Ox Ta Yes Ta Yes Ta n
799 .It Sx \&Pa Ta Yes Ta Yes Ta n
800 .It Sx \&Pf Ta \&No Ta Yes Ta 1
801 .It Sx \&Pp Ta \&No Ta \&No Ta 0
802 .It Sx \&Rv Ta \&No Ta \&No Ta n
803 .It Sx \&Sm Ta \&No Ta \&No Ta 1
804 .It Sx \&St Ta \&No Ta Yes Ta 1
805 .It Sx \&Sx Ta Yes Ta Yes Ta >0
806 .It Sx \&Sy Ta Yes Ta Yes Ta >0
807 .It Sx \&Tn Ta Yes Ta Yes Ta >0
808 .It Sx \&Ud Ta \&No Ta \&No Ta 0
809 .It Sx \&Ux Ta Yes Ta Yes Ta n
810 .It Sx \&Va Ta Yes Ta Yes Ta n
811 .It Sx \&Vt Ta Yes Ta Yes Ta >0
812 .It Sx \&Xr Ta Yes Ta Yes Ta >0, <3
813 .It Sx \&br Ta \&No Ta \&No Ta 0
814 .It Sx \&sp Ta \&No Ta \&No Ta 1
819 This section is a canonical reference of all macros, arranged
820 alphabetically. For the scoping of individual macros, see
826 block. Multiple authors should each be accorded their own
828 line. Author names should be ordered with full or abbreviated
829 forename(s) first, then full surname.
834 block. This macro may also be used in a non-bibliographic context when
835 referring to book titles.
838 Publication city or location of an
843 this macro is not implemented in
847 Publication date of an
849 block. This should follow the reduced or canonical form syntax
854 Publisher or issuer name of an
864 Issue number (usually for journals) of an
869 Optional information of an
874 Book or journal page number of an
879 Institutional author (school, government, etc.) of an
881 block. Multiple institutional authors should each be accorded their own
886 Technical report name of an
893 block. This macro may also be used in a non-bibliographical context
894 when referring to article titles.
897 URI of reference document.
907 block. Does not have any tail arguments.
910 Address construct: usually in the context of an computational address in
911 memory, not a physical (post) address.
914 .Bd -literal -offset indent
920 Author name. This macro may alternatively accepts the following
921 arguments, although these may not be specified along with a parameter:
922 .Bl -tag -width 12n -offset indent
924 Renders a line break before each author listing.
930 In the AUTHORS section, the default is not to split the first author
931 listing, but all subsequent author listings, whether or not they're
932 interspersed by other macros or text, are split. Thus, specifying
934 will cause the first listing also to be split. If not in the AUTHORS
935 section, the default is not to split.
938 .Bd -literal -offset indent
940 \&.An J. E. Hopcraft ,
949 are re-set when entering the AUTHORS section, so if one specifies
951 in the general document body, it must be re-specified in the AUTHORS
955 Begins a block enclosed by angled brackets. Does not have any head
959 .Bd -literal -offset indent
960 \&.Fl -key= Ns Ao Ar val Ac
967 Inserts an apostrophe without any surrounding white-space. This is
968 generally used as a grammatic device when referring to the verb form of
970 .Bd -literal -offset indent
975 Encloses its arguments in angled brackets.
978 .Bd -literal -offset indent
979 \&.Fl -key= Ns Aq Ar val
983 this macro is often abused for rendering URIs, which should instead use
987 or to note pre-processor
989 statements, which should use
996 Command arguments. If an argument is not provided, the string
998 is used as a default.
1001 .Bd -literal -offset indent
1008 Formats an AT&T version. Accepts at most one parameter:
1009 .Bl -tag -width 12n -offset indent
1018 Note that these parameters do not begin with a hyphen.
1021 .Bd -literal -offset indent
1039 block. Does not have any tail arguments.
1042 Begins a display block. A display is collection of macros or text which
1043 may be collectively offset or justified in a manner different from that
1044 of the enclosing context. By default, the block is preceded by a
1047 Each display is associated with a type, which must be one of the
1048 following arguments:
1049 .Bl -tag -width 12n -offset indent
1051 Only left-justify the block.
1053 Do not justify the block at all.
1055 Left- and right-justify the block.
1060 Centre-justify each line.
1063 The type must be provided first. Secondary arguments are as follows:
1064 .Bl -tag -width 12n -offset indent
1065 .It Fl offset Ar width
1066 Offset by the value of
1068 which is interpreted as one of the following, specified in order:
1071 As one of the pre-defined strings
1073 the width of standard indentation;
1078 which has no effect ;
1080 which justifies to the right margin; and
1082 which aligns around an imagined centre axis.
1084 As a precalculated width for a named macro. The most popular is the
1090 As a scaling unit following the syntax described in
1091 .Sx Scaling Widths .
1093 As the calculated string length of the opaque string.
1096 If unset, it will revert to the value of
1099 .Sx Scaling Widths .
1101 Do not assert a vertical space before the block.
1105 before any text or macros within the block.
1109 .Bd -literal -offset indent
1110 \&.Bd \-unfilled \-offset two-indent \-compact
1125 Begins a block enclosed by square brackets. Does not have any head
1129 .Bd -literal -offset indent
1138 Encloses its arguments in square brackets.
1141 .Bd -literal -offset indent
1146 this macro is sometimes abused to emulate optional arguments for
1147 commands; the correct macros to use for this purpose are
1159 block. Does not have any tail arguments.
1162 Begins a block enclosed by curly braces. Does not have any head
1166 .Bd -literal -offset indent
1175 Encloses its arguments in curly braces.
1178 .Bd -literal -offset indent
1179 \&.Brq 1 , ... , Va n
1186 Format the BSD/OS version provided as an argument, or a default value if
1187 no argument is provided.
1190 .Bd -literal -offset indent
1207 .Dq is currently in beta test.
1210 Format the BSD version provided as an argument, or a default value if no
1211 argument is provided.
1214 .Bd -literal -offset indent
1230 Configuration declaration (suggested for use only in section four
1231 manuals). This denotes strings accepted by
1235 .Bd -literal -offset indent
1236 \&.Cd device le0 at scode?
1240 this macro is commonly abused by using quoted literals to retain
1241 white-space and align consecutive
1243 declarations. This practise is discouraged.
1246 Command modifiers. Useful when specifying configuration options or
1250 .Bd -literal -offset indent
1259 One-line indented display. This is formatted by the default rules and
1260 is useful for simple indented statements. It is followed by a newline.
1263 .Bd -literal -offset indent
1276 block. Does not have any tail arguments.
1279 Document date. This is the mandatory first macro of any
1281 manual. Its calling syntax is as follows:
1283 .D1 \. Ns Sx \&Dd Cm date
1289 which signifies the current manual revision date dictated by
1291 or instead a valid canonical date as specified by
1293 If a date does not conform, the current date is used instead.
1296 .Bd -literal -offset indent
1298 \&.Dd $\&Mdocdate: July 21 2007$
1308 One-line intended display. This is formatted as literal text and is
1309 useful for commands and invocations. It is followed by a newline.
1312 .Bd -literal -offset indent
1313 \&.Dl % mandoc mdoc.7 | less
1322 Begins a block enclosed by double quotes. Does not have any head
1326 .Bd -literal -offset indent
1327 \&.D1 Do April is the cruellest month Dc \e(em T.S. Eliot
1334 Encloses its arguments in double quotes.
1337 .Bd -literal -offset indent
1338 \&.Dq April is the cruellest month
1346 Document title. This is the mandatory second macro of any
1348 file. Its calling syntax is as follows:
1350 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1352 Its arguments are as follows:
1353 .Bl -tag -width Ds -offset Ds
1355 The document's title (name). This should be capitalised and is
1358 The manual section. This may be one of
1366 .Pq Perl libraries ,
1376 .Pq system utilities ,
1378 .Pq kernel functions ,
1380 .Pq X Window System ,
1382 .Pq X Window System ,
1392 It is also required and should correspond to the manual's filename
1395 This overrides the volume inferred from
1397 This field is optional, and if specified, must be one of
1399 .Pq users' supplementary documents ,
1401 .Pq programmers' supplementary documents ,
1403 .Pq administrators' supplementary documents ,
1405 .Pq system managers' manuals ,
1407 .Pq users' reference manuals ,
1409 .Pq programmers' reference manuals ,
1411 .Pq kernel manuals ,
1422 .Pq contributed manuals .
1424 This specifies a specific relevant architecture. If
1426 is not provided, it may be used in its place, else it may be used
1427 subsequent that. It, too, is optional. It must be one of
1458 .Bd -literal -offset indent
1471 Defined variables such as preprocessor constants.
1474 .Bd -literal -offset indent
1483 Format the DragonFly BSD version provided as an argument, or a default
1484 value if no argument is provided.
1487 .Bd -literal -offset indent
1508 Denotes text that should be emphasised. Note that this is a
1509 presentation term and should not be used for stylistically decorating
1513 .Bd -literal -offset indent
1521 Error constants (suggested for use only in section two manuals).
1524 .Bd -literal -offset indent
1535 Environmental variables such as those specified in
1539 .Bd -literal -offset indent
1545 Inserts text regarding a utility's exit values. This macro must have
1548 argument specified, then an optional
1552 is not provided, the document's name as stipulated in
1564 Format the FreeBSD version provided as an argument, or a default value
1565 if no argument is provided.
1568 .Bd -literal -offset indent
1590 Format a hyperlink. The calling syntax is as follows:
1592 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1595 .Bd -literal -offset indent
1596 \&.Lk http://bsd.lv "The BSD.lv Project"
1611 Format the NetBSD version provided as an argument, or a default value if
1612 no argument is provided.
1615 .Bd -literal -offset indent
1634 Document operating system version. This is the mandatory third macro of
1637 file. Its calling syntax is as follows:
1639 .D1 \. Ns Sx \&Os Op Cm system
1643 parameter specifies the relevant operating system or environment. Left
1644 unspecified, it defaults to the local operating system version. This is
1648 .Bd -literal -offset indent
1663 this macro has been deprecated.
1666 Format the OpenBSD version provided as an argument, or a default value
1667 if no argument is provided.
1670 .Bd -literal -offset indent
1699 block. Does not have any tail arguments.
1702 Begins a bibliographic
1704 block. Does not have any head arguments. The block macro may only
1720 child macros (at least one must be specified).
1723 .Bd -literal -offset indent
1725 \&.%A J. E. Hopcroft
1727 \&.%B Introduction to Automata Theory, Languages, and Computation
1728 \&.%I Addison-Wesley
1729 \&.%C Reading, Massachusettes
1736 block is used within a SEE ALSO section, a vertical space is asserted
1737 before the rendered output, else the block continues on the current
1753 Format the UNIX name. Accepts no argument.
1756 .Bd -literal -offset indent
1780 This section documents compatibility with other roff implementations, at
1781 this time limited to
1785 refers to those versions before the
1788 .Pq somewhere between 1.15 and 1.19 .
1793 Negative scaling units are now truncated to zero instead of creating
1794 interesting conditions, such as with
1798 scaling unit, while accepted, is rendered as the default unit.
1800 In quoted literals, groff allowed pair-wise double-quotes to produce a
1801 standalone double-quote in formatted output. This idiosyncratic
1802 behaviour is no longer applicable.
1812 argument is ignored. Since text is not right-justified,
1821 Blocks of whitespace are stripped from both macro and free-form text
1822 lines (except when in literal mode), while groff would retain whitespace
1823 in free-form text lines.
1825 Historic groff has many un-callable macros. Most of these (excluding
1826 some block-level macros) are now callable, conforming to the
1827 non-historic groff version.
1833 but is a proper delimiter in this implementation.
1836 is assumed for all lists (it wasn't in historic groff): any list may be
1839 lists will restart the sequence only for the sub-list.
1843 incorrectly by following it with a reserved character and expecting the
1844 delimiter to render. This is not supported.
1848 macro only produces the first parameter. This is no longer the case.
1860 reference was written by
1861 .An Kristaps Dzonsons Aq kristaps@kth.se .
1863 .\" XXX: this really isn't the place for these caveats.
1867 .\" There are many ambiguous parts of mdoc.
1870 .\" .Bl -dash -compact
1875 .\" as function arguments are variables.
1880 .\" as function return types are still types. Furthermore, the
1882 .\" should be removed and
1884 .\" which ostensibly follows it, should follow the same convention as
1888 .\" should formalise that only one or two arguments are acceptable: a
1889 .\" variable name and optional, preceding type.
1892 .\" is ambiguous. It's commonly used to indicate an include file in the
1893 .\" synopsis section.
1895 .\" should be used, instead.
1901 .\" makes sense. The remaining ones should be removed.
1907 .\" macros should be deprecated.
1911 .\" macro lacks clarity. It should be absolutely clear which title will
1912 .\" render when formatting the manual page.
1916 .\" should be provided for Linux (\(`a la
1921 .\" There's no way to refer to references in
1925 .\" The \-split and \-nosplit dictates via
1927 .\" are re-set when entering and leaving the AUTHORS section.