1 .\" $Id: mdoc.7,v 1.100 2010/05/12 16:45:18 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 12 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.
302 document consists of a document prologue followed by one or more
305 The prologue, which consists of (in order) the
310 macros, is required for every document.
312 The first section (sections are denoted by
314 must be the NAME section, consisting of at least one
319 Following that, convention dictates specifying at least the SYNOPSIS and
320 DESCRIPTION sections, although this varies between manual sections.
322 The following is a well-formed skeleton
325 .Bd -literal -offset indent
332 \&.Nd a description goes here
333 \&.\e\*q The next is for sections 2 & 3 only.
344 utility processes files ...
345 \&.\e\*q .Sh IMPLEMENTATION NOTES
346 \&.\e\*q The next is for sections 2, 3, & 9 only.
347 \&.\e\*q .Sh RETURN VALUES
348 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
349 \&.\e\*q .Sh ENVIRONMENT
351 \&.\e\*q The next is for sections 1 & 8 only.
352 \&.\e\*q .Sh EXIT STATUS
353 \&.\e\*q .Sh EXAMPLES
354 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
355 \&.\e\*q .Sh DIAGNOSTICS
356 \&.\e\*q The next is for sections 2, 3, & 9 only.
358 \&.\e\*q .Sh SEE ALSO
359 \&.\e\*q .Xr foobar 1
360 \&.\e\*q .Sh STANDARDS
365 \&.\e\*q .Sh SECURITY CONSIDERATIONS
370 document are conventionally ordered as they appear above.
371 Sections should be composed as follows:
372 .Bl -ohang -offset Ds
374 The name(s) and a short description of the documented material.
375 The syntax for this as follows:
376 .Bd -literal -offset indent
380 \&.Nd a short description
385 macro(s) must precede the
394 The name of the library containing the documented material, which is
395 assumed to be a function in a section 2 or 3 manual.
396 The syntax for this is as follows:
397 .Bd -literal -offset indent
404 Documents the utility invocation syntax, function call syntax, or device
407 For the first, utilities (sections 1, 6, and 8), this is
408 generally structured as follows:
409 .Bd -literal -offset indent
420 For the second, function calls (sections 2, 3, 9):
421 .Bd -literal -offset indent
422 \&.Vt extern const char *global;
425 \&.Fn foo "const char *src"
427 \&.Fn bar "const char *src"
430 And for the third, configurations (section 4):
431 .Bd -literal -offset indent
432 \&.Cd \*qit* at isa? port 0x2e\*q
433 \&.Cd \*qit* at isa? port 0x4e\*q
436 Manuals not in these sections generally don't need a
447 This expands upon the brief, one-line description in
449 It usually contains a break-down of the options (if documenting a
451 .Bd -literal -offset indent
452 The arguments are as follows:
453 \&.Bl \-tag \-width Ds
455 Print verbose information.
459 Manuals not documenting a command won't include the above fragment.
460 .It Em IMPLEMENTATION NOTES
461 Implementation-specific notes should be kept here.
462 This is useful when implementing standard functions that may have side
463 effects or notable algorithmic implications.
465 This section is the dual of
467 which is used for commands.
468 It documents the return values of functions in sections 2, 3, and 9.
473 Documents any usages of environment variables, e.g.,
479 Documents files used.
480 It's helpful to document both the file and a short description of how
481 the file is used (created, modified, etc.).
486 Command exit status for section 1, 6, and 8 manuals.
487 This section is the dual of
489 which is used for functions.
490 Historically, this information was described in
492 a practise that is now discouraged.
498 This often contains snippets of well-formed, well-tested invocations.
499 Make doubly sure that your examples work properly!
501 Documents error conditions.
502 This is most useful in section 4 manuals.
503 Historically, this section was used in place of
505 for manuals in sections 1, 6, and 8; however, this practise is
512 Documents error handling in sections 2, 3, and 9.
517 References other manuals with related topics.
518 This section should exist for most manuals.
519 Cross-references should conventionally be ordered first by section, then
525 References any standards implemented or used.
526 If not adhering to any standards, the
528 section should be used instead.
533 The history of any manual without a
535 section should be described in this section.
537 Credits to authors, if applicable, should appear in this section.
538 Authors should generally be noted by both name and an e-mail address.
543 Explanations of common misuses and misunderstandings should be explained
546 Extant bugs should be described in this section.
547 .It Em SECURITY CONSIDERATIONS
548 Documents any security precautions that operators should consider.
551 Macros are one to three three characters in length and begin with a
554 at the beginning of the line.
555 An arbitrary amount of whitespace may sit between the control character
557 Thus, the following are equivalent:
558 .Bd -literal -offset indent
563 The syntax of a macro depends on its classification.
566 refers to macro arguments, which may be followed by zero or more
570 opens the scope of a macro; and if specified,
576 column indicates that the macro may be called subsequent to the initial
578 If a macro is not callable, then its invocation after the initial line
579 macro is interpreted as opaque text, such that
586 column indicates whether the macro may be followed by further
587 (ostensibly callable) macros.
588 If a macro is not parsable, subsequent macro invocations on the line
589 will be interpreted as opaque text.
593 column, if applicable, describes closure rules.
594 .Ss Block full-explicit
595 Multi-line scope closed by an explicit closing macro.
596 All macros contains bodies; only
599 .Bd -literal -offset indent
600 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
605 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
606 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
607 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
608 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
609 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
610 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
611 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
612 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
613 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
614 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
616 .Ss Block full-implicit
617 Multi-line scope closed by end-of-file or implicitly by another macro.
618 All macros have bodies; some
626 don't have heads; only one
631 .Bd -literal -offset indent
632 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
636 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
637 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
638 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
639 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
640 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
641 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
643 .Ss Block partial-explicit
644 Like block full-explicit, but also with single-line scope.
645 Each has at least a body and, in limited circumstances, a head
652 .Bd -literal -offset indent
653 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
655 \&.Yc \(lBtail...\(rB
657 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
658 \(lBbody...\(rB \&Yc \(lBtail...\(rB
661 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
662 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
663 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
664 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
665 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
666 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
667 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
668 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
669 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
670 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
671 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
672 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
673 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
674 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
675 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
676 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
677 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
678 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
679 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
680 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
681 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
682 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
683 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
684 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
685 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
686 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
688 .Ss Block partial-implicit
689 Like block full-implicit, but with single-line scope closed by
690 .Sx Reserved Characters
692 .Bd -literal -offset indent
693 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
696 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
697 .It Em Macro Ta Em Callable Ta Em Parsable
698 .It Sx \&Aq Ta Yes Ta Yes
699 .It Sx \&Bq Ta Yes Ta Yes
700 .It Sx \&Brq Ta Yes Ta Yes
701 .It Sx \&D1 Ta \&No Ta \&Yes
702 .It Sx \&Dl Ta \&No Ta Yes
703 .It Sx \&Dq Ta Yes Ta Yes
704 .It Sx \&Op Ta Yes Ta Yes
705 .It Sx \&Pq Ta Yes Ta Yes
706 .It Sx \&Ql Ta Yes Ta Yes
707 .It Sx \&Qq Ta Yes Ta Yes
708 .It Sx \&Sq Ta Yes Ta Yes
709 .It Sx \&Vt Ta Yes Ta Yes
715 .Sx Block partial-implicit
716 only when invoked as the first macro
717 in a SYNOPSIS section line, else it is
721 .Sx Reserved Characters ,
722 end of line, fixed argument lengths, and/or subsequent macros.
723 In-line macros have only text children.
724 If a number (or inequality) of arguments is
726 then the macro accepts an arbitrary number of arguments.
727 .Bd -literal -offset indent
728 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
730 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
732 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
735 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
736 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
737 .It Sx \&%A Ta \&No Ta \&No Ta >0
738 .It Sx \&%B Ta \&No Ta \&No Ta >0
739 .It Sx \&%C Ta \&No Ta \&No Ta >0
740 .It Sx \&%D Ta \&No Ta \&No Ta >0
741 .It Sx \&%I Ta \&No Ta \&No Ta >0
742 .It Sx \&%J Ta \&No Ta \&No Ta >0
743 .It Sx \&%N Ta \&No Ta \&No Ta >0
744 .It Sx \&%O Ta \&No Ta \&No Ta >0
745 .It Sx \&%P Ta \&No Ta \&No Ta >0
746 .It Sx \&%Q Ta \&No Ta \&No Ta >0
747 .It Sx \&%R Ta \&No Ta \&No Ta >0
748 .It Sx \&%T Ta \&No Ta \&No Ta >0
749 .It Sx \&%U Ta \&No Ta \&No Ta >0
750 .It Sx \&%V Ta \&No Ta \&No Ta >0
751 .It Sx \&Ad Ta Yes Ta Yes Ta n
752 .It Sx \&An Ta Yes Ta Yes Ta n
753 .It Sx \&Ap Ta Yes Ta Yes Ta 0
754 .It Sx \&Ar Ta Yes Ta Yes Ta n
755 .It Sx \&At Ta Yes Ta Yes Ta 1
756 .It Sx \&Bsx Ta Yes Ta Yes Ta n
757 .It Sx \&Bt Ta \&No Ta \&No Ta 0
758 .It Sx \&Bx Ta Yes Ta Yes Ta n
759 .It Sx \&Cd Ta Yes Ta Yes Ta >0
760 .It Sx \&Cm Ta Yes Ta Yes Ta n
761 .It Sx \&Db Ta \&No Ta \&No Ta 1
762 .It Sx \&Dd Ta \&No Ta \&No Ta >0
763 .It Sx \&Dt Ta \&No Ta \&No Ta n
764 .It Sx \&Dv Ta Yes Ta Yes Ta n
765 .It Sx \&Dx Ta Yes Ta Yes Ta n
766 .It Sx \&Em Ta Yes Ta Yes Ta >0
767 .It Sx \&En Ta \&No Ta \&No Ta 0
768 .It Sx \&Er Ta Yes Ta Yes Ta >0
769 .It Sx \&Es Ta \&No Ta \&No Ta 0
770 .It Sx \&Ev Ta Yes Ta Yes Ta n
771 .It Sx \&Ex Ta \&No Ta \&No Ta n
772 .It Sx \&Fa Ta Yes Ta Yes Ta n
773 .It Sx \&Fd Ta \&No Ta \&No Ta >0
774 .It Sx \&Fl Ta Yes Ta Yes Ta n
775 .It Sx \&Fn Ta Yes Ta Yes Ta >0
776 .It Sx \&Fr Ta \&No Ta \&No Ta n
777 .It Sx \&Ft Ta Yes Ta Yes Ta n
778 .It Sx \&Fx Ta Yes Ta Yes Ta n
779 .It Sx \&Hf Ta \&No Ta \&No Ta n
780 .It Sx \&Ic Ta Yes Ta Yes Ta >0
781 .It Sx \&In Ta \&No Ta \&No Ta n
782 .It Sx \&Lb Ta \&No Ta \&No Ta 1
783 .It Sx \&Li Ta Yes Ta Yes Ta n
784 .It Sx \&Lk Ta Yes Ta Yes Ta n
785 .It Sx \&Lp Ta \&No Ta \&No Ta 0
786 .It Sx \&Ms Ta Yes Ta Yes Ta >0
787 .It Sx \&Mt Ta Yes Ta Yes Ta >0
788 .It Sx \&Nm Ta Yes Ta Yes Ta n
789 .It Sx \&No Ta Yes Ta Yes Ta 0
790 .It Sx \&Ns Ta Yes Ta Yes Ta 0
791 .It Sx \&Nx Ta Yes Ta Yes Ta n
792 .It Sx \&Os Ta \&No Ta \&No Ta n
793 .It Sx \&Ot Ta \&No Ta \&No Ta n
794 .It Sx \&Ox Ta Yes Ta Yes Ta n
795 .It Sx \&Pa Ta Yes Ta Yes Ta n
796 .It Sx \&Pf Ta Yes Ta Yes Ta 1
797 .It Sx \&Pp Ta \&No Ta \&No Ta 0
798 .It Sx \&Rv Ta \&No Ta \&No Ta n
799 .It Sx \&Sm Ta \&No Ta \&No Ta 1
800 .It Sx \&St Ta \&No Ta Yes Ta 1
801 .It Sx \&Sx Ta Yes Ta Yes Ta >0
802 .It Sx \&Sy Ta Yes Ta Yes Ta >0
803 .It Sx \&Tn Ta Yes Ta Yes Ta >0
804 .It Sx \&Ud Ta \&No Ta \&No Ta 0
805 .It Sx \&Ux Ta Yes Ta Yes Ta n
806 .It Sx \&Va Ta Yes Ta Yes Ta n
807 .It Sx \&Vt Ta Yes Ta Yes Ta >0
808 .It Sx \&Xr Ta Yes Ta Yes Ta >0
809 .It Sx \&br Ta \&No Ta \&No Ta 0
810 .It Sx \&sp Ta \&No Ta \&No Ta 1
813 This section is a canonical reference of all macros, arranged
815 For the scoping of individual macros, see
820 block. Multiple authors should each be accorded their own
822 line. Author names should be ordered with full or abbreviated
823 forename(s) first, then full surname.
827 block. This macro may also be used in a non-bibliographic context when
828 referring to book titles.
830 Publication city or location of an
835 this macro is not implemented in
838 Publication date of an
840 block. This should follow the reduced or canonical form syntax
844 Publisher or issuer name of an
852 Issue number (usually for journals) of an
856 Optional information of an
860 Book or journal page number of an
864 Institutional author (school, government, etc.) of an
866 block. Multiple institutional authors should each be accorded their own
870 Technical report name of an
876 block. This macro may also be used in a non-bibliographical context
877 when referring to article titles.
879 URI of reference document.
887 block. Does not have any tail arguments.
889 Address construct: usually in the context of an computational address in
890 memory, not a physical (post) address.
897 This macro may alternatively accepts the following arguments, although
898 these may not be specified along with a parameter:
899 .Bl -tag -width 12n -offset indent
901 Renders a line break before each author listing.
907 In the AUTHORS section, the default is not to split the first author
908 listing, but all subsequent author listings, whether or not they're
909 interspersed by other macros or text, are split.
912 will cause the first listing also to be split.
913 If not in the AUTHORS section, the default is not to split.
917 .D1 \&.An J. D. Ullman .
924 are re-set when entering the AUTHORS section, so if one specifies
926 in the general document body, it must be re-specified in the AUTHORS
929 Begins a block enclosed by angled brackets.
930 Does not have any head arguments.
933 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
938 Inserts an apostrophe without any surrounding white-space.
939 This is generally used as a grammatic device when referring to the verb
941 .Bd -literal -offset indent
945 Encloses its arguments in angled brackets.
948 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
951 this macro is often abused for rendering URIs, which should instead use
955 or to note pre-processor
957 statements, which should use
964 If an argument is not provided, the string
966 is used as a default.
969 .D1 \&.Fl o \&Ns \&Ar file1
971 .D1 \&.Ar arg1 , arg2 .
973 Formats an AT&T version.
974 Accepts at most one parameter:
975 .Bl -tag -width 12n -offset indent
984 Note that these parameters do not begin with a hyphen.
1002 block. Does not have any tail arguments.
1004 Begins a display block.
1005 A display is collection of macros or text which may be collectively
1006 offset or justified in a manner different from that
1007 of the enclosing context.
1008 By default, the block is preceded by a vertical space.
1010 Each display is associated with a type, which must be one of the
1011 following arguments:
1012 .Bl -tag -width 12n -offset indent
1014 Only left-justify the block.
1016 Do not justify the block at all.
1018 Left- and right-justify the block.
1023 Centre-justify each line.
1026 The type must be provided first.
1027 Secondary arguments are as follows:
1028 .Bl -tag -width 12n -offset indent
1029 .It Fl offset Ar width
1030 Offset by the value of
1032 which is interpreted as one of the following, specified in order:
1035 As one of the pre-defined strings
1037 the width of standard indentation;
1042 which has no effect ;
1044 which justifies to the right margin; and
1046 which aligns around an imagined centre axis.
1048 As a precalculated width for a named macro.
1049 The most popular is the imaginary macro
1054 As a scaling unit following the syntax described in
1055 .Sx Scaling Widths .
1057 As the calculated string length of the opaque string.
1060 If unset, it will revert to the value of
1063 .Sx Scaling Widths .
1065 Do not assert a vertical space before the block.
1069 before any text or macros within the block.
1073 .Bd -literal -offset indent
1074 \&.Bd \-unfilled \-offset two-indent \-compact
1086 .\" Begins a list composed of one or more list entries. A list entry is
1087 .\" specified by the
1089 .\" macro, which consists of a head and optional body. By default, a list
1090 .\" is preceded by a blank line. A list must specify one of the following
1092 .\" .Bl -tag -width 12n
1094 .\" A list offset by a bullet. The head of list entries must be empty.
1095 .\" List entry bodies are justified after the bullet.
1097 .\" A columnated list. The number of columns is specified as arguments to
1100 .\" macro (the deprecated form of following the invocation of
1102 .\" is also accepted). Arguments dictate the width of columns specified in
1103 .\" list entries. List entry bodies must be left empty. Columns specified
1104 .\" in the list entry head are justified to their position in the sequence
1107 .\" A list offset by a dash (hyphen). The head of list entries must be
1108 .\" empty. List entry bodies are justified past the dash.
1112 .\" lists, but with additional formatting to the head.
1114 .\" A list offset by a number indicating list entry position. The head of
1115 .\" list entries must be empty. List entry bodies are justified past the
1120 .\" but instead of list bodies justifying to the head on the first line,
1121 .\" they trail the head text.
1128 .\" but list entry bodies aren't justified.
1130 .\" An un-justified list. This produces blocks of text.
1132 .\" List bodies are placed on the line following the head.
1134 .\" A list offset by list entry heads. List entry bodies are justified
1141 Begins a block enclosed by square brackets.
1142 Does not have any head arguments.
1145 .Bd -literal -offset indent
1153 Encloses its arguments in square brackets.
1156 .D1 \&.Bq 1 , \&Dv BUFSIZ
1159 this macro is sometimes abused to emulate optional arguments for
1160 commands; the correct macros to use for this purpose are
1171 block. Does not have any tail arguments.
1173 Begins a block enclosed by curly braces.
1174 Does not have any head arguments.
1177 .Bd -literal -offset indent
1185 Encloses its arguments in curly braces.
1188 .D1 \&.Brq 1 , ... , \&Va n
1193 Format the BSD/OS version provided as an argument, or a default value if
1194 no argument is provided.
1211 .Dq is currently in beta test.
1213 Format the BSD version provided as an argument, or a default value if no
1214 argument is provided.
1230 Configuration declaration.
1231 This denotes strings accepted by
1235 .D1 \&.Cd device le0 at scode?
1238 this macro is commonly abused by using quoted literals to retain
1239 white-space and align consecutive
1242 This practise is discouraged.
1245 Useful when specifying configuration options or keys.
1248 .D1 \&.Cm ControlPath
1249 .D1 \&.Cm ControlMaster
1254 One-line indented display.
1255 This is formatted by the default rules and is useful for simple indented
1257 It is followed by a newline.
1260 .D1 \&.D1 \&Fl abcdefgh
1270 block. Does not have any tail arguments.
1273 This is the mandatory first macro of any
1276 Its calling syntax is as follows:
1278 .D1 \. Ns Sx \&Dd Cm date
1284 which signifies the current manual revision date dictated by
1286 or instead a valid canonical date as specified by
1288 If a date does not conform, the current date is used instead.
1291 .D1 \&.Dd $\&Mdocdate$
1292 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1293 .D1 \&.Dd July 21, 2007
1300 One-line intended display.
1301 This is formatted as literal text and is useful for commands and
1303 It is followed by a newline.
1306 .D1 \&.Dl % mandoc mdoc.7 | less
1313 Begins a block enclosed by double quotes. Does not have any head
1317 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1322 Encloses its arguments in double quotes.
1325 .Bd -literal -offset indent -compact
1326 \&.Dq April is the cruellest month
1334 This is the mandatory second macro of any
1337 Its calling syntax is as follows:
1339 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1341 Its arguments are as follows:
1342 .Bl -tag -width Ds -offset Ds
1344 The document's title (name).
1345 This should be capitalised and is required.
1356 .Pq Perl libraries ,
1366 .Pq system utilities ,
1368 .Pq kernel functions ,
1370 .Pq X Window System ,
1372 .Pq X Window System ,
1382 It is also required and should correspond to the manual's filename
1385 This overrides the volume inferred from
1387 This field is optional, and if specified, must be one of
1389 .Pq users' supplementary documents ,
1391 .Pq programmers' supplementary documents ,
1393 .Pq administrators' supplementary documents ,
1395 .Pq system managers' manuals ,
1397 .Pq users' reference manuals ,
1399 .Pq programmers' reference manuals ,
1401 .Pq kernel manuals ,
1412 .Pq contributed manuals .
1414 This specifies a specific relevant architecture.
1417 is not provided, it may be used in its place, else it may be used
1419 It, too, is optional.
1454 .D1 \&.Dt FOO 9 i386
1455 .D1 \&.Dt FOO 9 KM i386
1462 Defined variables such as preprocessor constants.
1466 .D1 \&.Dv STDOUT_FILENO
1471 Format the DragonFly BSD version provided as an argument, or a default
1472 value if no argument is provided.
1493 Denotes text that should be emphasised.
1494 Note that this is a presentation term and should not be used for
1495 stylistically decorating technical terms.
1503 Display error constants.
1513 Environmental variables such as those specified in
1520 Inserts text regarding a utility's exit values.
1521 This macro must have first the
1523 argument specified, then an optional
1527 is not provided, the document's name as stipulated in
1535 Used when listing arguments to command-line utilities.
1536 Prints a fixed-width hyphen
1538 directly followed by each argument.
1539 If no arguments are provided, a hyphen is printed followed by a space.
1540 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1547 .D1 \&.Op \&Fl o \&Ns \&Ar file
1556 Format the FreeBSD version provided as an argument, or a default value
1557 if no argument is provided.
1580 The calling syntax is as follows:
1582 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1585 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1586 .D1 \&.Lk http://bsd.lv
1598 Format the NetBSD version provided as an argument, or a default value if
1599 no argument is provided.
1618 Document operating system version.
1619 This is the mandatory third macro of
1622 file. Its calling syntax is as follows:
1624 .D1 \. Ns Sx \&Os Op Cm system
1628 parameter specifies the relevant operating system or environment.
1629 Left unspecified, it defaults to the local operating system version.
1630 This is the suggested form.
1634 .D1 \&.Os KTH/CSC/TCS
1645 this macro has been deprecated.
1647 Format the OpenBSD version provided as an argument, or a default value
1648 if no argument is provided.
1677 Does not have any tail arguments.
1679 Begins a bibliographic
1682 Does not have any head arguments.
1683 The block macro may only contain
1698 child macros (at least one must be specified).
1701 .Bd -literal -offset indent -compact
1703 \&.%A J. E. Hopcroft
1705 \&.%B Introduction to Automata Theory, Languages, and Computation
1706 \&.%I Addison-Wesley
1707 \&.%C Reading, Massachusettes
1714 block is used within a SEE ALSO section, a vertical space is asserted
1715 before the rendered output, else the block continues on the current
1730 Format the UNIX name.
1731 Accepts no argument.
1748 This is also used for indicating global variables in the SYNOPSIS
1749 section, in which case a variable name is also specified.
1750 Note that it accepts
1751 .Sx Block partial-implicit
1752 syntax when invoked as the first macro in the SYNOPSIS section, else it
1757 Note that this should not be confused with
1759 which is used for function return types.
1762 .D1 \&.Vt unsigned char
1763 .D1 \&.Vt extern const char * const sys_signame[] ;
1770 Close a scope opened by
1773 Open an extension scope.
1774 This macro originally existed to extend the 9-argument limit of troff;
1775 since this limit has been lifted, the macro has been deprecated.
1777 Link to another manual
1778 .Pq Qq cross-reference .
1779 Its calling syntax is
1781 .D1 \. Ns Sx \&Xr Cm name section
1787 are the name and section of the linked manual.
1790 is followed by non-punctuation, an
1792 is inserted into the token stream.
1793 This behaviour is for compatibility with
1798 .D1 \&.Xr mandoc 1 ;
1799 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1803 This section documents compatibility between mandoc and other other
1804 troff implementations, at this time limited to GNU troff
1808 refers to groff versions before the
1811 .Pq somewhere between 1.15 and 1.19 .
1813 Heirloom troff, the other significant troff implementation accepting
1814 \-mdoc, is similar to historic groff.
1820 is no longer accepted.
1824 macro does not format its arguments when used in the FILES section under
1828 Historic groff does not print a dash for empty
1831 mandoc and newer groff implementations do.
1833 groff behaves irregularly when specifying
1836 within line-macro scopes.
1837 mandoc follows a consistent system.
1839 In mandoc, negative scaling units are truncated to zero; groff would
1840 move to prior lines.
1843 scaling unit, while accepted, is rendered as the default unit.
1845 In quoted literals, groff allowed pair-wise double-quotes to produce a
1846 standalone double-quote in formatted output.
1847 This idiosyncratic behaviour is not applicable in mandoc.
1856 in manodc. Furthermore, the
1858 argument is ignored.
1859 Lastly, since text is not right-justified in mandoc (or even groff),
1868 Historic groff has many un-callable macros.
1869 Most of these (excluding some block-level macros) are now callable.
1875 but has been a proper delimiter since then.
1878 is assumed for all lists (it wasn't in historic groff): any list may be
1881 lists will restart the sequence only for the sub-list.
1885 incorrectly by following it with a reserved character and expecting the
1886 delimiter to render.
1887 This is not supported in mandoc.
1891 macro only produces the first parameter.
1892 This is not the case in mandoc.
1899 macros were stipulated only to occur in certain manual sections.
1900 mandoc does not have these restrictions.
1908 reference was written by
1909 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1911 .\" XXX: this really isn't the place for these caveats.
1915 .\" There are many ambiguous parts of mdoc.
1918 .\" .Bl -dash -compact
1923 .\" as function arguments are variables.
1928 .\" as function return types are still types. Furthermore, the
1930 .\" should be removed and
1932 .\" which ostensibly follows it, should follow the same convention as
1936 .\" should formalise that only one or two arguments are acceptable: a
1937 .\" variable name and optional, preceding type.
1940 .\" is ambiguous. It's commonly used to indicate an include file in the
1941 .\" synopsis section.
1943 .\" should be used, instead.
1949 .\" makes sense. The remaining ones should be removed.
1955 .\" macros should be deprecated.
1959 .\" macro lacks clarity. It should be absolutely clear which title will
1960 .\" render when formatting the manual page.
1964 .\" should be provided for Linux (\(`a la
1969 .\" There's no way to refer to references in
1973 .\" The \-split and \-nosplit dictates via
1975 .\" are re-set when entering and leaving the AUTHORS section.