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