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