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