xref: /illumos-gate/usr/src/man/man7/man.7 (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
1.\" Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
2.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
3.\" Copyright (c) 1995, Sun Microsystems, Inc.
4.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7.Dd "Feb 18, 2015"
8.Dt MAN 7
9.Os
10.Sh NAME
11.Nm man
12.Nd macros to format Reference Manual pages
13.Sh SYNOPSIS
14.Nm mandoc
15.Fl T Ar man
16.Ar
17.Nm nroff
18.Fl man
19.Ar
20.Nm troff
21.Fl man
22.Ar
23.Sh DESCRIPTION
24These macros are used to lay out the reference pages in this manual.
25Note: if
26.Ar file
27contains format input for a preprocessor, the commands shown
28above must be piped through the appropriate preprocessor.
29This is handled automatically by the
30.Xr man 1
31command.
32See the
33.Sx Conventions
34section.
35.Lp
36Any text argument
37.Ar t
38may be zero to six words.
39Quotes may be used to include SPACE characters in a
40.Qq word .
41If
42.Ar text
43is empty, the special
44treatment is applied to the next input line with text to be printed.
45In this way
46.Nm \&.I
47may be used to italicize a whole line, or
48.Nm \&.SB
49may be used to make small bold letters.
50.Lp
51A prevailing indent distance is remembered between successive indented
52paragraphs, and is reset to default value upon reaching a non-indented
53paragraph.
54Default units for indents
55.Nm i
56are ens.
57.Lp
58Type font and size are reset to default values before each paragraph, and after
59processing font and size setting macros.
60.Pp
61These strings are predefined by
62.Nm -man :
63.Bl -tag -width Ds
64.It Nm \e*R
65.Sq \(rg ,
66.Sq (Reg)
67in
68.Nm nroff .
69.It Nm \e*S
70Change to default type size.
71.El
72.Sh "Requests"
73* n.t.l. = next text line; p.i. = prevailing indent
74.Bl -column ".TH n s d f m" "Cause " "t=n.t.l.*" "Explanation " -offset Ds
75.It Sy Request	Sy Cause	Sy "If No"	Sy Explanation
76.It ""	Sy Break 	Sy "Argument"	""
77.It Nm \&.B Ar "t"	no 	Ar t Ns =n.t.l.*	Text is in bold font.
78.It Nm \&.BI Ar t	no	Ar t Ns =n.t.l.	Join words, alternating bold and italic.
79.It Nm \&.BR Ar t	no	Ar t Ns =n.t.l.	Join words, alternating bold and roman.
80.It Nm \&.DT	no	Li \&.5i 1i...	Restore default tabs.
81.It Nm \&.HP Ar i	yes	Ar i Ns =p.i.*	"Begin paragraph with hanging indent. Set prevailing indent to" Ar i .
82.It Nm \&.I Ar t	no	Ar t Ns =n.t.l.	Text is italic.
83.It Nm \&.IB Ar t	no	Ar t Ns =n.t.l.	Join words, altenrating italic and bold.
84.It Nm \&.IP Ar x Ar i	yes	Ar x Ns =""	Same as
85.Nm \&.TP
86with tag
87.Ar x .
88.It Nm \&.IR Ar t	no	Ar t Ns =n.t.l.	Join words, alternating italic and roman.
89.It Nm \&.IX Ar t	no	-	Index macro, not used (obsolete).
90.It Nm \&.LP	yes	-	Begin left-aligned paragraph. Set prevailing indent to .5i.
91.It Nm \&.P	yes	-	Same as
92.Nm \&.LP .
93.It Nm \&.PD Ar d	no	Ar d Ns =.4v	Set vertical distance between paragraphs.
94.It Nm \&.PP	yes	-	Same as
95.Nm \&.LP .
96.It Nm \&.RE	yes	-	End of relative indent. Restores prevailing indent.
97.It Nm \&.RB Ar t	no	Ar t Ns =n.t.l.	Join words, alternating roman and bold.
98.It Nm \&.RI Ar t	no	Ar t Ns =n.t.l.	Join words, alternating roman and italic.
99.It Nm \&.RS Ar i	yes	Ar i Ns =p.i.	Start relative indent, increase indent by Ar i .
100Sets prevailing indent to .5i for nested indents.
101.It Nm \&.SB Ar t	no	-	Reduce size of text by 1 point, make text bold.
102.It Nm \&.SH Ar t	yes	-	Section Heading.
103.It Nm \&.SM Ar t	no	Ar t Ns =n.t.l.	Reduce size of text by 1 point.
104.It Nm \&.SS Ar t	yes	Ar t Ns =n.t.l.	Section Subheading.
105.It Nm \&.TH Ar n s d f m	yes	-	Begin reference page Ar n , No of section Ar s ; Ar d No is the date of the most recent change.  If present, Ar f No is the left page footer; Ar m No is the main page (center) header.  Sets prevailing indent and tabs to .5i.
106.It Nm \&.TP Ar i	yes	Ar i Ns =p.i.	Begin indented paragraph, with the tag given on the next text line. Set prevailing indent to
107.Ar i .
108.It Nm \&.TX Ar t p	no	-	Resolve the title abbreviation Ar t ; No join to punctuation mark (or text) Ar p .
109.El
110.Ss "Conventions"
111When formatting a manual page,
112.Nm
113examines the first line to determine
114whether it requires special processing.
115For example a first line consisting of:
116.Lp
117.Dl \&'\e" t
118.Lp
119indicates that the manual page must be run through the
120.Xr tbl 1
121preprocessor.
122.Lp
123A typical manual page for a command or function is laid out as follows:
124.Bl -tag -width ".SH RETURN VALUES"
125.
126.It Nm \&.TH Ar title Op "1-9"
127.
128The name of the command or function, which serves as the title of the manual
129page.
130This is followed by the number of the section in which it appears.
131.
132.It Nm \&.SH NAME
133.
134The name, or list of names, by which the command is called, followed by a dash
135and then a one-line summary of the action performed.
136All in roman font, this section contains no
137.Xr troff 1
138commands or escapes, and no macro requests.
139It is used to generate the database used by the
140.Xr whatis 1
141command.
142.
143.It Nm \&.SH SYNOPSIS
144.Bl -tag -width "Functions:"
145.It Sy Commands:
146The syntax of the command and its arguments, as typed on the command line.
147When in boldface, a word must be typed exactly as printed.
148When in italics, a word can be replaced with an argument that you supply.
149References to bold or italicized items are not capitalized in other sections,
150even when they begin a sentence.
151.Lp
152Syntactic symbols appear in roman face:
153.Bl -tag -width "   "
154.It Op " "
155An argument, when surrounded by brackets is optional.
156.It |
157Arguments separated by a vertical bar are exclusive.
158You can supply only one item from such a list.
159.It \&.\|.\|.
160Arguments followed by an ellipsis can be repeated.
161When an ellipsis follows a bracketed set, the expression within the brackets can
162be repeated.
163.El
164.It Sy Functions:
165If required, the data declaration, or
166.Li #include
167directive, is shown first,
168followed by the  function declaration.
169Otherwise, the function declaration is shown.
170.El
171.
172.It Nm \&.SH DESCRIPTION
173.
174A narrative overview of the command or function's external behavior.
175This includes how it interacts with files or data, and how it handles the
176standard input, standard output and standard error.
177Internals and implementation details are normally omitted.
178This section attempts to provide a succinct overview in answer to the question,
179"what does it do?"
180.Lp
181Literal text from the synopsis appears in constant width, as do literal
182filenames and references to items that appear elsewhere in the  reference
183manuals.
184Arguments are italicized.
185.Lp
186If a command interprets either subcommands or an input grammar, its command
187interface or input grammar is normally described in a
188.Nm USAGE
189section, which follows the
190.Nm OPTIONS
191section.
192The
193.Nm DESCRIPTION
194section only
195describes the behavior of the command itself, not that of subcommands.
196.
197.It Nm \&.SH OPTIONS
198.
199The list of options along with a description of how each affects the command's
200operation.
201.
202.It Nm \&.SH RETURN VALUES
203.
204A list of the values the library routine will return to the calling  program
205and the conditions that cause these values to be returned.
206.
207.It Nm \&.SH EXIT STATUS
208.
209A list of the values the utility will return to the calling  program or shell,
210and the conditions that cause these values to be  returned.
211.
212.It Nm \&.SH FILES
213.
214A list of files associated with the command or function.
215.
216.It Nm \&.SH SEE ALSO
217.
218A comma-separated list of related manual pages, followed by references to other
219published materials.
220.
221.It Nm \&.SH DIAGNOSTICS
222.
223A list of diagnostic messages and an explanation of each.
224.
225.It Nm \&.SH BUGS
226.
227A description of limitations, known defects, and possible problems associated
228with the command or function.
229.El
230.Sh FILES
231.Pa /usr/share/man/whatis
232.Sh NOTES
233The
234.Nm
235package should not be used for new documentation.
236The
237.Xr mdoc 7 ,
238package is preferred, as it uses semantic markup rather than physical markup.
239.Sh CODE SET INDEPENDENCE
240When processed with
241.Xr mandoc 1 ,
242this package is Code Set Independent.
243However, when processed with legacy tools such as
244.Xr nroff 1
245and
246.Xr troff 1 ,
247the use of multi-byte characters may not be supported.
248.Sh INTERFACE STABILITY
249.Sy Obsolete Committed .
250The
251.Xr mdoc 7
252package should be used instead.
253.Sh SEE ALSO
254.Xr eqn 1 ,
255.Xr man 1 ,
256.Xr mandoc 1 ,
257.Xr nroff 1 ,
258.Xr tbl 1 ,
259.Xr troff 1 ,
260.Xr whatis 1 ,
261.Xr mdoc 7
262.Rs
263.%A Dale Dougherty and Tim O'Reilly
264.%B Unix Text Processing
265.Re
266