Merge branch 'topic/earlyfix'
[s-roff.git] / tmac / mdoc-ditroff
blobb37f59be37e53f26e3dd886a41b4d7b1a15c2213
1 .\"@ mdoc-ditroff
2 .\"@ Definitions for all devices without a specialized mdoc- package.
3 .\"@ See doc.tmac for more on the mdoc semantic markup language.
4 .\"
5 .\" Copyright (c) 1991, 1993
6 .\"     The Regents of the University of California.  All rights reserved.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. [Deleted.  See
17 .\"     ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change]
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\"    may be used to endorse or promote products derived from this software
20 .\"    without specific prior written permission.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" SUCH DAMAGE.
33 .\"
34 .\"     @(#)doc-ditroff 8.1 (Berkeley) 06/08/93
35 .\" Adapted to S-roff by Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
36 .\"
37 .\"     %beginstrip%
40 .eo
42 .\" use -rD=1 for double-sided printing
44 .if !r D .nr D 0
46 .\" use -rcR=1 to force the creation of a single, very long page
48 .if !r cR .nr cR 0
50 .\" use -rS={11,12} to change the font size from 10pt to 11pt or 12pt.
52 .if !r S .nr S 10
55 .ec
58 .ie        (\n[S] == 11) \{\
59 .  ps 10.95z
60 .  vs 13.6p
61 .\}
62 .el \{ .ie (\n[S] == 12) \{\
63 .  ps 12z
64 .  vs 14.5p
65 .\}
66 .el \{\
67 .  ps 10z
68 .  vs 12p
69 .\}\}
72 .\" the `doc-xx-font' strings must not be empty!
74 .ds doc-caption-font \f[R]\s[\n[.ps]u]
75 .ds doc-caption-font2 \f[R]\s[\n[.ps]u]
76 .ds doc-Ad-font \f[I]\s[\n[.ps]u]
77 .ds doc-Ar-font \f[CO]\s[\n[.ps]u]
78 .ds doc-Cm-font \f[CB]\s[\n[.ps]u]
79 .ds doc-Em-font \f[I]\s[\n[.ps]u]
80 .ds doc-Er-font \f[C]\s[\n[.ps]u]
81 .ds doc-Ev-font \f[C]\s[\n[.ps]u]
82 .ds doc-Fa-font \f[CO]\s[\n[.ps]u]
83 .ds doc-Fd-font \f[CB]\s[\n[.ps]u]
84 .ds doc-Fl-font \f[CB]\s[\n[.ps]u]
85 .ds doc-Fn-font \f[CB]\s[\n[.ps]u]
86 .ds doc-Ft-font \f[CO]\s[\n[.ps]u]
87 .ds doc-Ic-font \f[CB]\s[\n[.ps]u]
88 .ds doc-Li-font \f[C]
89 .ds doc-Me-font \f[B]\s[\n[.ps]u]
90 .ds doc-Nm-font \f[CB]\s[\n[.ps]u]
91 .ds doc-No-font \f[R]\s[\n[.ps]u]
92 .ds doc-Pa-font \f[C]\s[\n[.ps]u]
93 .ds doc-Sh-font \f[B]\s[\n[.ps]u]
94 .ds doc-Sy-font \f[B]\s[\n[.ps]u]
95 .ds doc-Sx-font \f[B]\s[\n[.ps]u]
96 .ds doc-Tn-font-shape \f[R]
97 \# XXX: adapt to discrete LaTeX font sizes
98 .ds doc-Tn-font-size \s[(\n[.ps]u - 1z)]
99 .ds doc-Va-font \f[I]\s[\n[.ps]u]
100 .ds doc-Xr-font \f[C]\s[\n[.ps]u]
102 .ds doc-left-parenthesis \f[R]\|(\|\f[]\s[\n[.ps]u]
103 .ds doc-right-parenthesis \f[R]\|)\|\f[]\s[\n[.ps]u]
104 .ds lp \f[R](\f[]\s[\n[.ps]u]
105 .ds rp \f[R])\f[]\s[\n[.ps]u]
106 .ds doc-left-bracket \f[R]\^[\^\f[]\s[\n[.ps]u]
107 .ds doc-right-bracket \f[R]\^]\f[]\s[\n[.ps]u]
109 .tr *\[**]
111 .\" miscellaneous
112 .nr doc-subheader-indent (\w\a\f[C],\au * 5u)
113 .nr doc-paragraph-space .5v
115 .nr doc-digit-width \w'\0'u
116 .nr doc-fixed-width \w\a\f[C]0\a
121 .\" NS doc-header-space global register
122 .\" NS   the space between header and body
124 .nr doc-header-space .5i
127 .\" NS doc-footer-space global register
128 .\" NS   the space between body and footer
130 .nr doc-footer-space .5i
133 .\" NS doc-display-vertical global register
134 .\" NS   vertical space between list elements etc.
136 .nr doc-display-vertical 0
139 .\" NS doc-setup-page-layout macro
140 .\" NS   set up page layout
141 .\" NS
142 .\" NS modifies:
143 .\" NS   doc-display-vertical
145 .de doc-setup-page-layout
146 .  ie r LL \
147 .    ll \n[LL]u
148 .  el \
149 .    ll 6.5i
151 .  ie r LT \
152 .    lt \n[LT]u
153 .  el \
154 .    lt 6.5i
156 .  po 1i
158 .  nr doc-display-vertical .5v
162 .ds doc-left-singlequote \[oq]
163 .ds doc-right-singlequote \[cq]
165 .\" the following strings are `official'
166 .ds <= \[<=]
167 .ds >= \[>=]
168 .ds Lq \[lq]
169 .ds Rq \[rq]
170 .ds ua \[ua]
171 .ds aa \[aa]
172 .ds ga \[ga]
173 .ds q \[dq]
174 .ds Pi \[*p]
175 .ds Ne \[!=]
176 .ds Le \[<=]
177 .ds Ge \[>=]
178 .ds Lt <
179 .ds Gt >
180 .ds Pm \[+-]
181 .ds If \[if]
182 .ds Na \f[I]NaN\f[]
183 .ds Ba \f[R]|\f[]
184 .ds Am &
187 .\" NS doc-header-string global string
188 .\" NS   the final string used for the manual page header
190 .ds doc-header-string
193 .\" NS doc-setup-header macro
194 .\" NS   install and initialize header and footer support
195 .\" NS
196 .\" NS modifies:
197 .\" NS   doc-header-string
199 .de doc-setup-header
200 .  ds doc-header-string "\*[doc-document-title]
201 .  if !"\*[doc-section]"Null" \
202 .    as doc-header-string \|(\*[doc-section])
204 .  wh 0 doc-header
205 .  wh -1.25i doc-footer
207 .  br
209 .  e@ doc-end-macro
213 .\" NS doc-get-width macro
214 .\" NS   computes the width of a string as a multiple of `doc-fixed-width':
215 .\" NS   `.doc-get-width string'
216 .\" NS
217 .\" NS modifies:
218 .\" NS   doc-width
220 .de doc-get-width
221 .  nr doc-width \w\a\f[C]\$1\a
222 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
223 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
224 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
225 .    el \
226 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
227 .  \}
228 .  el \{\
229 .    ie \n[doc-width] \
230 .      nr doc-width 1
231 .    el \
232 .      nr doc-width 0
233 .  \}
237 .\" NS doc-get-arg-width macro
238 .\" NS   computes the width of an argument as a multiple of
239 .\" NS   `doc-fixed-width': `.doc-get-arg-width arg-index'
240 .\" NS
241 .\" NS modifies:
242 .\" NS   doc-width
244 .de doc-get-arg-width
245 .  nr doc-width \w\a\f[C]\*[doc-arg\$1]\a
246 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
247 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
248 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
249 .    el \
250 .      nr doc-width (\n[doc-width] / \n[doc-fixed-width])
251 .  \}
252 .  el \{\
253 .    ie \n[doc-width] \
254 .      nr doc-width 1
255 .    el \
256 .      nr doc-width 0
257 .  \}
261 .\" NS Ql user macro
262 .\" NS   quoted literal define
263 .\" NS
264 .\" NS modifies:
265 .\" NS   doc-argXXX
266 .\" NS   doc-arg-limit
267 .\" NS   doc-arg-ptr
268 .\" NS   doc-macro-name
269 .\" NS   doc-spaceXXX
270 .\" NS   doc-typeXXX
271 .\" NS   doc-quote-left
272 .\" NS   doc-quote-right
273 .\" NS
274 .\" NS local variables:
275 .\" NS   doc-reg-Ql
276 .\" NS   doc-reg-Ql1
277 .\" NS   doc-reg-Ql2
278 .\" NS
279 .\" NS width register `Ql' set in doc-common
281 .de Ql
282 .  if !\n[doc-arg-limit] \{\
283 .    ie \n[.$] \{\
284 .      ds doc-macro-name Ql
285 .      doc-parse-args \$@
286 .    \}
287 .    el \
288 .      tm Usage: .Ql argument ... (#\n[.c])
289 .  \}
291 .  nr doc-reg-Ql (\n[doc-arg-ptr] + 1)
292 .  doc-get-arg-width \n[doc-reg-Ql]
294 .  \" don't use quotes if we have more than two succeeding string arguments
295 .  nr doc-reg-Ql +1
296 .  if (\n[doc-arg-limit] >= \n[doc-reg-Ql]) \
297 .    if (\n[doc-type\n[doc-reg-Ql]] == 2) \
298 .      nr doc-width 3
300 .  \" make a difference in quotation style for strings longer
301 .  \" than two characters
302 .  ie (\n[doc-width] > 2) \
303 .    Li
304 .  el \{\
305 .    ie \n[doc-arg-ptr] \{\
306 .      \" we replace `Ql' with `Li'
307 .      ds doc-arg\n[doc-arg-ptr] Li
308 .      nr doc-arg-ptr -1
309 .    \}
310 .    el \{\
311 .      \" if .Ql has been called directly, we must shift all elements in
312 .      \" the argument vector to the right so that we can insert `Li'
313 .      nr doc-reg-Ql \n[doc-arg-limit]
314 .      nr doc-reg-Ql1 (\n[doc-arg-limit] + 1)
315 .      while \n[doc-reg-Ql] \{\
316 .        rn doc-arg\n[doc-reg-Ql] doc-arg\n[doc-reg-Ql1]
317 .        rnn doc-type\n[doc-reg-Ql] doc-type\n[doc-reg-Ql1]
318 .        rn doc-space\n[doc-reg-Ql] doc-space\n[doc-reg-Ql1]
319 .        nr doc-reg-Ql -1
320 .        nr doc-reg-Ql1 -1
321 .      \}
322 .      ds doc-arg1 Li
323 .      nr doc-type1 1
324 .      ds doc-space1
325 .      nr doc-arg-limit +1
326 .    \}
328 .    ds doc-quote-left "\*[doc-left-singlequote]
329 .    ds doc-quote-right "\*[doc-right-singlequote]
330 .    doc-enclose-string
331 .  \}
337 .\" s-ts-mode