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"
166 . \" .It "Header File (including source code)"
167 . It "Interactive Commands"
174 . It "Variable Types"
176 . It "Manual Page Cross References"
180 . Tn "GENERAL TEXT DOMAIN"
182 . Bl -tag -width 2n -compact
190 . It "Emphasis Macro"
192 . It "Enclosure and Quoting Macros"
193 . It "No-Op or Normal Text Macro"
194 . It "No-Space Macro"
195 . It "Section Cross References"
197 . It "Mathematical Symbols"
198 . It "References and Citations"
199 . It "Trade Names (or Acronyms and Type Names)"
200 . It "Extended Arguments"
204 . Tn "PAGE STRUCTURE DOMAIN"
206 . Bl -tag -width 2n -compact
207 . It "Section Headers"
208 . It "Subsection Headers"
209 . It "Paragraphs and Line Spacing"
211 . It "Examples and Displays"
212 . It "Lists and Columns"
216 . Tn "MISCELLANEOUS MACROS"
219 . Tn "PREDEFINED STRINGS"
225 . Tn "FORMATTING WITH GROFF, TROFF, AND NROFF"
241 .Sh "TROFF IDIOSYNCRASIES"
245 package attempts to simplify the process of writing a man page.
246 Theoretically, one should not have to learn the dirty details of
251 however, there are a few limitations which are unavoidable and best gotten
253 And, too, be forewarned, this package is
262 a macro is called by placing a
264 (dot character) at the beginning of a line followed by the two-character
265 (or three-character) name for the macro.
266 There can be space characters between the dot and the macro name (but
269 Arguments may follow the macro separated by spaces (again, no tabs).
270 It is the dot character at the beginning of the line which causes
273 to interpret the next two (or more) characters as a macro name.
274 A single starting dot followed by nothing is ignored.
277 (dot character) at the beginning of an input line in some context other than
278 a macro invocation, precede the
285 translates literally to a zero-width space, and is never displayed in
291 macros accept an unlimited number of arguments (contrary to other versions
292 of troff which can't handle more than nine arguments).
293 In limited cases, arguments may be continued or extended on the next
295 .Sx Extended Arguments
297 Almost all macros handle quoted arguments (see
298 .Sx Passing Space Characters in an Argument
303 general text domain and manual domain macros are special in that their
306 for callable macro names.
307 This means an argument on the argument list which matches a general text or
308 manual domain macro name and is determined to be callable will be executed
309 or called when it is processed.
310 In this case the argument, although the name of a macro, is not preceded by
314 It is in this manner that many macros are nested; for example the
319 the flag and argument macros,
323 to specify an optional flag with an argument:
325 .Bl -tag -xwidth ".Op Fl s Ar bytes" -offset indent
328 .Ql ".Op Fl s Ar bytes"
332 To prevent a string from being interpreted as a macro name, precede the
333 string with the escape sequence
336 .Bl -tag -xwidth ".Op \&Fl s \&Ar bytes" -offset indent
337 .It Op \&Fl s \&Ar bytes
339 .Ql ".Op \e&Fl s \e&Ar bytes"
347 are not interpreted as macros.
348 Macros whose argument lists are parsed for callable arguments are referred
351 and macros which may be called from an argument list are referred to as
353 throughout this document.
356 as almost all of the macros in
358 are parsed, but as it was cumbersome to constantly refer to macros as
359 being callable and being able to call other macros, the term parsed
362 .Ss "Passing Space Characters in an Argument"
364 Sometimes it is desirable to give as an argument a string containing one or
365 more blank space characters.
366 This may be necessary to specify arguments to macros which expect particular
367 arrangement of items in the argument list. Additionally, it makes
370 For example, the function macro
372 expects the first argument to be the name of a function and any remaining
373 arguments to be function parameters.
376 stipulates the declaration of function parameters in the parenthesized
377 parameter list, each parameter is guaranteed to be at minimum a two word
382 There are two possible ways to pass an argument which contains
384 One way of passing a string containing blank spaces is to use the hard or
385 unpaddable space character
387 that is, a blank space preceded by the escape character
389 This method may be used with any macro but has the side effect of
390 interfering with the adjustment of text over the length of a line.
392 sees the hard space as if it were any other printable character and cannot
393 split the string into blank or newline separated pieces as one would expect.
394 This method is useful for strings which are not expected to overlap a line
396 An alternative is to use
398 a paddable (i.e.\& stretchable), unbreakable space (this is a
402 The second method is to enclose the string with double quotes.
406 .Bl -tag -xwidth ".Fn fetch char\ *str" -offset indent
407 .It Fn fetch char\ *str
409 .Ql ".Fn fetch char\e *str"
410 .It Fn fetch "char *str"
411 can also be created by
412 .Ql ".Fn fetch \*[q]char *str\*[q]"
418 before the space resp.\& the double quotes were omitted,
420 would see three arguments, and the result would be:
422 .Dl Fn fetch char *str
424 .\" For an example of what happens when the parameter list overlaps a newline
425 .\" boundary, see the
429 .Ss "Trailing Blank Space Characters"
432 can be confused by blank space characters at the end of a line.
433 It is a wise preventive measure to globally remove all blank spaces
435 .Ao blank-space Ac Ns Ao end-of-line Ac
437 Should the need arise to force a blank character at the end of a line, it
438 may be forced with an unpaddable space and the
444 .Ss "Escaping Special Characters"
446 Special characters like the newline character
448 are handled by replacing the
454 to preserve the backslash.
456 .Ss "Other Possible Pitfalls"
458 A warning is emitted when an empty input line is found outside of displays
463 (Well, it is even better to use
465 macros to avoid the usage of low-level commands.)
467 Leading spaces will cause a break and are output directly.
468 Avoid this behaviour if possible.
469 Similarly, do not use more than one space character between words in an
470 ordinary text line; contrary to other text formatters, they are
472 replaced with a single space.
476 directly as an argument.
485 inserts two space characters after a punctuation mark closing a sentence;
490 are treated transparently, not influencing the sentence-ending behaviour.
491 To change this, insert
493 before or after the dot:
495 .Bd -literal -offset indent
514 .Bd -filled -offset indent
531 As can be seen in the first and third line,
533 handles punctuation characters specially in macro arguments.
534 This will be explained in section
537 In the same way, you have to protect trailing full stops of abbreviations
538 with a trailing zero-width space:
541 A comment in the source file of a man page can be either started with
547 anywhere (the latter is a
550 extension); the rest of such a line is ignored.
553 .Sh "A MANUAL PAGE TEMPLATE"
555 The body of a man page is easily constructed from a basic template:
557 .Bd -literal -offset indent
558 \&.\e" The following requests are required for all man pages.
559 \&.Dd Month day, year
560 \&.Os [OPERATING_SYSTEM] [version/release]
561 \&.Dt DOCUMENT_TITLE [section number] [architecture/volume]
564 \&.Nd one line description of name
565 \&.\e" This next request is for sections 2 and 3 only.
569 \&.\e" The following requests should be uncommented and
570 \&.\e" used where appropriate.
571 \&.\e" .Sh IMPLEMENTATION NOTES
572 \&.\e" This next request is for sections 2, 3 and 9 function
573 \&.\e" return values only.
574 \&.\e" .Sh RETURN VALUES
575 \&.\e" This next request is for sections 1, 6, 7 and 8 only.
576 \&.\e" .Sh ENVIRONMENT
579 \&.\e" This next request is for sections 1, 6, 7, 8 and 9 only
580 \&.\e" (command return values (to shell) and
581 \&.\e" fprintf/stderr type diagnostics).
582 \&.\e" .Sh DIAGNOSTICS
583 \&.\e" .Sh COMPATIBILITY
584 \&.\e" This next request is for sections 2, 3 and 9 error
585 \&.\e" and signal handling only.
595 The first items in the template are the macros
600 the document date, the operating system the man page or subject source is
601 developed or modified for, and the man page title (in
603 along with the section of the manual the page belongs in.
604 These macros identify the page and are discussed below in
607 The remaining items in the template are section headers
615 The headers are discussed in
616 .Sx "PAGE STRUCTURE DOMAIN" ,
617 after presentation of
618 .Sx "MANUAL DOMAIN" .
619 Several content macros are used to demonstrate page layout macros; reading
620 about content macros before page layout macros is recommended.
625 In the description of all macros below, optional arguments are put into
629 represents zero or more additional arguments.
630 Alternative values for a parameter are separated with
632 If there are alternative values for a mandatory parameter, braces are used
635 to enclose the value set.
636 Meta-variables are specified within angles.
640 .Bl -tag -width 6n -offset indent
644 .Op \-test1 Op \-test2 | \-test3
650 Except stated explicitly, all macros are parsed and callable.
652 Most macros have a default width value which can be used to specify a label
662 It is recommended not to use this rather obscure feature to avoid
663 dependencies on local modifications of the
670 The title macros are part of the page structure domain but are presented
671 first and separately for someone who wishes to start writing a man page
673 Three header macros designate the document title or manual page title, the
674 operating system, and the date of authorship.
675 These macros are called once at the very beginning of the document and are
676 used to construct headers and footers only.
680 .Op Aq document title
681 .Op Aq section number
684 The document title is the subject of the man page and must be in
686 due to troff limitations.
690 The section number may be a number in the range
691 .No 1,\~ Ns ... Ns ,\~9
697 If it is specified, and no volume name is given, a default volume name is
702 .Tn \*[operating-system] ,
703 the following sections are defined:
705 .Bl -column LOCAL -offset indent -compact
706 .It Li 1 Ta "\*[volume-ds-1]"
707 .It Li 2 Ta "\*[volume-ds-2]"
708 .It Li 3 Ta "\*[volume-ds-3]"
709 .It Li 4 Ta "\*[volume-ds-4]"
710 .It Li 5 Ta "\*[volume-ds-5]"
711 .It Li 6 Ta "\*[volume-ds-6]"
712 .It Li 7 Ta "\*[volume-ds-7]"
713 .It Li 8 Ta "\*[volume-ds-8]"
714 .It Li 9 Ta "\*[volume-ds-9]"
718 A volume name may be arbitrary or one of the following:
721 .Bl -column LOCAL -offset indent -compact
722 .It Li USD Ta "\*[volume-ds-USD]"
723 .It Li PS1 Ta "\*[volume-ds-PS1]"
724 .It Li AMD Ta "\*[volume-ds-AMD]"
725 .It Li SMM Ta "\*[volume-ds-SMM]"
726 .It Li URM Ta "\*[volume-ds-URM]"
727 .It Li PRM Ta "\*[volume-ds-PRM]"
728 .It Li KM Ta "\*[volume-ds-KM]"
729 .It Li IND Ta "\*[volume-ds-IND]"
730 .It Li LOCAL Ta "\*[volume-ds-LOCAL]"
731 .It Li CON Ta "\*[volume-ds-CON]"
743 Values from the previous table will specify a new volume name.
744 If the third parameter is a keyword designating a computer architecture,
745 its value is appended to the volume name as specified by the second
746 parameter. By default, the following architecture keywords are defined:
748 \# we use `No' to avoid hyphenation
749 .Bd -ragged -offset indent
750 .No alpha , amiga , arc , arm26 , arm32 , atari , bebox , cobalt , evbsh3 ,
751 .No hp300 , hpcmips , i386 , luna68k , m68k , mac68k , macppc , mips ,
752 .No mmeye , mvme68k , news68k , newsmips , next68k , ofppc , pc532 , pmax ,
753 .No powerpc , prep , sgimips , sh3 , sparc , sparc64 , sun3 , tahoe , vax ,
758 In the following examples, the left (which is identical to the right) and
759 the middle part of the manual page header strings are shown.
762 .Bl -tag -xwidth ".Li .Dt\ FOO\ 2\ mac68k" -compact -offset indent
765 .Ql System Reference Manual
766 .It Li ".Dt FOO 2 mac68k"
768 .Ql System Programmer's Manual (mac68k Architecture)
769 .It Li ".Dt FOO \*[q]\*[q] bar"
776 Local, OS-specific additions might be found in the file
778 look for strings named
780 (for the former type) and
782 (for the latter type);
784 then denotes the keyword to be used with the
788 This macro is neither callable nor parsed.
791 .Op Aq operating system
794 If the first parameter is empty,
796 .Sq Tn "\*[operating-system]"
798 This may be overridden in the local configuration file,
800 In general, the name of the operating system should be the common acronym,
805 The release should be the standard release nomenclature for the system
807 In the following table, the possible second arguments for some predefined
808 operating systems are listed.
811 local additions might be defined in
813 look for strings named
814 .Ql operating-system-XXX-YYY ,
817 is the acronym for the operating system and
822 .Bl -tag -xwidth ".No FreeBSD" -offset indent
824 7th, 7, III, 3, V, V.2, V.3, V.4
826 3, 4, 4.1, 4.2, 4.3, 4.3t, 4.3T, 4.3r, 4.3R, 4.4
828 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,
831 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,
832 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,
840 an unknown second parameter will be replaced with the string
842 for the other predefined acronyms it will be ignored and a warning message
844 Unrecognized arguments are displayed as given in the page footer.
845 For instance, a typical footer might be:
850 .Ql 4.3\~Berkeley Distribution ,
851 or for a locally produced set
853 .Dl .Os CS Department
860 macro is not present, the bottom left corner of the manual page will be
863 This macro is neither callable nor parsed.
874 is used for the date string.
875 If it has exactly three arguments, they are concatenated, separated with
878 .Dl .Dd January 25, 2001
880 Otherwise, the current date is used, ignoring the parameters.
882 This macro is neither callable nor parsed.
886 .Sh "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS"
888 .Ss "What's in a Name" Ns ...
890 The manual domain macro names are derived from the day to day informal
891 language used to describe commands, subroutines and related files.
892 Slightly different variations of this language are used to describe the
893 three different aspects of writing a man page.
894 First, there is the description of
897 Second is the description of a
902 macros, and third, the description of a command to a user in the verbal
903 sense; that is, discussion of a command in the text of a man page.
907 macros are themselves a type of command; the general syntax for a troff
910 .Bd -filled -offset indent
911 .Li ".Xx argument1 argument2" ...
916 is a macro command or request, and anything following it are arguments to
918 In the second case, the description of a
920 command using the content macros is a bit more involved; a typical
922 command line might be displayed as:
924 .Bd -filled -offset indent
927 .Ao Ar infile Ac Ao Ar outfile Ac
933 is the command name and the
938 argument designated as optional by the option brackets.
947 in this example, the user has to replace the meta expressions given in angle
948 brackets with real file names.
949 Note that in this document meta arguments are used to describe
951 commands; in most man pages, meta variables are not specifically written
953 The macros which formatted the above example:
955 .Bd -literal -offset indent
958 \&.Ao Ar infile Ac Ao Ar outfile Ac
962 In the third case, discussion of commands and command syntax includes both
963 examples above, but may add more detail.
968 from the example above might be referred to as
972 Some command line argument lists are quite long:
975 .Bl -tag -xwidth ".Nm make" -offset indent -compact
981 .Op Fl I Ar directory
983 .Op Ar variable Ns = Ns Ar value
991 Here one might talk about the command
993 and qualify the argument,
995 as an argument to the flag,
997 or discuss the optional file operand
999 In the verbal context, such detail can prevent confusion, however the
1001 package does not have a macro for an argument
1006 argument macro is used for an operand or file argument like
1008 as well as an argument to a flag like
1010 The make command line was produced from:
1012 .Bd -literal -offset indent
1015 \&.Op Fl D Ar variable
1017 \&.Op Fl f Ar makefile
1018 \&.Op Fl I Ar directory
1019 \&.Op Fl j Ar max_jobs
1020 \&.Op Ar variable Ns = Ns Ar value
1031 macros are explained in
1034 .Ss "General Syntax"
1036 The manual domain and general text domain macros share a similar syntax with
1037 a few minor deviations; most notably,
1043 differ only when called without arguments; and
1047 impose an order on their argument lists.
1048 All content macros are capable of recognizing and properly handling
1049 punctuation, provided each punctuation character is separated by a leading
1051 If a request is given:
1053 .Dl \&.Ar sptr, ptr),
1059 The punctuation is not recognized and all is output in the
1062 If the punctuation is separated by a leading white space:
1064 .Dl \&.Ar "sptr , ptr ) ,"
1068 .Dl Ar sptr , ptr ) ,
1070 The punctuation is now recognized and output in the default font
1071 distinguishing it from the argument strings.
1072 To remove the special meaning from a punctuation character escape it with
1076 is limited as a macro language, and has difficulty when presented with a
1077 string containing a member of the mathematical, logical or quotation set:
1079 .Bd -literal -offset indent-two
1080 {+,\-,/,*,%,<,>,<=,>=,=,==,&,`,',"}
1086 may assume it is supposed to actually perform the operation or evaluation
1087 suggested by the characters.
1088 To prevent the accidental evaluation of these characters, escape them with
1090 Typical syntax is shown in the first content macro displayed below,
1098 The address macro identifies an address construct.
1100 .Dl Usage: .Ad Ao address Ac ...
1102 .Bl -tag -xwidth ".Li .Ad\ f1\ ,\ f2\ ,\ f3\ :" -compact -offset 15n
1105 .It Li ".Ad addr1 ."
1107 .It Li ".Ad addr1 , file2"
1109 .It Li ".Ad f1 , f2 , f3 :"
1111 .It Li ".Ad addr ) ) ,"
1116 The default width is 12n.
1122 macro is used to specify the name of the author of the item being
1123 documented, or the name of the author of the actual manual page.
1125 .Dl Usage: .An Ao author name Ac ...
1127 .Bl -tag -xwidth ".Li .An\ \*[q]Joe\ Author\*[q]\ )\ )\ ," -offset 15n
1128 .It Li ".An \*[q]Joe Author\*[q]"
1130 .It Li ".An \*[q]Joe Author\*[q] ,"
1132 .It Li ".An \*[q]Joe Author\*[q] Aq nobody@FreeBSD.org"
1133 .An "Joe Author" Aq nobody@FreeBSD.org
1134 .It Li ".An \*[q]Joe Author\*[q] ) ) ,"
1135 .An "Joe Author" ) ) ,
1139 The default width is 12n.
1145 request causes a line break allowing each new name to appear on its own
1147 If this is not desirable,
1149 .Bd -literal -offset indent
1154 call will turn this off.
1155 To turn splitting back on, write
1157 .Bd -literal -offset indent
1165 argument macro may be used whenever an argument is referenced.
1166 If called without arguments, the
1170 .Dl Usage: .Ar Oo Ao argument Ac Oc ...
1172 .Bl -tag -xwidth ".Li .Ar\ file1\ file2" -compact -offset 15n
1177 .It Li ".Ar file1 ."
1179 .It Li ".Ar file1 file2"
1181 .It Li ".Ar f1 f2 f3 :"
1183 .It Li ".Ar file ) ) ,"
1188 The default width is 12n.
1190 .Ss "Configuration Declaration (Section Four Only)"
1194 macro is used to demonstrate a
1196 declaration for a device interface in a section four manual.
1198 .Dl Usage: .Cd Ao argument Ac ...
1200 .Bl -tag -xwidth ".Li .Cd\ Xdevice\ le0\ at\ scode?X" -offset 15n
1201 .It Li ".Cd \*[q]device le0 at scode?\*[q]"
1202 .Cd "device le0 at scode?"
1209 request causes a line break before and after its arguments are printed.
1212 The default width is 12n.
1214 .Ss "Command Modifiers"
1216 The command modifier is identical to the
1218 (flag) command with the exception that the
1220 macro does not assert a dash in front of every argument.
1221 Traditionally flags are marked by the preceding dash, however, some commands
1222 or subsets of commands do not use them.
1223 Command modifiers may also be specified in conjunction with interactive
1224 commands such as editor commands.
1228 The default width is 10n.
1230 .Ss "Defined Variables"
1232 A variable (or constant) which is defined in an include file
1233 is specified by the macro
1236 .Dl Usage: .Dv Ao defined variable Ac ...
1238 .Bl -tag -xwidth ".Li .Dv\ MAXHOSTNAMELEN" -compact -offset 15n
1239 .It Li ".Dv MAXHOSTNAMELEN"
1241 .It Li ".Dv TIOCGPGRP )"
1246 The default width is 12n.
1252 errno macro specifies the error return value for section 2, 3, and\~9 library
1254 The second example below shows
1258 general text domain macro, as it would be used in a section two manual page.
1260 .Dl Usage: .Er Ao errno type Ac ...
1262 .Bl -tag -xwidth ".Li .Bq\ Er\ ENOTDIR" -compact -offset 15n
1265 .It Li ".Er ENOENT ) ;"
1267 .It Li ".Bq Er ENOTDIR"
1272 The default width is 17n.
1274 .Ss "Environment Variables"
1278 macro specifies an environment variable.
1280 .Dl Usage: .Ev Ao argument Ac ...
1282 .Bl -tag -xwidth ".Li .Ev\ PRINTER\ )\ )\ ," -compact -offset 15n
1283 .It Li ".Ev DISPLAY"
1287 .It Li ".Ev PRINTER ) ) ,"
1292 The default width is 15n.
1298 macro handles command line flags.
1302 For interactive command flags, which are not prepended with a dash, the
1305 macro is identical, but without the dash.
1307 .Dl Usage: .Fl Ao argument Ac ...
1309 .Bl -tag -xwidth ".Li .Fl\ xyz\ )\ ," -compact -offset 15n
1322 .It Li ".Fl xyz ) ,"
1330 macro without any arguments results in a dash representing stdin/stdout.
1333 a single dash will result in two dashes.
1335 The default width is 12n.
1337 .Ss "Function Declarations"
1341 macro is used in the
1343 section with section two or three functions.
1344 It is neither callable nor parsed.
1346 .Dl Usage: .Fd Ao argument Ac ...
1348 .Bl -tag -xwidth ".Li .Fd\ X#include\ <sys/types.h>X" -compact -offset 15n
1349 .It Li ".Fd \*[q]#include <sys/types.h>\*[q]"
1350 .Fd "#include <sys/types.h>"
1357 request causes a line break if a function has already been presented and a
1358 break has not occurred.
1359 This leaves a nice vertical space in between the previous function call and
1360 the declaration for the next function.
1367 macro is the short form of the above example.
1368 It specifies the C\~header file as being included in a C\~program.
1369 It also causes a line break, and is neither callable nor parsed.
1371 .Dl Usage: .In Ao header file Ac
1373 .Bl -tag -xwidth ".Li .In\ stdio.h" -compact -offset 15n
1374 .It Li ".In stdio.h"
1378 .Ss "Function Types"
1380 This macro is intended for the
1383 It may be used anywhere else in the man page without problems, but its main
1384 purpose is to present the function type in kernel normal form for the
1386 of sections two and three (it causes a line break, allowing the function
1387 name to appear on the next line).
1389 .Dl Usage: .Ft Ao type Ac ...
1391 .Bl -tag -xwidth ".Li .Ft\ struct\ stat" -compact -offset 15n
1392 .It Li ".Ft struct stat"
1396 .Ss "Functions (Library Routines)"
1404 .Dl Usage: .Fn Ao function Ac Oo Ao parameter Ac Oc ...
1406 .Bl -tag -xwidth ".Li .Fn\ align\ Xchar\ *ptrX\ ," -compact -offset 15n
1407 .It Li ".Fn getchar"
1409 .It Li ".Fn strlen ) ,"
1411 .It Li ".Fn align \*[q]char *ptr\*[q] ,"
1412 .Fn align "char *ptr" ,
1415 Note that any call to another macro signals the end of the
1417 call (it will insert a closing parenthesis at that point).
1419 For functions with many parameters (which is rare), the macros
1427 (function argument).
1431 .Bd -literal -offset indent
1440 \&.Fa "struct rrec *newrr"
1449 .Bd -ragged -offset indent
1458 .Fa "struct rrec *newrr"
1467 section, the function will always begin at the beginning of line.
1468 If there is more than one function presented in the
1470 section and a function type has not been given, a line break will occur,
1471 leaving a nice vertical space between the current function name and the one
1474 The default width values of
1478 are 12n and 16n, respectively.
1480 .Ss "Function Arguments"
1484 macro is used to refer to function arguments (parameters) outside of the
1486 section of the manual or inside the
1488 section if the enclosure macros
1496 may also be used to refer to structure members.
1498 .Dl Usage: .Fa Ao function argument Ac ...
1500 .Bl -tag -xwidth ".Li .Fa\ d_namlen\ )\ )\ ," -compact -offset 15n
1501 .It Li ".Fa d_namlen ) ) ,"
1503 .It Li ".Fa iov_len"
1508 The default width is 12n.
1514 macro generates text for use in the
1518 .Dl Usage: .Rv Oo -std Oc Ao function Ac ...
1521 .Ql ".Rv -std atexit"
1524 .Bd -ragged -offset -indent
1525 \# a small hack to suppress a warning message
1526 .ds section-old "\*[section]
1529 .ds section "\*[section-old]
1535 option is valid only for manual page sections\~2 and\~3.
1536 Currently, this macro does nothing if used without the
1540 .Ss "Interactive Commands"
1544 macro designates an interactive or internal command.
1546 .Dl Usage: .Ic Ao argument Ac ...
1548 .Bl -tag -xwidth ".Li .Ic\ setenv\ ,\ unsetenv" -compact -offset 15n
1551 .It Li ".Ic \*[q]do while {...}\*[q]"
1552 .Ic "do while {...}"
1553 .It Li ".Ic setenv , unsetenv"
1554 .Ic setenv , unsetenv
1558 The default width is 12n.
1564 macro is used to specify the library where a particular function is compiled
1567 .Dl Usage: .Lb Ao argument Ac ...
1569 Available arguments to
1571 and their results are:
1574 .Bl -tag -xwidth ".Li libossaudio" -compact -offset indent
1612 Local, OS-specific additions might be found in the file
1614 look for strings named
1617 then denotes the keyword to be used with the
1625 literal macro may be used for special characters, variable constants, etc.\&
1626 -- anything which should be displayed as it would be typed.
1628 .Dl Usage: .Li Ao argument Ac ...
1630 .Bl -tag -xwidth ".Li .Li\ cntrl-D\ )\ ," -compact -offset 15n
1633 .It Li ".Li M1 M2 M3 ;"
1635 .It Li ".Li cntrl-D ) ,"
1637 .It Li ".Li 1024 ..."
1642 The default width is 16n.
1648 macro is used for the document title or subject name.
1649 It has the peculiarity of remembering the first argument it was called with,
1650 which should always be the subject name of the page.
1651 When called without arguments,
1653 regurgitates this initial name for the sole purpose of making less work for
1655 Note: A section two or three document function name is addressed with the
1663 and remaining sections.
1664 For interactive commands, such as the
1670 macro should be used.
1676 it can not recall the first argument it was invoked with.
1678 .Dl Usage: .Nm Oo Ao argument Ac Oc ...
1680 .Bl -tag -xwidth ".Li .Nm\ groff_mdoc" -compact -offset 15n
1681 .It Li ".Nm groff_mdoc"
1683 .It Li ".Nm \e-mdoc"
1685 .It Li ".Nm foo ) ) ,"
1692 The default width is 10n.
1698 macro places option brackets around any remaining arguments on the
1699 command line, and places any trailing punctuation outside the brackets.
1704 (which produce an opening and a closing option bracket respectively) may be used
1705 across one or more lines or to specify the exact position of the closing
1708 .Dl Usage: .Op Oo Ao option Ac Oc ...
1710 .Bl -tag -xwidth ".Li .Op\ Fl\ c\ Ar\ objfil\ Op\ Ar\ corfil\ ," -compact -offset 15n
1715 .It Li ".Op Fl k ) ."
1717 .It Li ".Op Fl k Ar kookfile"
1718 .Op Fl k Ar kookfile
1719 .It Li ".Op Fl k Ar kookfile ,"
1720 .Op Fl k Ar kookfile ,
1721 .It Li ".Op Ar objfil Op Ar corfil"
1722 .Op Ar objfil Op Ar corfil
1723 .It Li ".Op Fl c Ar objfil Op Ar corfil ,"
1724 .Op Fl c Ar objfil Op Ar corfil ,
1725 .It Li ".Op word1 word2"
1727 .It Li ".Li .Op Oo Ao option Ac Oc ..."
1728 .Li .Op Oo Ao options Ac Oc ...
1731 Here a typical example of the
1737 .Bd -literal -offset indent
1739 \&.Op Fl k Ar kilobytes
1740 \&.Op Fl i Ar interval
1748 .Bd -filled -offset indent
1750 .Op Fl k Ar kilobytes
1751 .Op Fl i Ar interval
1757 The default width values of
1761 are 14n and 10n, respectively.
1767 macro formats path or file names.
1768 If called without arguments, the
1770 string is output, which represents the current user's home directory.
1772 .Dl Usage: .Pa Oo Ao pathname Ac Oc ...
1774 .Bl -tag -xwidth ".Li .Pa\ /tmp/fooXXXXX\ )\ ." -compact -offset 15n
1777 .It Li ".Pa /usr/share"
1779 .It Li ".Pa /tmp/fooXXXXX ) ."
1780 .Pa /tmp/fooXXXXX ) .
1784 The default width is 32n.
1790 macro replaces standard abbreviations with their formal names.
1792 .Dl Usage: .St Ao abbreviation Ac ...
1795 .Dq Abbreviation/Formal Name
1801 .Bl -tag -xwidth ".Li -iso9945-1-90" -compact -offset indent
1816 .Bl -tag -xwidth ".Li -p1003.1g-2000" -compact -offset indent
1817 .It Li -iso9945-1-90
1819 .It Li -iso9945-1-96
1833 .It Li -p1003.1g-2000
1841 Part 2: Shell and Utilities
1843 .Bl -tag -xwidth ".Li -p1003.1g-2000" -compact -offset indent
1844 .It Li -iso9945-2-93
1856 .Bl -tag -xwidth ".Li -p1003.1g-2000" -compact -offset indent
1885 .Bl -tag -xwidth ".Li -p1003.1g-2000" -compact -offset indent
1892 .Ss "Variable Types"
1896 macro may be used whenever a type is referenced.
1899 section, it causes a line break (useful for old style variable declarations).
1901 .Dl Usage: .Vt Ao type Ac ...
1903 .Bl -tag -xwidth ".Li .Vt\ extern\ char\ *optarg\ ;" -compact -offset 15n
1904 .It Li ".Vt extern char *optarg ;"
1905 .Vt extern char *optarg ;
1912 Generic variable reference.
1914 .Dl Usage: .Va Ao variable Ac ...
1916 .Bl -tag -xwidth ".Li .Va\ Xchar\ sX\ ]\ )\ )\ ," -compact -offset 15n
1919 .It Li ".Va settimer ,"
1921 .It Li ".Va \*[q]int *prt\*[q] ) :"
1923 .It Li ".Va \*[q]char s\*[q] ] ) ) ,"
1924 .Va "char s" ] ) ) ,
1928 The default width is 12n.
1930 .Ss "Manual Page Cross References"
1934 macro expects the first argument to be a manual page name.
1935 The optional second argument, if a string (defining the manual section), is
1936 put into parentheses.
1938 .Dl Usage: .Xr Ao man page name Ac Oo Ao section Ac Oc ...
1940 .Bl -tag -xwidth ".Li .Xr\ xinit\ 1x\ ;" -compact -offset 15n
1947 .It Li ".Xr xinit 1x ;"
1952 The default width is 10n.
1955 .Sh "GENERAL TEXT DOMAIN"
1960 .Dl Usage: .At Oo Ao version Ac Oc ...
1962 .Bl -tag -xwidth ".Li .At\ v6\ ." -compact -offset 15n
1969 The following values for
1973 .Dl 32v, v1, v2, v3, v4, v5, v6, v7, V, V.1, V.2, V.3, V.4
1978 .Dl "Usage: .Bx" Bro -alpha | -beta | -devel Brc ...
1979 .Dl " .Bx" Oo Ao version Ac Oo Ao release Ac Oc Oc ...
1981 .Bl -tag -xwidth ".Li .Bx\ -devel" -compact -offset 15n
1986 .It Li ".Bx \-devel"
1991 will be prepended to the string
1993 The following values for
1997 .Dl Reno, reno, Tahoe, tahoe, Lite, lite, Lite2, lite2
2002 .Dl Usage: .Nx Oo Ao version Ac Oc ...
2004 .Bl -tag -xwidth ".Li .Nx\ 1.4\ ." -compact -offset 15n
2011 For possible values of
2013 see the description of the
2015 request above in section
2016 .Sx "TITLE MACROS" .
2021 .Dl Usage: .Fx Oo Ao version Ac Oc ...
2023 .Bl -tag -xwidth ".Li .Fx\ 2.2\ ." -compact -offset 15n
2030 For possible values of
2032 see the description of the
2034 request above in section
2035 .Sx "TITLE MACROS" .
2040 .Dl Usage: .Ox Oo Ao version Ac Oc ...
2042 .Bl -tag -xwidth ".Li .Ox\ 1.0" -compact -offset 15n
2050 .Dl Usage: .Bsx Oo Ao version Ac Oc ...
2052 .Bl -tag -xwidth ".Li .Bsx\ 1.0" -compact -offset 15n
2062 .Bl -tag -xwidth ".Li .Ux" -compact -offset 15n
2067 .Ss "Emphasis Macro"
2069 Text may be stressed or emphasized with the
2072 The usual font for emphasis is italic.
2074 .Dl Usage: .Em Ao argument Ac ...
2076 .Bl -tag -xwidth ".Li .Em\ vide\ infra\ )\ )\ ," -compact -offset 15n
2077 .It Li ".Em does not"
2079 .It Li ".Em exceed 1024 ."
2081 .It Li ".Em vide infra ) ) ,"
2082 .Em vide infra ) ) ,
2086 The default width is 10n.
2092 font mode must be ended with the
2094 macro (the latter takes no arguments).
2095 Font modes may be nested within other font modes.
2098 has the following syntax:
2100 .Dl .Bf Ao font mode Ac
2103 must be one of the following three types:
2105 .Bl -tag -xwidth ".Sy \&Sy | Fl symbolic" -compact -offset indent
2106 .It Sy \&Em | Fl emphasis
2109 macro was used for the entire block of text.
2110 .It Sy \&Li | Fl literal
2113 macro was used for the entire block of text.
2114 .It Sy \&Sy | Fl symbolic
2117 macro was used for the entire block of text.
2120 Both macros are neither callable nor parsed.
2122 .Ss "Enclosure and Quoting Macros"
2124 The concept of enclosure is similar to quoting.
2125 The object being to enclose one or more strings between a pair of characters
2126 like quotes or parentheses.
2127 The terms quoting and enclosure are used interchangeably throughout this
2129 Most of the one-line enclosure macros end in small letter
2131 to give a hint of quoting, but there are a few irregularities.
2132 For each enclosure macro there is also a pair of open and close macros which
2133 end in small letters
2143 .Bd -filled -offset 4n
2144 .Bl -column "quote" "close" "open" "Angle Bracket Enclosure" "`string' or string"
2145 .Em Quote Ta Em Open Ta Em Close Ta Em Function Ta Em Result
2146 .No .Aq Ta .Ao Ta .Ac Ta "Angle Bracket Enclosure" Ta Ao string Ac
2147 .No .Bq Ta .Bo Ta .Bc Ta "Bracket Enclosure" Ta Bo string Bc
2148 .No .Brq Ta .Bro Ta .Brc Ta "Brace Enclosure" Ta Bro string Brc
2149 .No .Dq Ta .Do Ta .Dc Ta "Double Quote" Ta Do string Dc
2150 .No .Eq Ta .Eo Ta .Ec Ta "Enclose String (in XX)" Ta XXstringXX
2151 .No .Pq Ta .Po Ta .Pc Ta "Parenthesis Enclosure" Ta Po string Pc
2152 .No .Ql Ta Ta Ta "Quoted Literal" Ta So string Sc or Li string
2153 .No .Qq Ta .Qo Ta .Qc Ta "Straight Double Quote" Ta Qo string Qc
2154 .No .Sq Ta .So Ta .Sc Ta "Single Quote" Ta So string Sc
2158 All macros ending with
2162 have a default width value of 12n.
2164 .Bl -tag -xwidth ".Li .Ec , .Eo"
2166 These macros expect the first argument to be the opening and closing strings
2169 Due to the nine-argument limit in the original troff program two other
2170 macros have been implemented which are now rather obsolete:
2172 takes the first and second parameter as the left and right enclosure string,
2173 which are then used to enclose the arguments of
2175 The default width value is 12n for both macros.
2177 The first and second arguments of this macro are the opening and
2178 closing strings respectively, followed by the arguments to be enclosed.
2180 The quoted literal macro behaves differently in troff and nroff mode.
2183 a quoted literal is always quoted.
2184 If formatted with troff, an item is only quoted if the width of the item is
2185 less than three constant width characters.
2186 This is to make short strings more visible where the font change to literal
2187 (constant width) is less noticeable.
2189 The default width is 16n.
2191 The prefix macro suppresses the whitespace between its first and second
2194 .Bl -tag -xwidth ".Li .Pf\ (\ Fa\ name2" -offset indent
2195 .It Li ".Pf ( Fa name2"
2200 The default width is 12n.
2204 macro (see below) performs the analogous suffix function.
2208 macro inserts an apostrophe and exits any special text modes, continuing in
2214 Examples of quoting:
2217 .Bl -tag -xwidth ".Li .Bq\ Em\ Greek\ ,\ French\ ." -compact -offset indent
2220 .It Li ".Aq Pa ctype.h ) ,"
2224 .It Li ".Bq Em Greek , French ."
2225 .Bq Em Greek , French .
2228 .It Li ".Dq string abc ."
2230 .It Li ".Dq \'^[A-Z]\'"
2232 .It Li ".Ql man mdoc"
2236 .It Li ".Qq string ) ,"
2238 .It Li ".Qq string Ns ),"
2244 .It Li ".Em or Ap ing"
2249 For a good example of nested enclosure macros, see the
2252 It was created from the same underlying enclosure macros as those presented
2258 extended argument list macros are discussed below.
2260 .Ss "No-Op or Normal Text Macro"
2264 macro can be used in a macro command line for parameters which should
2271 if you really want that English word (and not the macro) as a parameter.
2273 .Dl Usage: .No Ao argument Ac ...
2275 .Bl -tag -xwidth ".Li .No\ test\ Ta\ with\ Ta\ tabs" -compact -offset 15n
2276 .It Li ".No test Ta with Ta tabs"
2277 .No test Ta with Ta tabs
2281 The default width is 12n.
2283 .Ss "No-Space Macro"
2287 macro suppresses insertion of a space between the current position and its
2289 For example, it is useful for old style argument lists where there is no
2290 space between the flag and argument:
2292 .Dl "Usage:" ... Ao argument Ac \&Ns Oo Ao argument Ac Oc ...
2293 .Dl " " .Ns Ao argument Ac ...
2295 .Bl -tag -xwidth ".Li .Op\ Fl\ I\ Ns\ Ar\ directory" -compact -offset 15n
2296 .It Li ".Op Fl I Ns Ar directory"
2297 .Op Fl I Ns Ar directory
2302 macro always invokes the
2304 macro after eliminating the space unless another macro name follows it.
2305 If used as a request (i.e., the second form above in the
2312 .Ss "Section Cross References"
2316 macro designates a reference to a section header within the same document.
2318 .Dl Usage: .Sx Ao section reference Ac ...
2320 .Bl -tag -xwidth ".Li .Sx\ FILES" -offset 15n
2326 The default width is 16n.
2330 The symbolic emphasis macro is generally a boldface macro in either the
2331 symbolic sense or the traditional English usage.
2333 .Dl Usage: .Sy Ao symbol Ac ...
2335 .Bl -tag -xwidth ".Li .Sy\ Important\ Notice" -compact -offset 15n
2336 .It Li ".Sy Important Notice"
2337 .Sy Important Notice
2341 The default width is 6n.
2343 .Ss Mathematical Symbols
2345 Use this macro for mathematical symbols and similar things.
2347 .Dl Usage: .Ms Ao math symbol Ac ...
2349 .Bl -tag -xwidth ".Li .Ms\ sigma" -compact -offset 15n
2355 The default width is 6n.
2357 .Ss "References and Citations"
2359 The following macros make a modest attempt to handle references.
2360 At best, the macros make it convenient to manually drop in a subset of
2364 .Bl -tag -width 6n -offset indent -compact
2366 Reference start (does not take arguments).
2367 Causes a line break in the
2369 section and begins collection of reference information until the reference
2372 Reference end (does not take arguments).
2373 The reference is printed.
2375 Reference author name; one name per invocation.
2379 City/place (not implemented yet).
2383 Issuer/publisher name.
2389 Optional information.
2393 Corporate or foreign author.
2402 Macros beginning with
2404 are not callable but accept multiple arguments in the usual way.
2407 macro is handled properly as a parameter; other macros will cause strange
2412 can be used outside of the
2418 .Bd -literal -offset indent
2422 \&.%T "Implementation Notes on foobar(1)"
2423 \&.%R "Technical Report ABC-DE-12-345"
2424 \&.%Q "Drofnats College, Nowhere"
2431 .Bd -ragged -offset indent
2435 .%T "Implementation Notes on foobar(1)"
2436 .%R "Technical Report ABC-DE-12-345"
2437 .%Q "Drofnats College, Nowhere"
2442 .Ss "Trade Names (or Acronyms and Type Names)"
2444 The trade name macro prints its arguments in a smaller font.
2445 Its intended use is to imitate a small caps fonts for uppercase acronyms.
2447 .Dl Usage: .Tn Ao symbol Ac ...
2449 .Bl -tag -xwidth ".Li .Tn\ ASCII" -compact -offset 15n
2457 The default width is 10n.
2459 .Ss "Extended Arguments"
2465 macros allow one to extend an argument list on a macro boundary for the
2472 are implemented similarly to all other macros opening and closing an
2473 enclosure (without inserting characters, of course).
2474 This means that the following is true for those macros also.
2476 Here is an example of
2478 using the space mode macro to turn spacing off:
2480 .Bd -literal -offset indent
2482 \&.It Xo Sy I Ar operation
2483 \&.No \een Ar count No \een
2491 .Bd -filled -offset indent
2494 .It Xo Sy I Ar operation
2495 .No \en Ar count No \en
2504 .Bd -literal -offset indent
2506 \&.It Cm S No / Ar old_pattern Xo
2507 \&.No / Ar new_pattern
2516 .Bd -filled -offset indent
2519 .It Cm S No \&/ Ar old_pattern Xo
2520 .No \&/ Ar new_pattern
2530 and enclosure macros: Test the value of a variable.
2532 .Bd -literal -offset indent
2535 \&.Oo \e&! Oc Ns Ar variable Oo
2536 \&.Ar operator variable ...
2543 .Bd -filled -offset indent
2544 .Bl -tag -width flag -compact
2547 .Oo \&! Oc Ns Ar variable Oo
2548 .Ar operator variable ...
2555 .Sh "PAGE STRUCTURE DOMAIN"
2557 .Ss "Section Headers"
2561 section header macros are required in every man page.
2562 The remaining section headers are recommended at the discretion of the
2563 author writing the manual page.
2566 macro is parsed but not generally callable.
2567 It can be used as an argument in a call to
2569 only; it then reactivates the default font for
2572 The default width is 8n.
2574 .Bl -tag -xwidth ".Li .Sh\ RETURN\ VALUES"
2579 If not specified, headers, footers and page layout defaults will not be set
2580 and things will be rather unpleasant.
2583 section consists of at least three items.
2586 name macro naming the subject of the man page.
2587 The second is the name description macro,
2589 which separates the subject name from the third item, which is the
2591 The description should be the most terse and lucid possible, as the space
2597 then all its arguments.
2599 .It Li ".Sh LIBRARY"
2600 This section is for section two and three function calls.
2601 It should consist of a single
2605 .Sx "Library Names" .
2607 .It Li ".Sh SYNOPSIS"
2610 section describes the typical usage of the subject of a man page.
2611 The macros required are either
2622 The function name macro
2624 is required for manual page sections\~2 and\~3; the command and general name
2627 is required for sections 1, 5, 6, 7, and\~8.
2628 Section\~4 manuals require a
2633 configuration device usage macro.
2634 Several other macros may be necessary to produce the synopsis line as shown
2637 .Bd -filled -offset indent
2645 The following macros were used:
2648 .Dl ".Op Fl benstuv"
2652 .It Li ".Sh DESCRIPTION"
2653 In most cases the first text in the
2655 section is a brief paragraph on the command, function or file, followed by a
2656 lexical list of options and respective explanations.
2657 To create such a list, the
2664 macros are used (see
2665 .Sx Lists and Columns
2668 .It Li ".Sh IMPLEMENTATION NOTES"
2669 Implementation specific information should be placed here.
2671 .It Li ".Sh RETURN VALUES"
2672 Sections 2, 3 and\~9 function return values should go here.
2675 macro may be used to generate text for use in the
2677 section for most section 2 and 3 library functions;
2679 .Sx "Return Values" .
2685 section headers are part of the preferred manual page layout and must be
2686 used appropriately to maintain consistency.
2687 They are listed in the order in which they would be used.
2689 .Bl -tag -xwidth ".Li .Sh\ COMPATIBILITY"
2690 .It Li ".Sh ENVIRONMENT"
2693 section should reveal any related environment variables and clues to their
2694 behavior and/or usage.
2697 Files which are used or created by the man page subject should be listed via
2704 .It Li ".Sh EXAMPLES"
2705 There are several ways to create examples.
2708 section below for details.
2710 .It Li ".Sh DIAGNOSTICS"
2711 Diagnostic messages from a command should be placed in this section.
2713 .It Li ".Sh COMPATIBILITY"
2714 Known compatibility issues (e.g. deprecated options or parameters)
2715 should be listed here.
2718 Specific error handling, especially from library functions (man page
2719 sections 2, 3, and\~9) should go here.
2722 macro is used to specify an error (errno).
2724 .It Li ".Sh SEE ALSO"
2725 References to other material on the man page topic and cross references to
2726 other relevant man pages should be placed in the
2729 Cross references are specified using the
2734 style references are not accommodated.
2736 It is recommended that the cross references are sorted on the section
2737 number, then alphabetically on the names within a section, and placed
2738 in that order and comma separated.
2746 .It Li ".Sh STANDARDS"
2747 If the command, library function or file adheres to a specific
2748 implementation such as
2752 this should be noted here.
2753 If the command does not adhere to any standard, its history should be noted
2758 .It Li ".Sh HISTORY"
2759 Any command which does not adhere to any specific standards should be
2760 outlined historically in this section.
2762 .It Li ".Sh AUTHORS"
2763 Credits should be placed here.
2766 macro should be used to specify the name(s) of the person(s).
2769 Blatant problems with the topic go here.
2775 sections may be added; for example, this section was set with:
2777 .Bd -literal -offset 15n
2778 \&.Sh "PAGE STRUCTURE DOMAIN"
2781 .Ss "Subsection Headers"
2783 Subsection headers have exactly the same syntax as section headers:
2785 is parsed but not generally callable.
2786 It can be used as an argument in a call to
2788 only; it then reactivates the default font for
2791 The default width is 8n.
2793 .Ss "Paragraphs and Line Spacing"
2795 .Bl -tag -xwidth ".Li .Pp"
2799 paragraph command may be used to specify a line space where necessary.
2800 The macro is not necessary after a
2808 macro (which both assert a vertical distance unless the
2812 The macro is neither callable nor parsed and takes no arguments; an
2819 .\" This worked with version one, need to redo for version three
2822 .\" .Cw (ax+bx+c) \ is\ produced\ by\ \&
2823 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2840 .\" .Em is produced by
2856 .\" This example shows the same equation in a different format.
2860 .\" signs were forced with
2864 .\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
2865 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2876 .\" .Li \&.Cx \e\ +\e\ \e&
2887 .\" .Em is produced by
2895 .\" .Li \&.Cx \e\ +\e\ \e&
2906 .\" The incantation below was
2912 .\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
2914 .\" .Li \&.Cx Op Sy ?/
2924 .\" .Em is produced by
2926 .\" .Li \&.Ar \e\ b1 e1 f1
2940 The only keep that is implemented at this time is for words.
2947 The only option that
2949 accepts currently is
2951 (this is also the default if no option is given) which is useful for
2952 preventing line breaks in the middle of options.
2953 In the example for the make command line arguments (see
2954 .Sx What's in a Name ) ,
2957 from placing up the flag and the argument on separate lines.
2959 Both macros are neither callable nor parsed.
2961 More work needs to be done with the keep macros; specifically, a
2963 option should be added.
2965 .Ss "Examples and Displays"
2967 There are seven types of displays.
2969 .Bl -tag -xwidth ".Li .D1"
2972 Display one line of indented text.
2973 This macro is parsed but not callable.
2977 The above was produced by:
2978 .Li ".D1 Fl ldghfstru" .
2982 Display one line of indented
2987 example macro has been used throughout this file.
2988 It allows the indentation (display) of one line of text.
2989 Its default font is set to constant width (literal).
2991 is parsed but not callable.
2993 .Dl % ls -ldg /usr/local/bin
2995 The above was produced by:
2996 .Li ".Dl % ls -ldg /usr/local/bin" .
3002 display must be ended with the
3005 It has the following syntax:
3007 .Bl -tag -xwidth ".Li .Bd" -offset indent
3009 .Bro \-literal | \-filled | \-unfilled | \-ragged | \-centered Brc
3010 .Oo \-offset Ao string Ac Oc Oo \-file Ao file name Ac Oc Oo \-compact Oc Xc
3014 .Bl -tag -xwidth ".Fl file Ao Ar file name Ac " -compact
3016 Fill, but do not adjust the right margin (only left-justify).
3018 Center lines between the current left and right margin.
3019 Note that each single line is centered.
3021 Do not fill; display a block of text as typed, using line breaks as
3022 specified by the user.
3023 This can produce overlong lines without warning messages.
3025 Display a filled block.
3026 The block of text is formatted (i.e., the text is justified on both the left
3029 Display block with literal font (usually fixed-width).
3030 Useful for source code or simple tabbed or spaced text.
3031 .It Fl file Ao Ar file name Ac
3032 The file whose name follows the
3034 flag is read and displayed before any data enclosed with
3038 using the selected display type.
3040 .Xr troff/ Ns Nm \-mdoc
3041 commands in the file will be processed.
3042 .It Fl offset Ao Ar string Ac
3045 is specified with one of the following strings, the string is interpreted to
3046 indicate the level of indentation for the forthcoming block of text:
3049 .Bl -tag -xwidth ".Ar indent-two" -compact
3051 Align block on the current left margin; this is the default mode of
3054 Supposedly center the block.
3055 At this time unfortunately, the block merely gets left aligned about an
3056 imaginary center margin.
3058 Indent by one default indent value or tab.
3059 The default indent value is also used for the
3063 macros, so one is guaranteed the two types of displays will line up.
3064 The indentation value is normally set to\~6n or about two thirds of an inch
3065 (six constant width characters).
3067 Indent two times the default indent value.
3071 aligns the block about two inches from the right side of the page.
3072 This macro needs work and perhaps may never do the right thing within
3079 is a valid numeric expression instead
3080 .Pf ( Em with a scale indicator other than
3082 use that value for indentation.
3083 The most useful scale indicators are
3087 specifying the so-called
3091 This is approximately the width of the letter
3095 of the current font (for nroff output, both scale indicators give the same
3099 isn't a numeric expression, it is tested whether it is an
3101 macro name, and the default offset value associated with this macro is used.
3102 Finally, if all tests fail,
3105 (typeset with a fixed-width font) is taken as the offset.
3107 Suppress insertion of vertical space before begin of display.
3111 End display (takes no arguments).
3114 .Ss "Lists and Columns"
3116 There are several types of lists which may be initiated with the
3119 Items within the list are specified with the
3121 item macro, and each list must end with the
3124 Lists may be nested within themselves and within displays.
3125 The use of columns inside of lists or lists inside of columns is unproven.
3127 In addition, several list attributes may be specified such as the width of a
3128 tag, the list offset, and compactness (blank lines between items allowed or
3130 Most of this document has been formatted with a tag style list
3133 It has the following syntax forms:
3136 .Bl -tag -xwidth ".Li .Bl" -offset indent -compact
3138 .Bro \-hang | \-ohang | \-tag | \-diag | \-inset Brc
3139 .Oo \-width Ao string Ac Oc Oo \-xwidth Ao command Ac Oc
3140 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3142 .No \-column Oo \-offset Ao string Ac Oc
3143 .Ao string1 Ac Ao string2 Ac ... Xc
3145 .Bro \-item | \-enum Oo \-nested Oc | \-bullet | \-hyphen | \-dash Brc
3146 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3150 And now a detailed description of the list types.
3153 .Bl -tag -xwidth ".Fl column" -compact
3157 .Bd -literal -offset indent
3158 \&.Bl -bullet -offset indent -compact
3160 Bullet one goes here.
3170 .Bl -bullet -offset indent -compact
3172 Bullet one goes here.
3178 .It Fl dash No ( or Fl hyphen )
3181 .Bd -literal -offset indent
3182 \&.Bl -dash -offset indent -compact
3194 .Bl -dash -offset indent -compact
3205 .Bd -literal -offset indent
3206 \&.Bl -enum -offset indent -compact
3218 .Bl -enum -offset indent -compact
3226 If you want to nest enumerated lists, use the
3228 flag (starting with the second-level list):
3230 .Bd -literal -offset indent
3231 \&.Bl -enum -offset indent -compact
3234 \&.Bl -enum -nested -compact
3238 And item three here.
3249 .Bl -enum -offset indent -compact
3252 .Bl -enum -nested -compact
3256 And item three here.
3266 without list markers.
3268 .Bd -literal -offset indent
3269 \&.Bl -item -offset indent
3285 .Bl -item -offset indent
3303 to specify the tag width.
3306 .Bl -tag -width "PPID" -compact -offset indent
3308 sleep time of the process (seconds blocked)
3312 resulting from references by the process
3313 to pages not loaded in core.
3315 numerical user-id of process owner
3317 numerical id of parent of process priority
3318 (non-positive when in non-interruptible wait)
3324 .Bd -literal -offset indent
3325 \&.Bl -tag -width "PPID" -compact -offset indent
3327 sleep time of the process (seconds blocked)
3331 resulting from references by the process
3332 to pages not loaded in core.
3334 numerical user-id of process owner
3336 numerical id of parent of process priority
3337 (non-positive when in non-interruptible wait)
3343 Diag lists create section four diagnostic lists and are similar to inset
3344 lists except callable macros are ignored.
3349 are not meaningful in this context.
3353 .Bd -literal -offset indent
3355 \&.It You can't use Sy here.
3356 The message says all.
3364 .It You can't use Sy here.
3365 The message says all.
3370 A list with hanging tags.
3372 .Bl -hang -offset indent
3374 labels appear similar to tagged lists when the
3375 label is smaller than the label width.
3376 .It Em Longer hanged list labels
3377 blend into the paragraph unlike
3378 tagged paragraph labels.
3381 And the unformatted text which created it:
3383 .Bd -literal -offset indent
3384 \&.Bl -hang -offset indent
3386 labels appear similar to tagged lists when the
3387 label is smaller than the label width.
3388 \&.It Em Longer hanged list labels
3389 blend into the paragraph unlike
3390 tagged paragraph labels.
3396 Lists with overhanging tags do not use indentation for the items; tags are
3397 written to a separate line.
3399 .Bl -ohang -offset indent
3401 sleep time of the process (seconds blocked)
3405 resulting from references by the process
3406 to pages not loaded in core.
3408 numerical user-id of process owner
3410 numerical id of parent of process priority
3411 (non-positive when in non-interruptible wait)
3417 .Bd -literal -offset indent
3418 \&.Bl -ohang -offset indent
3420 sleep time of the process (seconds blocked)
3424 resulting from references by the process
3425 to pages not loaded in core.
3427 numerical user-id of process owner
3429 numerical id of parent of process priority
3430 (non-positive when in non-interruptible wait)
3436 Here is an example of inset labels:
3437 .Bl -inset -offset indent
3439 The tagged list (also called a tagged paragraph)
3440 is the most common type of list used in the
3444 attribute as described below.
3446 Diag lists create section four diagnostic lists
3447 and are similar to inset lists except callable
3450 Hanged labels are a matter of taste.
3452 Overhanging labels are nice when space is constrained.
3454 Inset labels are useful for controlling blocks of
3455 paragraphs and are valuable for converting
3457 manuals to other formats.
3460 Here is the source text which produced the above example:
3462 .Bd -literal -offset indent
3463 \&.Bl -inset -offset indent
3465 The tagged list (also called a tagged paragraph)
3466 is the most common type of list used in the
3469 Diag lists create section four diagnostic lists
3470 and are similar to inset lists except callable
3473 Hanged labels are a matter of taste.
3475 Overhanging labels are nice when space is constrained.
3477 Inset labels are useful for controlling blocks of
3478 paragraphs and are valuable for converting
3480 manuals to other formats.
3486 This list type generates multiple columns.
3487 The number of columns and the width of each column is determined by the
3493 argument is parsed to make a row, each column within the row is a separate
3494 argument separated by a tab or the
3500 .Bl -column -offset indent String Nroff Troff
3501 .It Sy String Ta Sy Nroff Ta Sy Troff
3502 .It Li <= Ta <= Ta \*(<=
3503 .It Li >= Ta >= Ta \*(>=
3509 .Bd -literal -offset indent
3510 \&.Bl -column -offset indent String Nroff Troff
3511 \&.It Sy String Ta Sy Nroff Ta Sy Troff
3512 \&.It Li <= Ta <= Ta \e*(<=
3513 \&.It Li >= Ta >= Ta \e*(>=
3521 .Bl -tag -xwidth ".Fl indent Ao Ar string Ac"
3522 .It Fl width Ao Ar string Ac
3525 is a valid numeric expression
3526 .Pf ( Em with a scale indicator other than
3528 use that value for indentation.
3529 The most useful scale indicators are
3533 specifying the so-called
3537 This is approximately the width of the letter
3541 of the current font (for nroff output, both scale indicators give the same
3545 isn't a numeric expression, it is tested whether it is an
3547 macro name, and the default offset value associated with this macro is used.
3548 Finally, if all tests fail,
3551 (typeset with a fixed-width font) is taken as the offset.
3553 If a width is not specified for the tag list type, every time
3555 is invoked, an attempt is made to determine an appropriate width.
3556 If the first argument to
3558 is a callable macro, the default width for that macro will be used;
3559 otherwise, the default width of
3562 .It Fl xwidth Ao Ar string Ac
3565 and use the width of the result.
3566 Almost all lists in this document use this option.
3570 .Bd -literal -offset indent
3571 \&.Bl -tag -xwidth ".Fl test Ao Ar string Ac"
3572 \&.It Fl test Ao Ar string Ac
3573 This is a longer sentence to show how the
3575 flag works in combination with a tag list.
3582 .Bl -tag -xwidth ".Fl test Ao Ar string Ac"
3583 .It Fl test Ao Ar string Ac
3584 This is a longer sentence to show how the
3586 flag works in combination with a tag list.
3590 Note that the current state of
3594 is interpreted; afterwards, all variables are restored again.
3595 However, boxes (used for enclosures) can't be saved in
3598 as a consequence, arguments must always be
3600 to avoid nasty errors.
3601 For example, do not write
3605 instead if you really need only an opening angle bracket.
3606 .It Fl offset Ao Ar string Ac
3611 a default indent value (normally set to\~6n, similar to the value used in
3618 is a valid numeric expression instead
3619 .Pf ( Em with a scale indicator other than
3621 use that value for indentation.
3622 The most useful scale indicators are
3626 specifying the so-called
3630 This is approximately the width of the letter
3634 of the current font (for nroff output, both scale indicators give the same
3638 isn't a numeric expression, it is tested whether it is an
3640 macro name, and the default offset value associated with this macro is used.
3641 Finally, if all tests fail,
3644 (typeset with a fixed-width font) is taken as the offset.
3646 Suppress insertion of vertical space before the list and between list items.
3650 .Sh "MISCELLANEOUS MACROS"
3652 Here a list of the remaining macros which do not fit well into one of the
3654 We couldn't find real examples for the following macros:
3658 They are documented here for completeness \- if you know how to use them
3659 properly please send a mail to
3660 .Mt bug-groff@gnu.org
3661 (including an example).
3663 .Bl -tag -xwidth ".Li .Bt"
3667 .Bd -ragged -offset indent
3671 It is neither callable nor parsed and takes no arguments.
3675 .Dl Usage: .Fr Ao function return value Ac ...
3677 Don't use this macro.
3678 It allows a break right before the return value (usually a single digit)
3679 which is bad typographical behaviour.
3682 to tie the return value to the previous word.
3685 Use this macro to include a (header) file literally.
3688 followed by the file name, then the contents of
3691 .Dl Usage: .Hf Ao file Ac
3693 It is neither callable nor parsed.
3699 Exact usage unknown.
3700 The documentation in the
3702 source file describes it as a macro for
3703 .Dq "menu entries" .
3705 Its default width is 6n.
3711 Exact usage unknown.
3712 The documentation in the
3714 source file describes it as
3715 .Dq old function type (fortran) .
3718 Activate (toggle) space mode.
3720 .Dl Usage: .Sm Oo on | off Oc ...
3722 If space mode is off, no spaces between macro arguments are inserted.
3723 If called without a parameter (or if the next parameter is neither
3733 .Bd -ragged -offset indent
3737 It is neither callable nor parsed and takes no arguments.
3741 .Sh "PREDEFINED STRINGS"
3743 The following strings are predefined:
3745 .Bl -column String infinity "Troff " "straight double quote" -offset indent
3746 .It Sy String Ta Sy Nroff Ta Sy Troff Ta Sy Meaning
3747 .It Li <= Ta <= Ta \*[<=] Ta "less equal"
3748 .It Li >= Ta >= Ta \*[>=] Ta "greater equal"
3749 .It Li Rq Ta '' Ta \*[Rq] Ta "right double quote"
3750 .It Li Lq Ta `` Ta \*[Lq] Ta "left double quote"
3751 .It Li ua Ta ^ Ta \*[ua] Ta "upwards arrow"
3752 .It Li aa Ta \' Ta \*[aa] Ta "acute accent"
3753 .It Li ga Ta \` Ta \*[ga] Ta "grave accent"
3754 .It Li q Ta \&" Ta \*[q] Ta "straight double quote"
3755 .It Li Pi Ta pi Ta \*[Pi] Ta "greek pi"
3756 .It Li Ne Ta != Ta \*[Ne] Ta "not equal"
3757 .It Li Le Ta <= Ta \*[Le] Ta "less equal"
3758 .It Li Ge Ta >= Ta \*[Ge] Ta "greater equal"
3759 .It Li Lt Ta < Ta \*[Lt] Ta "less than"
3760 .It Li Gt Ta > Ta \*[Gt] Ta "greater than"
3761 .It Li Pm Ta +\- Ta \*[Pm] Ta "plus minus"
3762 .It Li If Ta infinity Ta \*[If] Ta "infinity"
3763 .It Li Na Ta \*[Na] Ta \*[Na] Ta "not a number"
3764 .It Li Ba Ta \*[Ba] Ta \*[Ba] Ta "vertical bar"
3767 The names of the columns
3771 are a bit misleading;
3775 representation, while
3777 gives the best glyph form available.
3778 For example, a Unicode enabled
3780 device will have proper glyph representations for all strings, whereas the
3781 enhancement for a Latin1
3783 device is only the plus-minus sign.
3785 String names which consist of two characters can be written as
3787 string names which consist of one character can be written as
3789 A generic syntax for a string name of any length is
3798 \#=====================================================================
3804 available in previous versions of
3806 has been removed since
3809 provides better facilities to check parameters; additionally, many error and
3810 warning messages have been added to this macro package, making it both more
3813 The only remaining debugging macro is
3815 which yields a register dump of all global registers and strings.
3816 A normal user will never need it.
3819 .Sh "FORMATTING WITH GROFF, TROFF, AND NROFF"
3821 By default, the package inhibits page breaks, headers, and footers if
3828 to make the manual more efficient for viewing on-line.
3829 This behaviour can be changed (e.g.\& to create a hardcopy of the
3831 output) by setting the register
3833 to zero while calling
3836 .Dl groff -Tlatin1 -rcR=0 -mdoc foo.man > foo.txt
3838 For double-sided printing, set register
3842 .Dl groff -Tps -rD1 -mdoc foo.man > foo.ps
3844 To change the document font size to 11pt or 12pt, set register
3848 .Dl groff -Tdvi -rS11 -mdoc foo.man > foo.dvi
3859 .Bl -tag -width mdoc/doc-ditroff -compact
3861 The main manual macro package.
3863 A wrapper file to call
3865 .It Pa mdoc/doc-common
3866 Common strings, definitions, stuff related typographic output.
3867 .It Pa mdoc/doc-nroff
3868 Definitions used for a
3871 .It Pa mdoc/doc-ditroff
3872 Definitions used for all other devices.
3874 Local additions and customizations.
3876 This file checks whether the
3880 package should be used.
3894 Section 3f has not been added to the header routines.
3897 font should be changed in
3902 needs to have a check to prevent splitting up
3903 if the line length is too short.
3905 separates the last parenthesis, and sometimes
3906 looks ridiculous if a line is in fill mode.
3908 The list and display macros do not do any keeps
3909 and certainly should be able to.
3910 .\" Note what happens if the parameter list overlaps a newline
3912 .\" to make sure a line boundary is crossed:
3914 .\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[]
3917 .\" produces, nudge nudge,
3918 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
3919 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
3921 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] .
3923 .\" If double quotes are used, for example:
3925 .\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q
3928 .\" produces, nudge nudge,
3929 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
3931 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
3933 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" .
3935 .\" Not a pretty sight...
3936 .\" In a paragraph, a long parameter containing unpaddable spaces as
3937 .\" in the former example will cause
3939 .\" to break the line and spread
3940 .\" the remaining words out.
3941 .\" The latter example will adjust nicely to
3942 .\" justified margins, but may break in between an argument and its
3946 .\" the right margin adjustment is normally ragged and the problem is