internal update
[s-roff.git] / tmac / doc-ditroff.new
blob625fafd8446e983fca8aa761456c90a799e55237
1 .\" Copyright (c) 1991 The Regents of the University of California.
2 .\" 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 5.8 (Berkeley) 8/5/91
33 .\"
34 .\"     %beginstrip%
37 .eo
39 .\" use -rC=1 to number pages continuously
41 .if !r C .nr C 0
43 .\" use -rcR=1 to force the creation of a single, very long page
45 .if !r cR .nr cR 0
48 .ec
50 .\" the `doc-xx-font' strings must not be empty!
52 .ds doc-caption-font \f[R]\s[\n[.ps]u]
53 .ds doc-caption-font2 \f[R]\s[\n[.ps]u]
54 .ds doc-Ad-font \f[I]\s[\n[.ps]u]
55 .ds doc-Ar-font \f[CO]\s[\n[.ps]u]
56 .ds doc-Cm-font \f[CB]\s[\n[.ps]u]
57 .ds doc-Em-font \f[I]\s[\n[.ps]u]
58 .ds doc-Er-font \f[C]\s[\n[.ps]u]
59 .ds doc-Ev-font \f[C]\s[\n[.ps]u]
60 .ds doc-Fa-font \f[CO]\s[\n[.ps]u]
61 .ds doc-Fd-font \f[CB]\s[\n[.ps]u]
62 .ds doc-Fl-font \f[CB]\s[\n[.ps]u]
63 .ds doc-Fn-font \f[CB]\s[\n[.ps]u]
64 .ds doc-Ft-font \f[CO]\s[\n[.ps]u]
65 .ds doc-Ic-font \f[CB]\s[\n[.ps]u]
66 .ds doc-Li-font \f[C]
67 .ds doc-Me-font \f[B]\s[\n[.ps]u]
68 .ds doc-Nm-font \f[CB]\s[\n[.ps]u]
69 .ds doc-No-font \f[R]\s[\n[.ps]u]
70 .ds doc-Pa-font \f[C]\s[\n[.ps]u]
71 .ds doc-Sh-font \f[B]\s[\n[.ps]u]
72 .ds doc-Sy-font \f[B]\s[\n[.ps]u]
73 .ds doc-Sx-font \f[B]\s[\n[.ps]u]
74 .ds doc-Tn-font-shape \f[R]
75 \# XXX: adapt to discrete LaTeX font sizes
76 .ds doc-Tn-font-size \s[(\n[.ps]u - 1z)]
77 .ds doc-Va-font \f[I]\s[\n[.ps]u]
78 .ds doc-Xr-font \f[C]\s[\n[.ps]u]
80 .ds doc-left-parenthesis \f[R]\|(\|\f[P]\s[\n[.ps]u]
81 .ds doc-right-parenthesis \f[R]\|)\|\f[P]\s[\n[.ps]u]
82 .ds lp \f[R](\f[P]\s[\n[.ps]u]
83 .ds rp \f[R])\f[P]\s[\n[.ps]u]
84 .ds doc-left-bracket \f[R]\^[\^\f[P]\s[\n[.ps]u]
85 .ds doc-right-bracket \f[R]\^]\f[P]\s[\n[.ps]u]
87 .tr *\[**]
89 .\" miscellaneous
90 .nr doc-subheader-indent (\w\a\f[C],\au * 5u)
91 .nr doc-paragraph-space .5v
93 .nr doc-digit-width \w'\0'u
94 .nr doc-fixed-width \w\a\f[C]0\a
96 .eo
99 .\" NS doc-header-space global register
100 .\" NS   the space between header and body
102 .nr doc-header-space 0
105 .\" NS doc-footer-space global register
106 .\" NS   the space between body and footer
108 .nr doc-footer-space 0
111 .\" NS doc-display-vertical global register
112 .\" NS   vertical space between list elements etc.
114 .nr doc-display-vertical 0
117 .\" NS doc-setup-page-layout macro
118 .\" NS   set up page layout
119 .\" NS
120 .\" NS modifies:
121 .\" NS   doc-display-vertical
122 .\" NS   doc-footer-space
123 .\" NS   doc-header-space
125 .de doc-setup-page-layout
126 .  nr doc-header-space .5i
127 .  nr doc-footer-space .5i
129 .  ll 6.5i
130 .  lt 6.5i
131 .  po 1i
133 .  nr doc-display-vertical .5v
137 .ds <= \[<=]
138 .ds >= \[>=]
140 .\" Lq and Rq are `official'
141 .ds Lq \[lq]
142 .ds Rq \[rq]
143 .ds ua \[ua]
144 .ds aa \[aa]
145 .ds ga \[ga]
146 .ds doc-left-singlequote \)`
147 .ds doc-right-singlequote \)'
148 .\" q is `official'
149 .ds q \[dq]
151 .\" math stuff -- all macro names are `official'
152 .ds Pi \[*p]
153 .ds Ne \[!=]
154 .ds Le \[<=]
155 .ds Ge \[>=]
156 .ds Lt <
157 .ds Gt >
158 .ds Pm \[+-]
159 .ds If \[if]
160 .ds Na \f[I]NaN\f[P]
161 .ds Ba \f[R]|\f[P]
163 .nr gX 0
166 .\" NS doc-header-string global string
167 .\" NS   the final string used for the manual page header
169 .ds doc-header-string
172 .\" NS doc-setup-header macro
173 .\" NS   install and initialize header and footer support
174 .\" NS
175 .\" NS modifies:
176 .\" NS   doc-header-string
178 .de doc-setup-header
179 .  ds doc-header-string "\*[doc-document-title]
180 .  if !"\*[doc-section]"Null" \
181 .    as doc-header-string \|(\*[doc-section])
183 .  wh 0 doc-header
184 .  wh -1.25i doc-footer
186 .  nr nL \n[nl]
187 .  if \n[gX] \
188 .    ds doc-command-name
190 .  br
192 .  \" Don't set the page number if this is the first page,
193 .  \" in case the user has used -n.
194 .  if \n[nL] \
195 .    if !\n[C] \
196 .      nr % 1
198 .  nr gX 0
199 .  e@ doc-end-macro
203 .\" NS doc-get-width macro
204 .\" NS   computes the width of a string as a multiple of `doc-fixed-width':
205 .\" NS   `.doc-get-width string'
206 .\" NS
207 .\" NS modifies:
208 .\" NS   doc-width
210 .de doc-get-width
211 .  nr doc-width \w\a\f[C]\$1\a
212 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
213 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
214 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
215 .    el \
216 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
217 .  \}
218 .  el \{\
219 .    ie \n[doc-width] \
220 .      nr doc-width 1
221 .    el \
222 .      nr doc-width 0
223 .  \}
227 .\" NS doc-get-arg-width macro
228 .\" NS   computes the width of an argument as a multiple of
229 .\" NS   `doc-fixed-width': `.doc-get-arg-width arg-index'
230 .\" NS
231 .\" NS modifies:
232 .\" NS   doc-width
234 .de doc-get-arg-width
235 .  nr doc-width \w\a\f[C]\*[doc-arg\$1]\a
236 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
237 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
238 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
239 .    el \
240 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
241 .  \}
242 .  el \{\
243 .    ie \n[doc-width] \
244 .      nr doc-width 1
245 .    el \
246 .      nr doc-width 0
247 .  \}
251 .\" NS Ql user macro
252 .\" NS   quoted literal define
253 .\" NS
254 .\" NS modifies:
255 .\" NS   doc-argXXX
256 .\" NS   doc-arg-limit
257 .\" NS   doc-arg-ptr
258 .\" NS   doc-macro-name
259 .\" NS   doc-spaceXXX
260 .\" NS   doc-typeXXX
261 .\" NS   doc-quote-left
262 .\" NS   doc-quote-right
263 .\" NS
264 .\" NS local variables:
265 .\" NS   doc-reg-Ql
266 .\" NS   doc-reg-Ql1
267 .\" NS   doc-reg-Ql2
268 .\" NS
269 .\" NS width register `Ql' set in doc-common
271 .de Ql
272 .  if !\n[doc-arg-limit] \{\
273 .    ie \n[.$] \{\
274 .      ds doc-macro-name Ql
275 .      doc-parse-args \$@
276 .    \}
277 .    el \
278 .      tm Usage: .Ql argument ... (#\n[.c])
279 .  \}
281 .  nr doc-reg-Ql (\n[doc-arg-ptr] + 1)
282 .  doc-get-arg-width \n[doc-reg-Ql]
284 .  \" don't use quotes if we have more than two succeeding string arguments
285 .  nr doc-reg-Ql +1
286 .  if (\n[doc-arg-limit] >= \n[doc-reg-Ql]) \
287 .    if (\n[doc-type\n[doc-reg-Ql]] == 2) \
288 .      nr doc-width 3
290 .  \" make a difference in quotation style for strings longer
291 .  \" than two characters
292 .  ie (\n[doc-width] > 2) \
293 .    Li
294 .  el \{\
295 .    ie \n[doc-arg-ptr] \{\
296 .      \" we replace `Ql' with `Li'
297 .      ds doc-arg\n[doc-arg-ptr] Li
298 .      nr doc-arg-ptr -1
299 .    \}
300 .    el \{\
301 .      \" if .Ql has been called directly, we must shift all elements in
302 .      \" the argument vector to the right so that we can insert `Li'
303 .      nr doc-reg-Ql \n[doc-arg-limit]
304 .      nr doc-reg-Ql1 (\n[doc-arg-limit] + 1)
305 .      while \n[doc-reg-Ql] \{\
306 .        rn doc-arg\n[doc-reg-Ql] doc-arg\n[doc-reg-Ql1]
307 .        rnn doc-type\n[doc-reg-Ql] doc-type\n[doc-reg-Ql1]
308 .        rn doc-space\n[doc-reg-Ql] doc-space\n[doc-reg-Ql1]
309 .        nr doc-reg-Ql -1
310 .        nr doc-reg-Ql1 -1
311 .      \}
312 .      ds doc-arg1 Li
313 .      nr doc-type1 1
314 .      ds doc-space1
315 .      nr doc-arg-limit +1
316 .    \}
318 .    ds doc-quote-left "\*[doc-left-singlequote]
319 .    ds doc-quote-right "\*[doc-right-singlequote]
320 .    doc-enclose-string
321 .  \}
327 .\" EOF