1 .\" $Id: mdoc.7,v 1.98 2010/05/08 22:26:39 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 8 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 Whitespace consists of the space character.
185 In free-form lines, whitespace is preserved within a line; un-escaped
186 trailing spaces are stripped from input (unless in a literal context).
187 Blank free-form lines, which may include whitespace, are only permitted
188 within literal contexts.
190 In macro lines, whitespace delimits arguments and is discarded. If
191 arguments are quoted, whitespace within the quotes is retained.
193 Macro arguments may be quoted with a double-quote to group
194 space-delimited terms or to retain blocks of whitespace. A quoted
195 argument begins with a double-quote preceded by whitespace. The next
196 double-quote not pair-wise adjacent to another double-quote terminates
197 the literal, regardless of surrounding whitespace.
205 Note that any quoted term, be it argument or macro, is indiscriminately
206 considered literal text. Thus, the following produces
208 .Bd -literal -offset indent
212 In free-form mode, quotes are regarded as opaque text.
214 There are several macros in
216 that require a date argument. The canonical form for dates is the
219 .D1 Cm Month Day , Year
223 value is an optionally zero-padded numeral. The
225 value is the full month name. The
227 value is the full four-digit year.
229 Reduced form dates are broken-down canonical form dates:
234 Some examples of valid dates follow:
236 .D1 "May, 2009" Pq reduced form
237 .D1 "2009" Pq reduced form
238 .D1 "May 20, 2009" Pq canonical form
240 Many macros support scaled widths for their arguments, such as
241 stipulating a two-inch list indentation with the following:
242 .Bd -literal -offset indent
246 The syntax for scaled widths is
247 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
248 where a decimal must be preceded or proceeded by at least one digit.
249 Negative numbers, while accepted, are truncated to zero. The following
250 scaling units are accepted:
252 .Bl -tag -width Ds -offset indent -compact
265 default vertical span
277 default horizontal span
282 Using anything other than
288 is necessarily non-portable across output media. See
293 document consists of a document prologue followed by one or more
296 The prologue, which consists of (in order) the
301 macros, is required for every document.
303 The first section (sections are denoted by
305 must be the NAME section, consisting of at least one
310 Following that, convention dictates specifying at least the SYNOPSIS and
311 DESCRIPTION sections, although this varies between manual sections.
313 The following is a well-formed skeleton
316 .Bd -literal -offset indent
323 \&.Nd a description goes here
324 \&.\e\*q The next is for sections 2 & 3 only.
335 utility processes files ...
336 \&.\e\*q .Sh IMPLEMENTATION NOTES
337 \&.\e\*q The next is for sections 1 & 8 only.
338 \&.\e\*q .Sh EXIT STATUS
339 \&.\e\*q The next is for sections 2, 3, & 9 only.
340 \&.\e\*q .Sh RETURN VALUES
341 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
342 \&.\e\*q .Sh ENVIRONMENT
344 \&.\e\*q .Sh EXAMPLES
345 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
346 \&.\e\*q .Sh DIAGNOSTICS
347 \&.\e\*q The next is for sections 2, 3, & 9 only.
349 \&.\e\*q .Sh SEE ALSO
350 \&.\e\*q .Xr foobar 1
351 \&.\e\*q .Sh STANDARDS
356 \&.\e\*q .Sh SECURITY CONSIDERATIONS
361 document are conventionally ordered as they appear above. Sections
362 should be composed as follows:
363 .Bl -ohang -offset Ds
365 The name(s) and a short description of the documented material. The
366 syntax for this as follows:
367 .Bd -literal -offset indent
371 \&.Nd a short description
376 macro(s) must precede the
385 The name of the library containing the documented material, which is
386 assumed to be a function in a section 2 or 3 manual. The syntax for
388 .Bd -literal -offset indent
395 Documents the utility invocation syntax, function call syntax, or device
398 For the first, utilities (sections 1, 6, and 8), this is
399 generally structured as follows:
400 .Bd -literal -offset indent
411 For the second, function calls (sections 2, 3, 9):
412 .Bd -literal -offset indent
413 \&.Vt extern const char *global;
416 \&.Fn foo "const char *src"
418 \&.Fn bar "const char *src"
421 And for the third, configurations (section 4):
422 .Bd -literal -offset indent
423 \&.Cd \*qit* at isa? port 0x2e\*q
424 \&.Cd \*qit* at isa? port 0x4e\*q
427 Manuals not in these sections generally don't need a
438 This expands upon the brief, one-line description in
440 It usually contains a break-down of the options (if documenting a
442 .Bd -literal -offset indent
443 The arguments are as follows:
444 \&.Bl \-tag \-width Ds
446 Print verbose information.
450 Manuals not documenting a command won't include the above fragment.
451 .It Em IMPLEMENTATION NOTES
452 Implementation-specific notes should be kept here. This is useful when
453 implementing standard functions that may have side effects or notable
454 algorithmic implications.
456 Command exit status for section 1, 6, and 8 manuals. This section is
459 which is used for functions. Historically, this information was
462 a practise that is now discouraged.
467 This section is the dual of
469 which is used for commands. It documents the return values of functions
470 in sections 2, 3, and 9.
475 Documents any usages of environment variables, e.g.,
481 Documents files used. It's helpful to document both the file and a
482 short description of how the file is used (created, modified, etc.).
487 Example usages. This often contains snippets of well-formed,
488 well-tested invocations. Make doubly sure that your examples work
491 Documents error conditions. This is most useful in section 4 manuals.
492 Historically, this section was used in place of
494 for manuals in sections 1, 6, and 8; however, this practise is
501 Documents error handling in sections 2, 3, and 9.
506 References other manuals with related topics. This section should exist
507 for most manuals. Cross-references should conventionally be ordered
508 first by section, then alphabetically.
513 References any standards implemented or used. If not adhering to any
516 section should be used instead.
521 The history of any manual without a
523 section should be described in this section.
525 Credits to authors, if applicable, should appear in this section.
526 Authors should generally be noted by both name and an e-mail address.
531 Explanations of common misuses and misunderstandings should be explained
534 Extant bugs should be described in this section.
535 .It Em SECURITY CONSIDERATIONS
536 Documents any security precautions that operators should consider.
539 Macros are one to three three characters in length and begin with a
542 at the beginning of the line. An arbitrary amount of whitespace may
543 sit between the control character and the macro name. Thus, the
544 following are equivalent:
545 .Bd -literal -offset indent
550 The syntax of a macro depends on its classification. In this section,
552 refers to macro arguments, which may be followed by zero or more
556 opens the scope of a macro; and if specified,
562 column indicates that the macro may be called subsequent to the initial
563 line-macro. If a macro is not callable, then its invocation after the
564 initial line macro is interpreted as opaque text, such that
571 column indicates whether the macro may be followed by further
572 (ostensibly callable) macros. If a macro is not parsable, subsequent
573 macro invocations on the line will be interpreted as opaque text.
577 column, if applicable, describes closure rules.
578 .Ss Block full-explicit
579 Multi-line scope closed by an explicit closing macro. All macros
580 contains bodies; only
583 .Bd -literal -offset indent
584 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
589 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
590 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
591 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
592 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
593 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
594 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
595 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
596 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
597 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
598 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
600 .Ss Block full-implicit
601 Multi-line scope closed by end-of-file or implicitly by another macro.
602 All macros have bodies; some
610 don't have heads; only one
615 .Bd -literal -offset indent
616 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
620 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
621 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
622 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
623 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
624 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
625 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
627 .Ss Block partial-explicit
628 Like block full-explicit, but also with single-line scope. Each
629 has at least a body and, in limited circumstances, a head
636 .Bd -literal -offset indent
637 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
639 \&.Yc \(lBtail...\(rB
641 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
642 \(lBbody...\(rB \&Yc \(lBtail...\(rB
645 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
646 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
647 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
648 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
649 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
650 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
651 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
652 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
653 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
654 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
655 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
656 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
657 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
658 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
659 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
660 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
661 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
662 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
663 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
664 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
665 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
666 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
667 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
668 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
669 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
670 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
672 .Ss Block partial-implicit
673 Like block full-implicit, but with single-line scope closed by
674 .Sx Reserved Characters
676 .Bd -literal -offset indent
677 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
680 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
681 .It Em Macro Ta Em Callable Ta Em Parsable
682 .It Sx \&Aq Ta Yes Ta Yes
683 .It Sx \&Bq Ta Yes Ta Yes
684 .It Sx \&Brq Ta Yes Ta Yes
685 .It Sx \&D1 Ta \&No Ta \&Yes
686 .It Sx \&Dl Ta \&No Ta Yes
687 .It Sx \&Dq Ta Yes Ta Yes
688 .It Sx \&Op Ta Yes Ta Yes
689 .It Sx \&Pq Ta Yes Ta Yes
690 .It Sx \&Ql Ta Yes Ta Yes
691 .It Sx \&Qq Ta Yes Ta Yes
692 .It Sx \&Sq Ta Yes Ta Yes
693 .It Sx \&Vt Ta Yes Ta Yes
699 .Sx Block partial-implicit
700 only when invoked as the first macro
701 in a SYNOPSIS section line, else it is
705 .Sx Reserved Characters ,
706 end of line, fixed argument lengths, and/or subsequent macros. In-line
707 macros have only text children. If a number (or inequality) of
710 then the macro accepts an arbitrary number of arguments.
711 .Bd -literal -offset indent
712 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
714 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
716 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
719 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
720 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
721 .It Sx \&%A Ta \&No Ta \&No Ta >0
722 .It Sx \&%B Ta \&No Ta \&No Ta >0
723 .It Sx \&%C Ta \&No Ta \&No Ta >0
724 .It Sx \&%D Ta \&No Ta \&No Ta >0
725 .It Sx \&%I Ta \&No Ta \&No Ta >0
726 .It Sx \&%J Ta \&No Ta \&No Ta >0
727 .It Sx \&%N Ta \&No Ta \&No Ta >0
728 .It Sx \&%O Ta \&No Ta \&No Ta >0
729 .It Sx \&%P Ta \&No Ta \&No Ta >0
730 .It Sx \&%Q Ta \&No Ta \&No Ta >0
731 .It Sx \&%R Ta \&No Ta \&No Ta >0
732 .It Sx \&%T Ta \&No Ta \&No Ta >0
733 .It Sx \&%U Ta \&No Ta \&No Ta >0
734 .It Sx \&%V Ta \&No Ta \&No Ta >0
735 .It Sx \&Ad Ta Yes Ta Yes Ta n
736 .It Sx \&An Ta Yes Ta Yes Ta n
737 .It Sx \&Ap Ta Yes Ta Yes Ta 0
738 .It Sx \&Ar Ta Yes Ta Yes Ta n
739 .It Sx \&At Ta Yes Ta Yes Ta 1
740 .It Sx \&Bsx Ta Yes Ta Yes Ta n
741 .It Sx \&Bt Ta \&No Ta \&No Ta 0
742 .It Sx \&Bx Ta Yes Ta Yes Ta n
743 .It Sx \&Cd Ta Yes Ta Yes Ta >0
744 .It Sx \&Cm Ta Yes Ta Yes Ta n
745 .It Sx \&Db Ta \&No Ta \&No Ta 1
746 .It Sx \&Dd Ta \&No Ta \&No Ta >0
747 .It Sx \&Dt Ta \&No Ta \&No Ta n
748 .It Sx \&Dv Ta Yes Ta Yes Ta n
749 .It Sx \&Dx Ta Yes Ta Yes Ta n
750 .It Sx \&Em Ta Yes Ta Yes Ta >0
751 .It Sx \&En Ta \&No Ta \&No Ta 0
752 .It Sx \&Er Ta Yes Ta Yes Ta >0
753 .It Sx \&Es Ta \&No Ta \&No Ta 0
754 .It Sx \&Ev Ta Yes Ta Yes Ta n
755 .It Sx \&Ex Ta \&No Ta \&No Ta n
756 .It Sx \&Fa Ta Yes Ta Yes Ta n
757 .It Sx \&Fd Ta \&No Ta \&No Ta >0
758 .It Sx \&Fl Ta Yes Ta Yes Ta n
759 .It Sx \&Fn Ta Yes Ta Yes Ta >0
760 .It Sx \&Fr Ta \&No Ta \&No Ta n
761 .It Sx \&Ft Ta Yes Ta Yes Ta n
762 .It Sx \&Fx Ta Yes Ta Yes Ta n
763 .It Sx \&Hf Ta \&No Ta \&No Ta n
764 .It Sx \&Ic Ta Yes Ta Yes Ta >0
765 .It Sx \&In Ta \&No Ta \&No Ta n
766 .It Sx \&Lb Ta \&No Ta \&No Ta 1
767 .It Sx \&Li Ta Yes Ta Yes Ta n
768 .It Sx \&Lk Ta Yes Ta Yes Ta n
769 .It Sx \&Lp Ta \&No Ta \&No Ta 0
770 .It Sx \&Ms Ta Yes Ta Yes Ta >0
771 .It Sx \&Mt Ta Yes Ta Yes Ta >0
772 .It Sx \&Nm Ta Yes Ta Yes Ta n
773 .It Sx \&No Ta Yes Ta Yes Ta 0
774 .It Sx \&Ns Ta Yes Ta Yes Ta 0
775 .It Sx \&Nx Ta Yes Ta Yes Ta n
776 .It Sx \&Os Ta \&No Ta \&No Ta n
777 .It Sx \&Ot Ta \&No Ta \&No Ta n
778 .It Sx \&Ox Ta Yes Ta Yes Ta n
779 .It Sx \&Pa Ta Yes Ta Yes Ta n
780 .It Sx \&Pf Ta Yes Ta Yes Ta 1
781 .It Sx \&Pp Ta \&No Ta \&No Ta 0
782 .It Sx \&Rv Ta \&No Ta \&No Ta n
783 .It Sx \&Sm Ta \&No Ta \&No Ta 1
784 .It Sx \&St Ta \&No Ta Yes Ta 1
785 .It Sx \&Sx Ta Yes Ta Yes Ta >0
786 .It Sx \&Sy Ta Yes Ta Yes Ta >0
787 .It Sx \&Tn Ta Yes Ta Yes Ta >0
788 .It Sx \&Ud Ta \&No Ta \&No Ta 0
789 .It Sx \&Ux Ta Yes Ta Yes Ta n
790 .It Sx \&Va Ta Yes Ta Yes Ta n
791 .It Sx \&Vt Ta Yes Ta Yes Ta >0
792 .It Sx \&Xr Ta Yes Ta Yes Ta >0
793 .It Sx \&br Ta \&No Ta \&No Ta 0
794 .It Sx \&sp Ta \&No Ta \&No Ta 1
797 This section is a canonical reference of all macros, arranged
798 alphabetically. For the scoping of individual macros, see
803 block. Multiple authors should each be accorded their own
805 line. Author names should be ordered with full or abbreviated
806 forename(s) first, then full surname.
810 block. This macro may also be used in a non-bibliographic context when
811 referring to book titles.
813 Publication city or location of an
818 this macro is not implemented in
821 Publication date of an
823 block. This should follow the reduced or canonical form syntax
827 Publisher or issuer name of an
835 Issue number (usually for journals) of an
839 Optional information of an
843 Book or journal page number of an
847 Institutional author (school, government, etc.) of an
849 block. Multiple institutional authors should each be accorded their own
853 Technical report name of an
859 block. This macro may also be used in a non-bibliographical context
860 when referring to article titles.
862 URI of reference document.
870 block. Does not have any tail arguments.
872 Address construct: usually in the context of an computational address in
873 memory, not a physical (post) address.
879 Author name. This macro may alternatively accepts the following
880 arguments, although these may not be specified along with a parameter:
881 .Bl -tag -width 12n -offset indent
883 Renders a line break before each author listing.
889 In the AUTHORS section, the default is not to split the first author
890 listing, but all subsequent author listings, whether or not they're
891 interspersed by other macros or text, are split. Thus, specifying
893 will cause the first listing also to be split. If not in the AUTHORS
894 section, the default is not to split.
898 .D1 \&.An J. D. Ullman .
905 are re-set when entering the AUTHORS section, so if one specifies
907 in the general document body, it must be re-specified in the AUTHORS
910 Begins a block enclosed by angled brackets. Does not have any head
914 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
919 Inserts an apostrophe without any surrounding white-space. This is
920 generally used as a grammatic device when referring to the verb form of
922 .Bd -literal -offset indent
926 Encloses its arguments in angled brackets.
929 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
932 this macro is often abused for rendering URIs, which should instead use
936 or to note pre-processor
938 statements, which should use
944 Command arguments. If an argument is not provided, the string
946 is used as a default.
949 .D1 \&.Fl o \&Ns \&Ar file1
951 .D1 \&.Ar arg1 , arg2 .
953 Formats an AT&T version. Accepts at most one parameter:
954 .Bl -tag -width 12n -offset indent
963 Note that these parameters do not begin with a hyphen.
981 block. Does not have any tail arguments.
983 Begins a display block. A display is collection of macros or text which
984 may be collectively offset or justified in a manner different from that
985 of the enclosing context. By default, the block is preceded by a
988 Each display is associated with a type, which must be one of the
990 .Bl -tag -width 12n -offset indent
992 Only left-justify the block.
994 Do not justify the block at all.
996 Left- and right-justify the block.
1001 Centre-justify each line.
1004 The type must be provided first. Secondary arguments are as follows:
1005 .Bl -tag -width 12n -offset indent
1006 .It Fl offset Ar width
1007 Offset by the value of
1009 which is interpreted as one of the following, specified in order:
1012 As one of the pre-defined strings
1014 the width of standard indentation;
1019 which has no effect ;
1021 which justifies to the right margin; and
1023 which aligns around an imagined centre axis.
1025 As a precalculated width for a named macro. The most popular is the
1031 As a scaling unit following the syntax described in
1032 .Sx Scaling Widths .
1034 As the calculated string length of the opaque string.
1037 If unset, it will revert to the value of
1040 .Sx Scaling Widths .
1042 Do not assert a vertical space before the block.
1046 before any text or macros within the block.
1050 .Bd -literal -offset indent
1051 \&.Bd \-unfilled \-offset two-indent \-compact
1063 .\" Begins a list composed of one or more list entries. A list entry is
1064 .\" specified by the
1066 .\" macro, which consists of a head and optional body. By default, a list
1067 .\" is preceded by a blank line. A list must specify one of the following
1069 .\" .Bl -tag -width 12n
1071 .\" A list offset by a bullet. The head of list entries must be empty.
1072 .\" List entry bodies are justified after the bullet.
1074 .\" A columnated list. The number of columns is specified as arguments to
1077 .\" macro (the deprecated form of following the invocation of
1079 .\" is also accepted). Arguments dictate the width of columns specified in
1080 .\" list entries. List entry bodies must be left empty. Columns specified
1081 .\" in the list entry head are justified to their position in the sequence
1084 .\" A list offset by a dash (hyphen). The head of list entries must be
1085 .\" empty. List entry bodies are justified past the dash.
1089 .\" lists, but with additional formatting to the head.
1091 .\" A list offset by a number indicating list entry position. The head of
1092 .\" list entries must be empty. List entry bodies are justified past the
1097 .\" but instead of list bodies justifying to the head on the first line,
1098 .\" they trail the head text.
1105 .\" but list entry bodies aren't justified.
1107 .\" An un-justified list. This produces blocks of text.
1109 .\" List bodies are placed on the line following the head.
1111 .\" A list offset by list entry heads. List entry bodies are justified
1118 Begins a block enclosed by square brackets. Does not have any head
1122 .Bd -literal -offset indent
1130 Encloses its arguments in square brackets.
1133 .D1 \&.Bq 1 , \&Dv BUFSIZ
1136 this macro is sometimes abused to emulate optional arguments for
1137 commands; the correct macros to use for this purpose are
1148 block. Does not have any tail arguments.
1150 Begins a block enclosed by curly braces. Does not have any head
1154 .Bd -literal -offset indent
1162 Encloses its arguments in curly braces.
1165 .D1 \&.Brq 1 , ... , \&Va n
1170 Format the BSD/OS version provided as an argument, or a default value if
1171 no argument is provided.
1188 .Dq is currently in beta test.
1190 Format the BSD version provided as an argument, or a default value if no
1191 argument is provided.
1207 Configuration declaration. This denotes strings accepted by
1211 .D1 \&.Cd device le0 at scode?
1214 this macro is commonly abused by using quoted literals to retain
1215 white-space and align consecutive
1217 declarations. This practise is discouraged.
1219 Command modifiers. Useful when specifying configuration options or
1223 .D1 \&.Cm ControlPath
1224 .D1 \&.Cm ControlMaster
1229 One-line indented display. This is formatted by the default rules and
1230 is useful for simple indented statements. It is followed by a newline.
1233 .D1 \&.D1 \&Fl abcdefgh
1243 block. Does not have any tail arguments.
1245 Document date. This is the mandatory first macro of any
1247 manual. Its calling syntax is as follows:
1249 .D1 \. Ns Sx \&Dd Cm date
1255 which signifies the current manual revision date dictated by
1257 or instead a valid canonical date as specified by
1259 If a date does not conform, the current date is used instead.
1262 .D1 \&.Dd $\&Mdocdate$
1263 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1264 .D1 \&.Dd July 21, 2007
1271 One-line intended display. This is formatted as literal text and is
1272 useful for commands and invocations. It is followed by a newline.
1275 .D1 \&.Dl % mandoc mdoc.7 | less
1282 Begins a block enclosed by double quotes. Does not have any head
1286 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1291 Encloses its arguments in double quotes.
1294 .Bd -literal -offset indent -compact
1295 \&.Dq April is the cruellest month
1302 Document title. This is the mandatory second macro of any
1304 file. Its calling syntax is as follows:
1306 .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1308 Its arguments are as follows:
1309 .Bl -tag -width Ds -offset Ds
1311 The document's title (name). This should be capitalised and is
1314 The manual section. This may be one of
1322 .Pq Perl libraries ,
1332 .Pq system utilities ,
1334 .Pq kernel functions ,
1336 .Pq X Window System ,
1338 .Pq X Window System ,
1348 It is also required and should correspond to the manual's filename
1351 This overrides the volume inferred from
1353 This field is optional, and if specified, must be one of
1355 .Pq users' supplementary documents ,
1357 .Pq programmers' supplementary documents ,
1359 .Pq administrators' supplementary documents ,
1361 .Pq system managers' manuals ,
1363 .Pq users' reference manuals ,
1365 .Pq programmers' reference manuals ,
1367 .Pq kernel manuals ,
1378 .Pq contributed manuals .
1380 This specifies a specific relevant architecture. If
1382 is not provided, it may be used in its place, else it may be used
1383 subsequent that. It, too, is optional. It must be one of
1417 .D1 \&.Dt FOO 9 i386
1418 .D1 \&.Dt FOO 9 KM i386
1425 Defined variables such as preprocessor constants.
1429 .D1 \&.Dv STDOUT_FILENO
1434 Format the DragonFly BSD version provided as an argument, or a default
1435 value if no argument is provided.
1456 Denotes text that should be emphasised. Note that this is a
1457 presentation term and should not be used for stylistically decorating
1466 Display error constants.
1476 Environmental variables such as those specified in
1483 Inserts text regarding a utility's exit values. This macro must have
1486 argument specified, then an optional
1490 is not provided, the document's name as stipulated in
1497 Command-line flag. Used when listing arguments to command-line
1498 utilities. Prints a fixed-width hyphen
1500 directly followed by each argument. If no arguments are provided, a hyphen is
1501 printed followed by a space. If the argument is a macro, a hyphen is
1502 prefixed to the subsequent macro output.
1508 .D1 \&.Op \&Fl o \&Ns \&Ar file
1517 Format the FreeBSD version provided as an argument, or a default value
1518 if no argument is provided.
1540 Format a hyperlink. The calling syntax is as follows:
1542 .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1545 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1546 .D1 \&.Lk http://bsd.lv
1558 Format the NetBSD version provided as an argument, or a default value if
1559 no argument is provided.
1578 Document operating system version. This is the mandatory third macro of
1581 file. Its calling syntax is as follows:
1583 .D1 \. Ns Sx \&Os Op Cm system
1587 parameter specifies the relevant operating system or environment. Left
1588 unspecified, it defaults to the local operating system version. This is
1593 .D1 \&.Os KTH/CSC/TCS
1604 this macro has been deprecated.
1606 Format the OpenBSD version provided as an argument, or a default value
1607 if no argument is provided.
1635 block. Does not have any tail arguments.
1637 Begins a bibliographic
1639 block. Does not have any head arguments. The block macro may only
1655 child macros (at least one must be specified).
1658 .Bd -literal -offset indent -compact
1660 \&.%A J. E. Hopcroft
1662 \&.%B Introduction to Automata Theory, Languages, and Computation
1663 \&.%I Addison-Wesley
1664 \&.%C Reading, Massachusettes
1671 block is used within a SEE ALSO section, a vertical space is asserted
1672 before the rendered output, else the block continues on the current
1687 Format the UNIX name. Accepts no argument.
1703 A variable type. This is also used for indicating global variables in the
1704 SYNOPSIS section, in which case a variable name is also specified. Note that
1706 .Sx Block partial-implicit
1707 syntax when invoked as the first macro in the SYNOPSIS section, else it
1712 Note that this should not be confused with
1714 which is used for function return types.
1717 .D1 \&.Vt unsigned char
1718 .D1 \&.Vt extern const char * const sys_signame[] ;
1725 Close a scope opened by
1728 Open an extension scope. This macro originally existed to extend the
1729 9-argument limit of troff; since this limit has been lifted, the macro
1730 has been deprecated.
1732 Link to another manual
1733 .Pq Qq cross-reference .
1734 Its calling syntax is
1736 .D1 \. Ns Sx \&Xr Cm name section
1742 are the name and section of the linked manual. If
1744 is followed by non-punctuation, an
1746 is inserted into the token stream. This behaviour is for compatibility
1752 .D1 \&.Xr mandoc 1 ;
1753 .D1 \&.Xr mandoc 1 \&Ns s behaviour
1757 This section documents compatibility between mandoc and other other
1758 troff implementations, at this time limited to GNU troff
1762 refers to groff versions before the
1765 .Pq somewhere between 1.15 and 1.19 .
1767 Heirloom troff, the other significant troff implementation accepting
1768 \-mdoc, is similar to historic groff.
1774 is no longer accepted.
1778 macro does not format its arguments when used in the FILES section under
1779 certain list types. mandoc does.
1781 Historic groff does not print a dash for empty
1783 arguments. mandoc and newer groff implementations do.
1785 groff behaves irregularly when specifying
1788 within line-macro scopes. mandoc follows a consistent system.
1790 In mandoc, negative scaling units are truncated to zero; groff would
1791 move to prior lines. Furthermore, the
1793 scaling unit, while accepted, is rendered as the default unit.
1795 In quoted literals, groff allowed pair-wise double-quotes to produce a
1796 standalone double-quote in formatted output. This idiosyncratic
1797 behaviour is not applicable in mandoc.
1806 in manodc. Furthermore, the
1808 argument is ignored. Lastly, since text is not right-justified in
1809 mandoc (or even groff),
1818 Historic groff has many un-callable macros. Most of these (excluding
1819 some block-level macros) are now callable.
1825 but has been a proper delimiter since then.
1828 is assumed for all lists (it wasn't in historic groff): any list may be
1831 lists will restart the sequence only for the sub-list.
1835 incorrectly by following it with a reserved character and expecting the
1836 delimiter to render. This is not supported in mandoc.
1840 macro only produces the first parameter. This is not the case in
1848 macros were stipulated only to occur in certain manual sections. mandoc
1849 does not have these restrictions.
1857 reference was written by
1858 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1860 .\" XXX: this really isn't the place for these caveats.
1864 .\" There are many ambiguous parts of mdoc.
1867 .\" .Bl -dash -compact
1872 .\" as function arguments are variables.
1877 .\" as function return types are still types. Furthermore, the
1879 .\" should be removed and
1881 .\" which ostensibly follows it, should follow the same convention as
1885 .\" should formalise that only one or two arguments are acceptable: a
1886 .\" variable name and optional, preceding type.
1889 .\" is ambiguous. It's commonly used to indicate an include file in the
1890 .\" synopsis section.
1892 .\" should be used, instead.
1898 .\" makes sense. The remaining ones should be removed.
1904 .\" macros should be deprecated.
1908 .\" macro lacks clarity. It should be absolutely clear which title will
1909 .\" render when formatting the manual page.
1913 .\" should be provided for Linux (\(`a la
1918 .\" There's no way to refer to references in
1922 .\" The \-split and \-nosplit dictates via
1924 .\" are re-set when entering and leaving the AUTHORS section.