* src/preproc/grn/main.cc: Allow values of `narrow' parameter and
[s-roff.git] / tmac / groff_mdoc.man
blob2112eba4ebab0b78a0f7026f5a3c6df9631a0529
1 .\"     $NetBSD: mdoc.7,v 1.14 1999/08/30 00:41:28 ross Exp $
2 .\"
3 .\" Copyright (c) 1991, 1993
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgement:
16 .\"     This product includes software developed by the University of
17 .\"     California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\"    may be used to endorse or promote products derived from this software
20 .\"    without specific prior written permission.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" SUCH DAMAGE.
33 .\"
34 .\"     @(#)mdoc.7      8.2 (Berkeley) 12/30/93
35 .\"
36 .Dd November 24, 1997
37 .Os
38 .Dt MDOC 7
39 .Sh NAME
40 .Nm mdoc
41 .Nd quick reference guide for the
42 .Nm \-mdoc
43 macro package
44 .Sh SYNOPSIS
45 .Nm groff
46 .Fl m Ns Ar doc
47 .Ar files ...
48 .Sh DESCRIPTION
49 The
50 .Nm \-mdoc
51 package is a set of content-based and domain-based macros
52 used to format the
53 .Bx
54 man pages.
55 The macro names and their meanings are
56 listed below for quick reference; for
57 a detailed explanation on using the package,
58 see the tutorial sampler
59 .Xr mdoc.samples 7 .
60 .Pp
61 The macros are described in two groups, the first
62 includes the structural and physical page layout macros.
63 The second contains the manual and general text domain
64 macros which differentiate the
65 .Nm -\mdoc
66 package from other
67 .Xr troff
68 formatting packages.
69 .Sh PAGE STRUCTURE DOMAIN
70 .Ss Title Macros
71 To create a valid manual page, these three macros, in this order,
72 are required:
73 .Bl -tag -width "xxxx.Os OPERATINGxSYSTEM [version/release]" -compact
74 .It Li "\&.Dd  " Ar "Month day, year"
75 Document date.
76 .It Li "\&.Dt  " Ar "DOCUMENT_TITLE [section] [volume]"
77 Title, in upper case.
78 .It Li "\&.Os  " Ar "OPERATING_SYSTEM [version/release]"
79 Operating system
80 .Pq Tn BSD .
81 .El
82 .Ss Page Layout Macros
83 Section headers, paragraph breaks, lists and displays.
84 .Bl -tag -width flag -compact
85 .It Li \&.Sh
86 Section Headers.
87 Valid headers, in the order of presentation:
88 .Bl -tag -width "RETURN VALUES" -compact
89 .It Ar NAME
90 Name section, should include the
91 .Ql \&.Nm
93 .Ql \&.Fn
94 and the
95 .Ql \&.Nd
96 macros.
97 .It Ar SYNOPSIS
98 Usage.
99 .It Ar DESCRIPTION
100 General description, should include
101 options and parameters.
102 .It Ar RETURN VALUES
103 Sections two and three function calls.
104 .It Ar ENVIRONMENT
105 Describe environment variables.
106 .It Ar FILES
107 Files associated with the subject.
108 .It Ar EXAMPLES
109 Examples and suggestions.
110 .It Ar DIAGNOSTICS
111 Normally used for section four device interface diagnostics.
112 .It Ar ERRORS
113 Sections two and three error and signal
114 handling.
115 .It Ar SEE ALSO
116 Cross references and citations.
117 .It Ar STANDARDS
118 Conformance to standards if applicable.
119 .It Ar HISTORY
120 If a standard is not applicable, the history
121 of the subject should be given.
122 .It Ar BUGS
123 Gotchas and caveats.
124 .It Ar SECURITY CONSIDERATIONS
125 Security issues to be aware of.
126 .It Ar other
127 Customized headers may be added at
128 the authors discretion.
130 .It Li \&.Ss
131 Subsection Headers.
132 .It Li \&.Pp
133 Paragraph Break.
134 Vertical space (one line).
135 .It Li \&.D1
136 (D-one) Display-one
137 Indent and display one text line.
138 .It Li \&.Dl
139 (D-ell) Display-one literal.
140 Indent and display one line of literal text.
141 .It Li \&.Bd
142 Begin-display block.
143 Display options:
144 .Bl -tag -width "xoffset string " -compact
145 .It Fl ragged
146 Unjustified (ragged edges).
147 .It Fl filled
148 Filled, and if
149 .Xr troff 1 ,
150 also justified.
151 .It Fl unfilled
152 Unfilled, unjustified.
153 .It Fl literal
154 Literal text or code.
155 .It Fl file Ar name
156 Read in named
157 .Ar file
158 and display.
159 .It Fl offset Ar string
160 Offset display.
161 Acceptable
162 .Ar string
163 values:
164 .Bl -tag -width indent-two -compact
165 .It Ar left
166 Align block on left (default).
167 .It Ar center
168 Approximate center margin.
169 .It Ar indent
170 Six constant width spaces (a tab).
171 .It Ar indent-two
172 Two tabs.
173 .It Ar right
174 Left aligns block 2 inches from
175 right.
176 .It Ar xx Ns Cm n
177 Where
178 .Ar xx
179 is a number from
180 .No \&4 Ns Cm n
182 .No \&9\&9 Ns Cm n .
183 .It Ar Aa
184 Where
185 .Ar Aa
186 is a callable macro name.
187 .It Ar string
188 The width of
189 .Ar string
190 is used.
193 .It Li \&.Ed
194 End-display (matches \&.Bd).
195 .It Li \&.Bl
196 Begin-list.
197 Create lists or columns. Options:
198 .Bl -tag -width flag -compact
199 .It Em List-types
200 .Bl -column "xbullet " -compact
201 .It Fl bullet Ta "Bullet Item List"
202 .It Fl dash Ta "Dash Item List"
203 .It Fl hyphen Ta "(as per" Fl dash ")"
204 .It Fl item Ta "Unlabeled List"
205 .It Fl enum Ta "Enumerated List"
206 .It Fl tag Ta "Tag Labeled List"
207 .It Fl diag Ta "Diagnostic List"
208 .It Fl hang Ta "Hanging Labeled List"
209 .It Fl ohang Ta "Overhanging Labeled List"
210 .It Fl inset Ta "Inset or Run-on Labeled List"
211 .It Fl column Ta "Multiple Columns"
213 .It Em List-parameters
214 .Bl -tag -width "xcompact " -compact
215 .It Fl offset
216 (All lists.) See
217 .Ql \&.Bd
218 begin-display above.
219 .It Fl width
220 .Pf ( Fl tag
222 .Fl hang
223 lists only.)
225 .Ql \&.Bd .
226 This parameter is effectively required for
227 .Fl tag
228 lists.
229 .It Fl compact
230 (All lists.)
231 Suppresses blank lines.
234 .It Li \&.El
235 End-list.
236 .It Li \&.It
237 List item.
239 .Sh MANUAL AND GENERAL TEXT DOMAIN MACROS
240 The manual and general text domain macros are special in that
241 most of them are parsed for callable macros
242 for example:
243 .Bl -tag -width ".Op Fl s Ar filex" -offset indent
244 .It Li "\&.Op Fl s Ar file"
245 Produces
246 .Op Fl s Ar file
249 In this example, the option enclosure macro
250 .Ql \&.Op
251 is parsed, and calls the callable content macro
252 .Ql \&Fl
253 which operates on the argument
254 .Ql s
255 and then calls the callable content macro
256 .Ql \&Ar
257 which operates on the argument
258 .Ql file .
259 Some macros may be callable, but are not parsed and vice versa.
260 These macros are indicated in the
261 .Em parsed
263 .Em callable
264 columns below.
266 Unless stated, manual domain macros share a common syntax:
268 .Dl \&.Va argument [\ .\ ,\ ;\ :\ (\ )\ [\ ]\ argument \...\ ]
270 .Sy Note :
271 Opening and closing
272 punctuation characters are only recognized as such if they are presented
273 one at a time.
274 The string
275 .Ql "),"
276 is not recognized as punctuation and will be output with a leading white
277 space and in what ever font the calling macro uses.
279 argument list
280 .Ql "] ) ,"
281 is recognized as three sequential closing punctuation characters
282 and a leading white space is not output between the characters
283 and the previous argument (if any).
284 The special meaning of a punctuation character may be escaped
285 with the string
286 .Ql \e& .
287 For example the following string,
288 .Bl -tag -width "&.Ar file1\ , file2\ , file3\ )\ ." -offset indent
289 .It Li "\&.Ar file1\ , file2\ , file3\ )\ ."
290 Produces
291 .Ar file1 , file2 , file3 ) .
293 .ne 1i
294 .Ss Manual Domain Macros
295 .Bl -column "Name" "Parsed" "Callable" -compact
296 .It Em Name     Parsed  Callable        Description
297 .It Li \&Ad Ta Yes Ta Yes Ta Address. "(This macro may be deprecated.)"
298 .It Li \&Ar Ta Yes Ta Yes Ta "Command line argument."
299 .It Li \&Cd Ta \&No Ta \&No Ta "Configuration declaration (section four only)."
300 .It Li \&Cm Ta Yes Ta Yes Ta "Command line argument modifier."
301 .It Li \&Dv Ta Yes Ta Yes Ta "Defined variable (source code)."
302 .It Li \&Er Ta Yes Ta Yes Ta "Error number (source code)."
303 .It Li \&Ev Ta Yes Ta Yes Ta "Environment variable."
304 .It Li \&Fa Ta Yes Ta Yes Ta "Function argument."
305 .It Li \&Fd Ta \&No Ta \&No Ta "Function declaration."
306 .It Li \&Fl Ta Yes Ta Yes Ta "Command line flag."
307 .It Li \&Fn Ta Yes Ta Yes Ta "Function call (also .Fo and .Fc)."
308 .It Li \&Ic Ta Yes Ta Yes Ta "Interactive command."
309 .It Li \&Li Ta Yes Ta Yes Ta "Literal text."
310 .It Li \&Nm Ta Yes Ta Yes Ta "Command name."
311 .It Li \&Op Ta Yes Ta Yes Ta "Option (also .Oo and .Oc)."
312 .It Li \&Ot Ta Yes Ta Yes Ta "Old style function type (Fortran only)."
313 .It Li \&Pa Ta Yes Ta Yes Ta "Pathname or file name."
314 .It Li \&St Ta Yes Ta Yes Ta "Standards (-p1003.2, -p1003.1 or -ansiC)"
315 .It Li \&Va Ta Yes Ta Yes Ta "Variable name."
316 .It Li \&Vt Ta Yes Ta Yes Ta "Variable type (Fortran only)."
317 .It Li \&Xr Ta Yes Ta Yes Ta "Manual Page Cross Reference."
319 .Ss General Text Domain Macros
320 .Bl -column "Name" "Parsed" "Callable" -compact
321 .It Em "Name    Parsed  Callable        Description"
322 .It Li \&%A Ta Yes Ta \&No Ta "Reference author."
323 .It Li \&%B Ta Yes Ta Yes Ta "Reference book title."
324 .It Li \&%\&C Ta \&No Ta \&No Ta "Reference place of publishing (city)."
325 .It Li \&%\&D Ta \&No Ta \&No Ta "Reference date."
326 .It Li \&%J Ta Yes Ta Yes Ta "Reference journal title."
327 .It Li \&%N Ta \&No Ta \&No Ta "Reference issue number."
328 .It Li \&%\&O Ta \&No Ta \&No Ta "Reference optional information."
329 .It Li \&%P Ta \&No Ta \&No Ta "Reference page number(s)."
330 .It Li \&%R Ta \&No Ta \&No Ta "Reference report Name."
331 .It Li \&%T Ta Yes Ta Yes Ta "Reference article title."
332 .It Li \&%V Ta \&No Ta \&No Ta "Reference volume."
333 .It Li \&Ac Ta Yes Ta Yes Ta "Angle close quote."
334 .It Li \&Ao Ta Yes Ta Yes Ta "Angle open quote."
335 .It Li \&Ap Ta Yes Ta Yes Ta "Insert apostrophe; switch to .No mode "
336 .It Li \&Aq Ta Yes Ta Yes Ta "Angle quote."
337 .It Li \&At Ta \&No Ta \&No Ta Tn "AT&T UNIX."
338 .It Li \&Bc Ta Yes Ta Yes Ta "Bracket close quote."
339 .It Li \&Bf Ta \&No Ta \&No Ta "Begin font mode."
340 .It Li \&Bo Ta Yes Ta Yes Ta "Bracket open quote."
341 .It Li \&Bq Ta Yes Ta Yes Ta "Bracket quote."
342 .It Li \&Bx Ta Yes Ta Yes Ta "BSD" .
343 .It Li \&Db Ta \&No Ta \&No Ta "Debug (default is \\*qoff\\*q)."
344 .It Li \&Dc Ta Yes Ta Yes Ta "Double close quote."
345 .It Li \&Do Ta Yes Ta Yes Ta "Double open quote."
346 .It Li \&Dq Ta Yes Ta Yes Ta "Double quote."
347 .It Li \&Ec Ta Yes Ta Yes Ta "Enclose string close quote."
348 .It Li \&Ef Ta \&No Ta \&No Ta "End font mode."
349 .It Li \&Em Ta Yes Ta Yes Ta "Emphasis (traditional English)."
350 .It Li \&Eo Ta Yes Ta Yes Ta "Enclose string open quote."
351 .It Li \&Fx Ta \&No Ta \&No Ta "FreeBSD."
352 .It Li \&No Ta Yes Ta Yes Ta "Normal text (no-op)."
353 .It Li \&Ns Ta Yes Ta Yes Ta "No space."
354 .It Li \&Nx Ta \&No Ta \&No Ta "NetBSD."
355 .It Li \&Pc Ta Yes Ta Yes Ta "Parenthesis close quote."
356 .It Li \&Pf Ta Yes Ta \&No Ta "Prefix string."
357 .It Li \&Po Ta Yes Ta Yes Ta "Parenthesis open quote."
358 .It Li \&Pq Ta Yes Ta Yes Ta "Parentheses quote."
359 .It Li \&Qc Ta Yes Ta Yes Ta "Strait Double close quote."
360 .It Li \&Ql Ta Yes Ta Yes Ta "Quoted literal."
361 .It Li \&Qo Ta Yes Ta Yes Ta "Strait Double open quote."
362 .It Li \&Qq Ta Yes Ta Yes Ta "Strait Double quote."
363 .It Li \&Re Ta \&No Ta \&No Ta "Reference end."
364 .It Li \&Rs Ta \&No Ta \&No Ta "Reference start."
365 .It Li \&Sc Ta Yes Ta Yes Ta "Single close quote."
366 .It Li \&So Ta Yes Ta Yes Ta "Single open quote."
367 .It Li \&Sq Ta Yes Ta Yes Ta "Single quote."
368 .It Li \&Sm Ta \&No Ta \&No Ta "Space mode (default is \\*qon\\*q)."
369 .It Li \&Sx Ta Yes Ta Yes Ta "Section Cross Reference."
370 .It Li \&Sy Ta Yes Ta Yes Ta "Symbolic (traditional English)."
371 .It Li \&Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)."
372 .It Li \&Ux Ta Yes Ta Yes Ta "UNIX."
373 .It Li \&Xc Ta Yes Ta Yes Ta "Extend argument list close."
374 .It Li \&Xo Ta Yes Ta Yes Ta "Extend argument list open."
376 .\" .It Sy \&Hf Ta \&No Ta \&No Ta "Include file with header"
378 Macro names ending in
379 .Ql q
380 quote remaining items on the argument list.
381 Macro names ending in
382 .Ql o
383 begin a quote which may span more than one line of input and
384 are close quoted with the matching macro name ending in
385 .Ql c .
386 Enclosure macros may be nested and are limited to
387 eight arguments.
389 Note: the extended argument list macros
390 .Pf ( Ql \&.Xo ,
391 .Ql \&.Xc )
392 and the function enclosure macros
393 .Pf ( Ql \&.Fo ,
394 .Ql \&.Fc )
395 are irregular.
396 The extended list macros are used when the number of macro arguments
397 would exceed the
398 .Xr troff
399 limitation of nine arguments.
400 .Sh CONFIGURATION
401 For site specific configuration of the macro package,
402 see the file
403 .Pa /usr/src/share/tmac/README .
404 .Sh FILES
405 .Bl -tag -width "tmac.doc-ditroff" -compact
406 .It Pa tmac.doc
407 Manual and general text domain macros.
408 .It Pa tmac.doc-common
409 Common structural macros and definitions.
410 .It Pa tmac.doc-nroff
411 Site dependent
412 .Xr nroff
413 style file.
414 .It Pa tmac.doc-ditroff
415 Site dependent
416 .Xr troff
417 style file.
418 .It Pa tmac.doc-syms
419 Special defines (such as the standards macro).
421 .Sh SEE ALSO
422 .Xr mdoc.samples 7