xref: /csrg-svn/share/man/man7/mdoc.samples.7 (revision 43435)
1*43435Scael.\" Copyright (c) 1990 The Regents of the University of California.
2*43435Scael.\" All rights reserved.
3*43435Scael.\"
4*43435Scael.\" %sccs.include.redist.mdoc%
5*43435Scael.\"
6*43435Scael.\"     @(#)mdoc.samples.7	1.1 (Berkeley) 06/22/90
7*43435Scael.\"
8*43435Scael.\"	This sampler invokes every macro in the package several
9*43435Scael.\" 	times and is garanteed to give a worst case performance
10*43435Scael.\"	for an already slow package.
11*43435Scael.Dd
12*43435Scael.Os BSD 4.4
13*43435Scael.Dt MDOC.SAMPLES 7
14*43435Scael.Sh NAME
15*43435Scael.Nm mdoc.sample
16*43435Scael.Nd detailed samples utilizing
17*43435Scaelthe
18*43435Scael.Nm -mdoc
19*43435Scaelmacro package
20*43435Scael.Sh SYNOPSIS
21*43435Scael.Nm man mdoc.sample
22*43435Scael.Sh DESCRIPTION
23*43435ScaelA fairly complete sampler of how the
24*43435Scael.Nm \-mdoc
25*43435Scaelmacro package is used.
26*43435Scael.Sh TROFF IDIOSYNCRASIES
27*43435ScaelAlthough this is a content based formatting package, and
28*43435Scaeltheoretically one should not have to learn
29*43435Scael.Xr troff 1
30*43435Scaelto use it, there are a few
31*43435Scaellimitations which are unavoidable and best gotten out
32*43435Scaelof the way. And, too, be forewarned, this package is slow.
33*43435ScaelIts purpose is to allow translation of man pages from
34*43435Scael.Xr troff 1
35*43435Scaelto
36*43435Scael.Xr TeX Coming\ Soon
37*43435Scaeland vice versa.
38*43435Scael.Ss Macro Usage
39*43435ScaelAs in
40*43435Scael.Xr troff 1 ,
41*43435Scaela macro (request) is called by placing a
42*43435Scael.Li \&\.
43*43435Scael(dot character)
44*43435Scaelat the beginning of
45*43435Scaela line followed by the two character name for the macro.
46*43435ScaelArguments may follow the request separated by spaces.
47*43435ScaelIt is the dot character at the beginning of the line which causes
48*43435Scael.Xr troff 1
49*43435Scaelto interpret the next two characters as a request.
50*43435ScaelTo place a
51*43435Scael.Li \&\.
52*43435Scael(dot character)
53*43435Scaelat the beginning of a line in some context other than
54*43435Scaela macro request, precede the
55*43435Scael.Li \&\.
56*43435Scael(dot) with a
57*43435Scael.Li \e&.
58*43435ScaelIn this macro package, some macros may be given the
59*43435Scaelname of another macro as an argument. In this case
60*43435Scaelthe argument, although the name of a macro,
61*43435Scaelis not preceded by a
62*43435Scael.Li \&\.
63*43435Scael(dot),
64*43435Scaeland will be executed
65*43435Scaelwith the remaining arguments.
66*43435ScaelIt is in this manner that some requests are nested, such
67*43435Scaelas the
68*43435Scael.Li \&.Op
69*43435Scaelrequest may
70*43435Scael.Em call
71*43435Scaelthe flag request
72*43435Scael.Li \&.Fl .
73*43435Scael.Dp Op Fl ls
74*43435Scaelis produced by
75*43435Scael.Li \&.Op Fl ls
76*43435Scael.Dp
77*43435ScaelThe only requests which check to see if the first argument
78*43435Scaelis executable are:
79*43435Scael.Ds I
80*43435Scael.Cw \&.Cx\ Complex\ Expressions
81*43435Scael.Cl \&.Cl\ Column Line Entry	\&.Dp Display Examples (tagged paragraph)
82*43435Scael.Cl \&.Cx\ Complex\ Expressions	\&.Op\ Option Request
83*43435Scael.Cl \&.Dl\ Display (one) Line	\&.Sq Single Quotes
84*43435Scael.Cl \&.Dq\ Double Quotes	\&.Tp Tagged Paragraphs
85*43435Scael.Cw
86*43435Scael.De
87*43435Scael.Pp
88*43435ScaelThe eligible first arguments are:
89*43435Scael.Ds I
90*43435Scael.Cw \&.Cx\ Complex\ Expressions
91*43435Scael.Cl \&.Ad Addresses	\&.Fn Functions
92*43435Scael.Cl \&.Ar Arguments	\&.Ic Interactive Commands
93*43435Scael.Cl \&.Cl Column Entries	\&.Li Literals
94*43435Scael.Cl \&.Cm Command Modifiers	\&.Nm Names, subjects
95*43435Scael.Cl \&.Cw Column Widths	\&.Op Options
96*43435Scael.Cl \&.Cx Complex Expressions	\&.Pa Pathnames
97*43435Scael.Cl \&.Em Emphasis	\&.Sy Symbolic
98*43435Scael.Cl \&.Er Errno's	\&.Tp Tagged Paragraphs
99*43435Scael.Cl \&.Ev Environment	\&.Va Variables
100*43435Scael.Cl \&.Fl Flags	\&.Xr Cross References
101*43435Scael.Cw
102*43435Scael.De
103*43435Scael.Pp
104*43435ScaelRequests which cannot be called, or call any other macro:
105*43435Scael.Ds I
106*43435Scael.Cw \&.Cx\ Complex\ Expressions
107*43435Scael.Cl \&.Di Display Indent	\&.Dw Display Tag Width
108*43435Scael.Cl \&.De Display End	\&.Pp Paragraph Start
109*43435Scael.Cl \&.Df Display Filled	\&.Tw Tagged Paragraph Tag Width
110*43435Scael.Cl \&.Df Display unfilled
111*43435Scael.Cw
112*43435Scael.De
113*43435Scael.Pp
114*43435ScaelThe macro
115*43435Scael.Li .Op
116*43435Scaelis unusual that it can call more than one request on the same
117*43435Scaelline.
118*43435Scael.Ss Passing Space Characters in an Argument
119*43435ScaelTo pass an argument
120*43435Scaelto a macro request which contains spaces, the space must be preceded
121*43435Scaelby a
122*43435Scael.Li \e
123*43435Scaelto escape special interpretation:
124*43435Scael.Dw int\ *fetch()
125*43435Scael.Dp Fn int\ *fetch
126*43435Scaelis created by
127*43435Scael.Li \&.Fn int\e *fetch
128*43435Scael.Dp
129*43435ScaelFor critical spaces at the end of a line, as might be needed
130*43435Scaelwith the request
131*43435Scael.Li \&.Cx ,
132*43435Scaelfollowing the space with
133*43435Scael.Li \e&
134*43435Scaelis a good guarantee the space will not be stripped (e.g.
135*43435Scael.Li \e \e&) .
136*43435ScaelA blank space at the end of a line is otherwise an open invitation
137*43435Scaelto party for
138*43435Scael.Xr troff 1 .
139*43435Scael.Ss Escaping Special Characters
140*43435ScaelSpecial characters
141*43435Scaellike the newline character
142*43435Scael.Li \en ,
143*43435Scaelare handled by replacing the
144*43435Scael.Li \e
145*43435Scaelwith
146*43435Scael.Li \ee
147*43435Scael(e.g.
148*43435Scael.Li \een )
149*43435Scaelto preserve
150*43435Scaelthe backslash.
151*43435Scael.Sh HEADER REQUESTS
152*43435ScaelThree header macros designate the document title or manual page title,
153*43435Scaelthe operating system,
154*43435Scaeland the date of authorship (if not derived from
155*43435Scael.Xr sccs 1
156*43435Scaelor
157*43435Scael.Xr rcs 1 ) .
158*43435ScaelThese macros are one called once at the very beginning of the document
159*43435Scaeland are used to construct the headers and footers only.
160*43435Scael.Tp Li \&.Dt DOCUMENT_TITLE section# [volume]
161*43435ScaelThe document title is the
162*43435Scaelsubject of the man page and must be in CAPITALS due to troff
163*43435Scaellimitations.
164*43435ScaelThe section number may be 1,...,8,
165*43435Scaeland if it is specified,
166*43435Scaelthe volume title may be omitted.
167*43435ScaelA volume title may be arbitrary or one of the following:
168*43435Scael.\" .Cl
169*43435Scael.\" USD	UNIX User's Supplementary Documents
170*43435Scael.\" .Cl
171*43435Scael.\" PS1	UNIX Programmers's Supplementary Documents
172*43435Scael.Cw SMM
173*43435Scael.Cl AMD	UNIX Ancestral Manual Documents
174*43435Scael.Cl SMM	UNIX System Manager's Manual
175*43435Scael.Cl URM	UNIX Reference Manual
176*43435Scael.Cl PRM	UNIX Programmers's Manual
177*43435Scael.Cw
178*43435Scael.\" .Cl
179*43435Scael.\" MMI	UNIX Manual Master Index
180*43435Scael.\" .Cl
181*43435Scael.\" CON	UNIX Contributed Software Manual
182*43435Scael.\" .Cl
183*43435Scael.\" LOC	UNIX Local Manual
184*43435Scael.Tp Li \&.Os operating_system release#
185*43435ScaelThe name of the operating system
186*43435Scaelshould be the common acronym, e.g. BSD
187*43435Scaelor ATT.  The release should be the standard release
188*43435Scaelnomenclature for the system specified, e.g. 4.3, 4.3+tahoe, V.3,
189*43435ScaelV.4. Unrecognized arguments are displayed as given in the page footer.
190*43435ScaelFor instance, for the footer on this page, the 4.4 Berkeley Distribution
191*43435Scaelwas produced by:
192*43435Scael.Pp
193*43435Scael.Dl Li \&.Os BSD 4.4
194*43435Scael.Tp Li \&.Dd month day, year
195*43435ScaelThe date should be written formally:
196*43435Scael.Pp
197*43435Scael.Dl January 25, 1989
198*43435Scael.\"  is not a standard SCCS id-key. ??
199*43435Scael.Tp
200*43435Scael.Sh TEXT MACROS
201*43435ScaelThe following macro requests have similar
202*43435Scaelsyntax; the exceptions being the behaviour of the
203*43435Scaelrequest if called without an argument, and the
204*43435Scaelbehaviour of the requests
205*43435Scael.Li \&.Fn ,
206*43435Scael.Li \&.Pa ,
207*43435Scaeland
208*43435Scael.Li \&.Xr ,
209*43435Scaelwhich expect a specific format.
210*43435ScaelThe other requests can handle up to 9 arguments
211*43435Scaeland will format punctuation properly as
212*43435Scaellong as the punctuation is placed in the last
213*43435Scaelarguments.  Punctuation placed in the middle
214*43435Scaelof a string of text arguments will result
215*43435Scaelin a out of place space character.
216*43435Scael.Pp
217*43435ScaelAny argument which may be tested for punctuation
218*43435Scaeland contains a member of the mathematical, logical or
219*43435Scaelquotation
220*43435Scaelset
221*43435Scael{+,\-,/,*,%,<,>,<=,>=,=,==,&,`,',"}
222*43435Scaelshould have
223*43435Scaelthe character escaped.
224*43435Scael.Pp
225*43435Scael.Ss Address Request
226*43435ScaelThe address request constructs and address
227*43435Scaelof the form addr1[,addr2[,addr3]].
228*43435Scael.Pp
229*43435Scael.Dl \&.Ad Usage: .Ad address ... \*(Pu
230*43435Scael.Dw \&.Ad\ f1\ ,\ f2\ ,\ f3\ :
231*43435Scael.Dp Li \&.Ad addr1
232*43435Scael.Ad addr1
233*43435Scael.Dp Li \&.Ad addr1\ .
234*43435Scael.Ad addr1 .
235*43435Scael.Dp Li \&.Ad addr1\ , file2
236*43435Scael.Ad addr1 , file2
237*43435Scael.Dp Li \&.Ad f1\ , f2\ , f3\ :
238*43435Scael.Ad f1 , f2 , f3 :
239*43435Scael.Dp Li \&.Ad addr\ )\ )\ ,
240*43435Scael.Ad addr ) ) ,
241*43435Scael.Dp
242*43435ScaelIt is an error to call
243*43435Scael.Li \&.Ad
244*43435Scaelwithout arguments.
245*43435ScaelThe request may be called by
246*43435Scael.Li \&.Cl ,
247*43435Scael.Li \&.Cx ,
248*43435Scael.Li \&.Dl ,
249*43435Scael.Li \&.Dp ,
250*43435Scael.Li \&.Op
251*43435Scaelor
252*43435Scael.Li \&.Tp .
253*43435Scael.Ss Argument Request
254*43435ScaelThe
255*43435Scael.Li \&.Ar
256*43435Scaelargument request may be used whenever
257*43435Scaela command line argument is referenced.
258*43435Scael.Pp
259*43435Scael.Dl Usage: .Ar argument ... \*(Pu
260*43435Scael.Dw Tx
261*43435Scael.Dp Li \&.Ar
262*43435Scael.Ar
263*43435Scael.Dp Li \&.Ar file1
264*43435Scael.Ar file1
265*43435Scael.Dp Li \&.Ar file1\ .
266*43435Scael.Ar file1 .
267*43435Scael.Dp Li \&.Ar file1 file2
268*43435Scael.Ar file1 file2
269*43435Scael.Dp Li \&.Ar f1 f2 f3\ :
270*43435Scael.Ar f1 f2 f3 :
271*43435Scael.Dp Li \&.Ar file\ )\ )\ ,
272*43435Scael.Ar file ) ) ,
273*43435Scael.Dp
274*43435Scael.Pp
275*43435ScaelIf
276*43435Scael.Li \&.Ar
277*43435Scaelis called with no arguments
278*43435Scael.Ar
279*43435Scaelis assumed. The
280*43435Scael.Li \&.Ar
281*43435Scaelrequest cannot call other macros, but may
282*43435Scaelbe called by
283*43435Scael.Li \&.Cl ,
284*43435Scael.Li \&.Cx ,
285*43435Scael.Li \&.Dl ,
286*43435Scael.Li \&.Dp ,
287*43435Scael.Li \&.Op
288*43435Scaelor
289*43435Scael.Li \&.Tp .
290*43435ScaelSee the
291*43435Scael.Li \&.Op
292*43435Scaelrequest for an example of using
293*43435Scael.Li \&.Ar
294*43435Scaelin combination with the
295*43435Scael.Li \&.Fl
296*43435Scaelrequest.
297*43435Scael.Ss Double Quote Request
298*43435ScaelThe
299*43435Scael.Li \&.Dq
300*43435Scaeldouble quote request may be used to surround
301*43435Scaela string with double quotes. Punctuation is
302*43435Scaelplaced after the edn quote.  To place punctuation
303*43435Scaelin inside the quotes it must be escaped with
304*43435Scael.Li \&\e& .
305*43435Scael.Pp
306*43435Scael.Dl Usage: .Dq string ... \*(Pu
307*43435Scael.Dw \&.Dq\ fools\ and\ follies
308*43435Scael.Dp Li \&.Dq
309*43435Scael.Dq
310*43435Scael.Dp Li \&.Dq string
311*43435Scael.Dq string
312*43435Scael.Dp Li \&.Dq string\ .
313*43435Scael.Dq string .
314*43435Scael.Dp Li \&.Dq fools and follies
315*43435Scael.Dq fools and follies
316*43435Scael.Dp Li \&.Dq Ar pattern\ )\ )\ ,
317*43435Scael.Dq Ar pattern ) ) ,
318*43435Scael.Dp
319*43435Scael.Pp
320*43435ScaelIf
321*43435Scael.Li \&.Dq
322*43435Scaelis called with no arguments
323*43435Scael.Dq
324*43435Scaelis assumed. The
325*43435Scael.Li \&.Dq
326*43435Scaelrequest may call or be called by
327*43435Scael.Li \&.Cl ,
328*43435Scael.Li \&.Cx ,
329*43435Scael.Li \&.Dl ,
330*43435Scael.Li \&.Dp ,
331*43435Scael.Li \&.Op
332*43435Scael.Li \&.Sq ,
333*43435Scaelor
334*43435Scael.Li \&.Tp .
335*43435Scael.Pp
336*43435ScaelThe
337*43435Scael.Li \&.Sq
338*43435Scaelprovides single quotes
339*43435Scaelin the same manner as
340*43435Scael.Li \&.Dq .
341*43435ScaelNeither request can nest with in itself, but
342*43435Scael.Li \&.Dq
343*43435Scaeland
344*43435Scael.Li \&.Sq
345*43435Scaelcan be nested with in each other.
346*43435Scael.Ss Emphasis Request
347*43435ScaelA portion of text may be stressed or emphasized with the .Em
348*43435Scaelrequest.  The font used is commonly italic.
349*43435Scael.Pp
350*43435Scael.Dl Usage: .Em argument ... \*(Pu
351*43435Scael.Dw \&.Em\ vide\ infra\ )\ )\ ,
352*43435Scael.Dp Li \&.Em does not
353*43435Scael.Em does not
354*43435Scael.Dp Li \&.Em exceed 1024\ .
355*43435Scael.Em exceed 1024 .
356*43435Scael.Dp Li \&.Em vide infra\ )\ )\ ,
357*43435Scael.Em vide infra ) ) ,
358*43435Scael.Dp
359*43435Scael.Pp
360*43435ScaelIt is an error to call
361*43435Scael.Li \&.Em
362*43435Scaelwithout arguments.
363*43435ScaelThe request cannot call other macros, but
364*43435Scaelmay be invoked by
365*43435Scael.Li \&.Cl ,
366*43435Scael.Li \&.Cx ,
367*43435Scael.Li \&.Dl ,
368*43435Scael.Li \&.Dp ,
369*43435Scael.Li \&.Op
370*43435Scaelor
371*43435Scael.Li \&.Tp .
372*43435Scael.Ss Errno's (Section's two and three only)
373*43435ScaelThe
374*43435Scael.Li \&.Er
375*43435Scaelerrno request specifies the error return value
376*43435Scaelfor section two and three library routines. The second example
377*43435Scaelbelow shows
378*43435Scael.Li \&.Er
379*43435Scaelused with the
380*43435Scael.Li \&.Op
381*43435Scaelrequest, as it would be used in the error
382*43435Scaelsection of a section two manual page.
383*43435Scael.Pp
384*43435Scael.Dl Usage: .Er ERRNOTYPE ... \*(Pu
385*43435Scael.Dw Tx
386*43435Scael.Dp Li \&.Er ENOENT
387*43435Scael.Er ENOENT
388*43435Scael.Dp Li \&.Op \&Er ENOTDIR
389*43435Scael.Op Er ENOTDIR
390*43435Scael.Dp
391*43435Scael.Pp
392*43435ScaelIt is an error to call
393*43435Scael.Li \&.Er
394*43435Scaelwithout arguments.
395*43435ScaelThe request cannot call other macros, but
396*43435Scaelmay be invoked by
397*43435Scael.Li \&.Cl ,
398*43435Scael.Li \&.Cx ,
399*43435Scael.Li \&.Dl ,
400*43435Scael.Li \&.Dp ,
401*43435Scael.Li \&.Op
402*43435Scaelor
403*43435Scael.Li \&.Tp .
404*43435Scael.Ss Environment Variables
405*43435ScaelThe
406*43435Scael.Li \&.Ev
407*43435Scaelrequest specifies a environment variable.
408*43435Scael.Pp
409*43435Scael.Dl Usage: .Ev argument ... \*(Pu
410*43435Scael.Dw \&.Ev\ PRINTER\ )\ )\ ,
411*43435Scael.Dp Li \&.Ev DISPLAY
412*43435Scael.Ev  DISPLAY
413*43435Scael.Dp Li \&.Ev PATH\ .
414*43435Scael.Ev PATH .
415*43435Scael.Dp Li \&.Ev PRINTER\ )\ )\ ,
416*43435Scael.Ev PRINTER ) ) ,
417*43435Scael.Dp
418*43435Scael.Pp
419*43435ScaelIt is an error to call
420*43435Scael.Li \&.Ev
421*43435Scaelwithout arguments.
422*43435ScaelThe request cannot call other macros, but
423*43435Scaelmay be invoked by
424*43435Scael.Li \&.Cl ,
425*43435Scael.Li \&.Cx ,
426*43435Scael.Li \&.Dl ,
427*43435Scael.Li \&.Dp ,
428*43435Scael.Li \&.Op
429*43435Scaelor
430*43435Scael.Li \&.Tp .
431*43435Scael.Ss Flags
432*43435ScaelThe
433*43435Scael.Li \&.Fl
434*43435Scaelrequest handles command line flags. It prepends
435*43435Scaela dash,
436*43435Scael.Li \- ,
437*43435Scaelto the flag. For interactive command flags, which
438*43435Scaelare not prepended with a dash, the
439*43435Scael.Li \&.Cm
440*43435Scaelrequest is identical, but with out the dash.
441*43435ScaelThe
442*43435Scael.Li \&.Cm
443*43435Scaelstands for command modifier.
444*43435Scael.Pp
445*43435Scael.Dl Usage: .Fl argument ... \*(Pu
446*43435Scael.Dw Tx
447*43435Scael.Dp Li \&.Fl
448*43435Scael.Fl
449*43435Scael.Dp Li \&.Fl cfv
450*43435Scael.Fl cfv
451*43435Scael.Dp Li \&.Fl cfv\ .
452*43435Scael.Fl cfv .
453*43435Scael.Dp Li \&.Fl s v t
454*43435Scael.Fl s v t
455*43435Scael.Dp Li \&.Fl -\ ,
456*43435Scael.Fl - ,
457*43435Scael.Dp Li \&.Fl xyz\ )\ ,
458*43435Scael.Fl xyz ) ,
459*43435Scael.Dp
460*43435Scael.Pp
461*43435ScaelThe
462*43435Scael.Li \&.Fl
463*43435Scaelrequest without any arguments results
464*43435Scaelin a dash sign representing stdin/stdout.
465*43435ScaelNote that giving
466*43435Scael.Li \&.Fl
467*43435Scaela single dash, will result in two dashes.
468*43435ScaelThe request cannot call other macros, but
469*43435Scaelmay be invoked by
470*43435Scael.Li \&.Cl ,
471*43435Scael.Li \&.Cx ,
472*43435Scael.Li \&.Dl ,
473*43435Scael.Li \&.Dp ,
474*43435Scael.Li \&.Op
475*43435Scaelor
476*43435Scael.Li \&.Tp .
477*43435Scael.Pp
478*43435Scael.Ss Functions (library routines)
479*43435ScaelThe .Fn request is modeled on ANSI C conventions. It
480*43435Scaelmay fail on old style parameter lists.
481*43435Scael.Pp
482*43435ScaelUsage: .Fn [type\e\ ] function [[type\e\ ] params ... \*(Pu
483*43435Scael.Dw \&.Fn\ void\e\ push\ int\e\ p\ int\e\ *ptr,
484*43435Scael.Di L
485*43435Scael.Dp Li \&.Fn getchar
486*43435Scael.Fn getchar
487*43435Scael.Dp Li \&.Fn strlen\ )\ ,
488*43435Scael.Fn strlen ) ,
489*43435Scael.Dp Li \&.Fn strcpy char\e\ *dst char\e\ *src
490*43435Scael.Fn strcpy char\ *dst char\ *src
491*43435Scael.Dp Li \&.Fn int\e\ align int\e\ word
492*43435Scael.Fn int\ align int\ word
493*43435Scael.Dp Li \&.Fn void\e\ push int\e\ p int\e\ *ptr\ ,
494*43435Scael.Fn void\ push int\ p int\ *ptr ,
495*43435Scael.Dp
496*43435Scael.Pp
497*43435ScaelIt is an error to call
498*43435Scael.Li \&.Fn
499*43435Scaelwithout any arguments.
500*43435ScaelAt the moment,
501*43435Scael.Li \&.Fn
502*43435Scaeldoes not check its word boundaries
503*43435Scaelagainst troff line lengths.  It may split across a
504*43435Scaelline ungracefully. This will be fixed in the near future.
505*43435ScaelIn the examples above, arguments with more than one word
506*43435Scaelescape the blank spaces with a
507*43435Scael.Li \e .
508*43435ScaelThe
509*43435Scael.Li \&.Fn
510*43435Scaelrequest cannot execute any macro
511*43435Scaelnames given as the first argument.
512*43435ScaelIt may be called by the
513*43435Scael.Li \&.Cl ,
514*43435Scael.Li \&.Cx ,
515*43435Scael.Li \&.Dl ,
516*43435Scael.Li \&.Dp ,
517*43435Scael.Li \&.Op
518*43435Scaelor
519*43435Scael.Li \&.Tp .
520*43435Scael.Ss Literals
521*43435ScaelThe
522*43435Scael.Li \&.Li
523*43435Scaelliteral request may be used for special characters,
524*43435Scaelvariable constants, anything which should be displayed as it
525*43435Scaelwould be typed.
526*43435Scael.Pp
527*43435Scael.Dl Usage: .Li argument ... \*(Pu
528*43435Scael.Dw Tx
529*43435Scael.Dp Li \&.Li \een
530*43435Scael.Li \en
531*43435Scael.Dp Li \&.Li M1 M2 M3\ ;
532*43435Scael.Li M1 M2 M3 ;
533*43435Scael.Dp Li \&.Li cntrl-D\ )\ ,
534*43435Scael.Li cntrl-D ) ,
535*43435Scael.Dp Li \&.Li 1024\ ...
536*43435Scael.Li 1024 ...
537*43435Scael.Dp
538*43435Scael.Pp
539*43435ScaelIt is an error to call
540*43435Scael.Li \&.Li
541*43435Scaelwithout arguments.
542*43435ScaelThe request cannot call other macros, but
543*43435Scaelmay be invoked by
544*43435Scael.Li \&.Cl ,
545*43435Scael.Li \&.Cx ,
546*43435Scael.Li \&.Dl ,
547*43435Scael.Li \&.Dp ,
548*43435Scael.Li \&.Op
549*43435Scaelor
550*43435Scael.Li \&.Tp .
551*43435Scael.Ss Name Request
552*43435ScaelThe
553*43435Scael.Li \&.Nm
554*43435Scaelrequest is used for the document title or subject name.
555*43435ScaelIt has the peculiarity of remembering  the first
556*43435Scaelargument it was called with, which should
557*43435Scaelalways be the subject name of the page.  When called without
558*43435Scaelarguments,
559*43435Scael.Li \&.Nm
560*43435Scaelregurgitates this initial name for the sole purpose
561*43435Scaelof making less work for the author.
562*43435ScaelBeyond the NAME section of the man page, a section two
563*43435Scaelor three document function name is addressed with the
564*43435Scael.Li \&Fn
565*43435Scaelrequest, while
566*43435Scael.Li \&.Nm
567*43435Scaelcan continue to be used for any other sections.
568*43435ScaelFor interactive commands, such as the
569*43435Scael.Li while
570*43435Scaelcommand keyword in
571*43435Scael.Xr csh 1 ,
572*43435Scaelthe
573*43435Scael.Li \&.Ic
574*43435Scaelrequest should be used.
575*43435ScaelWhile the
576*43435Scael.Li \&.Ic
577*43435Scaelis nearly identical
578*43435Scaelto
579*43435Scael.Li \&.Nm ,
580*43435Scaelit can not recall the first argument it was invoked with.
581*43435Scael.Pp
582*43435Scael.Dl Usage: .Nm argument ... \*(Pu
583*43435Scael.Dw Tx
584*43435Scael.Dp Li \&.Nm mdoc.sample
585*43435Scael.Nm  mdoc.sample
586*43435Scael.Dp Li \&.Nm \-mdoc
587*43435Scael.Nm \-mdoc .
588*43435Scael.Dp Li \&.Nm foo\ )\ )\ ,
589*43435Scael.Nm foo ) ) ,
590*43435Scael.Dp Li \&.Nm
591*43435Scael.Nm
592*43435Scael.Dp
593*43435Scael.Pp
594*43435ScaelThe
595*43435Scael.Li \&.Nm
596*43435Scaelrequest cannot call other macros, but
597*43435Scaelmay be called by
598*43435Scael.Li \&.Cl ,
599*43435Scael.Li \&.Cx ,
600*43435Scael.Li \&.Dl ,
601*43435Scael.Li \&.Dp ,
602*43435Scael.Li \&.Op
603*43435Scaelor
604*43435Scael.Li \&.Tp .
605*43435Scael.Ss Pathnames
606*43435ScaelThe
607*43435Scael.Li \&.Pa
608*43435Scaelrequest formats path or file names.  It has two
609*43435Scaeldifferent behaviours. In any section of the man page
610*43435Scael.Em except
611*43435Scaelthe section FILES, it
612*43435Scaelexpects at most one path or file name, and any amount
613*43435Scaelof punctuation. In the section FILES,
614*43435Scaelit is often desirable to have a column of pathnames
615*43435Scaeland a column of pathname descriptions.
616*43435Scael.Pp
617*43435Scael.Dl Usage: .Pa pathname \*(Pu
618*43435Scael.Dw \&.Pa\ /tmp/fooXXXXX\ )\ .
619*43435Scael.Dp Li \&.Pa /usr/share
620*43435Scael.Pa /usr/share
621*43435Scael.Dp Li \&.Pa /tmp/fooXXXXX\ )\ .
622*43435Scael.Pa /tmp/fooXXXXX ) .
623*43435Scael.Dp
624*43435Scael.Pp
625*43435ScaelFrom within section FILES, use the
626*43435Scael.Li \&.Dw
627*43435Scaeland
628*43435Scael.Li \&.Dp
629*43435Scaelrequests to format the pathnames
630*43435Scaeland their descriptions.
631*43435Scael.Li \&.Pa
632*43435Scaelrequest cannot call other macros, but
633*43435Scaelmay be called by
634*43435Scael.Li \&.Cl ,
635*43435Scael.Li \&.Cx ,
636*43435Scael.Li \&.Dl ,
637*43435Scael.Li \&.Dp ,
638*43435Scael.Li \&.Op
639*43435Scaelor
640*43435Scael.Li \&.Tp .
641*43435Scael.Ss Single Quotes
642*43435ScaelSee the request
643*43435Scael.Li \&.Dq
644*43435Scaelabove.  The single quoting request
645*43435Scael.Li \&.Sq
646*43435Scaelworks in the same manner as
647*43435Scael.Li \&.Dq.
648*43435Scael.Ss Symbolic
649*43435ScaelThe symbolic request is really a boldface request.
650*43435ScaelThe need for this macro has not been established,
651*43435Scaelit is included 'just in case'.
652*43435Scael.Pp
653*43435Scael.Dl Usage: .Sy symbol ... \*(Pu
654*43435Scael.Dw \&.Sy\ something\ bold
655*43435Scael.Dp Li \&.Sy something bold
656*43435Scael.Sy something bold
657*43435Scael.Dp
658*43435Scael.Pp
659*43435ScaelThe
660*43435Scael.Li \&.Sy
661*43435Scaelrequest cannot call other macros, but can be called
662*43435Scaelby
663*43435Scael.Li \&.Cl ,
664*43435Scael.Li \&.Cx ,
665*43435Scael.Li \&.Dl ,
666*43435Scael.Li \&.Dp ,
667*43435Scael.Li \&.Op
668*43435Scaelor
669*43435Scael.Li \&.Tp .
670*43435Scael.Ss Variables
671*43435ScaelGeneric variable reference:
672*43435Scael.Pp
673*43435Scael.Dl Usage: .Va variable ... \*(Pu
674*43435Scael.Dw \&.Va char\ s\ ]\ )\ )\ ,
675*43435Scael.Dp Li \&.Va count
676*43435Scael.Va count
677*43435Scael.Dp Li \&.Va settimer ,
678*43435Scael.Va settimer ,
679*43435Scael.Dp Li \&.Va int\ *prt\ )\ :
680*43435Scael.Va int\ *prt ) :
681*43435Scael.Dp Li \&.Va char\ s\ ]\ )\ )\ ,
682*43435Scael.Va char\ s ] ) ) ,
683*43435Scael.Dp
684*43435Scael.Pp
685*43435Scael.Ss Cross References
686*43435ScaelThe
687*43435Scael.Li \&.Xr
688*43435Scaelrequest expects the first argument to be
689*43435Scaela manual page name, and the second argument, if it exists,
690*43435Scaelto be either a section page number or punctuation.  Any
691*43435Scaelremaining arguments are assumed to be punctuation.
692*43435Scael.Pp
693*43435Scael.Dl Usage: .Xr manpage [1,...,8] \*(Pu
694*43435Scael.Dw Tx
695*43435Scael.Dp Li \&.Xr mdoc
696*43435Scael.Xr mdoc
697*43435Scael.Dp Li \&.Xr mdoc\ ,
698*43435Scael.Xr mdoc ,
699*43435Scael.Dp Li \&.Xr mdoc 7
700*43435Scael.Xr mdoc 7
701*43435Scael.Dp Li \&.Xr mdoc 7\ )\ )\ ,
702*43435Scael.Xr mdoc 7 ) ) ,
703*43435Scael.Dp
704*43435Scael.Pp
705*43435ScaelThe
706*43435Scael.Li \&.Xr
707*43435Scaelrequest cannot call other macros, but may be called
708*43435Scaelby
709*43435Scael.Li \&.Cl ,
710*43435Scael.Li \&.Cx ,
711*43435Scael.Li \&.Dl ,
712*43435Scael.Li \&.Dp ,
713*43435Scael.Li \&.Op
714*43435Scaelor
715*43435Scael.Li \&.Tp .
716*43435ScaelIt is an error to call
717*43435Scael.Li \&.Xr
718*43435Scaelwithout
719*43435Scaelany arguments.
720*43435Scael.Pp
721*43435Scael.\" ---
722*43435Scael.Sh PAGE LAYOUT MACROS
723*43435Scael.Ss Section Headers
724*43435ScaelSeveral
725*43435Scael.Li \&.Sh
726*43435Scaelsection header requests are required in every
727*43435Scaelman page. The
728*43435Scael.Li \&.Sh
729*43435Scaelrequest can take up to nine arguments.
730*43435Scael.Tp \&.Sh NAME
731*43435ScaelThe
732*43435Scael.Li \&.Sh NAME
733*43435Scaelrequest is mandatory. If not specified,
734*43435Scaelthe headers, footers and page layout defaults
735*43435Scaelwill not be set and things will be rather unpleasant.
736*43435ScaelThe NAME section consists of at least three items.
737*43435ScaelThe first is the
738*43435Scael.Li \&.Nm
739*43435Scaelname request naming the subject of the man page.
740*43435ScaelThe second is the Name Description request,
741*43435Scael.Li \&.Nd ,
742*43435Scaelwhich separates the subject
743*43435Scaelname from the third item, which is the description. The
744*43435Scaeldescription should be the most terse and lucid possible,
745*43435Scaelas the space available is small.
746*43435Scael.Tp \&.Sh SYNOPSIS
747*43435ScaelThe SYNOPSIS section describes the typical usage of the
748*43435Scaelsubject of a man page. The  requests required
749*43435Scaelare either
750*43435Scael.Li \&.Nm
751*43435Scaelor
752*43435Scael.Li \&.Fn .
753*43435ScaelThe function name
754*43435Scaelrequest
755*43435Scael.Li \&.Fn
756*43435Scaelis required
757*43435Scaelfor manual page sections 2 and 3, the command and general
758*43435Scaelname request
759*43435Scael.Li \&.Nm
760*43435Scaelis required for the remaining sections 1, 4, 5, 6, 7, 8.
761*43435ScaelSeveral other requests may be necessary to produce
762*43435Scaelthe synopsis line as shown below:
763*43435Scael.Pp
764*43435Scael.Nm cat
765*43435Scael.Op Fl benstuv
766*43435Scael.Op Fl
767*43435Scael.Ar
768*43435Scael.Pp
769*43435ScaelThe following requests were used:
770*43435Scael.Pp
771*43435Scael.Dl \&.Nm cat
772*43435Scael.Dl \&.Op Fl benstuv
773*43435Scael.Dl \&.Op Fl
774*43435Scael.Dl \&.Ar
775*43435Scael.Pp
776*43435ScaelNote, the
777*43435Scael.Li \&.Op
778*43435Scaelrequest has accepted as its first
779*43435Scaelargument the name of another macro
780*43435Scael.Em \&Fl .
781*43435ScaelUpon discovering the first argument is callable,
782*43435Scael.Li \&.Op
783*43435Scaelcalls it with the remaining arguments
784*43435Scaeland returns the formatted text in option brackets.
785*43435Scael.Tp \&.Sh DESCRIPTION
786*43435ScaelIn most cases the first text in the DESCRIPTION section
787*43435Scaelis a brief paragraph on the command, function or file,
788*43435Scaelfollowed by a lexical list of options and respective
789*43435Scaelexplanations. To create such a list, the
790*43435Scael.Li \&.Tp
791*43435Scaelrequest is used in conjunction with text macros, such
792*43435Scaelas the
793*43435Scael.Li \&.Fl
794*43435Scaelmacro (see
795*43435Scaelthe EXAMPLES section below).
796*43435Scael.Tp
797*43435Scael.Pp
798*43435ScaelOther user specified
799*43435Scael.Li \&.Sh
800*43435Scaelsections may be added,
801*43435Scaelfor instance, in this manual page
802*43435Scael.Pp
803*43435Scael.Dl Li \&.Sh PAGE LAYOUT MACROS
804*43435Scael.Pp
805*43435Scaelwas used for this section.
806*43435Scael.Pp
807*43435ScaelThe following
808*43435Scael.Li \&.Sh
809*43435Scaelsection headers are part of the
810*43435Scaelpreferred manual page layout and must be used appropriately
811*43435Scaelto maintain consistency. They are listed in the order
812*43435Scaelin which they would be used.
813*43435Scael.Tp \&.Sh ENVIRONMENT
814*43435ScaelThe ENVIRONMENT section should reveal any related
815*43435Scaelenvironment
816*43435Scaelvariables and clues to their behaviour and/or usage.
817*43435Scael.Tp \&.Sh EXAMPLES
818*43435ScaelThere are several ways to create examples. See
819*43435Scaelthe EXAMPLES section below
820*43435Scaelfor details.
821*43435Scael.Tp \&.Sh FILES
822*43435ScaelFiles which are used or created by the man page subject
823*43435Scaelshould be listed via the
824*43435Scael.Li \&.Pa
825*43435Scaelrequest in the FILES section.
826*43435Scael.Tp \&.Sh SEE ALSO
827*43435ScaelReferences to other material on the man page topic and
828*43435Scaelcross references to other relevant man pages should
829*43435Scaelbe placed in the SEE ALSO section.  Cross references
830*43435Scaelare specified using the
831*43435Scael.Li \&.Xr
832*43435Scaelrequest.  At this time
833*43435Scael.Xr refer 1
834*43435Scaelstyle references are not accommodated.
835*43435Scael.Tp \&.Sh STANDARDS
836*43435ScaelIf the command, library function or file adheres to a
837*43435Scaelspecific implementation such as POSIX 1003.1 or
838*43435ScaelANSI C X3.159-1989 this should be noted here.  If the
839*43435Scaelcommand does not adhere to any standard, its history
840*43435Scaelshould be noted in the HISTORY section.
841*43435Scael.Tp \&.Sh HISTORY
842*43435ScaelAny command which does not adhere to any specific standards
843*43435Scaelshould be outlined historically in this section.
844*43435Scael.Tp \&.Sh AUTHORS
845*43435ScaelCredits, if need be, should be placed here.
846*43435Scael.Tp \&.Sh DIAGNOSTICS
847*43435ScaelDiagnostics from a command should be placed in this section.
848*43435Scael.Tp \&.Sh ERRORS
849*43435ScaelSpecific error handling, especially from library functions
850*43435Scael(man page sections 2 and 3) should go here.  The
851*43435Scael.Li \&.Er
852*43435Scaelrequest is used to specify an errno.
853*43435Scael.Tp \&.Sh BUGS
854*43435ScaelBlatant problems with the topic go here...
855*43435Scael.Tp
856*43435Scael.Pp
857*43435Scael.Ss Paragraphs and Line Spacing.
858*43435Scael.Tp \&.Pp
859*43435ScaelThe \&.Pp paragraph command may
860*43435Scaelbe used to specify a line space where necessary.
861*43435ScaelThe request is not necessary after a
862*43435Scael.Li \&.Sh
863*43435Scaelor
864*43435Scael.Li \&.Ss
865*43435Scaelrequest or before
866*43435Scaela
867*43435Scael.Li \&.Tp
868*43435Scaelor
869*43435Scael.Li \&.Dp
870*43435Scaelrequest.
871*43435Scael.Tp
872*43435Scael.Ss Complex Expressions
873*43435ScaelA complex expression is one combined of many
874*43435Scaeldifferent elements of text. It is usually only necessary
875*43435Scaelin particularly nasty man pages, such as
876*43435Scael.Xr adb 1
877*43435Scaelor
878*43435Scael.Xr ex 1 ,
879*43435Scaelwhere combinations of commands, addresses and symbols
880*43435Scaelmay be needed.
881*43435ScaelWhen pieces of text are processed,
882*43435Scael.Xr troff 1
883*43435Scaelassumes
884*43435Scaelthat a space character will be desired after each word
885*43435Scaelmaking it difficult to combine expressions where
886*43435Scaeldifferent requests are used.
887*43435Scael.Li \&.Cx
888*43435Scaelmerely glues text together without spaces.  Where
889*43435Scaela space is required, it must be specified.
890*43435ScaelA few examples:
891*43435Scael.Pp
892*43435ScaelThis first example shows how to construct a simple
893*43435Scaelexpression with no spacing in between:
894*43435Scael.Pp
895*43435Scael.Ds I
896*43435Scael.Cw (ax+bx+c) \ is\ produced\ by\ \&
897*43435Scael.\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
898*43435Scael.Cl Cx \t\t
899*43435Scael.Li \&.Cx\ (
900*43435Scael.Cx
901*43435Scael.Cl Cx \t\t
902*43435Scael.Li \&.Va ax
903*43435Scael.Cx
904*43435Scael.Cl Cx \t\t
905*43435Scael.Li \&.Sy \+
906*43435Scael.Cx
907*43435Scael.Cl Cx \&(\&
908*43435Scael.Va ax
909*43435Scael.Cx +
910*43435Scael.Va by
911*43435Scael.Cx +
912*43435Scael.Va c )
913*43435Scael.Cx \t
914*43435Scael.Em is produced by
915*43435Scael.Cx \t
916*43435Scael.Li \&.Va by
917*43435Scael.Cx
918*43435Scael.Cl Cx \t\t
919*43435Scael.Li \&.Sy \+
920*43435Scael.Cx
921*43435Scael.Cl Cx \t\t
922*43435Scael.Li \&.Va c )
923*43435Scael.Cx
924*43435Scael.Cl Cx \t\t
925*43435Scael.Li \&.Cx
926*43435Scael.Cx
927*43435Scael.Cw
928*43435Scael.De
929*43435Scael.Pp
930*43435ScaelThis example shows the same equation in a different format. The spaces
931*43435Scaelaround the
932*43435Scael.Li \&+
933*43435Scaelsigns were forced with
934*43435Scael.Li \e :
935*43435Scael.Pp
936*43435Scael.Ds I
937*43435Scael.Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \&
938*43435Scael.\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\&
939*43435Scael.Cl Cx \t\t
940*43435Scael.Li \&.Cx\ (
941*43435Scael.Cx
942*43435Scael.Cl Cx \t\t
943*43435Scael.Li \&.Va a
944*43435Scael.Cx
945*43435Scael.Cl Cx \t\t
946*43435Scael.Li \&.Sy x
947*43435Scael.Cx
948*43435Scael.Cl Cx \t\t
949*43435Scael.Li \&.Cx \e\ +\e\ \e&
950*43435Scael.Cx
951*43435Scael.Cl Cx \&(\&
952*43435Scael.Va a
953*43435Scael.Sy x
954*43435Scael.Cx \ +\ \&
955*43435Scael.Va b
956*43435Scael.Sy y
957*43435Scael.Cx \ +\ \&
958*43435Scael.Va c )
959*43435Scael.Cx \t
960*43435Scael.Em is produced by
961*43435Scael.Cl Cx \t\t
962*43435Scael.Li \&.Va b
963*43435Scael.Cx
964*43435Scael.Cl Cx \t\t
965*43435Scael.Li \&.Sy y
966*43435Scael.Cx
967*43435Scael.Cl Cx \t\t
968*43435Scael.Li \&.Cx \e\ +\e\ \e&
969*43435Scael.Cx
970*43435Scael.Cl Cx \t\t
971*43435Scael.Li \&.Va c )
972*43435Scael.Cx
973*43435Scael.Cl Cx \t\t
974*43435Scael.Li \&.Cx
975*43435Scael.Cx
976*43435Scael.Cw
977*43435Scael.De
978*43435Scael.Pp
979*43435ScaelThe incantation below was
980*43435Scaellifted from the
981*43435Scael.Xr adb 1
982*43435Scaelmanual page:
983*43435Scael.Pp
984*43435Scael.Ds I
985*43435Scael.Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by
986*43435Scael.Cl Cx \t\t
987*43435Scael.Li \&.Cx Op Sy ?/
988*43435Scael.Cx
989*43435Scael.Cl Cx \t\t
990*43435Scael.Li \&.Nm m
991*43435Scael.Cx
992*43435Scael.Cl Cx Op Sy ?/
993*43435Scael.Nm m
994*43435Scael.Ad \ b1 e1 f1
995*43435Scael.Op Sy ?/
996*43435Scael.Cx \t
997*43435Scael.Em is produced by
998*43435Scael.Cx \t
999*43435Scael.Li \&.Ar \e\ b1 e1 f1
1000*43435Scael.Cx
1001*43435Scael.Cl Cx \t\t
1002*43435Scael.Li \&.Op Sy ?/
1003*43435Scael.Cx
1004*43435Scael.Cl Cx \t\t
1005*43435Scael.Li \&.Cx
1006*43435Scael.Cx
1007*43435Scael.Cw
1008*43435Scael.De
1009*43435Scael.Pp
1010*43435Scael.Ss Examples and Displays
1011*43435ScaelThere are three types of displays, an indented one line display
1012*43435Scael.Li \&.Dl ,
1013*43435Scaela non\-filled block display
1014*43435Scael.Li Ds
1015*43435Scaeland a filled block display.
1016*43435Scael.Pp
1017*43435Scael.Tw \&.Dl
1018*43435Scael.Tp Li \&.Dl
1019*43435ScaelDisplay one line of indented text.
1020*43435ScaelThe
1021*43435Scael.Li \&.Dl
1022*43435Scaelexample request has been used throughout this
1023*43435Scaelfile.  It's
1024*43435Scaelbasic use is to indent (display) one line of text for quick
1025*43435Scaelone line examples. Its default font is set to
1026*43435Scaelconstant width, however,
1027*43435Scael.Li \&.Dl
1028*43435Scaelchecks the first argument to see if it is callable. It cannot process
1029*43435Scaelmore than nine arguments.
1030*43435Scael.Pp
1031*43435Scael.Ds I
1032*43435Scael.Li \&.Dl % ls -ldg /usr/local/bin
1033*43435Scael.Pp
1034*43435Scaelproduces:
1035*43435Scael.Dl % ls -ldg /usr/local/bin
1036*43435Scael.Pp
1037*43435Scael.Li \&.Dl Fl ldghfstru
1038*43435Scael.Pp
1039*43435Scaelproduces:
1040*43435Scael.Dl  Fl ldghfstru
1041*43435Scael.De
1042*43435Scael.Pp
1043*43435ScaelCalling either the request
1044*43435Scael.Li \&.Tp
1045*43435Scaelor
1046*43435Scael.Li \&.Dp
1047*43435Scaelfrom
1048*43435Scael.Li \&.Dl
1049*43435Scaelis redundant and may cause unpredictable errors.
1050*43435Scael.Tp Li \&.Ds
1051*43435ScaelDisplay a block of text as typed,
1052*43435Scaelright margin edges are left ragged.
1053*43435ScaelNesting
1054*43435Scael.Li \&.Ds
1055*43435Scaelrequests seems to work,
1056*43435Scaelso they can be used outside and within
1057*43435Scaeltagged paragraphs. Each
1058*43435Scael.Li \&.Ds
1059*43435Scaelrequest must be ended with a
1060*43435Scael.Li \&De
1061*43435Scaelrequest.
1062*43435Scael.Li \&.Ds
1063*43435Scaeltakes can be manipulated to indent
1064*43435Scaelwith the
1065*43435Scael.Li \&L , \&C , \&R ,
1066*43435Scaeland
1067*43435Scael.Li \&I
1068*43435Scaelflags.
1069*43435Scael.Dw 4n
1070*43435Scael.Dp Li L
1071*43435ScaelAlign block on the current left margin,
1072*43435Scaelthis is the default mode of
1073*43435Scael.Li \&.Ds
1074*43435Scaelif called without arguments.
1075*43435Scael.Dp Li C
1076*43435ScaelSupposedly center the block. At this time
1077*43435Scaelunfortunately, the block merely gets
1078*43435Scaelleft aligned about an imaginary center margin.
1079*43435ScaelThis will be fixed some time inthe near future.
1080*43435Scael.Dp Li I
1081*43435ScaelIndent from left margin default amount (usually
1082*43435Scaelabout a three quarters of an inch or eight
1083*43435Scaelconstant width characters).
1084*43435Scael.Dp Li R
1085*43435ScaelThis left aligns the block about two inches from
1086*43435Scaelthe right side of the page. It too, alas, needs
1087*43435Scaelwork.
1088*43435Scael.Dp
1089*43435Scael.Tp Li \&.De
1090*43435ScaelEnds a
1091*43435Scael.Li \&.Ds
1092*43435Scaelrequest.
1093*43435Scael.Tp Li \&.Df
1094*43435ScaelDisplay a filled (formatted) block.  Identical to
1095*43435Scael.Li \&.Ds ,
1096*43435Scaelexcept the block of text is formatted (the edges are
1097*43435Scaelnot left ragged).  Takes the same modifers as
1098*43435Scael.Li Ds .
1099*43435Scael.Tp
1100*43435Scael.Ss Tagged paragraphs and Columns
1101*43435ScaelThe commands
1102*43435Scael.Li \&.Tp
1103*43435Scaeland
1104*43435Scael.Li \&.Dp
1105*43435Scaelcreate tagged paragraph
1106*43435Scaellists.
1107*43435ScaelLike the
1108*43435Scael.Li \&.Cx
1109*43435Scaelrequest,
1110*43435Scaelboth require a begin and end.  When
1111*43435Scael.Li \&.Tp
1112*43435Scaelor
1113*43435Scael.Li \&.Dp
1114*43435Scaelare called with arguments, they collect and
1115*43435Scaelcreate the tag portion from
1116*43435Scaelthe arguments.
1117*43435ScaelAnything after the tag is placed in
1118*43435Scaelthe paragraph portion.
1119*43435ScaelThe
1120*43435Scael.Li \&.Dp
1121*43435Scaelmacro is essentially the same as
1122*43435Scaelthe \&.Tp
1123*43435Scaelmacro, but with a few added features.
1124*43435ScaelThese are discussed following the
1125*43435Scael.Li \&.Tp
1126*43435Scaelexample.
1127*43435Scael.Li \&.Tp
1128*43435Scaeland
1129*43435Scael.Li \&.Dp
1130*43435Scaelcan call several macros,
1131*43435Scaelthese are:
1132*43435Scael.Pp
1133*43435Scael.Dl \&.Ad, \&.Ar, \&.Cm, \&.Em, \&.Er, \&.Ev, \&.Fl, \&.Fn, \&.Ic,
1134*43435Scael.Dl \&.Li, \&.Nm, \&.Sy, \&.Va and \&.Xr.
1135*43435Scael.Pp
1136*43435ScaelThe
1137*43435Scael.Li \&.Tp
1138*43435Scaelrequest can be nested, and values for determining
1139*43435Scaelthe width of each tag are based on which macro
1140*43435Scael.Li \&.Tp
1141*43435Scaelis calling, if it is calling one, or by specifying
1142*43435Scaela width with the
1143*43435Scael.Li \&.Tw
1144*43435Scaelrequest.
1145*43435ScaelThe default width for an unknown tag type is set to just
1146*43435Scaelabout one and three quarter inches, or 20 characters in a
1147*43435Scaelconstant width font.
1148*43435ScaelIf the default width is unsatisfactory,
1149*43435Scael.Li \&.Tw
1150*43435Scaelcan be used as follows:
1151*43435Scael.Dp Li \&.Tw Fl
1152*43435Scaelsets the width to the default flag width
1153*43435Scael.Li \&.Fl ,
1154*43435Scaelwhich is
1155*43435Scaelset to ten constant width characters or about five sixth of
1156*43435Scaelan inch.
1157*43435Scael.Dp Li \&.Tw 24n
1158*43435Scaelsets the width to 24 constant width characters or about two
1159*43435Scaelinches.  The
1160*43435Scael.Li n
1161*43435Scaelis absolutely necessary for the scaling to work correctly.
1162*43435Scael.Dp Li \&.Tw ENAMETOOLONG
1163*43435Scaelsets the width to the constant width length of the
1164*43435Scaelstring given.
1165*43435Scael.Dp Li \&.Tw  int\e\ mkfifo
1166*43435Scaelagain, the width is set to the constant width of the string
1167*43435Scaelgiven, and the space is protected with a preceding
1168*43435Scael.Li \e .
1169*43435Scael.Dp
1170*43435Scael.Pp
1171*43435ScaelA nesting
1172*43435Scael.Li \&.Tp
1173*43435ScaelExample:
1174*43435Scael.Pp
1175*43435Scael.Tp Nm Name1
1176*43435ScaelThis is the first call to
1177*43435Scael.Li \&.Tp
1178*43435Scaelwith
1179*43435Scael.Li \&.Nm .
1180*43435Scael.Tp Nm Name2
1181*43435ScaelAnother call with
1182*43435Scael.Li \&.Nm .
1183*43435Scael.Tp Va Variable1
1184*43435ScaelAn example of the
1185*43435Scael.Li \&.Va
1186*43435Scaelrequest with
1187*43435Scael.Li \&.Tp .
1188*43435ScaelSince the first argument was callable
1189*43435Scaeland different from the last one, the
1190*43435Scaeltag was indented.
1191*43435Scael.Tp Va Variable2
1192*43435ScaelAnother
1193*43435Scael.Li \&.Va
1194*43435Scaelexample.
1195*43435Scael.Tp Fl Flag1
1196*43435ScaelA third nest (indent) using the
1197*43435Scael.Li \&.Fl
1198*43435Scaelrequest.
1199*43435Scael.Tp Fl Flag2
1200*43435ScaelAgain the
1201*43435Scael.Li \&.Fl
1202*43435Scael.Tp
1203*43435Scael.Pp
1204*43435ScaelA
1205*43435Scael.Li \&.Tp
1206*43435Scaelwith no arguments stops the current nest
1207*43435Scaeland exdents back to the previous level.
1208*43435Scael.Tp Va Variable3
1209*43435ScaelAnother call with the
1210*43435Scael.Li \&.Va
1211*43435Scaelrequest.
1212*43435Scael.Tp
1213*43435Scael.Pp
1214*43435ScaelAgain a
1215*43435Scael.Li \&.Tp
1216*43435Scaelwithout arguments exdents.  This will put
1217*43435Scaelus back at the first level.
1218*43435Scael.Tp Nm Name3
1219*43435ScaelAnother
1220*43435Scael.Li \&.Nm
1221*43435Scaelrequest. This request is followed
1222*43435Scaelby the last call to
1223*43435Scael.Li \&.Tp
1224*43435Scaelwithout arguments.
1225*43435Scael.Tp
1226*43435Scael.Pp
1227*43435ScaelThe above was created from:
1228*43435Scael.Pp
1229*43435Scael.Ds I
1230*43435Scael\&.Tp Nm Name1
1231*43435ScaelThis is the first call to
1232*43435Scael\&.Li \&.Tp
1233*43435Scaelwith
1234*43435Scael\&.Li \&.Nm .
1235*43435Scael\&.Tp Nm Name2
1236*43435ScaelAnother call with
1237*43435Scael\&.Li \&.Nm .
1238*43435Scael\&.Tp Va Variable1
1239*43435ScaelAn example of the
1240*43435Scael\&.Li \&.Va
1241*43435Scaelrequest with
1242*43435Scael\&.Li \&.Tp .
1243*43435ScaelSince the first argument was callable and different from
1244*43435Scaelthe last one, the tag was indented.
1245*43435Scael\&.Tp Va Variable2
1246*43435ScaelAnother
1247*43435Scael\&.Li \&.Va
1248*43435Scaelexample.
1249*43435Scael\&.Tp Fl Flag1
1250*43435ScaelA third nest (indent) using the
1251*43435Scael\&.Li \&.Fl
1252*43435Scaelrequest.
1253*43435Scael\&.Tp Fl Flag2
1254*43435ScaelAgain the
1255*43435Scael\&.Li \&.Fl
1256*43435Scael\&.Tp
1257*43435ScaelA
1258*43435Scael\&.Li \&.Tp
1259*43435Scaelwith no arguments stops the current nest
1260*43435Scaeland exdents back to the previous level.
1261*43435Scael\&.Tp Va Variable3
1262*43435ScaelAnother call with the
1263*43435Scael\&.Li \&.Va
1264*43435Scaelrequest.
1265*43435Scael\&.Tp
1266*43435ScaelAgain a
1267*43435Scael\&.Li \&.Tp
1268*43435Scaelwithout argments exdents.
1269*43435ScaelThis will put us back at the first level.
1270*43435Scael\&.Tp Nm Name3
1271*43435ScaelAnother
1272*43435Scael\&.Li \&.Nm
1273*43435Scaelrequest. This request is followed by the last call to
1274*43435Scael\&.Li \&.Tp
1275*43435Scaelwithout arguments.
1276*43435Scael\&.Tp
1277*43435Scael.De
1278*43435Scael.Pp
1279*43435ScaelAn example of
1280*43435Scael.Li \&.Dp:
1281*43435Scael.Pp
1282*43435Scael.Dw PAGEIN\ 10
1283*43435Scael.Dp SL 10
1284*43435Scaelsleep time of the process (seconds blocked)
1285*43435Scael.Dp PAGEIN 10
1286*43435Scaelnumber of disk i/o's resulting from references by the process
1287*43435Scaelto pages not loaded in core.
1288*43435Scael.Dp UID 10
1289*43435Scaelnumerical user-id of process owner
1290*43435Scael.Dp PPID 10
1291*43435Scaelnumerical id of parent of process
1292*43435Scaelprocess priority (non-positive when in non-interruptible wait)
1293*43435Scael.Dp
1294*43435Scael.Pp
1295*43435ScaelThe raw text:
1296*43435Scael.Pp
1297*43435Scael.Ds I
1298*43435Scael.Li \&.Dw PAGEIN\ 10
1299*43435Scael.Li \&.Dp SL 10
1300*43435Scaelsleep time of the process (seconds blocked)
1301*43435Scael.Li \&.Dp PAGEIN 10
1302*43435Scaelnumber of disk i/o's resulting from references by the process
1303*43435Scaelto pages not loaded in core.
1304*43435Scael.Li \&.Dp UID 10
1305*43435Scaelnumerical user-id of process owner
1306*43435Scael.Li \&.Dp PPID 10
1307*43435Scaelnumerical id of parent of process
1308*43435Scaelprocess priority (non-positive when in non-interruptible wait)
1309*43435Scael.Li \&.Dp
1310*43435Scael.De
1311*43435Scael.Pp
1312*43435ScaelThe default behaviour of
1313*43435Scael.Li \&.Dp
1314*43435Scaelis to indent a small amount from the current margin before
1315*43435Scaelprocessing the tag.  This margin can be changed with the
1316*43435Scaelrequest
1317*43435Scael.Li \&.Di
1318*43435Scaelwhich takes as its first argument either a numerical
1319*43435Scaelargument (e.g. a scaled number like 24n) or a letter
1320*43435Scael.Li \&L
1321*43435Scaelor
1322*43435Scael.Li \&I .
1323*43435ScaelThe
1324*43435Scael.Li \&L
1325*43435Scaelforces a left margin, which is useful if something doesn't
1326*43435Scaelquite fit (as in the example for the
1327*43435Scael.Li \&.Fn
1328*43435Scaelmacro in the TEXT MACRO section above).
1329*43435ScaelThe
1330*43435Scael.Li \&I
1331*43435Scaelis the default, but may be used for a return to the default
1332*43435Scaelif necessary.  Like all the tagged widths, the indents
1333*43435Scaelare pushed on a stack, and when that stack (or level)
1334*43435Scaelis expired, the previous values are used (this happens
1335*43435Scaelwhenever a
1336*43435Scael.Li \&.Dp
1337*43435Scaelor
1338*43435Scael.Li \&.Tp
1339*43435Scaelis called without arguments).
1340*43435ScaelIn this example,
1341*43435Scael.Li \&.Dw
1342*43435Scaelhas been used to set the width of the tag.
1343*43435ScaelIt is identical to the request
1344*43435Scael.Li \&.Tw
1345*43435Scaeldiscussed above.
1346*43435Scael.Ss Columns
1347*43435ScaelThe column request is made up of a width request,
1348*43435Scael.Li \&.Cw ,
1349*43435Scaeland a column line request,
1350*43435Scael.Li \&.Cl .
1351*43435ScaelFrom one to four simple columns can be created
1352*43435Scaeland all but the last column, are simple
1353*43435Scaelsingle entry style columns.
1354*43435ScaelThe last (rightmost) column can overflow into
1355*43435Scaela indented paragraph.
1356*43435Scael.Pp
1357*43435ScaelThe
1358*43435Scael.Li \&.Cw
1359*43435Scaelrequest takes at most three arguments
1360*43435Scaelas width indicators.  The number of columns is
1361*43435Scaelalways one more than given to
1362*43435Scael.Li \&.Cw .
1363*43435Scaelthe
1364*43435Scael.Li \&.Cl
1365*43435Scaelrequest should have its arguments
1366*43435Scaelon the next line and the columns should be
1367*43435Scaelseparated by a tab character.
1368*43435Scael.Pp
1369*43435ScaelAn example of two columns:
1370*43435Scael.Cw Macros
1371*43435Scael.Cl Macros	Description
1372*43435Scael.Cl \&.Tp	List Request
1373*43435Scael.Cl \&.Nm	Name Request
1374*43435Scael.Cw
1375*43435Scael.Pp
1376*43435ScaelThe requests used to format the
1377*43435Scaelcolumns above (the jagged edges are from tabs which can
1378*43435Scaelalso be represented by
1379*43435Scael.Li \et ) :
1380*43435Scael.Pp
1381*43435Scael.Dl \&.Cw Macros
1382*43435Scael.Dl \&.Cl Macros	Description
1383*43435Scael.Dl \&.Cl \e&.Tp	 List Request
1384*43435Scael.Dl \&.Cl \e&.Nm	 Name Request
1385*43435Scael.Dl \&.Cw
1386*43435Scael.Pp
1387*43435ScaelThere some problems with columns at the moment, while they
1388*43435Scaelwork well in nested lists, they are otherwise difficult
1389*43435Scaelto offset via example.
1390*43435Scael.Ss Options
1391*43435ScaelThe
1392*43435Scael.Li \&.Op
1393*43435Scaelrequest ain't quite working perfectly.
1394*43435ScaelThe (eventual) goal of
1395*43435Scael.Li \&.Op
1396*43435Scaelis to place brackets around the given arguments, and place any
1397*43435Scaelpunctuation outside the brackets.  In the case of
1398*43435Scael.Li \&.Cx,
1399*43435Scaeltrailing punctuation on the same request line as the
1400*43435Scael.Li \&.Op
1401*43435Scaelshould be placed outside the brackets.
1402*43435ScaelThe multiple macro calls are one of the reasons this request is so moody.
1403*43435ScaelIs is the only macro which attempts to call other macros on the
1404*43435Scaelrequest line. Its not doing too badly, just not perfect:
1405*43435Scael.Dw \&.Op\ Fl\ c\ Ar\ objfil\ Op\ Ar\ corfil\ ,
1406*43435Scael.Dp Li \&.Op
1407*43435Scael.Op
1408*43435Scael.Dp Li \&.Op Fl k
1409*43435Scael.Op Fl k
1410*43435Scael.Dp Li \&.Op Fl k\ )\ .
1411*43435Scael.Op Fl k ) .
1412*43435Scael.Dp Li \&.Op Fl k Ar kookfile
1413*43435Scael.Op Fl k Ar kookfile
1414*43435Scael.Dp Li \&.Op Fl k Ar kookfile\ ,
1415*43435Scael.Op Fl k Ar kookfile ,
1416*43435Scael.Dp Li \&.Op Ar objfil Op Ar corfil
1417*43435Scael.Op Ar objfil Op Ar corfil
1418*43435Scael.Dp Li \&.Op Fl c Ar objfil Op Ar corfil\ ,
1419*43435Scael.Op Fl c Ar objfil Op Ar corfil ,
1420*43435Scael.Dp Li \&.Op word1 word2
1421*43435Scael.Op word1 word2
1422*43435Scael.Dp
1423*43435Scael.Pp
1424*43435ScaelThe punctuation on the second to last example is
1425*43435Scaelimproperly placed and should be fixed some day.
1426*43435Scael.Sh FILES
1427*43435Scael.\" .Pa /usr/share/tmac/tmac.doc.style site specific layout
1428*43435Scael.Dw /usr/share/man0/template.doc
1429*43435Scael.Di L
1430*43435Scael.Dp Pa /usr/share/tmac/tmac.doc
1431*43435Scaelmanual macro package
1432*43435Scael.Dp Pa /usr/share/man0/template.doc
1433*43435Scaeltemplate for writing a man page
1434*43435Scael.Dp
1435*43435Scael.Sh HISTORY
1436*43435Scael4.4 BSD
1437*43435Scael.Sh SEE ALSO
1438*43435Scael.Xr mdoc.samples 7 ,
1439*43435Scael.Xr man 1 ,
1440*43435Scael.Xr troff 1
1441*43435Scael.Sh BUGS
1442*43435Scael.Pp
1443*43435ScaelPunctuation may be broken on
1444*43435Scael.Li \&.Op
1445*43435Scaelagain.
1446*43435Scael.Pp
1447*43435ScaelUndesirable hyphenation on the dash of a flag
1448*43435Scaelargument is not yet resolved, and causes
1449*43435Scaeloccasional mishaps in the DESCRIPTION section.
1450*43435Scael.Pp
1451*43435ScaelPredefined strings are not declared in documentation.
1452*43435Scael.Pp
1453*43435ScaelSection 3f has not been added to the header routines.
1454*43435Scael.Pp
1455*43435Scael.Li \&.Nm
1456*43435Scaelfont should be changed in NAME section.
1457*43435Scael.Pp
1458*43435Scael.Li \&.Fn
1459*43435Scaelneeds to have a check to prevent splitting up
1460*43435Scaelif the line length is too short. Right now it
1461*43435Scaelseparates the last parenthesis, and sometimes
1462*43435Scaellooks ridiculous if a line is in fill mode.
1463*43435Scael.Pp
1464*43435ScaelThe method used to prevent header and footer page
1465*43435Scaelbreaks (other than the initial header and footer) when using
1466*43435Scaelnroff seems to be putting out a partially filled line
1467*43435Scaelat the bottom of the page leaving an unsightly blank space.
1468*43435Scael.Pp
1469*43435ScaelThe tagged paragraph, display and column requests to not do any keeps
1470*43435Scaeland certainly should be able to.
1471*43435Scael.Pp
1472*43435ScaelOccasionally there maybe a problem with mathematical
1473*43435Scaelor logical interpretation of characters from the
1474*43435Scaelset
1475*43435Scael{+,\-,/,*,%,<,>,<=,>=,=,==,&}
1476*43435Scaelfound as the second
1477*43435Scaelcharacter in an argument string which may be checked for punctuation.
1478*43435ScaelThis is a relatively rare occurrence, as a lot of checking is
1479*43435Scaeldone to prevent it,
1480*43435Scaelbut if it should happen
1481*43435Scaelescape the characters
1482*43435Scaelwith
1483*43435Scael.Li \e& .
1484