* Imakefile.in (extraclean): Added gxditview._man.
[s-roff.git] / tmac / groff_mdoc.man
blobe39df7a2813e10fa351b67c7d77d5f87bcff241b
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. All advertising materials mentioning features or use of this software
23 .\"    must display the following acknowledgement:
24 .\"      This product includes software developed by the University of
25 .\"      California, Berkeley and its contributors.
26 .\" 4. Neither the name of the University nor the names of its contributors
27 .\"    may be used to endorse or promote products derived from this software
28 .\"    without specific prior written permission.
29 .\"
30 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
31 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
34 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 .\" SUCH DAMAGE.
41 .\"
42 .\"     @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93
43 .\"
44 .\" This reference invokes every macro in the package several
45 .\" times and is guaranteed to give a worst case performance
46 .\" for an already extremely slow package.
47 .\"
49 .Dd February 27, 2003
50 .Os
51 .Dt GROFF_MDOC 7
54 .Sh NAME
56 .Nm groff_mdoc
57 .Nd reference for groff's mdoc implementation
60 .Sh SYNOPSIS
62 .Nm groff Fl m Ns Cm doc Ar
65 .Sh DESCRIPTION
67 A complete reference for writing
68 .Ux
69 manual pages with the
70 .Nm \-mdoc
71 macro package; a
72 .Em content Ns -based
73 and
74 .Em domain Ns -based
75 formatting package for
76 .Tn GNU
77 .Xr troff 1 .
78 Its predecessor, the
79 .Xr \-man 7
80 package, addressed page layout leaving the manipulation of fonts and other
81 typesetting details to the individual author.
83 .Nm \-mdoc ,
84 page layout macros make up the
85 .Em "page structure domain"
86 which consists of macros for titles, section headers, displays and lists
87 \- essentially items which affect the physical position of text on a
88 formatted page.
89 In addition to the page structure domain, there are two more domains, the
90 .Em manual
91 domain and the
92 .Em general
93 text domain.
94 The general text domain is defined as macros which perform tasks such as
95 quoting or emphasizing pieces of text.
96 The manual domain is defined as macros that are a subset of the day to day
97 informal language used to describe commands, routines and related
98 .Ux
99 files.
100 Macros in the manual domain handle command names, command line arguments and
101 options, function names, function parameters, pathnames, variables, cross
102 references to other manual pages, and so on.
103 These domain items have value for both the author and the future user of the
104 manual page.
105 Hopefully, the consistency gained across the manual set will provide easier
106 translation to future documentation tools.
108 Throughout the
110 manual pages, a manual entry is simply referred to as a man page, regardless
111 of actual length and without sexist intention.
114 .Sh "GETTING STARTED"
116 The material presented in the remainder of this document is outlined
117 as follows:
119 .Bl -enum -width 3n -offset indent
120 .  It
121 .  Tn "TROFF IDIOSYNCRASIES"
123 .  Bl -tag -width 2n -compact
124 .    It "Macro Usage"
125 .    It "Passing Space Characters in an Argument"
126 .    It "Trailing Blank Space Characters"
127 .    It "Escaping Special Characters"
128 .    It "Other Possible Pitfalls"
129 .  El
131 .  It
132 .  Tn "A MANUAL PAGE TEMPLATE"
134 .  It
135 .  Tn "CONVENTIONS"
137 .  It
138 .  Tn "TITLE MACROS"
140 .  It
141 .  Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS"
143 .  Bl -tag -width 2n -compact
144 .    It "What's in a Name" Ns ...
145 .    It "General Syntax"
146 .  El
148 .  It
149 .  Tn "MANUAL DOMAIN"
151 .  Bl -tag -width 2n -compact
152 .    It "Addresses"
153 .    It "Author Name"
154 .    It "Arguments"
155 .    It "Configuration Declarations (Section Four Only)"
156 .    It "Command Modifiers"
157 .    It "Defined Variables"
158 .    It "Errno's"
159 .    It "Environment Variables"
160 .    It "Flags"
161 .    It "Function Declarations"
162 .    It "Function Types"
163 .    It "Functions (Library Routines)"
164 .    It "Function Arguments"
165 .    It "Return Values"
166 .    It "Exit Status"
167 .    \" .It "Header File (including source code)"
168 .    It "Interactive Commands"
169 .    It "Library Names"
170 .    It "Literals"
171 .    It "Names"
172 .    It "Options"
173 .    It "Pathnames"
174 .    It "Standards"
175 .    It "Variable Types"
176 .    It "Variables"
177 .    It "Manual Page Cross References"
178 .  El
180 .  It
181 .  Tn "GENERAL TEXT DOMAIN"
183 .  Bl -tag -width 2n -compact
184 .    It "AT&T Macro"
185 .    It "BSD Macro"
186 .    It "NetBSD Macro"
187 .    It "FreeBSD Macro"
188 .    It "OpenBSD Macro"
189 .    It "BSD/OS Macro"
190 .    It "UNIX Macro"
191 .    It "Emphasis Macro"
192 .    It "Font Mode"
193 .    It "Enclosure and Quoting Macros"
194 .    It "No-Op or Normal Text Macro"
195 .    It "No-Space Macro"
196 .    It "Section Cross References"
197 .    It "Symbolics"
198 .    It "Mathematical Symbols"
199 .    It "References and Citations"
200 .    It "Trade Names (or Acronyms and Type Names)"
201 .    It "Extended Arguments"
202 .  El
204 .  It
205 .  Tn "PAGE STRUCTURE DOMAIN"
207 .  Bl -tag -width 2n -compact
208 .    It "Section Headers"
209 .    It "Subsection Headers"
210 .    It "Paragraphs and Line Spacing"
211 .    It "Keeps"
212 .    It "Examples and Displays"
213 .    It "Lists and Columns"
214 .  El
216 .  It
217 .  Tn "MISCELLANEOUS MACROS"
219 .  It
220 .  Tn "PREDEFINED STRINGS"
222 .  It
223 .  Tn "DIAGNOSTICS"
225 .  It
226 .  Tn "FORMATTING WITH GROFF, TROFF, AND NROFF"
228 .  It
229 .  Tn "FILES"
231 .  It
232 .  Tn "SEE ALSO"
234 .  It
235 .  Tn "BUGS"
238 .\" XXX
239 .if t \
240 .  ne 7
243 .Sh "TROFF IDIOSYNCRASIES"
246 .Nm \-mdoc
247 package attempts to simplify the process of writing a man page.
248 Theoretically, one should not have to learn the tricky details of
249 .Tn GNU
250 .Xr troff 1
251 to use
252 .Nm \-mdoc ;
253 however, there are a few limitations which are unavoidable and best gotten
254 out of the way.
255 And, too, be forewarned, this package is
256 .Em not
257 fast.
259 .Ss "Macro Usage"
261 As in
262 .Tn GNU
263 .Xr troff 1 ,
264 a macro is called by placing a
265 .Ql .\&
266 (dot character) at the beginning of a line followed by the two-character
267 (or three-character) name for the macro.
268 There can be space or tab characters between the dot and the macro name.
269 Arguments may follow the macro separated by spaces (but
270 .Em no
271 tabs).
272 It is the dot character at the beginning of the line which causes
273 .Tn GNU
274 .Xr troff 1
275 to interpret the next two (or more) characters as a macro name.
276 A single starting dot followed by nothing is ignored.
277 To place a
278 .Ql .\&
279 (dot character) at the beginning of an input line in some context other than
280 a macro invocation, precede the
281 .Ql .\&
282 (dot) with the
283 .Ql \e&
284 escape sequence which translates literally to a zero-width space, and is
285 never displayed in the output.
287 In general,
288 .Tn GNU
289 .Xr troff 1
290 macros accept an unlimited number of arguments (contrary to other versions
291 of troff which can't handle more than nine arguments).
292 In limited cases, arguments may be continued or extended on the next
293 line (See
294 .Sx Extended Arguments
295 below).
296 Almost all macros handle quoted arguments (see
297 .Sx Passing Space Characters in an Argument
298 below).
300 Most of the
301 .Nm \-mdoc
302 general text domain and manual domain macros are special in that their
303 argument lists are
304 .Em parsed
305 for callable macro names.
306 This means an argument on the argument list which matches a general text or
307 manual domain macro name (and which is defined to be callable) will be
308 executed or called when it is processed.
309 In this case the argument, although the name of a macro, is not preceded by
311 .Ql .\&
312 (dot).
313 This makes it possible to nest macros; for example the option macro,
314 .Ql .Op ,
316 .Em call
317 the flag and argument macros,
318 .Ql \&Fl
320 .Ql \&Ar ,
321 to specify an optional flag with an argument:
323 .Bl -tag -width ".Op Fl s Ar bytes" -offset indent
324 .It Op Fl s Ar bytes
325 is produced by
326 .Ql ".Op Fl s Ar bytes"
330 To prevent a string from being interpreted as a macro name, precede the
331 string with the escape sequence
332 .Ql \e& :
334 .Bl -tag -width ".Op \&Fl s \&Ar bytes" -offset indent
335 .It Op \&Fl s \&Ar bytes
336 is produced by
337 .Ql ".Op \e&Fl s \e&Ar bytes"
341 Here the strings
342 .Ql \&Fl
344 .Ql \&Ar
345 are not interpreted as macros.
346 Macros whose argument lists are parsed for callable arguments are referred
347 to as
348 .Em parsed
349 and macros which may be called from an argument list are referred to as
350 .Em callable
351 throughout this document.
352 This is a technical
353 .Em faux pas
354 as almost all of the macros in
355 .Nm \-mdoc
356 are parsed, but as it was cumbersome to constantly refer to macros as
357 being callable and being able to call other macros, the term parsed
358 has been used.
361 In the following, we call an
362 .Nm \-mdoc
363 macro which starts a line (with a leading dot) a
364 .Em command
365 if this distinction is necessary.
367 .Ss "Passing Space Characters in an Argument"
369 Sometimes it is desirable to give as an argument a string containing one or
370 more blank space characters, say, to specify arguments to commands which
371 expect particular arrangement of items in the argument list.
372 Additionally, it makes
373 .Nm \-mdoc
374 working faster.
375 For example, the function command
376 .Ql .Fn
377 expects the first argument to be the name of a function and any remaining
378 arguments to be function parameters.
380 .Tn ANSI\~C
381 stipulates the declaration of function parameters in the parenthesized
382 parameter list, each parameter is guaranteed to be at minimum a two word
383 string.
384 For example,
385 .Fa int foo .
387 There are two possible ways to pass an argument which contains
388 an embedded space.
389 One way of passing a string containing blank spaces is to use the hard or
390 unpaddable space character
391 .Ql \e\  ,
392 that is, a blank space preceded by the escape character
393 .Ql \e .
394 This method may be used with any macro but has the side effect of
395 interfering with the adjustment of text over the length of a line.
396 .Xr Troff
397 sees the hard space as if it were any other printable character and cannot
398 split the string into blank or newline separated pieces as one would expect.
399 This method is useful for strings which are not expected to overlap a line
400 boundary.
401 An alternative is to use
402 .Ql \e~ ,
403 a paddable (i.e.\& stretchable), unbreakable space (this is a
404 .Tn GNU
405 .Xr troff 1
406 extension).
407 The second method is to enclose the string with double quotes.
409 For example:
411 .Bl -tag -width ".Fn fetch char\ *str" -offset indent
412 .It Fn fetch char\ *str
413 is created by
414 .Ql ".Fn fetch char\e *str"
415 .It Fn fetch "char *str"
416 can also be created by
417 .Ql ".Fn fetch \*[q]char *str\*[q]"
421 If the
422 .Ql \e
423 before the space in the first example
424 or double quotes in the second example
425 were omitted,
426 .Ql .Fn
427 would see three arguments, and the result would be:
429 .Dl Fn fetch char *str
431 .\" For an example of what happens when the parameter list overlaps a newline
432 .\" boundary, see the
433 .\" .Sx BUGS
434 .\" section.
436 .Ss "Trailing Blank Space Characters"
438 .Xr Troff
439 can be confused by blank space characters at the end of a line.
440 It is a wise preventive measure to globally remove all blank spaces
441 from
442 .Ao blank-space Ac Ns Ao end-of-line Ac
443 character sequences.
444 Should the need arise to use a blank character at the end of a line, it
445 may be forced with an unpaddable space and the
446 .Ql \e&
447 escape character.
448 For example,
449 .Ql string\e\ \e& .
451 .Ss "Escaping Special Characters"
453 Special characters like the newline character
454 .Ql \en
455 are handled by replacing the
456 .Ql \e
457 with
458 .Ql \ee
459 (e.g.\&
460 .Ql \een )
461 to preserve the backslash.
463 .Ss "Other Possible Pitfalls"
465 A warning is emitted when an empty input line is found outside of displays
466 (see below).
468 .Ql .sp
469 instead.
470 (Well, it is even better to use
471 .Nm \-mdoc
472 macros to avoid the usage of low-level commands.)
474 Leading spaces will cause a break and are output directly.
475 Avoid this behaviour if possible.
476 Similarly, do not use more than one space character between words in an
477 ordinary text line; contrary to other text formatters, they are
478 .Em not
479 replaced with a single space.
481 You can't pass
482 .Ql \*[q]
483 directly as an argument.
485 .Ql \e*[q]
487 .Ql \e*q )
488 instead.
490 By default,
491 .Xr troff 1
492 inserts two space characters after a punctuation mark closing a sentence;
493 characters like
494 .Ql \&)
496 .Ql \&'
497 are treated transparently, not influencing the sentence-ending behaviour.
498 To change this, insert
499 .Ql \e&
500 before or after the dot:
502 .Bd -literal -offset indent
504 \&.Ql .
505 character.
506 \&.Pp
508 \&.Ql \e&.
509 character.
510 \&.Pp
511 \&.No test .
512 test
513 \&.Pp
514 \&.No test.
515 test
519 gives
521 .Bd -filled -offset indent
523 .Ql .
524 character
527 .Ql \&.
528 character.
530 .No test .
531 test
533 .No test.
534 test
538 As can be seen in the first and third line,
539 .Nm \-mdoc
540 handles punctuation characters specially in macro arguments.
541 This will be explained in section
542 .Sx General Syntax
543 below.
544 In the same way, you have to protect trailing full stops of abbreviations
545 with a trailing zero-width space:
546 .Ql e.g.\e& .
548 A comment in the source file of a man page can be either started with
549 .Ql .\e"
550 on a single line,
551 .Ql \e"
552 after some input, or
553 .Ql \e#
554 anywhere (the latter is a
555 .Tn GNU
556 .Xr troff 1
557 extension); the rest of such a line is ignored.
560 .Sh "A MANUAL PAGE TEMPLATE"
562 The body of a man page is easily constructed from a basic template:
564 .Bd -literal -offset indent
565 \&.\e" The following commands are required for all man pages.
566 \&.Dd Month day, year
567 \&.Os [OPERATING_SYSTEM] [version/release]
568 \&.Dt DOCUMENT_TITLE [section number] [architecture/volume]
569 \&.Sh NAME
570 \&.Nm name
571 \&.Nd one line description of name
572 \&.\e" This next command is for sections 2 and 3 only.
573 \&.\e" .Sh LIBRARY
574 \&.Sh SYNOPSIS
575 \&.Sh DESCRIPTION
576 \&.\e" The following commands should be uncommented and
577 \&.\e" used where appropriate.
578 \&.\e" .Sh IMPLEMENTATION NOTES
579 \&.\e" This next command is for sections 2, 3 and 9 function
580 \&.\e" return values only.
581 \&.\e" .Sh RETURN VALUES
582 \&.\e" This next command is for sections 1, 6, 7 and 8 only.
583 \&.\e" .Sh ENVIRONMENT
584 \&.\e" .Sh FILES
585 \&.\e" .Sh EXAMPLES
586 \&.\e" This next command is for sections 1, 6, 7, 8 and 9 only
587 \&.\e"     (command return values (to shell) and
588 \&.\e"     fprintf/stderr type diagnostics).
589 \&.\e" .Sh DIAGNOSTICS
590 \&.\e" .Sh COMPATIBILITY
591 \&.\e" This next command is for sections 2, 3 and 9 error
592 \&.\e"     and signal handling only.
593 \&.\e" .Sh ERRORS
594 \&.\e" .Sh SEE ALSO
595 \&.\e" .Sh STANDARDS
596 \&.\e" .Sh HISTORY
597 \&.\e" .Sh AUTHORS
598 \&.\e" .Sh BUGS
602 The first items in the template are the commands
603 .Ql .Dd ,
604 .Ql .Os ,
606 .Ql .Dt ;
607 the document date, the operating system the man page or subject source is
608 developed or modified for, and the man page title (in
609 .Em upper case )
610 along with the section of the manual the page belongs in.
611 These commands identify the page and are discussed below in
612 .Sx TITLE MACROS .
614 The remaining items in the template are section headers
615 .Pf ( Li .Sh ) ;
616 of which
617 .Sx NAME ,
618 .Sx SYNOPSIS ,
620 .Sx DESCRIPTION
621 are mandatory.
622 The headers are discussed in
623 .Sx "PAGE STRUCTURE DOMAIN" ,
624 after presentation of
625 .Sx "MANUAL DOMAIN" .
626 Several content macros are used to demonstrate page layout macros; reading
627 about content macros before page layout macros is recommended.
630 .Sh CONVENTIONS
632 In the description of all macros below, optional arguments are put into
633 brackets.
634 An ellipsis
635 .Pf ( Sq ... )
636 represents zero or more additional arguments.
637 Alternative values for a parameter are separated with
638 .Ql | .
639 If there are alternative values for a mandatory parameter, braces are used
640 (together with
641 .Ql | )
642 to enclose the value set.
643 Meta-variables are specified within angles.
645 Example:
647 .Bl -tag -width 6n -offset indent
648 .It Li .Xx Xo
649 .Aq foo 
650 .Brq bar1 | bar2
651 .Op \-test1 Op \-test2 | \-test3
652 .No ...
657 Except stated explicitly, all macros are parsed and callable.
659 Note that a macro takes effect up to the next nested macro.
660 For example,
661 .Ql ".Ic foo Aq bar"
662 doesn't produce
663 .Sq Ic "foo <bar>"
665 .Sq Ic foo Aq bar .
666 Consequently, a warning message is emitted for most commands if the first
667 argument is a macro itself since it cancels the effect of the calling
668 command completely.
669 Another consequence is that quoting macros never insert literal quotes;
670 .Sq Ic "foo <bar>"
671 has been produced by
672 .Ql ".Ic \*[q]foo <bar>\*[q]" .
674 Most macros have a default width value which can be used to specify a label
675 width
676 .Pf ( Fl width )
677 or offset
678 .Pf ( Fl offset )
679 for the
680 .Ql .Bl
682 .Ql .Bd
683 macros.
684 It is recommended not to use this rather obscure feature to avoid
685 dependencies on local modifications of the
686 .Nm \-mdoc
687 package.
690 .Sh "TITLE MACROS"
692 The title macros are part of the page structure domain but are presented
693 first and separately for someone who wishes to start writing a man page
694 yesterday.
695 Three header macros designate the document title or manual page title, the
696 operating system, and the date of authorship.
697 These macros are called once at the very beginning of the document and are
698 used to construct headers and footers only.
700 .Bl -tag -width 6n
701 .It Li .Dt Xo
702 .Op Aq document title
703 .Op Aq section number
704 .Op Aq volume
706 The document title is the subject of the man page and must be in
707 .Tn CAPITALS
708 due to troff limitations.
709 If omitted,
710 .Sq Tn UNTITLED
711 is used.
712 The section number may be a number in the range
713 .No 1,\~ Ns ... Ns ,\~9
715 .Ql unass ,
716 .Ql draft ,
718 .Ql paper .
719 If it is specified, and no volume name is given, a default volume name is
720 used.
723 Under
724 .Tn \*[operating-system] ,
725 the following sections are defined:
727 .Bl -column LOCAL -offset indent -compact
728 .It Li 1   Ta "\*[volume-operating-system] \*[volume-ds-1]"
729 .It Li 2   Ta "\*[volume-operating-system] \*[volume-ds-2]"
730 .It Li 3   Ta "\*[volume-operating-system] \*[volume-ds-3]"
731 .It Li 4   Ta "\*[volume-operating-system] \*[volume-ds-4]"
732 .It Li 5   Ta "\*[volume-operating-system] \*[volume-ds-5]"
733 .It Li 6   Ta "\*[volume-operating-system] \*[volume-ds-6]"
734 .It Li 7   Ta "\*[volume-operating-system] \*[volume-ds-7]"
735 .It Li 8   Ta "\*[volume-operating-system] \*[volume-ds-8]"
736 .It Li 9   Ta "\*[volume-operating-system] \*[volume-ds-9]"
740 A volume name may be arbitrary or one of the following:
743 .Bl -column LOCAL -offset indent -compact
744 .It Li USD   Ta "\*[volume-ds-USD]"
745 .It Li PS1   Ta "\*[volume-ds-PS1]"
746 .It Li AMD   Ta "\*[volume-ds-AMD]"
747 .It Li SMM   Ta "\*[volume-ds-SMM]"
748 .It Li URM   Ta "\*[volume-ds-URM]"
749 .It Li PRM   Ta "\*[volume-ds-PRM]"
750 .It Li KM    Ta "\*[volume-ds-KM]"
751 .It Li IND   Ta "\*[volume-ds-IND]"
752 .It Li LOCAL Ta "\*[volume-ds-LOCAL]"
753 .It Li CON   Ta "\*[volume-ds-CON]"
757 For compatibility,
758 .Ql MMI
759 can be used for
760 .Ql IND ,
762 .Ql LOC
764 .Ql LOCAL .
765 Values from the previous table will specify a new volume name.
766 If the third parameter is a keyword designating a computer architecture,
767 its value is prepended to the default volume name as specified by the
768 second parameter.
769 By default, the following architecture keywords are defined:
771 \# we use `No' to avoid hyphenation
772 .Bd -ragged -offset indent
773 .No alpha , amiga , arc , arm26 , arm32 , atari , bebox , cobalt , evbsh3 ,
774 .No hp300 , hpcmips , i386 , luna68k , m68k , mac68k , macppc , mips ,
775 .No mmeye , mvme68k , news68k , newsmips , next68k , ofppc , pc532 , pmax ,
776 .No powerpc , prep , sgimips , sh3 , sparc , sparc64 , sun3 , tahoe , vax ,
777 .No x68k
781 If the section number is neither a numeric expression in the range 1 to\~9
782 nor one of the above described keywords, the third parameter is used
783 verbatim as the volume name.
785 In the following examples, the left (which is identical to the right) and
786 the middle part of the manual page header strings are shown.
787 Note how
788 .Ql \e&
789 prevents the digit\~1 from being a valid numeric expression.
791 .Bd -ragged
792 .Bl -tag -width ".Li .Dt\ FOO\ 2\ i386" -compact -offset indent
793 .It Li ".Dt FOO 7"
794 .Ql FOO(7)
795 .Ql \*[volume-operating-system] \*[volume-ds-7]
796 .It Li ".Dt FOO 7 bar"
797 .Ql FOO(7)
798 .Ql \*[volume-operating-system] \*[volume-ds-7]
799 .It Li ".Dt FOO \e&7 bar"
800 .Ql FOO(7)
801 .Ql bar
802 .It Li ".Dt FOO 2 i386"
803 .Ql FOO(2)
804 .Ql \*[volume-operating-system]/\*[volume-as-i386] \*[volume-ds-2]
805 .It Li ".Dt FOO \*[q]\*[q] bar"
806 .Ql FOO
807 .Ql bar
812 Local, OS-specific additions might be found in the file
813 .Pa mdoc.local ;
814 look for strings named
815 .Ql volume-ds-XXX
816 (for the former type) and
817 .Ql volume-as-XXX
818 (for the latter type);
819 .Ql XXX
820 then denotes the keyword to be used with the
821 .Ql .Dt
822 macro.
824 This macro is neither callable nor parsed.
826 .It Li .Os Xo
827 .Op Aq operating system
828 .Op Aq release
830 If the first parameter is empty,
831 the default
832 .Sq Tn "\*[operating-system]"
833 is used.
834 This may be overridden in the local configuration file,
835 .Pa mdoc.local .
836 In general, the name of the operating system should be the common acronym,
837 e.g.\&
838 .Tn BSD
840 .Tn ATT .
841 The release should be the standard release nomenclature for the system
842 specified.
843 In the following table, the possible second arguments for some predefined
844 operating systems are listed.
845 Similar to
846 .Ql .Dt ,
847 local additions might be defined in
848 .Pa mdoc.local ;
849 look for strings named
850 .Ql operating-system-XXX-YYY ,
851 where
852 .Ql XXX
853 is the acronym for the operating system and
854 .Ql YYY
855 the release ID.
857 .Bd -ragged -compact
858 .Bl -tag -width ".No FreeBSD" -offset indent
859 .It ATT
860 7th, 7, III, 3, V, V.2, V.3, V.4
861 .It BSD
862 3, 4, 4.1, 4.2, 4.3, 4.3t, 4.3T, 4.3r, 4.3R, 4.4
863 .It NetBSD
864 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,
865 1.3, 1.3a, 1.4, 1.5, 1.6
866 .It FreeBSD
867 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,
868 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,
869 4.2, 4.3, 4.4, 4.5, 5.0
875 .Tn ATT ,
876 an unknown second parameter will be replaced with the string
877 .Tn UNIX ;
878 for the other predefined acronyms it will be ignored and a warning message
879 emitted.
880 Unrecognized arguments are displayed as given in the page footer.
881 For instance, a typical footer might be:
883 .Dl .Os BSD 4.3
885 giving
886 .Ql 4.3\~Berkeley Distribution ,
887 or for a locally produced set
889 .Dl .Os CS Department
891 which will produce
892 .Ql CS\~Department .
894 If the
895 .Ql .Os
896 macro is not present, the bottom left corner of the manual page will be
897 ugly.
899 This macro is neither callable nor parsed.
901 .It Li .Dd Oo
902 .Aq month
903 .Aq day ,
904 .Aq year
907 .Ql Dd
908 has no arguments,
909 .Ql Epoch
910 is used for the date string.
911 If it has exactly three arguments, they are concatenated, separated with
912 unbreakable space:
914 .Dl .Dd January 25, 2001
916 Otherwise, the current date is used, ignoring the parameters.
918 This macro is neither callable nor parsed.
922 .Sh "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS"
924 .Ss "What's in a Name" Ns ...
926 The manual domain macro names are derived from the day to day informal
927 language used to describe commands, subroutines and related files.
928 Slightly different variations of this language are used to describe the
929 three different aspects of writing a man page.
930 First, there is the description of
931 .Nm \-mdoc
932 macro command usage.
933 Second is the description of a
935 command
936 .Em with
937 .Nm \-mdoc
938 macros, and third, the description of a command to a user in the verbal
939 sense; that is, discussion of a command in the text of a man page.
941 In the first case,
942 .Xr troff 1
943 macros are themselves a type of command; the general syntax for a troff
944 command is:
946 .Bd -filled -offset indent
947 .Li ".Xx argument1 argument2" ...
951 .Ql .Xx
952 is a macro command, and anything following it are arguments to
953 be processed.
954 In the second case, the description of a
956 command using the content macros is a bit more involved; a typical
957 .Sx SYNOPSIS
958 command line might be displayed as:
960 .Bd -filled -offset indent
961 .Nm filter
962 .Op Fl flag
963 .Ao Ar infile Ac Ao Ar outfile Ac
967 Here,
968 .Nm filter
969 is the command name and the
970 bracketed string
971 .Fl flag
972 is a
973 .Em flag
974 argument designated as optional by the option brackets.
976 .Nm \-mdoc
977 terms,
978 .Ao Ar infile Ac
980 .Ao Ar outfile Ac
981 are called
982 .Em meta arguments ;
983 in this example, the user has to replace the meta expressions given in angle
984 brackets with real file names.
985 Note that in this document meta arguments are used to describe
986 .Nm \-mdoc
987 commands; in most man pages, meta variables are not specifically written
988 with angle brackets.
989 The macros which formatted the above example:
991 .Bd -literal -offset indent
992 \&.Nm filter
993 \&.Op Fl flag
994 \&.Ao Ar infile Ac Ao Ar outfile Ac
998 In the third case, discussion of commands and command syntax includes both
999 examples above, but may add more detail.
1000 The arguments
1001 .Ao Ar infile Ac
1003 .Ao Ar outfile Ac
1004 from the example above might be referred to as
1005 .Em operands
1007 .Em file arguments .
1008 Some command line argument lists are quite long:
1010 .Bd -ragged
1011 .Bl -tag -width ".Nm make" -offset indent -compact
1012 .It Nm make
1013 .Op Fl eiknqrstv
1014 .Op Fl D Ar variable
1015 .Op Fl d Ar flags
1016 .Op Fl f Ar makefile
1017 .Op Fl I Ar directory
1018 .Op Fl j Ar max_jobs
1019 .Op Ar variable Ns = Ns Ar value
1021 .Op Ar target ...
1027 Here one might talk about the command
1028 .Nm make
1029 and qualify the argument,
1030 .Ar makefile ,
1031 as an argument to the flag,
1032 .Fl f ,
1033 or discuss the optional file operand
1034 .Ar target .
1035 In the verbal context, such detail can prevent confusion, however the
1036 .Nm \-mdoc
1037 package does not have a macro for an argument
1038 .Em to
1039 a flag.
1040 Instead the
1041 .Ql \&Ar
1042 argument macro is used for an operand or file argument like
1043 .Ar target
1044 as well as an argument to a flag like
1045 .Ar variable .
1046 The make command line was produced from:
1048 .Bd -literal -offset indent
1049 \&.Nm make
1050 \&.Op Fl eiknqrstv
1051 \&.Op Fl D Ar variable
1052 \&.Op Fl d Ar flags
1053 \&.Op Fl f Ar makefile
1054 \&.Op Fl I Ar directory
1055 \&.Op Fl j Ar max_jobs
1056 \&.Op Ar variable Ns = Ns Ar value
1057 \&.Bk
1058 \&.Op Ar target ...
1059 \&.Ek
1064 .Ql .Bk
1066 .Ql .Ek
1067 macros are explained in
1068 .Sx Keeps .
1070 .Ss "General Syntax"
1072 The manual domain and general text domain macros share a similar syntax with
1073 a few minor deviations; most notably,
1074 .Ql .Ar ,
1075 .Ql .Fl ,
1076 .Ql .Nm ,
1078 .Ql .Pa
1079 differ only when called without arguments; and
1080 .Ql .Fn
1082 .Ql .Xr
1083 impose an order on their argument lists.
1084 All content macros are capable of recognizing and properly handling
1085 punctuation, provided each punctuation character is separated by a leading
1086 space.
1087 If a command is given:
1089 .Dl \&.Ar sptr, ptr),
1091 The result is:
1093 .Dl Ar sptr, ptr),
1095 The punctuation is not recognized and all is output in the
1096 font used by
1097 .Ql .Ar .
1098 If the punctuation is separated by a leading white space:
1100 .Dl \&.Ar "sptr , ptr ) ,"
1102 The result is:
1104 .Dl Ar sptr , ptr ) ,
1106 The punctuation is now recognized and output in the default font
1107 distinguishing it from the argument strings.
1108 To remove the special meaning from a punctuation character escape it with
1109 .Ql \e& .
1111 .Xr Troff
1112 is limited as a macro language, and has difficulty when presented with a
1113 string containing a member of the mathematical, logical or quotation set:
1115 .Bd -literal -offset indent-two
1116 {+,\-,/,*,%,<,>,<=,>=,=,==,&,`,',"}
1120 The problem is that
1121 .Xr troff
1122 may assume it is supposed to actually perform the operation or evaluation
1123 suggested by the characters.
1124 To prevent the accidental evaluation of these characters, escape them with
1125 .Ql \e& .
1126 Typical syntax is shown in the first content macro displayed below,
1127 .Ql .Ad .
1130 .Sh "MANUAL DOMAIN"
1132 .Ss Addresses
1134 The address macro identifies an address construct.
1136 .Dl Usage: .Ad Ao address Ac ...
1138 .Bl -tag -width ".Li .Ad\ f1\ ,\ f2\ ,\ f3\ :" -compact -offset 15n
1139 .It Li ".Ad addr1"
1140 .Ad addr1
1141 .It Li ".Ad addr1 ."
1142 .Ad addr1 .
1143 .It Li ".Ad addr1 , file2"
1144 .Ad addr1 , file2
1145 .It Li ".Ad f1 , f2 , f3 :"
1146 .Ad f1 , f2 , f3 :
1147 .It Li ".Ad addr ) ) ,"
1148 .Ad addr ) ) ,
1152 The default width is 12n.
1154 .Ss "Author Name"
1157 .Ql .An
1158 macro is used to specify the name of the author of the item being
1159 documented, or the name of the author of the actual manual page.
1161 .Dl Usage: .An Ao author name Ac ...
1163 .Bl -tag -width ".Li .An\ \*[q]Joe\ Author\*[q]\ )\ )\ ," -offset 15n
1164 .It Li ".An \*[q]Joe Author\*[q]"
1165 .An "Joe Author"
1166 .It Li ".An \*[q]Joe Author\*[q] ,"
1167 .An "Joe Author" ,
1168 .It Li ".An \*[q]Joe Author\*[q] Aq nobody@FreeBSD.org"
1169 .An "Joe Author" Aq nobody@FreeBSD.org
1170 .It Li ".An \*[q]Joe Author\*[q] ) ) ,"
1171 .An "Joe Author" ) ) ,
1175 The default width is 12n.
1177 In the
1178 .Sx AUTHORS
1179 section, the
1180 .Ql .An
1181 command causes a line break allowing each new name to appear on its own
1182 line.
1183 If this is not desirable,
1185 .Bd -literal -offset indent
1186 \&.An -nosplit
1190 call will turn this off.
1191 To turn splitting back on, write
1193 .Bd -literal -offset indent
1194 \&.An -split
1197 .Ss "Arguments"
1200 .Li .Ar
1201 argument macro may be used whenever an argument is referenced.
1202 If called without arguments, the
1203 .Sq Ar
1204 string is output.
1206 .Dl Usage: .Ar Oo Ao argument Ac Oc ...
1208 .Bl -tag -width ".Li .Ar\ file1\ file2" -compact -offset 15n
1209 .It Li .Ar
1211 .It Li ".Ar file1"
1212 .Ar file1
1213 .It Li ".Ar file1 ."
1214 .Ar file1 .
1215 .It Li ".Ar file1 file2"
1216 .Ar file1 file2
1217 .It Li ".Ar f1 f2 f3 :"
1218 .Ar f1 f2 f3 :
1219 .It Li ".Ar file ) ) ,"
1220 .Ar file ) ) ,
1224 The default width is 12n.
1226 .Ss "Configuration Declaration (Section Four Only)"
1229 .Ql .Cd
1230 macro is used to demonstrate a
1231 .Xr config 8
1232 declaration for a device interface in a section four manual.
1234 .Dl Usage: .Cd Ao argument Ac ...
1236 .Bl -tag -width ".Li .Cd\ Xdevice\ le0\ at\ scode?X" -offset 15n
1237 .It Li ".Cd \*[q]device le0 at scode?\*[q]"
1238 .Cd "device le0 at scode?"
1241 In the
1242 .Sx SYNOPSIS
1243 section a
1244 .Ql .Cd
1245 command causes a line break before and after its arguments are printed.
1248 The default width is 12n.
1250 .Ss "Command Modifiers"
1252 The command modifier is identical to the
1253 .Ql .Fl
1254 (flag) command with the exception that the
1255 .Ql .Cm
1256 macro does not assert a dash in front of every argument.
1257 Traditionally flags are marked by the preceding dash, however, some commands
1258 or subsets of commands do not use them.
1259 Command modifiers may also be specified in conjunction with interactive
1260 commands such as editor commands.
1262 .Sx Flags .
1264 The default width is 10n.
1266 .Ss "Defined Variables"
1268 A variable (or constant) which is defined in an include file
1269 is specified by the macro
1270 .Ql .Dv .
1272 .Dl Usage: .Dv Ao defined variable Ac ...
1274 .Bl -tag -width ".Li .Dv\ MAXHOSTNAMELEN" -compact -offset 15n
1275 .It Li ".Dv MAXHOSTNAMELEN"
1276 .Dv MAXHOSTNAMELEN
1277 .It Li ".Dv TIOCGPGRP )"
1278 .Dv TIOCGPGRP )
1282 The default width is 12n.
1284 .Ss Errno's
1287 .Ql .Er
1288 errno macro specifies the error return value for section 2, 3, and\~9 library
1289 routines.
1290 The second example below shows
1291 .Ql .Er
1292 used with the
1293 .Ql .Bq
1294 general text domain macro, as it would be used in a section two manual page.
1296 .Dl Usage: .Er Ao errno type Ac ...
1298 .Bl -tag -width ".Li .Bq\ Er\ ENOTDIR" -compact -offset 15n
1299 .It Li ".Er ENOENT"
1300 .Er ENOENT
1301 .It Li ".Er ENOENT ) ;"
1302 .Er ENOENT ) ;
1303 .It Li ".Bq Er ENOTDIR"
1304 .Bq Er ENOTDIR
1308 The default width is 17n.
1310 .Ss "Environment Variables"
1313 .Ql .Ev
1314 macro specifies an environment variable.
1316 .Dl Usage: .Ev Ao argument Ac ...
1318 .Bl -tag -width ".Li .Ev\ PRINTER\ )\ )\ ," -compact -offset 15n
1319 .It Li ".Ev DISPLAY"
1320 .Ev DISPLAY
1321 .It Li ".Ev PATH ."
1322 .Ev PATH .
1323 .It Li ".Ev PRINTER ) ) ,"
1324 .Ev PRINTER ) ) ,
1328 The default width is 15n.
1330 .Ss Flags
1333 .Ql .Fl
1334 macro handles command line flags.
1335 It prepends a dash,
1336 .Ql \- ,
1337 to the flag.
1338 For interactive command flags, which are not prepended with a dash, the
1339 .Ql .Cm
1340 (command modifier)
1341 macro is identical, but without the dash.
1343 .Dl Usage: .Fl Ao argument Ac ...
1345 .Bl -tag -width ".Li .Fl\ xyz\ )\ ," -compact -offset 15n
1346 .It Li .Fl
1348 .It Li ".Fl cfv"
1349 .Fl cfv
1350 .It Li ".Fl cfv ."
1351 .Fl cfv .
1352 .It Li ".Cm cfv ."
1353 .Cm cfv .
1354 .It Li ".Fl s v t"
1355 .Fl s v t
1356 .It Li ".Fl \- ,"
1357 .Fl \- ,
1358 .It Li ".Fl xyz ) ,"
1359 .Fl xyz ) ,
1360 .It Li ".Fl |"
1361 .Fl |
1365 .Ql .Fl
1366 macro without any arguments results in a dash representing stdin/stdout.
1367 Note that giving
1368 .Ql .Fl
1369 a single dash will result in two dashes.
1371 The default width is 12n.
1373 .Ss "Function Declarations"
1376 .Ql .Fd
1377 macro is used in the
1378 .Sx SYNOPSIS
1379 section with section two or three functions.
1380 It is neither callable nor parsed.
1382 .Dl Usage: .Fd Ao argument Ac ...
1384 .Bl -tag -width ".Li .Fd\ X#include\ <sys/types.h>X" -compact -offset 15n
1385 .It Li ".Fd \*[q]#include <sys/types.h>\*[q]"
1386 .Fd "#include <sys/types.h>"
1389 In the
1390 .Sx SYNOPSIS
1391 section a
1392 .Ql .Fd
1393 command causes a line break if a function has already been presented and a
1394 break has not occurred.
1395 This leaves a nice vertical space in between the previous function call and
1396 the declaration for the next function.
1400 .Ql .In
1401 .Li ( #include
1402 statement)
1403 macro is the short form of the above example.
1404 It specifies the C\~header file as being included in a C\~program.
1405 It also causes a line break, and is neither callable nor parsed.
1407 .Dl Usage: .In Ao header file Ac
1409 .Bl -tag -width ".Li .In\ stdio.h" -compact -offset 15n
1410 .It Li ".In stdio.h"
1411 .In stdio.h
1414 .Ss "Function Types"
1416 This macro is intended for the
1417 .Sx SYNOPSIS
1418 section.
1419 It may be used anywhere else in the man page without problems, but its main
1420 purpose is to present the function type in kernel normal form for the
1421 .Sx SYNOPSIS
1422 of sections two and three (it causes a line break, allowing the function
1423 name to appear on the next line).
1425 .Dl Usage: .Ft Ao type Ac ...
1427 .Bl -tag -width ".Li .Ft\ struct\ stat" -compact -offset 15n
1428 .It Li ".Ft struct stat"
1429 .Ft struct stat
1432 .Ss "Functions (Library Routines)"
1434 The 
1435 .Ql .Fn
1436 macro is modeled on
1437 .Tn ANSI\~C
1438 conventions.
1440 .Dl Usage: .Fn Ao function Ac Oo Ao parameter Ac Oc ...
1442 .Bl -tag -width ".Li .Fn\ align\ Xchar\ *ptrX\ ," -compact -offset 15n
1443 .It Li ".Fn getchar"
1444 .Fn getchar
1445 .It Li ".Fn strlen ) ,"
1446 .Fn strlen ) ,
1447 .It Li ".Fn align \*[q]char *ptr\*[q] ,"
1448 .Fn align "char *ptr" ,
1451 Note that any call to another macro signals the end of the
1452 .Ql .Fn
1453 call (it will insert a closing parenthesis at that point).
1455 For functions with many parameters (which is rare), the macros
1456 .Ql .Fo
1457 (function open)
1459 .Ql .Fc
1460 (function close)
1461 may be used with
1462 .Ql .Fa
1463 (function argument).
1465 Example:
1467 .Bd -literal -offset indent
1468 \&.Ft int
1469 \&.Fo res_mkquery
1470 \&.Fa "int op"
1471 \&.Fa "char *dname"
1472 \&.Fa "int class"
1473 \&.Fa "int type"
1474 \&.Fa "char *data"
1475 \&.Fa "int datalen"
1476 \&.Fa "struct rrec *newrr"
1477 \&.Fa "char *buf"
1478 \&.Fa "int buflen"
1479 \&.Fc
1483 Produces:
1485 .Bd -ragged -offset indent
1486 .Ft int
1487 .Fo res_mkquery
1488 .Fa "int op"
1489 .Fa "char *dname"
1490 .Fa "int class"
1491 .Fa "int type"
1492 .Fa "char *data"
1493 .Fa "int datalen"
1494 .Fa "struct rrec *newrr"
1495 .Fa "char *buf"
1496 .Fa "int buflen"
1501 In the
1502 .Sx SYNOPSIS
1503 section, the function will always begin at the beginning of line.
1504 If there is more than one function presented in the
1505 .Sx SYNOPSIS
1506 section and a function type has not been given, a line break will occur,
1507 leaving a nice vertical space between the current function name and the one
1508 prior.
1510 The default width values of
1511 .Ql .Fn
1513 .Ql .Fo
1514 are 12n and 16n, respectively.
1516 .Ss "Function Arguments"
1519 .Ql .Fa
1520 macro is used to refer to function arguments (parameters) outside of the
1521 .Sx SYNOPSIS
1522 section of the manual or inside the
1523 .Sx SYNOPSIS
1524 section if the enclosure macros
1525 .Ql .Fo
1527 .Ql .Fc
1528 instead of
1529 .Ql .Fn
1530 are used.
1531 .Ql .Fa
1532 may also be used to refer to structure members.
1534 .Dl Usage: .Fa Ao function argument Ac ...
1536 .Bl -tag -width ".Li .Fa\ d_namlen\ )\ )\ ," -compact -offset 15n
1537 .It Li ".Fa d_namlen ) ) ,"
1538 .Fa d_namlen ) ) ,
1539 .It Li ".Fa iov_len"
1540 .Fa iov_len
1544 The default width is 12n.
1546 .Ss "Return Values"
1549 .Ql .Rv
1550 macro generates text for use in the
1551 .Sx RETURN VALUES
1552 section.
1554 .Dl Usage: .Rv Oo -std Oc Op Ao function Ac ...
1556 For example,
1557 .Ql ".Rv -std atexit"
1558 produces:
1560 .Bd -ragged -offset -indent
1561 \# a small hack to suppress a warning message
1562 .ds section-old "\*[section]
1563 .ds section 3
1564 .Rv -std atexit
1565 .ds section "\*[section-old]
1570 .Fl std
1571 option is valid only for manual page sections\~2 and\~3.
1572 Currently, this macro does nothing if used without the
1573 .Fl std
1574 flag.
1576 .Ss "Exit Status"
1579 .Ql .Ex
1580 macro generates text for use in the
1581 .Sx DIAGNOSTICS
1582 section.
1584 .Dl Usage: .Ex Oo -std Oc Op Ao utility Ac ...
1586 For example,
1587 .Ql ".Ex -std cat"
1588 produces:
1590 .Bd -ragged -offset -indent
1591 \# a small hack to suppress a warning message
1592 .ds section-old "\*[section]
1593 .ds section 1
1594 .Ex -std cat
1595 .ds section "\*[section-old]
1600 .Fl std
1601 option is valid only for manual page sections 1, 6 and\~8.
1602 Currently, this macro does nothing if used without the
1603 .Fl std
1604 flag.
1606 .Ss "Interactive Commands"
1609 .Ql .Ic
1610 macro designates an interactive or internal command.
1612 .Dl Usage: .Ic Ao argument Ac ...
1614 .Bl -tag -width ".Li .Ic\ setenv\ ,\ unsetenv" -compact -offset 15n
1615 .It Li ".Ic :wq"
1616 .Ic :wq
1617 .It Li ".Ic \*[q]do while {...}\*[q]"
1618 .Ic "do while {...}"
1619 .It Li ".Ic setenv , unsetenv"
1620 .Ic setenv , unsetenv
1624 The default width is 12n.
1626 .Ss "Library Names"
1629 .Ql .Lb
1630 macro is used to specify the library where a particular function is compiled
1633 .Dl Usage: .Lb Ao argument Ac ...
1635 Available arguments to
1636 .Ql .Lb 
1637 and their results are:
1640 .Bl -tag -width ".Li libossaudio" -compact -offset indent
1641 .It Li libarm32
1642 .Lb libarm32
1643 .It Li libc
1644 .Lb libc
1645 .It Li libcompat
1646 .Lb libcompat
1647 .It Li libcrypt
1648 .Lb libcrypt
1649 .It Li libcurses
1650 .Lb libcurses
1651 .It Li libedit
1652 .Lb libedit
1653 .It Li libi386
1654 .Lb libi386
1655 .It Li libipsec
1656 .Lb libipsec
1657 .It Li libkvm
1658 .Lb libkvm
1659 .It Li libm
1660 .Lb libm
1661 .It Li libmenu
1662 .Lb libmenu
1663 .It Li libossaudio
1664 .Lb libossaudio
1665 .It Li libposix
1666 .Lb libposix
1667 .It Li libresolv
1668 .Lb libresolv
1669 .It Li libtermcap
1670 .Lb libtermcap
1671 .It Li libutil
1672 .Lb libutil
1673 .It Li libz
1674 .Lb libz
1678 Local, OS-specific additions might be found in the file
1679 .Pa mdoc.local ;
1680 look for strings named
1681 .Ql str-Lb-XXX .
1682 .Ql XXX
1683 then denotes the keyword to be used with the
1684 .Ql .Lb
1685 macro.
1687 .Ss Literals
1690 .Ql .Li
1691 literal macro may be used for special characters, variable constants, etc.\&
1692 -- anything which should be displayed as it would be typed.
1694 .Dl Usage: .Li Ao argument Ac ...
1696 .Bl -tag -width ".Li .Li\ cntrl-D\ )\ ,"  -compact -offset 15n
1697 .It Li ".Li \een"
1698 .Li \en
1699 .It Li ".Li M1 M2 M3 ;"
1700 .Li M1 M2 M3 ;
1701 .It Li ".Li cntrl-D ) ,"
1702 .Li cntrl-D ) ,
1703 .It Li ".Li 1024 ..."
1704 .Li 1024 ...
1708 The default width is 16n.
1710 .Ss Names
1713 .Ql .Nm
1714 macro is used for the document title or subject name.
1715 It has the peculiarity of remembering the first argument it was called with,
1716 which should always be the subject name of the page.
1717 When called without arguments,
1718 .Ql .Nm
1719 regurgitates this initial name for the sole purpose of making less work for
1720 the author.
1721 Note: A section two or three document function name is addressed with the
1722 .Ql .Nm
1723 in the
1724 .Sx NAME
1725 section, and with
1726 .Ql .Fn
1727 in the
1728 .Sx SYNOPSIS
1729 and remaining sections.
1730 For interactive commands, such as the
1731 .Ql while
1732 command keyword in
1733 .Xr csh 1 ,
1735 .Ql .Ic
1736 macro should be used.
1737 While
1738 .Ql .Ic
1739 is nearly identical
1741 .Ql .Nm ,
1742 it can not recall the first argument it was invoked with.
1744 .Dl Usage: .Nm Oo Ao argument Ac Oc ...
1746 .Bl -tag -width ".Li .Nm\ groff_mdoc" -compact -offset 15n
1747 .It Li ".Nm groff_mdoc"
1748 .Nm groff_mdoc
1749 .It Li ".Nm \e-mdoc"
1750 .Nm \-mdoc
1751 .It Li ".Nm foo ) ) ,"
1752 .Nm foo ) ) ,
1753 .It Li ".Nm :"
1754 .Nm :
1758 The default width is 10n.
1760 .Ss Options
1763 .Ql .Op
1764 macro places option brackets around any remaining arguments on the
1765 command line, and places any trailing punctuation outside the brackets.
1766 The macros
1767 .Ql .Oo
1769 .Ql .Oc
1770 (which produce an opening and a closing option bracket respectively) may be used
1771 across one or more lines or to specify the exact position of the closing
1772 parenthesis.
1774 .Dl Usage: .Op Oo Ao option Ac Oc ...
1776 .Bl -tag -width ".Li .Op\ Fl\ c\ Ar\ objfil\ Op\ Ar\ corfil\ ," -compact -offset 15n
1777 .It Li .Op
1779 .It Li ".Op Fl k"
1780 .Op Fl k
1781 .It Li ".Op Fl k ) ."
1782 .Op Fl k ) .
1783 .It Li ".Op Fl k Ar kookfile"
1784 .Op Fl k Ar kookfile
1785 .It Li ".Op Fl k Ar kookfile ,"
1786 .Op Fl k Ar kookfile ,
1787 .It Li ".Op Ar objfil Op Ar corfil"
1788 .Op Ar objfil Op Ar corfil
1789 .It Li ".Op Fl c Ar objfil Op Ar corfil ,"
1790 .Op Fl c Ar objfil Op Ar corfil ,
1791 .It Li ".Op word1 word2"
1792 .Op word1 word2
1793 .It Li ".Li .Op Oo Ao option Ac Oc ..."
1794 .Li .Op Oo Ao options Ac Oc ...
1797 Here a typical example of the
1798 .Ql .Oo
1800 .Ql .Oc
1801 macros:
1803 .Bd -literal -offset indent
1804 \&.Oo
1805 \&.Op Fl k Ar kilobytes
1806 \&.Op Fl i Ar interval
1807 \&.Op Fl c Ar count
1808 \&.Oc
1812 Produces:
1814 .Bd -filled -offset indent
1816 .Op Fl k Ar kilobytes
1817 .Op Fl i Ar interval
1818 .Op Fl c Ar count
1823 The default width values of
1824 .Ql .Op
1826 .Ql .Oo
1827 are 14n and 10n, respectively.
1829 .Ss Pathnames
1832 .Ql .Pa
1833 macro formats path or file names.
1834 If called without arguments, the
1835 .Sq Pa
1836 string is output, which represents the current user's home directory.
1838 .Dl Usage: .Pa Oo Ao pathname Ac Oc ...
1840 .Bl -tag -width ".Li .Pa\ /tmp/fooXXXXX\ )\ ." -compact -offset 15n
1841 .It Li .Pa
1843 .It Li ".Pa /usr/share"
1844 .Pa /usr/share
1845 .It Li ".Pa /tmp/fooXXXXX ) ."
1846 .Pa /tmp/fooXXXXX ) .
1850 The default width is 32n.
1852 .Ss Standards
1855 .Ql .St
1856 macro replaces standard abbreviations with their formal names.
1858 .Dl Usage: .St Ao abbreviation Ac ...
1860 Available pairs for
1861 .Dq Abbreviation/Formal Name
1862 are:
1865 .Tn ANSI/ISO C
1867 .Bl -tag -width ".Li -iso9945-1-90" -compact -offset indent
1868 .It Li -ansiC
1869 .St -ansiC
1870 .It Li -ansiC-89
1871 .St -ansiC-89
1872 .It Li -isoC
1873 .St -isoC
1874 .It Li -isoC-99
1875 .St -isoC-99
1879 .Tn POSIX
1880 Part 1: System API
1882 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1883 .It Li -iso9945-1-90
1884 .St -iso9945-1-90
1885 .It Li -iso9945-1-96
1886 .St -iso9945-1-96
1887 .It Li -p1003.1
1888 .St -p1003.1
1889 .It Li -p1003.1-88
1890 .St -p1003.1-88
1891 .It Li -p1003.1-90
1892 .St -p1003.1-90
1893 .It Li -p1003.1-96
1894 .St -p1003.1-96
1895 .It Li -p1003.1b-93
1896 .St -p1003.1b-93
1897 .It Li -p1003.1c-95
1898 .St -p1003.1c-95
1899 .It Li -p1003.1g-2000
1900 .St -p1003.1g-2000
1901 .It Li -p1003.1i-95
1902 .St -p1003.1i-95
1906 .Tn POSIX
1907 Part 2: Shell and Utilities
1909 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1910 .It Li -iso9945-2-93
1911 .St -iso9945-2-93
1912 .It Li -p1003.2
1913 .St -p1003.2
1914 .It Li -p1003.2-92
1915 .St -p1003.2-92
1916 .It Li -p1003.2a-92
1917 .St -p1003.2a-92
1921 X/Open
1922 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1924 .It Li -susv2
1925 .St -susv2
1926 .It Li -svid4
1927 .St -svid4
1928 .It Li -xbd5
1929 .St -xbd5
1930 .It Li -xcu5
1931 .St -xcu5
1932 .It Li -xcurses4.2
1933 .St -xcurses4.2
1934 .It Li -xns5
1935 .St -xns5
1936 .It Li -xns5.2
1937 .St -xns5.2
1938 .It Li -xpg3
1939 .St -xpg3
1940 .It Li -xpg4
1941 .St -xpg4
1942 .It Li -xpg4.2
1943 .St -xpg4.2
1944 .It Li -xsh5
1945 .St -xsh5
1949 Miscellaneous
1951 .Bl -tag -width ".Li -p1003.1g-2000" -compact -offset indent
1952 .It Li -ieee754
1953 .St -ieee754
1954 .It Li -iso8802-3
1955 .St -iso8802-3
1958 .Ss "Variable Types"
1961 .Ql .Vt
1962 macro may be used whenever a type is referenced.
1963 In the
1964 .Sx SYNOPSIS
1965 section, it causes a line break (useful for old style variable declarations).
1967 .Dl Usage: .Vt Ao type Ac ...
1969 .Bl -tag -width ".Li .Vt\ extern\ char\ *optarg\ ;" -compact -offset 15n
1970 .It Li ".Vt extern char *optarg ;"
1971 .Vt extern char *optarg ;
1972 .It Li ".Vt FILE *"
1973 .Vt FILE *
1976 .Ss Variables
1978 Generic variable reference.
1980 .Dl Usage: .Va Ao variable Ac ...
1982 .Bl -tag -width ".Li .Va\ Xchar\ sX\ ]\ )\ )\ ," -compact -offset 15n
1983 .It Li ".Va count"
1984 .Va count
1985 .It Li ".Va settimer ,"
1986 .Va settimer ,
1987 .It Li ".Va \*[q]int *prt\*[q] ) :"
1988 .Va "int *prt" ) :
1989 .It Li ".Va \*[q]char s\*[q] ] ) ) ,"
1990 .Va "char s" ] ) ) ,
1994 The default width is 12n.
1996 .Ss "Manual Page Cross References"
1999 .Ql .Xr
2000 macro expects the first argument to be a manual page name.
2001 The optional second argument, if a string (defining the manual section), is
2002 put into parentheses.
2004 .Dl Usage: .Xr Ao man page name Ac Oo Ao section Ac Oc ...
2006 .Bl -tag -width ".Li .Xr\ xinit\ 1x\ ;" -compact -offset 15n
2007 .It Li ".Xr mdoc"
2008 .Xr mdoc
2009 .It Li ".Xr mdoc ,"
2010 .Xr mdoc ,
2011 .It Li ".Xr mdoc 7"
2012 .Xr mdoc 7
2013 .It Li ".Xr xinit 1x ;"
2014 .Xr xinit 1x ;
2018 The default width is 10n.
2021 .Sh "GENERAL TEXT DOMAIN"
2023 .Ss "AT&T Macro"
2026 .Dl Usage: .At Oo Ao version Ac Oc ...
2028 .Bl -tag -width ".Li .At\ v6\ ." -compact -offset 15n
2029 .It Li .At
2031 .It Li ".At v6 ."
2032 .At v6 .
2035 The following values for
2036 .Ao version Ac
2037 are possible:
2039 .Dl 32v, v1, v2, v3, v4, v5, v6, v7, V, V.1, V.2, V.3, V.4
2041 .Ss "BSD Macro"
2044 .Dl "Usage: .Bx" Bro -alpha | -beta | -devel Brc ...
2045 .Dl "       .Bx" Oo Ao version Ac Oo Ao release Ac Oc Oc ...
2047 .Bl -tag -width ".Li .Bx\ -devel" -compact -offset 15n
2048 .It Li .Bx
2050 .It Li ".Bx 4.3 ."
2051 .Bx 4.3 .
2052 .It Li ".Bx \-devel"
2053 .Bx -devel
2056 .Ao version Ac
2057 will be prepended to the string
2058 .Sq Bx .
2059 The following values for
2060 .Ao release Ac
2061 are possible:
2063 .Dl Reno, reno, Tahoe, tahoe, Lite, lite, Lite2, lite2
2065 .Ss "NetBSD Macro"
2068 .Dl Usage: .Nx Oo Ao version Ac Oc ...
2070 .Bl -tag -width ".Li .Nx\ 1.4\ ." -compact -offset 15n
2071 .It Li .Nx
2073 .It Li ".Nx 1.4 ."
2074 .Nx 1.4 .
2077 For possible values of
2078 .Ao version Ac
2079 see the description of the
2080 .Ql .Os
2081 command above in section
2082 .Sx "TITLE MACROS" .
2084 .Ss "FreeBSD Macro"
2087 .Dl Usage: .Fx Oo Ao version Ac Oc ...
2089 .Bl -tag -width ".Li .Fx\ 2.2\ ." -compact -offset 15n
2090 .It Li .Fx
2092 .It Li ".Fx 2.2 ."
2093 .Fx 2.2 .
2096 For possible values of
2097 .Ao version Ac
2098 see the description of the
2099 .Ql .Os
2100 command above in section
2101 .Sx "TITLE MACROS" .
2103 .Ss "OpenBSD Macro"
2106 .Dl Usage: .Ox Oo Ao version Ac Oc ...
2108 .Bl -tag -width ".Li .Ox\ 1.0" -compact -offset 15n
2109 .It Li ".Ox 1.0"
2110 .Ox 1.0
2113 .Ss "BSD/OS Macro"
2116 .Dl Usage: .Bsx Oo Ao version Ac Oc ...
2118 .Bl -tag -width ".Li .Bsx\ 1.0" -compact -offset 15n
2119 .It Li ".Bsx 1.0"
2120 .Bsx 1.0
2123 .Ss "UNIX Macro"
2126 .Dl Usage: .Ux ...
2128 .Bl -tag -width ".Li .Ux" -compact -offset 15n
2129 .It Li .Ux
2133 .Ss "Emphasis Macro"
2135 Text may be stressed or emphasized with the
2136 .Ql .Em
2137 macro.
2138 The usual font for emphasis is italic.
2140 .Dl Usage: .Em Ao argument Ac ...
2142 .Bl -tag -width ".Li .Em\ vide\ infra\ )\ )\ ," -compact -offset 15n
2143 .It Li ".Em does not"
2144 .Em does not
2145 .It Li ".Em exceed 1024 ."
2146 .Em exceed 1024 .
2147 .It Li ".Em vide infra ) ) ,"
2148 .Em vide infra ) ) ,
2152 The default width is 10n.
2154 .Ss "Font Mode"
2157 .Ql .Bf
2158 font mode must be ended with the
2159 .Ql .Ef
2160 macro (the latter takes no arguments).
2161 Font modes may be nested within other font modes.
2163 .Ql .Bf
2164 has the following syntax:
2166 .Dl .Bf Ao font mode Ac
2168 .Ao font mode Ac
2169 must be one of the following three types:
2171 .Bl -tag -width ".Sy \&Sy | Fl symbolic" -compact -offset indent
2172 .It Sy \&Em | Fl emphasis
2173 Same as if the 
2174 .Ql .Em
2175 macro was used for the entire block of text.
2176 .It Sy \&Li | Fl literal
2177 Same as if the
2178 .Ql .Li
2179 macro was used for the entire block of text.
2180 .It Sy \&Sy | Fl symbolic
2181 Same as if the
2182 .Ql .Sy
2183 macro was used for the entire block of text.
2186 Both macros are neither callable nor parsed.
2188 .Ss "Enclosure and Quoting Macros"
2190 The concept of enclosure is similar to quoting.
2191 The object being to enclose one or more strings between a pair of characters
2192 like quotes or parentheses.
2193 The terms quoting and enclosure are used interchangeably throughout this
2194 document.
2195 Most of the one-line enclosure macros end in small letter
2196 .Ql q
2197 to give a hint of quoting, but there are a few irregularities.
2198 For each enclosure macro there is also a pair of open and close macros which
2199 end in small letters
2200 .Ql o
2202 .Ql c
2203 respectively.
2205 \# XXX
2206 .if t \
2207 .  ne 10
2209 .Bd -filled -offset 4n
2210 .Bl -column "quote" "close" "open" "Angle Bracket Enclosure" "`string' or string"
2211 .Em Quote Ta Em Open Ta Em Close Ta Em Function               Ta Em Result
2212 .No .Aq   Ta    .Ao  Ta    .Ac   Ta "Angle Bracket Enclosure" Ta Ao string Ac
2213 .No .Bq   Ta    .Bo  Ta    .Bc   Ta "Bracket Enclosure"       Ta Bo string Bc
2214 .No .Brq  Ta    .Bro Ta    .Brc  Ta "Brace Enclosure"         Ta Bro string Brc
2215 .No .Dq   Ta    .Do  Ta    .Dc   Ta "Double Quote"            Ta Do string Dc
2216 .No .Eq   Ta    .Eo  Ta    .Ec   Ta "Enclose String (in XX)"  Ta XXstringXX
2217 .No .Pq   Ta    .Po  Ta    .Pc   Ta "Parenthesis Enclosure"   Ta Po string Pc
2218 .No .Ql   Ta         Ta          Ta "Quoted Literal"          Ta So string Sc or Li string
2219 .No .Qq   Ta    .Qo  Ta    .Qc   Ta "Straight Double Quote"   Ta Qo string Qc
2220 .No .Sq   Ta    .So  Ta    .Sc   Ta "Single Quote"            Ta So string Sc
2224 All macros ending with
2225 .Sq q
2227 .Sq o
2228 have a default width value of 12n.
2230 .Bl -tag -width ".Li .Ec , .Eo"
2231 .It Li .Eo , .Ec
2232 These macros expect the first argument to be the opening and closing strings
2233 respectively.
2234 .It Li .Es , .En
2235 Due to the nine-argument limit in the original troff program two other
2236 macros have been implemented which are now rather obsolete:
2237 .Ql .Es
2238 takes the first and second parameter as the left and right enclosure string,
2239 which are then used to enclose the arguments of
2240 .Ql .En .
2241 The default width value is 12n for both macros.
2242 .It Li .Eq
2243 The first and second arguments of this macro are the opening and
2244 closing strings respectively, followed by the arguments to be enclosed.
2245 .It Li .Ql
2246 The quoted literal macro behaves differently in troff and nroff mode.
2247 If formatted with
2248 .Xr nroff ,
2249 a quoted literal is always quoted.
2250 If formatted with troff, an item is only quoted if the width of the item is
2251 less than three constant width characters.
2252 This is to make short strings more visible where the font change to literal
2253 (constant width) is less noticeable.
2255 The default width is 16n.
2256 .It Li .Pf
2257 The prefix macro suppresses the whitespace between its first and second
2258 argument:
2260 .Bl -tag -width ".Li .Pf\ (\ Fa\ name2" -offset indent
2261 .It Li ".Pf ( Fa name2"
2262 .Pf ( Fa name2
2266 The default width is 12n.
2269 .Ql .Ns
2270 macro (see below) performs the analogous suffix function.
2271 .It Li .Ap
2273 .Ql .Ap
2274 macro inserts an apostrophe and exits any special text modes, continuing in
2275 .Ql .No
2276 mode.
2280 Examples of quoting:
2283 .Bl -tag -width ".Li .Bq\ Em\ Greek\ ,\ French\ ." -compact -offset indent
2284 .It Li .Aq
2286 .It Li ".Aq Pa ctype.h ) ,"
2287 .Aq Pa ctype.h ) ,
2288 .It Li .Bq
2290 .It Li ".Bq Em Greek , French ."
2291 .Bq Em Greek , French .
2292 .It Li .Dq
2294 .It Li ".Dq string abc ."
2295 .Dq string abc .
2296 .It Li ".Dq \'^[A-Z]\'"
2297 .Dq \'^[A-Z]\'
2298 .It Li ".Ql man mdoc"
2299 .Ql man mdoc
2300 .It Li .Qq
2302 .It Li ".Qq string ) ,"
2303 .Qq string ) ,
2304 .It Li ".Qq string Ns ),"
2305 .Qq string Ns ),
2306 .It Li .Sq
2308 .It Li ".Sq string"
2309 .Sq string
2310 .It Li ".Em or Ap ing"
2311 .Em or Ap ing
2315 For a good example of nested enclosure macros, see the
2316 .Ql .Op
2317 option macro.
2318 It was created from the same underlying enclosure macros as those presented
2319 in the list above.
2321 .Ql .Xo
2323 .Ql .Xc
2324 extended argument list macros are discussed below.
2326 .Ss "No-Op or Normal Text Macro"
2329 .Ql .No
2330 macro can be used in a macro command line for parameters which should
2331 .Em not
2332 be formatted.
2333 Be careful to add
2334 .Ql \e&
2335 to the word
2336 .Ql \&No
2337 if you really want that English word (and not the macro) as a parameter.
2339 .Dl Usage: .No Ao argument Ac ...
2341 .Bl -tag -width ".Li .No\ test\ Ta\ with\ Ta\ tabs" -compact -offset 15n
2342 .It Li ".No test Ta with Ta tabs"
2343 .No test Ta with Ta tabs
2347 The default width is 12n.
2349 .Ss "No-Space Macro"
2352 .Ql .Ns
2353 macro suppresses insertion of a space between the current position and its
2354 first parameter.
2355 For example, it is useful for old style argument lists where there is no
2356 space between the flag and argument:
2358 .Dl "Usage:" ... Ao argument Ac \&Ns Oo Ao argument Ac Oc ...
2359 .Dl "      " .Ns Ao argument Ac ...
2361 .Bl -tag -width ".Li .Op\ Fl\ I\ Ns\ Ar\ directory" -compact -offset 15n
2362 .It Li ".Op Fl I Ns Ar directory"
2363 .Op Fl I Ns Ar directory
2366 Note: The
2367 .Ql .Ns
2368 macro always invokes the
2369 .Ql .No
2370 macro after eliminating the space unless another macro name follows it.
2371 If used as a command (i.e., the second form above in the
2372 .Sq Usage
2373 line),
2374 .Ql .Ns
2375 is identical to
2376 .Ql .No .
2378 .Ss "Section Cross References"
2381 .Ql .Sx
2382 macro designates a reference to a section header within the same document.
2384 .Dl Usage: .Sx Ao section reference Ac ...
2386 .Bl -tag -width ".Li .Sx\ FILES" -offset 15n
2387 .It Li ".Sx FILES"
2388 .Sx FILES
2392 The default width is 16n.
2394 .Ss Symbolics
2396 The symbolic emphasis macro is generally a boldface macro in either the
2397 symbolic sense or the traditional English usage.
2399 .Dl Usage: .Sy Ao symbol Ac ...
2401 .Bl -tag -width ".Li .Sy\ Important\ Notice" -compact -offset 15n
2402 .It Li ".Sy Important Notice"
2403 .Sy Important Notice
2407 The default width is 6n.
2409 .Ss Mathematical Symbols
2411 Use this macro for mathematical symbols and similar things.
2413 .Dl Usage: .Ms Ao math symbol Ac ...
2415 .Bl -tag -width ".Li .Ms\ sigma" -compact -offset 15n
2416 .It Li ".Ms sigma"
2417 .Ms sigma
2421 The default width is 6n.
2423 .Ss "References and Citations"
2425 The following macros make a modest attempt to handle references.
2426 At best, the macros make it convenient to manually drop in a subset of
2427 .Xr refer 1
2428 style references.
2430 .Bl -tag -width 6n -offset indent -compact
2431 .It Li .Rs
2432 Reference start (does not take arguments).
2433 Causes a line break in the
2434 .Sx "SEE ALSO"
2435 section and begins collection of reference information until the reference
2436 end macro is read.
2437 .It Li .Re
2438 Reference end (does not take arguments).
2439 The reference is printed.
2440 .It Li .%A
2441 Reference author name; one name per invocation.
2442 .It Li .%B
2443 Book title.
2444 .It Li .%C
2445 City/place (not implemented yet).
2446 .It Li .%D
2447 Date.
2448 .It Li .%I
2449 Issuer/publisher name.
2450 .It Li .%J
2451 Journal name.
2452 .It Li .%N
2453 Issue number.
2454 .It Li .%O
2455 Optional information.
2456 .It Li .%P
2457 Page number.
2458 .It Li .%Q
2459 Corporate or foreign author.
2460 .It Li .%R
2461 Report name.
2462 .It Li .%T
2463 Title of article.
2464 .It Li .%V
2465 Volume.
2468 Macros beginning with
2469 .Ql %
2470 are not callable but accept multiple arguments in the usual way.
2471 Only the
2472 .Ql .Tn
2473 macro is handled properly as a parameter; other macros will cause strange
2474 output.
2475 .Ql .%B
2477 .Ql .%T
2478 can be used outside of the
2479 .Ql .Rs/.Re
2480 environment.
2482 Example:
2484 .Bd -literal -offset indent
2485 \&.Rs
2486 \&.%A "Matthew Bar"
2487 \&.%A "John Foo"
2488 \&.%T "Implementation Notes on foobar(1)"
2489 \&.%R "Technical Report ABC-DE-12-345"
2490 \&.%Q "Drofnats College, Nowhere"
2491 \&.%D "April 1991"
2492 \&.Re
2495 produces
2497 .Bd -ragged -offset indent
2499 .%A "Matthew Bar"
2500 .%A "John Foo"
2501 .%T "Implementation Notes on foobar(1)"
2502 .%R "Technical Report ABC-DE-12-345"
2503 .%Q "Drofnats College, Nowhere"
2504 .%D "April 1991"
2508 .Ss "Trade Names (or Acronyms and Type Names)"
2510 The trade name macro prints its arguments in a smaller font.
2511 Its intended use is to imitate a small caps fonts for uppercase acronyms.
2513 .Dl Usage: .Tn Ao symbol Ac ...
2515 .Bl -tag -width ".Li .Tn\ ASCII" -compact -offset 15n
2516 .It Li ".Tn DEC"
2517 .Tn DEC
2518 .It Li ".Tn ASCII"
2519 .Tn ASCII
2523 The default width is 10n.
2525 .Ss "Extended Arguments"
2528 .Li .Xo
2530 .Li .Xc
2531 macros allow one to extend an argument list on a macro boundary for the
2532 .Ql .It
2533 macro (see below).
2534 Note that
2535 .Li .Xo
2537 .Li .Xc
2538 are implemented similarly to all other macros opening and closing an
2539 enclosure (without inserting characters, of course).
2540 This means that the following is true for those macros also.
2542 Here is an example of
2543 .Ql .Xo
2544 using the space mode macro to turn spacing off:
2546 .Bd -literal -offset indent
2547 \&.Sm off
2548 \&.It Xo Sy I Ar operation
2549 \&.No \een Ar count No \een
2550 \&.Xc
2551 \&.Sm on
2555 produces
2557 .Bd -filled -offset indent
2558 .Bl -tag -compact
2559 .Sm off
2560 .It Xo Sy I Ar operation
2561 .No \en Ar count No \en
2563 .Sm on
2568 Another one:
2570 .Bd -literal -offset indent
2571 \&.Sm off
2572 \&.It Cm S No / Ar old_pattern Xo
2573 \&.No / Ar new_pattern
2574 \&.No / Op Cm g
2575 \&.Xc
2576 \&.Sm on
2580 produces
2582 .Bd -filled -offset indent
2583 .Bl -tag -compact
2584 .Sm off
2585 .It Cm S No \&/ Ar old_pattern Xo
2586 .No \&/ Ar new_pattern
2587 .No \&/ Op Cm g
2589 .Sm on
2594 Another example of
2595 .Ql .Xo
2596 and enclosure macros: Test the value of a variable.
2598 .Bd -literal -offset indent
2599 \&.It Xo
2600 \&.Ic .ifndef
2601 \&.Oo \e&! Oc Ns Ar variable Oo
2602 \&.Ar operator variable ...
2603 \&.Oc Xc
2607 produces
2609 .Bd -filled -offset indent
2610 .Bl -tag -width flag -compact
2611 .It Xo
2612 .Ic .ifndef
2613 .Oo \&! Oc Ns Ar variable Oo
2614 .Ar operator variable ...
2615 .Oc Xc
2621 .Sh "PAGE STRUCTURE DOMAIN"
2623 .Ss "Section Headers"
2625 The following
2626 .Ql .Sh
2627 section header macros are required in every man page.
2628 The remaining section headers are recommended at the discretion of the
2629 author writing the manual page.
2631 .Ql .Sh
2632 macro is parsed but not generally callable.
2633 It can be used as an argument in a call to
2634 .Ql .Sh
2635 only; it then reactivates the default font for
2636 .Ql .Sh .
2638 The default width is 8n.
2640 .Bl -tag -width ".Li .Sh\ RETURN\ VALUES"
2641 .It Li ".Sh NAME"
2643 .Ql ".Sh NAME"
2644 macro is mandatory.
2645 If not specified, headers, footers and page layout defaults will not be set
2646 and things will be rather unpleasant.
2648 .Sx NAME
2649 section consists of at least three items.
2650 The first is the
2651 .Ql .Nm
2652 name macro naming the subject of the man page.
2653 The second is the name description macro,
2654 .Ql .Nd ,
2655 which separates the subject name from the third item, which is the
2656 description.
2657 The description should be the most terse and lucid possible, as the space
2658 available is small.
2660 .Ql .Nd
2661 first prints
2662 .Ql - ,
2663 then all its arguments.
2665 .It Li ".Sh LIBRARY"
2666 This section is for section two and three function calls.
2667 It should consist of a single
2668 .Ql .Lb
2669 macro call;
2671 .Sx "Library Names" .
2673 .It Li ".Sh SYNOPSIS"
2675 .Sx SYNOPSIS
2676 section describes the typical usage of the subject of a man page.
2677 The macros required are either
2678 .Ql .Nm ,
2679 .Ql .Cd ,
2681 .Ql .Fn
2682 (and possibly
2683 .Ql .Fo ,
2684 .Ql .Fc ,
2685 .Ql .Fd ,
2687 .Ql .Ft ) .
2688 The function name macro
2689 .Ql .Fn
2690 is required for manual page sections\~2 and\~3; the command and general name
2691 macro
2692 .Ql .Nm
2693 is required for sections 1, 5, 6, 7, and\~8.
2694 Section\~4 manuals require a
2695 .Ql .Nm ,
2696 .Ql .Fd
2697 or a
2698 .Ql .Cd
2699 configuration device usage macro.
2700 Several other macros may be necessary to produce the synopsis line as shown
2701 below:
2703 .Bd -filled -offset indent
2704 .Nm cat
2705 .Op Fl benstuv
2706 .Op Fl
2711 The following macros were used:
2713 .Dl ".Nm cat"
2714 .Dl ".Op Fl benstuv"
2715 .Dl ".Op Fl"
2716 .Dl .Ar
2718 .It Li ".Sh DESCRIPTION"
2719 In most cases the first text in the
2720 .Sx DESCRIPTION
2721 section is a brief paragraph on the command, function or file, followed by a
2722 lexical list of options and respective explanations.
2723 To create such a list, the
2724 .Ql .Bl
2725 (begin list),
2726 .Ql .It
2727 (list item) and
2728 .Ql .El
2729 (end list)
2730 macros are used (see
2731 .Sx Lists and Columns
2732 below).
2734 .It Li ".Sh IMPLEMENTATION NOTES"
2735 Implementation specific information should be placed here.
2737 .It Li ".Sh RETURN VALUES"
2738 Sections 2, 3 and\~9 function return values should go here.
2740 .Ql .Rv
2741 macro may be used to generate text for use in the
2742 .Sx RETURN VALUES
2743 section for most section 2 and 3 library functions;
2745 .Sx "Return Values" .
2749 The following
2750 .Ql .Sh
2751 section headers are part of the preferred manual page layout and must be
2752 used appropriately to maintain consistency.
2753 They are listed in the order in which they would be used.
2755 .Bl -tag -width ".Li .Sh\ COMPATIBILITY"
2756 .It Li ".Sh ENVIRONMENT"
2758 .Sx ENVIRONMENT
2759 section should reveal any related environment variables and clues to their
2760 behavior and/or usage.
2762 .It Li ".Sh FILES"
2763 Files which are used or created by the man page subject should be listed via
2765 .Ql .Pa
2766 macro in the
2767 .Sx FILES
2768 section.
2770 .It Li ".Sh EXAMPLES"
2771 There are several ways to create examples.
2772 See the
2773 .Sx EXAMPLES
2774 section below for details.
2776 .It Li ".Sh DIAGNOSTICS"
2777 Diagnostic messages from a command should be placed in this section.
2779 .Ql .Ex
2780 macro may be used to generate text for use in the
2781 .Sx DIAGNOSTICS
2782 section for most section 1, 6 and\~8 commands;
2784 .Sx "Exit Status" .
2786 .It Li ".Sh COMPATIBILITY"
2787 Known compatibility issues (e.g. deprecated options or parameters)
2788 should be listed here.
2790 .It Li ".Sh ERRORS"
2791 Specific error handling, especially from library functions (man page
2792 sections 2, 3, and\~9) should go here.
2794 .Ql .Er
2795 macro is used to specify an error (errno).
2797 .It Li ".Sh SEE ALSO"
2798 References to other material on the man page topic and cross references to
2799 other relevant man pages should be placed in the
2800 .Sx "SEE ALSO"
2801 section.
2802 Cross references are specified using the
2803 .Ql .Xr
2804 macro.
2805 Currently
2806 .Xr refer 1
2807 style references are not accommodated.
2809 It is recommended that the cross references are sorted on the section
2810 number, then alphabetically on the names within a section, and placed
2811 in that order and comma separated.
2812 Example:
2814 .Xr ls 1 ,
2815 .Xr ps 1 ,
2816 .Xr group 5 ,
2817 .Xr passwd 5
2819 .It Li ".Sh STANDARDS"
2820 If the command, library function or file adheres to a specific
2821 implementation such as
2822 .St -p1003.2
2824 .St -ansiC
2825 this should be noted here.
2826 If the command does not adhere to any standard, its history should be noted
2827 in the
2828 .Sx HISTORY
2829 section.
2831 .It Li ".Sh HISTORY"
2832 Any command which does not adhere to any specific standards should be
2833 outlined historically in this section.
2835 .It Li ".Sh AUTHORS"
2836 Credits should be placed here.
2838 .Ql .An
2839 macro should be used to specify the name(s) of the person(s).
2841 .It Li ".Sh BUGS"
2842 Blatant problems with the topic go here.
2846 User-specified
2847 .Ql .Sh
2848 sections may be added; for example, this section was set with:
2850 .Bd -literal -offset 15n
2851 \&.Sh "PAGE STRUCTURE DOMAIN"
2854 .Ss "Subsection Headers"
2856 Subsection headers have exactly the same syntax as section headers:
2857 .Ql .Ss
2858 is parsed but not generally callable.
2859 It can be used as an argument in a call to
2860 .Ql .Ss
2861 only; it then reactivates the default font for
2862 .Ql .Ss .
2864 The default width is 8n.
2866 .Ss "Paragraphs and Line Spacing"
2868 .Bl -tag -width ".Li .Pp"
2869 .It Li .Pp
2870 The 
2871 .Ql .Pp
2872 paragraph command may be used to specify a line space where necessary.
2873 The macro is not necessary after a
2874 .Ql .Sh
2876 .Ql .Ss
2877 macro or before a
2878 .Ql .Bl
2880 .Ql .Bd
2881 macro (which both assert a vertical distance unless the
2882 .Fl compact
2883 flag is given).
2885 The macro is neither callable nor parsed and takes no arguments; an
2886 alternative name is
2887 .Ql .Lp .
2890 .\" XXX
2892 .\" This worked with version one, need to redo for version three
2893 .\" .Pp
2894 .\" .Ds I
2895 .\" .Cw (ax+bx+c) \ is\ produced\ by\ \&
2896 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2897 .\" .Cl Cx \t\t
2898 .\" .Li \&.Cx\ (
2899 .\" .Cx
2900 .\" .Cl Cx \t\t
2901 .\" .Li \&.Va ax
2902 .\" .Cx
2903 .\" .Cl Cx \t\t
2904 .\" .Li \&.Sy \+
2905 .\" .Cx
2906 .\" .Cl Cx \&(\&
2907 .\" .Va ax
2908 .\" .Cx +
2909 .\" .Va by
2910 .\" .Cx +
2911 .\" .Va c )
2912 .\" .Cx \t
2913 .\" .Em is produced by
2914 .\" .Cx \t
2915 .\" .Li \&.Va by
2916 .\" .Cx
2917 .\" .Cl Cx \t\t
2918 .\" .Li \&.Sy \+
2919 .\" .Cx
2920 .\" .Cl Cx \t\t
2921 .\" .Li \&.Va c )
2922 .\" .Cx
2923 .\" .Cl Cx \t\t
2924 .\" .Li \&.Cx
2925 .\" .Cx
2926 .\" .Cw
2927 .\" .De
2928 .\" .Pp
2929 .\" This example shows the same equation in a different format.
2930 .\" The spaces
2931 .\" around the
2932 .\" .Li \&+
2933 .\" signs were forced with
2934 .\" .Li \e :
2935 .\" .Pp
2936 .\" .Ds I
2937 .\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
2938 .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
2939 .\" .Cl Cx \t\t
2940 .\" .Li \&.Cx\ (
2941 .\" .Cx
2942 .\" .Cl Cx \t\t
2943 .\" .Li \&.Va a
2944 .\" .Cx
2945 .\" .Cl Cx \t\t
2946 .\" .Li \&.Sy x
2947 .\" .Cx
2948 .\" .Cl Cx \t\t
2949 .\" .Li \&.Cx \e\ +\e\ \e&
2950 .\" .Cx
2951 .\" .Cl Cx \&(\&
2952 .\" .Va a
2953 .\" .Sy x
2954 .\" .Cx \ +\ \&
2955 .\" .Va b
2956 .\" .Sy y
2957 .\" .Cx \ +\ \&
2958 .\" .Va c )
2959 .\" .Cx \t
2960 .\" .Em is produced by
2961 .\" .Cl Cx \t\t
2962 .\" .Li \&.Va b
2963 .\" .Cx
2964 .\" .Cl Cx \t\t
2965 .\" .Li \&.Sy y
2966 .\" .Cx
2967 .\" .Cl Cx \t\t
2968 .\" .Li \&.Cx \e\ +\e\ \e&
2969 .\" .Cx
2970 .\" .Cl Cx \t\t
2971 .\" .Li \&.Va c )
2972 .\" .Cx
2973 .\" .Cl Cx \t\t
2974 .\" .Li \&.Cx
2975 .\" .Cx
2976 .\" .Cw
2977 .\" .De
2978 .\" .Pp
2979 .\" The incantation below was
2980 .\" lifted from the
2981 .\" .Xr adb 1
2982 .\" manual page:
2983 .\" .Pp
2984 .\" .Ds I
2985 .\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
2986 .\" .Cl Cx \t\t
2987 .\" .Li \&.Cx Op Sy ?/
2988 .\" .Cx
2989 .\" .Cl Cx \t\t
2990 .\" .Li \&.Nm m
2991 .\" .Cx
2992 .\" .Cl Cx Op Sy ?/
2993 .\" .Nm m
2994 .\" .Ad \ b1 e1 f1
2995 .\" .Op Sy ?/
2996 .\" .Cx \t
2997 .\" .Em is produced by
2998 .\" .Cx \t
2999 .\" .Li \&.Ar \e\ b1 e1 f1
3000 .\" .Cx
3001 .\" .Cl Cx \t\t
3002 .\" .Li \&.Op Sy ?/
3003 .\" .Cx
3004 .\" .Cl Cx \t\t
3005 .\" .Li \&.Cx
3006 .\" .Cx
3007 .\" .Cw
3008 .\" .De
3009 .\" .Pp
3011 .Ss Keeps
3013 The only keep that is implemented at this time is for words.
3014 The macros are
3015 .Ql .Bk
3016 (begin keep)
3018 .Ql .Ek
3019 (end keep).
3020 The only option that
3021 .Ql .Bk
3022 accepts currently is
3023 .Fl words
3024 (this is also the default if no option is given) which is useful for
3025 preventing line breaks in the middle of options.
3026 In the example for the make command line arguments (see
3027 .Sx What's in a Name ) ,
3028 the keep prevented
3029 .Xr nroff
3030 from placing up the flag and the argument on separate lines.
3032 Both macros are neither callable nor parsed.
3034 More work needs to be done with the keep macros; specifically, a
3035 .Fl line
3036 option should be added.
3038 .Ss "Examples and Displays"
3040 There are seven types of displays.
3042 .Bl -tag -width ".Li .D1"
3043 .It Li .D1
3044 (This is D-one.)
3045 Display one line of indented text.
3046 This macro is parsed but not callable.
3048 .D1 Fl ldghfstru
3050 The above was produced by:
3051 .Li ".D1 Fl ldghfstru" .
3053 .It Li .Dl
3054 (This is D-ell.)
3055 Display one line of indented
3056 .Em literal
3057 text.
3059 .Ql .Dl
3060 example macro has been used throughout this file.
3061 It allows the indentation (display) of one line of text.
3062 Its default font is set to constant width (literal).
3063 .Ql .Dl
3064 is parsed but not callable.
3066 .Dl % ls -ldg /usr/local/bin
3068 The above was produced by:
3069 .Li ".Dl % ls -ldg /usr/local/bin" .
3071 .It Li .Bd
3072 Begin display.
3074 .Ql .Bd
3075 display must be ended with the
3076 .Ql .Ed
3077 macro.
3078 It has the following syntax:
3080 .Bd -ragged -compact
3081 .Bl -tag -width ".Li .Bd" -offset indent
3082 .It Li .Bd Xo
3083 .Bro \-literal | \-filled | \-unfilled | \-ragged | \-centered Brc
3084 .Oo \-offset Ao string Ac Oc Oo \-file Ao file name Ac Oc Oo \-compact Oc Xc
3089 .Bl -tag -width ".Fl file Ao Ar file name Ac " -compact
3090 .It Fl ragged
3091 Fill, but do not adjust the right margin (only left-justify).
3092 .It Fl centered
3093 Center lines between the current left and right margin.
3094 Note that each single line is centered.
3095 .It Fl unfilled
3096 Do not fill; display a block of text as typed, using line breaks as
3097 specified by the user.
3098 This can produce overlong lines without warning messages.
3099 .It Fl filled
3100 Display a filled block.
3101 The block of text is formatted (i.e., the text is justified on both the left
3102 and right side).
3103 .It Fl literal
3104 Display block with literal font (usually fixed-width).
3105 Useful for source code or simple tabbed or spaced text.
3106 .It Fl file Ao Ar file name Ac
3107 The file whose name follows the
3108 .Fl file
3109 flag is read and displayed before any data enclosed with
3110 .Ql .Bd
3112 .Ql .Ed ,
3113 using the selected display type.
3115 .Xr troff/ Ns Nm \-mdoc
3116 commands in the file will be processed.
3117 .It Fl offset Ao Ar string Ac
3119 .Fl offset
3120 is specified with one of the following strings, the string is interpreted to
3121 indicate the level of indentation for the forthcoming block of text:
3124 .Bl -tag -width ".Ar indent-two" -compact
3125 .It Ar left
3126 Align block on the current left margin; this is the default mode of
3127 .Ql .Bd .
3128 .It Ar center
3129 Supposedly center the block.
3130 At this time unfortunately, the block merely gets left aligned about an
3131 imaginary center margin.
3132 .It Ar indent
3133 Indent by one default indent value or tab.
3134 The default indent value is also used for the
3135 .Ql .D1
3136 and 
3137 .Ql .Dl
3138 macros, so one is guaranteed the two types of displays will line up.
3139 The indentation value is normally set to\~6n or about two thirds of an inch
3140 (six constant width characters).
3141 .It Ar indent-two
3142 Indent two times the default indent value.
3143 .It Ar right
3144 This
3145 .Em left
3146 aligns the block about two inches from the right side of the page.
3147 This macro needs work and perhaps may never do the right thing within
3148 .Xr troff .
3153 .Ao string Ac
3154 is a valid numeric expression instead
3155 .Pf ( Em with a scale indicator other than
3156 .Sq Em u ) ,
3157 use that value for indentation.
3158 The most useful scale indicators are
3159 .Sq m
3161 .Sq n ,
3162 specifying the so-called
3163 .Em \&Em
3165 .Em "En square" .
3166 This is approximately the width of the letters
3167 .Sq m
3169 .Sq n
3170 respectively
3171 of the current font (for nroff output, both scale indicators give the same
3172 values).
3174 .Ao string Ac
3175 isn't a numeric expression, it is tested whether it is an
3176 .Nm \-mdoc
3177 macro name, and the default offset value associated with this macro is used.
3178 Finally, if all tests fail,
3179 the width of
3180 .Ao string Ac
3181 (typeset with a fixed-width font) is taken as the offset.
3182 .It Fl compact
3183 Suppress insertion of vertical space before begin of display.
3186 .It Li .Ed
3187 End display (takes no arguments).
3190 .Ss "Lists and Columns"
3192 There are several types of lists which may be initiated with the
3193 .Ql .Bl
3194 begin-list macro.
3195 Items within the list are specified with the
3196 .Ql .It
3197 item macro, and each list must end with the
3198 .Ql .El
3199 macro.
3200 Lists may be nested within themselves and within displays.
3201 The use of columns inside of lists or lists inside of columns is unproven.
3203 In addition, several list attributes may be specified such as the width of a
3204 tag, the list offset, and compactness (blank lines between items allowed or
3205 disallowed).
3206 Most of this document has been formatted with a tag style list
3207 .Pf ( Fl tag ) .
3209 It has the following syntax forms:
3212 .Bd -ragged -compact
3213 .Bl -tag -width ".Li .Bl" -offset indent -compact
3214 .It Li .Bl Xo
3215 .Bro \-hang | \-ohang | \-tag | \-diag | \-inset Brc
3216 .Oo \-width Ao string Ac Oc
3217 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3218 .It Li .Bl Xo
3219 .No \-column Oo \-offset Ao string Ac Oc
3220 .Ao string1 Ac Ao string2 Ac ... Xc
3221 .It Li .Bl Xo
3222 .Bro \-item | \-enum Oo \-nested Oc | \-bullet | \-hyphen | \-dash Brc
3223 .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc
3228 And now a detailed description of the list types.
3231 .Bl -tag -width ".Fl column" -compact
3232 .It Fl bullet
3233 A bullet list.
3235 .Bd -literal -offset indent
3236 \&.Bl -bullet -offset indent -compact
3237 \&.It
3238 Bullet one goes here.
3239 \&.It
3240 Bullet two here.
3241 \&.El
3245 Produces:
3248 .Bl -bullet -offset indent -compact
3250 Bullet one goes here.
3252 Bullet two here.
3256 .It Fl dash No ( or Fl hyphen )
3257 A dash list.
3259 .Bd -literal -offset indent
3260 \&.Bl -dash -offset indent -compact
3261 \&.It
3262 Dash one goes here.
3263 \&.It
3264 Dash two here.
3265 \&.El
3269 Produces:
3272 .Bl -dash -offset indent -compact
3274 Dash one goes here.
3276 Dash two here.
3280 .It Fl enum
3281 An enumerated list.
3283 .Bd -literal -offset indent
3284 \&.Bl -enum -offset indent -compact
3285 \&.It
3286 Item one goes here.
3287 \&.It
3288 And item two here.
3289 \&.El
3293 The result:
3296 .Bl -enum -offset indent -compact
3298 Item one goes here.
3300 And item two here.
3304 If you want to nest enumerated lists, use the
3305 .Fl nested
3306 flag (starting with the second-level list):
3308 .Bd -literal -offset indent
3309 \&.Bl -enum -offset indent -compact
3310 \&.It
3311 Item one goes here
3312 \&.Bl -enum -nested -compact
3313 \&.It
3314 Item two goes here.
3315 \&.It
3316 And item three here.
3317 \&.El
3318 \&.It
3319 And item four here.
3320 \&.El
3324 Result:
3327 .Bl -enum -offset indent -compact
3329 Item one goes here.
3330 .Bl -enum -nested -compact
3332 Item two goes here.
3334 And item three here.
3337 And item four here.
3341 .It Fl item
3342 A list of type
3343 .Fl item
3344 without list markers.
3346 .Bd -literal -offset indent
3347 \&.Bl -item -offset indent
3348 \&.It
3349 Item one goes here.
3350 Item one goes here.
3351 Item one goes here.
3352 \&.It
3353 Item two here.
3354 Item two here.
3355 Item two here.
3356 \&.El
3360 Produces:
3363 .Bl -item -offset indent
3365 Item one goes here.
3366 Item one goes here.
3367 Item one goes here.
3369 Item two here.
3370 Item two here.
3371 Item two here.
3375 .It Fl tag
3376 A list with tags.
3378 .Fl width
3379 to specify the tag width.
3382 .Bl -tag -width "PPID" -compact -offset indent
3383 .It SL
3384 sleep time of the process (seconds blocked)
3385 .It PAGEIN
3386 number of disk
3387 .Tn I/O Ns 's
3388 resulting from references by the process
3389 to pages not loaded in core.
3390 .It UID
3391 numerical user-id of process owner
3392 .It PPID
3393 numerical id of parent of process priority
3394 (non-positive when in non-interruptible wait)
3398 The raw text:
3400 .Bd -literal -offset indent
3401 \&.Bl -tag -width "PPID" -compact -offset indent
3402 \&.It SL
3403 sleep time of the process (seconds blocked)
3404 \&.It PAGEIN
3405 number of disk
3406 \&.Tn I/O Ns 's
3407 resulting from references by the process
3408 to pages not loaded in core.
3409 \&.It UID
3410 numerical user-id of process owner
3411 \&.It PPID
3412 numerical id of parent of process priority
3413 (non-positive when in non-interruptible wait)
3414 \&.El
3418 .It Fl diag
3419 Diag lists create section four diagnostic lists and are similar to inset
3420 lists except callable macros are ignored.
3422 .Fl width
3423 flag is not meaningful in this context.
3425 Example:
3427 .Bd -literal -offset indent
3428 \&.Bl -diag
3429 \&.It You can't use Sy here.
3430 The message says all.
3431 \&.El
3435 produces
3437 .Bl -diag
3438 .It You can't use Sy here.
3439 The message says all.
3443 .It Fl hang
3444 A list with hanging tags.
3446 .Bl -hang -offset indent
3447 .It Em Hanged
3448 labels appear similar to tagged lists when the
3449 label is smaller than the label width.
3450 .It Em Longer hanged list labels
3451 blend into the paragraph unlike
3452 tagged paragraph labels.
3455 And the unformatted text which created it:
3457 .Bd -literal -offset indent
3458 \&.Bl -hang -offset indent
3459 \&.It Em Hanged
3460 labels appear similar to tagged lists when the
3461 label is smaller than the label width.
3462 \&.It Em Longer hanged list labels
3463 blend into the paragraph unlike
3464 tagged paragraph labels.
3465 \&.El
3469 .It Fl ohang
3470 Lists with overhanging tags do not use indentation for the items; tags are
3471 written to a separate line.
3473 .Bl -ohang -offset indent
3474 .It Sy SL
3475 sleep time of the process (seconds blocked)
3476 .It Sy PAGEIN
3477 number of disk
3478 .Tn I/O Ns 's
3479 resulting from references by the process
3480 to pages not loaded in core.
3481 .It Sy UID
3482 numerical user-id of process owner
3483 .It Sy PPID
3484 numerical id of parent of process priority
3485 (non-positive when in non-interruptible wait)
3489 The raw text:
3491 .Bd -literal -offset indent
3492 \&.Bl -ohang -offset indent
3493 \&.It Sy SL
3494 sleep time of the process (seconds blocked)
3495 \&.It Sy PAGEIN
3496 number of disk
3497 \&.Tn I/O Ns 's
3498 resulting from references by the process
3499 to pages not loaded in core.
3500 \&.It Sy UID
3501 numerical user-id of process owner
3502 \&.It Sy PPID
3503 numerical id of parent of process priority
3504 (non-positive when in non-interruptible wait)
3505 \&.El
3509 .It Fl inset
3510 Here is an example of inset labels:
3511 .Bl -inset -offset indent
3512 .It Em Tag
3513 The tagged list (also called a tagged paragraph)
3514 is the most common type of list used in the
3515 Berkeley manuals.
3516 Use a
3517 .Fl width
3518 attribute as described below.
3519 .It Em Diag
3520 Diag lists create section four diagnostic lists
3521 and are similar to inset lists except callable
3522 macros are ignored.
3523 .It Em Hang
3524 Hanged labels are a matter of taste.
3525 .It Em Ohang
3526 Overhanging labels are nice when space is constrained.
3527 .It Em Inset
3528 Inset labels are useful for controlling blocks of
3529 paragraphs and are valuable for converting
3530 .Nm \-mdoc
3531 manuals to other formats.
3534 Here is the source text which produced the above example:
3536 .Bd -literal -offset indent
3537 \&.Bl -inset -offset indent
3538 \&.It Em Tag
3539 The tagged list (also called a tagged paragraph)
3540 is the most common type of list used in the
3541 Berkeley manuals.
3542 \&.It Em Diag
3543 Diag lists create section four diagnostic lists
3544 and are similar to inset lists except callable
3545 macros are ignored.
3546 \&.It Em Hang
3547 Hanged labels are a matter of taste.
3548 \&.It Em Ohang
3549 Overhanging labels are nice when space is constrained.
3550 \&.It Em Inset
3551 Inset labels are useful for controlling blocks of
3552 paragraphs and are valuable for converting
3553 \&.Nm \-mdoc
3554 manuals to other formats.
3555 \&.El
3559 .It Fl column
3560 This list type generates multiple columns.
3561 The number of columns and the width of each column is determined by the
3562 arguments to the
3563 .Fl column
3564 list,
3565 .Aq Ar string1 ,
3566 .Aq Ar string2 ,
3567 etc.
3569 .Aq Ar stringN
3570 starts with a
3571 .Ql .\&
3572 (dot) immediately followed by a valid
3573 .Nm \-mdoc
3574 macro name, interpret
3575 .Aq Ar stringN
3576 and use the width of the result.
3577 Otherwise, the width of
3578 .Aq Ar stringN
3579 (typeset with a fixed-width font) is taken as the
3580 .Ar N Ns th
3581 column width.
3583 Each
3584 .Ql .It
3585 argument is parsed to make a row, each column within the row is a separate
3586 argument separated by a tab or the
3587 .Ql .Ta
3588 macro.
3590 The table:
3592 .Bl -column -offset indent ".Sy String" ".Sy Nroff" ".Sy Troff"
3593 .It Sy String Ta Sy Nroff Ta Sy Troff
3594 .It Li <= Ta <= Ta \*(<=
3595 .It Li >= Ta >= Ta \*(>=
3599 was produced by:
3601 .Bd -literal
3602 \&.Bl -column -offset indent ".Sy String" ".Sy Nroff" ".Sy Troff"
3603 \&.It Sy String Ta Sy Nroff Ta Sy Troff
3604 \&.It Li <= Ta <= Ta \e*(<=
3605 \&.It Li >= Ta >= Ta \e*(>=
3606 \&.El
3611 Other keywords:
3613 .Bl -tag -width ".Fl indent Ao Ar string Ac"
3614 .It Fl width Ao Ar string Ac
3616 .Aq Ar string
3617 starts with a
3618 .Ql .\&
3619 (dot) immediately followed by a valid
3620 .Nm \-mdoc
3621 macro name, interpret
3622 .Aq Ar string
3623 and use the width of the result.
3624 Almost all lists in this document use this option.
3626 Example:
3628 .Bd -literal -offset indent
3629 \&.Bl -tag -width ".Fl test Ao Ar string Ac"
3630 \&.It Fl test Ao Ar string Ac
3631 This is a longer sentence to show how the
3632 \&.Fl width
3633 flag works in combination with a tag list.
3634 \&.El
3638 gives:
3640 .Bl -tag -width ".Fl test Ao Ar string Ac"
3641 .It Fl test Ao Ar string Ac
3642 This is a longer sentence to show how the
3643 .Fl width
3644 flag works in combination with a tag list.
3648 (Note that the current state of
3649 .Nm \-mdoc
3650 is saved before
3651 .Aq Ar string
3652 is interpreted; afterwards, all variables are restored again.
3653 However, boxes (used for enclosures) can't be saved in
3654 .Tn GNU
3655 .Xr troff 1 ;
3656 as a consequence, arguments must always be
3657 .Em balanced
3658 to avoid nasty errors.
3659 For example, do not write
3660 .Ql ".Ao Ar string"
3662 .Ql ".Ao Ar string Xc"
3663 instead if you really need only an opening angle bracket.)
3665 Otherwise, if
3666 .Aq Ar string
3667 is a valid numeric expression
3668 .Em ( with a scale indicator other than
3669 .Sq Em u ) ,
3670 use that value for indentation.
3671 The most useful scale indicators are
3672 .Sq m
3674 .Sq n ,
3675 specifying the so-called
3676 .Em \&Em
3678 .Em "En square" .
3679 This is approximately the width of the letters
3680 .Sq m
3682 .Sq n
3683 respectively
3684 of the current font (for nroff output, both scale indicators give the same
3685 values).
3687 .Aq Ar string
3688 isn't a numeric expression, it is tested whether it is an
3689 .Nm \-mdoc
3690 macro name, and the default width value associated with this macro is used.
3691 Finally, if all tests fail,
3692 the width of
3693 .Aq Ar string
3694 (typeset with a fixed-width font) is taken as the width.
3696 If a width is not specified for the tag list type, every time
3697 .Ql .It
3698 is invoked, an attempt is made to determine an appropriate width.
3699 If the first argument to
3700 .Ql .It
3701 is a callable macro, the default width for that macro will be used;
3702 otherwise, the default width of
3703 .Ql .No
3704 is used.
3705 .It Fl offset Ao Ar string Ac
3707 .Aq Ar string
3709 .Ar indent ,
3710 a default indent value (normally set to\~6n, similar to the value used in
3711 .Ql .Dl
3713 .Ql .Bd )
3714 is used.
3716 .Aq Ar string
3717 is a valid numeric expression instead
3718 .Pf ( Em with a scale indicator other than
3719 .Sq Em u ) ,
3720 use that value for indentation.
3721 The most useful scale indicators are
3722 .Sq m
3724 .Sq n ,
3725 specifying the so-called
3726 .Em \&Em
3728 .Em "En square" .
3729 This is approximately the width of the letters
3730 .Sq m
3732 .Sq n
3733 respectively
3734 of the current font (for nroff output, both scale indicators give the same
3735 values).
3737 .Aq Ar string
3738 isn't a numeric expression, it is tested whether it is an
3739 .Nm \-mdoc
3740 macro name, and the default offset value associated with this macro is used.
3741 Finally, if all tests fail,
3742 the width of
3743 .Aq Ar string
3744 (typeset with a fixed-width font) is taken as the offset.
3745 .It Fl compact
3746 Suppress insertion of vertical space before the list and between list items.
3750 .Sh "MISCELLANEOUS MACROS"
3752 Here a list of the remaining macros which do not fit well into one of the
3753 above sections.
3754 We couldn't find real examples for the following macros:
3755 .Ql .Me
3757 .Ql .Ot .
3758 They are documented here for completeness \- if you know how to use them
3759 properly please send a mail to
3760 .Mt bug-groff@gnu.org
3761 (including an example).
3763 .Bl -tag -width ".Li .Bt"
3764 .It Li .Bt
3765 prints
3767 .Bd -ragged -offset indent
3771 It is neither callable nor parsed and takes no arguments.
3773 .It Li .Fr
3775 .Dl Usage: .Fr Ao function return value Ac ...
3777 Don't use this macro.
3778 It allows a break right before the return value (usually a single digit)
3779 which is bad typographical behaviour.
3781 .Ql \e~
3782 to tie the return value to the previous word.
3784 .It Li .Hf
3785 Use this macro to include a (header) file literally.
3786 It first prints
3787 .Ql File:
3788 followed by the file name, then the contents of
3789 .Ao file Ac .
3791 .Dl Usage: .Hf Ao file Ac
3793 It is neither callable nor parsed.
3795 .It Li .Lk
3796 To be written.
3798 .It Li .Me
3799 Exact usage unknown.
3800 The documentation in the
3801 .Nm \-mdoc
3802 source file describes it as a macro for
3803 .Dq "menu entries" .
3805 Its default width is 6n.
3807 .It Li .Mt
3808 To be written.
3810 .It Li .Ot
3811 Exact usage unknown.
3812 The documentation in the
3813 .Nm \-mdoc
3814 source file describes it as
3815 .Dq old function type (fortran) .
3817 .It Li .Sm
3818 Activate (toggle) space mode.
3820 .Dl Usage: .Sm Oo on | off Oc ...
3822 If space mode is off, no spaces between macro arguments are inserted.
3823 If called without a parameter (or if the next parameter is neither
3824 .Ql on
3826 .Ql off ,
3827 .Ql .Sm
3828 toggles space mode.
3830 .It Li .Ud
3831 prints
3833 .Bd -ragged -offset indent
3837 It is neither callable nor parsed and takes no arguments.
3841 .Sh "PREDEFINED STRINGS"
3843 The following strings are predefined:
3845 .Bl -column String infinity "Troff " "straight double quote" -offset indent
3846 .It Sy String Ta Sy Nroff Ta Sy Troff Ta Sy Meaning
3847 .It Li <=     Ta <=       Ta \*[<=]   Ta "less equal"
3848 .It Li >=     Ta >=       Ta \*[>=]   Ta "greater equal"
3849 .It Li Rq     Ta ''       Ta \*[Rq]   Ta "right double quote"
3850 .It Li Lq     Ta ``       Ta \*[Lq]   Ta "left double quote"
3851 .It Li ua     Ta ^        Ta \*[ua]   Ta "upwards arrow"
3852 .It Li aa     Ta \'       Ta \*[aa]   Ta "acute accent"
3853 .It Li ga     Ta \`       Ta \*[ga]   Ta "grave accent"
3854 .It Li q      Ta \&"      Ta \*[q]    Ta "straight double quote"
3855 .It Li Pi     Ta pi       Ta \*[Pi]   Ta "greek pi"
3856 .It Li Ne     Ta !=       Ta \*[Ne]   Ta "not equal"
3857 .It Li Le     Ta <=       Ta \*[Le]   Ta "less equal"
3858 .It Li Ge     Ta >=       Ta \*[Ge]   Ta "greater equal"
3859 .It Li Lt     Ta <        Ta \*[Lt]   Ta "less than"
3860 .It Li Gt     Ta >        Ta \*[Gt]   Ta "greater than"
3861 .It Li Pm     Ta +\-      Ta \*[Pm]   Ta "plus minus"
3862 .It Li If     Ta infinity Ta \*[If]   Ta "infinity"
3863 .It Li Am     Ta \*[Am]   Ta \*[Am]   Ta "ampersand"
3864 .It Li Na     Ta \*[Na]   Ta \*[Na]   Ta "not a number"
3865 .It Li Ba     Ta \*[Ba]   Ta \*[Ba]   Ta "vertical bar"
3868 The names of the columns
3869 .Sy Nroff
3871 .Sy Troff
3872 are a bit misleading;
3873 .Sy Nroff
3874 shows the
3875 .Tn ASCII
3876 representation, while
3877 .Sy Troff
3878 gives the best glyph form available.
3879 For example, a Unicode enabled
3880 .Tn TTY Ns - Ns
3881 device will have proper glyph representations for all strings, whereas the
3882 enhancement for a Latin1
3883 .Tn TTY Ns - Ns
3884 device is only the plus-minus sign.
3886 String names which consist of two characters can be written as
3887 .Ql \e*(xx ;
3888 string names which consist of one character can be written as
3889 .Ql \e*x .
3890 A generic syntax for a string name of any length is
3891 .Ql \e*[xxx]
3892 (this is a
3893 .Tn GNU
3894 .Xr troff 1
3895 extension).
3899 \#=====================================================================
3901 .Sh DIAGNOSTICS
3903 The debugging macro
3904 .Ql .Db
3905 available in previous versions of
3906 .Nm \-mdoc
3907 has been removed since
3908 .Tn GNU
3909 .Xr troff 1
3910 provides better facilities to check parameters; additionally, many error and
3911 warning messages have been added to this macro package, making it both more
3912 robust and verbose.
3914 The only remaining debugging macro is
3915 .Ql .Rd
3916 which yields a register dump of all global registers and strings.
3917 A normal user will never need it.
3920 .Sh "FORMATTING WITH GROFF, TROFF, AND NROFF"
3922 By default, the package inhibits page breaks, headers, and footers if
3923 displayed with a
3924 .Tn TTY
3925 device like
3926 .Sq latin1
3928 .Sq unicode
3929 to make the manual more efficient for viewing on-line.
3930 This behaviour can be changed (e.g.\& to create a hardcopy of the
3931 .Tn TTY
3932 output) by setting the register
3933 .Ql cR
3934 to zero while calling
3935 .Xr groff :
3937 .Dl groff -Tlatin1 -rcR=0 -mdoc foo.man > foo.txt
3939 For double-sided printing, set register
3940 .Ql D
3941 to\~1:
3943 .Dl groff -Tps -rD1 -mdoc foo.man > foo.ps
3945 To change the document font size to 11pt or 12pt, set register
3946 .Ql S
3947 accordingly:
3949 .Dl groff -Tdvi -rS11 -mdoc foo.man > foo.dvi
3951 Register
3952 .Ql S
3953 is ignored for
3954 .Tn TTY
3955 devices.
3957 The line and title length can be changed by setting the registers
3958 .Ql LL
3960 .Ql LT ,
3961 respectively:
3963 .Dl groff -Tutf8 -rLL=100n -rLT=100n -mdoc foo.man | less
3965 If not set, both registers default to 78n for TTY devices and 6.5i
3966 otherwise.
3969 .Sh FILES
3971 .Bl -tag -width mdoc/doc-ditroff -compact
3972 .It Pa doc.tmac
3973 The main manual macro package.
3974 .It Pa mdoc.tmac
3975 A wrapper file to call
3976 .Pa doc.tmac .
3977 .It Pa mdoc/doc-common
3978 Common strings, definitions, stuff related typographic output.
3979 .It Pa mdoc/doc-nroff
3980 Definitions used for a
3981 .Tn TTY
3982 output device.
3983 .It Pa mdoc/doc-ditroff
3984 Definitions used for all other devices.
3985 .It Pa mdoc.local
3986 Local additions and customizations.
3987 .It Pa andoc.tmac
3988 This file checks whether the
3989 .Nm \-mdoc
3990 or the
3991 .Nm \-man
3992 package should be used.
3996 .Sh "SEE ALSO"
3998 .Xr groff 1 ,
3999 .Xr man 1 ,
4000 .Xr troff 1 ,
4001 .Xr groff_man 7
4004 .Sh BUGS
4006 Section 3f has not been added to the header routines.
4008 .Ql \&.Nm
4009 font should be changed in
4010 .Sx NAME
4011 section.
4013 .Ql \&.Fn
4014 needs to have a check to prevent splitting up
4015 if the line length is too short.
4016 Occasionally it
4017 separates the last parenthesis, and sometimes
4018 looks ridiculous if a line is in fill mode.
4020 The list and display macros do not do any keeps
4021 and certainly should be able to.
4022 .\" Note what happens if the parameter list overlaps a newline
4023 .\" boundary.
4024 .\" to make sure a line boundary is crossed:
4025 .\" .Bd -literal
4026 .\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[]
4027 .\" .Ed
4028 .\" .Pp
4029 .\" produces, nudge nudge,
4030 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
4031 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
4032 .\" nudge
4033 .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] .
4034 .\" .Pp
4035 .\" If double quotes are used, for example:
4036 .\" .Bd -literal
4037 .\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q
4038 .\" .Ed
4039 .\" .Pp
4040 .\" produces, nudge nudge,
4041 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
4042 .\" nudge
4043 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
4044 .\" nudge
4045 .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" .
4046 .\" .Pp
4047 .\" Not a pretty sight...
4048 .\" In a paragraph, a long parameter containing unpaddable spaces as
4049 .\" in the former example will cause
4050 .\" .Xr troff
4051 .\" to break the line and spread
4052 .\" the remaining words out.
4053 .\" The latter example will adjust nicely to
4054 .\" justified margins, but may break in between an argument and its
4055 .\" declaration.
4056 .\" In
4057 .\" .Xr nroff
4058 .\" the right margin adjustment is normally ragged and the problem is
4059 .\" not as severe.
4061 .\" Local Variables:
4062 .\" mode: nroff
4063 .\" End: