3 .\" A complete reference of the mdoc macro package for GNU troff.
5 .\" Based on NetBSD's mdoc.samples.7, version 1.21.
8 .\" Warning: You can't format this file with the old mdoc macros!
11 .\" Copyright (c) 1990, 1993
12 .\" The Regents of the University of California. All rights reserved.
14 .\" Redistribution and use in source and binary forms, with or without
15 .\" modification, are permitted provided that the following conditions
17 .\" 1. Redistributions of source code must retain the above copyright
18 .\" notice, this list of conditions and the following disclaimer.
19 .\" 2. Redistributions in binary form must reproduce the above copyright
20 .\" notice, this list of conditions and the following disclaimer in the
21 .\" documentation and/or other materials provided with the distribution.
22 .\" 3. All advertising materials mentioning features or use of this software
23 .\" must display the following acknowledgement:
24 .\" This product includes software developed by the University of
25 .\" California, Berkeley and its contributors.
26 .\" 4. Neither the name of the University nor the names of its contributors
27 .\" may be used to endorse or promote products derived from this software
28 .\" without specific prior written permission.
30 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
31 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
34 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 .\" @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93
44 .\" This reference invokes every macro in the package several
45 .\" times and is guaranteed to give a worst case performance
46 .\" for an already extremely slow package.
57 .Nd reference for groff's mdoc implementation
62 .Nm groff Fl m Ns Cm doc Ar
67 A complete reference for writing
75 formatting package for
80 package, addressed page layout leaving the manipulation of fonts and other
81 typesetting details to the individual author.
84 page layout macros make up the
85 .Em "page structure domain"
86 which consists of macros for titles, section headers, displays and lists
87 \- essentially items which affect the physical position of text on a
89 In addition to the page structure domain, there are two more domains, the
94 The general text domain is defined as macros which perform tasks such as
95 quoting or emphasizing pieces of text.
96 The manual domain is defined as macros that are a subset of the day to day
97 informal language used to describe commands, routines and related
100 Macros in the manual domain handle command names, command line arguments and
101 options, function names, function parameters, pathnames, variables, cross
102 references to other manual pages, and so on.
103 These domain items have value for both the author and the future user of the
105 It is hoped the consistency gained across the manual set will provide easier
106 translation to future documentation tools.
110 manual pages, a manual entry is simply referred to as a man page, regardless
111 of actual length and without sexist intention.
114 .Sh "GETTING STARTED"
116 The material presented in the remainder of this document is outlined
119 .Bl -enum -width 3n -offset indent
121 . Tn "TROFF IDIOSYNCRASIES"
123 . Bl -tag -width 2n -compact
125 . It "Passing Space Characters in an Argument"
126 . It "Trailing Blank Space Characters"
127 . It "Escaping Special Characters"
128 . It "Other Possible Pitfalls"
132 . Tn "A MANUAL PAGE TEMPLATE"
141 . Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS"
143 . Bl -tag -width 2n -compact
144 . It "What's in a Name" Ns ...
145 . It "General Syntax"
151 . Bl -tag -width 2n -compact
155 . It "Configuration Declarations (Section Four Only)"
156 . It "Command Modifiers"
157 . It "Defined Variables"
159 . It "Environment Variables"
161 . It "Function Declarations"
162 . It "Function Types"
163 . It "Functions (Library Routines)"
164 . It "Function Arguments"
167 . \" .It "Header File (including source code)"
168 . It "Interactive Commands"
175 . It "Variable Types"
177 . It "Manual Page Cross References"
181 . Tn "GENERAL TEXT DOMAIN"
183 . Bl -tag -width 2n -compact
191 . It "Emphasis Macro"
193 . It "Enclosure and Quoting Macros"
194 . It "No-Op or Normal Text Macro"
195 . It "No-Space Macro"
196 . It "Section Cross References"
198 . It "Mathematical Symbols"
199 . It "References and Citations"
200 . It "Trade Names (or Acronyms and Type Names)"
201 . It "Extended Arguments"
205 . Tn "PAGE STRUCTURE DOMAIN"
207 . Bl -tag -width 2n -compact
208 . It "Section Headers"
209 . It "Subsection Headers"
210 . It "Paragraphs and Line Spacing"
212 . It "Examples and Displays"
213 . It "Lists and Columns"
217 . Tn "MISCELLANEOUS MACROS"
220 . Tn "PREDEFINED STRINGS"
226 . Tn "FORMATTING WITH GROFF, TROFF, AND NROFF"
243 .Sh "TROFF IDIOSYNCRASIES"
247 package attempts to simplify the process of writing a man page.
248 Theoretically, one should not have to learn the dirty details of
253 however, there are a few limitations which are unavoidable and best gotten
255 And, too, be forewarned, this package is
264 a macro is called by placing a
266 (dot character) at the beginning of a line followed by the two-character
267 (or three-character) name for the macro.
268 There can be space characters between the dot and the macro name (but
271 Arguments may follow the macro separated by spaces (again, no tabs).
272 It is the dot character at the beginning of the line which causes
275 to interpret the next two (or more) characters as a macro name.
276 A single starting dot followed by nothing is ignored.
279 (dot character) at the beginning of an input line in some context other than
280 a macro invocation, precede the
287 translates literally to a zero-width space, and is never displayed in
293 macros accept an unlimited number of arguments (contrary to other versions
294 of troff which can't handle more than nine arguments).
295 In limited cases, arguments may be continued or extended on the next
297 .Sx Extended Arguments
299 Almost all macros handle quoted arguments (see
300 .Sx Passing Space Characters in an Argument
305 general text domain and manual domain macros are special in that their
308 for callable macro names.
309 This means an argument on the argument list which matches a general text or
310 manual domain macro name and is determined to be callable will be executed
311 or called when it is processed.
312 In this case the argument, although the name of a macro, is not preceded by
316 It is in this manner that many macros are nested; for example the
321 the flag and argument macros,
325 to specify an optional flag with an argument:
327 .Bl -tag -width ".Op Fl s Ar bytes" -offset indent
330 .Ql ".Op Fl s Ar bytes"
334 To prevent a string from being interpreted as a macro name, precede the
335 string with the escape sequence
338 .Bl -tag -width ".Op \&Fl s \&Ar bytes" -offset indent
339 .It Op \&Fl s \&Ar bytes
341 .Ql ".Op \e&Fl s \e&Ar bytes"
349 are not interpreted as macros.
350 Macros whose argument lists are parsed for callable arguments are referred
353 and macros which may be called from an argument list are referred to as
355 throughout this document.
358 as almost all of the macros in
360 are parsed, but as it was cumbersome to constantly refer to macros as
361 being callable and being able to call other macros, the term parsed
364 .Ss "Passing Space Characters in an Argument"
366 Sometimes it is desirable to give as an argument a string containing one or
367 more blank space characters.
368 This may be necessary to specify arguments to macros which expect particular
369 arrangement of items in the argument list. Additionally, it makes
372 For example, the function macro
374 expects the first argument to be the name of a function and any remaining
375 arguments to be function parameters.
378 stipulates the declaration of function parameters in the parenthesized
379 parameter list, each parameter is guaranteed to be at minimum a two word
384 There are two possible ways to pass an argument which contains
386 One way of passing a string containing blank spaces is to use the hard or
387 unpaddable space character
389 that is, a blank space preceded by the escape character
391 This method may be used with any macro but has the side effect of
392 interfering with the adjustment of text over the length of a line.
394 sees the hard space as if it were any other printable character and cannot
395 split the string into blank or newline separated pieces as one would expect.
396 This method is useful for strings which are not expected to overlap a line
398 An alternative is to use
400 a paddable (i.e.\& stretchable), unbreakable space (this is a
404 The second method is to enclose the string with double quotes.
408 .Bl -tag -width ".Fn fetch char\ *str" -offset indent
409 .It Fn fetch char\ *str
411 .Ql ".Fn fetch char\e *str"
412 .It Fn fetch "char *str"
413 can also be created by
414 .Ql ".Fn fetch \*[q]char *str\*[q]"
420 before the space in the first example
421 or double quotes in the second example
424 would see three arguments, and the result would be:
426 .Dl Fn fetch char *str
428 .\" For an example of what happens when the parameter list overlaps a newline
429 .\" boundary, see the
433 .Ss "Trailing Blank Space Characters"
436 can be confused by blank space characters at the end of a line.
437 It is a wise preventive measure to globally remove all blank spaces
439 .Ao blank-space Ac Ns Ao end-of-line Ac
441 Should the need arise to force a blank character at the end of a line, it
442 may be forced with an unpaddable space and the
448 .Ss "Escaping Special Characters"
450 Special characters like the newline character
452 are handled by replacing the
458 to preserve the backslash.
460 .Ss "Other Possible Pitfalls"
462 A warning is emitted when an empty input line is found outside of displays
467 (Well, it is even better to use
469 macros to avoid the usage of low-level commands.)
471 Leading spaces will cause a break and are output directly.
472 Avoid this behaviour if possible.
473 Similarly, do not use more than one space character between words in an
474 ordinary text line; contrary to other text formatters, they are
476 replaced with a single space.
480 directly as an argument.
489 inserts two space characters after a punctuation mark closing a sentence;
494 are treated transparently, not influencing the sentence-ending behaviour.
495 To change this, insert
497 before or after the dot:
499 .Bd -literal -offset indent
518 .Bd -filled -offset indent
535 As can be seen in the first and third line,
537 handles punctuation characters specially in macro arguments.
538 This will be explained in section
541 In the same way, you have to protect trailing full stops of abbreviations
542 with a trailing zero-width space:
545 A comment in the source file of a man page can be either started with
551 anywhere (the latter is a
554 extension); the rest of such a line is ignored.
557 .Sh "A MANUAL PAGE TEMPLATE"
559 The body of a man page is easily constructed from a basic template:
561 .Bd -literal -offset indent
562 \&.\e" The following requests are required for all man pages.
563 \&.Dd Month day, year
564 \&.Os [OPERATING_SYSTEM] [version/release]
565 \&.Dt DOCUMENT_TITLE [section number] [architecture/volume]
568 \&.Nd one line description of name
569 \&.\e" This next request is for sections 2 and 3 only.
573 \&.\e" The following requests should be uncommented and
574 \&.\e" used where appropriate.
575 \&.\e" .Sh IMPLEMENTATION NOTES
576 \&.\e" This next request is for sections 2, 3 and 9 function
577 \&.\e" return values only.
578 \&.\e" .Sh RETURN VALUES
579 \&.\e" This next request is for sections 1, 6, 7 and 8 only.
580 \&.\e" .Sh ENVIRONMENT
583 \&.\e" This next request is for sections 1, 6, 7, 8 and 9 only
584 \&.\e" (command return values (to shell) and
585 \&.\e" fprintf/stderr type diagnostics).
586 \&.\e" .Sh DIAGNOSTICS
587 \&.\e" .Sh COMPATIBILITY
588 \&.\e" This next request is for sections 2, 3 and 9 error
589 \&.\e" and signal handling only.
599 The first items in the template are the macros
604 the document date, the operating system the man page or subject source is
605 developed or modified for, and the man page title (in
607 along with the section of the manual the page belongs in.
608 These macros identify the page and are discussed below in
611 The remaining items in the template are section headers
619 The headers are discussed in
620 .Sx "PAGE STRUCTURE DOMAIN" ,
621 after presentation of
622 .Sx "MANUAL DOMAIN" .
623 Several content macros are used to demonstrate page layout macros; reading
624 about content macros before page layout macros is recommended.
629 In the description of all macros below, optional arguments are put into
633 represents zero or more additional arguments.
634 Alternative values for a parameter are separated with
636 If there are alternative values for a mandatory parameter, braces are used
639 to enclose the value set.
640 Meta-variables are specified within angles.
644 .Bl -tag -width 6n -offset indent
648 .Op \-test1 Op \-test2 | \-test3
654 Except stated explicitly, all macros are parsed and callable.
656 Most macros have a default width value which can be used to specify a label
666 It is recommended not to use this rather obscure feature to avoid
667 dependencies on local modifications of the
674 The title macros are part of the page structure domain but are presented
675 first and separately for someone who wishes to start writing a man page
677 Three header macros designate the document title or manual page title, the
678 operating system, and the date of authorship.
679 These macros are called once at the very beginning of the document and are
680 used to construct headers and footers only.
684 .Op Aq document title
685 .Op Aq section number
688 The document title is the subject of the man page and must be in
690 due to troff limitations.
694 The section number may be a number in the range
695 .No 1,\~ Ns ... Ns ,\~9
701 If it is specified, and no volume name is given, a default volume name is
706 .Tn \*[operating-system] ,
707 the following sections are defined:
709 .Bl -column LOCAL -offset indent -compact
710 .It Li 1 Ta "\*[volume-operating-system] \*[volume-ds-1]"
711 .It Li 2 Ta "\*[volume-operating-system] \*[volume-ds-2]"
712 .It Li 3 Ta "\*[volume-operating-system] \*[volume-ds-3]"
713 .It Li 4 Ta "\*[volume-operating-system] \*[volume-ds-4]"
714 .It Li 5 Ta "\*[volume-operating-system] \*[volume-ds-5]"
715 .It Li 6 Ta "\*[volume-operating-system] \*[volume-ds-6]"
716 .It Li 7 Ta "\*[volume-operating-system] \*[volume-ds-7]"
717 .It Li 8 Ta "\*[volume-operating-system] \*[volume-ds-8]"
718 .It Li 9 Ta "\*[volume-operating-system] \*[volume-ds-9]"
722 A volume name may be arbitrary or one of the following:
725 .Bl -column LOCAL -offset indent -compact
726 .It Li USD Ta "\*[volume-ds-USD]"
727 .It Li PS1 Ta "\*[volume-ds-PS1]"
728 .It Li AMD Ta "\*[volume-ds-AMD]"
729 .It Li SMM Ta "\*[volume-ds-SMM]"
730 .It Li URM Ta "\*[volume-ds-URM]"
731 .It Li PRM Ta "\*[volume-ds-PRM]"
732 .It Li KM Ta "\*[volume-ds-KM]"
733 .It Li IND Ta "\*[volume-ds-IND]"
734 .It Li LOCAL Ta "\*[volume-ds-LOCAL]"
735 .It Li CON Ta "\*[volume-ds-CON]"
747 Values from the previous table will specify a new volume name.
748 If the third parameter is a keyword designating a computer architecture,
749 its value is prepended to the default volume name as specified by the
751 By default, the following architecture keywords are defined:
753 \# we use `No' to avoid hyphenation
754 .Bd -ragged -offset indent
755 .No alpha , amiga , arc , arm26 , arm32 , atari , bebox , cobalt , evbsh3 ,
756 .No hp300 , hpcmips , i386 , luna68k , m68k , mac68k , macppc , mips ,
757 .No mmeye , mvme68k , news68k , newsmips , next68k , ofppc , pc532 , pmax ,
758 .No powerpc , prep , sgimips , sh3 , sparc , sparc64 , sun3 , tahoe , vax ,
763 In the following examples, the left (which is identical to the right) and
764 the middle part of the manual page header strings are shown.
767 .Bl -tag -width ".Li .Dt\ FOO\ 2\ i386" -compact -offset indent
770 .Ql \*[volume-operating-system] \*[volume-ds-7]
771 .It Li ".Dt FOO 2 i386"
773 .Ql \*[volume-operating-system]/\*[volume-as-i386] \*[volume-ds-2]
774 .It Li ".Dt FOO \*[q]\*[q] bar"
781 Local, OS-specific additions might be found in the file
783 look for strings named
785 (for the former type) and
787 (for the latter type);
789 then denotes the keyword to be used with the
793 This macro is neither callable nor parsed.
796 .Op Aq operating system
799 If the first parameter is empty,
801 .Sq Tn "\*[operating-system]"
803 This may be overridden in the local configuration file,
805 In general, the name of the operating system should be the common acronym,
810 The release should be the standard release nomenclature for the system
812 In the following table, the possible second arguments for some predefined
813 operating systems are listed.
816 local additions might be defined in
818 look for strings named
819 .Ql operating-system-XXX-YYY ,
822 is the acronym for the operating system and
827 .Bl -tag -width ".No FreeBSD" -offset indent
829 7th, 7, III, 3, V, V.2, V.3, V.4
831 3, 4, 4.1, 4.2, 4.3, 4.3t, 4.3T, 4.3r, 4.3R, 4.4
833 0.8, 0.8a, 0.9, 0.9a, 1.0, 1.0a, 1.1, 1.2, 1.2a, 1.2b, 1.2c, 1.2d, 1.2e,
834 1.3, 1.3a, 1.4, 1.5, 1.6
836 1.0, 1.1, 1.1.5, 1.1.5.1, 2.0, 2.0.5, 2.1, 2.1.5, 2.1.6, 2.1.7, 2.2, 2.2.1,
837 2.2.2, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1,
838 4.2, 4.3, 4.4, 4.5, 5.0
845 an unknown second parameter will be replaced with the string
847 for the other predefined acronyms it will be ignored and a warning message
849 Unrecognized arguments are displayed as given in the page footer.
850 For instance, a typical footer might be:
855 .Ql 4.3\~Berkeley Distribution ,
856 or for a locally produced set
858 .Dl .Os CS Department
865 macro is not present, the bottom left corner of the manual page will be
868 This macro is neither callable nor parsed.
879 is used for the date string.
880 If it has exactly three arguments, they are concatenated, separated with
883 .Dl .Dd January 25, 2001
885 Otherwise, the current date is used, ignoring the parameters.
887 This macro is neither callable nor parsed.
891 .Sh "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS"
893 .Ss "What's in a Name" Ns ...
895 The manual domain macro names are derived from the day to day informal
896 language used to describe commands, subroutines and related files.
897 Slightly different variations of this language are used to describe the
898 three different aspects of writing a man page.
899 First, there is the description of
902 Second is the description of a
907 macros, and third, the description of a command to a user in the verbal
908 sense; that is, discussion of a command in the text of a man page.
912 macros are themselves a type of command; the general syntax for a troff
915 .Bd -filled -offset indent
916 .Li ".Xx argument1 argument2" ...
921 is a macro command or request, and anything following it are arguments to
923 In the second case, the description of a
925 command using the content macros is a bit more involved; a typical
927 command line might be displayed as:
929 .Bd -filled -offset indent
932 .Ao Ar infile Ac Ao Ar outfile Ac
938 is the command name and the
943 argument designated as optional by the option brackets.
952 in this example, the user has to replace the meta expressions given in angle
953 brackets with real file names.
954 Note that in this document meta arguments are used to describe
956 commands; in most man pages, meta variables are not specifically written
958 The macros which formatted the above example:
960 .Bd -literal -offset indent
963 \&.Ao Ar infile Ac Ao Ar outfile Ac
967 In the third case, discussion of commands and command syntax includes both
968 examples above, but may add more detail.
973 from the example above might be referred to as
977 Some command line argument lists are quite long:
980 .Bl -tag -width ".Nm make" -offset indent -compact
986 .Op Fl I Ar directory
988 .Op Ar variable Ns = Ns Ar value
996 Here one might talk about the command
998 and qualify the argument,
1000 as an argument to the flag,
1002 or discuss the optional file operand
1004 In the verbal context, such detail can prevent confusion, however the
1006 package does not have a macro for an argument
1011 argument macro is used for an operand or file argument like
1013 as well as an argument to a flag like
1015 The make command line was produced from:
1017 .Bd -literal -offset indent
1020 \&.Op Fl D Ar variable
1022 \&.Op Fl f Ar makefile
1023 \&.Op Fl I Ar directory
1024 \&.Op Fl j Ar max_jobs
1025 \&.Op Ar variable Ns = Ns Ar value
1036 macros are explained in
1039 .Ss "General Syntax"
1041 The manual domain and general text domain macros share a similar syntax with
1042 a few minor deviations; most notably,
1048 differ only when called without arguments; and
1052 impose an order on their argument lists.
1053 All content macros are capable of recognizing and properly handling
1054 punctuation, provided each punctuation character is separated by a leading
1056 If a request is given:
1058 .Dl \&.Ar sptr, ptr),
1064 The punctuation is not recognized and all is output in the
1067 If the punctuation is separated by a leading white space:
1069 .Dl \&.Ar "sptr , ptr ) ,"
1073 .Dl Ar sptr , ptr ) ,
1075 The punctuation is now recognized and output in the default font
1076 distinguishing it from the argument strings.
1077 To remove the special meaning from a punctuation character escape it with
1081 is limited as a macro language, and has difficulty when presented with a
1082 string containing a member of the mathematical, logical or quotation set:
1084 .Bd -literal -offset indent-two
1085 {+,\-,/,*,%,<,>,<=,>=,=,==,&,`,',"}
1091 may assume it is supposed to actually perform the operation or evaluation
1092 suggested by the characters.
1093 To prevent the accidental evaluation of these characters, escape them with
1095 Typical syntax is shown in the first content macro displayed below,
1103 The address macro identifies an address construct.
1105 .Dl Usage: .Ad Ao address Ac ...
1107 .Bl -tag -width ".Li .Ad\ f1\ ,\ f2\ ,\ f3\ :" -compact -offset 15n
1110 .It Li ".Ad addr1 ."
1112 .It Li ".Ad addr1 , file2"
1114 .It Li ".Ad f1 , f2 , f3 :"
1116 .It Li ".Ad addr ) ) ,"
1121 The default width is 12n.
1127 macro is used to specify the name of the author of the item being
1128 documented, or the name of the author of the actual manual page.
1130 .Dl Usage: .An Ao author name Ac ...
1132 .Bl -tag -width ".Li .An\ \*[q]Joe\ Author\*[q]\ )\ )\ ," -offset 15n
1133 .It Li ".An \*[q]Joe Author\*[q]"
1135 .It Li ".An \*[q]Joe Author\*[q] ,"
1137 .It Li ".An \*[q]Joe Author\*[q] Aq nobody@FreeBSD.org"
1138 .An "Joe Author" Aq nobody@FreeBSD.org
1139 .It Li ".An \*[q]Joe Author\*[q] ) ) ,"
1140 .An "Joe Author" ) ) ,
1144 The default width is 12n.
1150 request causes a line break allowing each new name to appear on its own
1152 If this is not desirable,
1154 .Bd -literal -offset indent
1159 call will turn this off.
1160 To turn splitting back on, write
1162 .Bd -literal -offset indent
1170 argument macro may be used whenever an argument is referenced.
1171 If called without arguments, the
1175 .Dl Usage: .Ar Oo Ao argument Ac Oc ...
1177 .Bl -tag -width ".Li .Ar\ file1\ file2" -compact -offset 15n
1182 .It Li ".Ar file1 ."
1184 .It Li ".Ar file1 file2"
1186 .It Li ".Ar f1 f2 f3 :"
1188 .It Li ".Ar file ) ) ,"
1193 The default width is 12n.
1195 .Ss "Configuration Declaration (Section Four Only)"
1199 macro is used to demonstrate a
1201 declaration for a device interface in a section four manual.
1203 .Dl Usage: .Cd Ao argument Ac ...
1205 .Bl -tag -width ".Li .Cd\ Xdevice\ le0\ at\ scode?X" -offset 15n
1206 .It Li ".Cd \*[q]device le0 at scode?\*[q]"
1207 .Cd "device le0 at scode?"
1214 request causes a line break before and after its arguments are printed.
1217 The default width is 12n.
1219 .Ss "Command Modifiers"
1221 The command modifier is identical to the
1223 (flag) command with the exception that the
1225 macro does not assert a dash in front of every argument.
1226 Traditionally flags are marked by the preceding dash, however, some commands
1227 or subsets of commands do not use them.
1228 Command modifiers may also be specified in conjunction with interactive
1229 commands such as editor commands.
1233 The default width is 10n.
1235 .Ss "Defined Variables"
1237 A variable (or constant) which is defined in an include file
1238 is specified by the macro
1241 .Dl Usage: .Dv Ao defined variable Ac ...
1243 .Bl -tag -width ".Li .Dv\ MAXHOSTNAMELEN" -compact -offset 15n
1244 .It Li ".Dv MAXHOSTNAMELEN"
1246 .It Li ".Dv TIOCGPGRP )"
1251 The default width is 12n.
1257 errno macro specifies the error return value for section 2, 3, and\~9 library
1259 The second example below shows
1263 general text domain macro, as it would be used in a section two manual page.
1265 .Dl Usage: .Er Ao errno type Ac ...
1267 .Bl -tag -width ".Li .Bq\ Er\ ENOTDIR" -compact -offset 15n
1270 .It Li ".Er ENOENT ) ;"
1272 .It Li ".Bq Er ENOTDIR"
1277 The default width is 17n.
1279 .Ss "Environment Variables"
1283 macro specifies an environment variable.
1285 .Dl Usage: .Ev Ao argument Ac ...
1287 .Bl -tag -width ".Li .Ev\ PRINTER\ )\ )\ ," -compact -offset 15n
1288 .It Li ".Ev DISPLAY"
1292 .It Li ".Ev PRINTER ) ) ,"
1297 The default width is 15n.
1303 macro handles command line flags.
1307 For interactive command flags, which are not prepended with a dash, the
1310 macro is identical, but without the dash.
1312 .Dl Usage: .Fl Ao argument Ac ...
1314 .Bl -tag -width ".Li .Fl\ xyz\ )\ ," -compact -offset 15n
1327 .It Li ".Fl xyz ) ,"
1335 macro without any arguments results in a dash representing stdin/stdout.
1338 a single dash will result in two dashes.
1340 The default width is 12n.
1342 .Ss "Function Declarations"
1346 macro is used in the
1348 section with section two or three functions.
1349 It is neither callable nor parsed.
1351 .Dl Usage: .Fd Ao argument Ac ...
1353 .Bl -tag -width ".Li .Fd\ X#include\ <sys/types.h>X" -compact -offset 15n
1354 .It Li ".Fd \*[q]#include <sys/types.h>\*[q]"
1355 .Fd "#include <sys/types.h>"
1362 request causes a line break if a function has already been presented and a
1363 break has not occurred.
1364 This leaves a nice vertical space in between the previous function call and
1365 the declaration for the next function.
1372 macro is the short form of the above example.
1373 It specifies the C\~header file as being included in a C\~program.
1374 It also causes a line break, and is neither callable nor parsed.
1376 .Dl Usage: .In Ao header file Ac
1378 .Bl -tag -width ".Li .In\ stdio.h" -compact -offset 15n
1379 .It Li ".In stdio.h"
1383 .Ss "Function Types"
1385 This macro is intended for the
1388 It may be used anywhere else in the man page without problems, but its main
1389 purpose is to present the function type in kernel normal form for the
1391 of sections two and three (it causes a line break, allowing the function
1392 name to appear on the next line).
1394 .Dl Usage: .Ft Ao type Ac ...
1396 .Bl -tag -width ".Li .Ft\ struct\ stat" -compact -offset 15n
1397 .It Li ".Ft struct stat"
1401 .Ss "Functions (Library Routines)"
1409 .Dl Usage: .Fn Ao function Ac Oo Ao parameter Ac Oc ...
1411 .Bl -tag -width ".Li .Fn\ align\ Xchar\ *ptrX\ ," -compact -offset 15n
1412 .It Li ".Fn getchar"
1414 .It Li ".Fn strlen ) ,"
1416 .It Li ".Fn align \*[q]char *ptr\*[q] ,"
1417 .Fn align "char *ptr" ,
1420 Note that any call to another macro signals the end of the
1422 call (it will insert a closing parenthesis at that point).
1424 For functions with many parameters (which is rare), the macros
1432 (function argument).
1436 .Bd -literal -offset indent
1445 \&.Fa "struct rrec *newrr"
1454 .Bd -ragged -offset indent
1463 .Fa "struct rrec *newrr"
1472 section, the function will always begin at the beginning of line.
1473 If there is more than one function presented in the
1475 section and a function type has not been given, a line break will occur,
1476 leaving a nice vertical space between the current function name and the one
1479 The default width values of
1483 are 12n and 16n, respectively.
1485 .Ss "Function Arguments"
1489 macro is used to refer to function arguments (parameters) outside of the
1491 section of the manual or inside the
1493 section if the enclosure macros
1501 may also be used to refer to structure members.
1503 .Dl Usage: .Fa Ao function argument Ac ...
1505 .Bl -tag -width ".Li .Fa\ d_namlen\ )\ )\ ," -compact -offset 15n
1506 .It Li ".Fa d_namlen ) ) ,"
1508 .It Li ".Fa iov_len"
1513 The default width is 12n.
1519 macro generates text for use in the
1523 .Dl Usage: .Rv Oo -std Oc Op Ao function Ac ...
1526 .Ql ".Rv -std atexit"
1529 .Bd -ragged -offset -indent
1530 \# a small hack to suppress a warning message
1531 .ds section-old "\*[section]
1534 .ds section "\*[section-old]
1540 option is valid only for manual page sections\~2 and\~3.
1541 Currently, this macro does nothing if used without the
1549 macro generates text for use in the
1553 .Dl Usage: .Ex Oo -std Oc Op Ao utility Ac ...
1559 .Bd -ragged -offset -indent
1560 \# a small hack to suppress a warning message
1561 .ds section-old "\*[section]
1564 .ds section "\*[section-old]
1570 option is valid only for manual page sections 1, 6 and\~8.
1571 Currently, this macro does nothing if used without the
1575 .Ss "Interactive Commands"
1579 macro designates an interactive or internal command.
1581 .Dl Usage: .Ic Ao argument Ac ...
1583 .Bl -tag -width ".Li .Ic\ setenv\ ,\ unsetenv" -compact -offset 15n
1586 .It Li ".Ic \*[q]do while {...}\*[q]"
1587 .Ic "do while {...}"
1588 .It Li ".Ic setenv , unsetenv"
1589 .Ic setenv , unsetenv
1593 The default width is 12n.
1599 macro is used to specify the library where a particular function is compiled
1602 .Dl Usage: .Lb Ao argument Ac ...
1604 Available arguments to
1606 and their results are:
1609 .Bl -tag -width ".Li libossaudio" -compact -offset indent
1647 Local, OS-specific additions might be found in the file
1649 look for strings named
1652 then denotes the keyword to be used with the
1660 literal macro may be used for special characters, variable constants, etc.\&
1661 -- anything which should be displayed as it would be typed.
1663 .Dl Usage: .Li Ao argument Ac ...
1665 .Bl -tag -width ".Li .Li\ cntrl-D\ )\ ," -compact -offset 15n
1668 .It Li ".Li M1 M2 M3 ;"
1670 .It Li ".Li cntrl-D ) ,"
1672 .It Li ".Li 1024 ..."
1677 The default width is 16n.
1683 macro is used for the document title or subject name.
1684 It has the peculiarity of remembering the first argument it was called with,
1685 which should always be the subject name of the page.
1686 When called without arguments,
1688 regurgitates this initial name for the sole purpose of making less work for
1690 Note: A section two or three document function name is addressed with the
1698 and remaining sections.
1699 For interactive commands, such as the
1705 macro should be used.
1711 it can not recall the first argument it was invoked with.
1713 .Dl Usage: .Nm Oo Ao argument Ac Oc ...
1715 .Bl -tag -width ".Li .Nm\ groff_mdoc" -compact -offset 15n
1716 .It Li ".Nm groff_mdoc"
1718 .It Li ".Nm \e-mdoc"
1720 .It Li ".Nm foo ) ) ,"
1727 The default width is 10n.
1733 macro places option brackets around any remaining arguments on the
1734 command line, and places any trailing punctuation outside the brackets.
1739 (which produce an opening and a closing option bracket respectively) may be used
1740 across one or more lines or to specify the exact position of the closing
1743 .Dl Usage: .Op Oo Ao option Ac Oc ...
1745 .Bl -tag -width ".Li .Op\ Fl\ c\ Ar\ objfil\ Op\ Ar\ corfil\ ," -compact -offset 15n
1750 .It Li ".Op Fl k ) ."
1752 .It Li ".Op Fl k Ar kookfile"
1753 .Op Fl k Ar kookfile
1754 .It Li ".Op Fl k Ar kookfile ,"
1755 .Op Fl k Ar kookfile ,
1756 .It Li ".Op Ar objfil Op Ar corfil"
1757 .Op Ar objfil Op Ar corfil
1758 .It Li ".Op Fl c Ar objfil Op Ar corfil ,"
1759 .Op Fl c Ar objfil Op Ar corfil ,
1760 .It Li ".Op word1 word2"
1762 .It Li ".Li .Op Oo Ao option Ac Oc ..."
1763 .Li .Op Oo Ao options Ac Oc ...
1766 Here a typical example of the
1772 .Bd -literal -offset indent
1774 \&.Op Fl k Ar kilobytes
1775 \&.Op Fl i Ar interval
1783 .Bd -filled -offset indent
1785 .Op Fl k Ar kilobytes
1786 .Op Fl i Ar interval
1792 The default width values of
1796 are 14n and 10n, respectively.
1802 macro formats path or file names.
1803 If called without arguments, the
1805 string is output, which represents the current user's home directory.
1807 .Dl Usage: .Pa Oo Ao pathname Ac Oc ...
1809 .Bl -tag -width ".Li .Pa\ /tmp/fooXXXXX\ )\ ." -compact -offset 15n
1812 .It Li ".Pa /usr/share"
1814 .It Li ".Pa /tmp/fooXXXXX ) ."
1815 .Pa /tmp/fooXXXXX ) .
1819 The default width is 32n.
1825 macro replaces standard abbreviations with their formal names.
1827 .Dl Usage: .St Ao abbreviation Ac ...
1830 .Dq Abbreviation/Formal Name
1836 .Bl -tag -width ".Li -iso9945-1-90" -compact -offset indent
1851 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1852 .It Li -iso9945-1-90
1854 .It Li -iso9945-1-96
1868 .It Li -p1003.1g-2000
1876 Part 2: Shell and Utilities
1878 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1879 .It Li -iso9945-2-93
1891 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1920 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1927 .Ss "Variable Types"
1931 macro may be used whenever a type is referenced.
1934 section, it causes a line break (useful for old style variable declarations).
1936 .Dl Usage: .Vt Ao type Ac ...
1938 .Bl -tag -width ".Li .Vt\ extern\ char\ *optarg\ ;" -compact -offset 15n
1939 .It Li ".Vt extern char *optarg ;"
1940 .Vt extern char *optarg ;
1947 Generic variable reference.
1949 .Dl Usage: .Va Ao variable Ac ...
1951 .Bl -tag -width ".Li .Va\ Xchar\ sX\ ]\ )\ )\ ," -compact -offset 15n
1954 .It Li ".Va settimer ,"
1956 .It Li ".Va \*[q]int *prt\*[q] ) :"
1958 .It Li ".Va \*[q]char s\*[q] ] ) ) ,"
1959 .Va "char s" ] ) ) ,
1963 The default width is 12n.
1965 .Ss "Manual Page Cross References"
1969 macro expects the first argument to be a manual page name.
1970 The optional second argument, if a string (defining the manual section), is
1971 put into parentheses.
1973 .Dl Usage: .Xr Ao man page name Ac Oo Ao section Ac Oc ...
1975 .Bl -tag -width ".Li .Xr\ xinit\ 1x\ ;" -compact -offset 15n
1982 .It Li ".Xr xinit 1x ;"
1987 The default width is 10n.
1990 .Sh "GENERAL TEXT DOMAIN"
1995 .Dl Usage: .At Oo Ao version Ac Oc ...
1997 .Bl -tag -width ".Li .At\ v6\ ." -compact -offset 15n
2004 The following values for
2008 .Dl 32v, v1, v2, v3, v4, v5, v6, v7, V, V.1, V.2, V.3, V.4
2013 .Dl "Usage: .Bx" Bro -alpha | -beta | -devel Brc ...
2014 .Dl " .Bx" Oo Ao version Ac Oo Ao release Ac Oc Oc ...
2016 .Bl -tag -width ".Li .Bx\ -devel" -compact -offset 15n
2021 .It Li ".Bx \-devel"
2026 will be prepended to the string
2028 The following values for
2032 .Dl Reno, reno, Tahoe, tahoe, Lite, lite, Lite2, lite2
2037 .Dl Usage: .Nx Oo Ao version Ac Oc ...
2039 .Bl -tag -width ".Li .Nx\ 1.4\ ." -compact -offset 15n
2046 For possible values of
2048 see the description of the
2050 request above in section
2051 .Sx "TITLE MACROS" .
2056 .Dl Usage: .Fx Oo Ao version Ac Oc ...
2058 .Bl -tag -width ".Li .Fx\ 2.2\ ." -compact -offset 15n
2065 For possible values of
2067 see the description of the
2069 request above in section
2070 .Sx "TITLE MACROS" .
2075 .Dl Usage: .Ox Oo Ao version Ac Oc ...
2077 .Bl -tag -width ".Li .Ox\ 1.0" -compact -offset 15n
2085 .Dl Usage: .Bsx Oo Ao version Ac Oc ...
2087 .Bl -tag -width ".Li .Bsx\ 1.0" -compact -offset 15n
2097 .Bl -tag -width ".Li .Ux" -compact -offset 15n
2102 .Ss "Emphasis Macro"
2104 Text may be stressed or emphasized with the
2107 The usual font for emphasis is italic.
2109 .Dl Usage: .Em Ao argument Ac ...
2111 .Bl -tag -width ".Li .Em\ vide\ infra\ )\ )\ ," -compact -offset 15n
2112 .It Li ".Em does not"
2114 .It Li ".Em exceed 1024 ."
2116 .It Li ".Em vide infra ) ) ,"
2117 .Em vide infra ) ) ,
2121 The default width is 10n.
2127 font mode must be ended with the
2129 macro (the latter takes no arguments).
2130 Font modes may be nested within other font modes.
2133 has the following syntax:
2135 .Dl .Bf Ao font mode Ac
2138 must be one of the following three types:
2140 .Bl -tag -width ".Sy \&Sy | Fl symbolic" -compact -offset indent
2141 .It Sy \&Em | Fl emphasis
2144 macro was used for the entire block of text.
2145 .It Sy \&Li | Fl literal
2148 macro was used for the entire block of text.
2149 .It Sy \&Sy | Fl symbolic
2152 macro was used for the entire block of text.
2155 Both macros are neither callable nor parsed.
2157 .Ss "Enclosure and Quoting Macros"
2159 The concept of enclosure is similar to quoting.
2160 The object being to enclose one or more strings between a pair of characters
2161 like quotes or parentheses.
2162 The terms quoting and enclosure are used interchangeably throughout this
2164 Most of the one-line enclosure macros end in small letter
2166 to give a hint of quoting, but there are a few irregularities.
2167 For each enclosure macro there is also a pair of open and close macros which
2168 end in small letters
2178 .Bd -filled -offset 4n
2179 .Bl -column "quote" "close" "open" "Angle Bracket Enclosure" "`string' or string"
2180 .Em Quote Ta Em Open Ta Em Close Ta Em Function Ta Em Result
2181 .No .Aq Ta .Ao Ta .Ac Ta "Angle Bracket Enclosure" Ta Ao string Ac
2182 .No .Bq Ta .Bo Ta .Bc Ta "Bracket Enclosure" Ta Bo string Bc
2183 .No .Brq Ta .Bro Ta .Brc Ta "Brace Enclosure" Ta Bro string Brc
2184 .No .Dq Ta .Do Ta .Dc Ta "Double Quote" Ta Do string Dc
2185 .No .Eq Ta .Eo Ta .Ec Ta "Enclose String (in XX)" Ta XXstringXX
2186 .No .Pq Ta .Po Ta .Pc Ta "Parenthesis Enclosure" Ta Po string Pc
2187 .No .Ql Ta Ta Ta "Quoted Literal" Ta So string Sc or Li string
2188 .No .Qq Ta .Qo Ta .Qc Ta "Straight Double Quote" Ta Qo string Qc
2189 .No .Sq Ta .So Ta .Sc Ta "Single Quote" Ta So string Sc
2193 All macros ending with
2197 have a default width value of 12n.
2199 .Bl -tag -width ".Li .Ec , .Eo"
2201 These macros expect the first argument to be the opening and closing strings
2204 Due to the nine-argument limit in the original troff program two other
2205 macros have been implemented which are now rather obsolete:
2207 takes the first and second parameter as the left and right enclosure string,
2208 which are then used to enclose the arguments of
2210 The default width value is 12n for both macros.
2212 The first and second arguments of this macro are the opening and
2213 closing strings respectively, followed by the arguments to be enclosed.
2215 The quoted literal macro behaves differently in troff and nroff mode.
2218 a quoted literal is always quoted.
2219 If formatted with troff, an item is only quoted if the width of the item is
2220 less than three constant width characters.
2221 This is to make short strings more visible where the font change to literal
2222 (constant width) is less noticeable.
2224 The default width is 16n.
2226 The prefix macro suppresses the whitespace between its first and second
2229 .Bl -tag -width ".Li .Pf\ (\ Fa\ name2" -offset indent
2230 .It Li ".Pf ( Fa name2"
2235 The default width is 12n.
2239 macro (see below) performs the analogous suffix function.
2243 macro inserts an apostrophe and exits any special text modes, continuing in
2249 Examples of quoting:
2252 .Bl -tag -width ".Li .Bq\ Em\ Greek\ ,\ French\ ." -compact -offset indent
2255 .It Li ".Aq Pa ctype.h ) ,"
2259 .It Li ".Bq Em Greek , French ."
2260 .Bq Em Greek , French .
2263 .It Li ".Dq string abc ."
2265 .It Li ".Dq \'^[A-Z]\'"
2267 .It Li ".Ql man mdoc"
2271 .It Li ".Qq string ) ,"
2273 .It Li ".Qq string Ns ),"
2279 .It Li ".Em or Ap ing"
2284 For a good example of nested enclosure macros, see the
2287 It was created from the same underlying enclosure macros as those presented
2293 extended argument list macros are discussed below.
2295 .Ss "No-Op or Normal Text Macro"
2299 macro can be used in a macro command line for parameters which should
2306 if you really want that English word (and not the macro) as a parameter.
2308 .Dl Usage: .No Ao argument Ac ...
2310 .Bl -tag -width ".Li .No\ test\ Ta\ with\ Ta\ tabs" -compact -offset 15n
2311 .It Li ".No test Ta with Ta tabs"
2312 .No test Ta with Ta tabs
2316 The default width is 12n.
2318 .Ss "No-Space Macro"
2322 macro suppresses insertion of a space between the current position and its
2324 For example, it is useful for old style argument lists where there is no
2325 space between the flag and argument:
2327 .Dl "Usage:" ... Ao argument Ac \&Ns Oo Ao argument Ac Oc ...
2328 .Dl " " .Ns Ao argument Ac ...
2330 .Bl -tag -width ".Li .Op\ Fl\ I\ Ns\ Ar\ directory" -compact -offset 15n
2331 .It Li ".Op Fl I Ns Ar directory"
2332 .Op Fl I Ns Ar directory
2337 macro always invokes the
2339 macro after eliminating the space unless another macro name follows it.
2340 If used as a request (i.e., the second form above in the
2347 .Ss "Section Cross References"
2351 macro designates a reference to a section header within the same document.
2353 .Dl Usage: .Sx Ao section reference Ac ...
2355 .Bl -tag -width ".Li .Sx\ FILES" -offset 15n
2361 The default width is 16n.
2365 The symbolic emphasis macro is generally a boldface macro in either the
2366 symbolic sense or the traditional English usage.
2368 .Dl Usage: .Sy Ao symbol Ac ...
2370 .Bl -tag -width ".Li .Sy\ Important\ Notice" -compact -offset 15n
2371 .It Li ".Sy Important Notice"
2372 .Sy Important Notice
2376 The default width is 6n.
2378 .Ss Mathematical Symbols
2380 Use this macro for mathematical symbols and similar things.
2382 .Dl Usage: .Ms Ao math symbol Ac ...
2384 .Bl -tag -width ".Li .Ms\ sigma" -compact -offset 15n
2390 The default width is 6n.
2392 .Ss "References and Citations"
2394 The following macros make a modest attempt to handle references.
2395 At best, the macros make it convenient to manually drop in a subset of
2399 .Bl -tag -width 6n -offset indent -compact
2401 Reference start (does not take arguments).
2402 Causes a line break in the
2404 section and begins collection of reference information until the reference
2407 Reference end (does not take arguments).
2408 The reference is printed.
2410 Reference author name; one name per invocation.
2414 City/place (not implemented yet).
2418 Issuer/publisher name.
2424 Optional information.
2428 Corporate or foreign author.
2437 Macros beginning with
2439 are not callable but accept multiple arguments in the usual way.
2442 macro is handled properly as a parameter; other macros will cause strange
2447 can be used outside of the
2453 .Bd -literal -offset indent
2457 \&.%T "Implementation Notes on foobar(1)"
2458 \&.%R "Technical Report ABC-DE-12-345"
2459 \&.%Q "Drofnats College, Nowhere"
2466 .Bd -ragged -offset indent
2470 .%T "Implementation Notes on foobar(1)"
2471 .%R "Technical Report ABC-DE-12-345"
2472 .%Q "Drofnats College, Nowhere"
2477 .Ss "Trade Names (or Acronyms and Type Names)"
2479 The trade name macro prints its arguments in a smaller font.
2480 Its intended use is to imitate a small caps fonts for uppercase acronyms.
2482 .Dl Usage: .Tn Ao symbol Ac ...
2484 .Bl -tag -width ".Li .Tn\ ASCII" -compact -offset 15n
2492 The default width is 10n.
2494 .Ss "Extended Arguments"
2500 macros allow one to extend an argument list on a macro boundary for the
2507 are implemented similarly to all other macros opening and closing an
2508 enclosure (without inserting characters, of course).
2509 This means that the following is true for those macros also.
2511 Here is an example of
2513 using the space mode macro to turn spacing off:
2515 .Bd -literal -offset indent
2517 \&.It Xo Sy I Ar operation
2518 \&.No \een Ar count No \een
2526 .Bd -filled -offset indent
2529 .It Xo Sy I Ar operation
2530 .No \en Ar count No \en
2539 .Bd -literal -offset indent
2541 \&.It Cm S No / Ar old_pattern Xo
2542 \&.No / Ar new_pattern
2551 .Bd -filled -offset indent
2554 .It Cm S No \&/ Ar old_pattern Xo
2555 .No \&/ Ar new_pattern
2565 and enclosure macros: Test the value of a variable.
2567 .Bd -literal -offset indent
2570 \&.Oo \e&! Oc Ns Ar variable Oo
2571 \&.Ar operator variable ...
2578 .Bd -filled -offset indent
2579 .Bl -tag -width flag -compact
2582 .Oo \&! Oc Ns Ar variable Oo
2583 .Ar operator variable ...
2590 .Sh "PAGE STRUCTURE DOMAIN"
2592 .Ss "Section Headers"
2596 section header macros are required in every man page.
2597 The remaining section headers are recommended at the discretion of the
2598 author writing the manual page.
2601 macro is parsed but not generally callable.
2602 It can be used as an argument in a call to
2604 only; it then reactivates the default font for
2607 The default width is 8n.
2609 .Bl -tag -width ".Li .Sh\ RETURN\ VALUES"
2614 If not specified, headers, footers and page layout defaults will not be set
2615 and things will be rather unpleasant.
2618 section consists of at least three items.
2621 name macro naming the subject of the man page.
2622 The second is the name description macro,
2624 which separates the subject name from the third item, which is the
2626 The description should be the most terse and lucid possible, as the space
2632 then all its arguments.
2634 .It Li ".Sh LIBRARY"
2635 This section is for section two and three function calls.
2636 It should consist of a single
2640 .Sx "Library Names" .
2642 .It Li ".Sh SYNOPSIS"
2645 section describes the typical usage of the subject of a man page.
2646 The macros required are either
2657 The function name macro
2659 is required for manual page sections\~2 and\~3; the command and general name
2662 is required for sections 1, 5, 6, 7, and\~8.
2663 Section\~4 manuals require a
2668 configuration device usage macro.
2669 Several other macros may be necessary to produce the synopsis line as shown
2672 .Bd -filled -offset indent
2680 The following macros were used:
2683 .Dl ".Op Fl benstuv"
2687 .It Li ".Sh DESCRIPTION"
2688 In most cases the first text in the
2690 section is a brief paragraph on the command, function or file, followed by a
2691 lexical list of options and respective explanations.
2692 To create such a list, the
2699 macros are used (see
2700 .Sx Lists and Columns
2703 .It Li ".Sh IMPLEMENTATION NOTES"
2704 Implementation specific information should be placed here.
2706 .It Li ".Sh RETURN VALUES"
2707 Sections 2, 3 and\~9 function return values should go here.
2710 macro may be used to generate text for use in the
2712 section for most section 2 and 3 library functions;
2714 .Sx "Return Values" .
2720 section headers are part of the preferred manual page layout and must be
2721 used appropriately to maintain consistency.
2722 They are listed in the order in which they would be used.
2724 .Bl -tag -width ".Li .Sh\ COMPATIBILITY"
2725 .It Li ".Sh ENVIRONMENT"
2728 section should reveal any related environment variables and clues to their
2729 behavior and/or usage.
2732 Files which are used or created by the man page subject should be listed via
2739 .It Li ".Sh EXAMPLES"
2740 There are several ways to create examples.
2743 section below for details.
2745 .It Li ".Sh DIAGNOSTICS"
2746 Diagnostic messages from a command should be placed in this section.
2749 macro may be used to generate text for use in the
2751 section for most section 1, 6 and\~8 commands;
2755 .It Li ".Sh COMPATIBILITY"
2756 Known compatibility issues (e.g. deprecated options or parameters)
2757 should be listed here.
2760 Specific error handling, especially from library functions (man page
2761 sections 2, 3, and\~9) should go here.
2764 macro is used to specify an error (errno).
2766 .It Li ".Sh SEE ALSO"
2767 References to other material on the man page topic and cross references to
2768 other relevant man pages should be placed in the
2771 Cross references are specified using the
2776 style references are not accommodated.
2778 It is recommended that the cross references are sorted on the section
2779 number, then alphabetically on the names within a section, and placed
2780 in that order and comma separated.
2788 .It Li ".Sh STANDARDS"
2789 If the command, library function or file adheres to a specific
2790 implementation such as
2794 this should be noted here.
2795 If the command does not adhere to any standard, its history should be noted
2800 .It Li ".Sh HISTORY"
2801 Any command which does not adhere to any specific standards should be
2802 outlined historically in this section.
2804 .It Li ".Sh AUTHORS"
2805 Credits should be placed here.
2808 macro should be used to specify the name(s) of the person(s).
2811 Blatant problems with the topic go here.
2817 sections may be added; for example, this section was set with:
2819 .Bd -literal -offset 15n
2820 \&.Sh "PAGE STRUCTURE DOMAIN"
2823 .Ss "Subsection Headers"
2825 Subsection headers have exactly the same syntax as section headers:
2827 is parsed but not generally callable.
2828 It can be used as an argument in a call to
2830 only; it then reactivates the default font for
2833 The default width is 8n.
2835 .Ss "Paragraphs and Line Spacing"
2837 .Bl -tag -width ".Li .Pp"
2841 paragraph command may be used to specify a line space where necessary.
2842 The macro is not necessary after a
2850 macro (which both assert a vertical distance unless the
2854 The macro is neither callable nor parsed and takes no arguments; an
2861 .\" This worked with version one, need to redo for version three
2864 .\" .Cw (ax+bx+c) \ is\ produced\ by\ \&
2865 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2882 .\" .Em is produced by
2898 .\" This example shows the same equation in a different format.
2902 .\" signs were forced with
2906 .\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
2907 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2918 .\" .Li \&.Cx \e\ +\e\ \e&
2929 .\" .Em is produced by
2937 .\" .Li \&.Cx \e\ +\e\ \e&
2948 .\" The incantation below was
2954 .\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
2956 .\" .Li \&.Cx Op Sy ?/
2966 .\" .Em is produced by
2968 .\" .Li \&.Ar \e\ b1 e1 f1
2982 The only keep that is implemented at this time is for words.
2989 The only option that
2991 accepts currently is
2993 (this is also the default if no option is given) which is useful for
2994 preventing line breaks in the middle of options.
2995 In the example for the make command line arguments (see
2996 .Sx What's in a Name ) ,
2999 from placing up the flag and the argument on separate lines.
3001 Both macros are neither callable nor parsed.
3003 More work needs to be done with the keep macros; specifically, a
3005 option should be added.
3007 .Ss "Examples and Displays"
3009 There are seven types of displays.
3011 .Bl -tag -width ".Li .D1"
3014 Display one line of indented text.
3015 This macro is parsed but not callable.
3019 The above was produced by:
3020 .Li ".D1 Fl ldghfstru" .
3024 Display one line of indented
3029 example macro has been used throughout this file.
3030 It allows the indentation (display) of one line of text.
3031 Its default font is set to constant width (literal).
3033 is parsed but not callable.
3035 .Dl % ls -ldg /usr/local/bin
3037 The above was produced by:
3038 .Li ".Dl % ls -ldg /usr/local/bin" .
3044 display must be ended with the
3047 It has the following syntax:
3049 .Bl -tag -width ".Li .Bd" -offset indent
3051 .Bro \-literal | \-filled | \-unfilled | \-ragged | \-centered Brc
3052 .Oo \-offset Ao string Ac Oc Oo \-file Ao file name Ac Oc Oo \-compact Oc Xc
3056 .Bl -tag -width ".Fl file Ao Ar file name Ac " -compact
3058 Fill, but do not adjust the right margin (only left-justify).
3060 Center lines between the current left and right margin.
3061 Note that each single line is centered.
3063 Do not fill; display a block of text as typed, using line breaks as
3064 specified by the user.
3065 This can produce overlong lines without warning messages.
3067 Display a filled block.
3068 The block of text is formatted (i.e., the text is justified on both the left
3071 Display block with literal font (usually fixed-width).
3072 Useful for source code or simple tabbed or spaced text.
3073 .It Fl file Ao Ar file name Ac
3074 The file whose name follows the
3076 flag is read and displayed before any data enclosed with
3080 using the selected display type.
3082 .Xr troff/ Ns Nm \-mdoc
3083 commands in the file will be processed.
3084 .It Fl offset Ao Ar string Ac
3087 is specified with one of the following strings, the string is interpreted to
3088 indicate the level of indentation for the forthcoming block of text:
3091 .Bl -tag -width ".Ar indent-two" -compact
3093 Align block on the current left margin; this is the default mode of
3096 Supposedly center the block.
3097 At this time unfortunately, the block merely gets left aligned about an
3098 imaginary center margin.
3100 Indent by one default indent value or tab.
3101 The default indent value is also used for the
3105 macros, so one is guaranteed the two types of displays will line up.
3106 The indentation value is normally set to\~6n or about two thirds of an inch
3107 (six constant width characters).
3109 Indent two times the default indent value.
3113 aligns the block about two inches from the right side of the page.
3114 This macro needs work and perhaps may never do the right thing within
3121 is a valid numeric expression instead
3122 .Pf ( Em with a scale indicator other than
3124 use that value for indentation.
3125 The most useful scale indicators are
3129 specifying the so-called
3133 This is approximately the width of the letters
3138 of the current font (for nroff output, both scale indicators give the same
3142 isn't a numeric expression, it is tested whether it is an
3144 macro name, and the default offset value associated with this macro is used.
3145 Finally, if all tests fail,
3148 (typeset with a fixed-width font) is taken as the offset.
3150 Suppress insertion of vertical space before begin of display.
3154 End display (takes no arguments).
3157 .Ss "Lists and Columns"
3159 There are several types of lists which may be initiated with the
3162 Items within the list are specified with the
3164 item macro, and each list must end with the
3167 Lists may be nested within themselves and within displays.
3168 The use of columns inside of lists or lists inside of columns is unproven.
3170 In addition, several list attributes may be specified such as the width of a
3171 tag, the list offset, and compactness (blank lines between items allowed or
3173 Most of this document has been formatted with a tag style list
3176 It has the following syntax forms:
3179 .Bl -tag -width ".Li .Bl" -offset indent -compact
3181 .Bro \-hang | \-ohang | \-tag | \-diag | \-inset Brc
3182 .Oo \-width Ao string Ac Oc
3183 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3185 .No \-column Oo \-offset Ao string Ac Oc
3186 .Ao string1 Ac Ao string2 Ac ... Xc
3188 .Bro \-item | \-enum Oo \-nested Oc | \-bullet | \-hyphen | \-dash Brc
3189 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3193 And now a detailed description of the list types.
3196 .Bl -tag -width ".Fl column" -compact
3200 .Bd -literal -offset indent
3201 \&.Bl -bullet -offset indent -compact
3203 Bullet one goes here.
3213 .Bl -bullet -offset indent -compact
3215 Bullet one goes here.
3221 .It Fl dash No ( or Fl hyphen )
3224 .Bd -literal -offset indent
3225 \&.Bl -dash -offset indent -compact
3237 .Bl -dash -offset indent -compact
3248 .Bd -literal -offset indent
3249 \&.Bl -enum -offset indent -compact
3261 .Bl -enum -offset indent -compact
3269 If you want to nest enumerated lists, use the
3271 flag (starting with the second-level list):
3273 .Bd -literal -offset indent
3274 \&.Bl -enum -offset indent -compact
3277 \&.Bl -enum -nested -compact
3281 And item three here.
3292 .Bl -enum -offset indent -compact
3295 .Bl -enum -nested -compact
3299 And item three here.
3309 without list markers.
3311 .Bd -literal -offset indent
3312 \&.Bl -item -offset indent
3328 .Bl -item -offset indent
3344 to specify the tag width.
3347 .Bl -tag -width "PPID" -compact -offset indent
3349 sleep time of the process (seconds blocked)
3353 resulting from references by the process
3354 to pages not loaded in core.
3356 numerical user-id of process owner
3358 numerical id of parent of process priority
3359 (non-positive when in non-interruptible wait)
3365 .Bd -literal -offset indent
3366 \&.Bl -tag -width "PPID" -compact -offset indent
3368 sleep time of the process (seconds blocked)
3372 resulting from references by the process
3373 to pages not loaded in core.
3375 numerical user-id of process owner
3377 numerical id of parent of process priority
3378 (non-positive when in non-interruptible wait)
3384 Diag lists create section four diagnostic lists and are similar to inset
3385 lists except callable macros are ignored.
3388 flag is not meaningful in this context.
3392 .Bd -literal -offset indent
3394 \&.It You can't use Sy here.
3395 The message says all.
3403 .It You can't use Sy here.
3404 The message says all.
3409 A list with hanging tags.
3411 .Bl -hang -offset indent
3413 labels appear similar to tagged lists when the
3414 label is smaller than the label width.
3415 .It Em Longer hanged list labels
3416 blend into the paragraph unlike
3417 tagged paragraph labels.
3420 And the unformatted text which created it:
3422 .Bd -literal -offset indent
3423 \&.Bl -hang -offset indent
3425 labels appear similar to tagged lists when the
3426 label is smaller than the label width.
3427 \&.It Em Longer hanged list labels
3428 blend into the paragraph unlike
3429 tagged paragraph labels.
3435 Lists with overhanging tags do not use indentation for the items; tags are
3436 written to a separate line.
3438 .Bl -ohang -offset indent
3440 sleep time of the process (seconds blocked)
3444 resulting from references by the process
3445 to pages not loaded in core.
3447 numerical user-id of process owner
3449 numerical id of parent of process priority
3450 (non-positive when in non-interruptible wait)
3456 .Bd -literal -offset indent
3457 \&.Bl -ohang -offset indent
3459 sleep time of the process (seconds blocked)
3463 resulting from references by the process
3464 to pages not loaded in core.
3466 numerical user-id of process owner
3468 numerical id of parent of process priority
3469 (non-positive when in non-interruptible wait)
3475 Here is an example of inset labels:
3476 .Bl -inset -offset indent
3478 The tagged list (also called a tagged paragraph)
3479 is the most common type of list used in the
3483 attribute as described below.
3485 Diag lists create section four diagnostic lists
3486 and are similar to inset lists except callable
3489 Hanged labels are a matter of taste.
3491 Overhanging labels are nice when space is constrained.
3493 Inset labels are useful for controlling blocks of
3494 paragraphs and are valuable for converting
3496 manuals to other formats.
3499 Here is the source text which produced the above example:
3501 .Bd -literal -offset indent
3502 \&.Bl -inset -offset indent
3504 The tagged list (also called a tagged paragraph)
3505 is the most common type of list used in the
3508 Diag lists create section four diagnostic lists
3509 and are similar to inset lists except callable
3512 Hanged labels are a matter of taste.
3514 Overhanging labels are nice when space is constrained.
3516 Inset labels are useful for controlling blocks of
3517 paragraphs and are valuable for converting
3519 manuals to other formats.
3525 This list type generates multiple columns.
3526 The number of columns and the width of each column is determined by the
3537 (dot) immediately followed by a valid
3539 macro name, interpret
3541 and use the width of the result.
3542 Otherwise, the width of
3544 (typeset with a fixed-width font) is taken as the
3550 argument is parsed to make a row, each column within the row is a separate
3551 argument separated by a tab or the
3557 .Bl -column -offset indent ".Sy String" ".Sy Nroff" ".Sy Troff"
3558 .It Sy String Ta Sy Nroff Ta Sy Troff
3559 .It Li <= Ta <= Ta \*(<=
3560 .It Li >= Ta >= Ta \*(>=
3567 \&.Bl -column -offset indent ".Sy String" ".Sy Nroff" ".Sy Troff"
3568 \&.It Sy String Ta Sy Nroff Ta Sy Troff
3569 \&.It Li <= Ta <= Ta \e*(<=
3570 \&.It Li >= Ta >= Ta \e*(>=
3578 .Bl -tag -width ".Fl indent Ao Ar string Ac"
3579 .It Fl width Ao Ar string Ac
3584 (dot) immediately followed by a valid
3586 macro name, interpret
3588 and use the width of the result.
3589 Almost all lists in this document use this option.
3593 .Bd -literal -offset indent
3594 \&.Bl -tag -width ".Fl test Ao Ar string Ac"
3595 \&.It Fl test Ao Ar string Ac
3596 This is a longer sentence to show how the
3598 flag works in combination with a tag list.
3605 .Bl -tag -width ".Fl test Ao Ar string Ac"
3606 .It Fl test Ao Ar string Ac
3607 This is a longer sentence to show how the
3609 flag works in combination with a tag list.
3613 (Note that the current state of
3617 is interpreted; afterwards, all variables are restored again.
3618 However, boxes (used for enclosures) can't be saved in
3621 as a consequence, arguments must always be
3623 to avoid nasty errors.
3624 For example, do not write
3627 .Ql ".Ao Ar string Xc"
3628 instead if you really need only an opening angle bracket.)
3632 is a valid numeric expression
3633 .Em ( with a scale indicator other than
3635 use that value for indentation.
3636 The most useful scale indicators are
3640 specifying the so-called
3644 This is approximately the width of the letters
3649 of the current font (for nroff output, both scale indicators give the same
3653 isn't a numeric expression, it is tested whether it is an
3655 macro name, and the default width value associated with this macro is used.
3656 Finally, if all tests fail,
3659 (typeset with a fixed-width font) is taken as the width.
3661 If a width is not specified for the tag list type, every time
3663 is invoked, an attempt is made to determine an appropriate width.
3664 If the first argument to
3666 is a callable macro, the default width for that macro will be used;
3667 otherwise, the default width of
3670 .It Fl offset Ao Ar string Ac
3675 a default indent value (normally set to\~6n, similar to the value used in
3682 is a valid numeric expression instead
3683 .Pf ( Em with a scale indicator other than
3685 use that value for indentation.
3686 The most useful scale indicators are
3690 specifying the so-called
3694 This is approximately the width of the letters
3699 of the current font (for nroff output, both scale indicators give the same
3703 isn't a numeric expression, it is tested whether it is an
3705 macro name, and the default offset value associated with this macro is used.
3706 Finally, if all tests fail,
3709 (typeset with a fixed-width font) is taken as the offset.
3711 Suppress insertion of vertical space before the list and between list items.
3715 .Sh "MISCELLANEOUS MACROS"
3717 Here a list of the remaining macros which do not fit well into one of the
3719 We couldn't find real examples for the following macros:
3723 They are documented here for completeness \- if you know how to use them
3724 properly please send a mail to
3725 .Mt bug-groff@gnu.org
3726 (including an example).
3728 .Bl -tag -width ".Li .Bt"
3732 .Bd -ragged -offset indent
3736 It is neither callable nor parsed and takes no arguments.
3740 .Dl Usage: .Fr Ao function return value Ac ...
3742 Don't use this macro.
3743 It allows a break right before the return value (usually a single digit)
3744 which is bad typographical behaviour.
3747 to tie the return value to the previous word.
3750 Use this macro to include a (header) file literally.
3753 followed by the file name, then the contents of
3756 .Dl Usage: .Hf Ao file Ac
3758 It is neither callable nor parsed.
3764 Exact usage unknown.
3765 The documentation in the
3767 source file describes it as a macro for
3768 .Dq "menu entries" .
3770 Its default width is 6n.
3776 Exact usage unknown.
3777 The documentation in the
3779 source file describes it as
3780 .Dq old function type (fortran) .
3783 Activate (toggle) space mode.
3785 .Dl Usage: .Sm Oo on | off Oc ...
3787 If space mode is off, no spaces between macro arguments are inserted.
3788 If called without a parameter (or if the next parameter is neither
3798 .Bd -ragged -offset indent
3802 It is neither callable nor parsed and takes no arguments.
3806 .Sh "PREDEFINED STRINGS"
3808 The following strings are predefined:
3810 .Bl -column String infinity "Troff " "straight double quote" -offset indent
3811 .It Sy String Ta Sy Nroff Ta Sy Troff Ta Sy Meaning
3812 .It Li <= Ta <= Ta \*[<=] Ta "less equal"
3813 .It Li >= Ta >= Ta \*[>=] Ta "greater equal"
3814 .It Li Rq Ta '' Ta \*[Rq] Ta "right double quote"
3815 .It Li Lq Ta `` Ta \*[Lq] Ta "left double quote"
3816 .It Li ua Ta ^ Ta \*[ua] Ta "upwards arrow"
3817 .It Li aa Ta \' Ta \*[aa] Ta "acute accent"
3818 .It Li ga Ta \` Ta \*[ga] Ta "grave accent"
3819 .It Li q Ta \&" Ta \*[q] Ta "straight double quote"
3820 .It Li Pi Ta pi Ta \*[Pi] Ta "greek pi"
3821 .It Li Ne Ta != Ta \*[Ne] Ta "not equal"
3822 .It Li Le Ta <= Ta \*[Le] Ta "less equal"
3823 .It Li Ge Ta >= Ta \*[Ge] Ta "greater equal"
3824 .It Li Lt Ta < Ta \*[Lt] Ta "less than"
3825 .It Li Gt Ta > Ta \*[Gt] Ta "greater than"
3826 .It Li Pm Ta +\- Ta \*[Pm] Ta "plus minus"
3827 .It Li If Ta infinity Ta \*[If] Ta "infinity"
3828 .It Li Na Ta \*[Na] Ta \*[Na] Ta "not a number"
3829 .It Li Ba Ta \*[Ba] Ta \*[Ba] Ta "vertical bar"
3832 The names of the columns
3836 are a bit misleading;
3840 representation, while
3842 gives the best glyph form available.
3843 For example, a Unicode enabled
3845 device will have proper glyph representations for all strings, whereas the
3846 enhancement for a Latin1
3848 device is only the plus-minus sign.
3850 String names which consist of two characters can be written as
3852 string names which consist of one character can be written as
3854 A generic syntax for a string name of any length is
3863 \#=====================================================================
3869 available in previous versions of
3871 has been removed since
3874 provides better facilities to check parameters; additionally, many error and
3875 warning messages have been added to this macro package, making it both more
3878 The only remaining debugging macro is
3880 which yields a register dump of all global registers and strings.
3881 A normal user will never need it.
3884 .Sh "FORMATTING WITH GROFF, TROFF, AND NROFF"
3886 By default, the package inhibits page breaks, headers, and footers if
3893 to make the manual more efficient for viewing on-line.
3894 This behaviour can be changed (e.g.\& to create a hardcopy of the
3896 output) by setting the register
3898 to zero while calling
3901 .Dl groff -Tlatin1 -rcR=0 -mdoc foo.man > foo.txt
3903 For double-sided printing, set register
3907 .Dl groff -Tps -rD1 -mdoc foo.man > foo.ps
3909 To change the document font size to 11pt or 12pt, set register
3913 .Dl groff -Tdvi -rS11 -mdoc foo.man > foo.dvi
3924 .Bl -tag -width mdoc/doc-ditroff -compact
3926 The main manual macro package.
3928 A wrapper file to call
3930 .It Pa mdoc/doc-common
3931 Common strings, definitions, stuff related typographic output.
3932 .It Pa mdoc/doc-nroff
3933 Definitions used for a
3936 .It Pa mdoc/doc-ditroff
3937 Definitions used for all other devices.
3939 Local additions and customizations.
3941 This file checks whether the
3945 package should be used.
3959 Section 3f has not been added to the header routines.
3962 font should be changed in
3967 needs to have a check to prevent splitting up
3968 if the line length is too short.
3970 separates the last parenthesis, and sometimes
3971 looks ridiculous if a line is in fill mode.
3973 The list and display macros do not do any keeps
3974 and certainly should be able to.
3975 .\" Note what happens if the parameter list overlaps a newline
3977 .\" to make sure a line boundary is crossed:
3979 .\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[]
3982 .\" produces, nudge nudge,
3983 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
3984 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
3986 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] .
3988 .\" If double quotes are used, for example:
3990 .\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q
3993 .\" produces, nudge nudge,
3994 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
3996 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
3998 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" .
4000 .\" Not a pretty sight...
4001 .\" In a paragraph, a long parameter containing unpaddable spaces as
4002 .\" in the former example will cause
4004 .\" to break the line and spread
4005 .\" the remaining words out.
4006 .\" The latter example will adjust nicely to
4007 .\" justified margins, but may break in between an argument and its
4011 .\" the right margin adjustment is normally ragged and the problem is
4014 .\" Local Variables: