b46202a1c191383778a198066332f0d335751994
[platform/upstream/groff.git] / tmac / an-old.tmac
1 .\" -*- nroff -*-
2 .\"
3 .\" an-old.tmac
4 .\"
5 .\" Copyright (C) 1989-2014  Free Software Foundation, Inc.
6 .\"      Written by James Clark (jjc@jclark.com)
7 .\"
8 .\" This file is part of groff.
9 .\"
10 .\" groff is free software; you can redistribute it and/or modify it under
11 .\" the terms of the GNU General Public License as published by the Free
12 .\" Software Foundation, either version 3 of the License, or
13 .\" (at your option) any later version.
14 .\"
15 .\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18 .\" for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public License
21 .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
22 .\"
23 .\"  -rcR=1 => Create a single, very long page instead of multiple pages.
24 .\"            Useful for online display.  Default in nroff mode.
25 .\"            Desactivate with -rcR=0.
26 .\"  -rC1 => Number pages continuously, rather than start each at 1.
27 .\"  -rD1 => Double-sided printing, ie different odd and even page footers.
28 .\"  -rPnnn => Number first page nnn.
29 .\"  -rSxx => Use size `xx'pt (either 10, 11, or 12) for document rather
30 .\"           than the default size of 10pt.
31 .\"  -rXnnn => Number pages after nnn as nnna, nnnb, nnnc, ...
32 .\"
33 .\" The file man.local is loaded at the end.  Put local additions there.
34 .\" If you need to add things to TH, use `.am1 TH'.
35 .\"
36 .
37 .if !\n(.g .ab These man macros work only with groff.
38 .
39 .do if d RI .nx
40 .
41 .do mso devtag.tmac
42 .
43 .nr _C \n(.C
44 .cp 0
45 .
46 .if (\n[.x]\n[.y] < 118) \
47 .  ab You need GNU troff version 1.18 or higher to run this version of man!
48 .
49 .if !r D .nr D 0
50 .if !r C .nr C 0
51 .if !r S .nr S 10
52 .\" we must use consecutive page numbers when using postscript to generate
53 .\" html images, and we must not reset the page number at the beginning
54 .\" (the `ps4html' register is automatically added to the command line by
55 .\" the pre-html preprocessor)
56 .if !r ps4html \
57 .  if r P .pn 0\n[P]
58 .if !r cR \{\
59 .  ie n .nr cR 1
60 .  el   .nr cR 0
61 .\}
62 .
63 .nr need_eo_h 0
64 .nr need_col2 0
65 .
66 .\" set up the line length...
67 .\" giving precedence to any prior assignment to the \n[LL] register.
68 .if !r LL \{\
69 .
70 .  \" but if that isn't predefined...
71 .  \" then try to respect any prior `.ll' request.
72 .  nr LL \n[.l]
73 .
74 .  \" For troff, this is sufficient to give us a default line length of
75 .  \" 6.5i, but for nroff, we prefer a default of 78n to nroff's default
76 .  \" 65n.  This has the unfortunate side effect that we will override a
77 .  \" user's `.ll 65n' request, with our preferred 78n default; we can't
78 .  \" possibly know that the 65n came from a `.ll' request, and MUST
79 .  \" assume that it was set by nroff, as its built-in default!  If the
80 .  \" user wants to force this setting, then he MUST use the `-rLL=65n'
81 .  \" option, or an equivalent `.nr LL 65n' request.
82 .  if n \
83 .    if (\n[LL] = 65n) \
84 .      nr LL 78n
85 .\}
86 .
87 .if !r LT \
88 .  nr LT \n[LL]
89 .
90 .nr FT (-.5i)
91 .
92 .\" Default heading font
93 .ds HF B\"
94 .
95 .nr an-first 1
96 .
97 .nr an-html 0
98 .if '\*[.T]'html' .nr an-html 1
99 .if \n[an-html] .nr C 1
100 .if r ps4html .nr C 1
101 .
102 .\" we redefine .ne to avoid page breaks if cR is set; instead, the page
103 .\" length is increased to the necessary amount (this is needed for tables)
104 .\"
105 .\" similarly, we redefine .bp if cR is set, adjusting the page length to
106 .\" the current position so that no empty lines are inserted
107 .if \n[cR] \{\
108 .  de1 ne
109 .    ie \\n[.$] \
110 .      nr an-ne (v;\\$*)
111 .    el \
112 .      nr an-ne 1v
113 .    if (\\n[an-ne] >= \\n[.t]) \
114 .      pl +(\\n[an-ne]u - \\n[.t]u + 1v)
115 .  .
116 .
117 .  rn bp an-bp
118 .  de1 bp
119 .    br
120 .    pl \\n[nl]u
121 .    an-bp \\$*
122 .  .
123 .\}
124 .
125 .de set-an-margin
126 .  nr an-level 1
127 .  nr an-margin \\n[IN]
128 .  nr an-saved-margin1 \\n[IN]
129 .  nr an-prevailing-indent \\n[IN]
130 .  nr an-saved-prevailing-indent1 \\n[IN]
131 ..
132 .
133 .ds an-extra1
134 .ds an-extra2
135 .ds an-extra3
136 .
137 .\" .TH title section extra1 extra2 extra3
138 .de1 TH
139 .  if \\n[an-html] \{\
140 .    DEVTAG-TL
141 .    nop \\$1
142 .    DEVTAG-EO-TL
143 .  \}
144 .
145 .  de an-init \" We have to do it like this to get multiple man pages right.
146 .    ds an-title "\\$1\"
147 .    ds an-section "\\$2\"
148 .    ds an-extra1 "\\$3\"
149 .    ie (\\n[.$] > 3)    .ds an-extra2 "\\$4\"
150 .    el                  .ds an-extra2 \"Sun Release 4.0
151 .
152 .    ie (\\n[.$] > 4)    .ds an-extra3 "\\$5\"
153 .    el \{ .ie '\\$2'1'  .ds an-extra3 General Commands Manual
154 .    el \{ .ie '\\$2'2'  .ds an-extra3 System Calls Manual
155 .    el \{ .ie '\\$2'3'  .ds an-extra3 Library Functions Manual
156 .    el \{ .ie '\\$2'3p' .ds an-extra3 Perl Programmers Reference Guide
157 .    el \{ .ie '\\$2'4'  .ds an-extra3 Kernel Interfaces Manual
158 .    el \{ .ie '\\$2'5'  .ds an-extra3 File Formats Manual
159 .    el \{ .ie '\\$2'6'  .ds an-extra3 Games Manual
160 .    el \{ .ie '\\$2'7'  .ds an-extra3 Miscellaneous Information Manual
161 .    el \{ .ie '\\$2'8'  .ds an-extra3 System Manager's Manual
162 .    el \{ .ie '\\$2'9'  .ds an-extra3 Kernel Developer's Manual
163 .    el                  .ds an-extra3
164 .    \}\}\}\}\}\}\}\}\}\}
165 .    ds an-init
166 \\..
167 .
168 .  DT
169 .
170 .  nr PS    10z \" default point size
171 .  nr PS-SS 10z
172 .  nr PS-SH 10.95z
173 .  nr VS    12p
174 .
175 .  \" use sizes similar to LaTeX
176 .  if t \{\
177 .    ie (\\n[S] == 11) \{\
178 .      nr PS    10.95z
179 .      nr PS-SS 10.95z
180 .      nr PS-SH 12z
181 .      nr VS    13.6p
182 .    \}
183 .    el \{\
184 .      if (\\n[S] == 12) \{\
185 .        nr PS    12z
186 .        nr PS-SS 12z
187 .        nr PS-SH 14.4z
188 .        nr VS    14.5p
189 .      \}
190 .    \}
191 .  \}
192 .
193 .  ps \\n[PS]u
194 .  vs \\n[VS]u
195 .  ll \\n[LL]u
196 .
197 .\" We must select an integer indentation value for nroff;
198 .\" see comment in an-do-tag.
199 .  if !r IN \{\
200 .    ie t .nr IN 7.2n
201 .    el   .nr IN 7n
202 .  \}
203 .  PD
204 .  if !r SN \
205 .    nr SN 3n \" the indentation of sub-sub-headings relative to sub-headings
206 .  set-an-margin
207 .  nr an-tag-sep 1n
208 .
209 .  nr an-no-space-flag 0
210 .  nr an-break-flag 0
211 .  nr an-div? 0
212 .
213 .  ie \\n[cR] \
214 .    an-header
215 .  el \{\
216 .    wh 0 an-header
217 .    wh -1i an-footer
218 .    wh \\n[FT]u an-p-footer
219 .
220 .    if \\n[nl] \{\
221 .      ie \\n[C] .bp (\\n[%] + 1)
222 .      el        .bp 1
223 .    \}
224 .  \}
225 ..
226 .
227 .\" BSD compatibility macros: .AT and .UC
228 .
229 .de1 AT
230 .  ds an-extra2 "7th Edition\"
231 .  if "\\$1"3" .ds an-extra2 "7th Edition\"
232 .  if "\\$1"4" .ds an-extra2 "System III\"
233 .  if "\\$1"5" \{\
234 .    ie "\\$2"" .ds an-extra2 "System V\"
235 .    el .ds an-extra2 "System V Release \\$2\"
236 .  \}
237 ..
238 .
239 .de1 UC
240 .  ds an-extra2 "3rd Berkeley Distribution\"
241 .  if "\\$1"3" .ds an-extra2 "3rd Berkeley Distribution\"
242 .  if "\\$1"4" .ds an-extra2 "4th Berkeley Distribution\"
243 .  if "\\$1"5" .ds an-extra2 "4.2 Berkeley Distribution\"
244 .  if "\\$1"6" .ds an-extra2 "4.3 Berkeley Distribution\"
245 .  if "\\$1"7" .ds an-extra2 "4.4 Berkeley Distribution\"
246 ..
247 .
248 .de1 DT
249 .  ta T .5i \" This sets tabs every .5 inches
250 ..
251 .
252 .de1 PD
253 .  ie \\n[.$] .nr PD (v;\\$1)
254 .  el         .nr PD (.4v >? \n[.V])
255 ..
256 .
257 .\" Redefine these to customize the header & footer
258 .
259 .de1 PT
260 .  tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
261 ..
262 .
263 .de1 BT
264 .  if r ps4html \
265 .    return
266 .  ie \\n[D] \{\
267 .    if o .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
268 .    if e .tl '\\*[an-page-string]'\\*[an-extra1]'\\*[an-extra2]'
269 .  \}
270 .  el \
271 .    tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
272 ..
273 .
274 .de1 an-header
275 .  an-init
276 .  if \\n[cR] \{\
277 .    ie \\n[an-first] \
278 .      nr an-first 0
279 .    el \
280 .      sp .5i
281 .  \}
282 .  ev an-1
283 .  ps \\n[PS]u
284 .  vs \\n[VS]u
285 .  lt \\n[LT]u
286 .  ie \\n[an-html] \
287 .    tl ''''
288 .  el \{\
289 .    if !\\n[cR] \
290 .      sp .5i
291 .    PT
292 .    ie !\\n[cR] \
293 .      sp |1i
294 .    el \
295 .      sp .5i
296 .  \}
297 .  ev
298 .  ns
299 ..
300 .
301 .de1 an-footer
302 '  bp
303 ..
304 .
305 .af an-page-letter a
306 .
307 .de1 an-p-footer
308 .  ev an-1
309 .  ps \\n[PS]u
310 .  vs \\n[VS]u
311 .  lt \\n[LT]u
312 .  ie \\n[an-html] \{\
313 .    ds an-page-string
314 .    ds an-extra1
315 .    ds an-extra2
316 .  \}
317 .  el \{\
318 .    ie r X \{\
319 .      if (\\n[%] > \\n[X]) \{\
320 .        nr an-page-letter (\\n[%] - \\n[X])
321 .        ds an-page-string \\n[X]\\n[an-page-letter]\"
322 .      \}
323 .    \}
324 .    el \{\
325 .      ie \\n[cR] \
326 .        ds an-page-string "\\*[an-title](\\*[an-section])\"
327 .      el \
328 .        ds an-page-string \\n[%]\"
329 .    \}
330 .  \}
331 .  BT
332 .  ev
333 ..
334 .
335 .de1 an-end
336 .  nr % 1
337 .  pl +4v
338 .  fl
339 .  sp 3
340 .  an-p-footer
341 .  pl \\n[nl]u
342 ..
343 .
344 .if \n[cR] .em an-end
345 .
346 .de1 SH
347 .  sp \\n[PD]u
348 .  set-an-margin
349 .  fi
350 .  in \\n[an-margin]u
351 .  ti 0
352 .  nr need_eo_h 1
353 .  DEVTAG-NH \\n[an-level]
354 .  it 1 an-trap
355 .  nr an-no-space-flag 1
356 .  nr an-break-flag 1
357 .  ps \\n[PS-SH]u
358 .  ft \\*[HF]
359 .  ne (2v + 1u)
360 .  if \\n[.$] \&\\$*
361 ..
362 .
363 .de1 SS
364 .  sp \\n[PD]u
365 .  set-an-margin
366 .  fi
367 .  in \\n[IN]u
368 .  ti \\n[SN]u
369 .  it 1 an-trap
370 .  nr an-no-space-flag 1
371 .  nr an-break-flag 1
372 .  ps \\n[PS-SS]u
373 .  ft \\*[HF]
374 .  ne (2v + 1u)
375 .  if \\n[.$] \&\\$*
376 ..
377 .
378 .de1 B
379 .  it 1 an-trap
380 .  ft B
381 .  if \\n[.$] \&\\$*
382 ..
383 .
384 .de1 I
385 .  it 1 an-trap
386 .  ft I
387 .  if \\n[.$] \,\\$*\/
388 ..
389 .
390 .de1 SM
391 .  it 1 an-trap
392 .  ps -1
393 .  if \\n[.$] \&\\$*
394 ..
395 .
396 .de1 SB
397 .  it 1 an-trap
398 .  ps -1
399 .  ft B
400 .  if \\n[.$] \&\\$*
401 ..
402 .
403 .de1 TP
404 .  sp \\n[PD]u
405 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
406 .  it 1 an-trap
407 .  in 0
408 .  if !\\n[an-div?] \{\
409 .    ll -\\n[an-margin]u
410 .    di an-div
411 .  \}
412 .  nr an-div? 1
413 ..
414 .
415 .de1 an-trap
416 .  if \\n[need_eo_h]>0 .DEVTAG-EO-H
417 .  nr need_eo_h 0
418 .  if \\n[need_col2]>0 .DEVTAG-COL 2
419 .  nr need_col2 0
420 .  ft R
421 .  ps \\n[PS]u
422 .  vs \\n[VS]u
423 .  if \\n[an-break-flag] \{\
424 .    br
425 .    nr an-break-flag 0
426 .  \}
427 .  if \\n[an-no-space-flag] \{\
428 .    ns
429 .    nr an-no-space-flag 0
430 .  \}
431 .  if \\n[an-div?] .an-do-tag
432 ..
433 .
434 .de an-do-tag
435 .  br
436 .  di
437 .  nr an-div? 0
438 .  ll
439 .  \" We must emit the diversion in a separate environment to
440 .  \" assure that a possible margin character is printed correctly.
441 .  ev an-2
442 .  evc 0
443 .  mc
444 .  nf
445 .  in \\n[an-margin]u
446 .  ie (\\n[dl] + \\n[an-tag-sep] > \\n[an-prevailing-indent]) \{\
447 .    ne (2v + 1u)
448 .    an-div
449 .    ev
450 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
451 .  \}
452 .  el \{\
453 .    \" In nroff mode, the indentation value should be an integer multiple
454 .    \" of the character cell, to avoid different results compared to the
455 .    \" the .ie part above.
456 .    ne (1v + 1u)
457 .    DEVTAG-COL 1
458 .    an-div
459 .    sp -1
460 .    ev
461 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
462 .    DEVTAG-COL-NEXT 2
463 .  \}
464 ..
465 .
466 .de1 LP
467 .  sp \\n[PD]u
468 .  ps \\n[PS]u
469 .  vs \\n[VS]u
470 .  ft R
471 .  in \\n[an-margin]u
472 .  nr an-prevailing-indent \\n[IN]
473 .  ns
474 ..
475 .
476 .als PP LP
477 .als P LP
478 .
479 .de1 IP
480 .  ie !\\n[.$] \{\
481 .    ps \\n[PS]u
482 .    vs \\n[VS]u
483 .    ft R
484 .    sp \\n[PD]u
485 .    ne (1v + 1u)
486 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
487 .    ns
488 .  \}
489 .  el \{\
490 .    ie (\\n[.$] - 1) .TP "\\$2"
491 .    el               .TP
492 \&\\$1
493 .  \}
494 ..
495 .
496 .de1 HP
497 .  ps \\n[PS]u
498 .  vs \\n[VS]u
499 .  ft R
500 .  sp \\n[PD]u
501 .  ne (1v + 1u)
502 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
503 .  in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
504 .  ti \\n[an-margin]u
505 .  DEVTAG-COL 1
506 .  nr need_col2 1
507 .  ns
508 ..
509 .
510 .ds an-empty \" this is referenced to avoid looping on eg .RB ( \\ )
511 .
512 .de1 RI
513 .  if \\n[.$] \{\
514 .    ds an-result \&\f[R]\\$1\"
515 .    shift
516 .    while (\\n[.$] >= 2) \{\
517 .      as an-result \,\f[I]\\$1\f[R]\/\\$2\\*[an-empty]\"
518 .      shift 2
519 .    \}
520 .    if \\n[.$] .as an-result \,\f[I]\\$1\"
521 \\*[an-result]
522 .    ft R
523 .  \}
524 ..
525 .
526 .de1 IR
527 .  if \\n[.$] \{\
528 .    ds an-result \&\f[I]\\$1\f[R]\"
529 .    shift
530 .    while (\\n[.$] >= 2) \{\
531 .      as an-result \/\\$1\f[I]\,\\$2\f[R]\"
532 .      shift 2
533 .    \}
534 .    if \\n[.$] .as an-result \/\\$1\"
535 \\*[an-result]
536 .    ft R
537 .  \}
538 ..
539 .
540 .de1 IB
541 .  if \\n[.$] \{\
542 .    ds an-result \&\f[I]\\$1\"
543 .    shift
544 .    while (\\n[.$] >= 2) \{\
545 .      as an-result \/\f[B]\\$1\f[I]\,\\$2\\*[an-empty]\"
546 .      shift 2
547 .    \}
548 .    if \\n[.$] .as an-result \/\f[B]\\$1\"
549 \\*[an-result]
550 .    ft R
551 .  \}
552 ..
553 .
554 .de1 BI
555 .  if \\n[.$] \{\
556 .    ds an-result \&\f[B]\\$1\"
557 .    shift
558 .    while (\\n[.$] >= 2) \{\
559 .      as an-result \,\f[I]\\$1\f[B]\/\\$2\\*[an-empty]\"
560 .      shift 2
561 .    \}
562 .    if \\n[.$] .as an-result \,\f[I]\\$1\"
563 \\*[an-result]
564 .    ft R
565 .  \}
566 ..
567 .
568 .de1 RB
569 .  ds an-result \&\"
570 .  while (\\n[.$] >= 2) \{\
571 .    as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]\"
572 .    shift 2
573 .  \}
574 .  if \\n[.$] .as an-result \f[R]\\$1\"
575 \\*[an-result]
576 .  ft R
577 ..
578 .
579 .de1 BR
580 .  ds an-result \&\"
581 .  while (\\n[.$] >= 2) \{\
582 .    as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]\"
583 .    shift 2
584 .  \}
585 .  if \\n[.$] .as an-result \f[B]\\$1\"
586 \\*[an-result]
587 .  ft R
588 ..
589 .
590 .de1 RS
591 .  nr an-saved-margin\\n[an-level] \\n[an-margin]
592 .  nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
593 .  ie \\n[.$] .nr an-margin +(n;\\$1)
594 .  el         .nr an-margin +\\n[an-prevailing-indent]
595 .  in \\n[an-margin]u
596 .  nr an-prevailing-indent \\n[IN]
597 .  nr an-level +1
598 ..
599 .
600 .de1 RE
601 .  ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
602 .  el         .nr an-level -1
603 .  nr an-level (1 >? \\n[an-level])
604 .  nr an-margin \\n[an-saved-margin\\n[an-level]]
605 .  nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
606 .  in \\n[an-margin]u
607 ..
608 .
609 .\" table support
610 .
611 .de1 TS
612 .  sp \\n[PD]u
613 .  if \\n[an-html] \{\
614 .    nr an-TS-ll \\n[.l]
615 .    ll 1000n
616 .  \}
617 .  HTML-IMAGE
618 ..
619 .
620 .de1 T&
621 ..
622 .
623 .de1 TE
624 .  HTML-IMAGE-END
625 .  if \\n[an-html] \
626 .    ll \\n[an-TS-ll]u
627 ..
628 .
629 .\" dummy equation delimiters
630 .de1 EQ
631 .  if \\n[an-html] \{\
632 .    nr an-EQ-ll \\n[.l]
633 .    ll 1000n
634 .  \}
635 .  HTML-IMAGE
636 ..
637 .de1 EN
638 .  HTML-IMAGE-END
639 .  if \\n[an-html] \
640 .    ll \\n[an-EQ-ll]u
641 ..
642 .
643 .de1 R
644 \c
645 .  ie \\n[.$] \{\
646 .    tm `R' is a string (producing the registered sign), not a macro.
647 .    nop \\$*
648 .  \}
649 .  el \{\
650 .    ie c\[rg] \
651 .      nop \[rg]\c
652 .    el \
653 .      nop (Reg.)\c
654 .  \}
655 ..
656 .
657 .\" these strings must work in compatibility mode also
658 .
659 .ds S \s'\\n(PSu'\"
660 .ie c\[tm] .ds Tm \(tm\"
661 .el        .ds Tm (TM)\"
662 .ds lq \(lq\"
663 .ds rq \(rq\"
664 .
665 .if !\n[an-html] \{\
666 .  if !rHY \{\
667 .    ie \n[cR] \
668 .      nr HY 12
669 .    el \
670 .      nr HY 14
671 .  \}
672 .  hy \n[HY]
673 .\}
674 .
675 .\" For UTF-8, map some characters conservatively for the sake
676 .\" of easy cut and paste.
677 .
678 .if '\*[.T]'utf8' \{\
679 .  rchar \- - ' `
680 .
681 .  char \- \N'45'
682 .  char  - \N'45'
683 .  char  ' \N'39'
684 .  char  ` \N'96'
685 .\}
686 .
687 .\" Load man macro extensions.
688 .mso an-ext.tmac
689 .
690 .\" Load local modifications.
691 .mso man.local
692 .
693 .cp \n[_C]
694 .
695 .\" end of an-old.tmac