xref: /csrg-svn/share/man/man7/mdoc.samples.7 (revision 50772)
143435Scael.\" Copyright (c) 1990 The Regents of the University of California.
243435Scael.\" All rights reserved.
343435Scael.\"
448889Scael.\" %sccs.include.redist.roff%
543435Scael.\"
6*50772Scael.\"     @(#)mdoc.samples.7	5.8 (Berkeley) 08/05/91
743435Scael.\"
8*50772Scael.\" This tutorial sampler invokes every macro in the package several
9*50772Scael.\" times and is guaranteed to give a worst case performance
1050363Sbostic.\" for an already extremely slow package.
11*50772Scael.\"
1243435Scael.Dd
13*50772Scael.Os
1443435Scael.Dt MDOC.SAMPLES 7
1543435Scael.Sh NAME
16*50772Scael.Nm mdoc.samples
17*50772Scael.Nd tutorial sampler for writing
18*50772Scael.Bx
19*50772Scaelmanuals with
20*50772Scael.Nm \-mdoc
2143435Scael.Sh SYNOPSIS
22*50772Scael.Nm man mdoc.samples
2343435Scael.Sh DESCRIPTION
2448888ScaelA tutorial sampler for writing
2548888Scael.Bx
2648888Scaelmanual pages with the
2743435Scael.Nm \-mdoc
2850362Scaelmacro package, a
2950362Scael.Em content Ns \-based
30*50772Scaeland
31*50772Scael.Em domain Ns \-based
3250362Scaelformatting
3348888Scaelpackage for
3448888Scael.Xr troff 1 .
3548888ScaelIts predecessor, the
3648888Scael.Xr \-man 7
3748888Scaelpackage,
38*50772Scaeladdressed page structure content leaving the
3948888Scaelmanipulation of fonts and other
4048888Scaeltypesetting details to the individual author.
41*50772ScaelIn
42*50772Scael.Nm \-mdoc ,
43*50772Scaelpage layout macros
44*50772Scaelmake up the
45*50772Scael.Em "page structure domain"
46*50772Scaelwhich consists of macros for titles, section headers, displays
47*50772Scaeland lists. Essentially items which affect the physical position
48*50772Scaelof text on a formatted page.
49*50772ScaelIn addition to the page structure domain, there are two more domains,
50*50772Scaelthe manual domain and the general text domain.
51*50772ScaelThe general text domain is defined as macros which
52*50772Scaelperform tasks such as quoting or emphasizing pieces of text.
53*50772ScaelThe manual domain is defined as macros that are a subset of the
54*50772Scaelday to day informal language used to describe commands, routines
55*50772Scaeland related
56*50772Scael.Bx
57*50772Scaelfiles.
58*50772ScaelMacros in the manual domain handle
59*50772Scaelcommand names, command line arguments and options, function names,
60*50772Scaelfunction parameters, pathnames, variables, cross
61*50772Scaelreferences to other manual pages, and so on.
62*50772ScaelThese domain
6348888Scaelitems have value
6448888Scaelfor both the author and the future user of the manual page.
6548888ScaelIt is hoped the consistency gained
6648888Scaelacross the manual set will provide easier
6748888Scaeltranslation to future documentation tools.
6848888Scael.Pp
6948888ScaelThrough out the
7048888Scael.Ux
7148888Scaelmanual pages, a manual entry
7248888Scaelis simply referred
7348888Scaelto as a man page, regardless of actual length and without
7448888Scaelsexist intention.
75*50772Scael.Sh GETTING STARTED
76*50772ScaelSince a tutorial document is normally read when a person
77*50772Scaeldesires to use the material immediately, the assumption has
78*50772Scaelbeen made that the user of this document may be impatient.
79*50772ScaelThe material presented in the remained of this document is
80*50772Scaeloutlined as follows:
81*50772Scael.Bl -enum -offset indent
82*50772Scael.It
83*50772Scael.Tn "TROFF IDIOSYNCRASIES"
84*50772Scael.Bl -tag -width flag -compact -offset indent
85*50772Scael.It Tn "Macro Usage" .
86*50772Scael.It Tn "Passing Space Characters in an Argument" .
87*50772Scael.It Tn "Trailing Blank Space Characters (a warning)" .
88*50772Scael.It Tn "Escaping Special Characters" .
89*50772Scael.El
90*50772Scael.It
91*50772Scael.Tn "THE ANATOMY OF A MAN PAGE"
92*50772Scael.Bl -tag -width flag -compact -offset indent
93*50772Scael.It Tn "A manual page template" .
94*50772Scael.El
95*50772Scael.It
96*50772Scael.Tn "INTRODUCTION OF TITLE MACROS" .
97*50772Scael.It
98*50772Scael.Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS" .
99*50772Scael.Bl -tag -width flag -compact -offset indent
100*50772Scael.It Tn "What's in a name..." .
101*50772Scael.It Tn "General Syntax" .
102*50772Scael.El
103*50772Scael.It
104*50772Scael.Tn "MANUAL DOMAIN"
105*50772Scael.Bl -tag -width flag -compact -offset indent
106*50772Scael.It Tn "Addresses" .
107*50772Scael.It Tn "Arguments" .
108*50772Scael.It Tn "Configuration Declarations (section four only)" .
109*50772Scael.It Tn "Command Modifier .
110*50772Scael.It Tn "Defined Variables" .
111*50772Scael.It Tn "Errno's (Section two only)" .
112*50772Scael.It Tn "Environment Variables" .
113*50772Scael.It Tn "Function Argument" .
114*50772Scael.It Tn "Function Declaration" .
115*50772Scael.It Tn "Flags" .
116*50772Scael.It Tn "Functions (library routines)" .
117*50772Scael.It Tn "Function Types" .
118*50772Scael.\" .It Tn "Header File (including source code)" .
119*50772Scael.It Tn "Interactive Commands" .
120*50772Scael.It Tn "Literals" .
121*50772Scael.It Tn "Names" .
122*50772Scael.It Tn "Options" .
123*50772Scael.It Tn "Pathnames" .
124*50772Scael.It Tn "Variables" .
125*50772Scael.It Tn "Cross References" .
126*50772Scael.El
127*50772Scael.It
128*50772Scael.Tn "GENERAL TEXT DOMAIN"
129*50772Scael.Bl -tag -width flag -compact -offset indent
130*50772Scael.It Tn "AT&T Macro" .
131*50772Scael.It Tn "BSD Macro" .
132*50772Scael.It Tn "UNIX Macro" .
133*50772Scael.It Tn "Emphasis Macro" .
134*50772Scael.It Tn "Enclosure/Quoting Macros"
135*50772Scael.Bl -tag -width flag -compact -offset indent
136*50772Scael.It Tn "Angle Bracket Quote/Enclosure" .
137*50772Scael.It Tn "Bracket Quotes/Enclosure" .
138*50772Scael.It Tn "Double Quote macro/Enclosure" .
139*50772Scael.It Tn "Parenthesis Quote/Enclosure" .
140*50772Scael.It Tn "Single Quotes/Enclosure" .
141*50772Scael.It Tn "Prefix Macro" .
142*50772Scael.El
143*50772Scael.It Tn "Extended  Arguments" .
144*50772Scael.It Tn "No\-Op or Normal Text Macro" .
145*50772Scael.It Tn "No Space Macro" .
146*50772Scael.It Tn "Section Cross References" .
147*50772Scael.It Tn "Symbolic Macro" .
148*50772Scael.It Tn "References and Citations" .
149*50772Scael.It Tn "Trade Names (Acronyms and Type Names)" .
150*50772Scael.El
151*50772Scael.It
152*50772Scael.Tn "PAGE STRUCTURE DOMAIN"
153*50772Scael.Bl -tag -width flag -compact -offset indent
154*50772Scael.It Tn "Section Headers" .
155*50772Scael.It Tn "Paragraphs and Line Spacing" .
156*50772Scael.It Tn "Keeps" .
157*50772Scael.It Tn "Displays" .
158*50772Scael.It Tn "Lists and Columns" .
159*50772Scael.El
160*50772Scael.It
161*50772Scael.Tn "PREDEFINED STRINGS"
162*50772Scael.It
163*50772Scael.Tn "DIAGNOSTICS"
164*50772Scael.It
165*50772Scael.Tn "FORMATTING WITH GROFF, TROFF AND NROFF"
166*50772Scael.It
167*50772Scael.Tn "BUGS"
168*50772Scael.El
169*50772Scael.ne 7
17043435Scael.Sh TROFF IDIOSYNCRASIES
17148888ScaelThe
17248888Scael.Nm \-mdoc
17348888Scaelpackage attempts to simplify the process of writing a man page.
17448888ScaelTheoretically, one should not have to learn the dirty details of
17543435Scael.Xr troff 1
17648888Scaelto use
17748888Scael.Nm \-mdoc ;
17848888Scaelhowever, there are a few
17943435Scaellimitations which are unavoidable and best gotten out
180*50772Scaelof the way.
181*50772ScaelAnd, too, be forewarned, this package is
18248888Scael.Em not
18348888Scaelfast.
18443435Scael.Ss Macro Usage
18543435ScaelAs in
18643435Scael.Xr troff 1 ,
18748888Scaela macro is called by placing a
18848888Scael.Ql \&\.
18943435Scael(dot character)
19043435Scaelat the beginning of
19143435Scaela line followed by the two character name for the macro.
19248888ScaelArguments may follow the macro separated by spaces.
19343435ScaelIt is the dot character at the beginning of the line which causes
19443435Scael.Xr troff 1
19548888Scaelto interpret the next two characters as a macro name.
19643435ScaelTo place a
19748888Scael.Ql \&\.
19843435Scael(dot character)
19943435Scaelat the beginning of a line in some context other than
200*50772Scaela macro invocation, precede the
20148888Scael.Ql \&\.
202*50772Scael(dot) with the
203*50772Scael.Ql \e&
204*50772Scaelescape sequence.
205*50772ScaelThe
206*50772Scael.Ql \e&
207*50772Scaeltranslates literally to a zero width space, and is never displayed in the
208*50772Scaeloutput.
20948888Scael.Pp
21048888ScaelIn general,
21148888Scael.Xr troff 1
21248888Scaelmacros accept up to nine arguments, any
21348888Scaelextra arguments are ignored.
21448888ScaelMost macros in
21548888Scael.Nm \-mdoc
21648888Scaelaccept nine arguments and,
21748888Scaelin limited cases, arguments may be continued or extended
21848888Scaelon the
21948888Scaelnext line (See
220*50772Scael.Sx Extensions ) .
221*50772ScaelA few macros handle quoted arguments (see
22248888Scael.Sx Passing Space Characters in an Argument
22348888Scaelbelow).
224*50772Scael.Pp
225*50772ScaelMost of the
22648888Scael.Nm \-mdoc
227*50772Scaelgeneral text domain and manual domain macros are special
228*50772Scaelin that their argument lists are
229*50772Scael.Em parsed
230*50772Scaelfor callable macro names.
231*50772ScaelThis means an argument on the argument list which matches
232*50772Scaela general text or manual domain macro name and is determined
233*50772Scaelto be callable will be executed
234*50772Scaelor called when it is processed.
235*50772ScaelIn this case
23643435Scaelthe argument, although the name of a macro,
23743435Scaelis not preceded by a
23848888Scael.Ql \&\.
239*50772Scael(dot).
240*50772ScaelIt is in this manner that many macros are nested; for
24148888Scaelexample
24248888Scaelthe option macro,
24348888Scael.Ql \&.Op ,
24448888Scaelmay
24543435Scael.Em call
24648888Scaelthe flag and argument macros,
247*50772Scael.Ql \&Fl
24848888Scaeland
249*50772Scael.Ql \&Ar ,
25048888Scaelto specify an optional flag with an argument:
25148888Scael.Bl -tag -width "\&.Op \&Fl s \&Ar bytes" -offset indent
25248888Scael.It Op Fl s Ar bytes
25343435Scaelis produced by
25448888Scael.Li \&.Op \&Fl s \&Ar bytes
25548888Scael.El
25643435Scael.Pp
25748888ScaelTo prevent a two character
25848888Scaelstring from being interpreted as a macro name, precede
25948888Scaelthe string with the
26048888Scaelescape sequence
26148888Scael.Ql \e& :
26248888Scael.Bl -tag -width "[\&Fl s \&Ar bytes]" -offset indent
26348888Scael.It Op \&Fl s \&Ar bytes
26448888Scaelis produced by
26548888Scael.Li \&.Op \e&Fl s \e&Ar bytes
26648888Scael.El
26743435Scael.Pp
26848888ScaelHere the strings
26948888Scael.Ql \&Fl
27048888Scaeland
27148888Scael.Ql \&Ar
27248888Scaelwere not interpreted as macros.
273*50772ScaelMacros which are parsed for callable arguments are referred to
274*50772Scaelas parsed macros and macros which may be called from an argument
275*50772Scaellist (are defined as executable) are simply referred to as callable
276*50772Scaelthrough out this document and in the companion quick reference
277*50772Scaeldocument
278*50772Scael.Xr mdoc 7 .
279*50772ScaelMore details on callable macros are presented in the
280*50772Scaelsection on
281*50772Scael.Sx MANUAL DOMAIN MACROS .
28248888Scael.Ss Passing Space Characters in an Argument
28348888ScaelSometimes it is desirable to give as one argument a string
284*50772Scaelcontaining one or more blank space characters.
285*50772ScaelThis may be necessary
28648888Scaelto defeat the nine argument limit or to specify arguments to macros
28748888Scaelwhich expect particular arrangement of items in the argument list.
28848888ScaelFor example,
28948888Scaelthe function macro
29048888Scael.Ql \&.Fn
29148888Scaelexpects the first argument to be the name of a function and any
292*50772Scaelremaining arguments to be function parameters.
293*50772ScaelAs
29448888Scael.Tn "ANSI C"
29548888Scaelstipulates the declaration of function parameters in the
29648888Scaelparenthesized parameter list, each parameter is guaranteed
297*50772Scaelto be at minimum a two word string.
298*50772ScaelFor example,
29948888Scael.Fa int foo .
300*50772Scael.Pp
30148888ScaelThere are two possible ways to pass an argument which contains
302*50772Scaelan embedded space.
303*50772Scael.Em Implementation note :
304*50772ScaelUnfortunately, the most convenient way
305*50772Scaelof passing spaces in between quotes by reassigning individual
306*50772Scaelarguments before parsing was fairly expensive speed wise
307*50772Scaeland space wise to implement in all the macros for
308*50772Scael.Tn AT&T
309*50772Scael.Xr troff .
310*50772ScaelIt is not expensive for
311*50772Scael.Xr groff
312*50772Scaelbut for the sake of portability, has been limited
313*50772Scaelto the following macros which need
31448888Scaelit the most:
31543435Scael.Pp
31648888Scael.Bl -tag -width 4n -offset indent -compact
31748888Scael.It Li \&Cd
318*50772ScaelConfiguration declaration (section 4
319*50772Scael.Sx SYNOPSIS )
32048888Scael.It Li \&Bl
32148888ScaelBegin list (for the width specifier).
32248888Scael.It Li \&Em
32348888ScaelEmphasized text.
32448888Scael.It Li \&Fn
32548888ScaelFunctions (sections two and four).
32648888Scael.It Li \&It
32748888ScaelList items.
32848888Scael.It Li \&Li
32948888ScaelLiteral text.
33048888Scael.It Li \&Sy
33148888ScaelSymbolic text.
33248888Scael.It Li \&%B
33348888ScaelBook titles.
33448888Scael.It Li \&%J
33548888ScaelJournal names.
33648888Scael.It Li \&%O
33748888ScaelOptional notes for a reference.
33848888Scael.It Li \&%R
33948888ScaelReport title (in a reference).
34048888Scael.It Li \&%T
34148888ScaelTitle of article in a book or journal.
34248888Scael.El
34348888Scael.Pp
34448888ScaelOne way of passing a string
34548888Scaelcontaining blank spaces is to use the hard or unpaddable space character
34648888Scael.Ql \e\  ,
347*50772Scaelthat is, a blank space preceded by the escape character
34848888Scael.Ql \e .
34948888ScaelThis method may be used with any macro but has the side effect
35048888Scaelof interfering with the adjustment of text
35148888Scaelover the length of a line.
35248888Scael.Xr Troff
35348888Scaelsees the hard space as if it were any other printable character and
35448888Scaelcannot split the string into blank or newline separated pieces as one
355*50772Scaelwould expect.
356*50772ScaelThe method is useful for strings which are not expected
357*50772Scaelto overlap a line boundary.
358*50772ScaelFor example:
35948888Scael.Bl -tag -width "fetch(char *str)" -offset indent
36048888Scael.It Fn fetch char\ *str
36143435Scaelis created by
36248888Scael.Ql \&.Fn fetch char\e *str
36348888Scael.It Fn fetch "char *str"
36448888Scaelcan also be created by
36548888Scael.Ql \&.Fn fetch "\\*q*char *str\\*q"
36648888Scael.El
36748888Scael.Pp
36848888ScaelIf the
36948888Scael.Ql \e
37048888Scaelor quotes
37148888Scaelwere omitted,
37248888Scael.Ql \&.Fn
37348888Scaelwould see three arguments and
37448888Scaelthe result would be:
37548888Scael.Pp
37648888Scael.Dl Fn fetch char *str
37748888Scael.Pp
37850362ScaelFor an example of what happens when the parameter list overlaps
37950362Scaela newline boundary, see the
38050362Scael.Sx BUGS
38150362Scaelsection.
38248888Scael.Ss Trailing Blank Space Characters
38348888Scael.Xr Troff
384*50772Scaelcan be confused by blank space characters at the end of a line.
385*50772ScaelIt
386*50772Scaelis a wise preventive measure to globally remove all blank spaces
387*50772Scaelfrom <blank-space><end-of-line> character sequences.
388*50772ScaelShould the need
38948888Scaelarise to force a blank character at the end of a line,
39048888Scaelit may be forced with an unpaddable space and the
39148888Scael.Ql \e&
39248888Scaelescape character.
39348888ScaelFor example,
39448888Scael.Ql string\e\ \e& .
39543435Scael.Ss Escaping Special Characters
39643435ScaelSpecial characters
39743435Scaellike the newline character
39848888Scael.Ql \en ,
39943435Scaelare handled by replacing the
40048888Scael.Ql \e
40143435Scaelwith
40248888Scael.Ql \ee
40343435Scael(e.g.
40448888Scael.Ql \een )
40543435Scaelto preserve
40643435Scaelthe backslash.
407*50772Scael.Sh THE ANATOMY OF A MAN PAGE
40848888ScaelThe body of a man page is easily constructed from a basic
40948888Scaeltemplate found in the file:
41048888Scael.Bd -literal -offset indent
411*50772Scael\&.\e" /usr/share/misc/man.template:
41248888Scael\&.\e" The following six lines are required.
413*50772Scael\&.Dd Month day, year
414*50772Scael\&.Os OPERATING_SYSTEM [version/release]
41548888Scael\&.Dt DOCUMENT_TITLE [section number] [volume]
41648888Scael\&.Sh NAME
41748888Scael\&.Sh SYNOPSIS
41848888Scael\&.Sh DESCRIPTION
41948888Scael\&.\e" The following requests should be uncommented and
42048888Scael\&.\e" used where appropriate.  This next request is
42148888Scael\&.\e" for sections 2 and 3 function return values only.
42248888Scael\&.\e" .Sh RETURN VALUES
42348888Scael\&.\e" This next request is for sections 1, 6, 7 & 8 only
42448888Scael\&.\e" .Sh ENVIRONMENT
42548888Scael\&.\e" .Sh FILES
42648888Scael\&.\e" .Sh EXAMPLES
42748888Scael\&.\e" This next request is for sections 1, 6, 7 & 8 only
42848888Scael\&.\e"     (command return values (to shell) and
42948888Scael\&.\e"	  fprintf/stderr type diagnostics)
43048888Scael\&.\e" .Sh DIAGNOSTICS
43148888Scael\&.\e" The next request is for sections 2 and 3 error
43248888Scael\&.\e" and signal handling only.
43348888Scael\&.\e" .Sh ERRORS
43448888Scael\&.\e" .Sh SEE ALSO
43548888Scael\&.\e" .Sh STANDARDS
43648888Scael\&.\e" .Sh HISTORY
43748888Scael\&.\e" .Sh AUTHORS
43848888Scael\&.\e" .Sh BUGS
43948888Scael.Ed
44048888Scael.Pp
44148888ScaelThe first items in the template are the macros
442*50772Scael.Pq Li \&.Dd , \&.Os , \&.Dt ;
443*50772Scaelthe document date,
444*50772Scaelthe operating system the man page or subject source is developed
445*50772Scaelor modified for,
446*50772Scaeland the man page title
447*50772Scael.Pq Em in upper case
448*50772Scaelalong with the section of the manual the page
449*50772Scaelbelongs in.
450*50772ScaelThese macros identify the page,
45148888Scaeland are discussed below in
45248888Scael.Sx TITLE MACROS .
45348888Scael.Pp
45448888ScaelThe remaining items in the template are section headers
45548888Scael.Pq Li \&.Sh ;
456*50772Scaelof which
457*50772Scael.Sx NAME ,
458*50772Scael.Sx SYNOPSIS
459*50772Scaeland
460*50772Scael.Sx DESCRIPTION
461*50772Scaelare mandatory.
462*50772ScaelThe
46348888Scaelheaders are
46448888Scaeldiscussed in
465*50772Scael.Sx PAGE STRUCTURE DOMAIN ,
46648888Scaelafter
46748888Scaelpresentation of
468*50772Scael.Sx MANUAL DOMAIN .
46948888ScaelSeveral content macros are used to demonstrate page layout macros;
47048888Scaelreading about content macros before page layout macros is
47148888Scaelrecommended.
47248888Scael.Sh TITLE MACROS
473*50772ScaelThe title macros are the first portion of the page structure
474*50772Scaeldomain, but are presented first and separate for someone who
475*50772Scaelwishes to start writing a man page yesterday.
47643435ScaelThree header macros designate the document title or manual page title,
47743435Scaelthe operating system,
47848888Scaeland the date of authorship.
47943435ScaelThese macros are one called once at the very beginning of the document
48043435Scaeland are used to construct the headers and footers only.
48148888Scael.Bl -tag -width 6n
48248888Scael.It Li \&.Dt DOCUMENT_TITLE section# [volume]
48343435ScaelThe document title is the
484*50772Scaelsubject of the man page and must be in
485*50772Scael.Tn CAPITALS
486*50772Scaeldue to troff
48743435Scaellimitations.
48848888ScaelThe section number may be 1,\ ...,\ 8,
48943435Scaeland if it is specified,
49043435Scaelthe volume title may be omitted.
49143435ScaelA volume title may be arbitrary or one of the following:
49243435Scael.\" .Cl
49343435Scael.\" USD	UNIX User's Supplementary Documents
49443435Scael.\" .Cl
495*50772Scael.\" PS1	UNIX Programmer's Supplementary Documents
49648888Scael.Pp
49748888Scael.Bl -column SMM -offset indent -compact
498*50772Scael.It Li AMD	UNIX Ancestral Manual Documents
499*50772Scael.It Li SMM	UNIX System Manager's Manual
500*50772Scael.It Li URM	UNIX Reference Manual
501*50772Scael.It Li PRM	UNIX Programmer's Manual
50248888Scael.El
50348888Scael.Pp
504*50772ScaelThe default volume labeling is
505*50772Scael.Li URM
506*50772Scaelfor sections 1, 6, and 7;
507*50772Scael.Li SMM
508*50772Scaelfor section 8;
509*50772Scael.Li PRM
510*50772Scaelfor sections 2, 3, 4, and 5.
51143435Scael.\" .Cl
51243435Scael.\" MMI	UNIX Manual Master Index
51343435Scael.\" .Cl
51443435Scael.\" CON	UNIX Contributed Software Manual
51543435Scael.\" .Cl
51643435Scael.\" LOC	UNIX Local Manual
51748888Scael.It Li \&.Os operating_system release#
51843435ScaelThe name of the operating system
519*50772Scaelshould be the common acronym, e.g.
520*50772Scael.Tn BSD
521*50772Scaelor
522*50772Scael.Tn ATT .
523*50772ScaelThe release should be the standard release
52448888Scaelnomenclature for the system specified, e.g. 4.3, 4.3+Tahoe, V.3,
525*50772ScaelV.4.
526*50772ScaelUnrecognized arguments are displayed as given in the page footer.
527*50772ScaelFor instance, a typical footer might be:
52843435Scael.Pp
529*50772Scael.Dl \&.Os BSD 4.3
530*50772Scael.Pp
531*50772Scaelor for a locally produced set
532*50772Scael.Pp
533*50772Scael.Dl \&.Os CS Department
534*50772Scael.Pp
535*50772ScaelThe Berkeley default,
536*50772Scael.Ql \&.Os
537*50772Scaelwithout an argument, has been defined as
538*50772Scael.Tn BSD
539*50772ScaelExperimental in the
540*50772Scaelsite specific file
541*50772Scael.Pa /usr/src/share/tmac/doc-common .
542*50772ScaelIt really should default to
543*50772Scael.Tn LOCAL .
544*50772ScaelNote, if the
545*50772Scael.Ql \&.Os
546*50772Scaelmacro is not present, the bottom left corner of the page
547*50772Scaelwill be ugly.
54848888Scael.It Li \&.Dd month day, year
54943435ScaelThe date should be written formally:
55043435Scael.Pp
551*50772Scael.ne 5
55243435Scael.Dl January 25, 1989
55348888Scael.El
554*50772Scael.Sh MANUAL DOMAIN
55548888Scael.Ss What's in a name...
556*50772ScaelThe manual domain macro names are derived from the day to day
55748888Scaelinformal language used to describe commands, subroutines and related
558*50772Scaelfiles.
559*50772ScaelSlightly
56048888Scaeldifferent variations of this language are used to describe
56148888Scaelthe three different aspects of writing a man page.
56248888ScaelFirst, there is the description of
56348888Scael.Nm \-mdoc
56448888Scaelmacro request usage.
56548888ScaelSecond is the description of a
56648888Scael.Ux
56748888Scaelcommand
56848888Scael.Em with
56948888Scael.Nm \-mdoc
57048888Scaelmacros and third,
57148888Scaelthe
57248888Scaeldescription a command to a user in the verbal sense;
57348888Scaelthat is, discussion of a command in the text of a man page.
57448888Scael.Pp
57548888ScaelIn the first case,
57648888Scael.Xr troff 1
57748888Scaelmacros are themselves a type of command;
57848888Scaelthe general syntax for a troff command is:
57948888Scael.Bd -filled -offset indent
58048888Scael\&.Va argument1 argument2 ... argument9
58148888Scael.Ed
58248888Scael.Pp
58348888ScaelThe
58448888Scael.Ql \&.Va
58548888Scaelis a macro command or request, and anything following it is an argument to
58648888Scaelbe processed.
58748888ScaelIn the second case,
58848888Scaelthe description of a
58948888Scael.Ux
59048888Scaelcommand using the content macros is a
59148888Scaelbit more involved;
592*50772Scaela typical
593*50772Scael.Sx SYNOPSIS
594*50772Scaelcommand line might be displayed as:
59548888Scael.Bd -filled -offset indent
59648888Scael.Nm filter
59748888Scael.Op Fl flag
59848888Scael.Ar infile outfile
59948888Scael.Ed
60048888Scael.Pp
60148888ScaelHere,
60248888Scael.Nm filter
60348888Scaelis the command name and the
60448888Scaelbracketed string
60548888Scael.Fl flag
60648888Scaelis a
60748888Scael.Em flag
60848888Scaelargument designated as optional by the option brackets.
60948888ScaelIn
61048888Scael.Nm \-mdoc
61148888Scaelterms,
61248888Scael.Ar infile
61343435Scaeland
61448888Scael.Ar outfile
61548888Scaelare
61648888Scaelcalled
61748888Scael.Em arguments .
61848888ScaelThe macros which formatted the above example:
61950362Scael.Bd -literal -offset indent
62050362Scael\&.Nm filter
62150362Scael\&.Op \&Fl flag
62250362Scael\&.Ar infile outfile
62348888Scael.Ed
62448888Scael.Pp
62548888ScaelIn the third case, discussion of commands and command syntax
626*50772Scaelincludes both examples above, but may add more detail.
627*50772ScaelThe
62848888Scaelarguments
62948888Scael.Ar infile
63048888Scaeland
63148888Scael.Ar outfile
632*50772Scaelfrom the example above might be referred to as
63348888Scael.Em operands
63448888Scaelor
63548888Scael.Em file arguments .
63648888ScaelSome command line argument lists are quite long:
63748888Scael.Bl -tag -width make -offset indent
63848888Scael.It Nm make
63948888Scael.Op Fl eiknqrstv
64048888Scael.Op Fl D Ar variable
64148888Scael.Op Fl d Ar flags
64248888Scael.Op Fl f Ar makefile
643*50772Scael.Bk -words
64448888Scael.Op Fl I Ar directory
645*50772Scael.Ek
64648888Scael.Op Fl j Ar max_jobs
64748888Scael.Op Ar variable=value
648*50772Scael.Bk -words
649*50772Scael.Op Ar target ...
650*50772Scael.Ek
65148888Scael.El
65248888Scael.Pp
65348888ScaelHere one might talk about the command
65448888Scael.Nm make
65548888Scaeland qualify the argument
65648888Scael.Ar makefile ,
65748888Scaelas an argument to the flag,
65848888Scael.Fl f ,
65948888Scaelor discuss the optional
66048888Scaelfile
66148888Scaeloperand
66248888Scael.Ar target .
66348888ScaelIn the verbal context, such detail can prevent confusion,
66448888Scaelhowever the
66548888Scael.Nm \-mdoc
66648888Scaelpackage
66748888Scaeldoes not have a macro for an argument
66848888Scael.Em to
66948888Scaela flag.
67048888ScaelInstead the
67148888Scael.Ql \&Ar
67248888Scaelargument macro is used for an operand or file argument like
67348888Scael.Ar target
67448888Scaelas well as an argument to a flag like
675*50772Scael.Ar variable .
676*50772ScaelThe make command line was produced from:
67748888Scael.Bd -literal -offset indent
67848888Scael\&.Nm make
67948888Scael\&.Op Fl eiknqrstv
68048888Scael\&.Op Fl D Ar variable
68148888Scael\&.Op Fl d Ar flags
68248888Scael\&.Op Fl f Ar makefile
68348888Scael\&.Op Fl I Ar directory
68448888Scael\&.Op Fl j Ar max_jobs
68548888Scael\&.Op Ar variable=value
686*50772Scael\&.Bk -words
68748888Scael\&.Op Ar target ...
688*50772Scael\&.Ek
68948888Scael.Ed
690*50772Scael.Pp
691*50772ScaelThe
692*50772Scael.Ql \&.Bk
693*50772Scaeland
694*50772Scael.Ql \&.Ek
695*50772Scaelare explained in
696*50772Scael.Sx Keeps .
69748888Scael.Ss General Syntax
698*50772ScaelThe manual domain and general text domain macros share a similar
69948888Scaelsyntax with a few minor deviations:
70048888Scael.Ql \&.Ar ,
70148888Scael.Ql \&.Fl ,
70248888Scael.Ql \&.Nm ,
70348888Scaeland
70448888Scael.Ql \&.Pa
70548888Scaeldiffer only when called without arguments;
70648888Scael.Ql \&.Fn
70748888Scaeland
70848888Scael.Ql \&.Xr
70948888Scaelimpose an order on their argument lists
71048888Scaeland the
711*50772Scael.Ql \&.Op
71248888Scaeland
713*50772Scael.Ql \&.Fn
71448888Scaelmacros
715*50772Scaelhave nesting limitations.
716*50772ScaelAll content macros
717*50772Scaelare capable of recognizing and properly handling punctuation,
718*50772Scaelprovided each punctuation character is separated by a leading space.
719*50772ScaelIf an request is given:
720*50772Scael.Pp
721*50772Scael.Dl \&.Li sptr, ptr),
722*50772Scael.Pp
723*50772ScaelThe result is:
724*50772Scael.Pp
725*50772Scael.Dl Li sptr, ptr),
726*50772Scael.Pp
727*50772ScaelThe punctuation is not recognized and all is output in the
728*50772Scaelliteral font. If the punctuation is separated by a leading
729*50772Scaelwhite space:
730*50772Scael.Pp
731*50772Scael.Dl \&.Li "sptr , ptr ) ,"
732*50772Scael.Pp
733*50772ScaelThe result is:
734*50772Scael.Pp
735*50772Scael.Dl Li sptr , ptr ) ,
736*50772Scael.Pp
737*50772ScaelThe punctuation is now recognized and is output in the
738*50772Scaeldefault font distinguishing it from the strings in literal font.
739*50772Scael.Pp
740*50772ScaelTo remove the special meaning from a punctuation character
741*50772Scaelescape it with
742*50772Scael.Ql \e& .
743*50772Scael.Xr Troff
744*50772Scaelis limited as a macro language, and has difficulty
745*50772Scaelwhen presented with a string containing
746*50772Scaela member of the mathematical, logical or
74748888Scaelquotation set:
748*50772Scael.Bd -literal -offset indent-two
749*50772Scael\&{+,\-,/,*,\&%,<,>,<=,>=,=,==,&,`,',"}
75048888Scael.Ed
751*50772Scael.Pp
752*50772ScaelThe problem is that
753*50772Scael.Xr troff
754*50772Scaelmay assume it is supposed to actually perform the operation
755*50772Scaelor evaluation suggested by the characters.  To prevent
756*50772Scaelthe accidental evaluation of these characters,
757*50772Scaelescape them with
75848888Scael.Ql \e& .
75948888ScaelTypical syntax is shown in the first content macro displayed
76048888Scaelbelow,
761*50772Scael.Ql \&.Ad .
76248888Scael.Ss Address Macro
763*50772ScaelThe address macro identifies an address construct
76443435Scaelof the form addr1[,addr2[,addr3]].
76543435Scael.Pp
76648888Scael.Dl Usage: .Ad address ... \*(Pu
76748888Scael.Bl -tag -width ".Ad f1 , f2 , f3 :" -compact -offset 14n
76848888Scael.It Li \&.Ad addr1
76943435Scael.Ad addr1
77048888Scael.It Li \&.Ad addr1\ .
77143435Scael.Ad addr1 .
77248888Scael.It Li \&.Ad addr1\ , file2
77343435Scael.Ad addr1 , file2
77448888Scael.It Li \&.Ad f1\ , f2\ , f3\ :
77543435Scael.Ad f1 , f2 , f3 :
77648888Scael.It Li \&.Ad addr\ )\ )\ ,
77743435Scael.Ad addr ) ) ,
77848888Scael.El
77948888Scael.Pp
78043435ScaelIt is an error to call
78143435Scael.Li \&.Ad
78243435Scaelwithout arguments.
78348888Scael.Li \&.Ad
78448888Scaelis callable by other macros and may call other macros.
78548888Scael.Ss Argument Macro
78643435ScaelThe
78743435Scael.Li \&.Ar
78848888Scaelargument macro may be used whenever
78943435Scaela command line argument is referenced.
79043435Scael.Pp
79143435Scael.Dl Usage: .Ar argument ... \*(Pu
79248888Scael.Bl -tag -width ".Ar file1 file2" -compact -offset 15n
79348888Scael.It Li \&.Ar
79443435Scael.Ar
79548888Scael.It Li \&.Ar file1
79643435Scael.Ar file1
79748888Scael.It Li \&.Ar file1\ .
79843435Scael.Ar file1 .
79948888Scael.It Li \&.Ar file1 file2
80043435Scael.Ar file1 file2
80148888Scael.It Li \&.Ar f1 f2 f3\ :
80243435Scael.Ar f1 f2 f3 :
80348888Scael.It Li \&.Ar file\ )\ )\ ,
80443435Scael.Ar file ) ) ,
80548888Scael.El
80643435Scael.Pp
80743435ScaelIf
80843435Scael.Li \&.Ar
80948888Scaelis called without arguments
81048888Scael.Ql Ar
811*50772Scaelis assumed.
812*50772ScaelThe
81343435Scael.Li \&.Ar
81448888Scaelmacro may call other macros, and may be
81548888Scaelcalled by other macros.
81648888Scael.Ss Configuration Declaration (section four only)
81748888ScaelThe
81848888Scael.Ql \&.Cd
81948888Scaelmacro is used to demonstrate a
82048888Scael.Xr config 8
82148888Scaeldeclaration for a device interface in a section four manual.
82248888ScaelThis macro accepts quoted arguments (double quotes only).
82348888Scael.Pp
82448888Scael.Bl -tag -width "device le0 at scode?" -offset indent
82548888Scael.It Cd "device le0 at scode?"
82648888Scaelproduced by:
82748888Scael.Ql ".Cd device le0 at scode?" .
82848888Scael.El
82948888Scael.Ss Command Modifier
83048888ScaelThe command modifier is identical to the
83148888Scael.Ql \&.Fl
83248888Scael(flag) command with the exception
83348888Scaelthe
83448888Scael.Ql \&.Cm
83548888Scaelmacro does not assert a dash
836*50772Scaelin front of every argument.
837*50772ScaelTraditionally flags are marked by the
83848888Scaelpreceding dash, some commands or subsets of commands do not use them.
83948888ScaelCommand modifiers may also be specified in conjunction with interactive
84048888Scaelcommands such as editor commands.
84148888ScaelSee
84248888Scael.Sx Flags .
84348888Scael.Ss Defined Variables
84448888ScaelA variable which is defined in an include file is specified
84548888Scaelby the macro
84648888Scael.Ql \&.Dv .
84743435Scael.Pp
84848888Scael.Dl Usage: .Dv defined_variable ... \*(Pu
84948888Scael.Bl -tag -width ".Dv MAXHOSTNAMELEN" -compact -offset 14n
85048888Scael.It Li ".Dv MAXHOSTNAMELEN"
85148888Scael.Dv MAXHOSTNAMELEN
85248888Scael.It Li ".Dv TIOCGPGRP )"
85348888Scael.Dv TIOCGPGRP )
85448888Scael.El
85548888Scael.Pp
85648888ScaelIt is an error to call
85748888Scael.Ql \&.Dv
85848888Scaelwithout arguments.
85948888Scael.Ql \&.Dv
86048888Scaelmay call other macros and
86148888Scaelmay be called by other macros.
86248888Scael.Ss Errno's (Section two only)
86343435ScaelThe
86448888Scael.Ql \&.Er
86548888Scaelerrno macro specifies the error return value
866*50772Scaelfor section two library routines.
867*50772ScaelThe second example
86843435Scaelbelow shows
86948888Scael.Ql \&.Er
87043435Scaelused with the
87148888Scael.Ql \&.Bq
872*50772Scaelgeneral text domain macro, as it would be used in
87348888Scaela section two manual page.
87443435Scael.Pp
87543435Scael.Dl Usage: .Er ERRNOTYPE ... \*(Pu
87648888Scael.Bl -tag -width ".Bq Er ENOTDIR" -compact -offset 14n
87748888Scael.It Li \&.Er ENOENT
87843435Scael.Er ENOENT
87948888Scael.It Li \&.Er ENOENT\ )\ ;
88048888Scael.Er ENOENT ) ;
88148888Scael.It Li \&.Bq \&Er ENOTDIR
88248888Scael.Bq Er ENOTDIR
88348888Scael.El
88443435Scael.Pp
88543435ScaelIt is an error to call
88648888Scael.Ql \&.Er
88743435Scaelwithout arguments.
88848888ScaelThe
88948888Scael.Ql \&.Er
89048888Scaelmacro
89148888Scaelis callable and may call other macros.
89243435Scael.Ss Environment Variables
89343435ScaelThe
89448888Scael.Ql \&.Ev
89548888Scaelmacro specifies a environment variable.
89643435Scael.Pp
89743435Scael.Dl Usage: .Ev argument ... \*(Pu
89848888Scael.Bl -tag -width ".Ev PRINTER ) ) ," -compact -offset 14n
89948888Scael.It Li \&.Ev DISPLAY
90043435Scael.Ev  DISPLAY
90148888Scael.It Li \&.Ev PATH\ .
90243435Scael.Ev PATH .
90348888Scael.It Li \&.Ev PRINTER\ )\ )\ ,
90443435Scael.Ev PRINTER ) ) ,
90548888Scael.El
90643435Scael.Pp
90743435ScaelIt is an error to call
90848888Scael.Ql \&.Ev
90943435Scaelwithout arguments.
91048888ScaelThe
91148888Scael.Ql \&.Ev
91248888Scaelmacro
91348888Scaelis callable by other macros and may call other macros.
91448888Scael.Ss Function Argument
91548888ScaelThe
91648888Scael.Ql \&.Fa
91748888Scaelmacro is used to refer to function arguments (parameters)
918*50772Scaeloutside of the
919*50772Scael.Sx SYNOPSIS
920*50772Scaelsection of the manual or inside
921*50772Scaelthe
922*50772Scael.Sx SYNOPSIS
923*50772Scaelsection should a parameter list be too
92448888Scaellong for the
92548888Scael.Ql \&.Fn
92648888Scaelmacro and the enclosure macros
92748888Scael.Ql \&.Fo
92848888Scaeland
92948888Scael.Ql \&.Fc
93048888Scaelmust be used.
93148888Scael.Ql \&.Fa
93248888Scaelmay also be used to refer to structure members.
93348888Scael.Pp
93448888Scael.Dl Usage: .Fa function_argument ... \*(Pu
93548888Scael.Bl -tag -width ".Fa d_namlen\ )\ )\ ," -compact -offset 14n
93648888Scael.It Li \&.Fa d_namlen\ )\ )\ ,
93748888Scael.Fa d_namlen ) ) ,
93848888Scael.It Li \&.Fa iov_len
93948888Scael.Fa iov_len
94048888Scael.El
94148888Scael.Pp
94248888ScaelIt is an error to call
94348888Scael.Ql \&.Fa
94448888Scaelwithout arguments.
94548888Scael.Ql \&.Fa
94648888Scaelis callable by other macros and may call other macros.
94748888Scael.Ss Function Declaration
94848888ScaelThe
94948888Scael.Ql \&.Fd
950*50772Scaelmacro is used in the
951*50772Scael.Sx SYNOPSIS
952*50772Scaelsection with section two or three
953*50772Scaelfunctions.
954*50772ScaelThe
95548888Scael.Ql \&.Fd
95648888Scaelmacro does not call other macros and is not callable by other
95748888Scaelmacros.
95848888Scael.Pp
95948888Scael.Dl Usage: .Fd include_file (or defined variable)
96048888Scael.Pp
961*50772ScaelIn the
962*50772Scael.Sx SYNOPSIS
963*50772Scaelsection a
96448888Scael.Ql \&.Fd
96548888Scaelrequest causes a line break if a function has already been presented
966*50772Scaeland a break has not occurred.
967*50772ScaelThis leaves a nice vertical space
96848888Scaelin between the previous function call and the declaration for the
96948888Scaelnext function.
97043435Scael.Ss Flags
97143435ScaelThe
97248888Scael.Ql \&.Fl
973*50772Scaelmacro handles command line flags.
974*50772ScaelIt prepends
97543435Scaela dash,
97648888Scael.Ql \- ,
977*50772Scaelto the flag.
978*50772ScaelFor interactive command flags, which
97943435Scaelare not prepended with a dash, the
98048888Scael.Ql \&.Cm
98148888Scael(command modifier)
98248888Scaelmacro is identical, but with out the dash.
98343435Scael.Pp
98443435Scael.Dl Usage: .Fl argument ... \*(Pu
98548888Scael.Bl -tag -width ".Fl \-s \-t \-v" -compact -offset 14n
98648888Scael.It Li \&.Fl
98743435Scael.Fl
98848888Scael.It Li \&.Fl cfv
98943435Scael.Fl cfv
99048888Scael.It Li \&.Fl cfv\ .
99143435Scael.Fl cfv .
99248888Scael.It Li \&.Fl s v t
99343435Scael.Fl s v t
99448888Scael.It Li \&.Fl -\ ,
99543435Scael.Fl - ,
99648888Scael.It Li \&.Fl xyz\ )\ ,
99743435Scael.Fl xyz ) ,
99848888Scael.El
99943435Scael.Pp
100043435ScaelThe
100148888Scael.Ql \&.Fl
100248888Scaelmacro without any arguments results
100348888Scaelin a dash representing stdin/stdout.
100443435ScaelNote that giving
100548888Scael.Ql \&.Fl
100643435Scaela single dash, will result in two dashes.
100748888ScaelThe
100848888Scael.Ql \&.Fl
100948888Scaelmacro
101048888Scaelis callable and may call other macros.
101143435Scael.Ss Functions (library routines)
101248888ScaelThe .Fn macro is modeled on ANSI C conventions.
101348888Scael.Bd -literal
1014*50772ScaelUsage: .Fn [type] function [[type] parameters ... \*(Pu]
101548888Scael.Ed
101650362Scael.Bl -tag -width ".Fn .int align. .const * char *sptrsxx" -compact
101748888Scael.It Li "\&.Fn getchar"
101843435Scael.Fn getchar
101948888Scael.It Li "\&.Fn strlen ) ,"
102043435Scael.Fn strlen ) ,
102148888Scael.It Li \&.Fn "\\*qint align\\*q" "\\*qconst * char *sptrs\\*q" ,
102248888Scael.Fn "int align" "const * char *sptrs" ,
102348888Scael.El
102443435Scael.Pp
102543435ScaelIt is an error to call
102648888Scael.Ql \&.Fn
102743435Scaelwithout any arguments.
102848888ScaelThe
102948888Scael.Ql \&.Fn
103048888Scaelmacro
1031*50772Scaelis parsed and is callable,
103248888Scaelnote that any call to another macro signals the end of
103348888Scaelthe
103448888Scael.Ql \&.Fn
1035*50772Scaelcall (it will close-parenthesis at that point).
103648888Scael.Pp
1037*50772ScaelFor functions that have more than eight parameters (and this
1038*50772Scaelis rare), the
1039*50772Scaelmacros
1040*50772Scael.Ql \&.Fo
1041*50772Scael(function open)
1042*50772Scaeland
1043*50772Scael.Ql \&.Fc
1044*50772Scael(function close)
1045*50772Scaelmay be used with
1046*50772Scael.Ql \&.Fa
1047*50772Scael(function argument)
1048*50772Scaelto get around the limitation. For example:
1049*50772Scael.Bd -literal -offset indent
1050*50772Scael\&.Fo "int res_mkquery"
1051*50772Scael\&.Fa "int op"
1052*50772Scael\&.Fa "char *dname"
1053*50772Scael\&.Fa "int class"
1054*50772Scael\&.Fa "int type"
1055*50772Scael\&.Fa "char *data"
1056*50772Scael\&.Fa "int datalen"
1057*50772Scael\&.Fa "struct rrec *newrr"
1058*50772Scael\&.Fa "char *buf"
1059*50772Scael\&.Fa "int buflen"
1060*50772Scael\&.Fc
1061*50772Scael.Ed
1062*50772Scael.Pp
1063*50772ScaelProduces:
1064*50772Scael.Bd -filled -offset indent
1065*50772Scael.Fo "int res_mkquery"
1066*50772Scael.Fa "int op"
1067*50772Scael.Fa "char *dname"
1068*50772Scael.Fa "int class"
1069*50772Scael.Fa "int type"
1070*50772Scael.Fa "char *data"
1071*50772Scael.Fa "int datalen"
1072*50772Scael.Fa "struct rrec *newrr"
1073*50772Scael.Fa "char *buf"
1074*50772Scael.Fa "int buflen"
1075*50772Scael.Fc
1076*50772Scael.Ed
1077*50772Scael.Pp
1078*50772ScaelThe
1079*50772Scael.Ql \&.Fo
1080*50772Scaeland
1081*50772Scael.Ql \&.Fc
1082*50772Scaelmacros are parsed and are callable.
1083*50772ScaelIn the
1084*50772Scael.Sx SYNOPSIS
1085*50772Scaelsection, the function will always begin at
1086*50772Scaelthe beginning of line.
1087*50772ScaelIf there is more than one function
1088*50772Scaelpresented in the
1089*50772Scael.Sx SYNOPSIS
1090*50772Scaelsection and a function type has not been
109148888Scaelgiven, a line break will occur, leaving a nice vertical space
109248888Scaelbetween the current function name and the one prior.
109343435ScaelAt the moment,
109448888Scael.Ql \&.Fn
109543435Scaeldoes not check its word boundaries
109648888Scaelagainst troff line lengths and may split across a newline
1097*50772Scaelungracefully.
1098*50772ScaelThis will be fixed in the near future.
109948888Scael.Ss Function Type
1100*50772ScaelThis macro is intended for the
1101*50772Scael.Sx SYNOPSIS
1102*50772Scaelsection.
1103*50772ScaelIt may be used
1104*50772Scaelanywhere else in the man page without problems, but its main purpose
1105*50772Scaelis to present the function type in kernel normal form for the
1106*50772Scael.Sx SYNOPSIS
110748888Scaelof sections two and three
110848888Scael(it causes a page break allowing the function name to appear
110948888Scaelon the next line).
111048888Scael.Pp
111148888Scael.Dl Usage: .Ft type ... \*(Pu
111248888Scael.Pp
111348888Scael.Bl -tag -width "\&.Ft struct stat" -offset 14n -compact
111448888Scael.It Li \&.Ft struct stat
111548888Scael.Ft struct stat
111648888Scael.El
111748888Scael.Pp
111843435ScaelThe
111948888Scael.Ql \&.Ft
112048888Scaelrequest is not callable by other macros.
112148888Scael.Ss Interactive Commands
112248888ScaelThe
112348888Scael.Ql \&.Ic
112448888Scaelmacro designates an interactive or internal command.
112548888Scael.Pp
112648888Scael.Dl Usage: .Li argument ... \*(Pu
112748888Scael.Bl -tag -width ".Ic setenv , unsetenv" -compact -offset 14n
112848888Scael.It Li \&.Ic :wq
112948888Scael.Ic :wq
113048888Scael.It Li \&.Ic do while {...}
113148888Scael.Ic do while {...}
113248888Scael.It Li \&.Ic setenv\ , unsetenv
113348888Scael.Ic setenv , unsetenv
113448888Scael.El
113548888Scael.Pp
113648888ScaelIt is an error to call
113748888Scael.Ql \&.Ic
113848888Scaelwithout arguments.
113948888ScaelThe
114048888Scael.Ql \&.Ic
114148888Scaelmacro may call other macros and is callable.
114243435Scael.Ss Literals
114343435ScaelThe
114448888Scael.Ql \&.Li
114548888Scaelliteral macro may be used for special characters,
114643435Scaelvariable constants, anything which should be displayed as it
114743435Scaelwould be typed.
114843435Scael.Pp
114943435Scael.Dl Usage: .Li argument ... \*(Pu
115048888Scael.Bl -tag -width ".Li cntrl-D ) ,"  -compact -offset 14n
115148888Scael.It Li \&.Li \een
115243435Scael.Li \en
115348888Scael.It Li \&.Li M1 M2 M3\ ;
115443435Scael.Li M1 M2 M3 ;
115548888Scael.It Li \&.Li cntrl-D\ )\ ,
115643435Scael.Li cntrl-D ) ,
115748888Scael.It Li \&.Li 1024\ ...
115843435Scael.Li 1024 ...
115948888Scael.El
116043435Scael.Pp
116143435ScaelThe
116248888Scael.Ql \&.Li
116348888Scaelmacro
116448888Scaelis callable by other macros and may call other macros.
116548888Scael.Ss Name Macro
116648888ScaelThe
116748888Scael.Ql \&.Nm
116848888Scaelmacro is used for the document title or subject name.
116948888ScaelIt has the peculiarity of remembering the first
117043435Scaelargument it was called with, which should
1171*50772Scaelalways be the subject name of the page.
1172*50772ScaelWhen called without
117343435Scaelarguments,
117448888Scael.Ql \&.Nm
117543435Scaelregurgitates this initial name for the sole purpose
117643435Scaelof making less work for the author.
117748888ScaelNote:
117848888Scaela section two
117943435Scaelor three document function name is addressed with the
118048888Scael.Ql \&.Nm
1181*50772Scaelin the
1182*50772Scael.Sx NAME
1183*50772Scaelsection, and with
118448888Scael.Ql \&.Fn
1185*50772Scaelin the
1186*50772Scael.Sx SYNOPSIS
118748888Scaeland remaining sections.
118843435ScaelFor interactive commands, such as the
118948888Scael.Ql while
119043435Scaelcommand keyword in
119143435Scael.Xr csh 1 ,
119243435Scaelthe
119348888Scael.Ql \&.Ic
119448888Scaelmacro should be used.
119543435ScaelWhile the
119648888Scael.Ql \&.Ic
119743435Scaelis nearly identical
119843435Scaelto
119948888Scael.Ql \&.Nm ,
120043435Scaelit can not recall the first argument it was invoked with.
120143435Scael.Pp
120243435Scael.Dl Usage: .Nm argument ... \*(Pu
120348888Scael.Bl -tag -width ".Nm mdoc.sample" -compact -offset 14n
120448888Scael.It Li \&.Nm mdoc.sample
120543435Scael.Nm  mdoc.sample
120648888Scael.It Li \&.Nm \-mdoc
120743435Scael.Nm \-mdoc .
120848888Scael.It Li \&.Nm foo\ )\ )\ ,
120943435Scael.Nm foo ) ) ,
121048888Scael.It Li \&.Nm
121143435Scael.Nm
121248888Scael.El
121343435Scael.Pp
121443435ScaelThe
121548888Scael.Ql \&.Nm
121648888Scaelmacro
121748888Scaelis callable by other macros and may call other macros.
121848888Scael.Ss Options
121948888ScaelThe
122048888Scael.Ql \&.Op
122148888Scaelmacro
122248888Scaelplaces option brackets around the any remaining arguments on the command
122348888Scaelline, and places any
1224*50772Scaeltrailing punctuation outside the brackets.
1225*50772ScaelThe macros
122648888Scael.Ql \&.Oc
122748888Scaeland
122848888Scael.Ql \&.Oo
122948888Scaelmay be used across one or more lines.
123048888Scael.Pp
123148888Scael.Dl Usage: .Op options ... \*(Pu
123248888Scael.Bl -tag -width ".Op Fl c Ar objfil Op Ar corfil ," -compact -offset indent
123348888Scael.It Li \&.Op
123448888Scael.Op
123548888Scael.It Li ".Op Fl k"
123648888Scael.Op Fl k
123748888Scael.It Li ".Op Fl k ) ."
123848888Scael.Op Fl k ) .
123948888Scael.It Li ".Op Fl k Ar kookfile"
124048888Scael.Op Fl k Ar kookfile
124148888Scael.It Li ".Op Fl k Ar kookfile ,"
124248888Scael.Op Fl k Ar kookfile ,
124348888Scael.It Li ".Op Ar objfil Op Ar corfil"
124448888Scael.Op Ar objfil Op Ar corfil
124548888Scael.It Li ".Op Fl c Ar objfil Op Ar corfil ,"
124648888Scael.Op Fl c Ar objfil Op Ar corfil ,
124748888Scael.It Li \&.Op word1 word2
124848888Scael.Op word1 word2
124948888Scael.El
125048888Scael.Pp
125148888ScaelThe
125248888Scael.Ql \&.Oc
125348888Scaeland
125448888Scael.Ql \&.Oo
125548888Scaelmacros:
125648888Scael.Bd -literal -offset indent
125748888Scael\&.Oo
125848888Scael\&.Op \&Fl k \&Ar kilobytes
125948888Scael\&.Op \&Fl i \&Ar interval
126048888Scael\&.Op \&Fl c \&Ar count
126148888Scael\&.Oc
126248888Scael.Ed
126348888Scael.Pp
126448888ScaelProduce:
126548888Scael.Oo
126648888Scael.Op Fl k Ar kilobytes
126748888Scael.Op Fl i Ar interval
126848888Scael.Op Fl c Ar count
126948888Scael.Oc
127048888Scael.Pp
127148888ScaelThe macros
127248888Scael.Ql \&.Op ,
127348888Scael.Ql \&.Oc
127448888Scaeland
127548888Scael.Ql \&.Oo
127648888Scaelare callable and may call other macros.
127743435Scael.Ss Pathnames
127843435ScaelThe
127948888Scael.Ql \&.Pa
128048888Scaelmacro formats path or file names.
128143435Scael.Pp
128243435Scael.Dl Usage: .Pa pathname \*(Pu
128348888Scael.Bl -tag -width ".Pa /tmp/fooXXXXX ) ." -compact -offset 14n
128448888Scael.It Li \&.Pa /usr/share
128543435Scael.Pa /usr/share
128648888Scael.It Li \&.Pa /tmp/fooXXXXX\ )\ .
128743435Scael.Pa /tmp/fooXXXXX ) .
128848888Scael.El
128943435Scael.Pp
129048888ScaelThe
129148888Scael.Ql \&.Pa
129248888Scaelmacro
129348888Scaelis callable by other macros and may call other macros.
1294*50772Scael.Ss Variables
1295*50772ScaelGeneric variable reference:
1296*50772Scael.Pp
1297*50772Scael.Dl Usage: .Va variable ... \*(Pu
1298*50772Scael.Bl -tag -width ".Va char s ] ) ) ," -compact -offset 14n
1299*50772Scael.It Li \&.Va count
1300*50772Scael.Va count
1301*50772Scael.It Li \&.Va settimer ,
1302*50772Scael.Va settimer ,
1303*50772Scael.It Li \&.Va int\ *prt\ )\ :
1304*50772Scael.Va int\ *prt ) :
1305*50772Scael.It Li \&.Va char\ s\ ]\ )\ )\ ,
1306*50772Scael.Va char\ s ] ) ) ,
1307*50772Scael.El
1308*50772Scael.Pp
1309*50772ScaelIt is an error to call
1310*50772Scael.Ql \&.Va
1311*50772Scaelwithout any arguments.
131248888ScaelThe
1313*50772Scael.Ql \&.Va
131450362Scaelmacro
1315*50772Scaelis callable by other macros and may call other macros.
1316*50772Scael.Ss Manual Page Cross References
1317*50772ScaelThe
1318*50772Scael.Ql \&.Xr
1319*50772Scaelmacro expects the first argument to be
1320*50772Scaela manual page name, and the second argument, if it exists,
1321*50772Scaelto be either a section page number or punctuation.
1322*50772ScaelAny
1323*50772Scaelremaining arguments are assumed to be punctuation.
132448888Scael.Pp
1325*50772Scael.Dl Usage: .Xr man_page [1,...,8] \*(Pu
1326*50772Scael.Bl -tag -width ".Xr mdoc 7 ) ) ," -compact -offset 14n
1327*50772Scael.It Li \&.Xr mdoc
1328*50772Scael.Xr mdoc
1329*50772Scael.It Li \&.Xr mdoc\ ,
1330*50772Scael.Xr mdoc ,
1331*50772Scael.It Li \&.Xr mdoc 7
1332*50772Scael.Xr mdoc 7
1333*50772Scael.It Li \&.Xr mdoc 7\ )\ )\ ,
1334*50772Scael.Xr mdoc 7 ) ) ,
1335*50772Scael.El
1336*50772Scael.Pp
1337*50772ScaelThe
1338*50772Scael.Ql \&.Xr
1339*50772Scaelmacro
1340*50772Scaelis callable by other macros and may call other macros.
1341*50772ScaelIt is an error to call
1342*50772Scael.Ql \&.Xr
1343*50772Scaelwithout
1344*50772Scaelany arguments.
1345*50772Scael.Sh GENERAL TEXT DOMAIN
1346*50772Scael.Ss AT&T Macro
1347*50772Scael.Bd -literal -offset indent -compact
1348*50772ScaelUsage: .At [v6 | v7 | 32v | V.1 | V.4] ... \*(Pu
1349*50772Scael.Ed
1350*50772Scael.Bl -tag -width ".At v6 ) ," -compact -offset 14n
1351*50772Scael.It Li ".At"
1352*50772Scael.At
1353*50772Scael.It Li ".At v6 ."
1354*50772Scael.At v6 .
1355*50772Scael.El
1356*50772Scael.Pp
1357*50772ScaelThe
1358*50772Scael.Ql \&.At
1359*50772Scaelmacro is
1360*50772Scael.Em not
1361*50772Scaelparsed and
1362*50772Scael.Em not
1363*50772Scaelcallable. It accepts at most two arguments.
1364*50772Scael.Ss BSD Macro
1365*50772Scael.Dl Usage: .Bx [Version/release] ... \*(Pu
1366*50772Scael.Bl -tag -width ".Bx 4.3 ) ," -compact -offset 14n
1367*50772Scael.It Li ".Bx"
1368*50772Scael.Bx
1369*50772Scael.It Li ".Bx 4.3 ."
1370*50772Scael.Bx 4.3 .
1371*50772Scael.El
1372*50772Scael.Pp
1373*50772ScaelThe
1374*50772Scael.Ql \&.Bx
1375*50772Scaelmacro is parsed and is callable.
1376*50772Scael.Ss UNIX Macro
1377*50772Scael.Dl Usage: .Ux ... \*(Pu
1378*50772Scael.Bl -tag -width ".Ux 4.3 ) ," -compact -offset 14n
1379*50772Scael.It Li ".Ux"
1380*50772Scael.Ux
1381*50772Scael.El
1382*50772Scael.Pp
1383*50772ScaelThe
1384*50772Scael.Ql \&.Ux
1385*50772Scaelmacro is parsed and is callable.
1386*50772Scael.Ss Emphasis Macro
1387*50772ScaelText may be stressed or emphasized with the
1388*50772Scael.Ql \&.Em
1389*50772Scaelmacro.
1390*50772ScaelThe usual font for emphasis is italic.
1391*50772Scael.Pp
1392*50772Scael.Dl Usage: .Em argument ... \*(Pu
1393*50772Scael.Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n
1394*50772Scael.It Li ".Em does not"
1395*50772Scael.Em does not
1396*50772Scael.It Li ".Em exceed 1024 ."
1397*50772Scael.Em exceed 1024 .
1398*50772Scael.It Li ".Em vide infra ) ) ,"
1399*50772Scael.Em vide infra ) ) ,
1400*50772Scael.El
1401*50772Scael.Pp
1402*50772ScaelThe emphasis can be forced across several lines of text by using
1403*50772Scaelthe
1404*50772Scael.Ql \&.Bf
1405*50772Scaelmacro discussed in
1406*50772Scael.Sx Modes
1407*50772Scaelunder
1408*50772Scael.Sx PAGE LAYOUT .
1409*50772Scael.\" .Pp
1410*50772Scael.\" .Em
1411*50772Scael.\" We are certain the reason most people desire a Harvard MBA
1412*50772Scael.\" so they can become to be successful philanthropists.  Only
1413*50772Scael.\" mathematicians and physicists go to graduate school strictly
1414*50772Scael.\" to acquire infinite wealthy and fame. Its that inifinity
1415*50772Scael.\" word that does it to them. Ruins them.
1416*50772Scael.\" .Em
1417*50772Scael.Pp
1418*50772ScaelThe
1419*50772Scael.Ql \&.Em
1420*50772Scaelmacro
1421*50772Scaelis callable and may call other macros.
1422*50772ScaelIt is an error to call
1423*50772Scael.Ql \&.Em
1424*50772Scaelwithout arguments.
1425*50772Scael.Ss Enclosure and Quoting Macros
1426*50772ScaelThe concept of enclosure is similar to quoting.
1427*50772ScaelThe object being to enclose one or more strings between
1428*50772Scaela pair of characters like quotes or parentheses.
1429*50772ScaelThe terms quoting and enclosure are used
1430*50772Scaelinterchangeably throughout this document.
1431*50772ScaelMost of the
1432*50772Scaelone line enclosure macros end
1433*50772Scaelend in small letter
1434*50772Scael.Ql q
1435*50772Scaelto give a hint of quoting, but there are a few irregularities.
1436*50772ScaelFor each enclosure macro
1437*50772Scaelthere is also a pair of open and close macros which end
1438*50772Scaelin small letters
1439*50772Scael.Ql o
1440*50772Scaeland
1441*50772Scael.Ql c
1442*50772Scaelrespectively.
1443*50772ScaelThese can be used across one or more lines of text
1444*50772Scaeland while they have nesting limitations, the one line quote macros
1445*50772Scaelcan be used inside
1446*50772Scaelof them.
1447*50772ScaelFor a good example of one these macros, see
1448*50772Scael.Sx Options .
1449*50772Scael.Pp
1450*50772Scael.Bd -filled -offset indent
1451*50772Scael.Bl -column "quote " "close " "open " "Enclose Stringx(in XX) " XXstringXX
1452*50772Scael.Em " Quote	 Close	 Open	Function	Result"
1453*50772Scael\&.Aq	.Ac	.Ao	Angle Bracket Enclosure	<string>
1454*50772Scael\&.Bq	.Bc	.Bo	Bracket Enclosure	[string]
1455*50772Scael\&.Dq	.Dc	.Do	Double Quote	``string''
1456*50772Scael	.Ec	.Eo	Enclose String (in XX)	XXstringXX
1457*50772Scael\&.Pq	.Pc	.Po	Parenthesis Enclosure	(string)
1458*50772Scael\&.Ql			Quoted Literal	`st' or string
1459*50772Scael\&.Qq	.Qc	.Qo	Straight Double Quote	"string"
1460*50772Scael\&.Sq	.Sc	.So	Single Quote	`string'
1461*50772Scael.El
1462*50772Scael.Ed
1463*50772Scael.Pp
1464*50772ScaelExcept for the following irregular macros, all
1465*50772Scaelof the quoting macros are parsed and callable.
1466*50772ScaelAll handle punctuation properly, as long as it
1467*50772Scaelis presented one character at a time and separated by spaces.
1468*50772ScaelThe quoting macros examine opening and closing punctuation
1469*50772Scaelto determine whether it comes before or after the
1470*50772Scaelenclosing string. This makes some nesting possible.
1471*50772Scael.Bl -tag -width xxx,xxxx
1472*50772Scael.It Li \&.Ec , \&.Eo
1473*50772ScaelThese macros expect the first argument to be the
1474*50772Scaelopening and closing strings respectively.
1475*50772Scael.It Li \&.Ql
1476*50772ScaelThe quoted literal macro behaves differently for
1477*50772Scael.Xr troff
1478*50772Scaelthan
1479*50772Scael.Xr nroff .
1480*50772ScaelIf formatted with
1481*50772Scael.Xr nroff ,
1482*50772Scaela quoted literal is always quoted. If formatted with
1483*50772Scaeltroff, an item is only quoted if the width
1484*50772Scaelof the item is less than three constant width characters.
1485*50772ScaelThis is to make short strings more visible where the font change
1486*50772Scaelto literal (constant width) is less noticeable.
1487*50772Scael.It Li \&.Pf
1488*50772ScaelThe prefix macro is not callable, but it is parsed:
1489*50772Scael.Pp
1490*50772Scael.Dl ".Pf ( Fa name2"
1491*50772Scael.Pp
149248888Scaelbecomes
1493*50772Scael.Pf ( Fa name2 .
1494*50772ScaelThe
1495*50772Scael.Ql \&.Ns
1496*50772Scael(no space) macro performs the analogous suffix function.
149748888Scael.El
149848888Scael.Pp
1499*50772Scael.ne 4
1500*50772ScaelExamples of quoting:
1501*50772Scael.Bl -tag -width ".Aq Pa ctype.h ) ,xxxxxxxx" -compact -offset indent
1502*50772Scael.It Li \&.Aq
1503*50772Scael.Aq
1504*50772Scael.It Li \&.Aq \&Ar ctype.h\ )\ ,
1505*50772Scael.Aq Ar ctype.h ) ,
1506*50772Scael.It Li \&.Bq
1507*50772Scael.Bq
1508*50772Scael.It Li \&.Bq \&Em Greek \&, French \&.
1509*50772Scael.Bq Em Greek , French .
1510*50772Scael.It Li \&.Dq
1511*50772Scael.Dq
1512*50772Scael.It Li ".Dq string abc ."
1513*50772Scael.Dq string abc .
1514*50772Scael.It Li ".Dq \'^[A-Z]\'"
1515*50772Scael.Dq \'^[A-Z]\'
1516*50772Scael.It Li "\&.Ql man mdoc"
1517*50772Scael.Ql man mdoc
1518*50772Scael.It Li \&.Qq
1519*50772Scael.Qq
1520*50772Scael.It Li "\&.Qq string ) ,"
1521*50772Scael.Qq string ) ,
1522*50772Scael.It Li \&.Sq
1523*50772Scael.Sq
1524*50772Scael.It Li "\&.Sq string
1525*50772Scael.Sq string
1526*50772Scael.El
1527*50772Scael.Pp
1528*50772ScaelFor a good example of nested enclosure macros, see the
1529*50772Scael.Ql \&.Op
1530*50772Scaeloption macro.
1531*50772ScaelIt was created from the same
1532*50772Scaelunderlying enclosure macros as those presented in the list
1533*50772Scaelabove.
153448888ScaelThe
1535*50772Scael.Ql \&.Xo
1536*50772Scaeland
1537*50772Scael.Ql \&.Xc
1538*50772Scaelextended argument list macros
1539*50772Scaelwere also built from the same underlying routines and are a good
1540*50772Scaelexample of
1541*50772Scael.Nm \-mdoc
1542*50772Scaelmacro usage at its worst.
1543*50772Scael.Ss No\-Op or Normal Text Macro
1544*50772ScaelThe macro
1545*50772Scael.Li \&.No
1546*50772Scaelis
1547*50772Scaela hack for words in a macro command line which should
1548*50772Scael.Em not
1549*50772Scaelbe formatted and follows the conventional syntax
1550*50772Scaelfor content macros.
1551*50772Scael.Ss No Space Macro
1552*50772ScaelThe
155348888Scael.Ql \&.Ns
1554*50772Scaelmacro eliminates unwanted spaces in between macro requests.
1555*50772ScaelIt is useful for old style argument lists where there is no space
1556*50772Scaelbetween the flag and argument:
1557*50772Scael.Bl -tag -width ".Op Fl I Ns Ar directoryxx" -offset indent
1558*50772Scael.It Li ".Op Fl I Ns Ar directory"
1559*50772Scaelproduces
1560*50772Scael.Op Fl I Ns Ar directory
1561*50772Scael.El
1562*50772Scael.Pp
1563*50772ScaelNote: the
1564*50772Scael.Ql \&.Ns
1565*50772Scaelmacro always invokes the
1566*50772Scael.Ql \&.No
1567*50772Scaelmacro after eliminating the space unless another macro name
1568*50772Scaelfollows it.
1569*50772ScaelThe macro
1570*50772Scael.Ql \&.Ns
1571*50772Scaelis callable and may call other macros.
157248888Scael.Ss Section Cross References
157348888ScaelThe
157448888Scael.Ql \&.Sx
157548888Scaelmacro designates a reference to a section header
1576*50772Scaelwithin the same document.
1577*50772ScaelIt is callable by other macros and may
157848888Scaelcall other macros.
157948888Scael.Pp
158048888Scael.Bl -tag -width "Li \&.Sx FILES" -offset 14n
158148888Scael.It Li \&.Sx FILES
158248888Scael.Sx FILES
158348888Scael.El
1584*50772Scael.Ss Symbolic
1585*50772ScaelThe symbolic emphasis macro is generally a boldface macro in
1586*50772Scaeleither the symbolic sense or the traditional English usage.
1587*50772Scael.Pp
1588*50772Scael.Dl Usage: .Sy symbol ... \*(Pu
1589*50772Scael.Bl -tag -width ".Sy Important Noticex" -compact -offset 14n
1590*50772Scael.It Li \&.Sy Important Notice
1591*50772Scael.Sy Important Notice
1592*50772Scael.El
1593*50772Scael.Pp
1594*50772ScaelThe
1595*50772Scael.Ql \&.Sy
1596*50772Scaelmacro
1597*50772Scaelis callable by other macros and may call other macros, except
1598*50772Scaelin the second form.
1599*50772ScaelArguments to
1600*50772Scael.Ql \&.Sy
1601*50772Scaelmay be quoted.
160248888Scael.Ss References and Citations
160348888ScaelThe following macros make a modest attempt to handle references.
1604*50772ScaelAt best, the macros make it convenient to manually drop in a subset of
160548888Scaelrefer style references.
160648888Scael.Pp
160748888Scael.Bl -tag -width 6n -offset indent -compact
160848888Scael.It Li ".Rs"
1609*50772ScaelReference Start.
1610*50772ScaelCauses a line break and begins collection
161148888Scaelof reference information until the
161248888Scaelreference end macro is read.
161348888Scael.It Li ".Re"
1614*50772ScaelReference End.
1615*50772ScaelThe reference is printed.
161648888Scael.It Li ".%A"
161748888ScaelReference author name, one name per invocation.
161848888Scael.It Li ".%B"
161948888ScaelBook title.
1620*50772Scael.It Li ".\&%C"
1621*50772ScaelCity/place.
1622*50772Scael.It Li ".\&%D"
1623*50772ScaelDate.
162448888Scael.It Li ".%J"
1625*50772ScaelJournal name.
162648888Scael.It Li ".%N"
162748888ScaelIssue number.
162848888Scael.It Li ".%O"
162948888ScaelOptional information.
1630*50772Scael.It Li ".%P"
1631*50772ScaelPage number.
163248888Scael.It Li ".%R"
163348888ScaelReport name.
163448888Scael.It Li ".%T"
163548888ScaelTitle of article.
163648888Scael.It Li ".%V"
163748888ScaelVolume(s).
163848888Scael.El
163948888Scael.Pp
1640*50772ScaelThe macros beginning with
164148888Scael.Ql %
1642*50772Scaelare not callable, and are parsed only for the trade name macro which
1643*50772Scaelreturns to its caller.
1644*50772Scael(And not very predictably at the moment either.)
1645*50772ScaelThe purpose is to allow trade names
1646*50772Scaelto be pretty printed in troff/ditroff output.
1647*50772Scael.Ss Trade Names (or Acronyms and Type Names)
1648*50772ScaelThe trade name macro is generally a small caps macro for
1649*50772Scaelall upper case words longer than two characters.
165043435Scael.Pp
1651*50772Scael.Dl Usage: .Tn symbol ... \*(Pu
1652*50772Scael.Bl -tag -width ".Tn ASCII" -compact -offset 14n
1653*50772Scael.It Li \&.Tn DEC
1654*50772Scael.Tn DEC
1655*50772Scael.It Li \&.Tn ASCII
1656*50772Scael.Tn ASCII
165748888Scael.El
165843435Scael.Pp
165943435ScaelThe
1660*50772Scael.Ql \&.Tn
166148888Scaelmacro
1662*50772Scaelis parsed and is callable by other macros.
166348888Scael.Ss Extended  Arguments
166448888ScaelThe
166548888Scael.Li \&.Xo
166648888Scaeland
166748888Scael.Li \&.Xc
1668*50772Scaelmacros allow one to extend an argument list
1669*50772Scaelon a macro boundary.
1670*50772ScaelArgument lists cannot
167148888Scaelbe extended within a macro
167248888Scaelwhich expects all of its arguments on one line such
167348888Scaelas
167448888Scael.Ql \&.Op .
1675*50772Scael.Pp
1676*50772ScaelHere is an example of
1677*50772Scael.Ql \&.Xo
1678*50772Scaelusing the space mode macro to turn spacing off:
1679*50772Scael.Bd -literal -offset indent
1680*50772Scael\&.Sm off
1681*50772Scael\&.It Xo Sy I Ar operation
1682*50772Scael\&.No \en Ar count No \en
1683*50772Scael\&.Xc
1684*50772Scael\&.Sm on
1685*50772Scael.Ed
1686*50772Scael.Pp
1687*50772ScaelProduces
1688*50772Scael.Bd -filled -offset indent
1689*50772Scael.Bl -tag -width flag -compact
1690*50772Scael.Sm off
1691*50772Scael.It Xo Sy I Ar operation
1692*50772Scael.No \en Ar count No \en
1693*50772Scael.Xc
1694*50772Scael.Sm on
1695*50772Scael.El
1696*50772Scael.Ed
1697*50772Scael.Pp
1698*50772ScaelAnother one:
1699*50772Scael.Bd -literal -offset indent
1700*50772Scael\&.Sm off
1701*50772Scael\&.It Cm S No \&/ Ar old_pattern Xo
1702*50772Scael\&.No \&/ Ar new_pattern
1703*50772Scael\&.No \&/ Op Cm g
1704*50772Scael\&.Xc
1705*50772Scael\&.Sm on
1706*50772Scael.Ed
1707*50772Scael.Pp
1708*50772ScaelProduces
1709*50772Scael.Bd -filled -offset indent
1710*50772Scael.Bl -tag -width flag -compact
1711*50772Scael.Sm off
1712*50772Scael.It Cm S No \&/ Ar old_pattern Xo
1713*50772Scael.No \&/ Ar new_pattern
1714*50772Scael.No \&/ Op Cm g
1715*50772Scael.Xc
1716*50772Scael.Sm on
1717*50772Scael.El
1718*50772Scael.Ed
1719*50772Scael.Pp
1720*50772ScaelAnother example of
1721*50772Scael.Ql \&.Xo
1722*50772Scaeland using enclosure macros:
1723*50772ScaelTest the value of an variable.
1724*50772Scael.Bd -literal -offset indent
1725*50772Scael\&.It Xo
1726*50772Scael\&.Ic .ifndef
1727*50772Scael\&.Oo \e&! Oc Ns Ar variable
1728*50772Scael\&.Op Ar operator variable ...
1729*50772Scael\&.Xc
1730*50772Scael.Ed
1731*50772Scael.Pp
1732*50772ScaelProduces
1733*50772Scael.Bd -filled -offset indent
1734*50772Scael.Bl -tag -width flag -compact
1735*50772Scael.It Xo
1736*50772Scael.Ic .ifndef
1737*50772Scael.Oo \&! Oc Ns Ar variable
1738*50772Scael.Op Ar operator variable ...
1739*50772Scael.Xc
1740*50772Scael.El
1741*50772Scael.Ed
1742*50772Scael.Pp
1743*50772ScaelAll of the above examples have used the
1744*50772Scael.Ql \&.Xo
1745*50772Scaelmacro on the argument list of the
1746*50772Scael.Ql \&.It
1747*50772Scael(list-item)
1748*50772Scaelmacro.
1749*50772ScaelThe extend macros are not used very often, and when they are
1750*50772Scaelit is usually to extend the list-item argument list.
1751*50772ScaelUnfortunately, this is also where the extend macros are the
1752*50772Scaelmost finicky.
1753*50772ScaelIn the first two examples, spacing was turned off;
1754*50772Scaelin the third, spacing was desired in part of the output but
1755*50772Scaelnot all of it.
1756*50772ScaelTo make these macros work in this situation make sure
1757*50772Scaelthe
1758*50772Scael.Ql \&.Xo
1759*50772Scaeland
1760*50772Scael.Ql \&.Xc
1761*50772Scaelmacros are placed as shown in the third example.
1762*50772ScaelIf the
1763*50772Scael.Ql \&.Xo
1764*50772Scaelmacro is not alone on the
1765*50772Scael.Ql \&.It
1766*50772Scaelargument list, spacing will be unpredictable.
1767*50772ScaelThe
1768*50772Scael.Ql \&.Ns
1769*50772Scael(no space macro)
1770*50772Scaelmust not occur as the first or last macro on a line
1771*50772Scaelin this situation.
1772*50772ScaelOut of 900 manual pages (about 1800 actual pages)
1773*50772Scaelcurrently released with
1774*50772Scael.Bx
1775*50772Scaelonly fifteen use the
1776*50772Scael.Ql \&.Xo
1777*50772Scaelmacro.
1778*50772Scael.Sh PAGE STRUCTURE DOMAIN
177943435Scael.Ss Section Headers
178048888ScaelThe first three
178148888Scael.Ql \&.Sh
178248888Scaelsection header macros
178348888Scaellist below are required in every
1784*50772Scaelman page.
1785*50772ScaelThe remaining section headers
1786*50772Scaelare recommended at the discretion of the author
1787*50772Scaelwriting the manual page.
1788*50772ScaelThe
178948888Scael.Ql \&.Sh
1790*50772Scaelmacro can take up to nine arguments.
1791*50772ScaelIt may call
179248888Scaelother macros, but it may not be called by other macros.
179348888Scael.Bl -tag -width ".Sh SYNOPSIS"
179448888Scael.It \&.Sh NAME
179543435ScaelThe
179648888Scael.Ql \&.Sh NAME
1797*50772Scaelmacro is mandatory.
1798*50772ScaelIf not specified,
179943435Scaelthe headers, footers and page layout defaults
180043435Scaelwill not be set and things will be rather unpleasant.
1801*50772ScaelThe
1802*50772Scael.Sx NAME
1803*50772Scaelsection consists of at least three items.
180443435ScaelThe first is the
180548888Scael.Ql \&.Nm
180648888Scaelname macro naming the subject of the man page.
180748888ScaelThe second is the Name Description macro,
180848888Scael.Ql \&.Nd ,
180943435Scaelwhich separates the subject
1810*50772Scaelname from the third item, which is the description.
1811*50772ScaelThe
181243435Scaeldescription should be the most terse and lucid possible,
181343435Scaelas the space available is small.
181448888Scael.It \&.Sh SYNOPSIS
1815*50772ScaelThe
1816*50772Scael.Sx SYNOPSIS
1817*50772Scaelsection describes the typical usage of the
1818*50772Scaelsubject of a man page.
1819*50772ScaelThe  macros required
182043435Scaelare either
182148888Scael.Ql ".Nm" ,
182248888Scael.Ql ".Cd" ,
1823*50772Scael.Ql ".Fn" ,
182448888Scael(and possibly
1825*50772Scael.Ql ".Fo" ,
1826*50772Scael.Ql ".Fc" ,
182748888Scael.Ql ".Fd" ,
182848888Scael.Ql ".Ft"
182948888Scaelmacros).
183043435ScaelThe function name
183148888Scaelmacro
183248888Scael.Ql ".Fn"
183343435Scaelis required
183443435Scaelfor manual page sections 2 and 3, the command and general
183548888Scaelname macro
183648888Scael.Ql \&.Nm
183748888Scaelis required for sections 1, 5, 6, 7, 8.
183848888ScaelSection 4 manuals require a
183948888Scael.Ql ".Nm" , ".Fd"
184048888Scaelor a
184148888Scael.Ql ".Cd"
184248888Scaelconfiguration device usage macro.
184348888ScaelSeveral other macros may be necessary to produce
184443435Scaelthe synopsis line as shown below:
184543435Scael.Pp
184648888Scael.Bd -filled -offset indent
184743435Scael.Nm cat
184843435Scael.Op Fl benstuv
184943435Scael.Op Fl
185043435Scael.Ar
185148888Scael.Ed
185243435Scael.Pp
185348888ScaelThe following macros were used:
185443435Scael.Pp
185543435Scael.Dl \&.Nm cat
185648888Scael.Dl \&.Op \&Fl benstuv
185748888Scael.Dl \&.Op \&Fl
185843435Scael.Dl \&.Ar
1859*50772Scael.Sy Note :
1860*50772ScaelThe macros
1861*50772Scael.Ql \&.Op ,
1862*50772Scael.Ql \&.Fl ,
1863*50772Scaeland
1864*50772Scael.Ql \&.Ar
1865*50772Scaelrecognize the pipe bar character
1866*50772Scael.Ql \*(Ba , so
1867*50772Scaela command line such as:
1868*50772Scael.Pp
1869*50772Scael.Dl ".Op Fl a | Fl b"
1870*50772Scael.Pp
1871*50772Scaelwill not go into outer space.
1872*50772Scael.Xr Troff
1873*50772Scaelnormally interprets a \*(Ba as a special operator.
1874*50772ScaelSee
1875*50772Scael.Sx PREDEFINED STRINGS
1876*50772Scaelfor a usable \*(Ba
1877*50772Scaelcharacter in other situations.
187848888Scael.It \&.Sh DESCRIPTION
1879*50772ScaelIn most cases the first text in the
1880*50772Scael.Sx DESCRIPTION
1881*50772Scaelsection
188243435Scaelis a brief paragraph on the command, function or file,
188343435Scaelfollowed by a lexical list of options and respective
1884*50772Scaelexplanations.
1885*50772ScaelTo create such a list, the
188648888Scael.Ql \&.Bl
188748888Scaelbegin-list,
188848888Scael.Ql \&.It
188948888Scaellist-item and
189048888Scael.Ql \&.El
189148888Scaelend-list
189248888Scaelmacros are used (see
189348888Scael.Sx Lists and Columns
189448888Scaelbelow).
189548888Scael.El
189643435Scael.Pp
189743435ScaelThe following
189848888Scael.Ql \&.Sh
189943435Scaelsection headers are part of the
190043435Scaelpreferred manual page layout and must be used appropriately
1901*50772Scaelto maintain consistency.
1902*50772ScaelThey are listed in the order
190343435Scaelin which they would be used.
190448888Scael.Bl -tag -width SYNOPSIS
190548888Scael.It \&.Sh ENVIRONMENT
1906*50772ScaelThe
1907*50772Scael.Sx ENVIRONMENT
1908*50772Scaelsection should reveal any related
190943435Scaelenvironment
1910*50772Scaelvariables and clues to their behavior and/or usage.
191148888Scael.It \&.Sh EXAMPLES
1912*50772ScaelThere are several ways to create examples.
1913*50772ScaelSee
1914*50772Scaelthe
1915*50772Scael.Sx EXAMPLES
1916*50772Scaelsection below
191743435Scaelfor details.
191848888Scael.It \&.Sh FILES
191943435ScaelFiles which are used or created by the man page subject
192043435Scaelshould be listed via the
192148888Scael.Ql \&.Pa
1922*50772Scaelmacro in the
1923*50772Scael.Sx FILES
1924*50772Scaelsection.
192548888Scael.It \&.Sh SEE ALSO
192643435ScaelReferences to other material on the man page topic and
192743435Scaelcross references to other relevant man pages should
1928*50772Scaelbe placed in the
1929*50772Scael.Sx SEE ALSO
1930*50772Scaelsection.
1931*50772ScaelCross references
193243435Scaelare specified using the
193348888Scael.Ql \&.Xr
1934*50772Scaelmacro.
1935*50772ScaelAt this time
193643435Scael.Xr refer 1
193743435Scaelstyle references are not accommodated.
193848888Scael.It \&.Sh STANDARDS
193943435ScaelIf the command, library function or file adheres to a
1940*50772Scaelspecific implementation such as
1941*50772Scael.St -p1003.2
1942*50772Scaelor
1943*50772Scael.St -ansiC
1944*50772Scaelthis should be noted here.
1945*50772ScaelIf the
194643435Scaelcommand does not adhere to any standard, its history
1947*50772Scaelshould be noted in the
1948*50772Scael.Sx HISTORY
1949*50772Scaelsection.
195048888Scael.It \&.Sh HISTORY
195143435ScaelAny command which does not adhere to any specific standards
195243435Scaelshould be outlined historically in this section.
195348888Scael.It \&.Sh AUTHORS
195443435ScaelCredits, if need be, should be placed here.
195548888Scael.It \&.Sh DIAGNOSTICS
195643435ScaelDiagnostics from a command should be placed in this section.
195748888Scael.It \&.Sh ERRORS
195843435ScaelSpecific error handling, especially from library functions
1959*50772Scael(man page sections 2 and 3) should go here.
1960*50772ScaelThe
196148888Scael.Ql \&.Er
196248888Scaelmacro is used to specify an errno.
196348888Scael.It \&.Sh BUGS
196443435ScaelBlatant problems with the topic go here...
196548888Scael.El
196643435Scael.Pp
196748888ScaelUser specified
196848888Scael.Ql \&.Sh
196948888Scaelsections may be added,
197048888Scaelfor example, this section was set with:
197148888Scael.Bd -literal -offset 14n
197248888Scael\&.Sh PAGE LAYOUT MACROS
197348888Scael.Ed
197443435Scael.Ss Paragraphs and Line Spacing.
197548888Scael.Bl -tag -width 6n
197648888Scael.It \&.Pp
197743435ScaelThe \&.Pp paragraph command may
197843435Scaelbe used to specify a line space where necessary.
197948888ScaelThe macro is not necessary after a
198048888Scael.Ql \&.Sh
198143435Scaelor
198248888Scael.Ql \&.Ss
198348888Scaelmacro or before
198443435Scaela
198548888Scael.Ql \&.Bl
198648888Scaelmacro.
198748888Scael(The
198848888Scael.Ql \&.Bl
198948888Scaelmacro asserts a vertical distance unless the -compact flag is given).
199048888Scael.El
1991*50772Scael.\" This worked with version one, need to redo for version three
199248888Scael.\" .Pp
199348888Scael.\" .Ds I
199448888Scael.\" .Cw (ax+bx+c) \ is\ produced\ by\ \&
199548888Scael.\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
199648888Scael.\" .Cl Cx \t\t
199748888Scael.\" .Li \&.Cx\ (
199848888Scael.\" .Cx
199948888Scael.\" .Cl Cx \t\t
200048888Scael.\" .Li \&.Va ax
200148888Scael.\" .Cx
200248888Scael.\" .Cl Cx \t\t
200348888Scael.\" .Li \&.Sy \+
200448888Scael.\" .Cx
200548888Scael.\" .Cl Cx \&(\&
200648888Scael.\" .Va ax
200748888Scael.\" .Cx +
200848888Scael.\" .Va by
200948888Scael.\" .Cx +
201048888Scael.\" .Va c )
201148888Scael.\" .Cx \t
201248888Scael.\" .Em is produced by
201348888Scael.\" .Cx \t
201448888Scael.\" .Li \&.Va by
201548888Scael.\" .Cx
201648888Scael.\" .Cl Cx \t\t
201748888Scael.\" .Li \&.Sy \+
201848888Scael.\" .Cx
201948888Scael.\" .Cl Cx \t\t
202048888Scael.\" .Li \&.Va c )
202148888Scael.\" .Cx
202248888Scael.\" .Cl Cx \t\t
202348888Scael.\" .Li \&.Cx
202448888Scael.\" .Cx
202548888Scael.\" .Cw
202648888Scael.\" .De
202748888Scael.\" .Pp
2028*50772Scael.\" This example shows the same equation in a different format.
2029*50772Scael.\" The spaces
203048888Scael.\" around the
203148888Scael.\" .Li \&+
203248888Scael.\" signs were forced with
203348888Scael.\" .Li \e :
203448888Scael.\" .Pp
203548888Scael.\" .Ds I
203648888Scael.\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
203748888Scael.\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
203848888Scael.\" .Cl Cx \t\t
203948888Scael.\" .Li \&.Cx\ (
204048888Scael.\" .Cx
204148888Scael.\" .Cl Cx \t\t
204248888Scael.\" .Li \&.Va a
204348888Scael.\" .Cx
204448888Scael.\" .Cl Cx \t\t
204548888Scael.\" .Li \&.Sy x
204648888Scael.\" .Cx
204748888Scael.\" .Cl Cx \t\t
204848888Scael.\" .Li \&.Cx \e\ +\e\ \e&
204948888Scael.\" .Cx
205048888Scael.\" .Cl Cx \&(\&
205148888Scael.\" .Va a
205248888Scael.\" .Sy x
205348888Scael.\" .Cx \ +\ \&
205448888Scael.\" .Va b
205548888Scael.\" .Sy y
205648888Scael.\" .Cx \ +\ \&
205748888Scael.\" .Va c )
205848888Scael.\" .Cx \t
205948888Scael.\" .Em is produced by
206048888Scael.\" .Cl Cx \t\t
206148888Scael.\" .Li \&.Va b
206248888Scael.\" .Cx
206348888Scael.\" .Cl Cx \t\t
206448888Scael.\" .Li \&.Sy y
206548888Scael.\" .Cx
206648888Scael.\" .Cl Cx \t\t
206748888Scael.\" .Li \&.Cx \e\ +\e\ \e&
206848888Scael.\" .Cx
206948888Scael.\" .Cl Cx \t\t
207048888Scael.\" .Li \&.Va c )
207148888Scael.\" .Cx
207248888Scael.\" .Cl Cx \t\t
207348888Scael.\" .Li \&.Cx
207448888Scael.\" .Cx
207548888Scael.\" .Cw
207648888Scael.\" .De
207748888Scael.\" .Pp
207848888Scael.\" The incantation below was
207948888Scael.\" lifted from the
208048888Scael.\" .Xr adb 1
208148888Scael.\" manual page:
208248888Scael.\" .Pp
208348888Scael.\" .Ds I
208448888Scael.\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
208548888Scael.\" .Cl Cx \t\t
208648888Scael.\" .Li \&.Cx Op Sy ?/
208748888Scael.\" .Cx
208848888Scael.\" .Cl Cx \t\t
208948888Scael.\" .Li \&.Nm m
209048888Scael.\" .Cx
209148888Scael.\" .Cl Cx Op Sy ?/
209248888Scael.\" .Nm m
209348888Scael.\" .Ad \ b1 e1 f1
209448888Scael.\" .Op Sy ?/
209548888Scael.\" .Cx \t
209648888Scael.\" .Em is produced by
209748888Scael.\" .Cx \t
209848888Scael.\" .Li \&.Ar \e\ b1 e1 f1
209948888Scael.\" .Cx
210048888Scael.\" .Cl Cx \t\t
210148888Scael.\" .Li \&.Op Sy ?/
210248888Scael.\" .Cx
210348888Scael.\" .Cl Cx \t\t
210448888Scael.\" .Li \&.Cx
210548888Scael.\" .Cx
210648888Scael.\" .Cw
210748888Scael.\" .De
210848888Scael.\" .Pp
2109*50772Scael.Ss Keeps
2110*50772ScaelThe only keep that is implemented at this time is for words.
2111*50772ScaelThe macros are
2112*50772Scael.Ql \&.Bk
2113*50772Scael(begin-keep)
2114*50772Scaeland
2115*50772Scael.Ql \&.Ek
2116*50772Scael(end-keep).
2117*50772ScaelThe only option that
2118*50772Scael.Ql \&.Bl
2119*50772Scaelaccepts is
2120*50772Scael.Fl words
2121*50772Scaeland is useful for preventing line breaks in the middle of options.
2122*50772ScaelIn the example for the make command line arguments (see
2123*50772Scael.Sx What's in a name ) ,
2124*50772Scaelthe keep prevented
2125*50772Scael.Xr nroff
2126*50772Scaelfrom placing up the
2127*50772Scaelflag and the argument
2128*50772Scaelon separate lines.
2129*50772Scael(Actually, the option macro used to prevent this from occurring,
2130*50772Scaelbut was dropped when the decision (religious) was made to force
2131*50772Scaelright justified margins in
2132*50772Scael.Xr troff
2133*50772Scaelas options in general look atrocious when spread across a sparse
2134*50772Scaelline.
2135*50772ScaelMore work needs to be done with the keep macros, a
2136*50772Scael.Fl line
2137*50772Scaeloption needs to be added.)
213848888Scael.Ss Examples and Displays
213948888ScaelThere are five types of displays, a quickie one line indented display
214048888Scael.Ql \&.D1 ,
214148888Scaela quickie one line literal display
214248888Scael.Ql \&.Dl ,
2143*50772Scaeland a block literal, block filled and block ragged which use
214448888Scaelthe
214548888Scael.Ql \&.Bd
214648888Scaelbegin-display
214748888Scaeland
214848888Scael.Ql \&.Ed
214948888Scaelend-display macros.
215043435Scael.Pp
2151*50772Scael.Bl -tag -width \&.Dlxx
215248888Scael.It Li \&.D1
215348888Scael(D-one) Display one line of indented text.
2154*50772ScaelThis macro is parsed, but it is not callable.
215543435Scael.Pp
2156*50772Scael.Dl Fl ldghfstru
215743435Scael.Pp
2158*50772ScaelThe above was produced by:
2159*50772Scael.Li \&.Dl Fl ldghfstru .
216048888Scael.It Li \&.Dl
216148888Scael(D-ell)
216248888ScaelDisplay one line of indented
216348888Scael.Em literal
2164*50772Scaeltext.
2165*50772ScaelThe
216648888Scael.Ql \&.Dl
216748888Scaelexample macro has been used throughout this
2168*50772Scaelfile.
2169*50772ScaelIt allows
217048888Scaelthe indent (display) of one line of text.
217148888ScaelIts default font is set to
217248888Scaelconstant width (literal) however
2173*50772Scaelit is parsed and will recognized other macros.
2174*50772ScaelIt is not callable however.
217543435Scael.Pp
2176*50772Scael.Dl % ls -ldg /usr/local/bin
217748888Scael.Pp
2178*50772ScaelThe above was produced by
2179*50772Scael.Li \&.Dl % ls -ldg /usr/local/bin .
218048888Scael.It Li \&.Bd
2181*50772ScaelBegin-display.
2182*50772ScaelThe
218348888Scael.Ql \&.Bd
218448888Scaeldisplay must be ended with the
218548888Scael.Ql \&.Ed
2186*50772Scaelmacro.
2187*50772ScaelDisplays may be nested within displays and
218848888Scaellists.
218948888Scael.Ql \&.Bd
219048888Scaelhas the following syntax:
219143435Scael.Pp
2192*50772Scael.Dl ".Bd display-type [-offset offset_value] [-compact]"
219343435Scael.Pp
219448888ScaelThe display-type must be one of the following four types and
219548888Scaelmay have an offset specifier for indentation:
219648888Scael.Ql \&.Bd .
219743435Scael.Pp
2198*50772Scael.Bl -tag -width "file file_name  " -compact
219948888Scael.It Fl ragged
220043435ScaelDisplay a block of text as typed,
220148888Scaelright (and left) margin edges are left ragged.
220248888Scael.It Fl filled
220348888ScaelDisplay a filled (formatted) block.
220448888ScaelThe block of text is formatted (the edges are filled \-
2205*50772Scaelnot left unjustified).
220648888Scael.It Fl literal
220748888ScaelDisplay a literal block, useful for source code or
220848888Scaelsimple tabbed or spaced text.
220948888Scael.It Fl file Ar file_name
221048888ScaelThe file name following the
221148888Scael.Fl file
2212*50772Scaelflag is read and displayed.
2213*50772ScaelLiteral mode is
221448888Scaelasserted and tabs are set at 8 constant width character
221548888Scaelintervals, however any
221648888Scael.Xr troff/ Ns Nm \-mdoc
221748888Scaelcommands in file will be processed.
221848888Scael.It Fl offset Ar string
221948888ScaelIf
222048888Scael.Fl offset
222148888Scaelis specified with one of the following strings, the string
222248888Scaelis interpreted to indicate the level of indentation for the
222348888Scaelforthcoming block of text:
222448888Scael.Pp
2225*50772Scael.Bl -tag -width "indent-two" -compact
222648888Scael.It Ar left
222743435ScaelAlign block on the current left margin,
222843435Scaelthis is the default mode of
222948888Scael.Ql \&.Bd .
223048888Scael.It Ar center
2231*50772ScaelSupposedly center the block.
2232*50772ScaelAt this time
223343435Scaelunfortunately, the block merely gets
223443435Scaelleft aligned about an imaginary center margin.
223548888Scael.It Ar indent
2236*50772ScaelIndents by one default indent value or tab.
2237*50772ScaelThe default
223848888Scaelindent value is also used for the
223948888Scael.Ql \&.D1
2240*50772Scaeldisplay so one is guaranteed the two types of displays
2241*50772Scaelwill line up.
2242*50772ScaelThis indent is normally set to 6n or about two
224348888Scaelthirds of an inch (six constant width characters).
224448888Scael.It Ar indent-two
224548888ScaelIndents two times the default indent value.
224648888Scael.It Ar right
224748888ScaelThis
224848888Scael.Em left
224948888Scaelaligns the block about two inches from
2250*50772Scaelthe right side of the page.
2251*50772ScaelThis macro needs
2252*50772Scaelwork and perhaps may never do the right thing by
225348888Scael.Xr troff .
225448888Scael.El
225548888Scael.El
225648888Scael.It ".Ed"
225748888ScaelEnd-display.
225848888Scael.El
225948888Scael.Ss Tagged Lists and Columns
226048888ScaelThere are several types of lists which may be initiated with the
226148888Scael.Ql ".Bl"
2262*50772Scaelbegin-list macro.
2263*50772ScaelItems within the list
226448888Scaelare specified with the
226548888Scael.Ql ".It"
226648888Scaelitem macro and
226748888Scaeleach list must end with the
226848888Scael.Ql ".El"
2269*50772Scaelmacro.
2270*50772ScaelLists may be nested within themselves and within displays.
227148888ScaelColumns may be used inside of lists, but lists are unproven
227248888Scaelinside of columns.
227343435Scael.Pp
227448888ScaelIn addition, several list attributes may be specified such as
227548888Scaelthe width of a tag, the list offset, and compactness specified
227648888Scael(blank lines between items allowed or disallowed).
2277*50772ScaelMost of this document has been formatted with a tag style list
2278*50772Scael.Pq Fl tag .
2279*50772ScaelFor a change of pace, the list-type used to present the list-types
2280*50772Scaelis an over-hanging list
2281*50772Scael.Pq Fl ohang .
2282*50772ScaelThis type of list is quite popular with
2283*50772Scael.Tn TeX
2284*50772Scaelusers, but looks a bit funny after having read many pages of
2285*50772Scaeltagged lists.
228648888ScaelThe following list types are accepted by
2287*50772Scael.Ql ".Bl" :
228843435Scael.Pp
228948888Scael.Bl -ohang -compact
229048888Scael.It Fl bullet
229148888Scael.It Fl item
229248888Scael.It Fl enum
2293*50772ScaelThese three are the simplest types of lists.
2294*50772ScaelOnce the
229548888Scael.Ql ".Bl"
229648888Scaelmacro has been given, items in the list are merely
229748888Scaelindicated by a line consisting solely of the
229848888Scael.Ql ".It"
2299*50772Scaelmacro.
2300*50772ScaelFor example, the source text for a simple enumerated list
230148888Scaelwould look like:
230248888Scael.Bd -literal -offset indent-two
230348888Scael\&.Bl -enum -compact
230448888Scael\&.It
230548888Scael\&Item one goes here.
230648888Scael\&.It
230748888Scael\&And item two here.
230848888Scael\&.It
230948888Scael\&Lastly item three goes here.
231048888Scael\&.El
231148888Scael.Ed
231243435Scael.Pp
231348888ScaelThe results:
231443435Scael.Pp
231548888Scael.Bl -enum -offset indent-two -compact
231648888Scael.It
231748888ScaelItem one goes here.
231848888Scael.It
231948888ScaelAnd item two here.
232048888Scael.It
232148888ScaelLastly item three goes here.
232248888Scael.El
232343435Scael.Pp
232448888ScaelA simple bullet list construction:
232548888Scael.Bd -literal -offset indent-two
232648888Scael\&.Bl -bullet -compact
232748888Scael\&.It
232848888Scael\&Bullet one goes here.
232948888Scael\&.It
233048888Scael\&Bullet two here.
233148888Scael\&.El
233248888Scael.Ed
233343435Scael.Pp
233448888ScaelProduces:
233548888Scael.Bl -bullet -offset indent-two -compact
233648888Scael.It
233748888ScaelBullet one goes here.
233848888Scael.It
233948888ScaelBullet two here.
234048888Scael.El
234143435Scael.Pp
234248888Scael.It Fl tag
234348888Scael.It Fl diag
234448888Scael.It Fl hang
234548888Scael.It Fl ohang
234648888Scael.It Fl inset
234748888ScaelThese list-types collect arguments specified with the
234848888Scael.Ql \&.It
234948888Scaelmacro and create a label which may be
235048888Scael.Em inset
235148888Scaelinto the forth coming text,
235248888Scael.Em hanged
2353*50772Scaelfrom the forth coming text,
235448888Scael.Em overhanged
2355*50772Scaelhung above and not offset from the forth coming paragraph or
2356*50772Scael.Em tagged .
2357*50772ScaelThis
235848888Scaellist was constructed with the
235948888Scael.Ql Fl ohang
2360*50772Scaellist-type.
2361*50772ScaelThe
236248888Scael.Ql \&.It
236348888Scaelmacro may call any callable macros for the inset, hang
236448888Scaeland tag list-types, but will not call macros for the
236548888Scaeldiag type.
236648888ScaelHere is an example of inset labels:
236748888Scael.Bl -inset -offset indent
236848888Scael.It Em Tag
236948888ScaelThe tagged list (also called a tagged paragraph) is the
237048888Scaelmost common type of list used in the Berkeley manuals.
237148888Scael.It Em Diag
237248888ScaelDiag lists create section four diagnostic lists
237348888Scaeland are similar to inset lists except callable
237448888Scaelmacros are ignored.
237548888Scael.It Em Hang
237648888ScaelHanged labels are a matter of taste.
237748888Scael.It Em Ohang
237848888ScaelOver hanging labels are nice when space is constrained.
237948888Scael.It Em Inset
238048888ScaelInset labels are useful for controlling blocks of
238148888Scaelparagraphs and are valuable for converting
238248888Scael.Nm \-mdoc
238348888Scaelmanuals to other formats.
238448888Scael.El
238543435Scael.Pp
238648888ScaelHere is the source text which produced the above example:
238748888Scael.Bd -literal -offset indent
238848888Scael\&.Bl -inset -offset indent
238948888Scael\&.It Em Tag
239048888Scael\&The tagged list (also called a tagged paragraph) is the
239148888Scael\&most common type of list used in the Berkeley manuals.
239248888Scael\&.It Em Diag
239348888Scael\&Diag lists create section four diagnostic lists
239448888Scael\&and are similar to inset lists except callable
239548888Scael\&macros are ignored.
239648888Scael\&.It Em Hang
239748888Scael\&Hanged labels are a matter of taste.
239848888Scael\&.It Em Ohang
239948888Scael\&Over hanging labels are nice when space is constrained.
240048888Scael\&.It Em Inset
240148888Scael\&Inset labels are useful for controlling blocks of
240248888Scael\&paragraphs and are valuable for converting
240348888Scael\&.Nm \-mdoc
240448888Scael\&manuals to other formats.
240548888Scael\&.El
240648888Scael.Ed
240743435Scael.Pp
240848888ScaelHere is a hanged list with just one item:
240948888Scael.Bl -hang -offset indent
241048888Scael.It Em Hanged
241148888Scaellabels appear similar to tagged lists when the
241248888Scaellabel is smaller than the label width.
241348888Scael.It Em Longer hanged list labels
241448888Scaelblend in to the paragraph unlike
241548888Scaeltagged paragraph labels.
241648888Scael.El
241743435Scael.Pp
2418*50772ScaelAnd the unformatted text which created it:
241948888Scael.Bd -literal -offset indent
242048888Scael\&.Bl -hang -offset indent
242148888Scael\&.It Em Hanged
242248888Scael\&labels appear similar to tagged lists when the
242348888Scael\&label is smaller than the label width.
242448888Scael\&.It Em Longer hanged list labels
242548888Scael\&blend in to the paragraph unlike
242648888Scael\&tagged paragraph labels.
242748888Scael\&.El
242848888Scael.Ed
242948888Scael.Pp
2430*50772ScaelThe tagged list which follows uses an optional width specifier to control
243148888Scaelthe width of the tag.
243248888Scael.Pp
243348888Scael.Bl -tag -width "PAGEIN 10" -compact -offset indent
243448888Scael.It SL 10
243543435Scaelsleep time of the process (seconds blocked)
243648888Scael.It PAGEIN 10
2437*50772Scaelnumber of disk I/O's resulting from references
243848888Scaelby the process to pages not loaded in core.
243948888Scael.It UID 10
244043435Scaelnumerical user-id of process owner
244148888Scael.It PPID 10
244248888Scaelnumerical id of parent of process process priority
244348888Scael(non-positive when in non-interruptible wait)
244448888Scael.El
244543435Scael.Pp
244643435ScaelThe raw text:
244748888Scael.Bd -literal -offset indent
244848888Scael\&.Bl -tag -width "PAGEIN 10" -compact -offset indent
244948888Scael\&.It SL 10
245048888Scael\&sleep time of the process (seconds blocked)
245148888Scael\&.It PAGEIN 10
2452*50772Scael\&number of disk I/O's resulting from references
245348888Scael\&by the process to pages not loaded in core.
245448888Scael\&.It UID 10
245548888Scael\&numerical user-id of process owner
245648888Scael\&.It PPID 10
245748888Scael\&numerical id of parent of process process priority
245848888Scael\&(non-positive when in non-interruptible wait)
245948888Scael\&.El
246048888Scael.Ed
246143435Scael.Pp
246248888ScaelAcceptable width specifiers:
246348888Scael.Bl -tag -width Ar -offset indent
246448888Scael.It Fl width Ar "\&Fl"
2465*50772Scaelsets the width to the default width for a flag.
2466*50772ScaelAll callable
2467*50772Scaelmacros have a default width value.
2468*50772ScaelThe
246948888Scael.Ql \&.Fl ,
247048888Scaelvalue is presently
247148888Scaelset to ten constant width characters or about five sixth of
247248888Scaelan inch.
247348888Scael.It Fl width Ar "24n"
247448888Scaelsets the width to 24 constant width characters or about two
2475*50772Scaelinches.
2476*50772ScaelThe
247748888Scael.Ql n
247848888Scaelis absolutely necessary for the scaling to work correctly.
247948888Scael.It Fl width Ar "ENAMETOOLONG"
248048888Scaelsets width to the constant width length of the
248148888Scaelstring given.
248248888Scael.It Fl width  Ar "\\*qint mkfifo\\*q"
248348888Scaelagain, the width is set to the constant width of the string
248448888Scaelgiven.
248548888Scael.El
248643435Scael.Pp
248748888ScaelIf a width is not specified for the tag list type, the first
248848888Scaeltime
248948888Scael.Ql \&.It
249048888Scaelis invoked, an attempt is made to determine an appropriate
2491*50772Scaelwidth.
2492*50772ScaelIf the first argument to
249348888Scael.Ql ".It"
249448888Scaelis a callable macro, the default width for that macro will be used
2495*50772Scaelas if the macro name had been supplied as the width.
2496*50772ScaelHowever,
249748888Scaelif another item in the list is given with a different callable
2498*50772Scaelmacro name, a new and nested list is assumed.
2499*50772Scael.Sh PREDEFINED STRINGS
2500*50772ScaelThe following strings are predefined as may be used by
2501*50772Scaelpreceding with the troff string interpreting sequence
2502*50772Scael.Ql \&\e*(xx
2503*50772Scaelwhere
2504*50772Scael.Em xx
2505*50772Scaelis the name of the defined string or as
2506*50772Scael.Ql \&\e*x
2507*50772Scaelwhere
2508*50772Scael.Em x
2509*50772Scaelis the name of the string.
2510*50772ScaelThe interpreting sequence may be used any where in the text.
2511*50772Scael.Pp
2512*50772Scael.Bl -column "String " "Nroff " "Troff " -offset indent
2513*50772Scael.It Sy "String	Nroff	Troff"
2514*50772Scael.It Li "<=" Ta \&<\&= Ta \*(<=
2515*50772Scael.It Li ">=" Ta \&>\&= Ta \*(>=
2516*50772Scael.It Li "Rq" Ta "''" Ta \*(Rq
2517*50772Scael.It Li "Lq" Ta "``" Ta \*(Lq
2518*50772Scael.It Li "ua" Ta ^ Ta \*(ua
2519*50772Scael.It Li "aa" Ta ' Ta \*(aa
2520*50772Scael.It Li "ga" Ta \` Ta \*(ga
2521*50772Scael.\" .It Li "sL" Ta ` Ta \*(sL
2522*50772Scael.\" .It Li "sR" Ta ' Ta \*(sR
2523*50772Scael.It Li "q" Ta \&" Ta \*q
2524*50772Scael.It Li "Pi" Ta pi Ta \*(Pi
2525*50772Scael.It Li "Ne" Ta != Ta \*(Ne
2526*50772Scael.It Li "Le" Ta <= Ta \*(Le
2527*50772Scael.It Li "Ge" Ta >= Ta \*(Ge
2528*50772Scael.It Li "Lt" Ta < Ta \*(Gt
2529*50772Scael.It Li "Gt" Ta > Ta \*(Lt
2530*50772Scael.It Li "Pm" Ta +- Ta \*(Pm
2531*50772Scael.It Li "If" Ta infinity Ta \*(If
2532*50772Scael.It Li "Na" Ta \fINaN\fP Ta \*(Na
2533*50772Scael.It Li "Ba" Ta \fR\&|\fP Ta \*(Ba
2534*50772Scael.El
2535*50772Scael.Pp
2536*50772Scael.Sy Note :
2537*50772ScaelThe string named
2538*50772Scael.Ql q
2539*50772Scaelshould be written as
2540*50772Scael\e*q since it is only one char.
254148888Scael.Sh DIAGNOSTICS
254248888ScaelThe debugging facilities for
254348888Scael.Nm \-mdoc
254448888Scaelare limited, but can help detect subtle errors such
254548888Scaelas the collision of an argument name with an internal
2546*50772Scaelregister or macro name.
2547*50772Scael(A what?)
254848888ScaelA register is an arithmetic storage class for
254948888Scael.Xr troff
255048888Scaelwith a one or two character name.
255148888ScaelAll registers internal to
255248888Scael.Nm \-mdoc
255348888Scaelfor
255448888Scael.Xr troff
255548888Scaeland
255648888Scael.Xr ditroff
255748888Scaelare two characters and
2558*50772Scaelof the form <upper_case><lower_case> such as
255948888Scael.Ql \&Ar ,
2560*50772Scael<lower_case><upper_case> as
256148888Scael.Ql \&aR
256243435Scaelor
256348888Scael<upper or lower letter><digit> as
256448888Scael.Ql \&C\&1 .
256548888ScaelAnd adding to the muddle,
256648888Scael.Xr troff
256748888Scaelhas its own internal registers all of which are either
2568*50772Scaeltwo lower case characters or a dot plus a letter or meta-character
256948888Scaelcharacter.
257048888ScaelIn one of the introduction examples, it was shown how to
257148888Scaelprevent the interpretation of a macro name with the escape sequence
257248888Scael.Ql \e& .
257348888ScaelThis is sufficient for the internal register names also.
257443435Scael.Pp
257548888Scael.\" Every callable macro name has a corresponding register
2576*50772Scael.\" of the same name (<upper_case><lower_case>).
257748888Scael.\" There are also specific registers which have
257848888Scael.\" been used for stacks and arrays and are listed in the
257948888Scael.\" .Sx Appendix .
258048888Scael.\" .Bd -ragged -offset 4n
258148888Scael.\" [A-Z][a-z]	registers corresponding to macro names (example ``Ar'')
258248888Scael.\" [a-z][A-Z]	registers corresponding to macro names (example ``aR'')
258348888Scael.\" C[0-9]		argument types (example C1)
258448888Scael.\" O[0-9]		offset stack (displays)
258548888Scael.\" h[0-9]		horizontal spacing stack (lists)
258648888Scael.\" o[0-9]		offset (stack) (lists)
258748888Scael.\" t[0-9]		tag stack (lists)
258848888Scael.\" v[0-9]		vertical spacing stack (lists)
258948888Scael.\" w[0-9]		width tag/label stack
259048888Scael.\" .Ed
259148888Scael.\" .Pp
259248888ScaelIf a non-escaped register name is given in the argument list of a request
2593*50772Scaelunpredictable behavior will occur.
2594*50772ScaelIn general, any time huge portions
259548888Scaelof text do not appear where expected in the output, or small strings
259648888Scaelsuch as list tags disappear, chances are there is a misunderstanding
259748888Scaelabout an argument type in the argument list.
259848888ScaelYour mother never intended for you to remember this evil stuff - so here
259948888Scaelis a way to find out whether or not your arguments are valid: The
260048888Scael.Ql \&.Db
260148888Scael(debug)
260248888Scaelmacro displays the interpretation of the argument list for most
2603*50772Scaelmacros.
2604*50772ScaelMacros such as the
260548888Scael.Ql \&.Pp
260648888Scael(paragraph)
2607*50772Scaelmacro do not contain debugging information.
2608*50772ScaelAll of the callable macros do,
260948888Scaeland it is strongly advised whenever in doubt,
261048888Scaelturn on the
261148888Scael.Ql \&.Db
261248888Scaelmacro.
261343435Scael.Pp
261448888Scael.Dl Usage: \&.Db [on | off]
261543435Scael.Pp
261648888ScaelAn example of a portion of text with
261748888Scaelthe debug macro placed above and below an
261848888Scaelartificially created problem (a flag argument
261948888Scael.Ql \&aC
262048888Scaelwhich should be
262148888Scael.Ql \e&aC
262248888Scaelin order to work):
262348888Scael.Bd -literal -offset indent
262448888Scael\&.Db on
262548888Scael\&.Op Fl aC Ar file )
262648888Scael\&.Db off
262748888Scael.Ed
262843435Scael.Pp
262948888ScaelThe resulting output:
263048888Scael.Bd -literal -offset indent
263148888ScaelDEBUGGING ON
263248888ScaelDEBUG(argv) MACRO: `.Op'  Line #: 2
263348888Scael	Argc: 1  Argv: `Fl'  Length: 2
263448888Scael	Space: `'  Class: Executable
263548888Scael	Argc: 2  Argv: `aC'  Length: 2
263648888Scael	Space: `'  Class: Executable
263748888Scael	Argc: 3  Argv: `Ar'  Length: 2
263848888Scael	Space: `'  Class: Executable
263948888Scael	Argc: 4  Argv: `file'  Length: 4
264048888Scael	Space: ` '  Class: String
264148888Scael	Argc: 5  Argv: `)'  Length: 1
264248888Scael	Space: ` '  Class: Closing Punctuation or suffix
264348888Scael	MACRO REQUEST: .Op Fl aC Ar file )
264448888ScaelDEBUGGING OFF
264548888Scael.Ed
264643435Scael.Pp
264748888ScaelThe first line of information tells the name of the calling
264848888Scaelmacro, here
264948888Scael.Ql \&.Op ,
2650*50772Scaeland the line number it appears on.
2651*50772ScaelIf one or more files are involved
265248888Scael(especially if text from another file is included) the line number
2653*50772Scaelmay be bogus.
2654*50772ScaelIf there is only one file, it should be accurate.
265548888ScaelThe second line gives the argument count, the argument
265648888Scael.Pq Ql \&Fl
2657*50772Scaeland its length.
2658*50772ScaelIf the length of an argument is two characters, the
265948888Scaelargument is tested to see if it is executable (unfortunately, any
266048888Scaelregister which contains a non-zero value appears executable).
266148888ScaelThe third line gives the space allotted for a class, and the
2662*50772Scaelclass type.
2663*50772ScaelThe problem here is the argument aC should not be
2664*50772Scaelexecutable.
2665*50772ScaelThe four types of classes are string, executable, closing
2666*50772Scaelpunctuation and opening punctuation.
2667*50772ScaelThe last line shows the entire
2668*50772Scaelargument list as it was read.
2669*50772ScaelIn this next example, the offending
267048888Scael.Ql \&aC
267148888Scaelis escaped:
267248888Scael.Bd -literal -offset indent
267348888Scael\&.Db on
267448888Scael\&.Em An escaped \e&aC
267548888Scael\&.Db off
267648888Scael.Ed
267748888Scael.Bd -literal -offset indent
267848888ScaelDEBUGGING ON
267948888ScaelDEBUG(fargv) MACRO: `.Em'  Line #: 2
268048888Scael	Argc: 1  Argv: `An'  Length: 2
268148888Scael	Space: ` '  Class: String
268248888Scael	Argc: 2  Argv: `escaped'  Length: 7
268348888Scael	Space: ` '  Class: String
268448888Scael	Argc: 3  Argv: `aC'  Length: 2
268548888Scael	Space: ` '  Class: String
268648888Scael	MACRO REQUEST: .Em An escaped &aC
268748888ScaelDEBUGGING OFF
268848888Scael.Ed
268943435Scael.Pp
269048888ScaelThe argument
269148888Scael.Ql \e&aC
269248888Scaelshows up with the same length of 2 as the
269348888Scael.Ql \e&
269448888Scaelsequence produces a zero width, but a register
269548888Scaelnamed
269648888Scael.Ql \e&aC
269748888Scaelwas not found and the type classified as string.
269848888Scael.Pp
269948888ScaelOther diagnostics consist of usage statements and are self explanatory.
270043435Scael.Sh FILES
270148888Scael.Bl -tag -width /usr/share/man0/template.doc -compact
270248888Scael.It Pa /usr/share/tmac/tmac.doc
270343435Scaelmanual macro package
270448888Scael.It Pa /usr/share/man0/template.doc
270543435Scaeltemplate for writing a man page
270648888Scael.El
270743435Scael.Sh HISTORY
2708*50772ScaelThe
2709*50772Scael.Nm mdoc.samples
2710*50772Scaeltutorial is
2711*50772Scael.Ud .
271243435Scael.Sh SEE ALSO
271348888Scael.Xr mdoc 7 ,
271443435Scael.Xr man 1 ,
271543435Scael.Xr troff 1
271643435Scael.Sh BUGS
271743435ScaelUndesirable hyphenation on the dash of a flag
271843435Scaelargument is not yet resolved, and causes
2719*50772Scaeloccasional mishaps in the
2720*50772Scael.Sx DESCRIPTION
2721*50772Scaelsection.
272248888Scael(line break on the hyphen).
272343435Scael.Pp
272443435ScaelPredefined strings are not declared in documentation.
272543435Scael.Pp
272643435ScaelSection 3f has not been added to the header routines.
272743435Scael.Pp
272848888Scael.Ql \&.Nm
2729*50772Scaelfont should be changed in
2730*50772Scael.Sx NAME
2731*50772Scaelsection.
273243435Scael.Pp
273348888Scael.Ql \&.Fn
273443435Scaelneeds to have a check to prevent splitting up
2735*50772Scaelif the line length is too short.
2736*50772ScaelRight now it
273743435Scaelseparates the last parenthesis, and sometimes
273843435Scaellooks ridiculous if a line is in fill mode.
273943435Scael.Pp
274043435ScaelThe method used to prevent header and footer page
274143435Scaelbreaks (other than the initial header and footer) when using
274243435Scaelnroff seems to be putting out a partially filled line
274343435Scaelat the bottom of the page leaving an unsightly blank space.
274443435Scael.Pp
274548888ScaelThe list and display macros to not do any keeps
274643435Scaeland certainly should be able to.
2747*50772Scael.\" Note what happens if the parameter list overlaps a newline
2748*50772Scael.\" boundary.
2749*50772Scael.\" to make sure a line boundary is crossed:
2750*50772Scael.\" .Bd -literal
2751*50772Scael.\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[]
2752*50772Scael.\" .Ed
2753*50772Scael.\" .Pp
2754*50772Scael.\" produces, nudge nudge,
2755*50772Scael.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
2756*50772Scael.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] ,
2757*50772Scael.\" nudge
2758*50772Scael.\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] .
2759*50772Scael.\" .Pp
2760*50772Scael.\" If double quotes are used, for example:
2761*50772Scael.\" .Bd -literal
2762*50772Scael.\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q
2763*50772Scael.\" .Ed
2764*50772Scael.\" .Pp
2765*50772Scael.\" produces, nudge nudge,
2766*50772Scael.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
2767*50772Scael.\" nudge
2768*50772Scael.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" ,
2769*50772Scael.\" nudge
2770*50772Scael.\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" .
2771*50772Scael.\" .Pp
2772*50772Scael.\" Not a pretty sight...
2773*50772Scael.\" In a paragraph, a long parameter containing unpaddable spaces as
2774*50772Scael.\" in the former example will cause
2775*50772Scael.\" .Xr troff
2776*50772Scael.\" to break the line and spread
2777*50772Scael.\" the remaining words out.
2778*50772Scael.\" The latter example will adjust nicely to
2779*50772Scael.\" justified margins, but may break in between an argument and its
2780*50772Scael.\" declaration.
2781*50772Scael.\" In
2782*50772Scael.\" .Xr nroff
2783*50772Scael.\" the right margin adjustment is normally ragged and the problem is
2784*50772Scael.\" not as severe.
2785