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