internal update
[s-roff.git] / tmac / doc-nroff.new
blob70d4812e8d6cd7779f1c4c8282d6711989183643
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-nroff 5.6 (Berkeley) 8/5/91
33 .\"
34 .\" tmac.mdoc-nroff
35 .\"     %beginstrip%
36 .\"
38 .\" use -rcR=0 to have multiple pages instead of a single, very long page
39 .if !rcR .nr cR 1
41 .\" the `doc-xx-font' strings must not be empty!
42 .ds doc-caption-font \f[R]
43 .ds doc-caption-font2 \f[R]
44 .ds doc-Ad-font \f[I]
45 .ds doc-Ar-font \f[I]
46 .ds doc-Cm-font \f[B]
47 .ds doc-Em-font \f[I]
48 .ds doc-Er-font \f[R]
49 .ds doc-Ev-font \f[R]
50 .ds doc-Fa-font \f[I]
51 .ds doc-Fd-font \f[B]
52 .ds doc-Fl-font \f[B]
53 .ds doc-Fn-font \f[B]
54 .ds doc-Ft-font \f[I]
55 .ds doc-Ic-font \f[B]
56 .ds doc-Li-font \f[R]
57 .ds doc-Me-font \f[B]
58 .ds doc-Nm-font \f[B]
59 .ds doc-No-font \f[R]
60 .ds doc-Pa-font \f[I]
61 .ds doc-Sh-font \f[B]
62 .ds doc-Sy-font \f[B]
63 .ds doc-Sx-font \f[I]
64 .ds doc-Tn-font-shape \f[R]
65 .ds doc-Tn-font-size
66 .ds doc-Va-font \f[I]
67 .ds doc-Xr-font \f[R]
69 .ds doc-left-parenthesis \f[R]\|(\f[P]
70 .ds doc-right-parenthesis \f[R]\|)\f[P]
71 .ds lp \f[R]\|(\f[P]
72 .ds rp \f[R]\|)\f[P]
73 .ds doc-left-bracket \f[R]\|[\|\f[P]
74 .ds doc-right-bracket \f[R]\|]\f[P]
76 .\" miscellaneous
77 .ds doc-punct-chars {\ .\ ,\ ;\ :\ (\ )\ [\ ]}
78 .nr doc-subheader-indent .5i
79 .nr doc-paragraph-space 1v
81 .ec
82 .ds doc-digit-string \0\0
83 .nr doc-digit-width \w'\0\0'u
84 .nr doc-fixed-width \w'0'
85 .eo
88 .de doc-setup-page-layout
89 .  ie \n[cR] \
90 .    nr doc-header-space 0
91 .  el \
92 .    nr doc-header-space .5i
93 .  nr doc-footer-space .5i
95 .  ll 78n
96 .  lt 78n
97 .  po 0i
99 .  nr doc-display-vertical 1v
100 .  ad l
101 .  na
105 .ds <= \&<\&=
106 .ds >= \&>\&=
108 .\" Lq and Rq are `official'
109 .ds Rq ''
110 .ds Lq ``
111 .ds ua ^
112 .ds aa \'
113 .ds ga \`
114 .ds doc-left-singlequote `
115 .ds doc-right-singlequote '
116 .\" q is `official'
117 .ds q \&"
119 .\" math stuff -- all macro names are `official'
120 .ds Pi pi
121 .ds Ne !=
122 .ds Le <=
123 .ds Ge >=
124 .ds Lt <
125 .ds Gt >
126 .ds Pm +-
127 .ds If infinity
128 .ds Na \f[I]NaN\f[P]
129 .ds Ba \f[R]|\f[P]
132 .de doc-setup-header
133 .  nr % 1
134 .  ds doc-header-string "\*[doc-document-title]
135 .  if !"\*[doc-section]"Null" \
136 .    as doc-header-string \|(\|\*[doc-section]\|)
138 .  ie \n[cR] \
139 .    doc-header
140 .  el \{\
141 .    wh 0 doc-header
142 .    wh -1.167i doc-footer
143 .  \}
145 .  if ((\n[nl] == 0) : (\n[nl] == -1)) \
146 '    bp
148 .  e@ doc-end-macro
152 .\" NS doc-get-width macro
153 .\" NS   computes the width of a string as a multiple of `doc-fixed-width':
154 .\" NS   `.doc-get-width string'
155 .\" NS
156 .\" NS modifies:
157 .\" NS   doc-width
159 .de doc-get-width
160 .  nr doc-width \w\a\$1\a
161 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
162 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
163 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
164 .    el \
165 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
166 .  \}
167 .  el \
168 .    nr doc-width 0
172 .\" NS doc-get-arg-width macro
173 .\" NS   computes the width of an argument as a multiple of
174 .\" NS   `doc-fixed-width': `.doc-get-arg-width arg-index'
175 .\" NS
176 .\" NS modifies:
177 .\" NS   doc-width
179 .de doc-get-arg-width
180 .  nr doc-width \w\a\*[doc-arg\$1]\a
181 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
182 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
183 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
184 .    el \
185 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
186 .  \}
187 .  el \
188 .    nr doc-width 0
192 .\" NS Ql macro
193 .\" NS   quoted literal define
194 .\" NS
195 .\" NS width register `.Ql' set in doc-common
196 .\" NS
197 .\" NS local variable:
198 .\" NS   doc-reg-Ql
200 .de Ql
201 .  if !\n[doc-args-processed] \{\
202 .    ds doc-macro-name Ql
204 .    nr doc-reg-Ql 1
205 .    while (\n[doc-reg-Ql] <= \n[.$]) \{\
206 .      ds doc-arg\n[doc-reg-Ql] "\$[\n[doc-reg-Ql]]
207 .      nr doc-reg-Ql +1
208 .    \}
210 .    nr doc-num-args \n[.$]
211 .    doc-parse-arg-vector
212 .  \}
214 .  ds doc-quote-left "\*[doc-left-singlequote]
215 .  ds doc-quote-right "\*[doc-right-singlequote]
217 .  doc-enclose-string \$@
221 .\" NS Sh macro
222 .\" NS   section headers
223 .\" NS
224 .\" NS width register `.Sh' set in doc-common
225 .\" NS
226 .\" NS local variable:
227 .\" NS   doc-reg-Sh
229 .de Sh
230 .  nr doc-in-synopsis-section 0
231 .  nr doc-indent-synopsis 0
233 .  ie "\$1"NAME" \{\
234 .    doc-setup-header
235 '    in 0
236 .  \}
237 .  el \{\
238 .    nr doc-in-synopsis-section 0
239 .    nr doc-in-see-also-section 0
240 .    nr doc-in-files-section 0
241 .    nr doc-in-standards-section 0
242 .    nr doc-in-authors-section 0
244 .    if "\$1"SEE" \
245 .      nr doc-in-see-also-section 1
246 .    if "\$1"FILES" \
247 .      nr doc-in-files-section 1
248 .    if "\$1"STANDARDS" \
249 .      nr doc-in-standards-section 1
250 .    if "\$1"SYNOPSIS" \
251 .      nr doc-in-synopsis-section 1
252 .    if "\$1"DESCRIPTION" \{\
253 .      nr doc-is-func-type 0
254 .      nr doc-function-count 0
255 .      nr doc-function-args-processed 0
256 .      nr doc-num-function-args 0
257 .      ds doc-function-arg
258 .    \}
259 .    if "\$1"AUTHORS" \
260 .      nr doc-in-authors-section 1
262 .    in 0
263 .  \}
265 .  doc-setup-page-layout
266 '  sp
267 .  ns
268 .  ta T .5i
269 .  if !\n[cR] \
270 .    ne 3
271 '  fi
273 .  ie \n[.$] \{\
274 .    nop \*[doc-Sh-font]\$1\c
275 .    nr doc-reg-Sh 2
276 .    while (\n[doc-reg-Sh] <= \n[.$]) \{\
277 .      nop \& \|\$[\n[doc-reg-Sh]]\c
278 .      nr doc-reg-Sh +1
279 .    \}
280 .    nop \f[P]\s[0]
281 .  \}
282 .  el \
283 .    tm Usage: .Sh section name (#\n[.c])
285 .  in (\n[.i]u + \n[doc-subheader-indent]u)
286 .  ns
289 .\" EOF