1 .\" $Id: mdoc.7,v 1.102 2010/05/14 14:21:17 kristaps Exp $
3 .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: May 14 2010 $
22 .Nd mdoc language reference
26 language is used to format
29 manuals. In this reference document, we describe its syntax, structure,
30 and usage. Our reference implementation is mandoc; the
32 section describes compatibility with other troff \-mdoc implementations.
36 document follows simple rules: lines beginning with the control
39 are parsed for macros. Other lines are interpreted within the scope of
41 .Bd -literal -offset indent
42 \&.Sh Macro lines change control state.
43 Other lines are interpreted within the current state.
47 documents may contain only graphable 7-bit ASCII characters, the space
48 character, and, in certain circumstances, the tab character. All
55 whether in a macro or free-form text line, is ignored to the end of
56 line. A macro line with only a control character and comment escape,
58 is also ignored. Macro lines with only a control charater and optionally
59 whitespace are stripped from input.
60 .Ss Reserved Characters
61 Within a macro line, the following characters are reserved:
63 .Bl -tag -width Ds -offset indent -compact
88 Use of reserved characters is described in
90 For general use in macro lines, these characters must either be escaped
91 with a non-breaking space
93 or, if applicable, an appropriate escape sequence used.
94 .Ss Special Characters
95 Special characters may occur in both macro and free-form lines.
96 Sequences begin with the escape character
98 followed by either an open-parenthesis
100 for two-character sequences; an open-bracket
102 for n-character sequences (terminated at a close-bracket
104 or a single one-character sequence.
115 Terms may be text-decorated using the
117 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
118 (revert to previous mode):
120 .D1 \efBbold\efR \efIitalic\efP
122 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
123 respectively) may be used instead.
124 A text decoration is valid within
125 the current font scope only: if a macro opens a font scope alongside
126 its own scope, such as
129 in-scope invocations of
131 are only valid within the font scope of the macro.
134 is specified outside of any font scope, such as in unenclosed, free-form
135 text, it will affect the remainder of the document.
137 Text may also be sized with the
139 escape, whose syntax is one of
141 for one-digit numerals;
145 for two-digit numerals; and
151 for arbitrary-digit numerals:
154 .D1 \es[+10]much bigger\es[-10]
155 .D1 \es+(10much bigger\es-(10
156 .D1 \es+'100'much much bigger\es-'100'
162 which encourages semantic annotation.
163 .Ss Predefined Strings
166 also defined a set of package-specific
167 .Dq predefined strings ,
169 .Sx Special Characters ,
170 demark special output characters and strings by way of input codes.
171 Predefined strings are escaped with the slash-asterisk,
189 Whitespace consists of the space character.
190 In free-form lines, whitespace is preserved within a line; un-escaped
191 trailing spaces are stripped from input (unless in a literal context).
192 Blank free-form lines, which may include whitespace, are only permitted
193 within literal contexts.
195 In macro lines, whitespace delimits arguments and is discarded.
196 If arguments are quoted, whitespace within the quotes is retained.
198 Macro arguments may be quoted with a double-quote to group
199 space-delimited terms or to retain blocks of whitespace.
200 A quoted argument begins with a double-quote preceded by whitespace.
201 The next double-quote not pair-wise adjacent to another double-quote
202 terminates the literal, regardless of surrounding whitespace.
210 Note that any quoted term, be it argument or macro, is indiscriminately
211 considered literal text.
212 Thus, the following produces
214 .Bd -literal -offset indent
218 In free-form mode, quotes are regarded as opaque text.
220 There are several macros in
222 that require a date argument.
223 The canonical form for dates is the American format:
225 .D1 Cm Month Day , Year
229 value is an optionally zero-padded numeral.
232 value is the full month name.
235 value is the full four-digit year.
237 Reduced form dates are broken-down canonical form dates:
242 Some examples of valid dates follow:
244 .D1 "May, 2009" Pq reduced form
245 .D1 "2009" Pq reduced form
246 .D1 "May 20, 2009" Pq canonical form
248 Many macros support scaled widths for their arguments, such as
249 stipulating a two-inch list indentation with the following:
250 .Bd -literal -offset indent
254 The syntax for scaled widths is
255 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
256 where a decimal must be preceded or proceeded by at least one digit.
257 Negative numbers, while accepted, are truncated to zero.
258 The following scaling units are accepted:
260 .Bl -tag -width Ds -offset indent -compact
273 default vertical span
285 default horizontal span
290 Using anything other than
296 is necessarily non-portable across output media.
300 When composing a manual, make sure that your sentences end at the end of
302 By doing so, front-ends will be able to apply the proper amount of
303 spacing after the end of sentence (unescaped) period, exclamation mark,
306 The proper spacing is also intelligently preserved if a sentence ends at
307 the boundary of a macro line.
311 document consists of a document prologue followed by one or more
314 The prologue, which consists of (in order) the
319 macros, is required for every document.
321 The first section (sections are denoted by
323 must be the NAME section, consisting of at least one
328 Following that, convention dictates specifying at least the SYNOPSIS and
329 DESCRIPTION sections, although this varies between manual sections.
331 The following is a well-formed skeleton
334 .Bd -literal -offset indent
341 \&.Nd a description goes here
342 \&.\e\*q The next is for sections 2 & 3 only.
353 utility processes files ...
354 \&.\e\*q .Sh IMPLEMENTATION NOTES
355 \&.\e\*q The next is for sections 2, 3, & 9 only.
356 \&.\e\*q .Sh RETURN VALUES
357 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
358 \&.\e\*q .Sh ENVIRONMENT
360 \&.\e\*q The next is for sections 1 & 8 only.
361 \&.\e\*q .Sh EXIT STATUS
362 \&.\e\*q .Sh EXAMPLES
363 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
364 \&.\e\*q .Sh DIAGNOSTICS
365 \&.\e\*q The next is for sections 2, 3, & 9 only.
367 \&.\e\*q .Sh SEE ALSO
368 \&.\e\*q .Xr foobar 1
369 \&.\e\*q .Sh STANDARDS
374 \&.\e\*q .Sh SECURITY CONSIDERATIONS
379 document are conventionally ordered as they appear above.
380 Sections should be composed as follows:
381 .Bl -ohang -offset Ds
383 The name(s) and a short description of the documented material.
384 The syntax for this as follows:
385 .Bd -literal -offset indent
389 \&.Nd a short description
394 macro(s) must precede the
403 The name of the library containing the documented material, which is
404 assumed to be a function in a section 2 or 3 manual.
405 The syntax for this is as follows:
406 .Bd -literal -offset indent
413 Documents the utility invocation syntax, function call syntax, or device
416 For the first, utilities (sections 1, 6, and 8), this is
417 generally structured as follows:
418 .Bd -literal -offset indent
429 For the second, function calls (sections 2, 3, 9):
430 .Bd -literal -offset indent
431 \&.Vt extern const char *global;
434 \&.Fn foo "const char *src"
436 \&.Fn bar "const char *src"
439 And for the third, configurations (section 4):
440 .Bd -literal -offset indent
441 \&.Cd \*qit* at isa? port 0x2e\*q
442 \&.Cd \*qit* at isa? port 0x4e\*q
445 Manuals not in these sections generally don't need a
456 This expands upon the brief, one-line description in
458 It usually contains a break-down of the options (if documenting a
460 .Bd -literal -offset indent
461 The arguments are as follows:
462 \&.Bl \-tag \-width Ds
464 Print verbose information.
468 Manuals not documenting a command won't include the above fragment.
469 .It Em IMPLEMENTATION NOTES
470 Implementation-specific notes should be kept here.
471 This is useful when implementing standard functions that may have side
472 effects or notable algorithmic implications.
474 This section is the dual of
476 which is used for commands.
477 It documents the return values of functions in sections 2, 3, and 9.
482 Documents any usages of environment variables, e.g.,
488 Documents files used.
489 It's helpful to document both the file and a short description of how
490 the file is used (created, modified, etc.).
495 Command exit status for section 1, 6, and 8 manuals.
496 This section is the dual of
498 which is used for functions.
499 Historically, this information was described in
501 a practise that is now discouraged.
507 This often contains snippets of well-formed, well-tested invocations.
508 Make doubly sure that your examples work properly!
510 Documents error conditions.
511 This is most useful in section 4 manuals.
512 Historically, this section was used in place of
514 for manuals in sections 1, 6, and 8; however, this practise is
521 Documents error handling in sections 2, 3, and 9.
526 References other manuals with related topics.
527 This section should exist for most manuals.
528 Cross-references should conventionally be ordered first by section, then
534 References any standards implemented or used.
535 If not adhering to any standards, the
537 section should be used instead.
542 The history of any manual without a
544 section should be described in this section.
546 Credits to authors, if applicable, should appear in this section.
547 Authors should generally be noted by both name and an e-mail address.
552 Explanations of common misuses and misunderstandings should be explained
555 Extant bugs should be described in this section.
556 .It Em SECURITY CONSIDERATIONS
557 Documents any security precautions that operators should consider.
560 Macros are one to three three characters in length and begin with a
563 at the beginning of the line.
564 An arbitrary amount of whitespace may sit between the control character
566 Thus, the following are equivalent:
567 .Bd -literal -offset indent
572 The syntax of a macro depends on its classification.
575 refers to macro arguments, which may be followed by zero or more
579 opens the scope of a macro; and if specified,
585 column indicates that the macro may be called subsequent to the initial
587 If a macro is not callable, then its invocation after the initial line
588 macro is interpreted as opaque text, such that
595 column indicates whether the macro may be followed by further
596 (ostensibly callable) macros.
597 If a macro is not parsable, subsequent macro invocations on the line
598 will be interpreted as opaque text.
602 column, if applicable, describes closure rules.
603 .Ss Block full-explicit
604 Multi-line scope closed by an explicit closing macro.
605 All macros contains bodies; only
608 .Bd -literal -offset indent
609 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
614 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
615 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
616 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
617 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
618 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
619 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
620 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
621 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
622 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
623 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
625 .Ss Block full-implicit
626 Multi-line scope closed by end-of-file or implicitly by another macro.
627 All macros have bodies; some
635 don't have heads; only one
640 .Bd -literal -offset indent
641 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
645 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
646 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
647 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
648 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
649 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
650 .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.
654 Each 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
670 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
671 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
672 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
673 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
674 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
675 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
676 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
677 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
678 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
679 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
680 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
681 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
682 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
683 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
684 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
685 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
686 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
687 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
688 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
689 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
690 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
691 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
692 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
693 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
694 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
695 .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
705 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
706 .It Em Macro Ta Em Callable Ta Em Parsable
707 .It Sx \&Aq Ta Yes Ta Yes
708 .It Sx \&Bq Ta Yes Ta Yes
709 .It Sx \&Brq Ta Yes Ta Yes
710 .It Sx \&D1 Ta \&No Ta \&Yes
711 .It Sx \&Dl Ta \&No Ta Yes
712 .It Sx \&Dq Ta Yes Ta Yes
713 .It Sx \&Op Ta Yes Ta Yes
714 .It Sx \&Pq Ta Yes Ta Yes
715 .It Sx \&Ql Ta Yes Ta Yes
716 .It Sx \&Qq Ta Yes Ta Yes
717 .It Sx \&Sq Ta Yes Ta Yes
718 .It Sx \&Vt Ta Yes Ta Yes
724 .Sx Block partial-implicit
725 only when invoked as the first macro
726 in a SYNOPSIS section line, else it is
730 .Sx Reserved Characters ,
731 end of line, fixed argument lengths, and/or subsequent macros.
732 In-line macros have only text children.
733 If a number (or inequality) of arguments is
735 then the macro accepts an arbitrary number of arguments.
736 .Bd -literal -offset indent
737 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
739 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
741 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
744 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
745 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
746 .It Sx \&%A Ta \&No Ta \&No Ta >0
747 .It Sx \&%B Ta \&No Ta \&No Ta >0
748 .It Sx \&%C Ta \&No Ta \&No Ta >0
749 .It Sx \&%D Ta \&No Ta \&No Ta >0
750 .It Sx \&%I Ta \&No Ta \&No Ta >0
751 .It Sx \&%J Ta \&No Ta \&No Ta >0
752 .It Sx \&%N Ta \&No Ta \&No Ta >0
753 .It Sx \&%O Ta \&No Ta \&No Ta >0
754 .It Sx \&%P Ta \&No Ta \&No Ta >0
755 .It Sx \&%Q Ta \&No Ta \&No Ta >0
756 .It Sx \&%R Ta \&No Ta \&No Ta >0
757 .It Sx \&%T Ta \&No Ta \&No Ta >0
758 .It Sx \&%U Ta \&No Ta \&No Ta >0
759 .It Sx \&%V Ta \&No Ta \&No Ta >0
760 .It Sx \&Ad Ta Yes Ta Yes Ta n
761 .It Sx \&An Ta Yes Ta Yes Ta n
762 .It Sx \&Ap Ta Yes Ta Yes Ta 0
763 .It Sx \&Ar Ta Yes Ta Yes Ta n
764 .It Sx \&At Ta Yes Ta Yes Ta 1
765 .It Sx \&Bsx Ta Yes Ta Yes Ta n
766 .It Sx \&Bt Ta \&No Ta \&No Ta 0
767 .It Sx \&Bx Ta Yes Ta Yes Ta n
768 .It Sx \&Cd Ta Yes Ta Yes Ta >0
769 .It Sx \&Cm Ta Yes Ta Yes Ta n
770 .It Sx \&Db Ta \&No Ta \&No Ta 1
771 .It Sx \&Dd Ta \&No Ta \&No Ta >0
772 .It Sx \&Dt Ta \&No Ta \&No Ta n
773 .It Sx \&Dv Ta Yes Ta Yes Ta n
774 .It Sx \&Dx Ta Yes Ta Yes Ta n
775 .It Sx \&Em Ta Yes Ta Yes Ta >0
776 .It Sx \&En Ta \&No Ta \&No Ta 0
777 .It Sx \&Er Ta Yes Ta Yes Ta >0
778 .It Sx \&Es Ta \&No Ta \&No Ta 0
779 .It Sx \&Ev Ta Yes Ta Yes Ta n
780 .It Sx \&Ex Ta \&No Ta \&No Ta n
781 .It Sx \&Fa Ta Yes Ta Yes Ta n
782 .It Sx \&Fd Ta \&No Ta \&No Ta >0
783 .It Sx \&Fl Ta Yes Ta Yes Ta n
784 .It Sx \&Fn Ta Yes Ta Yes Ta >0
785 .It Sx \&Fr Ta \&No Ta \&No Ta n
786 .It Sx \&Ft Ta Yes Ta Yes Ta n
787 .It Sx \&Fx Ta Yes Ta Yes Ta n
788 .It Sx \&Hf Ta \&No Ta \&No Ta n
789 .It Sx \&Ic Ta Yes Ta Yes Ta >0
790 .It Sx \&In Ta \&No Ta \&No Ta n
791 .It Sx \&Lb Ta \&No Ta \&No Ta 1
792 .It Sx \&Li Ta Yes Ta Yes Ta n
793 .It Sx \&Lk Ta Yes Ta Yes Ta n
794 .It Sx \&Lp Ta \&No Ta \&No Ta 0
795 .It Sx \&Ms Ta Yes Ta Yes Ta >0
796 .It Sx \&Mt Ta Yes Ta Yes Ta >0
797 .It Sx \&Nm Ta Yes Ta Yes Ta n
798 .It Sx \&No Ta Yes Ta Yes Ta 0
799 .It Sx \&Ns Ta Yes Ta Yes Ta 0
800 .It Sx \&Nx Ta Yes Ta Yes Ta n
801 .It Sx \&Os Ta \&No Ta \&No Ta n
802 .It Sx \&Ot Ta \&No Ta \&No Ta n
803 .It Sx \&Ox Ta Yes Ta Yes Ta n
804 .It Sx \&Pa Ta Yes Ta Yes Ta n
805 .It Sx \&Pf Ta Yes Ta Yes Ta 1
806 .It Sx \&Pp Ta \&No Ta \&No Ta 0
807 .It Sx \&Rv Ta \&No Ta \&No Ta n
808 .It Sx \&Sm Ta \&No Ta \&No Ta 1
809 .It Sx \&St Ta \&No Ta Yes Ta 1
810 .It Sx \&Sx Ta Yes Ta Yes Ta >0
811 .It Sx \&Sy Ta Yes Ta Yes Ta >0
812 .It Sx \&Tn Ta Yes Ta Yes Ta >0
813 .It Sx \&Ud Ta \&No Ta \&No Ta 0
814 .It Sx \&Ux Ta Yes Ta Yes Ta n
815 .It Sx \&Va Ta Yes Ta Yes Ta n
816 .It Sx \&Vt Ta Yes Ta Yes Ta >0
817 .It Sx \&Xr Ta Yes Ta Yes Ta >0
818 .It Sx \&br Ta \&No Ta \&No Ta 0
819 .It Sx \&sp Ta \&No Ta \&No Ta 1
822 This section is a canonical reference of all macros, arranged
824 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.
836 block. This macro may also be used in a non-bibliographic context when
837 referring to book titles.
839 Publication city or location of an
844 this macro is not implemented in
847 Publication date of an
849 block. This should follow the reduced or canonical form syntax
853 Publisher or issuer name of an
861 Issue number (usually for journals) of an
865 Optional information of an
869 Book or journal page number of an
873 Institutional author (school, government, etc.) of an
875 block. Multiple institutional authors should each be accorded their own
879 Technical report name of an
885 block. This macro may also be used in a non-bibliographical context
886 when referring to article titles.
888 URI of reference document.
896 block. Does not have any tail arguments.
898 Address construct: usually in the context of an computational address in
899 memory, not a physical (post) address.
906 This macro may alternatively accepts the following arguments, although
907 these may not be specified along with a parameter:
908 .Bl -tag -width 12n -offset indent
910 Renders a line break before each author listing.
916 In the AUTHORS section, the default is not to split the first author
917 listing, but all subsequent author listings, whether or not they're
918 interspersed by other macros or text, are split.
921 will cause the first listing also to be split.
922 If not in the AUTHORS section, the default is not to split.
926 .D1 \&.An J. D. Ullman .
933 are re-set when entering the AUTHORS section, so if one specifies
935 in the general document body, it must be re-specified in the AUTHORS
938 Begins a block enclosed by angled brackets.
939 Does not have any head arguments.
942 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
947 Inserts an apostrophe without any surrounding white-space.
948 This is generally used as a grammatic device when referring to the verb
950 .Bd -literal -offset indent
954 Encloses its arguments in angled brackets.
957 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
960 this macro is often abused for rendering URIs, which should instead use
964 or to note pre-processor
966 statements, which should use
973 If an argument is not provided, the string
975 is used as a default.
978 .D1 \&.Fl o \&Ns \&Ar file1
980 .D1 \&.Ar arg1 , arg2 .
982 Formats an AT&T version.
983 Accepts at most one parameter:
984 .Bl -tag -width 12n -offset indent
993 Note that these parameters do not begin with a hyphen.
1011 block. Does not have any tail arguments.
1013 Begins a display block.
1014 A display is collection of macros or text which may be collectively
1015 offset or justified in a manner different from that
1016 of the enclosing context.
1017 By default, the block is preceded by a vertical space.
1019 Each display is associated with a type, which must be one of the
1020 following arguments:
1021 .Bl -tag -width 12n -offset indent
1023 Only left-justify the block.
1025 Do not justify the block at all.
1027 Left- and right-justify the block.
1032 Centre-justify each line.
1035 The type must be provided first.
1036 Secondary arguments are as follows:
1037 .Bl -tag -width 12n -offset indent
1038 .It Fl offset Ar width
1039 Offset by the value of
1041 which is interpreted as one of the following, specified in order:
1044 As one of the pre-defined strings
1046 the width of standard indentation;
1051 which has no effect ;
1053 which justifies to the right margin; and
1055 which aligns around an imagined centre axis.
1057 As a precalculated width for a named macro.
1058 The most popular is the imaginary macro
1063 As a scaling unit following the syntax described in
1064 .Sx Scaling Widths .
1066 As the calculated string length of the opaque string.
1069 If unset, it will revert to the value of
1072 .Sx Scaling Widths .
1074 Do not assert a vertical space before the block.
1078 before any text or macros within the block.
1082 .Bd -literal -offset indent
1083 \&.Bd \-unfilled \-offset two-indent \-compact
1095 .\" Begins a list composed of one or more list entries. A list entry is
1096 .\" specified by the
1098 .\" macro, which consists of a head and optional body. By default, a list
1099 .\" is preceded by a blank line. A list must specify one of the following
1101 .\" .Bl -tag -width 12n
1103 .\" A list offset by a bullet. The head of list entries must be empty.
1104 .\" List entry bodies are justified after the bullet.
1106 .\" A columnated list. The number of columns is specified as arguments to
1109 .\" macro (the deprecated form of following the invocation of
1111 .\" is also accepted). Arguments dictate the width of columns specified in
1112 .\" list entries. List entry bodies must be left empty. Columns specified
1113 .\" in the list entry head are justified to their position in the sequence
1116 .\" A list offset by a dash (hyphen). The head of list entries must be
1117 .\" empty. List entry bodies are justified past the dash.
1121 .\" lists, but with additional formatting to the head.
1123 .\" A list offset by a number indicating list entry position. The head of
1124 .\" list entries must be empty. List entry bodies are justified past the
1129 .\" but instead of list bodies justifying to the head on the first line,
1130 .\" they trail the head text.
1137 .\" but list entry bodies aren't justified.
1139 .\" An un-justified list. This produces blocks of text.
1141 .\" List bodies are placed on the line following the head.
1143 .\" A list offset by list entry heads. List entry bodies are justified
1150 Begins a block enclosed by square brackets.
1151 Does not have any head arguments.
1154 .Bd -literal -offset indent
1162 Encloses its arguments in square brackets.
1165 .D1 \&.Bq 1 , \&Dv BUFSIZ
1168 this macro is sometimes abused to emulate optional arguments for
1169 commands; the correct macros to use for this purpose are
1180 block. Does not have any tail arguments.
1182 Begins a block enclosed by curly braces.
1183 Does not have any head arguments.
1186 .Bd -literal -offset indent
1194 Encloses its arguments in curly braces.
1197 .D1 \&.Brq 1 , ... , \&Va n
1202 Format the BSD/OS version provided as an argument, or a default value if
1203 no argument is provided.
1220 .Dq is currently in beta test.
1222 Format the BSD version provided as an argument, or a default value if no
1223 argument is provided.
1239 Configuration declaration.
1240 This denotes strings accepted by
1244 .D1 \&.Cd device le0 at scode?
1247 this macro is commonly abused by using quoted literals to retain
1248 white-space and align consecutive
1251 This practise is discouraged.
1254 Useful when specifying configuration options or keys.
1257 .D1 \&.Cm ControlPath
1258 .D1 \&.Cm ControlMaster
1263 One-line indented display.
1264 This is formatted by the default rules and is useful for simple indented
1266 It is followed by a newline.
1269 .D1 \&.D1 \&Fl abcdefgh
1279 block. Does not have any tail arguments.
1282 This is the mandatory first macro of any
1285 Its calling syntax is as follows:
1287 .D1 \. Ns Sx \&Dd Cm date
1293 which signifies the current manual revision date dictated by
1295 or instead a valid canonical date as specified by
1297 If a date does not conform, the current date is used instead.
1300 .D1 \&.Dd $\&Mdocdate$
1301 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1302 .D1 \&.Dd July 21, 2007
1309 One-line intended display.
1310 This is formatted as literal text and is useful for commands and
1312 It is followed by a newline.
1315 .D1 \&.Dl % mandoc mdoc.7 | less
1322 Begins a block enclosed by double quotes. Does not have any head
1326 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1331 Encloses its arguments in double quotes.
1334 .Bd -literal -offset indent -compact
1335 \&.Dq April is the cruellest month
1343 This is the mandatory second macro of any
1346 Its calling syntax is as follows:
1348 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1350 Its arguments are as follows:
1351 .Bl -tag -width Ds -offset Ds
1353 The document's title (name).
1354 This should be capitalised and is required.
1365 .Pq Perl libraries ,
1375 .Pq system utilities ,
1377 .Pq kernel functions ,
1379 .Pq X Window System ,
1381 .Pq X Window System ,
1391 It is also required and should correspond to the manual's filename
1394 This overrides the volume inferred from
1396 This field is optional, and if specified, must be one of
1398 .Pq users' supplementary documents ,
1400 .Pq programmers' supplementary documents ,
1402 .Pq administrators' supplementary documents ,
1404 .Pq system managers' manuals ,
1406 .Pq users' reference manuals ,
1408 .Pq programmers' reference manuals ,
1410 .Pq kernel manuals ,
1421 .Pq contributed manuals .
1423 This specifies a specific relevant architecture.
1426 is not provided, it may be used in its place, else it may be used
1428 It, too, is optional.
1463 .D1 \&.Dt FOO 9 i386
1464 .D1 \&.Dt FOO 9 KM i386
1471 Defined variables such as preprocessor constants.
1475 .D1 \&.Dv STDOUT_FILENO
1480 Format the DragonFly BSD version provided as an argument, or a default
1481 value if no argument is provided.
1502 Denotes text that should be emphasised.
1503 Note that this is a presentation term and should not be used for
1504 stylistically decorating technical terms.
1512 Display error constants.
1522 Environmental variables such as those specified in
1529 Inserts text regarding a utility's exit values.
1530 This macro must have first the
1532 argument specified, then an optional
1536 is not provided, the document's name as stipulated in
1544 Used when listing arguments to command-line utilities.
1545 Prints a fixed-width hyphen
1547 directly followed by each argument.
1548 If no arguments are provided, a hyphen is printed followed by a space.
1549 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1556 .D1 \&.Op \&Fl o \&Ns \&Ar file
1565 Format the FreeBSD version provided as an argument, or a default value
1566 if no argument is provided.
1589 The calling syntax is as follows:
1591 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1594 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1595 .D1 \&.Lk http://bsd.lv
1607 Format the NetBSD version provided as an argument, or a default value if
1608 no argument is provided.
1627 Document operating system version.
1628 This is the mandatory third macro of
1631 file. Its calling syntax is as follows:
1633 .D1 \. Ns Sx \&Os Op Cm system
1637 parameter specifies the relevant operating system or environment.
1638 Left unspecified, it defaults to the local operating system version.
1639 This is the suggested form.
1643 .D1 \&.Os KTH/CSC/TCS
1654 this macro has been deprecated.
1656 Format the OpenBSD version provided as an argument, or a default value
1657 if no argument is provided.
1686 Does not have any tail arguments.
1688 Begins a bibliographic
1691 Does not have any head arguments.
1692 The block macro may only contain
1707 child macros (at least one must be specified).
1710 .Bd -literal -offset indent -compact
1712 \&.%A J. E. Hopcroft
1714 \&.%B Introduction to Automata Theory, Languages, and Computation
1715 \&.%I Addison-Wesley
1716 \&.%C Reading, Massachusettes
1723 block is used within a SEE ALSO section, a vertical space is asserted
1724 before the rendered output, else the block continues on the current
1739 Format the UNIX name.
1740 Accepts no argument.
1757 This is also used for indicating global variables in the SYNOPSIS
1758 section, in which case a variable name is also specified.
1759 Note that it accepts
1760 .Sx Block partial-implicit
1761 syntax when invoked as the first macro in the SYNOPSIS section, else it
1766 Note that this should not be confused with
1768 which is used for function return types.
1771 .D1 \&.Vt unsigned char
1772 .D1 \&.Vt extern const char * const sys_signame[] ;
1779 Close a scope opened by
1782 Open an extension scope.
1783 This macro originally existed to extend the 9-argument limit of troff;
1784 since this limit has been lifted, the macro has been deprecated.
1786 Link to another manual
1787 .Pq Qq cross-reference .
1788 Its calling syntax is
1790 .D1 \. Ns Sx \&Xr Cm name section
1796 are the name and section of the linked manual.
1799 is followed by non-punctuation, an
1801 is inserted into the token stream.
1802 This behaviour is for compatibility with
1807 .D1 \&.Xr mandoc 1 ;
1808 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1812 This section documents compatibility between mandoc and other other
1813 troff implementations, at this time limited to GNU troff
1817 refers to groff versions before the
1820 .Pq somewhere between 1.15 and 1.19 .
1822 Heirloom troff, the other significant troff implementation accepting
1823 \-mdoc, is similar to historic groff.
1829 is no longer accepted.
1833 macro does not format its arguments when used in the FILES section under
1837 Historic groff does not print a dash for empty
1840 mandoc and newer groff implementations do.
1842 groff behaves irregularly when specifying
1845 within line-macro scopes.
1846 mandoc follows a consistent system.
1848 In mandoc, negative scaling units are truncated to zero; groff would
1849 move to prior lines.
1852 scaling unit, while accepted, is rendered as the default unit.
1854 In quoted literals, groff allowed pair-wise double-quotes to produce a
1855 standalone double-quote in formatted output.
1856 This idiosyncratic behaviour is not applicable in mandoc.
1865 in manodc. Furthermore, the
1867 argument is ignored.
1868 Lastly, since text is not right-justified in mandoc (or even groff),
1877 Historic groff has many un-callable macros.
1878 Most of these (excluding some block-level macros) are now callable.
1884 but has been a proper delimiter since then.
1887 is assumed for all lists (it wasn't in historic groff): any list may be
1890 lists will restart the sequence only for the sub-list.
1894 incorrectly by following it with a reserved character and expecting the
1895 delimiter to render.
1896 This is not supported in mandoc.
1900 macro only produces the first parameter.
1901 This is not the case in mandoc.
1908 macros were stipulated only to occur in certain manual sections.
1909 mandoc does not have these restrictions.
1917 reference was written by
1918 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1920 .\" XXX: this really isn't the place for these caveats.
1924 .\" There are many ambiguous parts of mdoc.
1927 .\" .Bl -dash -compact
1932 .\" as function arguments are variables.
1937 .\" as function return types are still types. Furthermore, the
1939 .\" should be removed and
1941 .\" which ostensibly follows it, should follow the same convention as
1945 .\" should formalise that only one or two arguments are acceptable: a
1946 .\" variable name and optional, preceding type.
1949 .\" is ambiguous. It's commonly used to indicate an include file in the
1950 .\" synopsis section.
1952 .\" should be used, instead.
1958 .\" makes sense. The remaining ones should be removed.
1964 .\" macros should be deprecated.
1968 .\" macro lacks clarity. It should be absolutely clear which title will
1969 .\" render when formatting the manual page.
1973 .\" should be provided for Linux (\(`a la
1978 .\" There's no way to refer to references in
1982 .\" The \-split and \-nosplit dictates via
1984 .\" are re-set when entering and leaving the AUTHORS section.