1 .\" $Id: mdoc.7,v 1.202 2011/08/18 08:58:44 kristaps Exp $
3 .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .Dd $Mdocdate: August 18 2011 $
23 .Nd mdoc language reference
27 language is used to format
31 This reference document describes its syntax, structure, and
33 The reference implementation for
39 section describes compatibility with other implementations.
43 document follows simple rules: lines beginning with the control
46 are parsed for macros.
47 Lines not beginning with the control character are
48 interpreted within the scope of prior macros:
49 .Bd -literal -offset indent
50 \&.Sh Macro lines change control state.
51 Text lines are interpreted within the current state.
55 documents may contain only graphable 7-bit ASCII characters, the space
56 character, and, in certain circumstances, the tab character.
57 The back-space character
59 indicates the start of an escape sequence for
61 .Sx Predefined Strings ,
63 .Sx Special Characters .
65 Text following an escaped double-quote
67 whether in a macro or text line, is ignored to the end of
69 A macro line beginning with a control character and comment escape
73 macro lines with only a control character and optional trailing
78 .Bd -literal -offset indent -compact
79 \&.\e\*q This is a comment line.
80 \&.\e\*q The next line is ignored:
82 \&.Em Emphasis \e\*q This is also a comment.
84 .Ss Special Characters
85 Special characters are used to encode special glyphs and are rendered
86 differently across output media.
87 They may occur in both macro and text lines.
88 Sequences begin with the escape character
90 followed by either an open-parenthesis
92 for two-character sequences; an open-bracket
94 for n-character sequences (terminated at a close-bracket
96 or a single one character sequence.
99 .Bl -tag -width Ds -offset indent -compact
110 Terms may be text-decorated using the
112 escape followed by an indicator: B (bold), I (italic), R (regular), or P
113 (revert to previous mode).
114 A numerical representation 3, 2, or 1 (bold, italic, and regular,
115 respectively) may be used instead.
116 If a macro opens a font scope after calling
122 mode will be restored upon exiting the
127 .Bl -tag -width Ds -offset indent -compact
129 write in bold, then switch to regular
131 write in italic, then return to previous
138 which encourages semantic annotation.
139 .Ss Predefined Strings
140 Predefined strings, like
141 .Sx Special Characters ,
142 mark special output glyphs.
143 Predefined strings are escaped with the slash-asterisk,
153 .Bl -tag -width Ds -offset indent -compact
160 These strings are set using
164 consists of several pre-set escapes listed in
167 Whitespace consists of the space character.
168 In text lines, whitespace is preserved within a line.
169 In macro lines, whitespace delimits arguments and is discarded.
171 Unescaped trailing spaces are stripped from text line input unless in a
173 In general, trailing whitespace on any input line is discouraged for
174 reasons of portability.
175 In the rare case that a blank character is needed at the end of an
176 input line, it may be forced by
179 Blank text lines, which may include whitespace, are only permitted
180 within literal contexts.
181 If the first character of a text line is a space, that line is printed
182 with a leading newline.
184 Macro arguments may be quoted with double-quotes; in this case,
185 whitespace within the quotes is retained as part of the argument.
188 .D1 Pf \. \&Fn strlen "\(dqconst char *s\(dq"
191 .Sq Fn strlen "const char *s" ,
194 .D1 Pf \. \&Fn strlen "const char *s"
197 .Sq Fn strlen const char *s .
199 A quoted argument begins with a double-quote preceded by whitespace.
200 The next double-quote not pairwise adjacent to another double-quote
201 terminates the literal, regardless of surrounding whitespace.
203 In unquoted arguments, space characters can alternatively be included
204 by preceding them with a backslash
206 but quoting is usually better for clarity.
208 Note that any quoted text, even if it would cause a macro invocation
209 when unquoted, is considered literal text.
210 Thus, the following produces
212 .Bd -literal -offset indent
216 In text lines, quotes are regarded as opaque text.
218 Many macros support scaled widths for their arguments.
219 The syntax for a scaled width is
220 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
221 where a decimal must be preceded or proceeded by at least one digit.
222 Negative numbers, while accepted, are truncated to zero.
224 The following scaling units are accepted:
226 .Bl -tag -width Ds -offset indent -compact
239 default vertical span
251 default horizontal span
256 Using anything other than
262 is necessarily non-portable across output media.
267 .Bl -tag -width Ds -offset indent -compact
268 .It \&.Bl -tag -width 2i
269 two-inch tagged list indentation
276 Sentences should terminate at the end of an input line.
277 By doing this, a formatter will be able to apply the proper amount of
278 spacing after the end of sentence (unescaped) period, exclamation mark,
279 or question mark followed by zero or more non-sentence closing
288 The proper spacing is also intelligently preserved if a sentence ends at
289 the boundary of a macro line.
292 .Bd -literal -offset indent -compact
293 Do not end sentences mid-line like this. Instead,
294 end a sentence like this.
295 A macro would end like this:
301 document consists of a document prologue followed by one or more
304 The prologue, which consists of the
309 macros in that order, is required for every document.
311 The first section (sections are denoted by
313 must be the NAME section, consisting of at least one
318 Following that, convention dictates specifying at least the
322 sections, although this varies between manual sections.
324 The following is a well-formed skeleton
328 .Bd -literal -offset indent
330 \&.Dt PROGNAME section
334 \&.Nd one line about what it does
336 \&.\e\*q For sections 2, 3, & 9 only.
337 \&.\e\*q Not used in OpenBSD.
345 utility processes files ...
346 \&.\e\*q .Sh IMPLEMENTATION NOTES
347 \&.\e\*q Not used in OpenBSD.
348 \&.\e\*q .Sh RETURN VALUES
349 \&.\e\*q For sections 2, 3, & 9 only.
350 \&.\e\*q .Sh ENVIRONMENT
351 \&.\e\*q For sections 1, 6, 7, & 8 only.
353 \&.\e\*q .Sh EXIT STATUS
354 \&.\e\*q For sections 1, 6, & 8 only.
355 \&.\e\*q .Sh EXAMPLES
356 \&.\e\*q .Sh DIAGNOSTICS
357 \&.\e\*q For sections 1, 4, 6, 7, & 8 only.
359 \&.\e\*q For sections 2, 3, & 9 only.
360 \&.\e\*q .Sh SEE ALSO
361 \&.\e\*q .Xr foobar 1
362 \&.\e\*q .Sh STANDARDS
367 \&.\e\*q .Sh SECURITY CONSIDERATIONS
368 \&.\e\*q Not used in OpenBSD.
373 document are conventionally ordered as they appear above.
374 Sections should be composed as follows:
375 .Bl -ohang -offset Ds
377 The name(s) and a one line description of the documented material.
378 The syntax for this as follows:
379 .Bd -literal -offset indent
383 \&.Nd a one line description
388 names should be separated by commas.
392 macro(s) must precede the
401 The name of the library containing the documented material, which is
402 assumed to be a function in a section 2, 3, or 9 manual.
403 The syntax for this is as follows:
404 .Bd -literal -offset indent
411 Documents the utility invocation syntax, function call syntax, or device
414 For the first, utilities (sections 1, 6, and 8), this is
415 generally structured as follows:
416 .Bd -literal -offset indent
427 Commands should be ordered alphabetically.
429 For the second, function calls (sections 2, 3, 9):
430 .Bd -literal -offset indent
432 \&.Vt extern const char *global;
434 \&.Fn foo "const char *src"
436 \&.Fn bar "const char *src"
445 macros should follow C header-file conventions.
447 And for the third, configurations (section 4):
448 .Bd -literal -offset indent
449 \&.Cd \*qit* at isa? port 0x2e\*q
450 \&.Cd \*qit* at isa? port 0x4e\*q
453 Manuals not in these sections generally don't need a
456 Some macros are displayed differently in the
458 section, particularly
468 All of these macros are output on their own line.
469 If two such dissimilar macros are pairwise invoked (except for
475 they are separated by a vertical space, unless in the case of
480 which are always separated by vertical space.
482 When text and macros following an
484 macro starting an input line span multiple output lines,
485 all output lines but the first will be indented to align
486 with the text immediately following the
488 macro, up to the next
493 macro or the end of an enclosing block, whichever comes first.
495 This begins with an expansion of the brief, one line description in
497 .Bd -literal -offset indent
500 utility does this, that, and the other.
503 It usually follows with a breakdown of the options (if documenting a
505 .Bd -literal -offset indent
506 The arguments are as follows:
507 \&.Bl \-tag \-width Ds
509 Print verbose information.
513 Manuals not documenting a command won't include the above fragment.
517 section usually contains most of the text of a manual, longer manuals
520 macro to form subsections.
521 In very long manuals, the
523 may be split into multiple sections, each started by an
525 macro followed by a non-standard section name, and each having
526 several subsections, like in the present
529 .It Em IMPLEMENTATION NOTES
530 Implementation-specific notes should be kept here.
531 This is useful when implementing standard functions that may have side
532 effects or notable algorithmic implications.
534 This section documents the
535 return values of functions in sections 2, 3, and 9.
540 Lists the environment variables used by the utility,
541 and explains the syntax and semantics of their values.
544 manual provides examples of typical content and formatting.
549 Documents files used.
550 It's helpful to document both the file name and a short description of how
551 the file is used (created, modified, etc.).
556 This section documents the
557 command exit status for section 1, 6, and 8 utilities.
558 Historically, this information was described in
560 a practise that is now discouraged.
566 This often contains snippets of well-formed, well-tested invocations.
567 Make sure that examples work properly!
569 Documents error conditions.
570 This is most useful in section 4 manuals.
571 Historically, this section was used in place of
573 for manuals in sections 1, 6, and 8; however, this practise is
580 Documents error handling in sections 2, 3, and 9.
585 References other manuals with related topics.
586 This section should exist for most manuals.
587 Cross-references should conventionally be ordered first by section, then
590 References to other documentation concerning the topic of the manual page,
591 for example authoritative books or journal articles, may also be
592 provided in this section.
599 References any standards implemented or used.
600 If not adhering to any standards, the
602 section should be used instead.
607 A brief history of the subject, including where it was first implemented,
608 and when it was ported to or reimplemented for the operating system at hand.
610 Credits to the person or persons who wrote the code and/or documentation.
611 Authors should generally be noted by both name and email address.
616 Common misuses and misunderstandings should be explained
619 Known bugs, limitations, and work-arounds should be described
621 .It Em SECURITY CONSIDERATIONS
622 Documents any security precautions that operators should consider.
625 Macros are one to three three characters in length and begin with a
628 at the beginning of the line.
629 An arbitrary amount of whitespace may sit between the control character
631 Thus, the following are equivalent:
632 .Bd -literal -offset indent
637 The syntax of a macro depends on its classification.
640 refers to macro arguments, which may be followed by zero or more
644 opens the scope of a macro; and if specified,
650 column indicates that the macro may also be called by passing its name
651 as an argument to another macro.
653 .Sq \&.Op \&Fl O \&Ar file
655 .Sq Op Fl O Ar file .
656 To prevent a macro call and render the macro name literally,
657 escape it by prepending a zero-width space,
663 If a macro is not callable but its name appears as an argument
664 to another macro, it is interpreted as opaque text.
672 column indicates whether the macro may call other macros by receiving
673 their names as arguments.
674 If a macro is not parsed but the name of another macro appears
675 as an argument, it is interpreted as opaque text.
679 column, if applicable, describes closure rules.
680 .Ss Block full-explicit
681 Multi-line scope closed by an explicit closing macro.
682 All macros contains bodies; only
688 .Bd -literal -offset indent
689 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
694 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXX"
695 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
696 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
697 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
698 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
699 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
700 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
701 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
702 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
703 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
705 .Ss Block full-implicit
706 Multi-line scope closed by end-of-file or implicitly by another macro.
707 All macros have bodies; some
715 don't have heads; only one
722 .Bd -literal -offset indent
723 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
727 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX"
728 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
729 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
730 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
731 .It Sx \&Nm Ta \&No Ta Yes Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
732 .It Sx \&Sh Ta \&No Ta Yes Ta closed by Sx \&Sh
733 .It Sx \&Ss Ta \&No Ta Yes Ta closed by Sx \&Sh , Sx \&Ss
739 .Sx Block full-implicit
740 macro only when invoked as the first macro
743 section line, else it is
745 .Ss Block partial-explicit
746 Like block full-explicit, but also with single-line scope.
747 Each has at least a body and, in limited circumstances, a head
754 .Bd -literal -offset indent
755 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
757 \&.Yc \(lBtail...\(rB
759 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
760 \(lBbody...\(rB \&Yc \(lBtail...\(rB
763 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -compact -offset indent
764 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
765 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
766 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
767 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
768 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
769 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
770 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
771 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
772 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
773 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
774 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
775 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
776 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
777 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
778 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
779 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
780 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
781 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
782 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
783 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
784 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
785 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
786 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
787 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
788 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
790 .Ss Block partial-implicit
791 Like block full-implicit, but with single-line scope closed by the
793 .Bd -literal -offset indent
794 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
797 .Bl -column "MacroX" "CallableX" "ParsedX" -compact -offset indent
798 .It Em Macro Ta Em Callable Ta Em Parsed
799 .It Sx \&Aq Ta Yes Ta Yes
800 .It Sx \&Bq Ta Yes Ta Yes
801 .It Sx \&Brq Ta Yes Ta Yes
802 .It Sx \&D1 Ta \&No Ta \&Yes
803 .It Sx \&Dl Ta \&No Ta Yes
804 .It Sx \&Dq Ta Yes Ta Yes
805 .It Sx \&Op Ta Yes Ta Yes
806 .It Sx \&Pq Ta Yes Ta Yes
807 .It Sx \&Ql Ta Yes Ta Yes
808 .It Sx \&Qq Ta Yes Ta Yes
809 .It Sx \&Sq Ta Yes Ta Yes
810 .It Sx \&Vt Ta Yes Ta Yes
816 .Sx Block partial-implicit
817 only when invoked as the first macro
820 section line, else it is
822 .Ss Special block macro
825 macro can only be used below
830 It delimits blocks representing table cells;
831 these blocks have bodies, but no heads.
833 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -compact -offset indent
834 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
835 .It Sx \&Ta Ta Yes Ta Yes Ta closed by Sx \&Ta , Sx \&It
838 Closed by the end of the line, fixed argument lengths,
839 and/or subsequent macros.
840 In-line macros have only text children.
841 If a number (or inequality) of arguments is
843 then the macro accepts an arbitrary number of arguments.
844 .Bd -literal -offset indent
845 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB
847 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
849 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
852 .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -compact -offset indent
853 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
854 .It Sx \&%A Ta \&No Ta \&No Ta >0
855 .It Sx \&%B Ta \&No Ta \&No Ta >0
856 .It Sx \&%C Ta \&No Ta \&No Ta >0
857 .It Sx \&%D Ta \&No Ta \&No Ta >0
858 .It Sx \&%I Ta \&No Ta \&No Ta >0
859 .It Sx \&%J Ta \&No Ta \&No Ta >0
860 .It Sx \&%N Ta \&No Ta \&No Ta >0
861 .It Sx \&%O Ta \&No Ta \&No Ta >0
862 .It Sx \&%P Ta \&No Ta \&No Ta >0
863 .It Sx \&%Q Ta \&No Ta \&No Ta >0
864 .It Sx \&%R Ta \&No Ta \&No Ta >0
865 .It Sx \&%T Ta \&No Ta \&No Ta >0
866 .It Sx \&%U Ta \&No Ta \&No Ta >0
867 .It Sx \&%V Ta \&No Ta \&No Ta >0
868 .It Sx \&Ad Ta Yes Ta Yes Ta >0
869 .It Sx \&An Ta Yes Ta Yes Ta >0
870 .It Sx \&Ap Ta Yes Ta Yes Ta 0
871 .It Sx \&Ar Ta Yes Ta Yes Ta n
872 .It Sx \&At Ta Yes Ta Yes Ta 1
873 .It Sx \&Bsx Ta Yes Ta Yes Ta n
874 .It Sx \&Bt Ta \&No Ta \&No Ta 0
875 .It Sx \&Bx Ta Yes Ta Yes Ta n
876 .It Sx \&Cd Ta Yes Ta Yes Ta >0
877 .It Sx \&Cm Ta Yes Ta Yes Ta >0
878 .It Sx \&Db Ta \&No Ta \&No Ta 1
879 .It Sx \&Dd Ta \&No Ta \&No Ta n
880 .It Sx \&Dt Ta \&No Ta \&No Ta n
881 .It Sx \&Dv Ta Yes Ta Yes Ta >0
882 .It Sx \&Dx Ta Yes Ta Yes Ta n
883 .It Sx \&Em Ta Yes Ta Yes Ta >0
884 .It Sx \&En Ta \&No Ta \&No Ta 0
885 .It Sx \&Er Ta Yes Ta Yes Ta >0
886 .It Sx \&Es Ta \&No Ta \&No Ta 0
887 .It Sx \&Ev Ta Yes Ta Yes Ta >0
888 .It Sx \&Ex Ta \&No Ta \&No Ta n
889 .It Sx \&Fa Ta Yes Ta Yes Ta >0
890 .It Sx \&Fd Ta \&No Ta \&No Ta >0
891 .It Sx \&Fl Ta Yes Ta Yes Ta n
892 .It Sx \&Fn Ta Yes Ta Yes Ta >0
893 .It Sx \&Fr Ta \&No Ta \&No Ta n
894 .It Sx \&Ft Ta Yes Ta Yes Ta >0
895 .It Sx \&Fx Ta Yes Ta Yes Ta n
896 .It Sx \&Hf Ta \&No Ta \&No Ta n
897 .It Sx \&Ic Ta Yes Ta Yes Ta >0
898 .It Sx \&In Ta \&No Ta \&No Ta 1
899 .It Sx \&Lb Ta \&No Ta \&No Ta 1
900 .It Sx \&Li Ta Yes Ta Yes Ta >0
901 .It Sx \&Lk Ta Yes Ta Yes Ta >0
902 .It Sx \&Lp Ta \&No Ta \&No Ta 0
903 .It Sx \&Ms Ta Yes Ta Yes Ta >0
904 .It Sx \&Mt Ta Yes Ta Yes Ta >0
905 .It Sx \&Nm Ta Yes Ta Yes Ta n
906 .It Sx \&No Ta Yes Ta Yes Ta 0
907 .It Sx \&Ns Ta Yes Ta Yes Ta 0
908 .It Sx \&Nx Ta Yes Ta Yes Ta n
909 .It Sx \&Os Ta \&No Ta \&No Ta n
910 .It Sx \&Ot Ta \&No Ta \&No Ta n
911 .It Sx \&Ox Ta Yes Ta Yes Ta n
912 .It Sx \&Pa Ta Yes Ta Yes Ta n
913 .It Sx \&Pf Ta Yes Ta Yes Ta 1
914 .It Sx \&Pp Ta \&No Ta \&No Ta 0
915 .It Sx \&Rv Ta \&No Ta \&No Ta n
916 .It Sx \&Sm Ta \&No Ta \&No Ta 1
917 .It Sx \&St Ta \&No Ta Yes Ta 1
918 .It Sx \&Sx Ta Yes Ta Yes Ta >0
919 .It Sx \&Sy Ta Yes Ta Yes Ta >0
920 .It Sx \&Tn Ta Yes Ta Yes Ta >0
921 .It Sx \&Ud Ta \&No Ta \&No Ta 0
922 .It Sx \&Ux Ta Yes Ta Yes Ta n
923 .It Sx \&Va Ta Yes Ta Yes Ta n
924 .It Sx \&Vt Ta Yes Ta Yes Ta >0
925 .It Sx \&Xr Ta Yes Ta Yes Ta >0
926 .It Sx \&br Ta \&No Ta \&No Ta 0
927 .It Sx \&sp Ta \&No Ta \&No Ta 1
930 When a macro argument consists of one single input character
931 considered as a delimiter, the argument gets special handling.
932 This does not apply when delimiters appear in arguments containing
933 more than one character.
934 Consequently, to prevent special handling and just handle it
935 like any other argument, a delimiter can be escaped by prepending
938 In text lines, delimiters never need escaping, but may be used
939 as normal punctuation.
941 For many macros, when the leading arguments are opening delimiters,
942 these delimiters are put before the macro scope,
943 and when the trailing arguments are closing delimiters,
944 these delimiters are put after the macro scope.
947 .D1 Pf \. \&Aq "( [ word ] ) ."
951 .D1 Aq ( [ word ] ) .
953 Opening delimiters are:
955 .Bl -tag -width Ds -offset indent -compact
962 Closing delimiters are:
964 .Bl -tag -width Ds -offset indent -compact
983 Note that even a period preceded by a backslash
985 gets this special handling; use
989 Many in-line macros interrupt their scope when they encounter
990 delimiters, and resume their scope when more arguments follow that
994 .D1 Pf \. \&Fl "a ( b | c \e*(Ba d ) e"
998 .D1 Fl a ( b | c \*(Ba d ) e
1000 This applies to both opening and closing delimiters,
1001 and also to the middle delimiter:
1003 .Bl -tag -width Ds -offset indent -compact
1008 As a special case, the predefined string \e*(Ba is handled and rendered
1009 in the same way as a plain
1012 Using this predefined string is not recommended in new manuals.
1014 This section is a canonical reference of all macros, arranged
1016 For the scoping of individual macros, see
1022 Multiple authors should each be accorded their own
1025 Author names should be ordered with full or abbreviated forename(s)
1026 first, then full surname.
1031 This macro may also be used in a non-bibliographic context when
1032 referring to book titles.
1034 Publication city or location of an
1038 Publication date of an
1041 Recommended formats of arguments are
1042 .Ar month day , year
1046 Publisher or issuer name of an
1054 Issue number (usually for journals) of an
1058 Optional information of an
1062 Book or journal page number of an
1066 Institutional author (school, government, etc.) of an
1069 Multiple institutional authors should each be accorded their own
1073 Technical report name of an
1080 This macro may also be used in a non-bibliographical context when
1081 referring to article titles.
1083 URI of reference document.
1092 Does not have any tail arguments.
1095 Do not use this for postal addresses.
1099 .Dl \&.Ad 0x00000000
1102 Can be used both for the authors of the program, function, or driver
1103 documented in the manual, or for the authors of the manual itself.
1104 Requires either the name of an author or one of the following arguments:
1106 .Bl -tag -width "-nosplitX" -offset indent -compact
1108 Start a new output line before each subsequent invocation of
1117 The effect of selecting either of the
1119 modes ends at the beginning of the
1124 section, the default is
1126 for the first author listing and
1128 for all other author listings.
1132 .Dl \&.An Kristaps Dzonsons \&Aq kristaps@bsd.lv
1134 Begin a block enclosed by angle brackets.
1135 Does not have any head arguments.
1138 .Dl \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
1143 Inserts an apostrophe without any surrounding whitespace.
1144 This is generally used as a grammatical device when referring to the verb
1148 .Dl \&.Fn execve \&Ap d
1150 Encloses its arguments in angle brackets.
1153 .Dl \&.Fl -key= \&Ns \&Aq \&Ar val
1156 this macro is often abused for rendering URIs, which should instead use
1160 or to note pre-processor
1162 statements, which should use
1169 If an argument is not provided, the string
1171 is used as a default.
1176 .Dl ".Ar arg1 , arg2 ."
1178 The arguments to the
1180 macro are names and placeholders for command arguments;
1181 for fixed strings to be passed verbatim as arguments, use
1186 Formats an AT&T version.
1187 Accepts one optional argument:
1189 .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact
1200 Note that these arguments do not begin with a hyphen.
1220 Does not have any tail arguments.
1222 Begin a display block.
1223 Its syntax is as follows:
1224 .Bd -ragged -offset indent
1227 .Op Fl offset Ar width
1231 Display blocks are used to select a different indentation and
1232 justification than the one used by the surrounding text.
1233 They may contain both macro lines and text lines.
1234 By default, a display block is preceded by a vertical space.
1238 must be one of the following:
1239 .Bl -tag -width 13n -offset indent
1241 Produce one output line from each input line, and centre-justify each line.
1242 Using this display type is not recommended; many
1244 implementations render it poorly.
1246 Change the positions of line breaks to fill each line, and left- and
1247 right-justify the resulting block.
1249 Produce one output line from each input line,
1250 and do not justify the block at all.
1251 Preserve white space as it appears in the input.
1252 Always use a constant-width font.
1253 Use this for displaying source code.
1255 Change the positions of line breaks to fill each line, and left-justify
1256 the resulting block.
1260 but using the same font as for normal text, which is a variable width font
1261 if supported by the output device.
1266 must be provided first.
1267 Additional arguments may follow:
1268 .Bl -tag -width 13n -offset indent
1269 .It Fl offset Ar width
1270 Indent the display by the
1272 which may be one of the following:
1275 One of the pre-defined strings
1277 the width of a standard indentation (six constant width characters);
1282 which has no effect;
1284 which justifies to the right margin; or
1286 which aligns around an imagined centre axis.
1288 A macro invocation, which selects a predefined width
1289 associated with that macro.
1290 The most popular is the imaginary macro
1295 A width using the syntax described in
1296 .Sx Scaling Widths .
1298 An arbitrary string, which indents by the length of this string.
1301 When the argument is missing,
1305 Do not assert vertical space before the display.
1309 .Bd -literal -offset indent
1310 \&.Bd \-literal \-offset indent \-compact
1320 Change the font mode for a scoped block of text.
1321 Its syntax is as follows:
1322 .Bd -ragged -offset indent
1325 .Fl emphasis | literal | symbolic |
1326 .Cm \&Em | \&Li | \&Sy
1334 argument are equivalent, as are
1342 Without an argument, this macro does nothing.
1343 The font mode continues until broken by a new font mode in a nested
1355 For each macro, keep its output together on the same output line,
1356 until the end of the macro or the end of the input line is reached,
1357 whichever comes first.
1358 Line breaks in text lines are unaffected.
1359 The syntax is as follows:
1361 .D1 Pf \. Sx \&Bk Fl words
1365 argument is required; additional arguments are ignored.
1367 The following example will not break within each
1370 .Bd -literal -offset indent
1373 \&.Op Fl o Ar output
1377 Be careful in using over-long lines within a keep block!
1378 Doing so will clobber the right margin.
1381 Lists consist of items specified using the
1383 macro, containing a head or a body or both.
1384 The list syntax is as follows:
1385 .Bd -ragged -offset indent
1389 .Op Fl offset Ar val
1396 is mandatory and must be specified first.
1403 or use the length of the given string.
1406 is a global indentation for the whole list, affecting both item heads
1408 For those list types supporting it, the
1410 argument requests an additional indentation of item bodies,
1415 argument is specified, list entries are separated by vertical space.
1417 A list must specify one of the following list types:
1418 .Bl -tag -width 12n -offset indent
1420 No item heads can be specified, but a bullet will be printed at the head
1422 Item bodies start on the same output line as the bullet
1423 and are indented according to the
1430 argument has no effect; instead, each argument specifies the width
1431 of one column, using either the
1433 syntax or the string length of the argument.
1434 If the first line of the body of a
1440 contexts spanning one input line each are implied until an
1442 macro line is encountered, at which point items start being interpreted as
1449 except that dashes are used in place of bullets.
1453 except that item heads are not parsed for macro invocations.
1454 Most often used in the
1456 section with error constants in the item heads.
1459 No item heads can be specified.
1462 except that cardinal numbers are used in place of bullets,
1467 except that the first lines of item bodies are not indented, but follow
1468 the item heads like in
1475 Item bodies follow items heads on the same line, using normal inter-word
1477 Bodies are not indented, and the
1479 argument is ignored.
1481 No item heads can be specified, and none are printed.
1482 Bodies are not indented, and the
1484 argument is ignored.
1486 Item bodies start on the line following item heads and are not indented.
1489 argument is ignored.
1491 Item bodies are indented according to the
1494 When an item head fits inside the indentation, the item body follows
1495 this head on the same output line.
1496 Otherwise, the body starts on the output line following the head.
1499 Lists may be nested within lists and displays.
1504 lists may not be portable.
1511 Begin a block enclosed by square brackets.
1512 Does not have any head arguments.
1515 .Bd -literal -offset indent -compact
1523 Encloses its arguments in square brackets.
1526 .Dl \&.Bq 1 , \&Dv BUFSIZ
1529 this macro is sometimes abused to emulate optional arguments for
1530 commands; the correct macros to use for this purpose are
1542 Does not have any tail arguments.
1544 Begin a block enclosed by curly braces.
1545 Does not have any head arguments.
1548 .Bd -literal -offset indent -compact
1556 Encloses its arguments in curly braces.
1559 .Dl \&.Brq 1 , ... , \&Va n
1564 Format the BSD/OS version provided as an argument, or a default value if
1565 no argument is provided.
1582 .Dq is currently in beta test.
1584 Format the BSD version provided as an argument, or a default value if no
1585 argument is provided.
1602 Kernel configuration declaration.
1603 This denotes strings accepted by
1605 It is most often used in section 4 manual pages.
1608 .Dl \&.Cd device le0 at scode?
1611 this macro is commonly abused by using quoted literals to retain
1612 whitespace and align consecutive
1615 This practise is discouraged.
1618 Typically used for fixed strings passed as arguments, unless
1620 is more appropriate.
1621 Also useful when specifying configuration options or keys.
1624 .Dl ".Nm mt Fl f Ar device Cm rewind"
1625 .Dl ".Nm ps Fl o Cm pid , Ns Cm command"
1626 .Dl ".Nm dd Cm if= Ns Ar file1 Cm of= Ns Ar file2"
1627 .Dl ".Cm IdentityFile Pa ~/.ssh/id_rsa"
1628 .Dl ".Cm LogLevel Dv DEBUG"
1630 One-line indented display.
1631 This is formatted by the default rules and is useful for simple indented
1633 It is followed by a newline.
1636 .Dl \&.D1 \&Fl abcdefgh
1643 Switch debugging mode.
1644 Its syntax is as follows:
1646 .D1 Pf \. Sx \&Db Cm on | off
1648 This macro is ignored by
1654 Does not have any tail arguments.
1657 This is the mandatory first macro of any
1660 Its syntax is as follows:
1662 .D1 Pf \. Sx \&Dd Ar month day , year
1666 is the full English month name, the
1668 is an optionally zero-padded numeral, and the
1670 is the full four-digit year.
1672 Other arguments are not portable; the
1674 utility handles them as follows:
1675 .Bl -dash -offset 3n -compact
1677 To have the date automatically filled in by the
1683 can be given as an argument.
1685 A few alternative date formats are accepted as well
1686 and converted to the standard form.
1688 If a date string cannot be parsed, it is used verbatim.
1690 If no date string is given, the current date is used.
1694 .Dl \&.Dd $\&Mdocdate$
1695 .Dl \&.Dd $\&Mdocdate: July 21 2007$
1696 .Dl \&.Dd July 21, 2007
1703 One-line intended display.
1704 This is formatted as literal text and is useful for commands and
1706 It is followed by a newline.
1709 .Dl \&.Dl % mandoc mdoc.7 \e(ba less
1716 Begin a block enclosed by double quotes.
1717 Does not have any head arguments.
1720 .Bd -literal -offset indent -compact
1722 April is the cruellest month
1730 Encloses its arguments in
1735 .Bd -literal -offset indent -compact
1736 \&.Dq April is the cruellest month
1747 This is the mandatory second macro of any
1750 Its syntax is as follows:
1751 .Bd -ragged -offset indent
1757 .Op Ar volume | arch
1762 Its arguments are as follows:
1763 .Bl -tag -width Ds -offset Ds
1765 The document's title (name), defaulting to
1768 It should be capitalised.
1779 .Pq Perl libraries ,
1789 .Pq system utilities ,
1791 .Pq kernel functions ,
1793 .Pq X Window System ,
1795 .Pq X Window System ,
1805 It should correspond to the manual's filename suffix and defaults to
1809 This overrides the volume inferred from
1811 This field is optional, and if specified, must be one of
1813 .Pq users' supplementary documents ,
1815 .Pq programmers' supplementary documents ,
1817 .Pq administrators' supplementary documents ,
1819 .Pq system managers' manuals ,
1821 .Pq users' reference manuals ,
1823 .Pq programmers' reference manuals ,
1825 .Pq kernel manuals ,
1836 .Pq contributed manuals .
1838 This specifies a specific relevant architecture.
1841 is not provided, it may be used in its place, else it may be used
1843 It, too, is optional.
1879 .Dl \&.Dt FOO 9 i386
1886 Defined variables such as preprocessor constants, constant symbols,
1887 enumeration values, and so on.
1892 .Dl \&.Dv STDOUT_FILENO
1898 for special-purpose constants and
1900 for variable symbols.
1902 Format the DragonFly BSD version provided as an argument, or a default
1903 value if no argument is provided.
1919 Close a scope started by
1921 Its syntax is as follows:
1923 .D1 Pf \. Sx \&Ec Op Ar TERM
1927 argument is used as the enclosure tail, for example, specifying \e(rq
1931 End a display context started by
1934 End a font mode context started by
1937 End a keep context started by
1940 End a list context started by
1948 Denotes text that should be
1950 Note that this is a presentation term and should not be used for
1951 stylistically decorating technical terms.
1952 Depending on the output device, this is usually represented
1953 using an italic font or underlined characters.
1966 This macro is obsolete and not implemented in
1969 An arbitrary enclosure.
1970 Its syntax is as follows:
1972 .D1 Pf \. Sx \&Eo Op Ar TERM
1976 argument is used as the enclosure head, for example, specifying \e(lq
1980 Error constants for definitions of the
1982 libc global variable.
1983 This is most often used in section 2 and 3 manual pages.
1991 for general constants.
1993 This macro is obsolete and not implemented.
1995 Environmental variables such as those specified in
2004 for general constants.
2006 Insert a standard sentence regarding command exit values of 0 on success
2008 This is most often used in section 1, 6, and 8 manual pages.
2009 Its syntax is as follows:
2011 .D1 Pf \. Sx \&Ex Fl std Op Ar utility ...
2015 is not specified, the document's name set by
2020 arguments are treated as separate utilities.
2026 Its syntax is as follows:
2027 .Bd -ragged -offset indent
2033 This may be invoked for names with or without the corresponding type.
2034 It is also used to specify the field name of a structure.
2037 macro is used in the
2041 section when documenting multi-line function prototypes.
2042 If invoked with multiple arguments, the arguments are separated by a
2044 Furthermore, if the following macro is another
2046 the last argument will also have a trailing comma.
2049 .Dl \&.Fa \(dqconst char *p\(dq
2050 .Dl \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
2056 End a function context started by
2059 Historically used to document include files.
2060 This usage has been deprecated in favour of
2062 Do not use this macro.
2065 .Sx MANUAL STRUCTURE
2069 Command-line flag or option.
2070 Used when listing arguments to command-line utilities.
2071 Prints a fixed-width hyphen
2073 directly followed by each argument.
2074 If no arguments are provided, a hyphen is printed followed by a space.
2075 If the argument is a macro, a hyphen is prefixed to the subsequent macro
2079 .Dl ".Fl R Op Fl H | L | P"
2080 .Dl ".Op Fl 1AaCcdFfgHhikLlmnopqRrSsTtux"
2081 .Dl ".Fl type Cm d Fl name Pa CVS"
2082 .Dl ".Fl Ar signal_number"
2089 Its syntax is as follows:
2090 .Bd -ragged -offset indent
2094 .Op Oo Ar argtype Oc Ar argname
2097 Function arguments are surrounded in parenthesis and
2098 are delimited by commas.
2099 If no arguments are specified, blank parenthesis are output.
2102 section, this macro starts a new output line,
2103 and a blank line is automatically inserted between function definitions.
2106 .Dl \&.Fn \*qint funcname\*q \*qint arg0\*q \*qint arg1\*q
2107 .Dl \&.Fn funcname \*qint arg0\*q
2108 .Dl \&.Fn funcname arg0
2110 .Bd -literal -offset indent -compact
2115 When referring to a function documented in another manual page, use
2119 .Sx MANUAL STRUCTURE ,
2124 Begin a function block.
2125 This is a multi-line version of
2127 Its syntax is as follows:
2129 .D1 Pf \. Sx \&Fo Ar funcname
2131 Invocations usually occur in the following context:
2132 .Bd -ragged -offset indent
2133 .Pf \. Sx \&Ft Ar functype
2135 .Pf \. Sx \&Fo Ar funcname
2137 .Pf \. Sx \&Fa Oo Ar argtype Oc Ar argname
2150 .Sx MANUAL STRUCTURE ,
2156 This macro is obsolete and not implemented in
2159 It was used to show function return values.
2162 .Dl Pf . Sx \&Fr Ar value
2165 Its syntax is as follows:
2167 .D1 Pf \. Sx \&Ft Ar functype
2171 section, a new output line is started after this macro.
2175 .Bd -literal -offset indent -compact
2181 .Sx MANUAL STRUCTURE ,
2188 version provided as an argument, or a default value
2189 if no argument is provided.
2205 This macro is not implemented in
2208 It was used to include the contents of a (header) file literally.
2211 .Dl Pf . Sx \&Hf Ar filename
2213 Designate an internal or interactive command.
2216 but used for instructions rather than values.
2227 is preferred for displaying code; the
2229 macro is used when referring to specific instructions.
2234 When invoked as the first macro on an input line in the
2236 section, the argument is displayed in angle brackets
2239 and a blank line is inserted in front if there is a preceding
2240 function declaration.
2241 This is most often used in section 2, 3, and 9 manual pages.
2244 .Dl \&.In sys/types.h
2247 .Sx MANUAL STRUCTURE .
2250 The syntax of this macro depends on the list type.
2259 have the following syntax:
2261 .D1 Pf \. Sx \&It Ar args
2270 have the following syntax:
2274 with subsequent lines interpreted within the scope of the
2276 until either a closing
2283 list has the following syntax:
2285 .D1 Pf \. Sx \&It Op Cm args
2287 Subsequent lines are interpreted as with
2290 The line arguments correspond to the list's left-hand side; body
2291 arguments correspond to the list's contents.
2295 list is the most complicated.
2296 Its syntax is as follows:
2298 .D1 Pf \. Sx \&It Ar cell Op <TAB> Ar cell ...
2299 .D1 Pf \. Sx \&It Ar cell Op Sx \&Ta Ar cell ...
2301 The arguments consist of one or more lines of text and macros
2302 representing a complete table line.
2303 Cells within the line are delimited by tabs or by the special
2306 The tab cell delimiter may only be used within the
2308 line itself; on following lines, only the
2310 macro can be used to delimit cells, and
2312 is only recognized as a macro when called by other macros,
2313 not as the first macro on a line.
2315 Note that quoted strings may span tab-delimited cells on an
2320 .Dl .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
2322 will preserve the semicolon whitespace except for the last.
2328 The syntax is as follows:
2330 .D1 Pf \. Sx \&Lb Ar library
2334 parameter may be a system library, such as
2338 in which case a small library description is printed next to the linker
2339 invocation; or a custom library, in which case the library name is
2341 This is most commonly used in the
2343 section as described in
2344 .Sx MANUAL STRUCTURE .
2350 Denotes text that should be in a
2353 Note that this is a presentation term and should not be used for
2354 stylistically decorating technical terms.
2356 On terminal output devices, this is often indistinguishable from
2367 Its syntax is as follows:
2369 .D1 Pf \. Sx \&Lk Ar uri Op Ar name
2372 .Dl \&.Lk http://bsd.lv \*qThe BSD.lv Project\*q
2373 .Dl \&.Lk http://bsd.lv
2381 Display a mathematical symbol.
2382 Its syntax is as follows:
2384 .D1 Pf \. Sx \&Ms Ar symbol
2393 Its syntax is as follows:
2395 .D1 Pf \. Sx \&Mt Ar address
2398 .Dl \&.Mt discuss@manpages.bsd.lv
2400 A one line description of the manual's content.
2401 This may only be invoked in the
2403 section subsequent the
2408 .Dl Pf . Sx \&Nd mdoc language reference
2409 .Dl Pf . Sx \&Nd format and display UNIX manuals
2413 macro technically accepts child macros and terminates with a subsequent
2416 Do not assume this behaviour: some
2418 database generators are not smart enough to parse more than the line
2419 arguments and will display macros verbatim.
2424 The name of the manual page, or \(em in particular in section 1, 6,
2425 and 8 pages \(em of an additional command or feature documented in
2427 When first invoked, the
2429 macro expects a single argument, the name of the manual page.
2430 Usually, the first invocation happens in the
2432 section of the page.
2433 The specified name will be remembered and used whenever the macro is
2434 called again without arguments later in the page.
2438 .Sx Block full-implicit
2439 semantics when invoked as the first macro on an input line in the
2441 section; otherwise, it uses ordinary
2446 .Bd -literal -offset indent
2455 of section 2, 3 and 9 manual pages, use the
2459 to mark up the name of the manual page.
2462 Closes the scope of any preceding in-line macro.
2463 When used after physical formatting macros like
2467 switches back to the standard font face and weight.
2468 Can also be used to embed plain text strings in macro lines
2469 using semantic annotation macros.
2472 .Dl ".Em italic , Sy bold , No and roman"
2474 .Bd -literal -offset indent -compact
2476 \&.Cm :C No / Ar pattern No / Ar replacement No /
2486 Suppress a space between the output of the preceding macro
2487 and the following text or macro.
2488 Following invocation, input is interpreted as normal text
2493 This has no effect when invoked at the start of a macro line.
2496 .Dl ".Ar name Ns = Ns Ar value"
2497 .Dl ".Cm :M Ns Ar pattern"
2498 .Dl ".Fl o Ns Ar output"
2507 version provided as an argument, or a default value if
2508 no argument is provided.
2528 Multi-line version of
2532 .Bd -literal -offset indent -compact
2534 \&.Op Fl flag Ns Ar value
2538 Optional part of a command line.
2539 Prints the argument(s) in brackets.
2540 This is most often used in the
2542 section of section 1 and 8 manual pages.
2545 .Dl \&.Op \&Fl a \&Ar b
2546 .Dl \&.Op \&Ar a | b
2551 Document operating system version.
2552 This is the mandatory third macro of
2556 Its syntax is as follows:
2558 .D1 Pf \. Sx \&Os Op Ar system Op Ar version
2562 parameter specifies the relevant operating system or environment.
2563 Left unspecified, it defaults to the local operating system version.
2564 This is the suggested form.
2568 .Dl \&.Os KTH/CSC/TCS
2576 This macro is obsolete and not implemented in
2581 packages described it as
2582 .Dq "old function type (FORTRAN)" .
2586 version provided as an argument, or a default value
2587 if no argument is provided.
2603 An absolute or relative file system path, or a file or directory name.
2604 If an argument is not provided, the character
2606 is used as a default.
2609 .Dl \&.Pa /usr/bin/mandoc
2610 .Dl \&.Pa /usr/share/man/man7/mdoc.7
2615 Close parenthesised context opened by
2618 Removes the space between its argument
2620 and the following macro.
2621 Its syntax is as follows:
2623 .D1 .Pf Ar prefix macro arguments ...
2625 This is equivalent to:
2627 .D1 .No Ar prefix No \&Ns Ar macro arguments ...
2630 .Dl ".Pf $ Ar variable_name"
2631 .Dl ".Pf 0x Ar hex_digits"
2638 Multi-line version of
2642 This will assert vertical space between prior and subsequent macros
2645 Paragraph breaks are not needed before or after
2649 macros or before displays
2657 Parenthesised enclosure.
2662 Close quoted context opened by
2665 Format a single-quoted literal.
2671 Multi-line version of
2674 Encloses its arguments in
2689 Does not have any tail arguments.
2691 Begin a bibliographic
2694 Does not have any head arguments.
2695 The block macro may only contain
2711 child macros (at least one must be specified).
2714 .Bd -literal -offset indent -compact
2716 \&.%A J. E. Hopcroft
2718 \&.%B Introduction to Automata Theory, Languages, and Computation
2719 \&.%I Addison-Wesley
2720 \&.%C Reading, Massachusettes
2727 block is used within a SEE ALSO section, a vertical space is asserted
2728 before the rendered output, else the block continues on the current
2731 Insert a standard sentence regarding a function call's return value of 0
2732 on success and \-1 on error, with the
2734 libc global variable set on error.
2735 Its syntax is as follows:
2737 .D1 Pf \. Sx \&Rv Fl std Op Ar function ...
2741 is not specified, the document's name set by
2746 arguments are treated as separate functions.
2751 Close single-quoted context opened by
2754 Begin a new section.
2755 For a list of conventional manual sections, see
2756 .Sx MANUAL STRUCTURE .
2757 These sections should be used unless it's absolutely necessary that
2758 custom sections be used.
2760 Section names should be unique so that they may be keyed by
2762 Although this macro is parsed, it should not consist of child node or it
2763 may not be linked with
2772 Switches the spacing mode for output generated from macros.
2773 Its syntax is as follows:
2775 .D1 Pf \. Sx \&Sm Cm on | off
2777 By default, spacing is
2781 no white space is inserted between macro arguments and between the
2782 output generated from adjacent macros, but text lines
2783 still get normal spacing between words and sentences.
2785 Multi-line version of
2788 Encloses its arguments in
2798 Begin a new subsection.
2801 there is no convention for the naming of subsections.
2804 the conventional sections described in
2805 .Sx MANUAL STRUCTURE
2806 rarely have subsections.
2808 Sub-section names should be unique so that they may be keyed by
2810 Although this macro is parsed, it should not consist of child node or it
2811 may not be linked with
2820 Replace an abbreviation for a standard with the full form.
2821 The following standards are recognised:
2823 .Bl -tag -width "-p1003.1g-2000X" -compact
2918 Reference a section or subsection in the same manual page.
2919 The referenced section or subsection name must be identical to the
2920 enclosed argument, including whitespace.
2923 .Dl \&.Sx MANUAL STRUCTURE
2930 Format enclosed arguments in symbolic
2932 Note that this is a presentation term and should not be used for
2933 stylistically decorating technical terms.
2942 Table cell separator in
2944 lists; can only be used below
2949 Since this macro is often implemented to use a small caps font,
2950 it has historically been used for acronyms (like ASCII) as well.
2951 Such usage is not recommended because it would use the same macro
2952 sometimes for semantical annotation, sometimes for physical formatting.
2958 .Dq currently under development.
2960 Format the UNIX name.
2961 Accepts no argument.
2980 .Dl \&.Va const char *bar ;
2983 This is also used for indicating global variables in the
2985 section, in which case a variable name is also specified.
2986 Note that it accepts
2987 .Sx Block partial-implicit
2988 syntax when invoked as the first macro on an input line in the
2990 section, else it accepts ordinary
2993 In the former case, this macro starts a new output line,
2994 and a blank line is inserted in front if there is a preceding
2995 function definition or include directive.
2997 Note that this should not be confused with
2999 which is used for function return types.
3002 .Dl \&.Vt unsigned char
3003 .Dl \&.Vt extern const char * const sys_signame[] \&;
3006 .Sx MANUAL STRUCTURE
3010 Close a scope opened by
3013 Extend the header of an
3015 macro or the body of a partial-implicit block macro
3016 beyond the end of the input line.
3017 This macro originally existed to work around the 9-argument limit
3021 Link to another manual
3022 .Pq Qq cross-reference .
3023 Its syntax is as follows:
3025 .D1 Pf \. Sx \&Xr Ar name section
3031 are the name and section of the linked manual.
3034 is followed by non-punctuation, an
3036 is inserted into the token stream.
3037 This behaviour is for compatibility with
3042 .Dl \&.Xr mandoc 1 \&;
3043 .Dl \&.Xr mandoc 1 \&Ns s behaviour
3046 This macro should not be used; it is implemented for compatibility with
3051 in the event of natural paragraph breaks.
3053 Emits vertical space.
3054 This macro should not be used; it is implemented for compatibility with
3056 Its syntax is as follows:
3058 .D1 Pf \. Sx \&sp Op Ar height
3062 argument must be formatted as described in
3063 .Sx Scaling Widths .
3066 asserts a single vertical space.
3068 This section documents compatibility between mandoc and other other
3069 troff implementations, at this time limited to GNU troff
3073 refers to groff versions before 1.17,
3074 which featured a significant update of the
3078 Heirloom troff, the other significant troff implementation accepting
3079 \-mdoc, is similar to historic groff.
3081 The following problematic behaviour is found in groff:
3082 .ds hist (Historic groff only.)
3097 with unknown arguments produces no output at all.
3099 Newer groff and mandoc print
3104 does not recognize trailing punctuation characters when they immediately
3105 precede tabulator characters, but treats them as normal text and
3106 outputs a space before them.
3108 .Sx \&Bd Fl ragged compact
3109 does not start a new line.
3113 with non-standard arguments behaves very strangely.
3114 When there are three arguments, they are printed verbatim.
3115 Any other number of arguments is replaced by the current date,
3116 but without any arguments the string
3121 does not print a dash for an empty argument.
3125 does not start a new line unless invoked as the line macro in the
3133 children causes inconsistent spacing between arguments.
3134 In mandoc, a single space is always inserted between arguments.
3139 causes inconsistent vertical spacing, depending on whether a prior
3146 for the normalised behaviour in mandoc.
3149 ignores additional arguments and is not treated specially in the
3154 sometimes requires a
3158 In new groff and mandoc, any list may be nested by default and
3160 lists will restart the sequence only for the sub-list.
3163 followed by a delimiter is incorrectly used in some manuals
3164 instead of properly quoting that character, which sometimes works with
3168 only accepts a single link-name argument; the remainder is misformatted.
3171 does not format its arguments when used in the FILES section under
3175 can only be called by other macros, but not at the beginning of a line.
3180 Historic groff only allows up to eight or nine arguments per macro input
3181 line, depending on the exact situation.
3182 Providing more arguments causes garbled output.
3183 The number of arguments on one input line is not limited with mandoc.
3185 Historic groff has many un-callable macros.
3186 Most of these (excluding some block-level macros) are callable
3187 in new groff and mandoc.
3190 (vertical bar) is not fully supported as a delimiter.
3197 .Pq font family face
3199 escapes behave irregularly when specified within line-macro scopes.
3201 Negative scaling units return to prior lines.
3202 Instead, mandoc truncates them to zero.
3205 The following features are unimplemented in mandoc:
3213 .Fl offset Ar center
3215 .Fl offset Ar right .
3216 Groff does not implement centered and flush-right rendering either,
3217 but produces large indentations.
3221 .Pq horizontal position ,
3223 .Pq vertical position ,
3227 .Pq text filling colour ,
3229 .Pq zero-length character ,
3233 .Pq horizontal position marker ,
3235 .Pq text overstrike ,
3239 escape sequences are all discarded in mandoc.
3243 scaling unit is accepted by mandoc, but rendered as the default unit.
3245 In quoted literals, groff allows pairwise double-quotes to produce a
3246 standalone double-quote in formatted output.
3247 This is not supported by mandoc.
3260 language first appeared as a troff macro package in
3262 It was later significantly updated by Werner Lemberg and Ruslan Ermilov
3264 The standalone implementation that is part of the
3266 utility written by Kristaps Dzonsons appeared in
3271 reference was written by
3272 .An Kristaps Dzonsons ,
3273 .Mt kristaps@bsd.lv .