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