1 .\" $Id: mdoc.7,v 1.93 2010/04/07 19:37:54 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: April 7 2010 $
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 mandoc; the
36 section describes compatibility with other troff \-mdoc implementations.
41 document follows simple rules: lines beginning with the control
44 are parsed for macros. Other lines are interpreted within the scope of
46 .Bd -literal -offset indent
47 \&.Sh Macro lines change control state.
48 Other lines are interpreted within the current state.
54 documents may contain only graphable 7-bit ASCII characters, the space
55 character, and, in certain circumstances, the tab character. All
64 whether in a macro or free-form text line, is ignored to the end of
65 line. A macro line with only a control character and comment escape,
67 is also ignored. Macro lines with only a control charater and optionally
68 whitespace are stripped from input.
71 .Ss Reserved Characters
72 Within a macro line, the following characters are reserved:
74 .Bl -tag -width Ds -offset indent -compact
100 Use of reserved characters is described in
102 For general use in macro lines, these characters must either be escaped
103 with a non-breaking space
105 or, if applicable, an appropriate escape sequence used.
108 .Ss Special Characters
109 Special characters may occur in both macro and free-form lines.
110 Sequences begin with the escape character
112 followed by either an open-parenthesis
114 for two-character sequences; an open-bracket
116 for n-character sequences (terminated at a close-bracket
118 or a single one-character sequence. See
120 for a complete list. Examples include
129 Terms may be text-decorated using the
131 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
132 (revert to previous mode):
134 .D1 \efBbold\efR \efIitalic\efP
136 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
137 respectively) may be used instead. A text decoration is valid within
138 the current font scope only: if a macro opens a font scope alongside
139 its own scope, such as
142 in-scope invocations of
144 are only valid within the font scope of the macro. If
146 is specified outside of any font scope, such as in unenclosed, free-form
147 text, it will affect the remainder of the document.
149 Text may also be sized with the
151 escape, whose syntax is one of
153 for one-digit numerals;
157 for two-digit numerals; and
163 for arbitrary-digit numerals:
166 .D1 \es[+10]much bigger\es[-10]
167 .D1 \es+(10much bigger\es-(10
168 .D1 \es+'100'much much bigger\es-'100'
174 which encourages semantic annotation.
177 .Ss Predefined Strings
180 also defined a set of package-specific
181 .Dq predefined strings ,
183 .Sx Special Characters ,
184 demark special output characters and strings by way of input codes.
185 Predefined strings are escaped with the slash-asterisk,
195 for a complete list. Examples include
204 In non-literal free-form lines, consecutive blocks of whitespace are
205 pruned from input and added later in the output filter, if applicable:
206 .Bd -literal -offset indent
207 These spaces are pruned from input.
214 In macro lines, whitespace delimits arguments and is discarded. If
215 arguments are quoted, whitespace within the quotes is retained.
218 Blank lines are only permitted within literal contexts, as are lines
219 containing only whitespace. Tab characters are only acceptable when
222 or when in a literal context.
226 Macro arguments may be quoted with a double-quote to group
227 space-delimited terms or to retain blocks of whitespace. A quoted
228 argument begins with a double-quote preceded by whitespace. The next
229 double-quote not pair-wise adjacent to another double-quote terminates
230 the literal, regardless of surrounding whitespace.
239 Note that any quoted term, be it argument or macro, is indiscriminately
240 considered literal text. Thus, the following produces
242 .Bd -literal -offset indent
247 In free-form mode, quotes are regarded as opaque text.
250 There are several macros in
252 that require a date argument. The canonical form for dates is the
255 .D1 Cm Month Day , Year
259 value is an optionally zero-padded numeral. The
261 value is the full month name. The
263 value is the full four-digit year.
265 Reduced form dates are broken-down canonical form dates:
270 Some examples of valid dates follow:
272 .D1 "May, 2009" Pq reduced form
273 .D1 "2009" Pq reduced form
274 .D1 "May 20, 2009" Pq canonical form
277 Many macros support scaled widths for their arguments, such as
278 stipulating a two-inch list indentation with the following:
279 .Bd -literal -offset indent
284 The syntax for scaled widths is
285 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
286 where a decimal must be preceded or proceeded by at least one digit.
287 Negative numbers, while accepted, are truncated to zero. The following
288 scaling units are accepted:
290 .Bl -tag -width Ds -offset indent -compact
303 default vertical span
315 default horizontal span
320 Using anything other than
326 is necessarily non-portable across output media. See
333 document consists of a document prologue followed by one or more
336 The prologue, which consists of (in order) the
341 macros, is required for every document.
343 The first section (sections are denoted by
345 must be the NAME section, consisting of at least one
350 Following that, convention dictates specifying at least the SYNOPSIS and
351 DESCRIPTION sections, although this varies between manual sections.
353 The following is a well-formed skeleton
356 .Bd -literal -offset indent
363 \&.Nd a description goes here
364 \&.\e\*q The next is for sections 2 & 3 only.
375 utility processes files ...
376 \&.\e\*q .Sh IMPLEMENTATION NOTES
377 \&.\e\*q The next is for sections 1 & 8 only.
378 \&.\e\*q .Sh EXIT STATUS
379 \&.\e\*q The next is for sections 2, 3, & 9 only.
380 \&.\e\*q .Sh RETURN VALUES
381 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
382 \&.\e\*q .Sh ENVIRONMENT
384 \&.\e\*q .Sh EXAMPLES
385 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
386 \&.\e\*q .Sh DIAGNOSTICS
387 \&.\e\*q The next is for sections 2, 3, & 9 only.
389 \&.\e\*q .Sh SEE ALSO
390 \&.\e\*q .Xr foobar 1
391 \&.\e\*q .Sh STANDARDS
396 \&.\e\*q .Sh SECURITY CONSIDERATIONS
401 document are conventionally ordered as they appear above. Sections
402 should be composed as follows:
403 .Bl -ohang -offset Ds
405 The name(s) and a short description of the documented material. The
406 syntax for this as follows:
407 .Bd -literal -offset indent
411 \&.Nd a short description
416 macro(s) must precede the
426 The name of the library containing the documented material, which is
427 assumed to be a function in a section 2 or 3 manual. The syntax for
429 .Bd -literal -offset indent
437 Documents the utility invocation syntax, function call syntax, or device
440 For the first, utilities (sections 1, 6, and 8), this is
441 generally structured as follows:
442 .Bd -literal -offset indent
453 For the second, function calls (sections 2, 3, 9):
454 .Bd -literal -offset indent
455 \&.Vt extern const char *global;
458 \&.Fn foo "const char *src"
460 \&.Fn bar "const char *src"
463 And for the third, configurations (section 4):
464 .Bd -literal -offset indent
465 \&.Cd \*qit* at isa? port 0x2e\*q
466 \&.Cd \*qit* at isa? port 0x4e\*q
469 Manuals not in these sections generally don't need a
481 This expands upon the brief, one-line description in
483 It usually contains a break-down of the options (if documenting a
485 .Bd -literal -offset indent
486 The arguments are as follows:
487 \&.Bl \-tag \-width Ds
489 Print verbose information.
493 Manuals not documenting a command won't include the above fragment.
495 .It Em IMPLEMENTATION NOTES
496 Implementation-specific notes should be kept here. This is useful when
497 implementing standard functions that may have side effects or notable
498 algorithmic implications.
501 Command exit status for section 1, 6, and 8 manuals. This section is
504 which is used for functions. Historically, this information was
507 a practise that is now discouraged.
513 This section is the dual of
515 which is used for commands. It documents the return values of functions
516 in sections 2, 3, and 9.
522 Documents any usages of environment variables, e.g.,
529 Documents files used. It's helpful to document both the file and a
530 short description of how the file is used (created, modified, etc.).
536 Example usages. This often contains snippets of well-formed,
537 well-tested invocations. Make doubly sure that your examples work
541 Documents error conditions. This is most useful in section 4 manuals.
542 Historically, this section was used in place of
544 for manuals in sections 1, 6, and 8; however, this practise is
552 Documents error handling in sections 2, 3, and 9.
558 References other manuals with related topics. This section should exist
559 for most manuals. Cross-references should conventionally be ordered
560 first by section, then alphabetically.
566 References any standards implemented or used. If not adhering to any
569 section should be used instead.
575 The history of any manual without a
577 section should be described in this section.
580 Credits to authors, if applicable, should appear in this section.
581 Authors should generally be noted by both name and an e-mail address.
587 Explanations of common misuses and misunderstandings should be explained
591 Extant bugs should be described in this section.
593 .It Em SECURITY CONSIDERATIONS
594 Documents any security precautions that operators should consider.
600 Macros are one to three three characters in length and begin with a
603 at the beginning of the line. An arbitrary amount of whitespace may
604 sit between the control character and the macro name. Thus, the
605 following are equivalent:
606 .Bd -literal -offset indent
612 The syntax of a macro depends on its classification. In this section,
614 refers to macro arguments, which may be followed by zero or more
618 opens the scope of a macro; and if specified,
625 column indicates that the macro may be called subsequent to the initial
626 line-macro. If a macro is not callable, then its invocation after the
627 initial line macro is interpreted as opaque text, such that
635 column indicates whether the macro may be followed by further
636 (ostensibly callable) macros. If a macro is not parsable, subsequent
637 macro invocations on the line will be interpreted as opaque text.
642 column, if applicable, describes closure rules.
645 .Ss Block full-explicit
646 Multi-line scope closed by an explicit closing macro. All macros
647 contains bodies; only
650 .Bd -literal -offset indent
651 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
657 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
658 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
659 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
660 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
661 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
662 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
663 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
664 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
665 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
666 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
670 .Ss Block full-implicit
671 Multi-line scope closed by end-of-file or implicitly by another macro.
672 All macros have bodies; some
680 don't have heads; only one
685 .Bd -literal -offset indent
686 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
691 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
692 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
693 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
694 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
695 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
696 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
700 .Ss Block partial-explicit
701 Like block full-explicit, but also with single-line scope. Each
702 has at least a body and, in limited circumstances, a head
709 .Bd -literal -offset indent
710 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
712 \&.Yc \(lBtail...\(rB
714 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
715 \(lBbody...\(rB \&Yc \(lBtail...\(rB
719 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
720 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
721 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
722 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
723 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
724 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
725 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
726 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
727 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
728 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
729 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
730 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
731 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
732 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
733 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
734 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
735 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
736 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
737 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
738 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
739 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
740 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
741 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
742 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
743 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
744 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
748 .Ss Block partial-implicit
749 Like block full-implicit, but with single-line scope closed by
750 .Sx Reserved Characters
752 .Bd -literal -offset indent
753 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
757 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
758 .It Em Macro Ta Em Callable Ta Em Parsable
759 .It Sx \&Aq Ta Yes Ta Yes
760 .It Sx \&Bq Ta Yes Ta Yes
761 .It Sx \&Brq Ta Yes Ta Yes
762 .It Sx \&D1 Ta \&No Ta \&Yes
763 .It Sx \&Dl Ta \&No Ta Yes
764 .It Sx \&Dq Ta Yes Ta Yes
765 .It Sx \&Op Ta Yes Ta Yes
766 .It Sx \&Pq Ta Yes Ta Yes
767 .It Sx \&Ql Ta Yes Ta Yes
768 .It Sx \&Qq Ta Yes Ta Yes
769 .It Sx \&Sq Ta Yes Ta Yes
770 .It Sx \&Vt Ta Yes Ta Yes
776 .Sx Block partial-implicit
777 only when invoked as the first macro
778 in a SYNOPSIS section line, else it is
784 .Sx Reserved Characters ,
785 end of line, fixed argument lengths, and/or subsequent macros. In-line
786 macros have only text children. If a number (or inequality) of
789 then the macro accepts an arbitrary number of arguments.
790 .Bd -literal -offset indent
791 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
793 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
795 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
799 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
800 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
801 .It Sx \&%A Ta \&No Ta \&No Ta >0
802 .It Sx \&%B Ta \&No Ta \&No Ta >0
803 .It Sx \&%C Ta \&No Ta \&No Ta >0
804 .It Sx \&%D Ta \&No Ta \&No Ta >0
805 .It Sx \&%I Ta \&No Ta \&No Ta >0
806 .It Sx \&%J Ta \&No Ta \&No Ta >0
807 .It Sx \&%N Ta \&No Ta \&No Ta >0
808 .It Sx \&%O Ta \&No Ta \&No Ta >0
809 .It Sx \&%P Ta \&No Ta \&No Ta >0
810 .It Sx \&%Q Ta \&No Ta \&No Ta >0
811 .It Sx \&%R Ta \&No Ta \&No Ta >0
812 .It Sx \&%T Ta \&No Ta \&No Ta >0
813 .It Sx \&%U Ta \&No Ta \&No Ta >0
814 .It Sx \&%V Ta \&No Ta \&No Ta >0
815 .It Sx \&Ad Ta Yes Ta Yes Ta n
816 .It Sx \&An Ta Yes Ta Yes Ta n
817 .It Sx \&Ap Ta Yes Ta Yes Ta 0
818 .It Sx \&Ar Ta Yes Ta Yes Ta n
819 .It Sx \&At Ta Yes Ta Yes Ta 1
820 .It Sx \&Bsx Ta Yes Ta Yes Ta n
821 .It Sx \&Bt Ta \&No Ta \&No Ta 0
822 .It Sx \&Bx Ta Yes Ta Yes Ta n
823 .It Sx \&Cd Ta Yes Ta Yes Ta >0
824 .It Sx \&Cm Ta Yes Ta Yes Ta n
825 .It Sx \&Db Ta \&No Ta \&No Ta 1
826 .It Sx \&Dd Ta \&No Ta \&No Ta >0
827 .It Sx \&Dt Ta \&No Ta \&No Ta n
828 .It Sx \&Dv Ta Yes Ta Yes Ta n
829 .It Sx \&Dx Ta Yes Ta Yes Ta n
830 .It Sx \&Em Ta Yes Ta Yes Ta >0
831 .It Sx \&En Ta \&No Ta \&No Ta 0
832 .It Sx \&Er Ta Yes Ta Yes Ta >0
833 .It Sx \&Es Ta \&No Ta \&No Ta 0
834 .It Sx \&Ev Ta Yes Ta Yes Ta n
835 .It Sx \&Ex Ta \&No Ta \&No Ta n
836 .It Sx \&Fa Ta Yes Ta Yes Ta n
837 .It Sx \&Fd Ta \&No Ta \&No Ta >0
838 .It Sx \&Fl Ta Yes Ta Yes Ta n
839 .It Sx \&Fn Ta Yes Ta Yes Ta >0
840 .It Sx \&Fr Ta \&No Ta \&No Ta n
841 .It Sx \&Ft Ta Yes Ta Yes Ta n
842 .It Sx \&Fx Ta Yes Ta Yes Ta n
843 .It Sx \&Hf Ta \&No Ta \&No Ta n
844 .It Sx \&Ic Ta Yes Ta Yes Ta >0
845 .It Sx \&In Ta \&No Ta \&No Ta n
846 .It Sx \&Lb Ta \&No Ta \&No Ta 1
847 .It Sx \&Li Ta Yes Ta Yes Ta n
848 .It Sx \&Lk Ta Yes Ta Yes Ta n
849 .It Sx \&Lp Ta \&No Ta \&No Ta 0
850 .It Sx \&Ms Ta Yes Ta Yes Ta >0
851 .It Sx \&Mt Ta Yes Ta Yes Ta >0
852 .It Sx \&Nm Ta Yes Ta Yes Ta n
853 .It Sx \&No Ta Yes Ta Yes Ta 0
854 .It Sx \&Ns Ta Yes Ta Yes Ta 0
855 .It Sx \&Nx Ta Yes Ta Yes Ta n
856 .It Sx \&Os Ta \&No Ta \&No Ta n
857 .It Sx \&Ot Ta \&No Ta \&No Ta n
858 .It Sx \&Ox Ta Yes Ta Yes Ta n
859 .It Sx \&Pa Ta Yes Ta Yes Ta n
860 .It Sx \&Pf Ta Yes Ta Yes Ta 1
861 .It Sx \&Pp Ta \&No Ta \&No Ta 0
862 .It Sx \&Rv Ta \&No Ta \&No Ta n
863 .It Sx \&Sm Ta \&No Ta \&No Ta 1
864 .It Sx \&St Ta \&No Ta Yes Ta 1
865 .It Sx \&Sx Ta Yes Ta Yes Ta >0
866 .It Sx \&Sy Ta Yes Ta Yes Ta >0
867 .It Sx \&Tn Ta Yes Ta Yes Ta >0
868 .It Sx \&Ud Ta \&No Ta \&No Ta 0
869 .It Sx \&Ux Ta Yes Ta Yes Ta n
870 .It Sx \&Va Ta Yes Ta Yes Ta n
871 .It Sx \&Vt Ta Yes Ta Yes Ta >0
872 .It Sx \&Xr Ta Yes Ta Yes Ta >0
873 .It Sx \&br Ta \&No Ta \&No Ta 0
874 .It Sx \&sp Ta \&No Ta \&No Ta 1
879 This section is a canonical reference of all macros, arranged
880 alphabetically. For the scoping of individual macros, see
886 block. Multiple authors should each be accorded their own
888 line. Author names should be ordered with full or abbreviated
889 forename(s) first, then full surname.
894 block. This macro may also be used in a non-bibliographic context when
895 referring to book titles.
898 Publication city or location of an
903 this macro is not implemented in
907 Publication date of an
909 block. This should follow the reduced or canonical form syntax
914 Publisher or issuer name of an
924 Issue number (usually for journals) of an
929 Optional information of an
934 Book or journal page number of an
939 Institutional author (school, government, etc.) of an
941 block. Multiple institutional authors should each be accorded their own
946 Technical report name of an
953 block. This macro may also be used in a non-bibliographical context
954 when referring to article titles.
957 URI of reference document.
967 block. Does not have any tail arguments.
970 Address construct: usually in the context of an computational address in
971 memory, not a physical (post) address.
978 Author name. This macro may alternatively accepts the following
979 arguments, although these may not be specified along with a parameter:
980 .Bl -tag -width 12n -offset indent
982 Renders a line break before each author listing.
988 In the AUTHORS section, the default is not to split the first author
989 listing, but all subsequent author listings, whether or not they're
990 interspersed by other macros or text, are split. Thus, specifying
992 will cause the first listing also to be split. If not in the AUTHORS
993 section, the default is not to split.
997 .D1 \&.An J. D. Ullman .
1004 are re-set when entering the AUTHORS section, so if one specifies
1006 in the general document body, it must be re-specified in the AUTHORS
1010 Begins a block enclosed by angled brackets. Does not have any head
1014 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
1020 Inserts an apostrophe without any surrounding white-space. This is
1021 generally used as a grammatic device when referring to the verb form of
1023 .Bd -literal -offset indent
1028 Encloses its arguments in angled brackets.
1031 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
1034 this macro is often abused for rendering URIs, which should instead use
1038 or to note pre-processor
1040 statements, which should use
1047 Command arguments. If an argument is not provided, the string
1049 is used as a default.
1052 .D1 \&.Fl o \&Ns \&Ar file1
1054 .D1 \&.Ar arg1 , arg2 .
1057 Formats an AT&T version. Accepts at most one parameter:
1058 .Bl -tag -width 12n -offset indent
1067 Note that these parameters do not begin with a hyphen.
1086 block. Does not have any tail arguments.
1089 Begins a display block. A display is collection of macros or text which
1090 may be collectively offset or justified in a manner different from that
1091 of the enclosing context. By default, the block is preceded by a
1094 Each display is associated with a type, which must be one of the
1095 following arguments:
1096 .Bl -tag -width 12n -offset indent
1098 Only left-justify the block.
1100 Do not justify the block at all.
1102 Left- and right-justify the block.
1107 Centre-justify each line.
1110 The type must be provided first. Secondary arguments are as follows:
1111 .Bl -tag -width 12n -offset indent
1112 .It Fl offset Ar width
1113 Offset by the value of
1115 which is interpreted as one of the following, specified in order:
1118 As one of the pre-defined strings
1120 the width of standard indentation;
1125 which has no effect ;
1127 which justifies to the right margin; and
1129 which aligns around an imagined centre axis.
1131 As a precalculated width for a named macro. The most popular is the
1137 As a scaling unit following the syntax described in
1138 .Sx Scaling Widths .
1140 As the calculated string length of the opaque string.
1143 If unset, it will revert to the value of
1146 .Sx Scaling Widths .
1148 Do not assert a vertical space before the block.
1152 before any text or macros within the block.
1156 .Bd -literal -offset indent
1157 \&.Bd \-unfilled \-offset two-indent \-compact
1170 .\" Begins a list composed of one or more list entries. A list entry is
1171 .\" specified by the
1173 .\" macro, which consists of a head and optional body. By default, a list
1174 .\" is preceded by a blank line. A list must specify one of the following
1176 .\" .Bl -tag -width 12n
1178 .\" A list offset by a bullet. The head of list entries must be empty.
1179 .\" List entry bodies are justified after the bullet.
1181 .\" A columnated list. The number of columns is specified as arguments to
1184 .\" macro (the deprecated form of following the invocation of
1186 .\" is also accepted). Arguments dictate the width of columns specified in
1187 .\" list entries. List entry bodies must be left empty. Columns specified
1188 .\" in the list entry head are justified to their position in the sequence
1191 .\" A list offset by a dash (hyphen). The head of list entries must be
1192 .\" empty. List entry bodies are justified past the dash.
1196 .\" lists, but with additional formatting to the head.
1198 .\" A list offset by a number indicating list entry position. The head of
1199 .\" list entries must be empty. List entry bodies are justified past the
1204 .\" but instead of list bodies justifying to the head on the first line,
1205 .\" they trail the head text.
1212 .\" but list entry bodies aren't justified.
1214 .\" An un-justified list. This produces blocks of text.
1216 .\" List bodies are placed on the line following the head.
1218 .\" A list offset by list entry heads. List entry bodies are justified
1225 Begins a block enclosed by square brackets. Does not have any head
1229 .Bd -literal -offset indent
1238 Encloses its arguments in square brackets.
1241 .D1 \&.Bq 1 , \&Dv BUFSIZ
1244 this macro is sometimes abused to emulate optional arguments for
1245 commands; the correct macros to use for this purpose are
1257 block. Does not have any tail arguments.
1260 Begins a block enclosed by curly braces. Does not have any head
1264 .Bd -literal -offset indent
1273 Encloses its arguments in curly braces.
1276 .D1 \&.Brq 1 , ... , \&Va n
1282 Format the BSD/OS version provided as an argument, or a default value if
1283 no argument is provided.
1301 .Dq is currently in beta test.
1304 Format the BSD version provided as an argument, or a default value if no
1305 argument is provided.
1322 Configuration declaration. This denotes strings accepted by
1326 .D1 \&.Cd device le0 at scode?
1329 this macro is commonly abused by using quoted literals to retain
1330 white-space and align consecutive
1332 declarations. This practise is discouraged.
1335 Command modifiers. Useful when specifying configuration options or
1339 .D1 \&.Cm ControlPath
1340 .D1 \&.Cm ControlMaster
1346 One-line indented display. This is formatted by the default rules and
1347 is useful for simple indented statements. It is followed by a newline.
1350 .D1 \&.D1 \&Fl abcdefgh
1361 block. Does not have any tail arguments.
1364 Document date. This is the mandatory first macro of any
1366 manual. Its calling syntax is as follows:
1368 .D1 \. Ns Sx \&Dd Cm date
1374 which signifies the current manual revision date dictated by
1376 or instead a valid canonical date as specified by
1378 If a date does not conform, the current date is used instead.
1381 .D1 \&.Dd $\&Mdocdate$
1382 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1383 .D1 \&.Dd July 21, 2007
1391 One-line intended display. This is formatted as literal text and is
1392 useful for commands and invocations. It is followed by a newline.
1395 .D1 \&.Dl % mandoc mdoc.7 | less
1403 Begins a block enclosed by double quotes. Does not have any head
1407 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1413 Encloses its arguments in double quotes.
1416 .Bd -literal -offset indent -compact
1417 \&.Dq April is the cruellest month
1425 Document title. This is the mandatory second macro of any
1427 file. Its calling syntax is as follows:
1429 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1431 Its arguments are as follows:
1432 .Bl -tag -width Ds -offset Ds
1434 The document's title (name). This should be capitalised and is
1437 The manual section. This may be one of
1445 .Pq Perl libraries ,
1455 .Pq system utilities ,
1457 .Pq kernel functions ,
1459 .Pq X Window System ,
1461 .Pq X Window System ,
1471 It is also required and should correspond to the manual's filename
1474 This overrides the volume inferred from
1476 This field is optional, and if specified, must be one of
1478 .Pq users' supplementary documents ,
1480 .Pq programmers' supplementary documents ,
1482 .Pq administrators' supplementary documents ,
1484 .Pq system managers' manuals ,
1486 .Pq users' reference manuals ,
1488 .Pq programmers' reference manuals ,
1490 .Pq kernel manuals ,
1501 .Pq contributed manuals .
1503 This specifies a specific relevant architecture. If
1505 is not provided, it may be used in its place, else it may be used
1506 subsequent that. It, too, is optional. It must be one of
1540 .D1 \&.Dt FOO 9 i386
1541 .D1 \&.Dt FOO 9 KM i386
1549 Defined variables such as preprocessor constants.
1553 .D1 \&.Dv STDOUT_FILENO
1559 Format the DragonFly BSD version provided as an argument, or a default
1560 value if no argument is provided.
1583 Denotes text that should be emphasised. Note that this is a
1584 presentation term and should not be used for stylistically decorating
1594 Display error constants.
1606 Environmental variables such as those specified in
1614 Inserts text regarding a utility's exit values. This macro must have
1617 argument specified, then an optional
1621 is not provided, the document's name as stipulated in
1628 Command-line flag. Used when listing arguments to command-line
1629 utilities. Prints a fixed-width hyphen
1631 directly followed by each argument. If no arguments are provided, a hyphen is
1632 printed followed by a space. If the argument is a macro, a hyphen is
1633 prefixed to the subsequent macro output.
1639 .D1 \&.Op \&Fl o \&Ns \&Ar file
1649 Format the FreeBSD version provided as an argument, or a default value
1650 if no argument is provided.
1673 Format a hyperlink. The calling syntax is as follows:
1675 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1678 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1679 .D1 \&.Lk http://bsd.lv
1692 Format the NetBSD version provided as an argument, or a default value if
1693 no argument is provided.
1713 Document operating system version. This is the mandatory third macro of
1716 file. Its calling syntax is as follows:
1718 .D1 \. Ns Sx \&Os Op Cm system
1722 parameter specifies the relevant operating system or environment. Left
1723 unspecified, it defaults to the local operating system version. This is
1728 .D1 \&.Os KTH/CSC/TCS
1740 this macro has been deprecated.
1743 Format the OpenBSD version provided as an argument, or a default value
1744 if no argument is provided.
1774 block. Does not have any tail arguments.
1777 Begins a bibliographic
1779 block. Does not have any head arguments. The block macro may only
1795 child macros (at least one must be specified).
1798 .Bd -literal -offset indent -compact
1800 \&.%A J. E. Hopcroft
1802 \&.%B Introduction to Automata Theory, Languages, and Computation
1803 \&.%I Addison-Wesley
1804 \&.%C Reading, Massachusettes
1811 block is used within a SEE ALSO section, a vertical space is asserted
1812 before the rendered output, else the block continues on the current
1828 Format the UNIX name. Accepts no argument.
1845 A variable type. This is also used for indicating global variables in the
1846 SYNOPSIS section, in which case a variable name is also specified. Note that
1848 .Sx Block partial-implicit
1849 syntax when invoked as the first macro in the SYNOPSIS section, else it
1854 Note that this should not be confused with
1856 which is used for function return types.
1859 .D1 \&.Vt unsigned char
1860 .D1 \&.Vt extern const char * const sys_signame[] ;
1868 Close a scope opened by
1872 Open an extension scope. This macro originally existed to extend the
1873 9-argument limit of troff; since this limit has been lifted, the macro
1874 has been deprecated.
1877 Link to another manual
1878 .Pq Qq cross-reference .
1879 Its calling syntax is
1881 .D1 \. Ns Sx \&Xr Cm name section
1887 are the name and section of the linked manual. If
1889 is followed by non-punctuation, an
1891 is inserted into the token stream. This behaviour is for compatibility
1897 .D1 \&.Xr mandoc 1 ;
1898 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1905 This section documents compatibility between mandoc and other other
1906 troff implementations, at this time limited to GNU troff
1910 refers to groff versions before the
1913 .Pq somewhere between 1.15 and 1.19 .
1916 Heirloom troff, the other significant troff implementation accepting
1917 \-mdoc, is similar to historic groff.
1924 is no longer accepted.
1929 macro does not format its arguments when used in the FILES section under
1930 certain list types. mandoc does.
1933 Historic groff does not print a dash for empty
1935 arguments. mandoc and newer groff implementations do.
1937 groff behaves irregularly when specifying
1940 within line-macro scopes. mandoc follows a consistent system.
1943 In mandoc, negative scaling units are truncated to zero; groff would
1944 move to prior lines. Furthermore, the
1946 scaling unit, while accepted, is rendered as the default unit.
1949 In quoted literals, groff allowed pair-wise double-quotes to produce a
1950 standalone double-quote in formatted output. This idiosyncratic
1951 behaviour is not applicable in mandoc.
1961 in manodc. Furthermore, the
1963 argument is ignored. Lastly, since text is not right-justified in
1964 mandoc (or even groff),
1974 In mandoc, blocks of whitespace are stripped from both macro and
1975 free-form text lines (except when in literal mode); groff would retain
1976 whitespace in free-form text lines.
1979 Historic groff has many un-callable macros. Most of these (excluding
1980 some block-level macros) are now callable.
1987 but has been a proper delimiter since then.
1991 is assumed for all lists (it wasn't in historic groff): any list may be
1994 lists will restart the sequence only for the sub-list.
1999 incorrectly by following it with a reserved character and expecting the
2000 delimiter to render. This is not supported in mandoc.
2005 macro only produces the first parameter. This is not the case in
2014 macros were stipulated only to occur in certain manual sections. mandoc
2015 does not have these restrictions.
2027 reference was written by
2028 .An Kristaps Dzonsons Aq kristaps@kth.se .
2030 .\" XXX: this really isn't the place for these caveats.
2034 .\" There are many ambiguous parts of mdoc.
2037 .\" .Bl -dash -compact
2042 .\" as function arguments are variables.
2047 .\" as function return types are still types. Furthermore, the
2049 .\" should be removed and
2051 .\" which ostensibly follows it, should follow the same convention as
2055 .\" should formalise that only one or two arguments are acceptable: a
2056 .\" variable name and optional, preceding type.
2059 .\" is ambiguous. It's commonly used to indicate an include file in the
2060 .\" synopsis section.
2062 .\" should be used, instead.
2068 .\" makes sense. The remaining ones should be removed.
2074 .\" macros should be deprecated.
2078 .\" macro lacks clarity. It should be absolutely clear which title will
2079 .\" render when formatting the manual page.
2083 .\" should be provided for Linux (\(`a la
2088 .\" There's no way to refer to references in
2092 .\" The \-split and \-nosplit dictates via
2094 .\" are re-set when entering and leaving the AUTHORS section.