Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / contrib / groff / tmac / doc-ditroff
1 .\" Copyright (c) 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"      This product includes software developed by the University of
15 .\"      California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)doc-ditroff 8.1 (Berkeley) 06/08/93
33 .\"     $FreeBSD: src/contrib/groff/tmac/doc-ditroff,v 1.1.1.1.8.5 2003/02/14 15:22:11 ru Exp $
34 .\"     $DragonFly: src/contrib/groff/tmac/Attic/doc-ditroff,v 1.2 2003/06/17 04:24:02 dillon Exp $
35 .\"
36 .\"     %beginstrip%
37 .
38 .
39 .eo
40 .
41 .\" use -rC=1 to number pages continuously
42 .
43 .if !r C .nr C 0
44 .
45 .\" use -rD=1 for double-sided printing
46 .
47 .if !r D .nr D 0
48 .
49 .\" use -rcR=1 to force the creation of a single, very long page
50 .
51 .if !r cR .nr cR 0
52 .
53 .\" use -rS={11,12} to change the font size from 10pt to 11pt or 12pt.
54 .
55 .if !r S .nr S 10
56 .
57 .
58 .ec
59 .
60 .
61 .ie        (\n[S] == 11) \{\
62 .  ps 10.95z
63 .  vs 13.6p
64 .\}
65 .el \{ .ie (\n[S] == 12) \{\
66 .  ps 12z
67 .  vs 14.5p
68 .\}
69 .el \{\
70 .  ps 10z
71 .  vs 12p
72 .\}\}
73 .
74 .
75 .\" the `doc-xx-font' strings must not be empty!
76 .
77 .ds doc-caption-font \f[R]\s[\n[.ps]u]
78 .ds doc-caption-font2 \f[R]\s[\n[.ps]u]
79 .ds doc-Ad-font \f[I]\s[\n[.ps]u]
80 .ds doc-Ar-font \f[CO]\s[\n[.ps]u]
81 .ds doc-Cm-font \f[CB]\s[\n[.ps]u]
82 .ds doc-Em-font \f[I]\s[\n[.ps]u]
83 .ds doc-Er-font \f[C]\s[\n[.ps]u]
84 .ds doc-Ev-font \f[C]\s[\n[.ps]u]
85 .ds doc-Fa-font \f[CO]\s[\n[.ps]u]
86 .ds doc-Fd-font \f[CB]\s[\n[.ps]u]
87 .ds doc-Fl-font \f[CB]\s[\n[.ps]u]
88 .ds doc-Fn-font \f[CB]\s[\n[.ps]u]
89 .ds doc-Ft-font \f[CO]\s[\n[.ps]u]
90 .ds doc-Ic-font \f[CB]\s[\n[.ps]u]
91 .ds doc-Li-font \f[C]
92 .ds doc-Me-font \f[B]\s[\n[.ps]u]
93 .ds doc-Nm-font \f[CB]\s[\n[.ps]u]
94 .ds doc-No-font \f[R]\s[\n[.ps]u]
95 .ds doc-Pa-font \f[C]\s[\n[.ps]u]
96 .ds doc-Sh-font \f[B]\s[\n[.ps]u]
97 .ds doc-Sy-font \f[B]\s[\n[.ps]u]
98 .ds doc-Sx-font \f[B]\s[\n[.ps]u]
99 .ds doc-Tn-font-shape \f[R]
100 \# XXX: adapt to discrete LaTeX font sizes
101 .ds doc-Tn-font-size \s[(\n[.ps]u - 1z)]
102 .ds doc-Va-font \f[I]\s[\n[.ps]u]
103 .ds doc-Xr-font \f[C]\s[\n[.ps]u]
104 .
105 .ds doc-left-parenthesis \f[R]\|(\|\f[]\s[\n[.ps]u]
106 .ds doc-right-parenthesis \f[R]\|)\|\f[]\s[\n[.ps]u]
107 .ds lp \f[R](\f[]\s[\n[.ps]u]
108 .ds rp \f[R])\f[]\s[\n[.ps]u]
109 .ds doc-left-bracket \f[R]\^[\^\f[]\s[\n[.ps]u]
110 .ds doc-right-bracket \f[R]\^]\f[]\s[\n[.ps]u]
111 .
112 .tr *\[**]
113 .
114 .\" miscellaneous
115 .nr doc-subheader-indent (\w\a\f[C],\au * 5u)
116 .nr doc-paragraph-space .5v
117 .
118 .nr doc-digit-width \w'\0'u
119 .nr doc-fixed-width \w\a\f[C]0\a
120 .
121 .eo
122 .
123 .
124 .\" NS doc-header-space global register
125 .\" NS   the space between header and body
126 .
127 .nr doc-header-space 0
128 .
129 .
130 .\" NS doc-footer-space global register
131 .\" NS   the space between body and footer
132 .
133 .nr doc-footer-space 0
134 .
135 .
136 .\" NS doc-display-vertical global register
137 .\" NS   vertical space between list elements etc.
138 .
139 .nr doc-display-vertical 0
140 .
141 .
142 .\" NS doc-setup-page-layout macro
143 .\" NS   set up page layout
144 .\" NS
145 .\" NS modifies:
146 .\" NS   doc-display-vertical
147 .\" NS   doc-footer-space
148 .\" NS   doc-header-space
149 .
150 .de doc-setup-page-layout
151 .  nr doc-header-space .5i
152 .  nr doc-footer-space .5i
153 .
154 .  ie r LL \
155 .    ll \n[LL]u
156 .  el \
157 .    ll 6.5i
158 .
159 .  ie r LT \
160 .    lt \n[LT]u
161 .  el \
162 .    lt 6.5i
163 .
164 .  po 1i
165 .
166 .  nr doc-display-vertical .5v
167 ..
168 .
169 .
170 .ds doc-left-singlequote \[oq]
171 .ds doc-right-singlequote \[cq]
172 .
173 .\" the following strings are `official'
174 .ds <= \[<=]
175 .ds >= \[>=]
176 .ds Lq \[lq]
177 .ds Rq \[rq]
178 .ds ua \[ua]
179 .ds aa \[aa]
180 .ds ga \[ga]
181 .ds q \[dq]
182 .ds Pi \[*p]
183 .ds Ne \[!=]
184 .ds Le \[<=]
185 .ds Ge \[>=]
186 .ds Lt <
187 .ds Gt >
188 .ds Pm \[+-]
189 .ds If \[if]
190 .ds Na \f[I]NaN\f[]
191 .ds Ba \f[R]|\f[]
192 .ds Am &
193 .
194 .nr gX 0
195 .
196 .
197 .\" NS doc-header-string global string
198 .\" NS   the final string used for the manual page header
199 .
200 .ds doc-header-string
201 .
202 .
203 .\" NS doc-setup-header macro
204 .\" NS   install and initialize header and footer support
205 .\" NS
206 .\" NS modifies:
207 .\" NS   doc-header-string
208 .
209 .de doc-setup-header
210 .  ds doc-header-string "\*[doc-document-title]
211 .  if !"\*[doc-section]"Null" \
212 .    as doc-header-string \|(\*[doc-section])
213 .
214 .  wh 0 doc-header
215 .  wh -1.25i doc-footer
216 .
217 .  nr nL \n[nl]
218 .  if \n[gX] \
219 .    ds doc-command-name
220 .
221 .  br
222 .
223 .  \" Don't set the page number if this is the first page,
224 .  \" in case the user has used -n.
225 .  if \n[nL] \
226 .    if !\n[C] \
227 .      nr % 1
228 .
229 .  nr gX 0
230 .  e@ doc-end-macro
231 ..
232 .
233 .
234 .\" NS doc-get-width macro
235 .\" NS   computes the width of a string as a multiple of `doc-fixed-width':
236 .\" NS   `.doc-get-width string'
237 .\" NS
238 .\" NS modifies:
239 .\" NS   doc-width
240 .
241 .de doc-get-width
242 .  nr doc-width \w\a\f[C]\$1\a
243 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
244 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
245 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
246 .    el \
247 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
248 .  \}
249 .  el \{\
250 .    ie \n[doc-width] \
251 .      nr doc-width 1
252 .    el \
253 .      nr doc-width 0
254 .  \}
255 ..
256 .
257 .
258 .\" NS doc-get-arg-width macro
259 .\" NS   computes the width of an argument as a multiple of
260 .\" NS   `doc-fixed-width': `.doc-get-arg-width arg-index'
261 .\" NS
262 .\" NS modifies:
263 .\" NS   doc-width
264 .
265 .de doc-get-arg-width
266 .  nr doc-width \w\a\f[C]\*[doc-arg\$1]\a
267 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
268 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
269 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
270 .    el \
271 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
272 .  \}
273 .  el \{\
274 .    ie \n[doc-width] \
275 .      nr doc-width 1
276 .    el \
277 .      nr doc-width 0
278 .  \}
279 ..
280 .
281 .
282 .\" NS Ql user macro
283 .\" NS   quoted literal define
284 .\" NS
285 .\" NS modifies:
286 .\" NS   doc-argXXX
287 .\" NS   doc-arg-limit
288 .\" NS   doc-arg-ptr
289 .\" NS   doc-macro-name
290 .\" NS   doc-spaceXXX
291 .\" NS   doc-typeXXX
292 .\" NS   doc-quote-left
293 .\" NS   doc-quote-right
294 .\" NS
295 .\" NS local variables:
296 .\" NS   doc-reg-Ql
297 .\" NS   doc-reg-Ql1
298 .\" NS   doc-reg-Ql2
299 .\" NS
300 .\" NS width register `Ql' set in doc-common
301 .
302 .de Ql
303 .  if !\n[doc-arg-limit] \{\
304 .    ie \n[.$] \{\
305 .      ds doc-macro-name Ql
306 .      doc-parse-args \$@
307 .    \}
308 .    el \
309 .      tm Usage: .Ql argument ... (#\n[.c])
310 .  \}
311 .
312 .  nr doc-reg-Ql (\n[doc-arg-ptr] + 1)
313 .  doc-get-arg-width \n[doc-reg-Ql]
314 .
315 .  \" don't use quotes if we have more than two succeeding string arguments
316 .  nr doc-reg-Ql +1
317 .  if (\n[doc-arg-limit] >= \n[doc-reg-Ql]) \
318 .    if (\n[doc-type\n[doc-reg-Ql]] == 2) \
319 .      nr doc-width 3
320 .
321 .  \" make a difference in quotation style for strings longer
322 .  \" than two characters
323 .  ie (\n[doc-width] > 2) \
324 .    Li
325 .  el \{\
326 .    ie \n[doc-arg-ptr] \{\
327 .      \" we replace `Ql' with `Li'
328 .      ds doc-arg\n[doc-arg-ptr] Li
329 .      nr doc-arg-ptr -1
330 .    \}
331 .    el \{\
332 .      \" if .Ql has been called directly, we must shift all elements in
333 .      \" the argument vector to the right so that we can insert `Li'
334 .      nr doc-reg-Ql \n[doc-arg-limit]
335 .      nr doc-reg-Ql1 (\n[doc-arg-limit] + 1)
336 .      while \n[doc-reg-Ql] \{\
337 .        rn doc-arg\n[doc-reg-Ql] doc-arg\n[doc-reg-Ql1]
338 .        rnn doc-type\n[doc-reg-Ql] doc-type\n[doc-reg-Ql1]
339 .        rn doc-space\n[doc-reg-Ql] doc-space\n[doc-reg-Ql1]
340 .        nr doc-reg-Ql -1
341 .        nr doc-reg-Ql1 -1
342 .      \}
343 .      ds doc-arg1 Li
344 .      nr doc-type1 1
345 .      ds doc-space1
346 .      nr doc-arg-limit +1
347 .    \}
348 .
349 .    ds doc-quote-left "\*[doc-left-singlequote]
350 .    ds doc-quote-right "\*[doc-right-singlequote]
351 .    doc-enclose-string
352 .  \}
353 ..
354 .
355 .
356 .ec
357 .
358 .\" EOF