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 resp.\& the double quotes were omitted,
422 would see three arguments, and the result would be:
424 .Dl Fn fetch char *str
426 .\" For an example of what happens when the parameter list overlaps a newline
427 .\" boundary, see the
431 .Ss "Trailing Blank Space Characters"
434 can be confused by blank space characters at the end of a line.
435 It is a wise preventive measure to globally remove all blank spaces
437 .Ao blank-space Ac Ns Ao end-of-line Ac
439 Should the need arise to force a blank character at the end of a line, it
440 may be forced with an unpaddable space and the
446 .Ss "Escaping Special Characters"
448 Special characters like the newline character
450 are handled by replacing the
456 to preserve the backslash.
458 .Ss "Other Possible Pitfalls"
460 A warning is emitted when an empty input line is found outside of displays
465 (Well, it is even better to use
467 macros to avoid the usage of low-level commands.)
469 Leading spaces will cause a break and are output directly.
470 Avoid this behaviour if possible.
471 Similarly, do not use more than one space character between words in an
472 ordinary text line; contrary to other text formatters, they are
474 replaced with a single space.
478 directly as an argument.
487 inserts two space characters after a punctuation mark closing a sentence;
492 are treated transparently, not influencing the sentence-ending behaviour.
493 To change this, insert
495 before or after the dot:
497 .Bd -literal -offset indent
516 .Bd -filled -offset indent
533 As can be seen in the first and third line,
535 handles punctuation characters specially in macro arguments.
536 This will be explained in section
539 In the same way, you have to protect trailing full stops of abbreviations
540 with a trailing zero-width space:
543 A comment in the source file of a man page can be either started with
549 anywhere (the latter is a
552 extension); the rest of such a line is ignored.
555 .Sh "A MANUAL PAGE TEMPLATE"
557 The body of a man page is easily constructed from a basic template:
559 .Bd -literal -offset indent
560 \&.\e" The following requests are required for all man pages.
561 \&.Dd Month day, year
562 \&.Os [OPERATING_SYSTEM] [version/release]
563 \&.Dt DOCUMENT_TITLE [section number] [architecture/volume]
566 \&.Nd one line description of name
567 \&.\e" This next request is for sections 2 and 3 only.
571 \&.\e" The following requests should be uncommented and
572 \&.\e" used where appropriate.
573 \&.\e" .Sh IMPLEMENTATION NOTES
574 \&.\e" This next request is for sections 2, 3 and 9 function
575 \&.\e" return values only.
576 \&.\e" .Sh RETURN VALUES
577 \&.\e" This next request is for sections 1, 6, 7 and 8 only.
578 \&.\e" .Sh ENVIRONMENT
581 \&.\e" This next request is for sections 1, 6, 7, 8 and 9 only
582 \&.\e" (command return values (to shell) and
583 \&.\e" fprintf/stderr type diagnostics).
584 \&.\e" .Sh DIAGNOSTICS
585 \&.\e" .Sh COMPATIBILITY
586 \&.\e" This next request is for sections 2, 3 and 9 error
587 \&.\e" and signal handling only.
597 The first items in the template are the macros
602 the document date, the operating system the man page or subject source is
603 developed or modified for, and the man page title (in
605 along with the section of the manual the page belongs in.
606 These macros identify the page and are discussed below in
609 The remaining items in the template are section headers
617 The headers are discussed in
618 .Sx "PAGE STRUCTURE DOMAIN" ,
619 after presentation of
620 .Sx "MANUAL DOMAIN" .
621 Several content macros are used to demonstrate page layout macros; reading
622 about content macros before page layout macros is recommended.
627 In the description of all macros below, optional arguments are put into
631 represents zero or more additional arguments.
632 Alternative values for a parameter are separated with
634 If there are alternative values for a mandatory parameter, braces are used
637 to enclose the value set.
638 Meta-variables are specified within angles.
642 .Bl -tag -width 6n -offset indent
646 .Op \-test1 Op \-test2 | \-test3
652 Except stated explicitly, all macros are parsed and callable.
654 Most macros have a default width value which can be used to specify a label
664 It is recommended not to use this rather obscure feature to avoid
665 dependencies on local modifications of the
672 The title macros are part of the page structure domain but are presented
673 first and separately for someone who wishes to start writing a man page
675 Three header macros designate the document title or manual page title, the
676 operating system, and the date of authorship.
677 These macros are called once at the very beginning of the document and are
678 used to construct headers and footers only.
682 .Op Aq document title
683 .Op Aq section number
686 The document title is the subject of the man page and must be in
688 due to troff limitations.
692 The section number may be a number in the range
693 .No 1,\~ Ns ... Ns ,\~9
699 If it is specified, and no volume name is given, a default volume name is
704 .Tn \*[operating-system] ,
705 the following sections are defined:
707 .Bl -column LOCAL -offset indent -compact
708 .It Li 1 Ta "\*[volume-ds-1]"
709 .It Li 2 Ta "\*[volume-ds-2]"
710 .It Li 3 Ta "\*[volume-ds-3]"
711 .It Li 4 Ta "\*[volume-ds-4]"
712 .It Li 5 Ta "\*[volume-ds-5]"
713 .It Li 6 Ta "\*[volume-ds-6]"
714 .It Li 7 Ta "\*[volume-ds-7]"
715 .It Li 8 Ta "\*[volume-ds-8]"
716 .It Li 9 Ta "\*[volume-ds-9]"
720 A volume name may be arbitrary or one of the following:
723 .Bl -column LOCAL -offset indent -compact
724 .It Li USD Ta "\*[volume-ds-USD]"
725 .It Li PS1 Ta "\*[volume-ds-PS1]"
726 .It Li AMD Ta "\*[volume-ds-AMD]"
727 .It Li SMM Ta "\*[volume-ds-SMM]"
728 .It Li URM Ta "\*[volume-ds-URM]"
729 .It Li PRM Ta "\*[volume-ds-PRM]"
730 .It Li KM Ta "\*[volume-ds-KM]"
731 .It Li IND Ta "\*[volume-ds-IND]"
732 .It Li LOCAL Ta "\*[volume-ds-LOCAL]"
733 .It Li CON Ta "\*[volume-ds-CON]"
745 Values from the previous table will specify a new volume name.
746 If the third parameter is a keyword designating a computer architecture,
747 its value is appended to the volume name as specified by the second
748 parameter. By default, the following architecture keywords are defined:
750 \# we use `No' to avoid hyphenation
751 .Bd -ragged -offset indent
752 .No alpha , amiga , arc , arm26 , arm32 , atari , bebox , cobalt , evbsh3 ,
753 .No hp300 , hpcmips , i386 , luna68k , m68k , mac68k , macppc , mips ,
754 .No mmeye , mvme68k , news68k , newsmips , next68k , ofppc , pc532 , pmax ,
755 .No powerpc , prep , sgimips , sh3 , sparc , sparc64 , sun3 , tahoe , vax ,
760 In the following examples, the left (which is identical to the right) and
761 the middle part of the manual page header strings are shown.
764 .Bl -tag -width ".Li .Dt\ FOO\ 2\ mac68k" -compact -offset indent
767 .Ql System Reference Manual
768 .It Li ".Dt FOO 2 mac68k"
770 .Ql System Programmer's Manual (mac68k Architecture)
771 .It Li ".Dt FOO \*[q]\*[q] bar"
778 Local, OS-specific additions might be found in the file
780 look for strings named
782 (for the former type) and
784 (for the latter type);
786 then denotes the keyword to be used with the
790 This macro is neither callable nor parsed.
793 .Op Aq operating system
796 If the first parameter is empty,
798 .Sq Tn "\*[operating-system]"
800 This may be overridden in the local configuration file,
802 In general, the name of the operating system should be the common acronym,
807 The release should be the standard release nomenclature for the system
809 In the following table, the possible second arguments for some predefined
810 operating systems are listed.
813 local additions might be defined in
815 look for strings named
816 .Ql operating-system-XXX-YYY ,
819 is the acronym for the operating system and
824 .Bl -tag -width ".No FreeBSD" -offset indent
826 7th, 7, III, 3, V, V.2, V.3, V.4
828 3, 4, 4.1, 4.2, 4.3, 4.3t, 4.3T, 4.3r, 4.3R, 4.4
830 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,
833 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,
834 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,
842 an unknown second parameter will be replaced with the string
844 for the other predefined acronyms it will be ignored and a warning message
846 Unrecognized arguments are displayed as given in the page footer.
847 For instance, a typical footer might be:
852 .Ql 4.3\~Berkeley Distribution ,
853 or for a locally produced set
855 .Dl .Os CS Department
862 macro is not present, the bottom left corner of the manual page will be
865 This macro is neither callable nor parsed.
876 is used for the date string.
877 If it has exactly three arguments, they are concatenated, separated with
880 .Dl .Dd January 25, 2001
882 Otherwise, the current date is used, ignoring the parameters.
884 This macro is neither callable nor parsed.
888 .Sh "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS"
890 .Ss "What's in a Name" Ns ...
892 The manual domain macro names are derived from the day to day informal
893 language used to describe commands, subroutines and related files.
894 Slightly different variations of this language are used to describe the
895 three different aspects of writing a man page.
896 First, there is the description of
899 Second is the description of a
904 macros, and third, the description of a command to a user in the verbal
905 sense; that is, discussion of a command in the text of a man page.
909 macros are themselves a type of command; the general syntax for a troff
912 .Bd -filled -offset indent
913 .Li ".Xx argument1 argument2" ...
918 is a macro command or request, and anything following it are arguments to
920 In the second case, the description of a
922 command using the content macros is a bit more involved; a typical
924 command line might be displayed as:
926 .Bd -filled -offset indent
929 .Ao Ar infile Ac Ao Ar outfile Ac
935 is the command name and the
940 argument designated as optional by the option brackets.
949 in this example, the user has to replace the meta expressions given in angle
950 brackets with real file names.
951 Note that in this document meta arguments are used to describe
953 commands; in most man pages, meta variables are not specifically written
955 The macros which formatted the above example:
957 .Bd -literal -offset indent
960 \&.Ao Ar infile Ac Ao Ar outfile Ac
964 In the third case, discussion of commands and command syntax includes both
965 examples above, but may add more detail.
970 from the example above might be referred to as
974 Some command line argument lists are quite long:
977 .Bl -tag -width ".Nm make" -offset indent -compact
983 .Op Fl I Ar directory
985 .Op Ar variable Ns = Ns Ar value
993 Here one might talk about the command
995 and qualify the argument,
997 as an argument to the flag,
999 or discuss the optional file operand
1001 In the verbal context, such detail can prevent confusion, however the
1003 package does not have a macro for an argument
1008 argument macro is used for an operand or file argument like
1010 as well as an argument to a flag like
1012 The make command line was produced from:
1014 .Bd -literal -offset indent
1017 \&.Op Fl D Ar variable
1019 \&.Op Fl f Ar makefile
1020 \&.Op Fl I Ar directory
1021 \&.Op Fl j Ar max_jobs
1022 \&.Op Ar variable Ns = Ns Ar value
1033 macros are explained in
1036 .Ss "General Syntax"
1038 The manual domain and general text domain macros share a similar syntax with
1039 a few minor deviations; most notably,
1045 differ only when called without arguments; and
1049 impose an order on their argument lists.
1050 All content macros are capable of recognizing and properly handling
1051 punctuation, provided each punctuation character is separated by a leading
1053 If a request is given:
1055 .Dl \&.Ar sptr, ptr),
1061 The punctuation is not recognized and all is output in the
1064 If the punctuation is separated by a leading white space:
1066 .Dl \&.Ar "sptr , ptr ) ,"
1070 .Dl Ar sptr , ptr ) ,
1072 The punctuation is now recognized and output in the default font
1073 distinguishing it from the argument strings.
1074 To remove the special meaning from a punctuation character escape it with
1078 is limited as a macro language, and has difficulty when presented with a
1079 string containing a member of the mathematical, logical or quotation set:
1081 .Bd -literal -offset indent-two
1082 {+,\-,/,*,%,<,>,<=,>=,=,==,&,`,',"}
1088 may assume it is supposed to actually perform the operation or evaluation
1089 suggested by the characters.
1090 To prevent the accidental evaluation of these characters, escape them with
1092 Typical syntax is shown in the first content macro displayed below,
1100 The address macro identifies an address construct.
1102 .Dl Usage: .Ad Ao address Ac ...
1104 .Bl -tag -width ".Li .Ad\ f1\ ,\ f2\ ,\ f3\ :" -compact -offset 15n
1107 .It Li ".Ad addr1 ."
1109 .It Li ".Ad addr1 , file2"
1111 .It Li ".Ad f1 , f2 , f3 :"
1113 .It Li ".Ad addr ) ) ,"
1118 The default width is 12n.
1124 macro is used to specify the name of the author of the item being
1125 documented, or the name of the author of the actual manual page.
1127 .Dl Usage: .An Ao author name Ac ...
1129 .Bl -tag -width ".Li .An\ \*[q]Joe\ Author\*[q]\ )\ )\ ," -offset 15n
1130 .It Li ".An \*[q]Joe Author\*[q]"
1132 .It Li ".An \*[q]Joe Author\*[q] ,"
1134 .It Li ".An \*[q]Joe Author\*[q] Aq nobody@FreeBSD.org"
1135 .An "Joe Author" Aq nobody@FreeBSD.org
1136 .It Li ".An \*[q]Joe Author\*[q] ) ) ,"
1137 .An "Joe Author" ) ) ,
1141 The default width is 12n.
1147 request causes a line break allowing each new name to appear on its own
1149 If this is not desirable,
1151 .Bd -literal -offset indent
1156 call will turn this off.
1157 To turn splitting back on, write
1159 .Bd -literal -offset indent
1167 argument macro may be used whenever an argument is referenced.
1168 If called without arguments, the
1172 .Dl Usage: .Ar Oo Ao argument Ac Oc ...
1174 .Bl -tag -width ".Li .Ar\ file1\ file2" -compact -offset 15n
1179 .It Li ".Ar file1 ."
1181 .It Li ".Ar file1 file2"
1183 .It Li ".Ar f1 f2 f3 :"
1185 .It Li ".Ar file ) ) ,"
1190 The default width is 12n.
1192 .Ss "Configuration Declaration (Section Four Only)"
1196 macro is used to demonstrate a
1198 declaration for a device interface in a section four manual.
1200 .Dl Usage: .Cd Ao argument Ac ...
1202 .Bl -tag -width ".Li .Cd\ Xdevice\ le0\ at\ scode?X" -offset 15n
1203 .It Li ".Cd \*[q]device le0 at scode?\*[q]"
1204 .Cd "device le0 at scode?"
1211 request causes a line break before and after its arguments are printed.
1214 The default width is 12n.
1216 .Ss "Command Modifiers"
1218 The command modifier is identical to the
1220 (flag) command with the exception that the
1222 macro does not assert a dash in front of every argument.
1223 Traditionally flags are marked by the preceding dash, however, some commands
1224 or subsets of commands do not use them.
1225 Command modifiers may also be specified in conjunction with interactive
1226 commands such as editor commands.
1230 The default width is 10n.
1232 .Ss "Defined Variables"
1234 A variable (or constant) which is defined in an include file
1235 is specified by the macro
1238 .Dl Usage: .Dv Ao defined variable Ac ...
1240 .Bl -tag -width ".Li .Dv\ MAXHOSTNAMELEN" -compact -offset 15n
1241 .It Li ".Dv MAXHOSTNAMELEN"
1243 .It Li ".Dv TIOCGPGRP )"
1248 The default width is 12n.
1254 errno macro specifies the error return value for section 2, 3, and\~9 library
1256 The second example below shows
1260 general text domain macro, as it would be used in a section two manual page.
1262 .Dl Usage: .Er Ao errno type Ac ...
1264 .Bl -tag -width ".Li .Bq\ Er\ ENOTDIR" -compact -offset 15n
1267 .It Li ".Er ENOENT ) ;"
1269 .It Li ".Bq Er ENOTDIR"
1274 The default width is 17n.
1276 .Ss "Environment Variables"
1280 macro specifies an environment variable.
1282 .Dl Usage: .Ev Ao argument Ac ...
1284 .Bl -tag -width ".Li .Ev\ PRINTER\ )\ )\ ," -compact -offset 15n
1285 .It Li ".Ev DISPLAY"
1289 .It Li ".Ev PRINTER ) ) ,"
1294 The default width is 15n.
1300 macro handles command line flags.
1304 For interactive command flags, which are not prepended with a dash, the
1307 macro is identical, but without the dash.
1309 .Dl Usage: .Fl Ao argument Ac ...
1311 .Bl -tag -width ".Li .Fl\ xyz\ )\ ," -compact -offset 15n
1324 .It Li ".Fl xyz ) ,"
1332 macro without any arguments results in a dash representing stdin/stdout.
1335 a single dash will result in two dashes.
1337 The default width is 12n.
1339 .Ss "Function Declarations"
1343 macro is used in the
1345 section with section two or three functions.
1346 It is neither callable nor parsed.
1348 .Dl Usage: .Fd Ao argument Ac ...
1350 .Bl -tag -width ".Li .Fd\ X#include\ <sys/types.h>X" -compact -offset 15n
1351 .It Li ".Fd \*[q]#include <sys/types.h>\*[q]"
1352 .Fd "#include <sys/types.h>"
1359 request causes a line break if a function has already been presented and a
1360 break has not occurred.
1361 This leaves a nice vertical space in between the previous function call and
1362 the declaration for the next function.
1369 macro is the short form of the above example.
1370 It specifies the C\~header file as being included in a C\~program.
1371 It also causes a line break, and is neither callable nor parsed.
1373 .Dl Usage: .In Ao header file Ac
1375 .Bl -tag -width ".Li .In\ stdio.h" -compact -offset 15n
1376 .It Li ".In stdio.h"
1380 .Ss "Function Types"
1382 This macro is intended for the
1385 It may be used anywhere else in the man page without problems, but its main
1386 purpose is to present the function type in kernel normal form for the
1388 of sections two and three (it causes a line break, allowing the function
1389 name to appear on the next line).
1391 .Dl Usage: .Ft Ao type Ac ...
1393 .Bl -tag -width ".Li .Ft\ struct\ stat" -compact -offset 15n
1394 .It Li ".Ft struct stat"
1398 .Ss "Functions (Library Routines)"
1406 .Dl Usage: .Fn Ao function Ac Oo Ao parameter Ac Oc ...
1408 .Bl -tag -width ".Li .Fn\ align\ Xchar\ *ptrX\ ," -compact -offset 15n
1409 .It Li ".Fn getchar"
1411 .It Li ".Fn strlen ) ,"
1413 .It Li ".Fn align \*[q]char *ptr\*[q] ,"
1414 .Fn align "char *ptr" ,
1417 Note that any call to another macro signals the end of the
1419 call (it will insert a closing parenthesis at that point).
1421 For functions with many parameters (which is rare), the macros
1429 (function argument).
1433 .Bd -literal -offset indent
1442 \&.Fa "struct rrec *newrr"
1451 .Bd -ragged -offset indent
1460 .Fa "struct rrec *newrr"
1469 section, the function will always begin at the beginning of line.
1470 If there is more than one function presented in the
1472 section and a function type has not been given, a line break will occur,
1473 leaving a nice vertical space between the current function name and the one
1476 The default width values of
1480 are 12n and 16n, respectively.
1482 .Ss "Function Arguments"
1486 macro is used to refer to function arguments (parameters) outside of the
1488 section of the manual or inside the
1490 section if the enclosure macros
1498 may also be used to refer to structure members.
1500 .Dl Usage: .Fa Ao function argument Ac ...
1502 .Bl -tag -width ".Li .Fa\ d_namlen\ )\ )\ ," -compact -offset 15n
1503 .It Li ".Fa d_namlen ) ) ,"
1505 .It Li ".Fa iov_len"
1510 The default width is 12n.
1516 macro generates text for use in the
1520 .Dl Usage: .Rv Oo -std Oc Op Ao function Ac ...
1523 .Ql ".Rv -std atexit"
1526 .Bd -ragged -offset -indent
1527 \# a small hack to suppress a warning message
1528 .ds section-old "\*[section]
1531 .ds section "\*[section-old]
1537 option is valid only for manual page sections\~2 and\~3.
1538 Currently, this macro does nothing if used without the
1546 macro generates text for use in the
1550 .Dl Usage: .Ex Oo -std Oc Op Ao utility Ac ...
1556 .Bd -ragged -offset -indent
1557 \# a small hack to suppress a warning message
1558 .ds section-old "\*[section]
1561 .ds section "\*[section-old]
1567 option is valid only for manual page sections 1, 6 and\~8.
1568 Currently, this macro does nothing if used without the
1572 .Ss "Interactive Commands"
1576 macro designates an interactive or internal command.
1578 .Dl Usage: .Ic Ao argument Ac ...
1580 .Bl -tag -width ".Li .Ic\ setenv\ ,\ unsetenv" -compact -offset 15n
1583 .It Li ".Ic \*[q]do while {...}\*[q]"
1584 .Ic "do while {...}"
1585 .It Li ".Ic setenv , unsetenv"
1586 .Ic setenv , unsetenv
1590 The default width is 12n.
1596 macro is used to specify the library where a particular function is compiled
1599 .Dl Usage: .Lb Ao argument Ac ...
1601 Available arguments to
1603 and their results are:
1606 .Bl -tag -width ".Li libossaudio" -compact -offset indent
1644 Local, OS-specific additions might be found in the file
1646 look for strings named
1649 then denotes the keyword to be used with the
1657 literal macro may be used for special characters, variable constants, etc.\&
1658 -- anything which should be displayed as it would be typed.
1660 .Dl Usage: .Li Ao argument Ac ...
1662 .Bl -tag -width ".Li .Li\ cntrl-D\ )\ ," -compact -offset 15n
1665 .It Li ".Li M1 M2 M3 ;"
1667 .It Li ".Li cntrl-D ) ,"
1669 .It Li ".Li 1024 ..."
1674 The default width is 16n.
1680 macro is used for the document title or subject name.
1681 It has the peculiarity of remembering the first argument it was called with,
1682 which should always be the subject name of the page.
1683 When called without arguments,
1685 regurgitates this initial name for the sole purpose of making less work for
1687 Note: A section two or three document function name is addressed with the
1695 and remaining sections.
1696 For interactive commands, such as the
1702 macro should be used.
1708 it can not recall the first argument it was invoked with.
1710 .Dl Usage: .Nm Oo Ao argument Ac Oc ...
1712 .Bl -tag -width ".Li .Nm\ groff_mdoc" -compact -offset 15n
1713 .It Li ".Nm groff_mdoc"
1715 .It Li ".Nm \e-mdoc"
1717 .It Li ".Nm foo ) ) ,"
1724 The default width is 10n.
1730 macro places option brackets around any remaining arguments on the
1731 command line, and places any trailing punctuation outside the brackets.
1736 (which produce an opening and a closing option bracket respectively) may be used
1737 across one or more lines or to specify the exact position of the closing
1740 .Dl Usage: .Op Oo Ao option Ac Oc ...
1742 .Bl -tag -width ".Li .Op\ Fl\ c\ Ar\ objfil\ Op\ Ar\ corfil\ ," -compact -offset 15n
1747 .It Li ".Op Fl k ) ."
1749 .It Li ".Op Fl k Ar kookfile"
1750 .Op Fl k Ar kookfile
1751 .It Li ".Op Fl k Ar kookfile ,"
1752 .Op Fl k Ar kookfile ,
1753 .It Li ".Op Ar objfil Op Ar corfil"
1754 .Op Ar objfil Op Ar corfil
1755 .It Li ".Op Fl c Ar objfil Op Ar corfil ,"
1756 .Op Fl c Ar objfil Op Ar corfil ,
1757 .It Li ".Op word1 word2"
1759 .It Li ".Li .Op Oo Ao option Ac Oc ..."
1760 .Li .Op Oo Ao options Ac Oc ...
1763 Here a typical example of the
1769 .Bd -literal -offset indent
1771 \&.Op Fl k Ar kilobytes
1772 \&.Op Fl i Ar interval
1780 .Bd -filled -offset indent
1782 .Op Fl k Ar kilobytes
1783 .Op Fl i Ar interval
1789 The default width values of
1793 are 14n and 10n, respectively.
1799 macro formats path or file names.
1800 If called without arguments, the
1802 string is output, which represents the current user's home directory.
1804 .Dl Usage: .Pa Oo Ao pathname Ac Oc ...
1806 .Bl -tag -width ".Li .Pa\ /tmp/fooXXXXX\ )\ ." -compact -offset 15n
1809 .It Li ".Pa /usr/share"
1811 .It Li ".Pa /tmp/fooXXXXX ) ."
1812 .Pa /tmp/fooXXXXX ) .
1816 The default width is 32n.
1822 macro replaces standard abbreviations with their formal names.
1824 .Dl Usage: .St Ao abbreviation Ac ...
1827 .Dq Abbreviation/Formal Name
1833 .Bl -tag -width ".Li -iso9945-1-90" -compact -offset indent
1848 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1849 .It Li -iso9945-1-90
1851 .It Li -iso9945-1-96
1865 .It Li -p1003.1g-2000
1873 Part 2: Shell and Utilities
1875 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1876 .It Li -iso9945-2-93
1888 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1917 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1924 .Ss "Variable Types"
1928 macro may be used whenever a type is referenced.
1931 section, it causes a line break (useful for old style variable declarations).
1933 .Dl Usage: .Vt Ao type Ac ...
1935 .Bl -tag -width ".Li .Vt\ extern\ char\ *optarg\ ;" -compact -offset 15n
1936 .It Li ".Vt extern char *optarg ;"
1937 .Vt extern char *optarg ;
1944 Generic variable reference.
1946 .Dl Usage: .Va Ao variable Ac ...
1948 .Bl -tag -width ".Li .Va\ Xchar\ sX\ ]\ )\ )\ ," -compact -offset 15n
1951 .It Li ".Va settimer ,"
1953 .It Li ".Va \*[q]int *prt\*[q] ) :"
1955 .It Li ".Va \*[q]char s\*[q] ] ) ) ,"
1956 .Va "char s" ] ) ) ,
1960 The default width is 12n.
1962 .Ss "Manual Page Cross References"
1966 macro expects the first argument to be a manual page name.
1967 The optional second argument, if a string (defining the manual section), is
1968 put into parentheses.
1970 .Dl Usage: .Xr Ao man page name Ac Oo Ao section Ac Oc ...
1972 .Bl -tag -width ".Li .Xr\ xinit\ 1x\ ;" -compact -offset 15n
1979 .It Li ".Xr xinit 1x ;"
1984 The default width is 10n.
1987 .Sh "GENERAL TEXT DOMAIN"
1992 .Dl Usage: .At Oo Ao version Ac Oc ...
1994 .Bl -tag -width ".Li .At\ v6\ ." -compact -offset 15n
2001 The following values for
2005 .Dl 32v, v1, v2, v3, v4, v5, v6, v7, V, V.1, V.2, V.3, V.4
2010 .Dl "Usage: .Bx" Bro -alpha | -beta | -devel Brc ...
2011 .Dl " .Bx" Oo Ao version Ac Oo Ao release Ac Oc Oc ...
2013 .Bl -tag -width ".Li .Bx\ -devel" -compact -offset 15n
2018 .It Li ".Bx \-devel"
2023 will be prepended to the string
2025 The following values for
2029 .Dl Reno, reno, Tahoe, tahoe, Lite, lite, Lite2, lite2
2034 .Dl Usage: .Nx Oo Ao version Ac Oc ...
2036 .Bl -tag -width ".Li .Nx\ 1.4\ ." -compact -offset 15n
2043 For possible values of
2045 see the description of the
2047 request above in section
2048 .Sx "TITLE MACROS" .
2053 .Dl Usage: .Fx Oo Ao version Ac Oc ...
2055 .Bl -tag -width ".Li .Fx\ 2.2\ ." -compact -offset 15n
2062 For possible values of
2064 see the description of the
2066 request above in section
2067 .Sx "TITLE MACROS" .
2072 .Dl Usage: .Ox Oo Ao version Ac Oc ...
2074 .Bl -tag -width ".Li .Ox\ 1.0" -compact -offset 15n
2082 .Dl Usage: .Bsx Oo Ao version Ac Oc ...
2084 .Bl -tag -width ".Li .Bsx\ 1.0" -compact -offset 15n
2094 .Bl -tag -width ".Li .Ux" -compact -offset 15n
2099 .Ss "Emphasis Macro"
2101 Text may be stressed or emphasized with the
2104 The usual font for emphasis is italic.
2106 .Dl Usage: .Em Ao argument Ac ...
2108 .Bl -tag -width ".Li .Em\ vide\ infra\ )\ )\ ," -compact -offset 15n
2109 .It Li ".Em does not"
2111 .It Li ".Em exceed 1024 ."
2113 .It Li ".Em vide infra ) ) ,"
2114 .Em vide infra ) ) ,
2118 The default width is 10n.
2124 font mode must be ended with the
2126 macro (the latter takes no arguments).
2127 Font modes may be nested within other font modes.
2130 has the following syntax:
2132 .Dl .Bf Ao font mode Ac
2135 must be one of the following three types:
2137 .Bl -tag -width ".Sy \&Sy | Fl symbolic" -compact -offset indent
2138 .It Sy \&Em | Fl emphasis
2141 macro was used for the entire block of text.
2142 .It Sy \&Li | Fl literal
2145 macro was used for the entire block of text.
2146 .It Sy \&Sy | Fl symbolic
2149 macro was used for the entire block of text.
2152 Both macros are neither callable nor parsed.
2154 .Ss "Enclosure and Quoting Macros"
2156 The concept of enclosure is similar to quoting.
2157 The object being to enclose one or more strings between a pair of characters
2158 like quotes or parentheses.
2159 The terms quoting and enclosure are used interchangeably throughout this
2161 Most of the one-line enclosure macros end in small letter
2163 to give a hint of quoting, but there are a few irregularities.
2164 For each enclosure macro there is also a pair of open and close macros which
2165 end in small letters
2175 .Bd -filled -offset 4n
2176 .Bl -column "quote" "close" "open" "Angle Bracket Enclosure" "`string' or string"
2177 .Em Quote Ta Em Open Ta Em Close Ta Em Function Ta Em Result
2178 .No .Aq Ta .Ao Ta .Ac Ta "Angle Bracket Enclosure" Ta Ao string Ac
2179 .No .Bq Ta .Bo Ta .Bc Ta "Bracket Enclosure" Ta Bo string Bc
2180 .No .Brq Ta .Bro Ta .Brc Ta "Brace Enclosure" Ta Bro string Brc
2181 .No .Dq Ta .Do Ta .Dc Ta "Double Quote" Ta Do string Dc
2182 .No .Eq Ta .Eo Ta .Ec Ta "Enclose String (in XX)" Ta XXstringXX
2183 .No .Pq Ta .Po Ta .Pc Ta "Parenthesis Enclosure" Ta Po string Pc
2184 .No .Ql Ta Ta Ta "Quoted Literal" Ta So string Sc or Li string
2185 .No .Qq Ta .Qo Ta .Qc Ta "Straight Double Quote" Ta Qo string Qc
2186 .No .Sq Ta .So Ta .Sc Ta "Single Quote" Ta So string Sc
2190 All macros ending with
2194 have a default width value of 12n.
2196 .Bl -tag -width ".Li .Ec , .Eo"
2198 These macros expect the first argument to be the opening and closing strings
2201 Due to the nine-argument limit in the original troff program two other
2202 macros have been implemented which are now rather obsolete:
2204 takes the first and second parameter as the left and right enclosure string,
2205 which are then used to enclose the arguments of
2207 The default width value is 12n for both macros.
2209 The first and second arguments of this macro are the opening and
2210 closing strings respectively, followed by the arguments to be enclosed.
2212 The quoted literal macro behaves differently in troff and nroff mode.
2215 a quoted literal is always quoted.
2216 If formatted with troff, an item is only quoted if the width of the item is
2217 less than three constant width characters.
2218 This is to make short strings more visible where the font change to literal
2219 (constant width) is less noticeable.
2221 The default width is 16n.
2223 The prefix macro suppresses the whitespace between its first and second
2226 .Bl -tag -width ".Li .Pf\ (\ Fa\ name2" -offset indent
2227 .It Li ".Pf ( Fa name2"
2232 The default width is 12n.
2236 macro (see below) performs the analogous suffix function.
2240 macro inserts an apostrophe and exits any special text modes, continuing in
2246 Examples of quoting:
2249 .Bl -tag -width ".Li .Bq\ Em\ Greek\ ,\ French\ ." -compact -offset indent
2252 .It Li ".Aq Pa ctype.h ) ,"
2256 .It Li ".Bq Em Greek , French ."
2257 .Bq Em Greek , French .
2260 .It Li ".Dq string abc ."
2262 .It Li ".Dq \'^[A-Z]\'"
2264 .It Li ".Ql man mdoc"
2268 .It Li ".Qq string ) ,"
2270 .It Li ".Qq string Ns ),"
2276 .It Li ".Em or Ap ing"
2281 For a good example of nested enclosure macros, see the
2284 It was created from the same underlying enclosure macros as those presented
2290 extended argument list macros are discussed below.
2292 .Ss "No-Op or Normal Text Macro"
2296 macro can be used in a macro command line for parameters which should
2303 if you really want that English word (and not the macro) as a parameter.
2305 .Dl Usage: .No Ao argument Ac ...
2307 .Bl -tag -width ".Li .No\ test\ Ta\ with\ Ta\ tabs" -compact -offset 15n
2308 .It Li ".No test Ta with Ta tabs"
2309 .No test Ta with Ta tabs
2313 The default width is 12n.
2315 .Ss "No-Space Macro"
2319 macro suppresses insertion of a space between the current position and its
2321 For example, it is useful for old style argument lists where there is no
2322 space between the flag and argument:
2324 .Dl "Usage:" ... Ao argument Ac \&Ns Oo Ao argument Ac Oc ...
2325 .Dl " " .Ns Ao argument Ac ...
2327 .Bl -tag -width ".Li .Op\ Fl\ I\ Ns\ Ar\ directory" -compact -offset 15n
2328 .It Li ".Op Fl I Ns Ar directory"
2329 .Op Fl I Ns Ar directory
2334 macro always invokes the
2336 macro after eliminating the space unless another macro name follows it.
2337 If used as a request (i.e., the second form above in the
2344 .Ss "Section Cross References"
2348 macro designates a reference to a section header within the same document.
2350 .Dl Usage: .Sx Ao section reference Ac ...
2352 .Bl -tag -width ".Li .Sx\ FILES" -offset 15n
2358 The default width is 16n.
2362 The symbolic emphasis macro is generally a boldface macro in either the
2363 symbolic sense or the traditional English usage.
2365 .Dl Usage: .Sy Ao symbol Ac ...
2367 .Bl -tag -width ".Li .Sy\ Important\ Notice" -compact -offset 15n
2368 .It Li ".Sy Important Notice"
2369 .Sy Important Notice
2373 The default width is 6n.
2375 .Ss Mathematical Symbols
2377 Use this macro for mathematical symbols and similar things.
2379 .Dl Usage: .Ms Ao math symbol Ac ...
2381 .Bl -tag -width ".Li .Ms\ sigma" -compact -offset 15n
2387 The default width is 6n.
2389 .Ss "References and Citations"
2391 The following macros make a modest attempt to handle references.
2392 At best, the macros make it convenient to manually drop in a subset of
2396 .Bl -tag -width 6n -offset indent -compact
2398 Reference start (does not take arguments).
2399 Causes a line break in the
2401 section and begins collection of reference information until the reference
2404 Reference end (does not take arguments).
2405 The reference is printed.
2407 Reference author name; one name per invocation.
2411 City/place (not implemented yet).
2415 Issuer/publisher name.
2421 Optional information.
2425 Corporate or foreign author.
2434 Macros beginning with
2436 are not callable but accept multiple arguments in the usual way.
2439 macro is handled properly as a parameter; other macros will cause strange
2444 can be used outside of the
2450 .Bd -literal -offset indent
2454 \&.%T "Implementation Notes on foobar(1)"
2455 \&.%R "Technical Report ABC-DE-12-345"
2456 \&.%Q "Drofnats College, Nowhere"
2463 .Bd -ragged -offset indent
2467 .%T "Implementation Notes on foobar(1)"
2468 .%R "Technical Report ABC-DE-12-345"
2469 .%Q "Drofnats College, Nowhere"
2474 .Ss "Trade Names (or Acronyms and Type Names)"
2476 The trade name macro prints its arguments in a smaller font.
2477 Its intended use is to imitate a small caps fonts for uppercase acronyms.
2479 .Dl Usage: .Tn Ao symbol Ac ...
2481 .Bl -tag -width ".Li .Tn\ ASCII" -compact -offset 15n
2489 The default width is 10n.
2491 .Ss "Extended Arguments"
2497 macros allow one to extend an argument list on a macro boundary for the
2504 are implemented similarly to all other macros opening and closing an
2505 enclosure (without inserting characters, of course).
2506 This means that the following is true for those macros also.
2508 Here is an example of
2510 using the space mode macro to turn spacing off:
2512 .Bd -literal -offset indent
2514 \&.It Xo Sy I Ar operation
2515 \&.No \een Ar count No \een
2523 .Bd -filled -offset indent
2526 .It Xo Sy I Ar operation
2527 .No \en Ar count No \en
2536 .Bd -literal -offset indent
2538 \&.It Cm S No / Ar old_pattern Xo
2539 \&.No / Ar new_pattern
2548 .Bd -filled -offset indent
2551 .It Cm S No \&/ Ar old_pattern Xo
2552 .No \&/ Ar new_pattern
2562 and enclosure macros: Test the value of a variable.
2564 .Bd -literal -offset indent
2567 \&.Oo \e&! Oc Ns Ar variable Oo
2568 \&.Ar operator variable ...
2575 .Bd -filled -offset indent
2576 .Bl -tag -width flag -compact
2579 .Oo \&! Oc Ns Ar variable Oo
2580 .Ar operator variable ...
2587 .Sh "PAGE STRUCTURE DOMAIN"
2589 .Ss "Section Headers"
2593 section header macros are required in every man page.
2594 The remaining section headers are recommended at the discretion of the
2595 author writing the manual page.
2598 macro is parsed but not generally callable.
2599 It can be used as an argument in a call to
2601 only; it then reactivates the default font for
2604 The default width is 8n.
2606 .Bl -tag -width ".Li .Sh\ RETURN\ VALUES"
2611 If not specified, headers, footers and page layout defaults will not be set
2612 and things will be rather unpleasant.
2615 section consists of at least three items.
2618 name macro naming the subject of the man page.
2619 The second is the name description macro,
2621 which separates the subject name from the third item, which is the
2623 The description should be the most terse and lucid possible, as the space
2629 then all its arguments.
2631 .It Li ".Sh LIBRARY"
2632 This section is for section two and three function calls.
2633 It should consist of a single
2637 .Sx "Library Names" .
2639 .It Li ".Sh SYNOPSIS"
2642 section describes the typical usage of the subject of a man page.
2643 The macros required are either
2654 The function name macro
2656 is required for manual page sections\~2 and\~3; the command and general name
2659 is required for sections 1, 5, 6, 7, and\~8.
2660 Section\~4 manuals require a
2665 configuration device usage macro.
2666 Several other macros may be necessary to produce the synopsis line as shown
2669 .Bd -filled -offset indent
2677 The following macros were used:
2680 .Dl ".Op Fl benstuv"
2684 .It Li ".Sh DESCRIPTION"
2685 In most cases the first text in the
2687 section is a brief paragraph on the command, function or file, followed by a
2688 lexical list of options and respective explanations.
2689 To create such a list, the
2696 macros are used (see
2697 .Sx Lists and Columns
2700 .It Li ".Sh IMPLEMENTATION NOTES"
2701 Implementation specific information should be placed here.
2703 .It Li ".Sh RETURN VALUES"
2704 Sections 2, 3 and\~9 function return values should go here.
2707 macro may be used to generate text for use in the
2709 section for most section 2 and 3 library functions;
2711 .Sx "Return Values" .
2717 section headers are part of the preferred manual page layout and must be
2718 used appropriately to maintain consistency.
2719 They are listed in the order in which they would be used.
2721 .Bl -tag -width ".Li .Sh\ COMPATIBILITY"
2722 .It Li ".Sh ENVIRONMENT"
2725 section should reveal any related environment variables and clues to their
2726 behavior and/or usage.
2729 Files which are used or created by the man page subject should be listed via
2736 .It Li ".Sh EXAMPLES"
2737 There are several ways to create examples.
2740 section below for details.
2742 .It Li ".Sh DIAGNOSTICS"
2743 Diagnostic messages from a command should be placed in this section.
2746 macro may be used to generate text for use in the
2748 section for most section 1, 6 and\~8 commands;
2752 .It Li ".Sh COMPATIBILITY"
2753 Known compatibility issues (e.g. deprecated options or parameters)
2754 should be listed here.
2757 Specific error handling, especially from library functions (man page
2758 sections 2, 3, and\~9) should go here.
2761 macro is used to specify an error (errno).
2763 .It Li ".Sh SEE ALSO"
2764 References to other material on the man page topic and cross references to
2765 other relevant man pages should be placed in the
2768 Cross references are specified using the
2773 style references are not accommodated.
2775 It is recommended that the cross references are sorted on the section
2776 number, then alphabetically on the names within a section, and placed
2777 in that order and comma separated.
2785 .It Li ".Sh STANDARDS"
2786 If the command, library function or file adheres to a specific
2787 implementation such as
2791 this should be noted here.
2792 If the command does not adhere to any standard, its history should be noted
2797 .It Li ".Sh HISTORY"
2798 Any command which does not adhere to any specific standards should be
2799 outlined historically in this section.
2801 .It Li ".Sh AUTHORS"
2802 Credits should be placed here.
2805 macro should be used to specify the name(s) of the person(s).
2808 Blatant problems with the topic go here.
2814 sections may be added; for example, this section was set with:
2816 .Bd -literal -offset 15n
2817 \&.Sh "PAGE STRUCTURE DOMAIN"
2820 .Ss "Subsection Headers"
2822 Subsection headers have exactly the same syntax as section headers:
2824 is parsed but not generally callable.
2825 It can be used as an argument in a call to
2827 only; it then reactivates the default font for
2830 The default width is 8n.
2832 .Ss "Paragraphs and Line Spacing"
2834 .Bl -tag -width ".Li .Pp"
2838 paragraph command may be used to specify a line space where necessary.
2839 The macro is not necessary after a
2847 macro (which both assert a vertical distance unless the
2851 The macro is neither callable nor parsed and takes no arguments; an
2858 .\" This worked with version one, need to redo for version three
2861 .\" .Cw (ax+bx+c) \ is\ produced\ by\ \&
2862 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2879 .\" .Em is produced by
2895 .\" This example shows the same equation in a different format.
2899 .\" signs were forced with
2903 .\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
2904 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2915 .\" .Li \&.Cx \e\ +\e\ \e&
2926 .\" .Em is produced by
2934 .\" .Li \&.Cx \e\ +\e\ \e&
2945 .\" The incantation below was
2951 .\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
2953 .\" .Li \&.Cx Op Sy ?/
2963 .\" .Em is produced by
2965 .\" .Li \&.Ar \e\ b1 e1 f1
2979 The only keep that is implemented at this time is for words.
2986 The only option that
2988 accepts currently is
2990 (this is also the default if no option is given) which is useful for
2991 preventing line breaks in the middle of options.
2992 In the example for the make command line arguments (see
2993 .Sx What's in a Name ) ,
2996 from placing up the flag and the argument on separate lines.
2998 Both macros are neither callable nor parsed.
3000 More work needs to be done with the keep macros; specifically, a
3002 option should be added.
3004 .Ss "Examples and Displays"
3006 There are seven types of displays.
3008 .Bl -tag -width ".Li .D1"
3011 Display one line of indented text.
3012 This macro is parsed but not callable.
3016 The above was produced by:
3017 .Li ".D1 Fl ldghfstru" .
3021 Display one line of indented
3026 example macro has been used throughout this file.
3027 It allows the indentation (display) of one line of text.
3028 Its default font is set to constant width (literal).
3030 is parsed but not callable.
3032 .Dl % ls -ldg /usr/local/bin
3034 The above was produced by:
3035 .Li ".Dl % ls -ldg /usr/local/bin" .
3041 display must be ended with the
3044 It has the following syntax:
3046 .Bl -tag -width ".Li .Bd" -offset indent
3048 .Bro \-literal | \-filled | \-unfilled | \-ragged | \-centered Brc
3049 .Oo \-offset Ao string Ac Oc Oo \-file Ao file name Ac Oc Oo \-compact Oc Xc
3053 .Bl -tag -width ".Fl file Ao Ar file name Ac " -compact
3055 Fill, but do not adjust the right margin (only left-justify).
3057 Center lines between the current left and right margin.
3058 Note that each single line is centered.
3060 Do not fill; display a block of text as typed, using line breaks as
3061 specified by the user.
3062 This can produce overlong lines without warning messages.
3064 Display a filled block.
3065 The block of text is formatted (i.e., the text is justified on both the left
3068 Display block with literal font (usually fixed-width).
3069 Useful for source code or simple tabbed or spaced text.
3070 .It Fl file Ao Ar file name Ac
3071 The file whose name follows the
3073 flag is read and displayed before any data enclosed with
3077 using the selected display type.
3079 .Xr troff/ Ns Nm \-mdoc
3080 commands in the file will be processed.
3081 .It Fl offset Ao Ar string Ac
3084 is specified with one of the following strings, the string is interpreted to
3085 indicate the level of indentation for the forthcoming block of text:
3088 .Bl -tag -width ".Ar indent-two" -compact
3090 Align block on the current left margin; this is the default mode of
3093 Supposedly center the block.
3094 At this time unfortunately, the block merely gets left aligned about an
3095 imaginary center margin.
3097 Indent by one default indent value or tab.
3098 The default indent value is also used for the
3102 macros, so one is guaranteed the two types of displays will line up.
3103 The indentation value is normally set to\~6n or about two thirds of an inch
3104 (six constant width characters).
3106 Indent two times the default indent value.
3110 aligns the block about two inches from the right side of the page.
3111 This macro needs work and perhaps may never do the right thing within
3118 is a valid numeric expression instead
3119 .Pf ( Em with a scale indicator other than
3121 use that value for indentation.
3122 The most useful scale indicators are
3126 specifying the so-called
3130 This is approximately the width of the letter
3134 of the current font (for nroff output, both scale indicators give the same
3138 isn't a numeric expression, it is tested whether it is an
3140 macro name, and the default offset value associated with this macro is used.
3141 Finally, if all tests fail,
3144 (typeset with a fixed-width font) is taken as the offset.
3146 Suppress insertion of vertical space before begin of display.
3150 End display (takes no arguments).
3153 .Ss "Lists and Columns"
3155 There are several types of lists which may be initiated with the
3158 Items within the list are specified with the
3160 item macro, and each list must end with the
3163 Lists may be nested within themselves and within displays.
3164 The use of columns inside of lists or lists inside of columns is unproven.
3166 In addition, several list attributes may be specified such as the width of a
3167 tag, the list offset, and compactness (blank lines between items allowed or
3169 Most of this document has been formatted with a tag style list
3172 It has the following syntax forms:
3175 .Bl -tag -width ".Li .Bl" -offset indent -compact
3177 .Bro \-hang | \-ohang | \-tag | \-diag | \-inset Brc
3178 .Oo \-width Ao string Ac Oc
3179 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3181 .No \-column Oo \-offset Ao string Ac Oc
3182 .Ao string1 Ac Ao string2 Ac ... Xc
3184 .Bro \-item | \-enum Oo \-nested Oc | \-bullet | \-hyphen | \-dash Brc
3185 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3189 And now a detailed description of the list types.
3192 .Bl -tag -width ".Fl column" -compact
3196 .Bd -literal -offset indent
3197 \&.Bl -bullet -offset indent -compact
3199 Bullet one goes here.
3209 .Bl -bullet -offset indent -compact
3211 Bullet one goes here.
3217 .It Fl dash No ( or Fl hyphen )
3220 .Bd -literal -offset indent
3221 \&.Bl -dash -offset indent -compact
3233 .Bl -dash -offset indent -compact
3244 .Bd -literal -offset indent
3245 \&.Bl -enum -offset indent -compact
3257 .Bl -enum -offset indent -compact
3265 If you want to nest enumerated lists, use the
3267 flag (starting with the second-level list):
3269 .Bd -literal -offset indent
3270 \&.Bl -enum -offset indent -compact
3273 \&.Bl -enum -nested -compact
3277 And item three here.
3288 .Bl -enum -offset indent -compact
3291 .Bl -enum -nested -compact
3295 And item three here.
3305 without list markers.
3307 .Bd -literal -offset indent
3308 \&.Bl -item -offset indent
3324 .Bl -item -offset indent
3340 to specify the tag width.
3343 .Bl -tag -width "PPID" -compact -offset indent
3345 sleep time of the process (seconds blocked)
3349 resulting from references by the process
3350 to pages not loaded in core.
3352 numerical user-id of process owner
3354 numerical id of parent of process priority
3355 (non-positive when in non-interruptible wait)
3361 .Bd -literal -offset indent
3362 \&.Bl -tag -width "PPID" -compact -offset indent
3364 sleep time of the process (seconds blocked)
3368 resulting from references by the process
3369 to pages not loaded in core.
3371 numerical user-id of process owner
3373 numerical id of parent of process priority
3374 (non-positive when in non-interruptible wait)
3380 Diag lists create section four diagnostic lists and are similar to inset
3381 lists except callable macros are ignored.
3384 flag is not meaningful in this context.
3388 .Bd -literal -offset indent
3390 \&.It You can't use Sy here.
3391 The message says all.
3399 .It You can't use Sy here.
3400 The message says all.
3405 A list with hanging tags.
3407 .Bl -hang -offset indent
3409 labels appear similar to tagged lists when the
3410 label is smaller than the label width.
3411 .It Em Longer hanged list labels
3412 blend into the paragraph unlike
3413 tagged paragraph labels.
3416 And the unformatted text which created it:
3418 .Bd -literal -offset indent
3419 \&.Bl -hang -offset indent
3421 labels appear similar to tagged lists when the
3422 label is smaller than the label width.
3423 \&.It Em Longer hanged list labels
3424 blend into the paragraph unlike
3425 tagged paragraph labels.
3431 Lists with overhanging tags do not use indentation for the items; tags are
3432 written to a separate line.
3434 .Bl -ohang -offset indent
3436 sleep time of the process (seconds blocked)
3440 resulting from references by the process
3441 to pages not loaded in core.
3443 numerical user-id of process owner
3445 numerical id of parent of process priority
3446 (non-positive when in non-interruptible wait)
3452 .Bd -literal -offset indent
3453 \&.Bl -ohang -offset indent
3455 sleep time of the process (seconds blocked)
3459 resulting from references by the process
3460 to pages not loaded in core.
3462 numerical user-id of process owner
3464 numerical id of parent of process priority
3465 (non-positive when in non-interruptible wait)
3471 Here is an example of inset labels:
3472 .Bl -inset -offset indent
3474 The tagged list (also called a tagged paragraph)
3475 is the most common type of list used in the
3479 attribute as described below.
3481 Diag lists create section four diagnostic lists
3482 and are similar to inset lists except callable
3485 Hanged labels are a matter of taste.
3487 Overhanging labels are nice when space is constrained.
3489 Inset labels are useful for controlling blocks of
3490 paragraphs and are valuable for converting
3492 manuals to other formats.
3495 Here is the source text which produced the above example:
3497 .Bd -literal -offset indent
3498 \&.Bl -inset -offset indent
3500 The tagged list (also called a tagged paragraph)
3501 is the most common type of list used in the
3504 Diag lists create section four diagnostic lists
3505 and are similar to inset lists except callable
3508 Hanged labels are a matter of taste.
3510 Overhanging labels are nice when space is constrained.
3512 Inset labels are useful for controlling blocks of
3513 paragraphs and are valuable for converting
3515 manuals to other formats.
3521 This list type generates multiple columns.
3522 The number of columns and the width of each column is determined by the
3533 (dot) immediately followed by a valid
3535 macro name, interpret
3537 and use the width of the result.
3538 Otherwise, the width of
3540 (typeset with a fixed-width font) is taken as the
3546 argument is parsed to make a row, each column within the row is a separate
3547 argument separated by a tab or the
3553 .Bl -column -offset indent ".Sy String" ".Sy Nroff" ".Sy Troff"
3554 .It Sy String Ta Sy Nroff Ta Sy Troff
3555 .It Li <= Ta <= Ta \*(<=
3556 .It Li >= Ta >= Ta \*(>=
3563 \&.Bl -column -offset indent ".Sy String" ".Sy Nroff" ".Sy Troff"
3564 \&.It Sy String Ta Sy Nroff Ta Sy Troff
3565 \&.It Li <= Ta <= Ta \e*(<=
3566 \&.It Li >= Ta >= Ta \e*(>=
3574 .Bl -tag -width ".Fl indent Ao Ar string Ac"
3575 .It Fl width Ao Ar string Ac
3580 (dot) immediately followed by a valid
3582 macro name, interpret
3584 and use the width of the result.
3585 Almost all lists in this document use this option.
3589 .Bd -literal -offset indent
3590 \&.Bl -tag -width ".Fl test Ao Ar string Ac"
3591 \&.It Fl test Ao Ar string Ac
3592 This is a longer sentence to show how the
3594 flag works in combination with a tag list.
3601 .Bl -tag -width ".Fl test Ao Ar string Ac"
3602 .It Fl test Ao Ar string Ac
3603 This is a longer sentence to show how the
3605 flag works in combination with a tag list.
3609 (Note that the current state of
3613 is interpreted; afterwards, all variables are restored again.
3614 However, boxes (used for enclosures) can't be saved in
3617 as a consequence, arguments must always be
3619 to avoid nasty errors.
3620 For example, do not write
3623 .Ql ".Ao Ar string Xc"
3624 instead if you really need only an opening angle bracket.)
3628 is a valid numeric expression
3629 .Em ( with a scale indicator other than
3631 use that value for indentation.
3632 The most useful scale indicators are
3636 specifying the so-called
3640 This is approximately the width of the letter
3644 of the current font (for nroff output, both scale indicators give the same
3648 isn't a numeric expression, it is tested whether it is an
3650 macro name, and the default width value associated with this macro is used.
3651 Finally, if all tests fail,
3654 (typeset with a fixed-width font) is taken as the width.
3656 If a width is not specified for the tag list type, every time
3658 is invoked, an attempt is made to determine an appropriate width.
3659 If the first argument to
3661 is a callable macro, the default width for that macro will be used;
3662 otherwise, the default width of
3665 .It Fl offset Ao Ar string Ac
3670 a default indent value (normally set to\~6n, similar to the value used in
3677 is a valid numeric expression instead
3678 .Pf ( Em with a scale indicator other than
3680 use that value for indentation.
3681 The most useful scale indicators are
3685 specifying the so-called
3689 This is approximately the width of the letter
3693 of the current font (for nroff output, both scale indicators give the same
3697 isn't a numeric expression, it is tested whether it is an
3699 macro name, and the default offset value associated with this macro is used.
3700 Finally, if all tests fail,
3703 (typeset with a fixed-width font) is taken as the offset.
3705 Suppress insertion of vertical space before the list and between list items.
3709 .Sh "MISCELLANEOUS MACROS"
3711 Here a list of the remaining macros which do not fit well into one of the
3713 We couldn't find real examples for the following macros:
3717 They are documented here for completeness \- if you know how to use them
3718 properly please send a mail to
3719 .Mt bug-groff@gnu.org
3720 (including an example).
3722 .Bl -tag -width ".Li .Bt"
3726 .Bd -ragged -offset indent
3730 It is neither callable nor parsed and takes no arguments.
3734 .Dl Usage: .Fr Ao function return value Ac ...
3736 Don't use this macro.
3737 It allows a break right before the return value (usually a single digit)
3738 which is bad typographical behaviour.
3741 to tie the return value to the previous word.
3744 Use this macro to include a (header) file literally.
3747 followed by the file name, then the contents of
3750 .Dl Usage: .Hf Ao file Ac
3752 It is neither callable nor parsed.
3758 Exact usage unknown.
3759 The documentation in the
3761 source file describes it as a macro for
3762 .Dq "menu entries" .
3764 Its default width is 6n.
3770 Exact usage unknown.
3771 The documentation in the
3773 source file describes it as
3774 .Dq old function type (fortran) .
3777 Activate (toggle) space mode.
3779 .Dl Usage: .Sm Oo on | off Oc ...
3781 If space mode is off, no spaces between macro arguments are inserted.
3782 If called without a parameter (or if the next parameter is neither
3792 .Bd -ragged -offset indent
3796 It is neither callable nor parsed and takes no arguments.
3800 .Sh "PREDEFINED STRINGS"
3802 The following strings are predefined:
3804 .Bl -column String infinity "Troff " "straight double quote" -offset indent
3805 .It Sy String Ta Sy Nroff Ta Sy Troff Ta Sy Meaning
3806 .It Li <= Ta <= Ta \*[<=] Ta "less equal"
3807 .It Li >= Ta >= Ta \*[>=] Ta "greater equal"
3808 .It Li Rq Ta '' Ta \*[Rq] Ta "right double quote"
3809 .It Li Lq Ta `` Ta \*[Lq] Ta "left double quote"
3810 .It Li ua Ta ^ Ta \*[ua] Ta "upwards arrow"
3811 .It Li aa Ta \' Ta \*[aa] Ta "acute accent"
3812 .It Li ga Ta \` Ta \*[ga] Ta "grave accent"
3813 .It Li q Ta \&" Ta \*[q] Ta "straight double quote"
3814 .It Li Pi Ta pi Ta \*[Pi] Ta "greek pi"
3815 .It Li Ne Ta != Ta \*[Ne] Ta "not equal"
3816 .It Li Le Ta <= Ta \*[Le] Ta "less equal"
3817 .It Li Ge Ta >= Ta \*[Ge] Ta "greater equal"
3818 .It Li Lt Ta < Ta \*[Lt] Ta "less than"
3819 .It Li Gt Ta > Ta \*[Gt] Ta "greater than"
3820 .It Li Pm Ta +\- Ta \*[Pm] Ta "plus minus"
3821 .It Li If Ta infinity Ta \*[If] Ta "infinity"
3822 .It Li Na Ta \*[Na] Ta \*[Na] Ta "not a number"
3823 .It Li Ba Ta \*[Ba] Ta \*[Ba] Ta "vertical bar"
3826 The names of the columns
3830 are a bit misleading;
3834 representation, while
3836 gives the best glyph form available.
3837 For example, a Unicode enabled
3839 device will have proper glyph representations for all strings, whereas the
3840 enhancement for a Latin1
3842 device is only the plus-minus sign.
3844 String names which consist of two characters can be written as
3846 string names which consist of one character can be written as
3848 A generic syntax for a string name of any length is
3857 \#=====================================================================
3863 available in previous versions of
3865 has been removed since
3868 provides better facilities to check parameters; additionally, many error and
3869 warning messages have been added to this macro package, making it both more
3872 The only remaining debugging macro is
3874 which yields a register dump of all global registers and strings.
3875 A normal user will never need it.
3878 .Sh "FORMATTING WITH GROFF, TROFF, AND NROFF"
3880 By default, the package inhibits page breaks, headers, and footers if
3887 to make the manual more efficient for viewing on-line.
3888 This behaviour can be changed (e.g.\& to create a hardcopy of the
3890 output) by setting the register
3892 to zero while calling
3895 .Dl groff -Tlatin1 -rcR=0 -mdoc foo.man > foo.txt
3897 For double-sided printing, set register
3901 .Dl groff -Tps -rD1 -mdoc foo.man > foo.ps
3903 To change the document font size to 11pt or 12pt, set register
3907 .Dl groff -Tdvi -rS11 -mdoc foo.man > foo.dvi
3918 .Bl -tag -width mdoc/doc-ditroff -compact
3920 The main manual macro package.
3922 A wrapper file to call
3924 .It Pa mdoc/doc-common
3925 Common strings, definitions, stuff related typographic output.
3926 .It Pa mdoc/doc-nroff
3927 Definitions used for a
3930 .It Pa mdoc/doc-ditroff
3931 Definitions used for all other devices.
3933 Local additions and customizations.
3935 This file checks whether the
3939 package should be used.
3953 Section 3f has not been added to the header routines.
3956 font should be changed in
3961 needs to have a check to prevent splitting up
3962 if the line length is too short.
3964 separates the last parenthesis, and sometimes
3965 looks ridiculous if a line is in fill mode.
3967 The list and display macros do not do any keeps
3968 and certainly should be able to.
3969 .\" Note what happens if the parameter list overlaps a newline
3971 .\" to make sure a line boundary is crossed:
3973 .\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[]
3976 .\" produces, nudge nudge,
3977 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
3978 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
3980 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] .
3982 .\" If double quotes are used, for example:
3984 .\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q
3987 .\" produces, nudge nudge,
3988 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
3990 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
3992 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" .
3994 .\" Not a pretty sight...
3995 .\" In a paragraph, a long parameter containing unpaddable spaces as
3996 .\" in the former example will cause
3998 .\" to break the line and spread
3999 .\" the remaining words out.
4000 .\" The latter example will adjust nicely to
4001 .\" justified margins, but may break in between an argument and its
4005 .\" the right margin adjustment is normally ragged and the problem is
4008 .\" Local Variables: