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