* src/roff/troff/node.cc (troff_output_file::put_char): Always
[s-roff.git] / tmac / doc-ditroff
blob6c830093f29170f9277eb9d092b34b6bbe1f508e
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 -rD=1 for double-sided printing
41 .if !r D .nr D 0
43 .\" use -rcR=1 to force the creation of a single, very long page
45 .if !r cR .nr cR 0
47 .\" use -rS={11,12} to change the font size from 10pt to 11pt or 12pt.
49 .if !r S .nr S 10
52 .ec
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 .\}\}
69 .\" the `doc-xx-font' strings must not be empty!
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]
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]
106 .tr *\[**]
108 .\" miscellaneous
109 .nr doc-subheader-indent (\w\a\f[C],\au * 5u)
110 .nr doc-paragraph-space .5v
112 .nr doc-digit-width \w'\0'u
113 .nr doc-fixed-width \w\a\f[C]0\a
118 .\" NS doc-header-space global register
119 .\" NS   the space between header and body
121 .nr doc-header-space 0
124 .\" NS doc-footer-space global register
125 .\" NS   the space between body and footer
127 .nr doc-footer-space 0
130 .\" NS doc-display-vertical global register
131 .\" NS   vertical space between list elements etc.
133 .nr doc-display-vertical 0
136 .\" NS doc-setup-page-layout macro
137 .\" NS   set up page layout
138 .\" NS
139 .\" NS modifies:
140 .\" NS   doc-display-vertical
141 .\" NS   doc-footer-space
142 .\" NS   doc-header-space
144 .de doc-setup-page-layout
145 .  nr doc-header-space .5i
146 .  nr doc-footer-space .5i
148 .  ie r LL \
149 .    ll \n[LL]u
150 .  el \
151 .    ll 6.5i
153 .  ie r LT \
154 .    lt \n[LT]u
155 .  el \
156 .    lt 6.5i
158 .  po 1i
160 .  nr doc-display-vertical .5v
164 .ds doc-left-singlequote \[oq]
165 .ds doc-right-singlequote \[cq]
167 .\" the following strings are `official'
168 .ds <= \[<=]
169 .ds >= \[>=]
170 .ds Lq \[lq]
171 .ds Rq \[rq]
172 .ds ua \[ua]
173 .ds aa \[aa]
174 .ds ga \[ga]
175 .ds q \[dq]
176 .ds Pi \[*p]
177 .ds Ne \[!=]
178 .ds Le \[<=]
179 .ds Ge \[>=]
180 .ds Lt <
181 .ds Gt >
182 .ds Pm \[+-]
183 .ds If \[if]
184 .ds Na \f[I]NaN\f[]
185 .ds Ba \f[R]|\f[]
186 .ds Am &
188 .nr gX 0
191 .\" NS doc-header-string global string
192 .\" NS   the final string used for the manual page header
194 .ds doc-header-string
197 .\" NS doc-setup-header macro
198 .\" NS   install and initialize header and footer support
199 .\" NS
200 .\" NS modifies:
201 .\" NS   doc-header-string
203 .de doc-setup-header
204 .  ds doc-header-string "\*[doc-document-title]
205 .  if !"\*[doc-section]"Null" \
206 .    as doc-header-string \|(\*[doc-section])
208 .  wh 0 doc-header
209 .  wh -1.25i doc-footer
211 .  if \n[gX] \
212 .    ds doc-command-name
214 .  br
216 .  nr gX 0
217 .  e@ doc-end-macro
221 .\" NS doc-get-width macro
222 .\" NS   computes the width of a string as a multiple of `doc-fixed-width':
223 .\" NS   `.doc-get-width string'
224 .\" NS
225 .\" NS modifies:
226 .\" NS   doc-width
228 .de doc-get-width
229 .  nr doc-width \w\a\f[C]\$1\a
230 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
231 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
232 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
233 .    el \
234 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
235 .  \}
236 .  el \{\
237 .    ie \n[doc-width] \
238 .      nr doc-width 1
239 .    el \
240 .      nr doc-width 0
241 .  \}
245 .\" NS doc-get-arg-width macro
246 .\" NS   computes the width of an argument as a multiple of
247 .\" NS   `doc-fixed-width': `.doc-get-arg-width arg-index'
248 .\" NS
249 .\" NS modifies:
250 .\" NS   doc-width
252 .de doc-get-arg-width
253 .  nr doc-width \w\a\f[C]\*[doc-arg\$1]\a
254 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
255 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
256 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
257 .    el \
258 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
259 .  \}
260 .  el \{\
261 .    ie \n[doc-width] \
262 .      nr doc-width 1
263 .    el \
264 .      nr doc-width 0
265 .  \}
269 .\" NS Ql user macro
270 .\" NS   quoted literal define
271 .\" NS
272 .\" NS modifies:
273 .\" NS   doc-argXXX
274 .\" NS   doc-arg-limit
275 .\" NS   doc-arg-ptr
276 .\" NS   doc-macro-name
277 .\" NS   doc-spaceXXX
278 .\" NS   doc-typeXXX
279 .\" NS   doc-quote-left
280 .\" NS   doc-quote-right
281 .\" NS
282 .\" NS local variables:
283 .\" NS   doc-reg-Ql
284 .\" NS   doc-reg-Ql1
285 .\" NS   doc-reg-Ql2
286 .\" NS
287 .\" NS width register `Ql' set in doc-common
289 .de Ql
290 .  if !\n[doc-arg-limit] \{\
291 .    ie \n[.$] \{\
292 .      ds doc-macro-name Ql
293 .      doc-parse-args \$@
294 .    \}
295 .    el \
296 .      tm Usage: .Ql argument ... (#\n[.c])
297 .  \}
299 .  nr doc-reg-Ql (\n[doc-arg-ptr] + 1)
300 .  doc-get-arg-width \n[doc-reg-Ql]
302 .  \" don't use quotes if we have more than two succeeding string arguments
303 .  nr doc-reg-Ql +1
304 .  if (\n[doc-arg-limit] >= \n[doc-reg-Ql]) \
305 .    if (\n[doc-type\n[doc-reg-Ql]] == 2) \
306 .      nr doc-width 3
308 .  \" make a difference in quotation style for strings longer
309 .  \" than two characters
310 .  ie (\n[doc-width] > 2) \
311 .    Li
312 .  el \{\
313 .    ie \n[doc-arg-ptr] \{\
314 .      \" we replace `Ql' with `Li'
315 .      ds doc-arg\n[doc-arg-ptr] Li
316 .      nr doc-arg-ptr -1
317 .    \}
318 .    el \{\
319 .      \" if .Ql has been called directly, we must shift all elements in
320 .      \" the argument vector to the right so that we can insert `Li'
321 .      nr doc-reg-Ql \n[doc-arg-limit]
322 .      nr doc-reg-Ql1 (\n[doc-arg-limit] + 1)
323 .      while \n[doc-reg-Ql] \{\
324 .        rn doc-arg\n[doc-reg-Ql] doc-arg\n[doc-reg-Ql1]
325 .        rnn doc-type\n[doc-reg-Ql] doc-type\n[doc-reg-Ql1]
326 .        rn doc-space\n[doc-reg-Ql] doc-space\n[doc-reg-Ql1]
327 .        nr doc-reg-Ql -1
328 .        nr doc-reg-Ql1 -1
329 .      \}
330 .      ds doc-arg1 Li
331 .      nr doc-type1 1
332 .      ds doc-space1
333 .      nr doc-arg-limit +1
334 .    \}
336 .    ds doc-quote-left "\*[doc-left-singlequote]
337 .    ds doc-quote-right "\*[doc-right-singlequote]
338 .    doc-enclose-string
339 .  \}
345 .\" EOF