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