Imported Upstream version 1.22.4
[platform/upstream/groff.git] / tmac / groff_mdoc.7.man
1 '\" t
2 .\" groff_mdoc.man
3 .\"
4 .\"   A complete reference of the mdoc macro package for GNU troff.
5 .\"
6 .\" Based on NetBSD's mdoc.samples.7, version 1.21.
7 .\"
8 .\"
9 .\"   Warning: You can't format this file with the old mdoc macros!
10 .\"
11 .\"
12 .\" Copyright (C) 1990, 1993
13 .\"   The Regents of the University of California.  All rights reserved.
14 .\"
15 .\" Redistribution and use in source and binary forms, with or without
16 .\" modification, are permitted provided that the following conditions
17 .\" are met:
18 .\" 1. Redistributions of source code must retain the above copyright
19 .\"    notice, this list of conditions and the following disclaimer.
20 .\" 2. Redistributions in binary form must reproduce the above copyright
21 .\"    notice, this list of conditions and the following disclaimer in
22 .\"    the documentation and/or other materials provided with the
23 .\"    distribution.
24 .\" 3. [Deleted.  See
25 .\"     ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change]
26 .\" 4. Neither the name of the University nor the names of its
27 .\"    contributors may be used to endorse or promote products derived
28 .\"    from this software without specific prior written permission.
29 .\"
30 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS"
31 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
32 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
33 .\" PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
34 .\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
37 .\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
38 .\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
39 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
40 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
41 .\" SUCH DAMAGE.
42 .\"
43 .\"     @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93
44 .\"
45 .\" This reference invokes every macro in the package several times and
46 .\" is guaranteed to give a worst case performance for an already
47 .\" extremely slow package.
48 .\"
49 .
50 .Dd November 2, 2010
51 .Dt GROFF_MDOC 7
52 .Os
53 .
54 .
55 .Sh NAME
56 .
57 .Nm groff_mdoc
58 .Nd reference for groff's mdoc implementation
59 .
60 .
61 .Sh SYNOPSIS
62 .
63 .Nm groff Fl m Ns Cm doc Ar
64 .
65 .
66 .Sh DESCRIPTION
67 .
68 A complete reference for writing
69 .Ux
70 manual pages with the
71 .Nm \-mdoc
72 macro package; a
73 .Em content Ns -based
74 and
75 .Em domain Ns -based
76 formatting package for
77 .Tn GNU
78 .Xr troff 1 .
79 Its predecessor, the
80 .Xr \-man 7
81 package, addressed page layout leaving the manipulation of fonts and other
82 typesetting details to the individual author.
83 In
84 .Nm \-mdoc ,
85 page layout macros make up the
86 .Em "page structure domain"
87 which consists of macros for titles, section headers, displays and lists
88 \(en essentially items which affect the physical position of text on a
89 formatted page.
90 In addition to the page structure domain, there are two more domains, the
91 .Em manual
92 domain and the
93 .Em general
94 text domain.
95 The general text domain is defined as macros which perform tasks such as
96 quoting or emphasizing pieces of text.
97 The manual domain is defined as macros that are a subset of the day to day
98 informal language used to describe commands, routines and related
99 .Ux
100 files.
101 Macros in the manual domain handle command names, command-line arguments and
102 options, function names, function parameters, pathnames, variables, cross
103 references to other manual pages, and so on.
104 These domain items have value for both the author and the future user of the
105 manual page.
106 Hopefully, the consistency gained across the manual set will provide easier
107 translation to future documentation tools.
108 .Pp
109 Throughout the
110 .Ux
111 manual pages, a manual entry is simply referred to as a man page, regardless
112 of actual length and without sexist intention.
113 .
114 .
115 .Sh "GETTING STARTED"
116 .
117 The material presented in the remainder of this document is outlined
118 as follows:
119 .
120 .Bl -enum -width 3n -offset indent
121 .  It
122 .  Tn "TROFF IDIOSYNCRASIES"
123 .
124 .  Bl -tag -width 2n -compact
125 .    It "Macro Usage"
126 .    It "Passing Space Characters in an Argument"
127 .    It "Trailing Blank Space Characters"
128 .    It "Escaping Special Characters"
129 .    It "Other Possible Pitfalls"
130 .  El
131 .
132 .  It
133 .  Tn "A MANUAL PAGE TEMPLATE"
134 .
135 .  It
136 .  Tn "CONVENTIONS"
137 .
138 .  It
139 .  Tn "TITLE MACROS"
140 .
141 .  It
142 .  Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS"
143 .
144 .  Bl -tag -width 2n -compact
145 .    It "What's in a Name" Ns ...
146 .    It "General Syntax"
147 .  El
148 .
149 .  It
150 .  Tn "MANUAL DOMAIN"
151 .
152 .  Bl -tag -width 2n -compact
153 .    It "Addresses"
154 .    It "Author Name"
155 .    It "Arguments"
156 .    It "Configuration Declarations (Section Four Only)"
157 .    It "Command Modifiers"
158 .    It "Defined Variables"
159 .    It "Errno's"
160 .    It "Environment Variables"
161 .    It "Flags"
162 .    It "Function Declarations"
163 .    It "Function Types"
164 .    It "Functions (Library Routines)"
165 .    It "Function Arguments"
166 .    It "Return Values"
167 .    It "Exit Status"
168 .    \" .It "Header File (including source code)"
169 .    It "Interactive Commands"
170 .    It "Library Names"
171 .    It "Literals"
172 .    It "Names"
173 .    It "Options"
174 .    It "Pathnames"
175 .    It "Standards"
176 .    It "Variable Types"
177 .    It "Variables"
178 .    It "Manual Page Cross References"
179 .  El
180 .
181 .  It
182 .  Tn "GENERAL TEXT DOMAIN"
183 .
184 .  Bl -tag -width 2n -compact
185 .    It "AT&T Macro"
186 .    It "BSD Macro"
187 .    It "NetBSD Macro"
188 .    It "FreeBSD Macro"
189 .    It "DragonFly Macro"
190 .    It "OpenBSD Macro"
191 .    It "BSD/OS Macro"
192 .    It "UNIX Macro"
193 .    It "Emphasis Macro"
194 .    It "Font Mode"
195 .    It "Enclosure and Quoting Macros"
196 .    It "No-Op or Normal Text Macro"
197 .    It "No-Space Macro"
198 .    It "Section Cross References"
199 .    It "Symbolics"
200 .    It "Mathematical Symbols"
201 .    It "References and Citations"
202 .    It "Trade Names (or Acronyms and Type Names)"
203 .    It "Extended Arguments"
204 .  El
205 .
206 .  It
207 .  Tn "PAGE STRUCTURE DOMAIN"
208 .
209 .  Bl -tag -width 2n -compact
210 .    It "Section Headers"
211 .    It "Subsection Headers"
212 .    It "Paragraphs and Line Spacing"
213 .    It "Keeps"
214 .    It "Examples and Displays"
215 .    It "Lists and Columns"
216 .  El
217 .
218 .  It
219 .  Tn "MISCELLANEOUS MACROS"
220 .
221 .  It
222 .  Tn "PREDEFINED STRINGS"
223 .
224 .  It
225 .  Tn "DIAGNOSTICS"
226 .
227 .  It
228 .  Tn "FORMATTING WITH GROFF, TROFF, AND NROFF"
229 .
230 .  It
231 .  Tn "FILES"
232 .
233 .  It
234 .  Tn "SEE ALSO"
235 .
236 .  It
237 .  Tn "BUGS"
238 .El
239 .
240 .\" XXX
241 .if t \
242 .  ne 7
243 .
244 .
245 .Sh "TROFF IDIOSYNCRASIES"
246 .
247 The
248 .Nm \-mdoc
249 package attempts to simplify the process of writing a man page.
250 Theoretically, one should not have to learn the tricky details of
251 .Tn GNU
252 .Xr troff 1
253 to use
254 .Nm \-mdoc ;
255 however, there are a few limitations which are unavoidable and best gotten
256 out of the way.
257 And, too, be forewarned, this package is
258 .Em not
259 fast.
260 .
261 .Ss "Macro Usage"
262 .
263 As in
264 .Tn GNU
265 .Xr troff 1 ,
266 a macro is called by placing a
267 .Ql .\&
268 (dot character) at the beginning of a line followed by the two-character
269 (or three-character) name for the macro.
270 There can be space or tab characters between the dot and the macro name.
271 Arguments may follow the macro separated by spaces (but
272 .Em no
273 tabs).
274 It is the dot character at the beginning of the line which causes
275 .Tn GNU
276 .Xr troff 1
277 to interpret the next two (or more) characters as a macro name.
278 A single starting dot followed by nothing is ignored.
279 To place a
280 .Ql .\&
281 (dot character) at the beginning of an input line in some context other than
282 a macro invocation, precede the
283 .Ql .\&
284 (dot) with the
285 .Ql \e&
286 escape sequence which translates literally to a zero-width space, and is
287 never displayed in the output.
288 .Pp
289 In general,
290 .Tn GNU
291 .Xr troff 1
292 macros accept an unlimited number of arguments (contrary to other versions
293 of troff which can't handle more than nine arguments).
294 In limited cases, arguments may be continued or extended on the next
295 line (See
296 .Sx Extended Arguments
297 below).
298 Almost all macros handle quoted arguments (see
299 .Sx Passing Space Characters in an Argument
300 below).
301 .Pp
302 Most of the
303 .Nm \-mdoc
304 general text domain and manual domain macros are special in that their
305 argument lists are
306 .Em parsed
307 for callable macro names.
308 This means an argument on the argument list which matches a general text or
309 manual domain macro name (and which is defined to be callable) will be
310 executed or called when it is processed.
311 In this case the argument, although the name of a macro, is not preceded by
312 a
313 .Ql .\&
314 (dot).
315 This makes it possible to nest macros; for example the option macro,
316 .Ql .Op ,
317 may
318 .Em call
319 the flag and argument macros,
320 .Ql \&Fl
321 and
322 .Ql \&Ar ,
323 to specify an optional flag with an argument:
324 .
325 .Bl -tag -width ".Op Fl s Ar bytes" -offset indent
326 .It Op Fl s Ar bytes
327 is produced by
328 .Ql ".Op Fl s Ar bytes"
329 .El
330 .
331 .Pp
332 To prevent a string from being interpreted as a macro name, precede the
333 string with the escape sequence
334 .Ql \e& :
335 .
336 .Bl -tag -width ".Op \&Fl s \&Ar bytes" -offset indent
337 .It Op \&Fl s \&Ar bytes
338 is produced by
339 .Ql ".Op \e&Fl s \e&Ar bytes"
340 .El
341 .
342 .Pp
343 Here the strings
344 .Ql \&Fl
345 and
346 .Ql \&Ar
347 are not interpreted as macros.
348 Macros whose argument lists are parsed for callable arguments are referred
349 to as
350 .Em parsed
351 and macros which may be called from an argument list are referred to as
352 .Em callable
353 throughout this document.
354 This is a technical
355 .Em faux pas
356 as almost all of the macros in
357 .Nm \-mdoc
358 are parsed, but as it was cumbersome to constantly refer to macros as
359 being callable and being able to call other macros, the term parsed
360 has been used.
361 .
362 .Pp
363 In the following, we call an
364 .Nm \-mdoc
365 macro which starts a line (with a leading dot) a
366 .Em command
367 if this distinction is necessary.
368 .
369 .Ss "Passing Space Characters in an Argument"
370 .
371 Sometimes it is desirable to give as an argument a string containing one or
372 more blank space characters, say, to specify arguments to commands which
373 expect particular arrangement of items in the argument list.
374 Additionally, it makes
375 .Nm \-mdoc
376 working faster.
377 For example, the function command
378 .Ql .Fn
379 expects the first argument to be the name of a function and any remaining
380 arguments to be function parameters.
381 As
382 .Tn ANSI\~C
383 stipulates the declaration of function parameters in the parenthesized
384 parameter list, each parameter is guaranteed to be at minimum a two word
385 string.
386 For example,
387 .Fa int foo .
388 .Pp
389 There are two possible ways to pass an argument which contains
390 an embedded space.
391 One way of passing a string containing blank spaces is to use the hard or
392 unpaddable space character
393 .Ql \e\  ,
394 that is, a blank space preceded by the escape character
395 .Ql \e .
396 This method may be used with any macro but has the side effect of
397 interfering with the adjustment of text over the length of a line.
398 .Xr Troff
399 sees the hard space as if it were any other printable character and cannot
400 split the string into blank or newline separated pieces as one would expect.
401 This method is useful for strings which are not expected to overlap a line
402 boundary.
403 An alternative is to use
404 .Ql \e\[ti] ,
405 a paddable (i.e.\& stretchable), unbreakable space (this is a
406 .Tn GNU
407 .Xr troff 1
408 extension).
409 The second method is to enclose the string with double quotes.
410 .Pp
411 For example:
412 .
413 .Bl -tag -width ".Fn fetch char\ *str" -offset indent
414 .It Fn fetch char\ *str
415 is created by
416 .Ql ".Fn fetch char\e *str"
417 .It Fn fetch "char *str"
418 can also be created by
419 .Ql ".Fn fetch \*[q]char *str\*[q]"
420 .El
421 .
422 .Pp
423 If the
424 .Ql \e
425 before the space in the first example
426 or double quotes in the second example
427 were omitted,
428 .Ql .Fn
429 would see three arguments, and the result would be:
430 .Pp
431 .Dl Fn fetch char *str
432 .Pp
433 .\" For an example of what happens when the parameter list overlaps a newline
434 .\" boundary, see the
435 .\" .Sx BUGS
436 .\" section.
437 .
438 .Ss "Trailing Blank Space Characters"
439 .
440 .Xr Troff
441 can be confused by blank space characters at the end of a line.
442 It is a wise preventive measure to globally remove all blank spaces
443 from
444 .Ao blank-space Ac Ns Ao end-of-line Ac
445 character sequences.
446 Should the need arise to use a blank character at the end of a line, it
447 may be forced with an unpaddable space and the
448 .Ql \e&
449 escape character.
450 For example,
451 .Ql string\e\ \e& .
452 .
453 .Ss "Escaping Special Characters"
454 .
455 Special characters like the newline character
456 .Ql \en
457 are handled by replacing the
458 .Ql \e
459 with
460 .Ql \ee
461 (e.g.\&
462 .Ql \een )
463 to preserve the backslash.
464 .
465 .Ss "Other Possible Pitfalls"
466 .
467 A warning is emitted when an empty input line is found outside of displays
468 (see below).
469 Use
470 .Ql .sp
471 instead.
472 (Well, it is even better to use
473 .Nm \-mdoc
474 macros to avoid the usage of low-level commands.)
475 .Pp
476 Leading spaces will cause a break and are output directly.
477 Avoid this behaviour if possible.
478 Similarly, do not use more than one space character between words in an
479 ordinary text line; contrary to other text formatters, they are
480 .Em not
481 replaced with a single space.
482 .Pp
483 You can't pass
484 .Ql \*[q]
485 directly as an argument.
486 Use
487 .Ql \e*[q]
488 (or
489 .Ql \e*q )
490 instead.
491 .Pp
492 By default,
493 .Xr troff 1
494 inserts two space characters after a punctuation mark closing a sentence;
495 characters like
496 .Ql \&)
497 or
498 .Ql \&'
499 are treated transparently, not influencing the sentence-ending behaviour.
500 To change this, insert
501 .Ql \e&
502 before or after the dot:
503 .
504 .Bd -literal -offset indent
505 The
506 \&.Ql .
507 character.
508 \&.Pp
509 The
510 \&.Ql \e&.
511 character.
512 \&.Pp
513 \&.No test .
514 test
515 \&.Pp
516 \&.No test.
517 test
518 .Ed
519 .Pp
520 .
521 gives
522 .
523 .Bd -filled -offset indent
524 The
525 .Ql .
526 character
527 .Pp
528 The
529 .Ql \&.
530 character.
531 .Pp
532 .No test .
533 test
534 .Pp
535 .No test.
536 test
537 .Ed
538 .Pp
539 .
540 As can be seen in the first and third line,
541 .Nm \-mdoc
542 handles punctuation characters specially in macro arguments.
543 This will be explained in section
544 .Sx General Syntax
545 below.
546 In the same way, you have to protect trailing full stops of abbreviations
547 with a trailing zero-width space:
548 .Ql e.g.\e& .
549 .Pp
550 A comment in the source file of a man page can be either started with
551 .Ql .\e"
552 on a single line,
553 .Ql \e"
554 after some input, or
555 .Ql \e#
556 anywhere (the latter is a
557 .Tn GNU
558 .Xr troff 1
559 extension); the rest of such a line is ignored.
560 .
561 .
562 .Sh "A MANUAL PAGE TEMPLATE"
563 .
564 The body of a man page is easily constructed from a basic template:
565 .
566 .Bd -literal -offset indent
567 \&.\e" The following commands are required for all man pages.
568 \&.Dd Month day, year
569 \&.Dt DOCUMENT_TITLE [section number] [architecture/volume]
570 \&.Os [OPERATING_SYSTEM] [version/release]
571 \&.Sh NAME
572 \&.Nm name
573 \&.Nd one line description of name
574 \&.\e" This next command is for sections 2 and 3 only.
575 \&.\e" .Sh LIBRARY
576 \&.Sh SYNOPSIS
577 \&.Sh DESCRIPTION
578 \&.\e" The following commands should be uncommented and
579 \&.\e" used where appropriate.
580 \&.\e" .Sh IMPLEMENTATION NOTES
581 \&.\e" This next command is for sections 2, 3, and 9 only
582 \&.\e"     (function return values).
583 \&.\e" .Sh RETURN VALUES
584 \&.\e" This next command is for sections 1, 6, 7, and 8 only.
585 \&.\e" .Sh ENVIRONMENT
586 \&.\e" .Sh FILES
587 \&.\e" This next command is for sections 1, 6, and 8 only
588 \&.\e"     (command return values to the shell).
589 \&.\e" .Sh EXIT STATUS
590 \&.\e" .Sh EXAMPLES
591 \&.\e" This next command is for sections 1, 4, 6, 7, 8, and 9 only
592 \&.\e"     (fprintf/stderr type diagnostics).
593 \&.\e" .Sh DIAGNOSTICS
594 \&.\e" .Sh COMPATIBILITY
595 \&.\e" This next command is for sections 2, 3, 4, and 9 only
596 \&.\e"     (settings of the errno variable).
597 \&.\e" .Sh ERRORS
598 \&.\e" .Sh SEE ALSO
599 \&.\e" .Sh STANDARDS
600 \&.\e" .Sh HISTORY
601 \&.\e" .Sh AUTHORS
602 \&.\e" .Sh CAVEATS
603 \&.\e" .Sh BUGS
604 .Ed
605 .Pp
606 .
607 The first items in the template are the commands
608 .Ql .Dd ,
609 .Ql .Dt ,
610 and
611 .Ql .Os ;
612 the document date, the operating system the man page or subject source is
613 developed or modified for, and the man page title (in
614 .Em upper case )
615 along with the section of the manual the page belongs in.
616 These commands identify the page and are discussed below in
617 .Sx TITLE MACROS .
618 .Pp
619 The remaining items in the template are section headers
620 .Pf ( Li .Sh ) ;
621 of which
622 .Em NAME ,
623 .Em SYNOPSIS ,
624 and
625 .Em DESCRIPTION
626 are mandatory.
627 The headers are discussed in
628 .Sx "PAGE STRUCTURE DOMAIN" ,
629 after presentation of
630 .Sx "MANUAL DOMAIN" .
631 Several content macros are used to demonstrate page layout macros; reading
632 about content macros before page layout macros is recommended.
633 .
634 .
635 .Sh CONVENTIONS
636 .
637 In the description of all macros below, optional arguments are put into
638 brackets.
639 An ellipsis
640 .Pf ( Sq ... )
641 represents zero or more additional arguments.
642 Alternative values for a parameter are separated with
643 .Ql | .
644 If there are alternative values for a mandatory parameter, braces are used
645 (together with
646 .Ql | )
647 to enclose the value set.
648 Meta-variables are specified within angles.
649 .Pp
650 Example:
651 .
652 .Bl -tag -width 6n -offset indent
653 .It Li .Xx Xo
654 .Aq foo
655 .Brq bar1 | bar2
656 .Op \-test1 Op \-test2 | \-test3
657 .No ...
658 .Xc
659 .El
660 .
661 .Pp
662 Except stated explicitly, all macros are parsed and callable.
663 .Pp
664 Note that a macro takes effect up to the next nested macro.
665 For example,
666 .Ql ".Ic foo Aq bar"
667 doesn't produce
668 .Sq Ic "foo <bar>"
669 but
670 .Sq Ic foo Aq bar .
671 Consequently, a warning message is emitted for most commands if the first
672 argument is a macro itself since it cancels the effect of the calling
673 command completely.
674 Another consequence is that quoting macros never insert literal quotes;
675 .Sq Ic "foo <bar>"
676 has been produced by
677 .Ql ".Ic \*[q]foo <bar>\*[q]" .
678 .Pp
679 Most macros have a default width value which can be used to specify a label
680 width
681 .Pf ( Fl width )
682 or offset
683 .Pf ( Fl offset )
684 for the
685 .Ql .Bl
686 and
687 .Ql .Bd
688 macros.
689 It is recommended not to use this rather obscure feature to avoid
690 dependencies on local modifications of the
691 .Nm \-mdoc
692 package.
693 .
694 .
695 .Sh "TITLE MACROS"
696 .
697 The title macros are part of the page structure domain but are presented
698 first and separately for someone who wishes to start writing a man page
699 yesterday.
700 Three header macros designate the document title or manual page title, the
701 operating system, and the date of authorship.
702 These macros are called once at the very beginning of the document and are
703 used to construct headers and footers only.
704 .
705 .Bl -tag -width 6n
706 .It Li .Dt Xo
707 .Op Aq document title
708 .Op Aq section number
709 .Op Aq volume
710 .Xc
711 The document title is the subject of the man page and must be in
712 .Tn CAPITALS
713 due to troff limitations.
714 If omitted,
715 .Sq Tn UNTITLED
716 is used.
717 The section number may be a number in the range
718 .No 1,\~ Ns ... Ns ,\~9
719 or
720 .Ql unass ,
721 .Ql draft ,
722 or
723 .Ql paper .
724 If it is specified, and no volume name is given, a default volume name is
725 used.
726 .
727 .Pp
728 Under
729 .Tn \*[doc-operating-system] ,
730 the following sections are defined:
731 .Pp
732 .TS
733 l l l.
734 1       \*[doc-volume-operating-system] \*[doc-volume-ds-1]
735 2       \*[doc-volume-operating-system] \*[doc-volume-ds-2]
736 3       \*[doc-volume-operating-system] \*[doc-volume-ds-3]
737 4       \*[doc-volume-operating-system] \*[doc-volume-ds-4]
738 5       \*[doc-volume-operating-system] \*[doc-volume-ds-5]
739 6       \*[doc-volume-operating-system] \*[doc-volume-ds-6]
740 7       \*[doc-volume-operating-system] \*[doc-volume-ds-7]
741 8       \*[doc-volume-operating-system] \*[doc-volume-ds-8]
742 9       \*[doc-volume-operating-system] \*[doc-volume-ds-9]
743 .TE
744 .Pp
745 .
746 A volume name may be arbitrary or one of the following:
747 .
748 .Pp
749 .TS
750 l l.
751 USD     \*[doc-volume-ds-USD]
752 PS1     \*[doc-volume-ds-PS1]
753 AMD     \*[doc-volume-ds-AMD]
754 SMM     \*[doc-volume-ds-SMM]
755 URM     \*[doc-volume-ds-URM]
756 PRM     \*[doc-volume-ds-PRM]
757 KM      \*[doc-volume-ds-KM]
758 IND     \*[doc-volume-ds-IND]
759 LOCAL   \*[doc-volume-ds-LOCAL]
760 CON     \*[doc-volume-ds-CON]
761 .TE
762 .Pp
763 .
764 For compatibility,
765 .Ql MMI
766 can be used for
767 .Ql IND ,
768 and
769 .Ql LOC
770 for
771 .Ql LOCAL .
772 Values from the previous table will specify a new volume name.
773 If the third parameter is a keyword designating a computer architecture,
774 its value is prepended to the default volume name as specified by the
775 second parameter.
776 By default, the following architecture keywords are defined:
777 .
778 \# we use 'No' to avoid hyphenation
779 .Bd -ragged -offset indent
780 .No acorn26 , acorn32 , algor , alpha , amd64 , amiga , amigappc ,
781 .No arc , arm , arm26 , arm32 , armish , atari , aviion ,
782 .No beagle , bebox , cats , cesfic , cobalt , dreamcast ,
783 .No emips , evbarm , evbmips , evbppc , evbsh3 , ews4800mips ,
784 .No hp300 , hp700 , hpcarm , hpcmips , hpcsh , hppa , hppa64 ,
785 .No i386 , ia64 , ibmnws , iyonix , landisk , loongson , luna68k , luna88k ,
786 .No m68k , mac68k , macppc , mips , mips64 , mipsco , mmeye ,
787 .No mvme68k , mvme88k , mvmeppc , netwinder , news68k , newsmips , next68k ,
788 .No ofppc , palm , pc532 , playstation2 , pmax , pmppc , powerpc , prep ,
789 .No rs6000 , sandpoint , sbmips , sgi , sgimips , sh3 , shark ,
790 .No socppc , solbourne , sparc , sparc64 , sun2 , sun3 ,
791 .No tahoe , vax , x68k , x86_64 , xen , zaurus
792 .Ed
793 .Pp
794 .
795 If the section number is neither a numeric expression in the range 1 to\~9
796 nor one of the above described keywords, the third parameter is used
797 verbatim as the volume name.
798 .Pp
799 In the following examples, the left (which is identical to the right) and
800 the middle part of the manual page header strings are shown.
801 Note how
802 .Ql \e&
803 prevents the digit\~7 from being a valid numeric expression.
804 .
805 .Bd -ragged
806 .Bl -tag -width ".Li .Dt\ FOO\ 2\ i386" -compact -offset indent
807 .It Li ".Dt FOO 7"
808 .Ql FOO(7)
809 .Ql \*[doc-volume-operating-system] \*[doc-volume-ds-7]
810 .It Li ".Dt FOO 7 bar"
811 .Ql FOO(7)
812 .Ql \*[doc-volume-operating-system] \*[doc-volume-ds-7]
813 .It Li ".Dt FOO \e&7 bar"
814 .Ql FOO(7)
815 .Ql bar
816 .It Li ".Dt FOO 2 i386"
817 .Ql FOO(2)
818 .Ql \*[doc-volume-operating-system]/\*[doc-volume-as-i386] \*[doc-volume-ds-2]
819 .It Li ".Dt FOO \*[q]\*[q] bar"
820 .Ql FOO
821 .Ql bar
822 .El
823 .Ed
824 .Pp
825 .
826 Local, OS-specific additions might be found in the file
827 .Pa mdoc.local ;
828 look for strings named
829 .Ql volume\-ds\-XXX
830 (for the former type) and
831 .Ql volume\-as\-XXX
832 (for the latter type);
833 .Ql XXX
834 then denotes the keyword to be used with the
835 .Ql .Dt
836 macro.
837 .Pp
838 This macro is neither callable nor parsed.
839 .
840 .It Li .Os Xo
841 .Op Aq operating system
842 .Op Aq release
843 .Xc
844 If the first parameter is empty,
845 the default
846 .Sq Tn "\*[doc-operating-system]"
847 is used.
848 This may be overridden in the local configuration file,
849 .Pa mdoc.local .
850 In general, the name of the operating system should be the common acronym,
851 e.g.\&
852 .Tn BSD
853 or
854 .Tn ATT .
855 The release should be the standard release nomenclature for the system
856 specified.
857 In the following table, the possible second arguments for some predefined
858 operating systems are listed.
859 Similar to
860 .Ql .Dt ,
861 local additions might be defined in
862 .Pa mdoc.local ;
863 look for strings named
864 .Ql operating\-system\-XXX\-YYY ,
865 where
866 .Ql XXX
867 is the acronym for the operating system and
868 .Ql YYY
869 the release ID.
870 .
871 .Bd -ragged -compact
872 .Bl -tag -width ".No DragonFly" -offset indent
873 .It ATT
874 7th, 7, III, 3, V, V.2, V.3, V.4
875 .It BSD
876 3, 4, 4.1, 4.2, 4.3, 4.3t, 4.3T, 4.3r, 4.3R, 4.4
877 .It NetBSD
878 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,
879 1.3, 1.3a, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.6.1,
880 1.6.2, 1.6.3, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1, 3.0, 3.0.1, 3.0.2, 3.0.3,
881 3.1, 3.1.1, 4.0, 4.0.1, 5.0, 5.0.1, 5.0.2, 5.1, 5.1.2, 5.1.3, 5.1.4,
882 5.2, 5.2.1, 5.2.2, 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.1, 6.1.1,
883 6.1.2, 6.1.3, 6.1.4
884 .It FreeBSD
885 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,
886 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,
887 4.1.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.6.2, 4.7, 4.8, 4.9, 4.10, 4.11, 5.0, 5.1,
888 5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4, 7.0, 7.1, 7.2, 7.3, 7.4,
889 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, 9.2, 9.3, 10.0
890 .It OpenBSD
891 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4,
892 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9,
893 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6
894 .It DragonFly
895 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 1.8.1, 1.9, 1.10, 1.12, 1.12.2,
896 1.13, 2.0, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 2.9.1, 2.10, 2.10.1,
897 2.11, 2.12, 2.13, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8
898 .It Darwin
899 8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0, 8.5.0, 8.6.0, 8.7.0, 8.8.0, 8.9.0,
900 8.10.0, 8.11.0, 9.0.0, 9.1.0, 9.2.0, 9.3.0, 9.4.0, 9.5.0, 9.6.0, 9.7.0,
901 9.8.0, 10.1.0, 10.2.0, 10.3.0, 10.4.0, 10.5.0, 10.6.0, 10.7.0, 10.8.0,
902 11.0.0, 11.1.0, 11.2.0, 11.3.0, 11.4.0, 11.5.0, 12.0.0, 12.1.0, 12.2.0,
903 13.0.0, 13.1.0, 13.2.0, 13.3.0, 13.4.0, 14.0.0
904 .El
905 .Ed
906 .Pp
907 .
908 For
909 .Tn ATT ,
910 an unknown second parameter will be replaced with the string
911 .Tn UNIX ;
912 for the other predefined acronyms it will be ignored and a warning message
913 emitted.
914 Unrecognized arguments are displayed as given in the page footer.
915 For instance, a typical footer might be:
916 .Pp
917 .Dl .Os BSD 4.3
918 .Pp
919 giving
920 .Ql 4.3\~Berkeley Distribution ,
921 or for a locally produced set
922 .Pp
923 .Dl .Os CS Department
924 .Pp
925 which will produce
926 .Ql CS\~Department .
927 .Pp
928 If the
929 .Ql .Os
930 macro is not present, the bottom left corner of the manual page will be
931 ugly.
932 .Pp
933 This macro is neither callable nor parsed.
934 .
935 .It Li .Dd Oo
936 .Aq month
937 .Aq day ,
938 .Aq year
939 .Oc
940 If
941 .Ql Dd
942 has no arguments,
943 .Ql Epoch
944 is used for the date string.
945 If it has exactly three arguments, they are concatenated, separated with
946 unbreakable space:
947 .Pp
948 .Dl .Dd January 25, 2001
949 .Pp
950 The month's name shall not be abbreviated.
951 .Pp
952 With any other number of arguments, the current date is used, ignoring
953 the parameters.
954 .Pp
955 As a special exception, the format
956 .Bd -filled -offset indent
957 .Li .Dd $Mdocdate:
958 .Aq month
959 .Aq day
960 .Aq year
961 .Li $
962 .Ed
963 .Pp
964 is also recognized.
965 It is used in
966 .Ox
967 manuals to automatically insert the current date when committing.
968 .Pp
969 This macro is neither callable nor parsed.
970 .El
971 .
972 .
973 .Sh "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS"
974 .
975 .Ss "What's in a Name" Ns ...
976 .
977 The manual domain macro names are derived from the day to day informal
978 language used to describe commands, subroutines and related files.
979 Slightly different variations of this language are used to describe the
980 three different aspects of writing a man page.
981 First, there is the description of
982 .Nm \-mdoc
983 macro command usage.
984 Second is the description of a
985 .Ux
986 command
987 .Em with
988 .Nm \-mdoc
989 macros, and third, the description of a command to a user in the verbal
990 sense; that is, discussion of a command in the text of a man page.
991 .Pp
992 In the first case,
993 .Xr troff 1
994 macros are themselves a type of command; the general syntax for a troff
995 command is:
996 .
997 .Bd -filled -offset indent
998 .Li ".Xx argument1 argument2" ...
999 .Ed
1000 .Pp
1001 .
1002 .Ql .Xx
1003 is a macro command, and anything following it are arguments to
1004 be processed.
1005 In the second case, the description of a
1006 .Ux
1007 command using the content macros is a bit more involved; a typical
1008 .Sx SYNOPSIS
1009 command line might be displayed as:
1010 .
1011 .Bd -filled -offset indent
1012 .Nm filter
1013 .Op Fl flag
1014 .Ao Ar infile Ac Ao Ar outfile Ac
1015 .Ed
1016 .Pp
1017 .
1018 Here,
1019 .Nm filter
1020 is the command name and the
1021 bracketed string
1022 .Fl flag
1023 is a
1024 .Em flag
1025 argument designated as optional by the option brackets.
1026 In
1027 .Nm \-mdoc
1028 terms,
1029 .Ao Ar infile Ac
1030 and
1031 .Ao Ar outfile Ac
1032 are called
1033 .Em meta arguments ;
1034 in this example, the user has to replace the meta expressions given in angle
1035 brackets with real file names.
1036 Note that in this document meta arguments are used to describe
1037 .Nm \-mdoc
1038 commands; in most man pages, meta variables are not specifically written
1039 with angle brackets.
1040 The macros which formatted the above example:
1041 .
1042 .Bd -literal -offset indent
1043 \&.Nm filter
1044 \&.Op Fl flag
1045 \&.Ao Ar infile Ac Ao Ar outfile Ac
1046 .Ed
1047 .Pp
1048 .
1049 In the third case, discussion of commands and command syntax includes both
1050 examples above, but may add more detail.
1051 The arguments
1052 .Ao Ar infile Ac
1053 and
1054 .Ao Ar outfile Ac
1055 from the example above might be referred to as
1056 .Em operands
1057 or
1058 .Em file arguments .
1059 Some command-line argument lists are quite long:
1060 .
1061 .Bd -ragged
1062 .Bl -tag -width ".Nm make" -offset indent -compact
1063 .It Nm make
1064 .Op Fl eiknqrstv
1065 .Op Fl D Ar variable
1066 .Op Fl d Ar flags
1067 .Op Fl f Ar makefile
1068 .Op Fl I Ar directory
1069 .Op Fl j Ar max_jobs
1070 .Op Ar variable Ns = Ns Ar value
1071 .Bk
1072 .Op Ar target ...
1073 .Ek
1074 .El
1075 .Ed
1076 .Pp
1077 .
1078 Here one might talk about the command
1079 .Nm make
1080 and qualify the argument,
1081 .Ar makefile ,
1082 as an argument to the flag,
1083 .Fl f ,
1084 or discuss the optional file operand
1085 .Ar target .
1086 In the verbal context, such detail can prevent confusion, however the
1087 .Nm \-mdoc
1088 package does not have a macro for an argument
1089 .Em to
1090 a flag.
1091 Instead the
1092 .Ql \&Ar
1093 argument macro is used for an operand or file argument like
1094 .Ar target
1095 as well as an argument to a flag like
1096 .Ar variable .
1097 The make command line was produced from:
1098 .
1099 .Bd -literal -offset indent
1100 \&.Nm make
1101 \&.Op Fl eiknqrstv
1102 \&.Op Fl D Ar variable
1103 \&.Op Fl d Ar flags
1104 \&.Op Fl f Ar makefile
1105 \&.Op Fl I Ar directory
1106 \&.Op Fl j Ar max_jobs
1107 \&.Op Ar variable Ns = Ns Ar value
1108 \&.Bk
1109 \&.Op Ar target ...
1110 \&.Ek
1111 .Ed
1112 .Pp
1113 .
1114 The
1115 .Ql .Bk
1116 and
1117 .Ql .Ek
1118 macros are explained in
1119 .Sx Keeps .
1120 .
1121 .Ss "General Syntax"
1122 .
1123 The manual domain and general text domain macros share a similar syntax with
1124 a few minor deviations; most notably,
1125 .Ql .Ar ,
1126 .Ql .Fl ,
1127 .Ql .Nm ,
1128 and
1129 .Ql .Pa
1130 differ only when called without arguments; and
1131 .Ql .Fn
1132 and
1133 .Ql .Xr
1134 impose an order on their argument lists.
1135 All content macros are capable of recognizing and properly handling
1136 punctuation, provided each punctuation character is separated by a leading
1137 space.
1138 If a command is given:
1139 .Pp
1140 .Dl \&.Ar sptr, ptr),
1141 .Pp
1142 The result is:
1143 .Pp
1144 .Dl Ar sptr, ptr),
1145 .Pp
1146 The punctuation is not recognized and all is output in the
1147 font used by
1148 .Ql .Ar .
1149 If the punctuation is separated by a leading white space:
1150 .Pp
1151 .Dl \&.Ar "sptr , ptr ) ,"
1152 .Pp
1153 The result is:
1154 .Pp
1155 .Dl Ar sptr , ptr ) ,
1156 .Pp
1157 The punctuation is now recognized and output in the default font
1158 distinguishing it from the argument strings.
1159 To remove the special meaning from a punctuation character escape it with
1160 .Ql \e& .
1161 .Pp
1162 The following punctuation characters are recognized by
1163 .Nm \-mdoc :
1164 .
1165 .Bl -column -offset indent-two XXXXXX XXXXXX XXXXXX XXXXXX
1166 .It Li .\& Ta Li ,\& Ta Li :\& Ta Li ;\& Ta Li (\&
1167 .It Li )\& Ta Li [\& Ta Li ]\& Ta Li ?\& Ta Li !\&
1168 .El
1169 .Pp
1170 .
1171 .Xr Troff
1172 is limited as a macro language, and has difficulty when presented with a
1173 string containing a member of the mathematical, logical or quotation set:
1174 .
1175 .Bd -literal -offset indent-two
1176 {+,\-,/,*,%,<,>,<=,>=,=,==,&,`,',"}
1177 .Ed
1178 .Pp
1179 .
1180 The problem is that
1181 .Xr troff
1182 may assume it is supposed to actually perform the operation or evaluation
1183 suggested by the characters.
1184 To prevent the accidental evaluation of these characters, escape them with
1185 .Ql \e& .
1186 Typical syntax is shown in the first content macro displayed below,
1187 .Ql .Ad .
1188 .
1189 .
1190 .Sh "MANUAL DOMAIN"
1191 .
1192 .Ss Addresses
1193 .
1194 The address macro identifies an address construct.
1195 .Pp
1196 .Dl Usage: .Ad Ao address Ac ...
1197 .Pp
1198 .Bl -tag -width ".Li .Ad\ f1\ ,\ f2\ ,\ f3\ :" -compact -offset 15n
1199 .It Li ".Ad addr1"
1200 .Ad addr1
1201 .It Li ".Ad addr1 ."
1202 .Ad addr1 .
1203 .It Li ".Ad addr1 , file2"
1204 .Ad addr1 , file2
1205 .It Li ".Ad f1 , f2 , f3 :"
1206 .Ad f1 , f2 , f3 :
1207 .It Li ".Ad addr ) ) ,"
1208 .Ad addr ) ) ,
1209 .El
1210 .Pp
1211 .
1212 The default width is 12n.
1213 .
1214 .Ss "Author Name"
1215 .
1216 The
1217 .Ql .An
1218 macro is used to specify the name of the author of the item being
1219 documented, or the name of the author of the actual manual page.
1220 .Pp
1221 .Dl Usage: .An Ao author name Ac ...
1222 .Pp
1223 .Bl -tag -width ".Li .An\ \*[q]Joe\ Author\*[q]\ )\ )\ ," -offset 15n
1224 .It Li ".An \*[q]Joe Author\*[q]"
1225 .An "Joe Author"
1226 .It Li ".An \*[q]Joe Author\*[q] ,"
1227 .An "Joe Author" ,
1228 .It Li ".An \*[q]Joe Author\*[q] Aq nobody@FreeBSD.org"
1229 .An "Joe Author" Aq nobody@FreeBSD.org
1230 .It Li ".An \*[q]Joe Author\*[q] ) ) ,"
1231 .An "Joe Author" ) ) ,
1232 .El
1233 .Pp
1234 .
1235 The default width is 12n.
1236 .Pp
1237 In the
1238 .Em AUTHORS
1239 section, the
1240 .Ql .An
1241 command causes a line break allowing each new name to appear on its own
1242 line.
1243 If this is not desirable,
1244 .
1245 .Bd -literal -offset indent
1246 \&.An \-nosplit
1247 .Ed
1248 .Pp
1249 .
1250 call will turn this off.
1251 To turn splitting back on, write
1252 .
1253 .Bd -literal -offset indent
1254 \&.An \-split
1255 .Ed
1256 .
1257 .Ss "Arguments"
1258 .
1259 The
1260 .Li .Ar
1261 argument macro may be used whenever an argument is referenced.
1262 If called without arguments, the
1263 .Sq Ar
1264 string is output.
1265 .Pp
1266 .Dl Usage: .Ar Oo Ao argument Ac Oc ...
1267 .Pp
1268 .Bl -tag -width ".Li .Ar\ file1\ file2" -compact -offset 15n
1269 .It Li .Ar
1270 .Ar
1271 .It Li ".Ar file1"
1272 .Ar file1
1273 .It Li ".Ar file1 ."
1274 .Ar file1 .
1275 .It Li ".Ar file1 file2"
1276 .Ar file1 file2
1277 .It Li ".Ar f1 f2 f3 :"
1278 .Ar f1 f2 f3 :
1279 .It Li ".Ar file ) ) ,"
1280 .Ar file ) ) ,
1281 .El
1282 .Pp
1283 .
1284 The default width is 12n.
1285 .
1286 .Ss "Configuration Declaration (Section Four Only)"
1287 .
1288 The
1289 .Ql .Cd
1290 macro is used to demonstrate a
1291 .Xr config 8
1292 declaration for a device interface in a section four manual.
1293 .Pp
1294 .Dl Usage: .Cd Ao argument Ac ...
1295 .Pp
1296 .Bl -tag -width ".Li .Cd\ Xdevice\ le0\ at\ scode?X" -offset 15n
1297 .It Li ".Cd \*[q]device le0 at scode?\*[q]"
1298 .Cd "device le0 at scode?"
1299 .El
1300 .Pp
1301 In the
1302 .Sx SYNOPSIS
1303 section a
1304 .Ql .Cd
1305 command causes a line break before and after its arguments are printed.
1306 .Pp
1307 .
1308 The default width is 12n.
1309 .
1310 .Ss "Command Modifiers"
1311 .
1312 The command modifier is identical to the
1313 .Ql .Fl
1314 (flag) command with the exception that the
1315 .Ql .Cm
1316 macro does not assert a dash in front of every argument.
1317 Traditionally flags are marked by the preceding dash, however, some commands
1318 or subsets of commands do not use them.
1319 Command modifiers may also be specified in conjunction with interactive
1320 commands such as editor commands.
1321 See
1322 .Sx Flags .
1323 .Pp
1324 The default width is 10n.
1325 .
1326 .Ss "Defined Variables"
1327 .
1328 A variable (or constant) which is defined in an include file
1329 is specified by the macro
1330 .Ql .Dv .
1331 .Pp
1332 .Dl Usage: .Dv Ao defined variable Ac ...
1333 .Pp
1334 .Bl -tag -width ".Li .Dv\ MAXHOSTNAMELEN" -compact -offset 15n
1335 .It Li ".Dv MAXHOSTNAMELEN"
1336 .Dv MAXHOSTNAMELEN
1337 .It Li ".Dv TIOCGPGRP )"
1338 .Dv TIOCGPGRP )
1339 .El
1340 .Pp
1341 .
1342 The default width is 12n.
1343 .
1344 .Ss Errno's
1345 .
1346 The
1347 .Ql .Er
1348 errno macro specifies the error return value for section 2, 3, and\~9 library
1349 routines.
1350 The second example below shows
1351 .Ql .Er
1352 used with the
1353 .Ql .Bq
1354 general text domain macro, as it would be used in a section two manual page.
1355 .Pp
1356 .Dl Usage: .Er Ao errno type Ac ...
1357 .Pp
1358 .Bl -tag -width ".Li .Bq\ Er\ ENOTDIR" -compact -offset 15n
1359 .It Li ".Er ENOENT"
1360 .Er ENOENT
1361 .It Li ".Er ENOENT ) ;"
1362 .Er ENOENT ) ;
1363 .It Li ".Bq Er ENOTDIR"
1364 .Bq Er ENOTDIR
1365 .El
1366 .Pp
1367 .
1368 The default width is 17n.
1369 .
1370 .Ss "Environment Variables"
1371 .
1372 The
1373 .Ql .Ev
1374 macro specifies an environment variable.
1375 .Pp
1376 .Dl Usage: .Ev Ao argument Ac ...
1377 .Pp
1378 .Bl -tag -width ".Li .Ev\ PRINTER\ )\ )\ ," -compact -offset 15n
1379 .It Li ".Ev DISPLAY"
1380 .Ev DISPLAY
1381 .It Li ".Ev PATH ."
1382 .Ev PATH .
1383 .It Li ".Ev PRINTER ) ) ,"
1384 .Ev PRINTER ) ) ,
1385 .El
1386 .Pp
1387 .
1388 The default width is 15n.
1389 .
1390 .Ss Flags
1391 .
1392 The
1393 .Ql .Fl
1394 macro handles command-line flags.
1395 It prepends a dash,
1396 .Ql \- ,
1397 to the flag.
1398 For interactive command flags, which are not prepended with a dash, the
1399 .Ql .Cm
1400 (command modifier)
1401 macro is identical, but without the dash.
1402 .Pp
1403 .Dl Usage: .Fl Ao argument Ac ...
1404 .Pp
1405 .Bl -tag -width ".Li .Fl\ xyz\ )\ ," -compact -offset 15n
1406 .It Li .Fl
1407 .Fl
1408 .It Li ".Fl cfv"
1409 .Fl cfv
1410 .It Li ".Fl cfv ."
1411 .Fl cfv .
1412 .It Li ".Cm cfv ."
1413 .Cm cfv .
1414 .It Li ".Fl s v t"
1415 .Fl s v t
1416 .It Li ".Fl \- ,"
1417 .Fl \- ,
1418 .It Li ".Fl xyz ) ,"
1419 .Fl xyz ) ,
1420 .It Li ".Fl |"
1421 .Fl |
1422 .El
1423 .Pp
1424 The
1425 .Ql .Fl
1426 macro without any arguments results in a dash representing stdin/stdout.
1427 Note that giving
1428 .Ql .Fl
1429 a single dash will result in two dashes.
1430 .Pp
1431 The default width is 12n.
1432 .
1433 .Ss "Function Declarations"
1434 .
1435 The
1436 .Ql .Fd
1437 macro is used in the
1438 .Sx SYNOPSIS
1439 section with section two or three functions.
1440 It is neither callable nor parsed.
1441 .Pp
1442 .Dl Usage: .Fd Ao argument Ac ...
1443 .Pp
1444 .Bl -tag -width ".Li .Fd\ X#include\ <sys/types.h>X" -compact -offset 15n
1445 .It Li ".Fd \*[q]#include <sys/types.h>\*[q]"
1446 .Fd "#include <sys/types.h>"
1447 .El
1448 .Pp
1449 In the
1450 .Sx SYNOPSIS
1451 section a
1452 .Ql .Fd
1453 command causes a line break if a function has already been presented and a
1454 break has not occurred.
1455 This leaves a nice vertical space in between the previous function call and
1456 the declaration for the next function.
1457 .
1458 .Pp
1459 The
1460 .Ql .In
1461 macro, while in the
1462 .Sx SYNOPSIS
1463 section, represents the
1464 .Li #include
1465 statement, and is the short form of the above example.
1466 It specifies the C\~header file as being included in a C\~program.
1467 It also causes a line break.
1468 .Pp
1469 While not in the
1470 .Sx SYNOPSIS
1471 section, it represents the header file enclosed in angle brackets.
1472 .Pp
1473 .Dl Usage: .In Ao header file Ac
1474 .Pp
1475 .Bl -tag -width ".Li .In\ stdio.h" -compact -offset 15n
1476 .nr in-synopsis-section 1
1477 .It Li ".In stdio.h"
1478 .In stdio.h
1479 .nr in-synopsis-section 0
1480 .It Li ".In stdio.h"
1481 .In stdio.h
1482 .El
1483 .
1484 .Ss "Function Types"
1485 .
1486 This macro is intended for the
1487 .Sx SYNOPSIS
1488 section.
1489 It may be used anywhere else in the man page without problems, but its main
1490 purpose is to present the function type in kernel normal form for the
1491 .Sx SYNOPSIS
1492 of sections two and three (it causes a line break, allowing the function
1493 name to appear on the next line).
1494 .Pp
1495 .Dl Usage: .Ft Ao type Ac ...
1496 .Pp
1497 .Bl -tag -width ".Li .Ft\ struct\ stat" -compact -offset 15n
1498 .It Li ".Ft struct stat"
1499 .Ft struct stat
1500 .El
1501 .
1502 .Ss "Functions (Library Routines)"
1503 .
1504 The
1505 .Ql .Fn
1506 macro is modeled on
1507 .Tn ANSI\~C
1508 conventions.
1509 .Pp
1510 .Dl Usage: .Fn Ao function Ac Oo Ao parameter Ac Oc ...
1511 .Pp
1512 .Bl -tag -width ".Li .Fn\ align\ Xchar\ *ptrX\ ," -compact -offset 15n
1513 .It Li ".Fn getchar"
1514 .Fn getchar
1515 .It Li ".Fn strlen ) ,"
1516 .Fn strlen ) ,
1517 .It Li ".Fn align \*[q]char *ptr\*[q] ,"
1518 .Fn align "char *ptr" ,
1519 .El
1520 .Pp
1521 Note that any call to another macro signals the end of the
1522 .Ql .Fn
1523 call (it will insert a closing parenthesis at that point).
1524 .Pp
1525 For functions with many parameters (which is rare), the macros
1526 .Ql .Fo
1527 (function open)
1528 and
1529 .Ql .Fc
1530 (function close)
1531 may be used with
1532 .Ql .Fa
1533 (function argument).
1534 .Pp
1535 Example:
1536 .
1537 .Bd -literal -offset indent
1538 \&.Ft int
1539 \&.Fo res_mkquery
1540 \&.Fa "int op"
1541 \&.Fa "char *dname"
1542 \&.Fa "int class"
1543 \&.Fa "int type"
1544 \&.Fa "char *data"
1545 \&.Fa "int datalen"
1546 \&.Fa "struct rrec *newrr"
1547 \&.Fa "char *buf"
1548 \&.Fa "int buflen"
1549 \&.Fc
1550 .Ed
1551 .Pp
1552 .
1553 Produces:
1554 .
1555 .Bd -ragged -offset indent
1556 .Ft int
1557 .Fo res_mkquery
1558 .Fa "int op"
1559 .Fa "char *dname"
1560 .Fa "int class"
1561 .Fa "int type"
1562 .Fa "char *data"
1563 .Fa "int datalen"
1564 .Fa "struct rrec *newrr"
1565 .Fa "char *buf"
1566 .Fa "int buflen"
1567 .Fc
1568 .Ed
1569 .Pp
1570 .
1571 In the
1572 .Sx SYNOPSIS
1573 section, the function will always begin at the beginning of line.
1574 If there is more than one function presented in the
1575 .Sx SYNOPSIS
1576 section and a function type has not been given, a line break will occur,
1577 leaving a nice vertical space between the current function name and the one
1578 prior.
1579 .Pp
1580 The default width values of
1581 .Ql .Fn
1582 and
1583 .Ql .Fo
1584 are 12n and 16n, respectively.
1585 .
1586 .Ss "Function Arguments"
1587 .
1588 The
1589 .Ql .Fa
1590 macro is used to refer to function arguments (parameters) outside of the
1591 .Sx SYNOPSIS
1592 section of the manual or inside the
1593 .Sx SYNOPSIS
1594 section if the enclosure macros
1595 .Ql .Fo
1596 and
1597 .Ql .Fc
1598 instead of
1599 .Ql .Fn
1600 are used.
1601 .Ql .Fa
1602 may also be used to refer to structure members.
1603 .Pp
1604 .Dl Usage: .Fa Ao function argument Ac ...
1605 .Pp
1606 .Bl -tag -width ".Li .Fa\ d_namlen\ )\ )\ ," -compact -offset 15n
1607 .It Li ".Fa d_namlen ) ) ,"
1608 .Fa d_namlen ) ) ,
1609 .It Li ".Fa iov_len"
1610 .Fa iov_len
1611 .El
1612 .Pp
1613 .
1614 The default width is 12n.
1615 .
1616 .Ss "Return Values"
1617 .
1618 The
1619 .Ql .Rv
1620 macro generates text for use in the
1621 .Sx RETURN VALUES
1622 section.
1623 .Pp
1624 .Dl Usage: .Rv Oo \-std Oc Op Ao function Ac ...
1625 .Pp
1626 For example,
1627 .Ql ".Rv \-std atexit"
1628 produces:
1629 .
1630 .Bd -ragged -offset indent
1631 \# a small hack to suppress a warning message
1632 .ds doc-section-old "\*[doc-section]
1633 .ds doc-section 3
1634 .Rv -std atexit
1635 .ds doc-section "\*[doc-section-old]
1636 .Ed
1637 .Pp
1638 .
1639 The
1640 .Fl std
1641 option is valid only for manual page sections\~2 and\~3.
1642 Currently, this macro does nothing if used without the
1643 .Fl std
1644 flag.
1645 .
1646 .Ss "Exit Status"
1647 .
1648 The
1649 .Ql .Ex
1650 macro generates text for use in the
1651 .Sx DIAGNOSTICS
1652 section.
1653 .Pp
1654 .Dl Usage: .Ex Oo \-std Oc Op Ao utility Ac ...
1655 .Pp
1656 For example,
1657 .Ql ".Ex \-std cat"
1658 produces:
1659 .
1660 .Bd -ragged -offset indent
1661 \# a small hack to suppress a warning message
1662 .ds doc-section-old "\*[doc-section]
1663 .ds doc-section 1
1664 .Ex -std cat
1665 .ds doc-section "\*[doc-section-old]
1666 .Ed
1667 .Pp
1668 .
1669 The
1670 .Fl std
1671 option is valid only for manual page sections 1, 6 and\~8.
1672 Currently, this macro does nothing if used without the
1673 .Fl std
1674 flag.
1675 .
1676 .Ss "Interactive Commands"
1677 .
1678 The
1679 .Ql .Ic
1680 macro designates an interactive or internal command.
1681 .Pp
1682 .Dl Usage: .Ic Ao argument Ac ...
1683 .Pp
1684 .Bl -tag -width ".Li .Ic\ setenv\ ,\ unsetenv" -compact -offset 15n
1685 .It Li ".Ic :wq"
1686 .Ic :wq
1687 .It Li ".Ic \*[q]do while {...}\*[q]"
1688 .Ic "do while {...}"
1689 .It Li ".Ic setenv , unsetenv"
1690 .Ic setenv , unsetenv
1691 .El
1692 .Pp
1693 .
1694 The default width is 12n.
1695 .
1696 .Ss "Library Names"
1697 .
1698 The
1699 .Ql .Lb
1700 macro is used to specify the library where a particular function is compiled
1701 in.
1702 .Pp
1703 .Dl Usage: .Lb Ao argument Ac ...
1704 .Pp
1705 Available arguments to
1706 .Ql .Lb
1707 and their results are:
1708 .
1709 .Pp
1710 .Bl -tag -width ".Li librpcsec_gss" -compact -offset indent
1711 .It Li libarchive
1712 .Lb libarchive
1713 .It Li libarm
1714 .Lb libarm
1715 .It Li libarm32
1716 .Lb libarm32
1717 .It Li libbluetooth
1718 .Lb libbluetooth
1719 .It Li libbsm
1720 .Lb libbsm
1721 .It Li libc
1722 .Lb libc
1723 .It Li libc_r
1724 .Lb libc_r
1725 .It Li libcalendar
1726 .Lb libcalendar
1727 .It Li libcam
1728 .Lb libcam
1729 .It Li libcdk
1730 .Lb libcdk
1731 .It Li libcipher
1732 .Lb libcipher
1733 .It Li libcompat
1734 .Lb libcompat
1735 .It Li libcrypt
1736 .Lb libcrypt
1737 .It Li libcurses
1738 .Lb libcurses
1739 .It Li libdevinfo
1740 .Lb libdevinfo
1741 .It Li libdevstat
1742 .Lb libdevstat
1743 .It Li libdisk
1744 .Lb libdisk
1745 .It Li libdwarf
1746 .Lb libdwarf
1747 .It Li libedit
1748 .Lb libedit
1749 .It Li libelf
1750 .Lb libelf
1751 .It Li libevent
1752 .Lb libevent
1753 .It Li libfetch
1754 .Lb libfetch
1755 .It Li libform
1756 .Lb libform
1757 .It Li libgeom
1758 .Lb libgeom
1759 .It Li libgpib
1760 .Lb libgpib
1761 .It Li libi386
1762 .Lb libi386
1763 .It Li libintl
1764 .Lb libintl
1765 .It Li libipsec
1766 .Lb libipsec
1767 .It Li libipx
1768 .Lb libipx
1769 .It Li libiscsi
1770 .Lb libiscsi
1771 .It Li libjail
1772 .Lb libjail
1773 .It Li libkiconv
1774 .Lb libkiconv
1775 .It Li libkse
1776 .Lb libkse
1777 .It Li libkvm
1778 .Lb libkvm
1779 .It Li libm
1780 .Lb libm
1781 .It Li libm68k
1782 .Lb libm68k
1783 .It Li libmagic
1784 .Lb libmagic
1785 .It Li libmd
1786 .Lb libmd
1787 .It Li libmemstat
1788 .Lb libmemstat
1789 .It Li libmenu
1790 .Lb libmenu
1791 .It Li libnetgraph
1792 .Lb libnetgraph
1793 .It Li libnetpgp
1794 .Lb libnetpgp
1795 .It Li libossaudio
1796 .Lb libossaudio
1797 .It Li libpam
1798 .Lb libpam
1799 .It Li libpcap
1800 .Lb libpcap
1801 .It Li libpci
1802 .Lb libpci
1803 .It Li libpmc
1804 .Lb libpmc
1805 .It Li libposix
1806 .Lb libposix
1807 .It Li libprop
1808 .Lb libprop
1809 .It Li libpthread
1810 .Lb libpthread
1811 .It Li libpuffs
1812 .Lb libpuffs
1813 .It Li librefuse
1814 .Lb librefuse
1815 .It Li libresolv
1816 .Lb libresolv
1817 .It Li librpcsec_gss
1818 .Lb librpcsec_gss
1819 .It Li librpcsvc
1820 .Lb librpcsvc
1821 .It Li librt
1822 .Lb librt
1823 .It Li libsdp
1824 .Lb libsdp
1825 .It Li libssp
1826 .Lb libssp
1827 .It Li libSystem
1828 .Lb libSystem
1829 .It Li libtermcap
1830 .Lb libtermcap
1831 .It Li libterminfo
1832 .Lb libterminfo
1833 .It Li libthr
1834 .Lb libthr
1835 .It Li libufs
1836 .Lb libufs
1837 .It Li libugidfw
1838 .Lb libugidfw
1839 .It Li libulog
1840 .Lb libulog
1841 .It Li libusbhid
1842 .Lb libusbhid
1843 .It Li libutil
1844 .Lb libutil
1845 .It Li libvgl
1846 .Lb libvgl
1847 .It Li libx86_64
1848 .Lb libx86_64
1849 .It Li libz
1850 .Lb libz
1851 .El
1852 .Pp
1853 .
1854 Local, OS-specific additions might be found in the file
1855 .Pa mdoc.local ;
1856 look for strings named
1857 .Ql str\-Lb\-XXX .
1858 .Ql XXX
1859 then denotes the keyword to be used with the
1860 .Ql .Lb
1861 macro.
1862 .Pp
1863 In the
1864 .Em LIBRARY
1865 section an
1866 .Ql .Lb
1867 command causes a line break before and after its arguments are printed.
1868 .Pp
1869 .
1870 .Ss Literals
1871 .
1872 The
1873 .Ql .Li
1874 literal macro may be used for special characters, variable constants, etc.\&
1875 \- anything which should be displayed as it would be typed.
1876 .Pp
1877 .Dl Usage: .Li Ao argument Ac ...
1878 .Pp
1879 .Bl -tag -width ".Li .Li\ cntrl\-D\ )\ ,"  -compact -offset 15n
1880 .It Li ".Li \een"
1881 .Li \en
1882 .It Li ".Li M1 M2 M3 ;"
1883 .Li M1 M2 M3 ;
1884 .It Li ".Li cntrl\-D ) ,"
1885 .Li cntrl-D ) ,
1886 .It Li ".Li 1024 ..."
1887 .Li 1024 ...
1888 .El
1889 .Pp
1890 .
1891 The default width is 16n.
1892 .
1893 .Ss Names
1894 .
1895 The
1896 .Ql .Nm
1897 macro is used for the document title or subject name.
1898 It has the peculiarity of remembering the first argument it was called with,
1899 which should always be the subject name of the page.
1900 When called without arguments,
1901 .Ql .Nm
1902 regurgitates this initial name for the sole purpose of making less work for
1903 the author.
1904 .Ql .Nm
1905 causes a line break within the
1906 .Sx SYNOPSIS
1907 section.
1908 .Pp
1909 Note: A section two or three document function name is addressed with the
1910 .Ql .Nm
1911 in the
1912 .Em NAME
1913 section, and with
1914 .Ql .Fn
1915 in the
1916 .Sx SYNOPSIS
1917 and remaining sections.
1918 For interactive commands, such as the
1919 .Ql while
1920 command keyword in
1921 .Xr csh 1 ,
1922 the
1923 .Ql .Ic
1924 macro should be used.
1925 While
1926 .Ql .Ic
1927 is nearly identical
1928 to
1929 .Ql .Nm ,
1930 it can not recall the first argument it was invoked with.
1931 .Pp
1932 .Dl Usage: .Nm Oo Ao argument Ac Oc ...
1933 .Pp
1934 .Bl -tag -width ".Li .Nm\ groff_mdoc" -compact -offset 15n
1935 .It Li ".Nm groff_mdoc"
1936 .Nm groff_mdoc
1937 .It Li ".Nm \e\-mdoc"
1938 .Nm \-mdoc
1939 .It Li ".Nm foo ) ) ,"
1940 .Nm foo ) ) ,
1941 .It Li ".Nm :"
1942 .Nm :
1943 .El
1944 .Pp
1945 .
1946 The default width is 10n.
1947 .
1948 .Ss Options
1949 .
1950 The
1951 .Ql .Op
1952 macro places option brackets around any remaining arguments on the
1953 command line, and places any trailing punctuation outside the brackets.
1954 The macros
1955 .Ql .Oo
1956 and
1957 .Ql .Oc
1958 (which produce an opening and a closing option bracket respectively) may be used
1959 across one or more lines or to specify the exact position of the closing
1960 parenthesis.
1961 .Pp
1962 .Dl Usage: .Op Oo Ao option Ac Oc ...
1963 .Pp
1964 .Bl -tag -width ".Li .Op\ Fl\ c\ Ar\ objfil\ Op\ Ar\ corfil\ ," -compact -offset 15n
1965 .It Li .Op
1966 .Op
1967 .It Li ".Op Fl k"
1968 .Op Fl k
1969 .It Li ".Op Fl k ) ."
1970 .Op Fl k ) .
1971 .It Li ".Op Fl k Ar kookfile"
1972 .Op Fl k Ar kookfile
1973 .It Li ".Op Fl k Ar kookfile ,"
1974 .Op Fl k Ar kookfile ,
1975 .It Li ".Op Ar objfil Op Ar corfil"
1976 .Op Ar objfil Op Ar corfil
1977 .It Li ".Op Fl c Ar objfil Op Ar corfil ,"
1978 .Op Fl c Ar objfil Op Ar corfil ,
1979 .It Li ".Op word1 word2"
1980 .Op word1 word2
1981 .It Li ".Li .Op Oo Ao option Ac Oc ..."
1982 .Li .Op Oo Ao option Ac Oc ...
1983 .El
1984 .Pp
1985 Here a typical example of the
1986 .Ql .Oo
1987 and
1988 .Ql .Oc
1989 macros:
1990 .
1991 .Bd -literal -offset indent
1992 \&.Oo
1993 \&.Op Fl k Ar kilobytes
1994 \&.Op Fl i Ar interval
1995 \&.Op Fl c Ar count
1996 \&.Oc
1997 .Ed
1998 .Pp
1999 .
2000 Produces:
2001 .
2002 .Bd -filled -offset indent
2003 .Oo
2004 .Op Fl k Ar kilobytes
2005 .Op Fl i Ar interval
2006 .Op Fl c Ar count
2007 .Oc
2008 .Ed
2009 .Pp
2010 .
2011 The default width values of
2012 .Ql .Op
2013 and
2014 .Ql .Oo
2015 are 14n and 10n, respectively.
2016 .
2017 .Ss Pathnames
2018 .
2019 The
2020 .Ql .Pa
2021 macro formats path or file names.
2022 If called without arguments, the
2023 .Sq Pa
2024 string is output, which represents the current user's home directory.
2025 .Pp
2026 .Dl Usage: .Pa Oo Ao pathname Ac Oc ...
2027 .Pp
2028 .Bl -tag -width ".Li .Pa\ /tmp/fooXXXXX\ )\ ." -compact -offset 15n
2029 .It Li .Pa
2030 .Pa
2031 .It Li ".Pa /usr/share"
2032 .Pa /usr/share
2033 .It Li ".Pa /tmp/fooXXXXX ) ."
2034 .Pa /tmp/fooXXXXX ) .
2035 .El
2036 .Pp
2037 .
2038 The default width is 32n.
2039 .
2040 .Ss Standards
2041 .
2042 The
2043 .Ql .St
2044 macro replaces standard abbreviations with their formal names.
2045 .Pp
2046 .Dl Usage: .St Ao abbreviation Ac ...
2047 .Pp
2048 Available pairs for
2049 .Dq Abbreviation/Formal Name
2050 are:
2051 .
2052 .Pp
2053 .Tn ANSI/ISO C
2054 .Pp
2055 .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent
2056 .It Li \-ansiC
2057 .St -ansiC
2058 .It Li \-ansiC\-89
2059 .St -ansiC-89
2060 .It Li \-isoC
2061 .St -isoC
2062 .It Li \-isoC\-90
2063 .St -isoC-90
2064 .It Li \-isoC\-99
2065 .St -isoC-99
2066 .It Li \-isoC\-2011
2067 .St -isoC-2011
2068 .El
2069 .Pp
2070 .
2071 .Tn POSIX
2072 Part 1: System API
2073 .Pp
2074 .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent
2075 .It Li \-iso9945\-1\-90
2076 .St -iso9945-1-90
2077 .It Li \-iso9945\-1\-96
2078 .St -iso9945-1-96
2079 .It Li \-p1003.1
2080 .St -p1003.1
2081 .It Li \-p1003.1\-88
2082 .St -p1003.1-88
2083 .It Li \-p1003.1\-90
2084 .St -p1003.1-90
2085 .It Li \-p1003.1\-96
2086 .St -p1003.1-96
2087 .It Li \-p1003.1b\-93
2088 .St -p1003.1b-93
2089 .It Li \-p1003.1c\-95
2090 .St -p1003.1c-95
2091 .It Li \-p1003.1g\-2000
2092 .St -p1003.1g-2000
2093 .It Li \-p1003.1i\-95
2094 .St -p1003.1i-95
2095 .It Li \-p1003.1\-2001
2096 .St -p1003.1-2001
2097 .It Li \-p1003.1\-2004
2098 .St -p1003.1-2004
2099 .It Li \-p1003.1\-2008
2100 .St -p1003.1-2008
2101 .El
2102 .Pp
2103 .
2104 .Tn POSIX
2105 Part 2: Shell and Utilities
2106 .Pp
2107 .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent
2108 .It Li \-iso9945\-2\-93
2109 .St -iso9945-2-93
2110 .It Li \-p1003.2
2111 .St -p1003.2
2112 .It Li \-p1003.2\-92
2113 .St -p1003.2-92
2114 .It Li \-p1003.2a\-92
2115 .St -p1003.2a-92
2116 .El
2117 .Pp
2118 .
2119 X/Open
2120 .Pp
2121 .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent
2122 .It Li \-susv2
2123 .St -susv2
2124 .It Li \-susv3
2125 .St -susv3
2126 .It Li \-svid4
2127 .St -svid4
2128 .It Li \-xbd5
2129 .St -xbd5
2130 .It Li \-xcu5
2131 .St -xcu5
2132 .It Li \-xcurses4.2
2133 .St -xcurses4.2
2134 .It Li \-xns5
2135 .St -xns5
2136 .It Li \-xns5.2
2137 .St -xns5.2
2138 .It Li \-xpg3
2139 .St -xpg3
2140 .It Li \-xpg4
2141 .St -xpg4
2142 .It Li \-xpg4.2
2143 .St -xpg4.2
2144 .It Li \-xsh5
2145 .St -xsh5
2146 .El
2147 .Pp
2148 .
2149 Miscellaneous
2150 .Pp
2151 .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent
2152 .It Li \-ieee754
2153 .St -ieee754
2154 .It Li \-iso8601
2155 .St -iso8601
2156 .It Li \-iso8802\-3
2157 .St -iso8802-3
2158 .El
2159 .
2160 .Ss "Variable Types"
2161 .
2162 The
2163 .Ql .Vt
2164 macro may be used whenever a type is referenced.
2165 In the
2166 .Sx SYNOPSIS
2167 section, it causes a line break (useful for old style variable declarations).
2168 .Pp
2169 .Dl Usage: .Vt Ao type Ac ...
2170 .Pp
2171 .Bl -tag -width ".Li .Vt\ extern\ char\ *optarg\ ;" -compact -offset 15n
2172 .It Li ".Vt extern char *optarg ;"
2173 .Vt extern char *optarg ;
2174 .It Li ".Vt FILE *"
2175 .Vt FILE *
2176 .El
2177 .
2178 .Ss Variables
2179 .
2180 Generic variable reference.
2181 .Pp
2182 .Dl Usage: .Va Ao variable Ac ...
2183 .Pp
2184 .Bl -tag -width ".Li .Va\ Xchar\ sX\ ]\ )\ )\ ," -compact -offset 15n
2185 .It Li ".Va count"
2186 .Va count
2187 .It Li ".Va settimer ,"
2188 .Va settimer ,
2189 .It Li ".Va \*[q]int *prt\*[q] ) :"
2190 .Va "int *prt" ) :
2191 .It Li ".Va \*[q]char s\*[q] ] ) ) ,"
2192 .Va "char s" ] ) ) ,
2193 .El
2194 .Pp
2195 .
2196 The default width is 12n.
2197 .
2198 .Ss "Manual Page Cross References"
2199 .
2200 The
2201 .Ql .Xr
2202 macro expects the first argument to be a manual page name.
2203 The optional second argument, if a string (defining the manual section), is
2204 put into parentheses.
2205 .Pp
2206 .Dl Usage: .Xr Ao man page name Ac Oo Ao section Ac Oc ...
2207 .Pp
2208 .Bl -tag -width ".Li .Xr\ xinit\ 1x\ ;" -compact -offset 15n
2209 .It Li ".Xr mdoc"
2210 .Xr mdoc
2211 .It Li ".Xr mdoc ,"
2212 .Xr mdoc ,
2213 .It Li ".Xr mdoc 7"
2214 .Xr mdoc 7
2215 .It Li ".Xr xinit 1x ;"
2216 .Xr xinit 1x ;
2217 .El
2218 .Pp
2219 .
2220 The default width is 10n.
2221 .
2222 .
2223 .Sh "GENERAL TEXT DOMAIN"
2224 .
2225 .Ss "AT&T Macro"
2226 .
2227 .Pp
2228 .Dl Usage: .At Oo Ao version Ac Oc ...
2229 .Pp
2230 .Bl -tag -width ".Li .At\ v6\ ." -compact -offset 15n
2231 .It Li .At
2232 .At
2233 .It Li ".At v6 ."
2234 .At v6 .
2235 .El
2236 .Pp
2237 The following values for
2238 .Ao version Ac
2239 are possible:
2240 .Pp
2241 .Dl 32v, v1, v2, v3, v4, v5, v6, v7, III, V, V.1, V.2, V.3, V.4
2242 .
2243 .Ss "BSD Macro"
2244 .
2245 .Pp
2246 .Dl "Usage: .Bx" Bro \-alpha | \-beta | \-devel Brc ...
2247 .Dl "       .Bx" Oo Ao version Ac Oo Ao release Ac Oc Oc ...
2248 .Pp
2249 .Bl -tag -width ".Li .Bx\ -devel" -compact -offset 15n
2250 .It Li .Bx
2251 .Bx
2252 .It Li ".Bx 4.3 ."
2253 .Bx 4.3 .
2254 .It Li ".Bx \-devel"
2255 .Bx -devel
2256 .El
2257 .Pp
2258 .Ao version Ac
2259 will be prepended to the string
2260 .Sq Bx .
2261 The following values for
2262 .Ao release Ac
2263 are possible:
2264 .Pp
2265 .Dl Reno, reno, Tahoe, tahoe, Lite, lite, Lite2, lite2
2266 .
2267 .Ss "NetBSD Macro"
2268 .
2269 .Pp
2270 .Dl Usage: .Nx Oo Ao version Ac Oc ...
2271 .Pp
2272 .Bl -tag -width ".Li .Nx\ 1.4\ ." -compact -offset 15n
2273 .It Li .Nx
2274 .Nx
2275 .It Li ".Nx 1.4 ."
2276 .Nx 1.4 .
2277 .El
2278 .Pp
2279 For possible values of
2280 .Ao version Ac
2281 see the description of the
2282 .Ql .Os
2283 command above in section
2284 .Sx "TITLE MACROS" .
2285 .
2286 .Ss "FreeBSD Macro"
2287 .
2288 .Pp
2289 .Dl Usage: .Fx Oo Ao version Ac Oc ...
2290 .Pp
2291 .Bl -tag -width ".Li .Fx\ 2.2\ ." -compact -offset 15n
2292 .It Li .Fx
2293 .Fx
2294 .It Li ".Fx 2.2 ."
2295 .Fx 2.2 .
2296 .El
2297 .Pp
2298 For possible values of
2299 .Ao version Ac
2300 see the description of the
2301 .Ql .Os
2302 command above in section
2303 .Sx "TITLE MACROS" .
2304 .
2305 .Ss "DragonFly Macro"
2306 .
2307 .Pp
2308 .Dl Usage: .Dx Oo Ao version Ac Oc ...
2309 .Pp
2310 .Bl -tag -width ".Li .Dx\ 1.4\ ." -compact -offset 15n
2311 .It Li .Dx
2312 .Dx
2313 .It Li ".Dx 1.4 ."
2314 .Dx 1.4 .
2315 .El
2316 .Pp
2317 For possible values of
2318 .Ao version Ac
2319 see the description of the
2320 .Ql .Os
2321 command above in section
2322 .Sx "TITLE MACROS" .
2323 .
2324 .Ss "OpenBSD Macro"
2325 .
2326 .Pp
2327 .Dl Usage: .Ox Oo Ao version Ac Oc ...
2328 .Pp
2329 .Bl -tag -width ".Li .Ox\ 1.0" -compact -offset 15n
2330 .It Li ".Ox 1.0"
2331 .Ox 1.0
2332 .El
2333 .
2334 .Ss "BSD/OS Macro"
2335 .
2336 .Pp
2337 .Dl Usage: .Bsx Oo Ao version Ac Oc ...
2338 .Pp
2339 .Bl -tag -width ".Li .Bsx\ 1.0" -compact -offset 15n
2340 .It Li ".Bsx 1.0"
2341 .Bsx 1.0
2342 .El
2343 .
2344 .Ss "UNIX Macro"
2345 .
2346 .Pp
2347 .Dl Usage: .Ux ...
2348 .Pp
2349 .Bl -tag -width ".Li .Ux" -compact -offset 15n
2350 .It Li .Ux
2351 .Ux
2352 .El
2353 .
2354 .Ss "Emphasis Macro"
2355 .
2356 Text may be stressed or emphasized with the
2357 .Ql .Em
2358 macro.
2359 The usual font for emphasis is italic.
2360 .Pp
2361 .Dl Usage: .Em Ao argument Ac ...
2362 .Pp
2363 .Bl -tag -width ".Li .Em\ vide\ infra\ )\ )\ ," -compact -offset 15n
2364 .It Li ".Em does not"
2365 .Em does not
2366 .It Li ".Em exceed 1024 ."
2367 .Em exceed 1024 .
2368 .It Li ".Em vide infra ) ) ,"
2369 .Em vide infra ) ) ,
2370 .El
2371 .Pp
2372 .
2373 The default width is 10n.
2374 .
2375 .Ss "Font Mode"
2376 .
2377 The
2378 .Ql .Bf
2379 font mode must be ended with the
2380 .Ql .Ef
2381 macro (the latter takes no arguments).
2382 Font modes may be nested within other font modes.
2383 .Pp
2384 .Ql .Bf
2385 has the following syntax:
2386 .Pp
2387 .Dl .Bf Ao font mode Ac
2388 .Pp
2389 .Ao font mode Ac
2390 must be one of the following three types:
2391 .Pp
2392 .Bl -tag -width ".Sy \&Sy | Fl symbolic" -compact -offset indent
2393 .It Sy \&Em | Fl emphasis
2394 Same as if the
2395 .Ql .Em
2396 macro was used for the entire block of text.
2397 .It Sy \&Li | Fl literal
2398 Same as if the
2399 .Ql .Li
2400 macro was used for the entire block of text.
2401 .It Sy \&Sy | Fl symbolic
2402 Same as if the
2403 .Ql .Sy
2404 macro was used for the entire block of text.
2405 .El
2406 .Pp
2407 Both macros are neither callable nor parsed.
2408 .
2409 .Ss "Enclosure and Quoting Macros"
2410 .
2411 The concept of enclosure is similar to quoting.
2412 The object being to enclose one or more strings between a pair of characters
2413 like quotes or parentheses.
2414 The terms quoting and enclosure are used interchangeably throughout this
2415 document.
2416 Most of the one-line enclosure macros end in small letter
2417 .Ql q
2418 to give a hint of quoting, but there are a few irregularities.
2419 For each enclosure macro there is also a pair of open and close macros which
2420 end in small letters
2421 .Ql o
2422 and
2423 .Ql c
2424 respectively.
2425 .Pp
2426 \# XXX
2427 .if t \
2428 .  ne 10
2429 .
2430 .TS
2431 lb lb lb lb lb
2432 l l l l l.
2433 Quote   Open    Close   Function        Result
2434 \&.Aq   .Ao     .Ac     Angle Bracket Enclosure <string>
2435 \&.Bq   .Bo     .Bc     Bracket Enclosure       [string]
2436 \&.Brq  .Bro    .Brc    Brace Enclosure {string}
2437 \&.Dq   .Do     .Dc     Double Quote    "string"
2438 \&.Eq   .Eo     .Ec     Enclose String (in XX)  XXstring
2439 \&.Pq   .Po     .Pc     Parenthesis Enclosure   (string)
2440 \&.Ql                   Quoted Literal  \*[Lq]string\*[Rq] or string
2441 \&.Qq   .Qo     .Qc     Straight Double Quote   "string"
2442 \&.Sq   .So     .Sc     Single Quote    'string'
2443 .TE
2444 .Pp
2445 All macros ending with
2446 .Sq q
2447 and
2448 .Sq o
2449 have a default width value of 12n.
2450 .
2451 .Bl -tag -width ".Li .Ec , .Eo"
2452 .It Li .Eo , .Ec
2453 These macros expect the first argument to be the opening and closing strings
2454 respectively.
2455 .It Li .Es , .En
2456 Due to the nine-argument limit in the original troff program two other
2457 macros have been implemented which are now rather obsolete:
2458 .Ql .Es
2459 takes the first and second parameter as the left and right enclosure string,
2460 which are then used to enclose the arguments of
2461 .Ql .En .
2462 The default width value is 12n for both macros.
2463 .It Li .Eq
2464 The first and second arguments of this macro are the opening and
2465 closing strings respectively, followed by the arguments to be enclosed.
2466 .It Li .Ql
2467 The quoted literal macro behaves differently in troff and nroff mode.
2468 If formatted with
2469 .Xr nroff ,
2470 a quoted literal is always quoted.
2471 If formatted with troff, an item is only quoted if the width of the item is
2472 less than three constant width characters.
2473 This is to make short strings more visible where the font change to literal
2474 (constant width) is less noticeable.
2475 .Pp
2476 The default width is 16n.
2477 .It Li .Pf
2478 The prefix macro suppresses the whitespace between its first and second
2479 argument:
2480 .
2481 .Bl -tag -width ".Li .Pf\ (\ Fa\ name2" -offset indent
2482 .It Li ".Pf ( Fa name2"
2483 .Pf ( Fa name2
2484 .El
2485 .Pp
2486 .
2487 The default width is 12n.
2488 .Pp
2489 The
2490 .Ql .Ns
2491 macro (see below) performs the analogous suffix function.
2492 .It Li .Ap
2493 The
2494 .Ql .Ap
2495 macro inserts an apostrophe and exits any special text modes, continuing in
2496 .Ql .No
2497 mode.
2498 .El
2499 .Pp
2500 .
2501 Examples of quoting:
2502 .
2503 .Pp
2504 .Bl -tag -width ".Li .Bq\ Em\ Greek\ ,\ French\ ." -compact -offset indent
2505 .It Li .Aq
2506 .Aq
2507 .It Li ".Aq Pa ctype.h ) ,"
2508 .Aq Pa ctype.h ) ,
2509 .It Li .Bq
2510 .Bq
2511 .It Li ".Bq Em Greek , French ."
2512 .Bq Em Greek , French .
2513 .It Li .Dq
2514 .Dq
2515 .It Li ".Dq string abc ."
2516 .Dq string abc .
2517 .It Li ".Dq \'^[A\-Z]\'"
2518 .Dq \'^[A-Z]\'
2519 .It Li ".Ql man mdoc"
2520 .Ql man mdoc
2521 .It Li .Qq
2522 .Qq
2523 .It Li ".Qq string ) ,"
2524 .Qq string ) ,
2525 .It Li ".Qq string Ns ),"
2526 .Qq string Ns ),
2527 .It Li .Sq
2528 .Sq
2529 .It Li ".Sq string"
2530 .Sq string
2531 .It Li ".Em or Ap ing"
2532 .Em or Ap ing
2533 .El
2534 .Pp
2535 .
2536 For a good example of nested enclosure macros, see the
2537 .Ql .Op
2538 option macro.
2539 It was created from the same underlying enclosure macros as those presented
2540 in the list above.
2541 The
2542 .Ql .Xo
2543 and
2544 .Ql .Xc
2545 extended argument list macros are discussed below.
2546 .
2547 .Ss "No-Op or Normal Text Macro"
2548 .
2549 The
2550 .Ql .No
2551 macro can be used in a macro command line for parameters which should
2552 .Em not
2553 be formatted.
2554 Be careful to add
2555 .Ql \e&
2556 to the word
2557 .Ql \&No
2558 if you really want that English word (and not the macro) as a parameter.
2559 .Pp
2560 .Dl Usage: .No Ao argument Ac ...
2561 .Pp
2562 .Bl -tag -width ".Li .No\ test\ Ta\ with\ Ta\ tabs" -compact -offset 15n
2563 .It Li ".No test Ta with Ta tabs"
2564 .No test Ta with Ta tabs
2565 .El
2566 .Pp
2567 .
2568 The default width is 12n.
2569 .
2570 .Ss "No-Space Macro"
2571 .
2572 The
2573 .Ql .Ns
2574 macro suppresses insertion of a space between the current position and its
2575 first parameter.
2576 For example, it is useful for old style argument lists where there is no
2577 space between the flag and argument:
2578 .Pp
2579 .Dl "Usage:" ... Ao argument Ac \&Ns Oo Ao argument Ac Oc ...
2580 .Dl "      " .Ns Ao argument Ac ...
2581 .Pp
2582 .Bl -tag -width ".Li .Op\ Fl\ I\ Ns\ Ar\ directory" -compact -offset 15n
2583 .It Li ".Op Fl I Ns Ar directory"
2584 .Op Fl I Ns Ar directory
2585 .El
2586 .Pp
2587 Note: The
2588 .Ql .Ns
2589 macro always invokes the
2590 .Ql .No
2591 macro after eliminating the space unless another macro name follows it.
2592 If used as a command (i.e., the second form above in the
2593 .Sq Usage
2594 line),
2595 .Ql .Ns
2596 is identical to
2597 .Ql .No .
2598 .
2599 .Ss "Section Cross References"
2600 .
2601 The
2602 .Ql .Sx
2603 macro designates a reference to a section header within the same document.
2604 .Pp
2605 .Dl Usage: .Sx Ao section reference Ac ...
2606 .Pp
2607 .Bl -tag -width ".Li .Sx\ FILES" -offset 15n
2608 .It Li ".Sx FILES"
2609 .Sx FILES
2610 .El
2611 .Pp
2612 .
2613 The default width is 16n.
2614 .
2615 .Ss Symbolics
2616 .
2617 The symbolic emphasis macro is generally a boldface macro in either the
2618 symbolic sense or the traditional English usage.
2619 .Pp
2620 .Dl Usage: .Sy Ao symbol Ac ...
2621 .Pp
2622 .Bl -tag -width ".Li .Sy\ Important\ Notice" -compact -offset 15n
2623 .It Li ".Sy Important Notice"
2624 .Sy Important Notice
2625 .El
2626 .Pp
2627 .
2628 The default width is 6n.
2629 .
2630 .Ss Mathematical Symbols
2631 .
2632 Use this macro for mathematical symbols and similar things.
2633 .Pp
2634 .Dl Usage: .Ms Ao math symbol Ac ...
2635 .Pp
2636 .Bl -tag -width ".Li .Ms\ sigma" -compact -offset 15n
2637 .It Li ".Ms sigma"
2638 .Ms sigma
2639 .El
2640 .Pp
2641 .
2642 The default width is 6n.
2643 .
2644 .Ss "References and Citations"
2645 .
2646 The following macros make a modest attempt to handle references.
2647 At best, the macros make it convenient to manually drop in a subset of
2648 .Xr refer 1
2649 style references.
2650 .Pp
2651 .Bl -tag -width 6n -offset indent -compact
2652 .It Li .Rs
2653 Reference start (does not take arguments).
2654 Causes a line break in the
2655 .Sx "SEE ALSO"
2656 section and begins collection of reference information until the reference
2657 end macro is read.
2658 .It Li .Re
2659 Reference end (does not take arguments).
2660 The reference is printed.
2661 .It Li .%A
2662 Reference author name; one name per invocation.
2663 .It Li .%B
2664 Book title.
2665 .It Li .%C
2666 City/place.
2667 .It Li .%D
2668 Date.
2669 .It Li .%I
2670 Issuer/publisher name.
2671 .It Li .%J
2672 Journal name.
2673 .It Li .%N
2674 Issue number.
2675 .It Li .%O
2676 Optional information.
2677 .It Li .%P
2678 Page number.
2679 .It Li .%Q
2680 Corporate or foreign author.
2681 .It Li .%R
2682 Report name.
2683 .It Li .%T
2684 Title of article.
2685 .It Li .%U
2686 Optional hypertext reference.
2687 .It Li .%V
2688 Volume.
2689 .El
2690 .Pp
2691 Macros beginning with
2692 .Ql %
2693 are not callable but accept multiple arguments in the usual way.
2694 Only the
2695 .Ql .Tn
2696 macro is handled properly as a parameter; other macros will cause strange
2697 output.
2698 .Ql .%B
2699 and
2700 .Ql .%T
2701 can be used outside of the
2702 .Ql .Rs/.Re
2703 environment.
2704 .Pp
2705 Example:
2706 .
2707 .Bd -literal -offset indent
2708 \&.Rs
2709 \&.%A "Matthew Bar"
2710 \&.%A "John Foo"
2711 \&.%T "Implementation Notes on foobar(1)"
2712 \&.%R "Technical Report ABC\-DE\-12\-345"
2713 \&.%Q "Drofnats College"
2714 \&.%C "Nowhere"
2715 \&.%D "April 1991"
2716 \&.Re
2717 .Ed
2718 .Pp
2719 produces
2720 .
2721 .Bd -ragged -offset indent
2722 .Rs
2723 .%A "Matthew Bar"
2724 .%A "John Foo"
2725 .%T "Implementation Notes on foobar(1)"
2726 .%R "Technical Report ABC-DE-12-345"
2727 .%Q "Drofnats College"
2728 .%C "Nowhere"
2729 .%D "April 1991"
2730 .Re
2731 .Ed
2732 .
2733 .Ss "Trade Names (or Acronyms and Type Names)"
2734 .
2735 The trade name macro prints its arguments in a smaller font.
2736 Its intended use is to imitate a small caps fonts for uppercase acronyms.
2737 .Pp
2738 .Dl Usage: .Tn Ao symbol Ac ...
2739 .Pp
2740 .Bl -tag -width ".Li .Tn\ ASCII" -compact -offset 15n
2741 .It Li ".Tn DEC"
2742 .Tn DEC
2743 .It Li ".Tn ASCII"
2744 .Tn ASCII
2745 .El
2746 .Pp
2747 .
2748 The default width is 10n.
2749 .
2750 .Ss "Extended Arguments"
2751 .
2752 The
2753 .Li .Xo
2754 and
2755 .Li .Xc
2756 macros allow one to extend an argument list on a macro boundary for the
2757 .Ql .It
2758 macro (see below).
2759 Note that
2760 .Li .Xo
2761 and
2762 .Li .Xc
2763 are implemented similarly to all other macros opening and closing an
2764 enclosure (without inserting characters, of course).
2765 This means that the following is true for those macros also.
2766 .Pp
2767 Here is an example of
2768 .Ql .Xo
2769 using the space mode macro to turn spacing off:
2770 .
2771 .Bd -literal -offset indent
2772 \&.Sm off
2773 \&.It Xo Sy I Ar operation
2774 \&.No \een Ar count No \een
2775 \&.Xc
2776 \&.Sm on
2777 .Ed
2778 .Pp
2779 .
2780 produces
2781 .
2782 .Bd -filled -offset indent
2783 .Bl -tag -compact
2784 .Sm off
2785 .It Xo Sy I Ar operation
2786 .No \en Ar count No \en
2787 .Xc
2788 .Sm on
2789 .El
2790 .Ed
2791 .Pp
2792 .
2793 Another one:
2794 .
2795 .Bd -literal -offset indent
2796 \&.Sm off
2797 \&.It Cm S No / Ar old_pattern Xo
2798 \&.No / Ar new_pattern
2799 \&.No / Op Cm g
2800 \&.Xc
2801 \&.Sm on
2802 .Ed
2803 .Pp
2804 .
2805 produces
2806 .
2807 .Bd -filled -offset indent
2808 .Bl -tag -compact
2809 .Sm off
2810 .It Cm S No \&/ Ar old_pattern Xo
2811 .No \&/ Ar new_pattern
2812 .No \&/ Op Cm g
2813 .Xc
2814 .Sm on
2815 .El
2816 .Ed
2817 .Pp
2818 .
2819 Another example of
2820 .Ql .Xo
2821 and enclosure macros: Test the value of a variable.
2822 .
2823 .Bd -literal -offset indent
2824 \&.It Xo
2825 \&.Ic .ifndef
2826 \&.Oo \e&! Oc Ns Ar variable Oo
2827 \&.Ar operator variable ...
2828 \&.Oc Xc
2829 .Ed
2830 .Pp
2831 .
2832 produces
2833 .
2834 .Bd -filled -offset indent
2835 .Bl -tag -width flag -compact
2836 .It Xo
2837 .Ic .ifndef
2838 .Oo \&! Oc Ns Ar variable Oo
2839 .Ar operator variable ...
2840 .Oc Xc
2841 .El
2842 .Ed
2843 .Pp
2844 .
2845 .
2846 .Sh "PAGE STRUCTURE DOMAIN"
2847 .
2848 .Ss "Section Headers"
2849 .
2850 The following
2851 .Ql .Sh
2852 section header macros are required in every man page.
2853 The remaining section headers are recommended at the discretion of the
2854 author writing the manual page.
2855 The
2856 .Ql .Sh
2857 macro is parsed but not generally callable.
2858 It can be used as an argument in a call to
2859 .Ql .Sh
2860 only; it then reactivates the default font for
2861 .Ql .Sh .
2862 .Pp
2863 The default width is 8n.
2864 .
2865 .Bl -tag -width ".Li .Sh\ RETURN\ VALUES"
2866 .It Li ".Sh NAME"
2867 The
2868 .Ql ".Sh NAME"
2869 macro is mandatory.
2870 If not specified, headers, footers and page layout defaults will not be set
2871 and things will be rather unpleasant.
2872 The
2873 .Em NAME
2874 section consists of at least three items.
2875 The first is the
2876 .Ql .Nm
2877 name macro naming the subject of the man page.
2878 The second is the name description macro,
2879 .Ql .Nd ,
2880 which separates the subject name from the third item, which is the
2881 description.
2882 The description should be the most terse and lucid possible, as the space
2883 available is small.
2884 .Pp
2885 .Ql .Nd
2886 first prints
2887 .Ql \- ,
2888 then all its arguments.
2889 .
2890 .It Li ".Sh LIBRARY"
2891 This section is for section two and three function calls.
2892 It should consist of a single
2893 .Ql .Lb
2894 macro call;
2895 see
2896 .Sx "Library Names" .
2897 .
2898 .It Li ".Sh SYNOPSIS"
2899 The
2900 .Sx SYNOPSIS
2901 section describes the typical usage of the subject of a man page.
2902 The macros required are either
2903 .Ql .Nm ,
2904 .Ql .Cd ,
2905 or
2906 .Ql .Fn
2907 (and possibly
2908 .Ql .Fo ,
2909 .Ql .Fc ,
2910 .Ql .Fd ,
2911 and
2912 .Ql .Ft ) .
2913 The function name macro
2914 .Ql .Fn
2915 is required for manual page sections\~2 and\~3; the command and general name
2916 macro
2917 .Ql .Nm
2918 is required for sections 1, 5, 6, 7, and\~8.
2919 Section\~4 manuals require a
2920 .Ql .Nm ,
2921 .Ql .Fd
2922 or a
2923 .Ql .Cd
2924 configuration device usage macro.
2925 Several other macros may be necessary to produce the synopsis line as shown
2926 below:
2927 .
2928 .Bd -filled -offset indent
2929 .Nm cat
2930 .Op Fl benstuv
2931 .Op Fl
2932 .Ar
2933 .Ed
2934 .Pp
2935 .
2936 The following macros were used:
2937 .Pp
2938 .Dl ".Nm cat"
2939 .Dl ".Op Fl benstuv"
2940 .Dl ".Op Fl"
2941 .Dl .Ar
2942 .
2943 .It Li ".Sh DESCRIPTION"
2944 In most cases the first text in the
2945 .Sx DESCRIPTION
2946 section is a brief paragraph on the command, function or file, followed by a
2947 lexical list of options and respective explanations.
2948 To create such a list, the
2949 .Ql .Bl
2950 (begin list),
2951 .Ql .It
2952 (list item) and
2953 .Ql .El
2954 (end list)
2955 macros are used (see
2956 .Sx Lists and Columns
2957 below).
2958 .
2959 .It Li ".Sh IMPLEMENTATION NOTES"
2960 Implementation specific information should be placed here.
2961 .
2962 .It Li ".Sh RETURN VALUES"
2963 Sections 2, 3 and\~9 function return values should go here.
2964 The
2965 .Ql .Rv
2966 macro may be used to generate text for use in the
2967 .Sx RETURN VALUES
2968 section for most section 2 and 3 library functions;
2969 see
2970 .Sx "Return Values" .
2971 .El
2972 .Pp
2973 .
2974 The following
2975 .Ql .Sh
2976 section headers are part of the preferred manual page layout and must be
2977 used appropriately to maintain consistency.
2978 They are listed in the order in which they would be used.
2979 .
2980 .Bl -tag -width ".Li .Sh\ COMPATIBILITY"
2981 .It Li ".Sh ENVIRONMENT"
2982 The
2983 .Em ENVIRONMENT
2984 section should reveal any related environment variables and clues to their
2985 behavior and/or usage.
2986 .
2987 .It Li ".Sh FILES"
2988 Files which are used or created by the man page subject should be listed via
2989 the
2990 .Ql .Pa
2991 macro in the
2992 .Sx FILES
2993 section.
2994 .
2995 .It Li ".Sh EXAMPLES"
2996 There are several ways to create examples.
2997 See the
2998 .Sx "Examples and Displays"
2999 section below for details.
3000 .
3001 .It Li ".Sh DIAGNOSTICS"
3002 Diagnostic messages from a command should be placed in this section.
3003 The
3004 .Ql .Ex
3005 macro may be used to generate text for use in the
3006 .Sx DIAGNOSTICS
3007 section for most section 1, 6 and\~8 commands;
3008 see
3009 .Sx "Exit Status" .
3010 .
3011 .It Li ".Sh COMPATIBILITY"
3012 Known compatibility issues (e.g.\& deprecated options or parameters)
3013 should be listed here.
3014 .
3015 .It Li ".Sh ERRORS"
3016 Specific error handling, especially from library functions (man page
3017 sections 2, 3, and\~9) should go here.
3018 The
3019 .Ql .Er
3020 macro is used to specify an error (errno).
3021 .
3022 .It Li ".Sh SEE ALSO"
3023 References to other material on the man page topic and cross references to
3024 other relevant man pages should be placed in the
3025 .Sx "SEE ALSO"
3026 section.
3027 Cross references are specified using the
3028 .Ql .Xr
3029 macro.
3030 Currently
3031 .Xr refer 1
3032 style references are not accommodated.
3033 .Pp
3034 It is recommended that the cross references are sorted on the section
3035 number, then alphabetically on the names within a section, and placed
3036 in that order and comma separated.
3037 Example:
3038 .Pp
3039 .Xr ls 1 ,
3040 .Xr ps 1 ,
3041 .Xr group 5 ,
3042 .Xr passwd 5
3043 .
3044 .It Li ".Sh STANDARDS"
3045 If the command, library function or file adheres to a specific
3046 implementation such as
3047 .St -p1003.2
3048 or
3049 .St -ansiC
3050 this should be noted here.
3051 If the command does not adhere to any standard, its history should be noted
3052 in the
3053 .Em HISTORY
3054 section.
3055 .
3056 .It Li ".Sh HISTORY"
3057 Any command which does not adhere to any specific standards should be
3058 outlined historically in this section.
3059 .
3060 .It Li ".Sh AUTHORS"
3061 Credits should be placed here.
3062 Use the
3063 .Ql .An
3064 macro for names and the
3065 .Ql .Aq
3066 macro for e-mail addresses within optional contact information.
3067 Explicitly indicate whether the person authored the initial manual page
3068 or the software or whatever the person is being credited for.
3069 .It Li ".Sh BUGS"
3070 Blatant problems with the topic go here.
3071 .El
3072 .Pp
3073 .
3074 User-specified
3075 .Ql .Sh
3076 sections may be added; for example, this section was set with:
3077 .
3078 .Bd -literal -offset 15n
3079 \&.Sh "PAGE STRUCTURE DOMAIN"
3080 .Ed
3081 .
3082 .Ss "Subsection Headers"
3083 .
3084 Subsection headers have exactly the same syntax as section headers:
3085 .Ql .Ss
3086 is parsed but not generally callable.
3087 It can be used as an argument in a call to
3088 .Ql .Ss
3089 only; it then reactivates the default font for
3090 .Ql .Ss .
3091 .Pp
3092 The default width is 8n.
3093 .
3094 .Ss "Paragraphs and Line Spacing"
3095 .
3096 .Bl -tag -width ".Li .Pp"
3097 .It Li .Pp
3098 The
3099 .Ql .Pp
3100 paragraph command may be used to specify a line space where necessary.
3101 The macro is not necessary after a
3102 .Ql .Sh
3103 or
3104 .Ql .Ss
3105 macro or before a
3106 .Ql .Bl
3107 or
3108 .Ql .Bd
3109 macro (which both assert a vertical distance unless the
3110 .Fl compact
3111 flag is given).
3112 .Pp
3113 The macro is neither callable nor parsed and takes no arguments; an
3114 alternative name is
3115 .Ql .Lp .
3116 .El
3117 .
3118 .\" XXX
3119 .
3120 .\" This worked with version one, need to redo for version three
3121 .\" .Pp
3122 .\" .Ds I
3123 .\" .Cw (ax+bx+c) \ is\ produced\ by\ \&
3124 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
3125 .\" .Cl Cx \t\t
3126 .\" .Li \&.Cx\ (
3127 .\" .Cx
3128 .\" .Cl Cx \t\t
3129 .\" .Li \&.Va ax
3130 .\" .Cx
3131 .\" .Cl Cx \t\t
3132 .\" .Li \&.Sy \+
3133 .\" .Cx
3134 .\" .Cl Cx \&(\&
3135 .\" .Va ax
3136 .\" .Cx +
3137 .\" .Va by
3138 .\" .Cx +
3139 .\" .Va c )
3140 .\" .Cx \t
3141 .\" .Em is produced by
3142 .\" .Cx \t
3143 .\" .Li \&.Va by
3144 .\" .Cx
3145 .\" .Cl Cx \t\t
3146 .\" .Li \&.Sy \+
3147 .\" .Cx
3148 .\" .Cl Cx \t\t
3149 .\" .Li \&.Va c )
3150 .\" .Cx
3151 .\" .Cl Cx \t\t
3152 .\" .Li \&.Cx
3153 .\" .Cx
3154 .\" .Cw
3155 .\" .De
3156 .\" .Pp
3157 .\" This example shows the same equation in a different format.
3158 .\" The spaces
3159 .\" around the
3160 .\" .Li \&+
3161 .\" signs were forced with
3162 .\" .Li \e :
3163 .\" .Pp
3164 .\" .Ds I
3165 .\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
3166 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
3167 .\" .Cl Cx \t\t
3168 .\" .Li \&.Cx\ (
3169 .\" .Cx
3170 .\" .Cl Cx \t\t
3171 .\" .Li \&.Va a
3172 .\" .Cx
3173 .\" .Cl Cx \t\t
3174 .\" .Li \&.Sy x
3175 .\" .Cx
3176 .\" .Cl Cx \t\t
3177 .\" .Li \&.Cx \e\ +\e\ \e&
3178 .\" .Cx
3179 .\" .Cl Cx \&(\&
3180 .\" .Va a
3181 .\" .Sy x
3182 .\" .Cx \ +\ \&
3183 .\" .Va b
3184 .\" .Sy y
3185 .\" .Cx \ +\ \&
3186 .\" .Va c )
3187 .\" .Cx \t
3188 .\" .Em is produced by
3189 .\" .Cl Cx \t\t
3190 .\" .Li \&.Va b
3191 .\" .Cx
3192 .\" .Cl Cx \t\t
3193 .\" .Li \&.Sy y
3194 .\" .Cx
3195 .\" .Cl Cx \t\t
3196 .\" .Li \&.Cx \e\ +\e\ \e&
3197 .\" .Cx
3198 .\" .Cl Cx \t\t
3199 .\" .Li \&.Va c )
3200 .\" .Cx
3201 .\" .Cl Cx \t\t
3202 .\" .Li \&.Cx
3203 .\" .Cx
3204 .\" .Cw
3205 .\" .De
3206 .\" .Pp
3207 .\" The incantation below was
3208 .\" lifted from the
3209 .\" .Xr adb 1
3210 .\" manual page:
3211 .\" .Pp
3212 .\" .Ds I
3213 .\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
3214 .\" .Cl Cx \t\t
3215 .\" .Li \&.Cx Op Sy ?/
3216 .\" .Cx
3217 .\" .Cl Cx \t\t
3218 .\" .Li \&.Nm m
3219 .\" .Cx
3220 .\" .Cl Cx Op Sy ?/
3221 .\" .Nm m
3222 .\" .Ad \ b1 e1 f1
3223 .\" .Op Sy ?/
3224 .\" .Cx \t
3225 .\" .Em is produced by
3226 .\" .Cx \t
3227 .\" .Li \&.Ar \e\ b1 e1 f1
3228 .\" .Cx
3229 .\" .Cl Cx \t\t
3230 .\" .Li \&.Op Sy ?/
3231 .\" .Cx
3232 .\" .Cl Cx \t\t
3233 .\" .Li \&.Cx
3234 .\" .Cx
3235 .\" .Cw
3236 .\" .De
3237 .\" .Pp
3238 .
3239 .Ss Keeps
3240 .
3241 The only keep that is implemented at this time is for words.
3242 The macros are
3243 .Ql .Bk
3244 (begin keep)
3245 and
3246 .Ql .Ek
3247 (end keep).
3248 The only option that
3249 .Ql .Bk
3250 accepts currently is
3251 .Fl words
3252 (this is also the default if no option is given) which is useful for
3253 preventing line breaks in the middle of options.
3254 In the example for the make command-line arguments (see
3255 .Sx What's in a Name ) ,
3256 the keep prevented
3257 .Xr nroff
3258 from placing up the flag and the argument on separate lines.
3259 .Pp
3260 Both macros are neither callable nor parsed.
3261 .Pp
3262 More work needs to be done with the keep macros; specifically, a
3263 .Fl line
3264 option should be added.
3265 .
3266 .Ss "Examples and Displays"
3267 .
3268 There are seven types of displays.
3269 .Pp
3270 .Bl -tag -width ".Li .D1"
3271 .It Li .D1
3272 (This is D-one.)
3273 Display one line of indented text.
3274 This macro is parsed but not callable.
3275 .Pp
3276 .D1 Fl ldghfstru
3277 .Pp
3278 The above was produced by:
3279 .Li ".D1 Fl ldghfstru" .
3280 .
3281 .It Li .Dl
3282 (This is D-ell.)
3283 Display one line of indented
3284 .Em literal
3285 text.
3286 The
3287 .Ql .Dl
3288 example macro has been used throughout this file.
3289 It allows the indentation (display) of one line of text.
3290 Its default font is set to constant width (literal).
3291 .Ql .Dl
3292 is parsed but not callable.
3293 .Pp
3294 .Dl % ls \-ldg /usr/local/bin
3295 .Pp
3296 The above was produced by:
3297 .Li ".Dl % ls \e\-ldg /usr/local/bin" .
3298 .
3299 .It Li .Bd
3300 Begin display.
3301 The
3302 .Ql .Bd
3303 display must be ended with the
3304 .Ql .Ed
3305 macro.
3306 It has the following syntax:
3307 .Pp
3308 .Bd -ragged -compact
3309 .Bl -tag -width ".Li .Bd" -offset indent
3310 .It Li .Bd Xo
3311 .Bro \-literal | \-filled | \-unfilled | \-ragged | \-centered Brc
3312 .Oo \-offset Ao string Ac Oc Oo \-file Ao file name Ac Oc Oo \-compact Oc Xc
3313 .El
3314 .Ed
3315 .Pp
3316 .
3317 .Bl -tag -width ".Fl file Ao Ar file name Ac " -compact
3318 .It Fl ragged
3319 Fill, but do not adjust the right margin (only left-justify).
3320 .It Fl centered
3321 Center lines between the current left and right margin.
3322 Note that each single line is centered.
3323 .It Fl unfilled
3324 Do not fill; display a block of text as typed, using line breaks as
3325 specified by the user.
3326 This can produce overlong lines without warning messages.
3327 .It Fl filled
3328 Display a filled block.
3329 The block of text is formatted (i.e., the text is justified on both the left
3330 and right side).
3331 .It Fl literal
3332 Display block with literal font (usually fixed-width).
3333 Useful for source code or simple tabbed or spaced text.
3334 .It Fl file Ao Ar file name Ac
3335 The file whose name follows the
3336 .Fl file
3337 flag is read and displayed before any data enclosed with
3338 .Ql .Bd
3339 and
3340 .Ql .Ed ,
3341 using the selected display type.
3342 Any
3343 .Xr troff/ Ns Nm \-mdoc
3344 commands in the file will be processed.
3345 .It Fl offset Ao Ar string Ac
3346 If
3347 .Fl offset
3348 is specified with one of the following strings, the string is interpreted to
3349 indicate the level of indentation for the forthcoming block of text:
3350 .
3351 .Pp
3352 .Bl -tag -width ".Ar indent-two" -compact
3353 .It Ar left
3354 Align block on the current left margin; this is the default mode of
3355 .Ql .Bd .
3356 .It Ar center
3357 Supposedly center the block.
3358 At this time unfortunately, the block merely gets left aligned about an
3359 imaginary center margin.
3360 .It Ar indent
3361 Indent by one default indent value or tab.
3362 The default indent value is also used for the
3363 .Ql .D1
3364 and
3365 .Ql .Dl
3366 macros, so one is guaranteed the two types of displays will line up.
3367 The indentation value is normally set to\~6n or about two thirds of an inch
3368 (six constant width characters).
3369 .It Ar indent\-two
3370 Indent two times the default indent value.
3371 .It Ar right
3372 This
3373 .Em left
3374 aligns the block about two inches from the right side of the page.
3375 This macro needs work and perhaps may never do the right thing within
3376 .Xr troff .
3377 .El
3378 .Pp
3379 .
3380 If
3381 .Ao string Ac
3382 is a valid numeric expression instead
3383 .Pf ( Em with a scale indicator other than
3384 .Sq Em u ) ,
3385 use that value for indentation.
3386 The most useful scale indicators are
3387 .Sq m
3388 and
3389 .Sq n ,
3390 specifying the so-called
3391 .Em \&Em
3392 and
3393 .Em "En square" .
3394 This is approximately the width of the letters
3395 .Sq m
3396 and
3397 .Sq n
3398 respectively
3399 of the current font (for nroff output, both scale indicators give the same
3400 values).
3401 If
3402 .Ao string Ac
3403 isn't a numeric expression, it is tested whether it is an
3404 .Nm \-mdoc
3405 macro name, and the default offset value associated with this macro is used.
3406 Finally, if all tests fail,
3407 the width of
3408 .Ao string Ac
3409 (typeset with a fixed-width font) is taken as the offset.
3410 .It Fl compact
3411 Suppress insertion of vertical space before begin of display.
3412 .El
3413 .
3414 .It Li .Ed
3415 End display (takes no arguments).
3416 .El
3417 .
3418 .Ss "Lists and Columns"
3419 .
3420 There are several types of lists which may be initiated with the
3421 .Ql .Bl
3422 begin-list macro.
3423 Items within the list are specified with the
3424 .Ql .It
3425 item macro, and each list must end with the
3426 .Ql .El
3427 macro.
3428 Lists may be nested within themselves and within displays.
3429 The use of columns inside of lists or lists inside of columns is unproven.
3430 .Pp
3431 In addition, several list attributes may be specified such as the width of a
3432 tag, the list offset, and compactness (blank lines between items allowed or
3433 disallowed).
3434 Most of this document has been formatted with a tag style list
3435 .Pf ( Fl tag ) .
3436 .Pp
3437 It has the following syntax forms:
3438 .
3439 .Pp
3440 .Bd -ragged -compact
3441 .Bl -tag -width ".Li .Bl" -offset indent -compact
3442 .It Li .Bl Xo
3443 .Bro \-hang | \-ohang | \-tag | \-diag | \-inset Brc
3444 .Oo \-width Ao string Ac Oc
3445 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3446 .It Li .Bl Xo
3447 .No \-column Oo \-offset Ao string Ac Oc
3448 .Ao string1 Ac Ao string2 Ac ... Xc
3449 .It Li .Bl Xo
3450 .Bro \-item | \-enum Oo \-nested Oc | \-bullet | \-hyphen | \-dash Brc
3451 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3452 .El
3453 .Ed
3454 .Pp
3455 .
3456 And now a detailed description of the list types.
3457 .
3458 .Pp
3459 .Bl -tag -width ".Fl column" -compact
3460 .It Fl bullet
3461 A bullet list.
3462 .
3463 .Bd -literal -offset indent
3464 \&.Bl \-bullet \-offset indent \-compact
3465 \&.It
3466 Bullet one goes here.
3467 \&.It
3468 Bullet two here.
3469 \&.El
3470 .Ed
3471 .Pp
3472 .
3473 Produces:
3474 .
3475 .Pp
3476 .Bl -bullet -offset indent -compact
3477 .It
3478 Bullet one goes here.
3479 .It
3480 Bullet two here.
3481 .El
3482 .Pp
3483 .
3484 .It Fl dash No ( or Fl hyphen )
3485 A dash list.
3486 .
3487 .Bd -literal -offset indent
3488 \&.Bl \-dash \-offset indent \-compact
3489 \&.It
3490 Dash one goes here.
3491 \&.It
3492 Dash two here.
3493 \&.El
3494 .Ed
3495 .Pp
3496 .
3497 Produces:
3498 .
3499 .Pp
3500 .Bl -dash -offset indent -compact
3501 .It
3502 Dash one goes here.
3503 .It
3504 Dash two here.
3505 .El
3506 .Pp
3507 .
3508 .It Fl enum
3509 An enumerated list.
3510 .
3511 .Bd -literal -offset indent
3512 \&.Bl \-enum \-offset indent \-compact
3513 \&.It
3514 Item one goes here.
3515 \&.It
3516 And item two here.
3517 \&.El
3518 .Ed
3519 .Pp
3520 .
3521 The result:
3522 .
3523 .Pp
3524 .Bl -enum -offset indent -compact
3525 .It
3526 Item one goes here.
3527 .It
3528 And item two here.
3529 .El
3530 .Pp
3531 .
3532 If you want to nest enumerated lists, use the
3533 .Fl nested
3534 flag (starting with the second-level list):
3535 .
3536 .Bd -literal -offset indent
3537 \&.Bl \-enum \-offset indent \-compact
3538 \&.It
3539 Item one goes here
3540 \&.Bl \-enum \-nested \-compact
3541 \&.It
3542 Item two goes here.
3543 \&.It
3544 And item three here.
3545 \&.El
3546 \&.It
3547 And item four here.
3548 \&.El
3549 .Ed
3550 .Pp
3551 .
3552 Result:
3553 .
3554 .Pp
3555 .Bl -enum -offset indent -compact
3556 .It
3557 Item one goes here.
3558 .Bl -enum -nested -compact
3559 .It
3560 Item two goes here.
3561 .It
3562 And item three here.
3563 .El
3564 .It
3565 And item four here.
3566 .El
3567 .Pp
3568 .
3569 .It Fl item
3570 A list of type
3571 .Fl item
3572 without list markers.
3573 .
3574 .Bd -literal -offset indent
3575 \&.Bl \-item \-offset indent
3576 \&.It
3577 Item one goes here.
3578 Item one goes here.
3579 Item one goes here.
3580 \&.It
3581 Item two here.
3582 Item two here.
3583 Item two here.
3584 \&.El
3585 .Ed
3586 .Pp
3587 .
3588 Produces:
3589 .
3590 .Pp
3591 .Bl -item -offset indent
3592 .It
3593 Item one goes here.
3594 Item one goes here.
3595 Item one goes here.
3596 .It
3597 Item two here.
3598 Item two here.
3599 Item two here.
3600 .El
3601 .Pp
3602 .
3603 .It Fl tag
3604 A list with tags.
3605 Use
3606 .Fl width
3607 to specify the tag width.
3608 .
3609 .Pp
3610 .Bl -tag -width "PPID" -compact -offset indent
3611 .It SL
3612 sleep time of the process (seconds blocked)
3613 .It PAGEIN
3614 number of disk
3615 .Tn I/O Ns 's
3616 resulting from references by the process
3617 to pages not loaded in core.
3618 .It UID
3619 numerical user-id of process owner
3620 .It PPID
3621 numerical id of parent of process priority
3622 (non-positive when in non-interruptible wait)
3623 .El
3624 .Pp
3625 .
3626 The raw text:
3627 .
3628 .Bd -literal -offset indent
3629 \&.Bl \-tag \-width "PPID" \-compact \-offset indent
3630 \&.It SL
3631 sleep time of the process (seconds blocked)
3632 \&.It PAGEIN
3633 number of disk
3634 \&.Tn I/O Ns 's
3635 resulting from references by the process
3636 to pages not loaded in core.
3637 \&.It UID
3638 numerical user\-id of process owner
3639 \&.It PPID
3640 numerical id of parent of process priority
3641 (non\-positive when in non\-interruptible wait)
3642 \&.El
3643 .Ed
3644 .Pp
3645 .
3646 .It Fl diag
3647 Diag lists create section four diagnostic lists and are similar to inset
3648 lists except callable macros are ignored.
3649 The
3650 .Fl width
3651 flag is not meaningful in this context.
3652 .Pp
3653 Example:
3654 .
3655 .Bd -literal -offset indent
3656 \&.Bl \-diag
3657 \&.It You can't use Sy here.
3658 The message says all.
3659 \&.El
3660 .Ed
3661 .Pp
3662 .
3663 produces
3664 .
3665 .Bl -diag
3666 .It You can't use Sy here.
3667 The message says all.
3668 .El
3669 .Pp
3670 .
3671 .It Fl hang
3672 A list with hanging tags.
3673 .
3674 .Bl -hang -offset indent
3675 .It Em Hanged
3676 labels appear similar to tagged lists when the
3677 label is smaller than the label width.
3678 .It Em Longer hanged list labels
3679 blend into the paragraph unlike
3680 tagged paragraph labels.
3681 .El
3682 .Pp
3683 And the unformatted text which created it:
3684 .
3685 .Bd -literal -offset indent
3686 \&.Bl \-hang \-offset indent
3687 \&.It Em Hanged
3688 labels appear similar to tagged lists when the
3689 label is smaller than the label width.
3690 \&.It Em Longer hanged list labels
3691 blend into the paragraph unlike
3692 tagged paragraph labels.
3693 \&.El
3694 .Ed
3695 .Pp
3696 .
3697 .It Fl ohang
3698 Lists with overhanging tags do not use indentation for the items; tags are
3699 written to a separate line.
3700 .Pp
3701 .Bl -ohang -offset indent
3702 .It Sy SL
3703 sleep time of the process (seconds blocked)
3704 .It Sy PAGEIN
3705 number of disk
3706 .Tn I/O Ns 's
3707 resulting from references by the process
3708 to pages not loaded in core.
3709 .It Sy UID
3710 numerical user-id of process owner
3711 .It Sy PPID
3712 numerical id of parent of process priority
3713 (non-positive when in non-interruptible wait)
3714 .El
3715 .Pp
3716 .
3717 The raw text:
3718 .
3719 .Bd -literal -offset indent
3720 \&.Bl \-ohang \-offset indent
3721 \&.It Sy SL
3722 sleep time of the process (seconds blocked)
3723 \&.It Sy PAGEIN
3724 number of disk
3725 \&.Tn I/O Ns 's
3726 resulting from references by the process
3727 to pages not loaded in core.
3728 \&.It Sy UID
3729 numerical user\-id of process owner
3730 \&.It Sy PPID
3731 numerical id of parent of process priority
3732 (non\-positive when in non\-interruptible wait)
3733 \&.El
3734 .Ed
3735 .Pp
3736 .
3737 .It Fl inset
3738 Here is an example of inset labels:
3739 .Bl -inset -offset indent
3740 .It Em Tag
3741 The tagged list (also called a tagged paragraph)
3742 is the most common type of list used in the
3743 Berkeley manuals.
3744 Use a
3745 .Fl width
3746 attribute as described below.
3747 .It Em Diag
3748 Diag lists create section four diagnostic lists
3749 and are similar to inset lists except callable
3750 macros are ignored.
3751 .It Em Hang
3752 Hanged labels are a matter of taste.
3753 .It Em Ohang
3754 Overhanging labels are nice when space is constrained.
3755 .It Em Inset
3756 Inset labels are useful for controlling blocks of
3757 paragraphs and are valuable for converting
3758 .Nm \-mdoc
3759 manuals to other formats.
3760 .El
3761 .Pp
3762 Here is the source text which produced the above example:
3763 .
3764 .Bd -literal -offset indent
3765 \&.Bl \-inset \-offset indent
3766 \&.It Em Tag
3767 The tagged list (also called a tagged paragraph)
3768 is the most common type of list used in the
3769 Berkeley manuals.
3770 \&.It Em Diag
3771 Diag lists create section four diagnostic lists
3772 and are similar to inset lists except callable
3773 macros are ignored.
3774 \&.It Em Hang
3775 Hanged labels are a matter of taste.
3776 \&.It Em Ohang
3777 Overhanging labels are nice when space is constrained.
3778 \&.It Em Inset
3779 Inset labels are useful for controlling blocks of
3780 paragraphs and are valuable for converting
3781 \&.Nm \-mdoc
3782 manuals to other formats.
3783 \&.El
3784 .Ed
3785 .Pp
3786 .
3787 .It Fl column
3788 This list type generates multiple columns.
3789 The number of columns and the width of each column is determined by the
3790 arguments to the
3791 .Fl column
3792 list,
3793 .Aq Ar string1 ,
3794 .Aq Ar string2 ,
3795 etc.
3796 If
3797 .Aq Ar stringN
3798 starts with a
3799 .Ql .\&
3800 (dot) immediately followed by a valid
3801 .Nm \-mdoc
3802 macro name, interpret
3803 .Aq Ar stringN
3804 and use the width of the result.
3805 Otherwise, the width of
3806 .Aq Ar stringN
3807 (typeset with a fixed-width font) is taken as the
3808 .Ar N Ns th
3809 column width.
3810 .Pp
3811 Each
3812 .Ql .It
3813 argument is parsed to make a row, each column within the row is a separate
3814 argument separated by a tab or the
3815 .Ql .Ta
3816 macro.
3817 .Pp
3818 The table:
3819 .
3820 .Bl -column -offset indent ".Sy String" ".Sy Nroff" ".Sy Troff"
3821 .It Sy String Ta Sy Nroff Ta Sy Troff
3822 .It Li <= Ta <= Ta \*(<=
3823 .It Li >= Ta >= Ta \*(>=
3824 .El
3825 .Pp
3826 .
3827 was produced by:
3828 .
3829 .Bd -literal
3830 \&.Bl \-column \-offset indent ".Sy String" ".Sy Nroff" ".Sy Troff"
3831 \&.It Sy String Ta Sy Nroff Ta Sy Troff
3832 \&.It Li <= Ta <= Ta \e*(<=
3833 \&.It Li >= Ta >= Ta \e*(>=
3834 \&.El
3835 .Ed
3836 .Pp
3837 .
3838 Don't abuse this list type!
3839 For more complicated cases it might be far better and easier to use
3840 .Xr tbl 1 ,
3841 the table preprocessor.
3842 .El
3843 .Pp
3844 .
3845 Other keywords:
3846 .
3847 .Bl -tag -width ".Fl indent Ao Ar string Ac"
3848 .It Fl width Ao Ar string Ac
3849 If
3850 .Aq Ar string
3851 starts with a
3852 .Ql .\&
3853 (dot) immediately followed by a valid
3854 .Nm \-mdoc
3855 macro name, interpret
3856 .Aq Ar string
3857 and use the width of the result.
3858 Almost all lists in this document use this option.
3859 .Pp
3860 Example:
3861 .
3862 .Bd -literal -offset indent
3863 \&.Bl \-tag \-width ".Fl test Ao Ar string Ac"
3864 \&.It Fl test Ao Ar string Ac
3865 This is a longer sentence to show how the
3866 \&.Fl width
3867 flag works in combination with a tag list.
3868 \&.El
3869 .Ed
3870 .Pp
3871 .
3872 gives:
3873 .
3874 .Bl -tag -width ".Fl test Ao Ar string Ac"
3875 .It Fl test Ao Ar string Ac
3876 This is a longer sentence to show how the
3877 .Fl width
3878 flag works in combination with a tag list.
3879 .El
3880 .Pp
3881 .
3882 (Note that the current state of
3883 .Nm \-mdoc
3884 is saved before
3885 .Aq Ar string
3886 is interpreted; afterwards, all variables are restored again.
3887 However, boxes (used for enclosures) can't be saved in
3888 .Tn GNU
3889 .Xr troff 1 ;
3890 as a consequence, arguments must always be
3891 .Em balanced
3892 to avoid nasty errors.
3893 For example, do not write
3894 .Ql ".Ao Ar string"
3895 but
3896 .Ql ".Ao Ar string Xc"
3897 instead if you really need only an opening angle bracket.)
3898 .Pp
3899 Otherwise, if
3900 .Aq Ar string
3901 is a valid numeric expression
3902 .Em ( with a scale indicator other than
3903 .Sq Em u ) ,
3904 use that value for indentation.
3905 The most useful scale indicators are
3906 .Sq m
3907 and
3908 .Sq n ,
3909 specifying the so-called
3910 .Em \&Em
3911 and
3912 .Em "En square" .
3913 This is approximately the width of the letters
3914 .Sq m
3915 and
3916 .Sq n
3917 respectively
3918 of the current font (for nroff output, both scale indicators give the same
3919 values).
3920 If
3921 .Aq Ar string
3922 isn't a numeric expression, it is tested whether it is an
3923 .Nm \-mdoc
3924 macro name, and the default width value associated with this macro is used.
3925 Finally, if all tests fail,
3926 the width of
3927 .Aq Ar string
3928 (typeset with a fixed-width font) is taken as the width.
3929 .Pp
3930 If a width is not specified for the tag list type,
3931 .Sq 6n
3932 is used.
3933 .It Fl offset Ao Ar string Ac
3934 If
3935 .Aq Ar string
3936 is
3937 .Ar indent ,
3938 a default indent value (normally set to\~6n, similar to the value used in
3939 .Ql .Dl
3940 or
3941 .Ql .Bd )
3942 is used.
3943 If
3944 .Aq Ar string
3945 is a valid numeric expression instead
3946 .Pf ( Em with a scale indicator other than
3947 .Sq Em u ) ,
3948 use that value for indentation.
3949 The most useful scale indicators are
3950 .Sq m
3951 and
3952 .Sq n ,
3953 specifying the so-called
3954 .Em \&Em
3955 and
3956 .Em "En square" .
3957 This is approximately the width of the letters
3958 .Sq m
3959 and
3960 .Sq n
3961 respectively
3962 of the current font (for nroff output, both scale indicators give the same
3963 values).
3964 If
3965 .Aq Ar string
3966 isn't a numeric expression, it is tested whether it is an
3967 .Nm \-mdoc
3968 macro name, and the default offset value associated with this macro is used.
3969 Finally, if all tests fail,
3970 the width of
3971 .Aq Ar string
3972 (typeset with a fixed-width font) is taken as the offset.
3973 .It Fl compact
3974 Suppress insertion of vertical space before the list and between list items.
3975 .El
3976 .
3977 .
3978 .Sh "MISCELLANEOUS MACROS"
3979 .
3980 Here a list of the remaining macros which do not fit well into one of the
3981 above sections.
3982 We couldn't find real examples for the following macros:
3983 .Ql .Me
3984 and
3985 .Ql .Ot .
3986 They are documented here for completeness \- if you know how to use them
3987 properly please send a mail to
3988 .Mt groff@gnu.org
3989 (including an example).
3990 .
3991 .Bl -tag -width ".Li .Bt"
3992 .It Li .Bt
3993 prints
3994 .
3995 .Bd -ragged -offset indent
3996 .Bt
3997 .Ed
3998 .Pp
3999 It is neither callable nor parsed and takes no arguments.
4000 .
4001 .It Li .Fr
4002 .Pp
4003 .Dl Usage: .Fr Ao function return value Ac ...
4004 .Pp
4005 Don't use this macro.
4006 It allows a break right before the return value (usually a single digit)
4007 which is bad typographical behaviour.
4008 Use
4009 .Ql \e\[ti]
4010 to tie the return value to the previous word.
4011 .
4012 .It Li .Hf
4013 Use this macro to include a (header) file literally.
4014 It first prints
4015 .Ql File:
4016 followed by the file name, then the contents of
4017 .Ao file Ac .
4018 .Pp
4019 .Dl Usage: .Hf Ao file Ac
4020 .Pp
4021 It is neither callable nor parsed.
4022 .
4023 .It Li .Lk
4024 To be written.
4025 .
4026 .It Li .Me
4027 Exact usage unknown.
4028 The documentation in the
4029 .Nm \-mdoc
4030 source file describes it as a macro for
4031 .Dq "menu entries" .
4032 .Pp
4033 Its default width is 6n.
4034 .
4035 .It Li .Mt
4036 To be written.
4037 .
4038 .It Li .Ot
4039 Exact usage unknown.
4040 The documentation in the
4041 .Nm \-mdoc
4042 source file describes it as
4043 .Dq old function type (fortran) .
4044 .
4045 .It Li .Sm
4046 Activate (toggle) space mode.
4047 .Pp
4048 .Dl Usage: .Sm Oo on | off Oc ...
4049 .Pp
4050 If space mode is off, no spaces between macro arguments are inserted.
4051 If called without a parameter (or if the next parameter is neither
4052 .Ql on
4053 nor
4054 .Ql off ,
4055 .Ql .Sm
4056 toggles space mode.
4057 .
4058 .It Li .Ud
4059 prints
4060 .
4061 .Bd -ragged -offset indent
4062 .Ud
4063 .Ed
4064 .Pp
4065 It is neither callable nor parsed and takes no arguments.
4066 .El
4067 .
4068 .
4069 .Sh "PREDEFINED STRINGS"
4070 .
4071 The following strings are predefined:
4072 .Pp
4073 .TS
4074 lb lb lb lb
4075 l l l l.
4076 String  Nroff   Troff   Meaning
4077 <=      <=      \*[<=]  less equal
4078 >=      >=      \*[>=]  greater equal
4079 Rq      ''      \*[Rq]  right double quote
4080 Lq      ``      \*[Lq]  left double quote
4081 ua      ^       \*[ua]  upwards arrow
4082 aa      \'      \*[aa]  acute accent
4083 ga      \`      \*[ga]  grave accent
4084 q       \&"     \*[q]   straight double quote
4085 Pi      pi      \*[Pi]  greek pi
4086 Ne      !=      \*[Ne]  not equal
4087 Le      <=      \*[Le]  less equal
4088 Ge      >=      \*[Ge]  greater equal
4089 Lt      <       \*[Lt]  less than
4090 Gt      >       \*[Gt]  greater than
4091 Pm      +\-     \*[Pm]  plus minus
4092 If      infinity        \*[If]  infinity
4093 Am      \*[Am]  \*[Am]  ampersand
4094 Na      \*[Na]  \*[Na]  not a number
4095 Ba      \*[Ba]  \*[Ba]  vertical bar
4096 .TE
4097 .Pp
4098 The names of the columns
4099 .Sy Nroff
4100 and
4101 .Sy Troff
4102 are a bit misleading;
4103 .Sy Nroff
4104 shows the
4105 .Tn ASCII
4106 representation, while
4107 .Sy Troff
4108 gives the best glyph form available.
4109 For example, a Unicode enabled
4110 .Tn TTY Ns - Ns
4111 device will have proper glyph representations for all strings, whereas the
4112 enhancement for a Latin1
4113 .Tn TTY Ns - Ns
4114 device is only the plus-minus sign.
4115 .Pp
4116 String names which consist of two characters can be written as
4117 .Ql \e*(xx ;
4118 string names which consist of one character can be written as
4119 .Ql \e*x .
4120 A generic syntax for a string name of any length is
4121 .Ql \e*[xxx]
4122 (this is a
4123 .Tn GNU
4124 .Xr troff 1
4125 extension).
4126 .
4127 .
4128 \#
4129 \#=====================================================================
4130 \#
4131 .Sh DIAGNOSTICS
4132 .
4133 The debugging macro
4134 .Ql .Db
4135 available in previous versions of
4136 .Nm \-mdoc
4137 has been removed since
4138 .Tn GNU
4139 .Xr troff 1
4140 provides better facilities to check parameters; additionally, many error and
4141 warning messages have been added to this macro package, making it both more
4142 robust and verbose.
4143 .Pp
4144 The only remaining debugging macro is
4145 .Ql .Rd
4146 which yields a register dump of all global registers and strings.
4147 A normal user will never need it.
4148 .
4149 .
4150 .Sh "FORMATTING WITH GROFF, TROFF, AND NROFF"
4151 .
4152 By default, the package inhibits page breaks, headers, and footers if
4153 displayed with a
4154 .Tn TTY
4155 device like
4156 .Sq latin1
4157 or
4158 .Sq unicode ,
4159 to make the manual more efficient for viewing on-line.
4160 This behaviour can be changed (e.g.\& to create a hardcopy of the
4161 .Tn TTY
4162 output) by setting the register
4163 .Ql cR
4164 to zero while calling
4165 .Xr groff 1 ,
4166 resulting in multiple pages instead of a single, very long page:
4167 .Pp
4168 .Dl groff \-Tlatin1 \-rcR=0 \-mdoc foo.man > foo.txt
4169 .Pp
4170 For double-sided printing, set register
4171 .Ql D
4172 to\~1:
4173 .Pp
4174 .Dl groff \-Tps \-rD1 \-mdoc foo.man > foo.ps
4175 .Pp
4176 To change the document font size to 11pt or 12pt, set register
4177 .Ql S
4178 accordingly:
4179 .Pp
4180 .Dl groff \-Tdvi \-rS11 \-mdoc foo.man > foo.dvi
4181 .Pp
4182 Register
4183 .Ql S
4184 is ignored for
4185 .Tn TTY
4186 devices.
4187 .Pp
4188 The line and title length can be changed by setting the registers
4189 .Ql LL
4190 and
4191 .Ql LT ,
4192 respectively:
4193 .Pp
4194 .Dl groff \-Tutf8 \-rLL=100n \-rLT=100n \-mdoc foo.man | less
4195 .Pp
4196 If not set, both registers default to 78n for TTY devices and 6.5i
4197 otherwise.
4198 .
4199 .
4200 .Sh FILES
4201 .
4202 .Bl -tag -width mdoc/doc-ditroff -compact
4203 .It Pa doc.tmac
4204 The main manual macro package.
4205 .It Pa mdoc.tmac
4206 A wrapper file to call
4207 .Pa doc.tmac .
4208 .It Pa mdoc/doc-common
4209 Common strings, definitions, stuff related typographic output.
4210 .It Pa mdoc/doc-nroff
4211 Definitions used for a
4212 .Tn TTY
4213 output device.
4214 .It Pa mdoc/doc-ditroff
4215 Definitions used for all other devices.
4216 .It Pa mdoc.local
4217 Local additions and customizations.
4218 .It Pa andoc.tmac
4219 Use this file if you don't know whether the
4220 .Nm \-mdoc
4221 or the
4222 .Nm \-man
4223 package should be used.
4224 Multiple man pages (in either format) can be handled.
4225 .El
4226 .
4227 .
4228 .Sh "SEE ALSO"
4229 .
4230 .Xr groff 1 ,
4231 .Xr man 1 ,
4232 .Xr troff 1 ,
4233 .Xr groff_man 7
4234 .
4235 .
4236 .Sh BUGS
4237 .
4238 Section 3f has not been added to the header routines.
4239 .Pp
4240 .Ql \&.Nm
4241 font should be changed in
4242 .Em NAME
4243 section.
4244 .Pp
4245 .Ql \&.Fn
4246 needs to have a check to prevent splitting up
4247 if the line length is too short.
4248 Occasionally it
4249 separates the last parenthesis, and sometimes
4250 looks ridiculous if a line is in fill mode.
4251 .Pp
4252 The list and display macros do not do any keeps
4253 and certainly should be able to.
4254 .\" Note what happens if the parameter list overlaps a newline
4255 .\" boundary.
4256 .\" to make sure a line boundary is crossed:
4257 .\" .Bd -literal
4258 .\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[]
4259 .\" .Ed
4260 .\" .Pp
4261 .\" produces, nudge nudge,
4262 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
4263 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
4264 .\" nudge
4265 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] .
4266 .\" .Pp
4267 .\" If double quotes are used, for example:
4268 .\" .Bd -literal
4269 .\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q
4270 .\" .Ed
4271 .\" .Pp
4272 .\" produces, nudge nudge,
4273 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
4274 .\" nudge
4275 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
4276 .\" nudge
4277 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" .
4278 .\" .Pp
4279 .\" Not a pretty sight...
4280 .\" In a paragraph, a long parameter containing unpaddable spaces as
4281 .\" in the former example will cause
4282 .\" .Xr troff
4283 .\" to break the line and spread
4284 .\" the remaining words out.
4285 .\" The latter example will adjust nicely to
4286 .\" justified margins, but may break in between an argument and its
4287 .\" declaration.
4288 .\" In
4289 .\" .Xr nroff
4290 .\" the right margin adjustment is normally ragged and the problem is
4291 .\" not as severe.
4292 .
4293 .\" ====================================================================
4294 .\" Editor settings
4295 .\" ====================================================================
4296 .
4297 .\" Local Variables:
4298 .\" mode: nroff
4299 .\" fill-column: 72
4300 .\" End:
4301 .\" vim: set filetype=groff textwidth=72: