* doc/groff.texinfo: More info on conditionals.
[s-roff.git] / tmac / an-old.tmac
blob9ef041f93ecc2bc1a942a1bb4831c6bfc6100d72
1 .\" an-old.tmac
2 .\"
3 .\" Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
4 .\"      Written by James Clark (jjc@jclark.com)
5 .\"
6 .\" This file is part of groff.
7 .\"
8 .\" groff is free software; you can redistribute it and/or modify it under
9 .\" the terms of the GNU General Public License as published by the Free
10 .\" Software Foundation; either version 2, or (at your option) any later
11 .\" version.
12 .\"
13 .\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 .\" for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public License along
19 .\" with groff; see the file COPYING.  If not, write to the Free Software
20 .\" Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 .\"
22 .\"  -rcR=1 => Create a single, very long page instead of multiple pages.
23 .\"            Useful for online display.  Default in nroff mode.
24 .\"            Desactivate with -rcR=0.
25 .\"  -rC1 => Number pages continuously, rather than start each at 1.
26 .\"  -rD1 => Double-sided printing, ie different odd and even page footers.
27 .\"  -rPnnn => Number first page nnn.
28 .\"  -rSxx => Use size `xx'pt (either 10, 11, or 12) for document rather
29 .\"           than the default size of 10pt.
30 .\"  -rXnnn => Number pages after nnn as nnna, nnnb, nnnc, ...
31 .\"
32 .\" The file man.local is loaded at the end.  Put local additions there.
33 .\" If you need to add things to TH, use `.am TH'.
34 .\"
36 .if !\n(.g .ab These man macros work only with groff.
38 .nr _C \n[.C]
39 .cp 0
41 .if !r D .nr D 0
42 .if !r C .nr C 0
43 .if !r S .nr S 10
44 .\" we must use consecutive page numbers when using postscript to generate
45 .\" html images, and we must not reset the page number at the beginning
46 .\" (the `ps4html' register is automatically added to the command line by
47 .\" the pre-html preprocessor)
48 .if !r ps4html \
49 .  if r P .pn 0\n[P]
50 .if !r cR \{\
51 .  ie n .nr cR 1
52 .  el   .nr cR 0
53 .\}
55 .nr an-html 0
56 .if '\*(.T'html' .nr an-html 1
57 .if \n[an-html] .nr C 1
58 .if r ps4html .nr C 1
60 .de set-an-margin
61 .  nr an-margin \\n[IN]
64 .\" .TH title section extra1 extra2 extra3
65 .de TH
66 .  if \\n[an-html] \{\
67 .     HTML-TAG ".tl"
68 \\$1
69 .  \}
70 .  cp 0
72 .  de an-init \" We have to do it like this to get multiple man pages right.
73 .    ds an-title "\\$1
74 .    ds an-section "\\$2
75 .    ds an-extra1 "\\$3
76 .    ie (\\n[.$] > 3) .ds an-extra2 "\\$4
77 .    el               .ds an-extra2 \"Sun Release 4.0
78 .    ie (\\n[.$] > 4) .ds an-extra3 "\\$5
79 .    el               .ds an-extra3 \"System Programmer's Manual
80 .    ds an-init
81 \\..
83 .  DT
85 .  nr PS    10z \" default point size
86 .  nr PS-SS 10z
87 .  nr PS-SH 10.95z
88 .  nr VS    12p
90 .  \" use sizes similar to LaTeX
91 .  if t \{\
92 .    ie (\\n[S] == 11) \{\
93 .      nr PS    10.95z
94 .      nr PS-SS 10.95z
95 .      nr PS-SH 12z
96 .      nr VS    13.6p
97 .    \}
98 .    el \{\
99 .      if (\\n[S] == 12) \{\
100 .        nr PS    12z
101 .        nr PS-SS 12z
102 .        nr PS-SH 14.4z
103 .        nr VS    14.5p
104 .      \}
105 .    \}
106 .  \}
108 .  ps \\n[PS]u
109 .  vs \\n[VS]u
111 .  nr IN 7.2n
112 .  PD
113 .  nr SN 3n \" the indentation of sub-sub-headings relative to sub-headings
114 .  nr an-level 1
115 .  set-an-margin
116 .  nr an-prevailing-indent \\n[IN]
117 .  nr an-tag-sep 1n
119 .  nr an-no-space-flag 0
120 .  nr an-break-flag 0
121 .  nr an-div? 0
123 .  ie \\n[cR] \
124 .    an-header
125 .  el \{\
126 .    wh 0 an-header
127 .    wh -1i an-footer
128 .    wh -.5i an-p-footer
130 .    if (\\n[nl] > 0) \{\
131 .      ie \\n[C] .bp (\\n[%] + 1)
132 .      el        .bp 1
133 .    \}
134 .  \}
137 .de DT
138 .  ta T .5i \" This sets tabs every .5 inches
141 .de PD
142 .  ie \\n[.$] .nr PD (v;\\$1)
143 .  el         .nr PD (.4v >? \n[.V])
146 .de an-header
147 .  an-init
148 .  ev 1
149 .  ps \\n[PS]u
150 .  vs \\n[VS]u
151 .  ie \\n[an-html] \
152 .    tl ''''
153 .  el \{\
154 .    if !\\n[cR] \
155 .      sp .5i
156 .    tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
157 .    ie !\\n[cR] \
158 .      sp |1i
159 .    el \
160 .      sp .5i
161 .  \}
162 .  ev
163 .  ns
166 .de an-footer
167 '  bp
170 .af an-page-letter a
172 .de an-p-footer
173 .  ev 1
174 .  ps \\n[PS]u
175 .  vs \\n[VS]u
176 .  ie \\n[an-html] \{\
177 .    ds an-page-string
178 .    ds an-extra1
179 .    ds an-extra2
180 .  \}
181 .  el \{\
182 .    ie r X \{\
183 .      if (\\n[%] > \\n[X]) \{\
184 .        nr an-page-letter (\\n[%] - \\n[X])
185 .        ds an-page-string \\n[X]\\n[an-page-letter]
186 .      \}
187 .    \}
188 .    el \{\
189 .      ie \\n[cR] \
190 .        ds an-page-string "\\*[an-title](\\*[an-section])
191 .      el \
192 .        ds an-page-string \\n[%]
193 .    \}
194 .  \}
195 .  ie \\n[D] \{\
196 .    if o .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
197 .    if e .tl '\\*[an-page-string]'\\*[an-extra1]'\\*[an-extra2]'
198 .  \}
199 .  el \
200 .    tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
201 .  ev
204 .de an-end
205 .  nr % 1
206 .  pl +3v
207 .  fl
208 .  sp 3
209 .  an-p-footer
210 .  pl \\n[nl]u
213 .if \n[cR] .em an-end
215 .de SH
216 .  sp \\n[PD]u
217 .  nr an-level 1
218 .  set-an-margin
219 .  nr an-prevailing-indent \\n[IN]
220 .  fi
221 .  in \\n[an-margin]u
222 .  ti 0
223 .  HTML-TAG ".NH \\n[an-level]"
224 .  it 1 an-trap
225 .  nr an-no-space-flag 1
226 .  nr an-break-flag 1
227 .  ps \\n[PS-SH]u
228 .  ft B
229 .  if !\\n[cR] .ne (2v + 1u)
230 .  if \\n[.$] \&\\$*
233 .de SS
234 .  sp \\n[PD]u
235 .  nr an-level 1
236 .  set-an-margin
237 .  nr an-prevailing-indent \\n[IN]
238 .  fi
239 .  in \\n[IN]u
240 .  ti \\n[SN]u
241 .  it 1 an-trap
242 .  nr an-no-space-flag 1
243 .  nr an-break-flag 1
244 .  ps \\n[PS-SS]u
245 .  ft B
246 .  if !\\n[cR] .ne (2v + 1u)
247 .  if \\n[.$] \&\\$*
250 .de B
251 .  it 1 an-trap
252 .  ft B
253 .  if \\n[.$] \&\\$*
256 .de I
257 .  it 1 an-trap
258 .  ft I
259 .  if \\n[.$] \&\\$*
262 .de SM
263 .  it 1 an-trap
264 .  ps -1
265 .  if \\n[.$] \&\\$*
268 .de SB
269 .  it 1 an-trap
270 .  ps -1
271 .  ft B
272 .  if \\n[.$] \&\\$*
275 .de TP
276 .  sp \\n[PD]u
277 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
278 .  it 1 an-trap
279 .  if !\\n[an-div?] .di an-div
280 .  ie \\n[an-html] .in \\n[an-margin]u
281 .  el \{\
282 .    in 0
283 .    ll -\\n[an-margin]u
284 .  \}
285 .  nr an-div? 1
288 .de an-trap
289 .  ft R
290 .  ps \\n[PS]u
291 .  vs \\n[VS]u
292 .  if \\n[an-break-flag] \{\
293 .    br
294 .    nr an-break-flag 0
295 .  \}
296 .  if \\n[an-no-space-flag] \{\
297 .    ns
298 .    nr an-no-space-flag 0
299 .  \}
300 .  if \\n[an-div?] .an-do-tag
303 .de an-do-tag
304 .  nr an-div? 0
305 .  br
306 .  ll
307 .  di
308 .  ie (\\n[dl] + \\n[an-tag-sep] > \\n[an-prevailing-indent]) \{\
309 .    in \\n[an-margin]u
310 .    if !\\n[cR] .ne (2v + 1u)
311 .    an-div
312 .    br
313 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
314 .  \}
315 .  el \{\
316 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
317 .    ti -\\n[an-prevailing-indent]u
318 .    chop an-div
319 .    if !\\n[cR] .ne (1v + 1u)
320 \\*[an-div]\\h'|\\n[an-prevailing-indent]u'\c
321 .  \}
324 .de LP
325 .  br
326 .  sp \\n[PD]u
327 .  ps \\n[PS]u
328 .  vs \\n[VS]u
329 .  ft R
330 .  in \\n[an-margin]u
331 .  nr an-prevailing-indent \\n[IN]
334 .als PP LP
335 .als P LP
337 .de IP
338 .  ie !\\n[.$] \{\
339 .    ps \\n[PS]u
340 .    vs \\n[VS]u
341 .    ft R
342 .    sp \\n[PD]u
343 .    if !\\n[cR] .ne (1v + 1u)
344 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
345 .  \}
346 .  el \{\
347 .    ie (\\n[.$] - 1) .TP "\\$2"
348 .    el               .TP
349 \&\\$1
350 .  \}
353 .de HP
354 .  ps \\n[PS]u
355 .  vs \\n[VS]u
356 .  ft R
357 .  sp \\n[PD]u
358 .  if !\\n[cR] .ne (1v + 1u)
359 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
360 .  in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
361 .  ti \\n[an-margin]u
364 .ds an-empty \" this is referenced to avoid looping on eg .RB ( \\ )
366 .de RI
367 .  if \\n[.$] \{\
368 .    ds an-result \&\\$1
369 .    shift
370 .    while (\\n[.$] >= 2) \{\
371 .      as an-result \,\f[I]\\$1\f[R]\/\\$2\\*[an-empty]
372 .      shift 2
373 .    \}
374 .    if \\n[.$] .as an-result \,\f[I]\\$1\f[R]
375 \\*[an-result]
376 .  \}
379 .de IR
380 .  if \\n[.$] \{\
381 .    ds an-result \&\f[I]\\$1\f[R]
382 .    shift
383 .    while (\\n[.$] >= 2) \{\
384 .      as an-result \/\\$1\f[I]\,\\$2\f[R]
385 .      shift 2
386 .    \}
387 .    if \\n[.$] .as an-result \/\\$1
388 \\*[an-result]
389 .  \}
392 .de IB
393 .  if \\n[.$] \{\
394 .    ds an-result \&\f[I]\\$1
395 .    shift
396 .    while (\\n[.$] >= 2) \{\
397 .      as an-result \/\f[B]\\$1\f[I]\,\\$2\\*[an-empty]
398 .      shift 2
399 .    \}
400 .    if \\n[.$] .as an-result \/\f[B]\\$1
401 \\*[an-result]
402 .    ft R
403 .  \}
406 .de BI
407 .  if \\n[.$] \{\
408 .    ds an-result \&\f[B]\\$1
409 .    shift
410 .    while (\\n[.$] >= 2) \{\
411 .      as an-result \,\f[I]\\$1\f[B]\/\\$2\\*[an-empty]
412 .      shift 2
413 .    \}
414 .    if \\n[.$] .as an-result \,\f[I]\\$1
415 \\*[an-result]
416 .    ft R
417 .  \}
420 .de RB
421 .  ds an-result \&
422 .  while (\\n[.$] >= 2) \{\
423 .    as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]
424 .    shift 2
425 .  \}
426 .  if \\n[.$] .as an-result \f[R]\\$1
427 \\*[an-result]
428 .  ft R
431 .de BR
432 .  ds an-result \&
433 .  while (\\n[.$] >= 2) \{\
434 .    as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]
435 .    shift 2
436 .  \}
437 .  if \\n[.$] .as an-result \f[B]\\$1
438 \\*[an-result]
439 .  ft R
442 .de RS
443 .  br
444 .  nr an-saved-margin\\n[an-level] \\n[an-margin]
445 .  nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
446 .  ie \\n[.$] .nr an-margin +(n;\\$1)
447 .  el         .nr an-margin +\\n[an-prevailing-indent]
448 .  in \\n[an-margin]u
449 .  nr an-prevailing-indent \\n[IN]
450 .  nr an-level +1
453 .de RE
454 .  br
455 .  ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
456 .  el         .nr an-level -1
457 .  nr an-level (1 >? \\n[an-level])
458 .  nr an-margin \\n[an-saved-margin\\n[an-level]]
459 .  nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
460 .  in \\n[an-margin]u
463 .ds S \s[\\n[PS]]
464 .ie c\[rg] .ds R \[rg]
465 .el        .ds R (Reg.)
466 .ie c\[tm] .ds Tm \[tm]
467 .el        .ds Tm (TM)
468 .ds lq \(lq
469 .ds rq \(rq
471 .if !\n[an-html] .hy 14
473 .\" Load local modifications.
474 .mso man.local
476 .cp \n[_C]
478 .\" end of an-old.tmac