* MORE.STUFF: Added gpresent.
[s-roff.git] / tmac / doc-ditroff
blob8b8bd00a7ae4a3098a0b17cd9dd5cebd42e4182d
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 .\"
34 .\"     %beginstrip%
37 .eo
39 .\" use -rC=1 to number pages continuously
41 .if !r C .nr C 0
43 .\" use -rD=1 for double-sided printing
45 .if !r D .nr D 0
47 .\" use -rcR=1 to force the creation of a single, very long page
49 .if !r cR .nr cR 0
51 .\" use -rS={11,12} to change the font size from 10pt to 11pt or 12pt.
53 .if !r S .nr S 10
56 .ec
59 .ie        (\n[S] == 11) \{\
60 .  ps 10.95z
61 .  vs 13.6p
62 .\}
63 .el \{ .ie (\n[S] == 12) \{\
64 .  ps 12z
65 .  vs 14.5p
66 .\}
67 .el \{\
68 .  ps 10z
69 .  vs 12p
70 .\}\}
73 .\" the `doc-xx-font' strings must not be empty!
75 .ds doc-caption-font \f[R]\s[\n[.ps]u]
76 .ds doc-caption-font2 \f[R]\s[\n[.ps]u]
77 .ds doc-Ad-font \f[I]\s[\n[.ps]u]
78 .ds doc-Ar-font \f[CO]\s[\n[.ps]u]
79 .ds doc-Cm-font \f[CB]\s[\n[.ps]u]
80 .ds doc-Em-font \f[I]\s[\n[.ps]u]
81 .ds doc-Er-font \f[C]\s[\n[.ps]u]
82 .ds doc-Ev-font \f[C]\s[\n[.ps]u]
83 .ds doc-Fa-font \f[CO]\s[\n[.ps]u]
84 .ds doc-Fd-font \f[CB]\s[\n[.ps]u]
85 .ds doc-Fl-font \f[CB]\s[\n[.ps]u]
86 .ds doc-Fn-font \f[CB]\s[\n[.ps]u]
87 .ds doc-Ft-font \f[CO]\s[\n[.ps]u]
88 .ds doc-Ic-font \f[CB]\s[\n[.ps]u]
89 .ds doc-Li-font \f[C]
90 .ds doc-Me-font \f[B]\s[\n[.ps]u]
91 .ds doc-Nm-font \f[CB]\s[\n[.ps]u]
92 .ds doc-No-font \f[R]\s[\n[.ps]u]
93 .ds doc-Pa-font \f[C]\s[\n[.ps]u]
94 .ds doc-Sh-font \f[B]\s[\n[.ps]u]
95 .ds doc-Sy-font \f[B]\s[\n[.ps]u]
96 .ds doc-Sx-font \f[B]\s[\n[.ps]u]
97 .ds doc-Tn-font-shape \f[R]
98 \# XXX: adapt to discrete LaTeX font sizes
99 .ds doc-Tn-font-size \s[(\n[.ps]u - 1z)]
100 .ds doc-Va-font \f[I]\s[\n[.ps]u]
101 .ds doc-Xr-font \f[C]\s[\n[.ps]u]
103 .ds doc-left-parenthesis \f[R]\|(\|\f[]\s[\n[.ps]u]
104 .ds doc-right-parenthesis \f[R]\|)\|\f[]\s[\n[.ps]u]
105 .ds lp \f[R](\f[]\s[\n[.ps]u]
106 .ds rp \f[R])\f[]\s[\n[.ps]u]
107 .ds doc-left-bracket \f[R]\^[\^\f[]\s[\n[.ps]u]
108 .ds doc-right-bracket \f[R]\^]\f[]\s[\n[.ps]u]
110 .tr *\[**]
112 .\" miscellaneous
113 .nr doc-subheader-indent (\w\a\f[C],\au * 5u)
114 .nr doc-paragraph-space .5v
116 .nr doc-digit-width \w'\0'u
117 .nr doc-fixed-width \w\a\f[C]0\a
122 .\" NS doc-header-space global register
123 .\" NS   the space between header and body
125 .nr doc-header-space 0
128 .\" NS doc-footer-space global register
129 .\" NS   the space between body and footer
131 .nr doc-footer-space 0
134 .\" NS doc-display-vertical global register
135 .\" NS   vertical space between list elements etc.
137 .nr doc-display-vertical 0
140 .\" NS doc-setup-page-layout macro
141 .\" NS   set up page layout
142 .\" NS
143 .\" NS modifies:
144 .\" NS   doc-display-vertical
145 .\" NS   doc-footer-space
146 .\" NS   doc-header-space
148 .de doc-setup-page-layout
149 .  nr doc-header-space .5i
150 .  nr doc-footer-space .5i
152 .  ie r LL \
153 .    ll \n[LL]u
154 .  el \
155 .    ll 6.5i
157 .  ie r LT \
158 .    lt \n[LT]u
159 .  el \
160 .    lt 6.5i
162 .  po 1i
164 .  nr doc-display-vertical .5v
168 .ds doc-left-singlequote \[oq]
169 .ds doc-right-singlequote \[cq]
171 .\" the following strings are `official'
172 .ds <= \[<=]
173 .ds >= \[>=]
174 .ds Lq \[lq]
175 .ds Rq \[rq]
176 .ds ua \[ua]
177 .ds aa \[aa]
178 .ds ga \[ga]
179 .ds q \[dq]
180 .ds Pi \[*p]
181 .ds Ne \[!=]
182 .ds Le \[<=]
183 .ds Ge \[>=]
184 .ds Lt <
185 .ds Gt >
186 .ds Pm \[+-]
187 .ds If \[if]
188 .ds Na \f[I]NaN\f[]
189 .ds Ba \f[R]|\f[]
191 .nr gX 0
194 .\" NS doc-header-string global string
195 .\" NS   the final string used for the manual page header
197 .ds doc-header-string
200 .\" NS doc-setup-header macro
201 .\" NS   install and initialize header and footer support
202 .\" NS
203 .\" NS modifies:
204 .\" NS   doc-header-string
206 .de doc-setup-header
207 .  ds doc-header-string "\*[doc-document-title]
208 .  if !"\*[doc-section]"Null" \
209 .    as doc-header-string \|(\*[doc-section])
211 .  wh 0 doc-header
212 .  wh -1.25i doc-footer
214 .  nr nL \n[nl]
215 .  if \n[gX] \
216 .    ds doc-command-name
218 .  br
220 .  \" Don't set the page number if this is the first page,
221 .  \" in case the user has used -n.
222 .  if \n[nL] \
223 .    if !\n[C] \
224 .      nr % 1
226 .  nr gX 0
227 .  e@ doc-end-macro
231 .\" NS doc-get-width macro
232 .\" NS   computes the width of a string as a multiple of `doc-fixed-width':
233 .\" NS   `.doc-get-width string'
234 .\" NS
235 .\" NS modifies:
236 .\" NS   doc-width
238 .de doc-get-width
239 .  nr doc-width \w\a\f[C]\$1\a
240 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
241 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
242 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
243 .    el \
244 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
245 .  \}
246 .  el \{\
247 .    ie \n[doc-width] \
248 .      nr doc-width 1
249 .    el \
250 .      nr doc-width 0
251 .  \}
255 .\" NS doc-get-arg-width macro
256 .\" NS   computes the width of an argument as a multiple of
257 .\" NS   `doc-fixed-width': `.doc-get-arg-width arg-index'
258 .\" NS
259 .\" NS modifies:
260 .\" NS   doc-width
262 .de doc-get-arg-width
263 .  nr doc-width \w\a\f[C]\*[doc-arg\$1]\a
264 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
265 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
266 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
267 .    el \
268 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
269 .  \}
270 .  el \{\
271 .    ie \n[doc-width] \
272 .      nr doc-width 1
273 .    el \
274 .      nr doc-width 0
275 .  \}
279 .\" NS Ql user macro
280 .\" NS   quoted literal define
281 .\" NS
282 .\" NS modifies:
283 .\" NS   doc-argXXX
284 .\" NS   doc-arg-limit
285 .\" NS   doc-arg-ptr
286 .\" NS   doc-macro-name
287 .\" NS   doc-spaceXXX
288 .\" NS   doc-typeXXX
289 .\" NS   doc-quote-left
290 .\" NS   doc-quote-right
291 .\" NS
292 .\" NS local variables:
293 .\" NS   doc-reg-Ql
294 .\" NS   doc-reg-Ql1
295 .\" NS   doc-reg-Ql2
296 .\" NS
297 .\" NS width register `Ql' set in doc-common
299 .de Ql
300 .  if !\n[doc-arg-limit] \{\
301 .    ie \n[.$] \{\
302 .      ds doc-macro-name Ql
303 .      doc-parse-args \$@
304 .    \}
305 .    el \
306 .      tm Usage: .Ql argument ... (#\n[.c])
307 .  \}
309 .  nr doc-reg-Ql (\n[doc-arg-ptr] + 1)
310 .  doc-get-arg-width \n[doc-reg-Ql]
312 .  \" don't use quotes if we have more than two succeeding string arguments
313 .  nr doc-reg-Ql +1
314 .  if (\n[doc-arg-limit] >= \n[doc-reg-Ql]) \
315 .    if (\n[doc-type\n[doc-reg-Ql]] == 2) \
316 .      nr doc-width 3
318 .  \" make a difference in quotation style for strings longer
319 .  \" than two characters
320 .  ie (\n[doc-width] > 2) \
321 .    Li
322 .  el \{\
323 .    ie \n[doc-arg-ptr] \{\
324 .      \" we replace `Ql' with `Li'
325 .      ds doc-arg\n[doc-arg-ptr] Li
326 .      nr doc-arg-ptr -1
327 .    \}
328 .    el \{\
329 .      \" if .Ql has been called directly, we must shift all elements in
330 .      \" the argument vector to the right so that we can insert `Li'
331 .      nr doc-reg-Ql \n[doc-arg-limit]
332 .      nr doc-reg-Ql1 (\n[doc-arg-limit] + 1)
333 .      while \n[doc-reg-Ql] \{\
334 .        rn doc-arg\n[doc-reg-Ql] doc-arg\n[doc-reg-Ql1]
335 .        rnn doc-type\n[doc-reg-Ql] doc-type\n[doc-reg-Ql1]
336 .        rn doc-space\n[doc-reg-Ql] doc-space\n[doc-reg-Ql1]
337 .        nr doc-reg-Ql -1
338 .        nr doc-reg-Ql1 -1
339 .      \}
340 .      ds doc-arg1 Li
341 .      nr doc-type1 1
342 .      ds doc-space1
343 .      nr doc-arg-limit +1
344 .    \}
346 .    ds doc-quote-left "\*[doc-left-singlequote]
347 .    ds doc-quote-right "\*[doc-right-singlequote]
348 .    doc-enclose-string
349 .  \}
355 .\" EOF