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