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