1 .\" $Id: mdoc.7,v 1.94 2010/04/13 05:26:49 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: April 13 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. See
106 for a complete list. Examples include
113 Terms may be text-decorated using the
115 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
116 (revert to previous mode):
118 .D1 \efBbold\efR \efIitalic\efP
120 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
121 respectively) may be used instead. A text decoration is valid within
122 the current font scope only: if a macro opens a font scope alongside
123 its own scope, such as
126 in-scope invocations of
128 are only valid within the font scope of the macro. If
130 is specified outside of any font scope, such as in unenclosed, free-form
131 text, it will affect the remainder of the document.
133 Text may also be sized with the
135 escape, whose syntax is one of
137 for one-digit numerals;
141 for two-digit numerals; and
147 for arbitrary-digit numerals:
150 .D1 \es[+10]much bigger\es[-10]
151 .D1 \es+(10much bigger\es-(10
152 .D1 \es+'100'much much bigger\es-'100'
158 which encourages semantic annotation.
159 .Ss Predefined Strings
162 also defined a set of package-specific
163 .Dq predefined strings ,
165 .Sx Special Characters ,
166 demark special output characters and strings by way of input codes.
167 Predefined strings are escaped with the slash-asterisk,
177 for a complete list. Examples include
184 In non-literal free-form lines, consecutive blocks of whitespace are
185 pruned from input and added later in the output filter, if applicable:
186 .Bd -literal -offset indent
187 These spaces are pruned from input.
193 In macro lines, whitespace delimits arguments and is discarded. If
194 arguments are quoted, whitespace within the quotes is retained.
196 Blank lines are only permitted within literal contexts, as are lines
197 containing only whitespace. Tab characters are only acceptable when
200 or when in a literal context.
202 Macro arguments may be quoted with a double-quote to group
203 space-delimited terms or to retain blocks of whitespace. A quoted
204 argument begins with a double-quote preceded by whitespace. The next
205 double-quote not pair-wise adjacent to another double-quote terminates
206 the literal, regardless of surrounding whitespace.
214 Note that any quoted term, be it argument or macro, is indiscriminately
215 considered literal text. Thus, the following produces
217 .Bd -literal -offset indent
221 In free-form mode, quotes are regarded as opaque text.
223 There are several macros in
225 that require a date argument. The canonical form for dates is the
228 .D1 Cm Month Day , Year
232 value is an optionally zero-padded numeral. The
234 value is the full month name. The
236 value is the full four-digit year.
238 Reduced form dates are broken-down canonical form dates:
243 Some examples of valid dates follow:
245 .D1 "May, 2009" Pq reduced form
246 .D1 "2009" Pq reduced form
247 .D1 "May 20, 2009" Pq canonical form
249 Many macros support scaled widths for their arguments, such as
250 stipulating a two-inch list indentation with the following:
251 .Bd -literal -offset indent
255 The syntax for scaled widths is
256 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
257 where a decimal must be preceded or proceeded by at least one digit.
258 Negative numbers, while accepted, are truncated to zero. The following
259 scaling units are accepted:
261 .Bl -tag -width Ds -offset indent -compact
274 default vertical span
286 default horizontal span
291 Using anything other than
297 is necessarily non-portable across output media. See
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 1 & 8 only.
347 \&.\e\*q .Sh EXIT STATUS
348 \&.\e\*q The next is for sections 2, 3, & 9 only.
349 \&.\e\*q .Sh RETURN VALUES
350 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
351 \&.\e\*q .Sh ENVIRONMENT
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. Sections
371 should be composed as follows:
372 .Bl -ohang -offset Ds
374 The name(s) and a short description of the documented material. The
375 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. The syntax for
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. This is useful when
462 implementing standard functions that may have side effects or notable
463 algorithmic implications.
465 Command exit status for section 1, 6, and 8 manuals. This section is
468 which is used for functions. Historically, this information was
471 a practise that is now discouraged.
476 This section is the dual of
478 which is used for commands. It documents the return values of functions
479 in sections 2, 3, and 9.
484 Documents any usages of environment variables, e.g.,
490 Documents files used. It's helpful to document both the file and a
491 short description of how the file is used (created, modified, etc.).
496 Example usages. This often contains snippets of well-formed,
497 well-tested invocations. Make doubly sure that your examples work
500 Documents error conditions. This is most useful in section 4 manuals.
501 Historically, this section was used in place of
503 for manuals in sections 1, 6, and 8; however, this practise is
510 Documents error handling in sections 2, 3, and 9.
515 References other manuals with related topics. This section should exist
516 for most manuals. Cross-references should conventionally be ordered
517 first by section, then alphabetically.
522 References any standards implemented or used. If not adhering to any
525 section should be used instead.
530 The history of any manual without a
532 section should be described in this section.
534 Credits to authors, if applicable, should appear in this section.
535 Authors should generally be noted by both name and an e-mail address.
540 Explanations of common misuses and misunderstandings should be explained
543 Extant bugs should be described in this section.
544 .It Em SECURITY CONSIDERATIONS
545 Documents any security precautions that operators should consider.
548 Macros are one to three three characters in length and begin with a
551 at the beginning of the line. An arbitrary amount of whitespace may
552 sit between the control character and the macro name. Thus, the
553 following are equivalent:
554 .Bd -literal -offset indent
559 The syntax of a macro depends on its classification. In this section,
561 refers to macro arguments, which may be followed by zero or more
565 opens the scope of a macro; and if specified,
571 column indicates that the macro may be called subsequent to the initial
572 line-macro. If a macro is not callable, then its invocation after the
573 initial line macro is interpreted as opaque text, such that
580 column indicates whether the macro may be followed by further
581 (ostensibly callable) macros. If a macro is not parsable, subsequent
582 macro invocations on the line will be interpreted as opaque text.
586 column, if applicable, describes closure rules.
587 .Ss Block full-explicit
588 Multi-line scope closed by an explicit closing macro. All macros
589 contains bodies; only
592 .Bd -literal -offset indent
593 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
598 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
599 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
600 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
601 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
602 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
603 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
604 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
605 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
606 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
607 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
609 .Ss Block full-implicit
610 Multi-line scope closed by end-of-file or implicitly by another macro.
611 All macros have bodies; some
619 don't have heads; only one
624 .Bd -literal -offset indent
625 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
629 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
630 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
631 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
632 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
633 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
634 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
636 .Ss Block partial-explicit
637 Like block full-explicit, but also with single-line scope. Each
638 has at least a body and, in limited circumstances, a head
645 .Bd -literal -offset indent
646 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
648 \&.Yc \(lBtail...\(rB
650 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
651 \(lBbody...\(rB \&Yc \(lBtail...\(rB
654 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
655 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
656 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
657 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
658 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
659 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
660 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
661 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
662 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
663 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
664 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
665 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
666 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
667 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
668 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
669 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
670 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
671 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
672 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
673 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
674 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
675 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
676 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
677 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
678 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
679 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
681 .Ss Block partial-implicit
682 Like block full-implicit, but with single-line scope closed by
683 .Sx Reserved Characters
685 .Bd -literal -offset indent
686 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
689 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
690 .It Em Macro Ta Em Callable Ta Em Parsable
691 .It Sx \&Aq Ta Yes Ta Yes
692 .It Sx \&Bq Ta Yes Ta Yes
693 .It Sx \&Brq Ta Yes Ta Yes
694 .It Sx \&D1 Ta \&No Ta \&Yes
695 .It Sx \&Dl Ta \&No Ta Yes
696 .It Sx \&Dq Ta Yes Ta Yes
697 .It Sx \&Op Ta Yes Ta Yes
698 .It Sx \&Pq Ta Yes Ta Yes
699 .It Sx \&Ql Ta Yes Ta Yes
700 .It Sx \&Qq Ta Yes Ta Yes
701 .It Sx \&Sq Ta Yes Ta Yes
702 .It Sx \&Vt Ta Yes Ta Yes
708 .Sx Block partial-implicit
709 only when invoked as the first macro
710 in a SYNOPSIS section line, else it is
714 .Sx Reserved Characters ,
715 end of line, fixed argument lengths, and/or subsequent macros. In-line
716 macros have only text children. If a number (or inequality) of
719 then the macro accepts an arbitrary number of arguments.
720 .Bd -literal -offset indent
721 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
723 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
725 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
728 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
729 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
730 .It Sx \&%A Ta \&No Ta \&No Ta >0
731 .It Sx \&%B Ta \&No Ta \&No Ta >0
732 .It Sx \&%C Ta \&No Ta \&No Ta >0
733 .It Sx \&%D Ta \&No Ta \&No Ta >0
734 .It Sx \&%I Ta \&No Ta \&No Ta >0
735 .It Sx \&%J Ta \&No Ta \&No Ta >0
736 .It Sx \&%N Ta \&No Ta \&No Ta >0
737 .It Sx \&%O Ta \&No Ta \&No Ta >0
738 .It Sx \&%P Ta \&No Ta \&No Ta >0
739 .It Sx \&%Q Ta \&No Ta \&No Ta >0
740 .It Sx \&%R Ta \&No Ta \&No Ta >0
741 .It Sx \&%T Ta \&No Ta \&No Ta >0
742 .It Sx \&%U Ta \&No Ta \&No Ta >0
743 .It Sx \&%V Ta \&No Ta \&No Ta >0
744 .It Sx \&Ad Ta Yes Ta Yes Ta n
745 .It Sx \&An Ta Yes Ta Yes Ta n
746 .It Sx \&Ap Ta Yes Ta Yes Ta 0
747 .It Sx \&Ar Ta Yes Ta Yes Ta n
748 .It Sx \&At Ta Yes Ta Yes Ta 1
749 .It Sx \&Bsx Ta Yes Ta Yes Ta n
750 .It Sx \&Bt Ta \&No Ta \&No Ta 0
751 .It Sx \&Bx Ta Yes Ta Yes Ta n
752 .It Sx \&Cd Ta Yes Ta Yes Ta >0
753 .It Sx \&Cm Ta Yes Ta Yes Ta n
754 .It Sx \&Db Ta \&No Ta \&No Ta 1
755 .It Sx \&Dd Ta \&No Ta \&No Ta >0
756 .It Sx \&Dt Ta \&No Ta \&No Ta n
757 .It Sx \&Dv Ta Yes Ta Yes Ta n
758 .It Sx \&Dx Ta Yes Ta Yes Ta n
759 .It Sx \&Em Ta Yes Ta Yes Ta >0
760 .It Sx \&En Ta \&No Ta \&No Ta 0
761 .It Sx \&Er Ta Yes Ta Yes Ta >0
762 .It Sx \&Es Ta \&No Ta \&No Ta 0
763 .It Sx \&Ev Ta Yes Ta Yes Ta n
764 .It Sx \&Ex Ta \&No Ta \&No Ta n
765 .It Sx \&Fa Ta Yes Ta Yes Ta n
766 .It Sx \&Fd Ta \&No Ta \&No Ta >0
767 .It Sx \&Fl Ta Yes Ta Yes Ta n
768 .It Sx \&Fn Ta Yes Ta Yes Ta >0
769 .It Sx \&Fr Ta \&No Ta \&No Ta n
770 .It Sx \&Ft Ta Yes Ta Yes Ta n
771 .It Sx \&Fx Ta Yes Ta Yes Ta n
772 .It Sx \&Hf Ta \&No Ta \&No Ta n
773 .It Sx \&Ic Ta Yes Ta Yes Ta >0
774 .It Sx \&In Ta \&No Ta \&No Ta n
775 .It Sx \&Lb Ta \&No Ta \&No Ta 1
776 .It Sx \&Li Ta Yes Ta Yes Ta n
777 .It Sx \&Lk Ta Yes Ta Yes Ta n
778 .It Sx \&Lp Ta \&No Ta \&No Ta 0
779 .It Sx \&Ms Ta Yes Ta Yes Ta >0
780 .It Sx \&Mt Ta Yes Ta Yes Ta >0
781 .It Sx \&Nm Ta Yes Ta Yes Ta n
782 .It Sx \&No Ta Yes Ta Yes Ta 0
783 .It Sx \&Ns Ta Yes Ta Yes Ta 0
784 .It Sx \&Nx Ta Yes Ta Yes Ta n
785 .It Sx \&Os Ta \&No Ta \&No Ta n
786 .It Sx \&Ot Ta \&No Ta \&No Ta n
787 .It Sx \&Ox Ta Yes Ta Yes Ta n
788 .It Sx \&Pa Ta Yes Ta Yes Ta n
789 .It Sx \&Pf Ta Yes Ta Yes Ta 1
790 .It Sx \&Pp Ta \&No Ta \&No Ta 0
791 .It Sx \&Rv Ta \&No Ta \&No Ta n
792 .It Sx \&Sm Ta \&No Ta \&No Ta 1
793 .It Sx \&St Ta \&No Ta Yes Ta 1
794 .It Sx \&Sx Ta Yes Ta Yes Ta >0
795 .It Sx \&Sy Ta Yes Ta Yes Ta >0
796 .It Sx \&Tn Ta Yes Ta Yes Ta >0
797 .It Sx \&Ud Ta \&No Ta \&No Ta 0
798 .It Sx \&Ux Ta Yes Ta Yes Ta n
799 .It Sx \&Va Ta Yes Ta Yes Ta n
800 .It Sx \&Vt Ta Yes Ta Yes Ta >0
801 .It Sx \&Xr Ta Yes Ta Yes Ta >0
802 .It Sx \&br Ta \&No Ta \&No Ta 0
803 .It Sx \&sp Ta \&No Ta \&No Ta 1
806 This section is a canonical reference of all macros, arranged
807 alphabetically. For the scoping of individual macros, see
812 block. Multiple authors should each be accorded their own
814 line. Author names should be ordered with full or abbreviated
815 forename(s) first, then full surname.
819 block. This macro may also be used in a non-bibliographic context when
820 referring to book titles.
822 Publication city or location of an
827 this macro is not implemented in
830 Publication date of an
832 block. This should follow the reduced or canonical form syntax
836 Publisher or issuer name of an
844 Issue number (usually for journals) of an
848 Optional information of an
852 Book or journal page number of an
856 Institutional author (school, government, etc.) of an
858 block. Multiple institutional authors should each be accorded their own
862 Technical report name of an
868 block. This macro may also be used in a non-bibliographical context
869 when referring to article titles.
871 URI of reference document.
879 block. Does not have any tail arguments.
881 Address construct: usually in the context of an computational address in
882 memory, not a physical (post) address.
888 Author name. This macro may alternatively accepts the following
889 arguments, although these may not be specified along with a parameter:
890 .Bl -tag -width 12n -offset indent
892 Renders a line break before each author listing.
898 In the AUTHORS section, the default is not to split the first author
899 listing, but all subsequent author listings, whether or not they're
900 interspersed by other macros or text, are split. Thus, specifying
902 will cause the first listing also to be split. If not in the AUTHORS
903 section, the default is not to split.
907 .D1 \&.An J. D. Ullman .
914 are re-set when entering the AUTHORS section, so if one specifies
916 in the general document body, it must be re-specified in the AUTHORS
919 Begins a block enclosed by angled brackets. Does not have any head
923 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
928 Inserts an apostrophe without any surrounding white-space. This is
929 generally used as a grammatic device when referring to the verb form of
931 .Bd -literal -offset indent
935 Encloses its arguments in angled brackets.
938 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
941 this macro is often abused for rendering URIs, which should instead use
945 or to note pre-processor
947 statements, which should use
953 Command arguments. If an argument is not provided, the string
955 is used as a default.
958 .D1 \&.Fl o \&Ns \&Ar file1
960 .D1 \&.Ar arg1 , arg2 .
962 Formats an AT&T version. Accepts at most one parameter:
963 .Bl -tag -width 12n -offset indent
972 Note that these parameters do not begin with a hyphen.
990 block. Does not have any tail arguments.
992 Begins a display block. A display is collection of macros or text which
993 may be collectively offset or justified in a manner different from that
994 of the enclosing context. By default, the block is preceded by a
997 Each display is associated with a type, which must be one of the
999 .Bl -tag -width 12n -offset indent
1001 Only left-justify the block.
1003 Do not justify the block at all.
1005 Left- and right-justify the block.
1010 Centre-justify each line.
1013 The type must be provided first. Secondary arguments are as follows:
1014 .Bl -tag -width 12n -offset indent
1015 .It Fl offset Ar width
1016 Offset by the value of
1018 which is interpreted as one of the following, specified in order:
1021 As one of the pre-defined strings
1023 the width of standard indentation;
1028 which has no effect ;
1030 which justifies to the right margin; and
1032 which aligns around an imagined centre axis.
1034 As a precalculated width for a named macro. The most popular is the
1040 As a scaling unit following the syntax described in
1041 .Sx Scaling Widths .
1043 As the calculated string length of the opaque string.
1046 If unset, it will revert to the value of
1049 .Sx Scaling Widths .
1051 Do not assert a vertical space before the block.
1055 before any text or macros within the block.
1059 .Bd -literal -offset indent
1060 \&.Bd \-unfilled \-offset two-indent \-compact
1072 .\" Begins a list composed of one or more list entries. A list entry is
1073 .\" specified by the
1075 .\" macro, which consists of a head and optional body. By default, a list
1076 .\" is preceded by a blank line. A list must specify one of the following
1078 .\" .Bl -tag -width 12n
1080 .\" A list offset by a bullet. The head of list entries must be empty.
1081 .\" List entry bodies are justified after the bullet.
1083 .\" A columnated list. The number of columns is specified as arguments to
1086 .\" macro (the deprecated form of following the invocation of
1088 .\" is also accepted). Arguments dictate the width of columns specified in
1089 .\" list entries. List entry bodies must be left empty. Columns specified
1090 .\" in the list entry head are justified to their position in the sequence
1093 .\" A list offset by a dash (hyphen). The head of list entries must be
1094 .\" empty. List entry bodies are justified past the dash.
1098 .\" lists, but with additional formatting to the head.
1100 .\" A list offset by a number indicating list entry position. The head of
1101 .\" list entries must be empty. List entry bodies are justified past the
1106 .\" but instead of list bodies justifying to the head on the first line,
1107 .\" they trail the head text.
1114 .\" but list entry bodies aren't justified.
1116 .\" An un-justified list. This produces blocks of text.
1118 .\" List bodies are placed on the line following the head.
1120 .\" A list offset by list entry heads. List entry bodies are justified
1127 Begins a block enclosed by square brackets. Does not have any head
1131 .Bd -literal -offset indent
1139 Encloses its arguments in square brackets.
1142 .D1 \&.Bq 1 , \&Dv BUFSIZ
1145 this macro is sometimes abused to emulate optional arguments for
1146 commands; the correct macros to use for this purpose are
1157 block. Does not have any tail arguments.
1159 Begins a block enclosed by curly braces. Does not have any head
1163 .Bd -literal -offset indent
1171 Encloses its arguments in curly braces.
1174 .D1 \&.Brq 1 , ... , \&Va n
1179 Format the BSD/OS version provided as an argument, or a default value if
1180 no argument is provided.
1197 .Dq is currently in beta test.
1199 Format the BSD version provided as an argument, or a default value if no
1200 argument is provided.
1216 Configuration declaration. This denotes strings accepted by
1220 .D1 \&.Cd device le0 at scode?
1223 this macro is commonly abused by using quoted literals to retain
1224 white-space and align consecutive
1226 declarations. This practise is discouraged.
1228 Command modifiers. Useful when specifying configuration options or
1232 .D1 \&.Cm ControlPath
1233 .D1 \&.Cm ControlMaster
1238 One-line indented display. This is formatted by the default rules and
1239 is useful for simple indented statements. It is followed by a newline.
1242 .D1 \&.D1 \&Fl abcdefgh
1252 block. Does not have any tail arguments.
1254 Document date. This is the mandatory first macro of any
1256 manual. Its calling syntax is as follows:
1258 .D1 \. Ns Sx \&Dd Cm date
1264 which signifies the current manual revision date dictated by
1266 or instead a valid canonical date as specified by
1268 If a date does not conform, the current date is used instead.
1271 .D1 \&.Dd $\&Mdocdate$
1272 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1273 .D1 \&.Dd July 21, 2007
1280 One-line intended display. This is formatted as literal text and is
1281 useful for commands and invocations. It is followed by a newline.
1284 .D1 \&.Dl % mandoc mdoc.7 | less
1291 Begins a block enclosed by double quotes. Does not have any head
1295 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1300 Encloses its arguments in double quotes.
1303 .Bd -literal -offset indent -compact
1304 \&.Dq April is the cruellest month
1311 Document title. This is the mandatory second macro of any
1313 file. Its calling syntax is as follows:
1315 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1317 Its arguments are as follows:
1318 .Bl -tag -width Ds -offset Ds
1320 The document's title (name). This should be capitalised and is
1323 The manual section. This may be one of
1331 .Pq Perl libraries ,
1341 .Pq system utilities ,
1343 .Pq kernel functions ,
1345 .Pq X Window System ,
1347 .Pq X Window System ,
1357 It is also required and should correspond to the manual's filename
1360 This overrides the volume inferred from
1362 This field is optional, and if specified, must be one of
1364 .Pq users' supplementary documents ,
1366 .Pq programmers' supplementary documents ,
1368 .Pq administrators' supplementary documents ,
1370 .Pq system managers' manuals ,
1372 .Pq users' reference manuals ,
1374 .Pq programmers' reference manuals ,
1376 .Pq kernel manuals ,
1387 .Pq contributed manuals .
1389 This specifies a specific relevant architecture. If
1391 is not provided, it may be used in its place, else it may be used
1392 subsequent that. It, too, is optional. It must be one of
1426 .D1 \&.Dt FOO 9 i386
1427 .D1 \&.Dt FOO 9 KM i386
1434 Defined variables such as preprocessor constants.
1438 .D1 \&.Dv STDOUT_FILENO
1443 Format the DragonFly BSD version provided as an argument, or a default
1444 value if no argument is provided.
1465 Denotes text that should be emphasised. Note that this is a
1466 presentation term and should not be used for stylistically decorating
1475 Display error constants.
1485 Environmental variables such as those specified in
1492 Inserts text regarding a utility's exit values. This macro must have
1495 argument specified, then an optional
1499 is not provided, the document's name as stipulated in
1506 Command-line flag. Used when listing arguments to command-line
1507 utilities. Prints a fixed-width hyphen
1509 directly followed by each argument. If no arguments are provided, a hyphen is
1510 printed followed by a space. If the argument is a macro, a hyphen is
1511 prefixed to the subsequent macro output.
1517 .D1 \&.Op \&Fl o \&Ns \&Ar file
1526 Format the FreeBSD version provided as an argument, or a default value
1527 if no argument is provided.
1549 Format a hyperlink. The calling syntax is as follows:
1551 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1554 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1555 .D1 \&.Lk http://bsd.lv
1567 Format the NetBSD version provided as an argument, or a default value if
1568 no argument is provided.
1587 Document operating system version. This is the mandatory third macro of
1590 file. Its calling syntax is as follows:
1592 .D1 \. Ns Sx \&Os Op Cm system
1596 parameter specifies the relevant operating system or environment. Left
1597 unspecified, it defaults to the local operating system version. This is
1602 .D1 \&.Os KTH/CSC/TCS
1613 this macro has been deprecated.
1615 Format the OpenBSD version provided as an argument, or a default value
1616 if no argument is provided.
1644 block. Does not have any tail arguments.
1646 Begins a bibliographic
1648 block. Does not have any head arguments. The block macro may only
1664 child macros (at least one must be specified).
1667 .Bd -literal -offset indent -compact
1669 \&.%A J. E. Hopcroft
1671 \&.%B Introduction to Automata Theory, Languages, and Computation
1672 \&.%I Addison-Wesley
1673 \&.%C Reading, Massachusettes
1680 block is used within a SEE ALSO section, a vertical space is asserted
1681 before the rendered output, else the block continues on the current
1696 Format the UNIX name. Accepts no argument.
1712 A variable type. This is also used for indicating global variables in the
1713 SYNOPSIS section, in which case a variable name is also specified. Note that
1715 .Sx Block partial-implicit
1716 syntax when invoked as the first macro in the SYNOPSIS section, else it
1721 Note that this should not be confused with
1723 which is used for function return types.
1726 .D1 \&.Vt unsigned char
1727 .D1 \&.Vt extern const char * const sys_signame[] ;
1734 Close a scope opened by
1737 Open an extension scope. This macro originally existed to extend the
1738 9-argument limit of troff; since this limit has been lifted, the macro
1739 has been deprecated.
1741 Link to another manual
1742 .Pq Qq cross-reference .
1743 Its calling syntax is
1745 .D1 \. Ns Sx \&Xr Cm name section
1751 are the name and section of the linked manual. If
1753 is followed by non-punctuation, an
1755 is inserted into the token stream. This behaviour is for compatibility
1761 .D1 \&.Xr mandoc 1 ;
1762 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1766 This section documents compatibility between mandoc and other other
1767 troff implementations, at this time limited to GNU troff
1771 refers to groff versions before the
1774 .Pq somewhere between 1.15 and 1.19 .
1776 Heirloom troff, the other significant troff implementation accepting
1777 \-mdoc, is similar to historic groff.
1783 is no longer accepted.
1787 macro does not format its arguments when used in the FILES section under
1788 certain list types. mandoc does.
1790 Historic groff does not print a dash for empty
1792 arguments. mandoc and newer groff implementations do.
1794 groff behaves irregularly when specifying
1797 within line-macro scopes. mandoc follows a consistent system.
1799 In mandoc, negative scaling units are truncated to zero; groff would
1800 move to prior lines. Furthermore, the
1802 scaling unit, while accepted, is rendered as the default unit.
1804 In quoted literals, groff allowed pair-wise double-quotes to produce a
1805 standalone double-quote in formatted output. This idiosyncratic
1806 behaviour is not applicable in mandoc.
1815 in manodc. Furthermore, the
1817 argument is ignored. Lastly, since text is not right-justified in
1818 mandoc (or even groff),
1827 In mandoc, blocks of whitespace are stripped from both macro and
1828 free-form text lines (except when in literal mode); groff would retain
1829 whitespace in free-form text lines.
1831 Historic groff has many un-callable macros. Most of these (excluding
1832 some block-level macros) are now callable.
1838 but has been a proper delimiter since then.
1841 is assumed for all lists (it wasn't in historic groff): any list may be
1844 lists will restart the sequence only for the sub-list.
1848 incorrectly by following it with a reserved character and expecting the
1849 delimiter to render. This is not supported in mandoc.
1853 macro only produces the first parameter. This is not the case in
1861 macros were stipulated only to occur in certain manual sections. mandoc
1862 does not have these restrictions.
1870 reference was written by
1871 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1873 .\" XXX: this really isn't the place for these caveats.
1877 .\" There are many ambiguous parts of mdoc.
1880 .\" .Bl -dash -compact
1885 .\" as function arguments are variables.
1890 .\" as function return types are still types. Furthermore, the
1892 .\" should be removed and
1894 .\" which ostensibly follows it, should follow the same convention as
1898 .\" should formalise that only one or two arguments are acceptable: a
1899 .\" variable name and optional, preceding type.
1902 .\" is ambiguous. It's commonly used to indicate an include file in the
1903 .\" synopsis section.
1905 .\" should be used, instead.
1911 .\" makes sense. The remaining ones should be removed.
1917 .\" macros should be deprecated.
1921 .\" macro lacks clarity. It should be absolutely clear which title will
1922 .\" render when formatting the manual page.
1926 .\" should be provided for Linux (\(`a la
1931 .\" There's no way to refer to references in
1935 .\" The \-split and \-nosplit dictates via
1937 .\" are re-set when entering and leaving the AUTHORS section.