Merge branch 'topic/sync-to-go-2'
[s-roff.git] / tmac / an-old.tmac
blobf7a13864bb339f4f998c474bcdb80665ed7015be
1 .\"@ an-old.tmac
2 .\"
3 .\" Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 .\"
5 .\" Copyright (C) 1989 - 1992, 2001 - 2005, 2007 - 2009
6 .\"   Free Software Foundation, Inc.
7 .\"      Written by James Clark (jjc@jclark.com)
8 .\"
9 .\" This is free software; you can redistribute it and/or modify it under
10 .\" the terms of the GNU General Public License as published by the Free
11 .\" Software Foundation; either version 2, or (at your option) any later
12 .\" version.
13 .\"
14 .\" This is distributed in the hope that it will be useful, but WITHOUT ANY
15 .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 .\" for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public License along
20 .\" with groff; see the file COPYING.  If not, write to the Free Software
21 .\" Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
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 .\"
37 .if !\n(.g .ab These man macros work only with groff / compatible.
39 .do if d RI .nx
41 .do mso devtag.tmac
43 .nr _C \n(.C
44 .cp 0
46 .if (\n[.x]\n[.y] < 118) \
47 .  ab You need a newer troff (v1.18 or higher) for this version of man!
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 .\}
63 .nr need_eo_h 0
64 .nr need_col2 0
66 .\" set up the line length...
67 .\" giving precedence to any prior assignment to the \n[LL] register.
68 .if !r LL \{\
70 .  \" but if that isn't predefined...
71 .  \" then try to respect any prior `.ll' request.
72 .  nr LL \n[.l]
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 .\}
87 .if !r LT \
88 .  nr LT \n[LL]
90 .nr FT (-.5i)
92 .\" Default heading font
93 .ds HF B\"
95 .nr an-first 1
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
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)
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 .  .
117 .  rn bp an-bp
118 .  de1 bp
119 .    br
120 .    pl \\n[nl]u
121 .    an-bp \\$*
122 .  .
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]
133 .ds an-extra1
134 .ds an-extra2
135 .ds an-extra3
136 .\" Print volume headers like mdoc(7) does
137 .ds an-doc-volume-ds-1 General Commands Manual
138 .ds an-doc-volume-ds-2 System Calls Manual
139 .ds an-doc-volume-ds-3 Library Functions Manual
140 .ds an-doc-volume-ds-4 Kernel Interfaces Manual
141 .ds an-doc-volume-ds-5 File Formats Manual
142 .ds an-doc-volume-ds-6 Games Manual
143 .ds an-doc-volume-ds-7 Miscellaneous Information Manual
144 .ds an-doc-volume-ds-8 System Manager's Manual
145 .ds an-doc-volume-ds-9 Kernel Developer's Manual
147 .\" .TH title section extra1 extra2 extra3
148 .de1 TH
149 .  if \\n[an-html] \{\
150 .    DEVTAG-TL
151 .    nop \\$1
152 .    DEVTAG-EO-TL
153 .  \}
155 .  de an-init \" We have to do it like this to get multiple man pages right.
156 .    ds an-title "\\$1\"
157 .    ds an-section "\\$2\"
158 .    ds an-extra1 "\\$3\"
159 .    ie (\\n[.$] > 3) .ds an-extra2 "\\$4\"
160 .    el               .ds an-extra2 \"Sun Release 4.0
162 .   ie (\\n[.$] > 4)  .ds  an-extra3 "\\$5\"
163 .   el \{
164 .     rm an-extra3
165 .     if '\\$2'1'     .als an-extra3 an-doc-volume-ds-1
166 .     if '\\$2'2'     .als an-extra3 an-doc-volume-ds-2
167 .     if '\\$2'3'     .als an-extra3 an-doc-volume-ds-3
168 .     if '\\$2'3p'    .ds  an-extra3 Perl Programmers Reference Guide
169 .     if '\\$2'4'     .als an-extra3 an-doc-volume-ds-4
170 .     if '\\$2'5'     .als an-extra3 an-doc-volume-ds-5
171 .     if '\\$2'6'     .als an-extra3 an-doc-volume-ds-6
172 .     if '\\$2'7'     .als an-extra3 an-doc-volume-ds-7
173 .     if '\\$2'8'     .als an-extra3 an-doc-volume-ds-8
174 .     if '\\$2'9'     .als an-extra3 an-doc-volume-ds-9
175 .     if !d an-extra3 .ds  an-extra3
176 .   \}
177 .   ds an-init
178 \\..
180 .  DT
182 .  nr PS    10z \" default point size
183 .  nr PS-SS 10z
184 .  nr PS-SH 10.95z
185 .  nr VS    12p
187 .  \" use sizes similar to LaTeX
188 .  if t \{\
189 .    ie (\\n[S] == 11) \{\
190 .      nr PS    10.95z
191 .      nr PS-SS 10.95z
192 .      nr PS-SH 12z
193 .      nr VS    13.6p
194 .    \}
195 .    el \{\
196 .      if (\\n[S] == 12) \{\
197 .        nr PS    12z
198 .        nr PS-SS 12z
199 .        nr PS-SH 14.4z
200 .        nr VS    14.5p
201 .      \}
202 .    \}
203 .  \}
205 .  ps \\n[PS]u
206 .  vs \\n[VS]u
207 .  ll \\n[LL]u
209 .\" We must select an integer indentation value for nroff;
210 .\" see comment in an-do-tag.
211 .  if !r IN \{\
212 .    ie t .nr IN 7.2n
213 .    el   .nr IN 7n
214 .  \}
215 .  PD
216 .  if !r SN \
217 .    nr SN 3n \" the indentation of sub-sub-headings relative to sub-headings
218 .  set-an-margin
219 .  nr an-tag-sep 1n
221 .  nr an-no-space-flag 0
222 .  nr an-break-flag 0
223 .  nr an-div? 0
225 .  ie \\n[cR] \
226 .    an-header
227 .  el \{\
228 .    wh 0 an-header
229 .    wh -1i an-footer
230 .    wh \\n[FT]u an-p-footer
232 .    if \\n[nl] \{\
233 .      ie \\n[C] .bp (\\n[%] + 1)
234 .      el        .bp 1
235 .    \}
236 .  \}
239 .\" BSD compatibility macros: .AT and .UC
241 .de1 AT
242 .  ds an-extra2 "7th Edition\"
243 .  if "\\$1"3" .ds an-extra2 "7th Edition\"
244 .  if "\\$1"4" .ds an-extra2 "System III\"
245 .  if "\\$1"5" \{\
246 .    ie "\\$2"" .ds an-extra2 "System V\"
247 .    el .ds an-extra2 "System V Release \\$2\"
248 .  \}
251 .de1 UC
252 .  ds an-extra2 "3rd Berkeley Distribution\"
253 .  if "\\$1"3" .ds an-extra2 "3rd Berkeley Distribution\"
254 .  if "\\$1"4" .ds an-extra2 "4th Berkeley Distribution\"
255 .  if "\\$1"5" .ds an-extra2 "4.2 Berkeley Distribution\"
256 .  if "\\$1"6" .ds an-extra2 "4.3 Berkeley Distribution\"
257 .  if "\\$1"7" .ds an-extra2 "4.4 Berkeley Distribution\"
260 .de1 DT
261 .  ta T .5i \" This sets tabs every .5 inches
264 .de1 PD
265 .  ie \\n[.$] .nr PD (v;\\$1)
266 .  el         .nr PD (.4v >? \n[.V])
269 .\" Redefine these to customize the header & footer
271 .de1 PT
272 .  tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
275 .de1 BT
276 .  if r ps4html \
277 .    return
278 .  ie \\n[D] \{\
279 .    if o .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
280 .    if e .tl '\\*[an-page-string]'\\*[an-extra1]'\\*[an-extra2]'
281 .  \}
282 .  el \
283 .    tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
286 .de1 an-header
287 .  an-init
288 .  if \\n[cR] \{\
289 .    ie \\n[an-first] \
290 .      nr an-first 0
291 .    el \
292 .      sp .5i
293 .  \}
294 .  ev an-1
295 .  ps \\n[PS]u
296 .  vs \\n[VS]u
297 .  lt \\n[LT]u
298 .  ie \\n[an-html] \
299 .    tl ''''
300 .  el \{\
301 .    if !\\n[cR] \
302 .      sp .5i
303 .    PT
304 .    ie !\\n[cR] \
305 .      sp |1i
306 .    el \
307 .      sp .5i
308 .  \}
309 .  ev
310 .  ns
313 .de1 an-footer
314 '  bp
317 .af an-page-letter a
319 .de1 an-p-footer
320 .  ev an-1
321 .  ps \\n[PS]u
322 .  vs \\n[VS]u
323 .  lt \\n[LT]u
324 .  ie \\n[an-html] \{\
325 .    ds an-page-string
326 .    ds an-extra1
327 .    ds an-extra2
328 .  \}
329 .  el \{\
330 .    ie r X \{\
331 .      if (\\n[%] > \\n[X]) \{\
332 .        nr an-page-letter (\\n[%] - \\n[X])
333 .        ds an-page-string \\n[X]\\n[an-page-letter]\"
334 .      \}
335 .    \}
336 .    el \{\
337 .      ie \\n[cR] \
338 .        ds an-page-string "\\*[an-title](\\*[an-section])\"
339 .      el \
340 .        ds an-page-string \\n[%]\"
341 .    \}
342 .  \}
343 .  BT
344 .  ev
347 .de1 an-end
348 .  nr % 1
349 .  pl +4v
350 .  fl
351 .  sp 3
352 .  an-p-footer
353 .  pl \\n[nl]u
356 .if \n[cR] .em an-end
358 .de1 SH
359 .  sp \\n[PD]u
360 .  set-an-margin
361 .  fi
362 .  in \\n[an-margin]u
363 .  ti 0
364 .  nr need_eo_h 1
365 .  DEVTAG-NH \\n[an-level]
366 .  it 1 an-trap
367 .  nr an-no-space-flag 1
368 .  nr an-break-flag 1
369 .  ps \\n[PS-SH]u
370 .  ft \\*[HF]
371 .  ne (2v + 1u)
372 .  if \\n[.$] \&\\$*
375 .de1 SS
376 .  sp \\n[PD]u
377 .  set-an-margin
378 .  fi
379 .  in \\n[IN]u
380 .  ti \\n[SN]u
381 .  it 1 an-trap
382 .  nr an-no-space-flag 1
383 .  nr an-break-flag 1
384 .  ps \\n[PS-SS]u
385 .  ft \\*[HF]
386 .  ne (2v + 1u)
387 .  if \\n[.$] \&\\$*
390 .de1 B
391 .  it 1 an-trap
392 .  ft B
393 .  if \\n[.$] \&\\$*
396 .de1 I
397 .  it 1 an-trap
398 .  ft I
399 .  if \\n[.$] \,\\$*\/
402 .de1 SM
403 .  it 1 an-trap
404 .  ps -1
405 .  if \\n[.$] \&\\$*
408 .de1 SB
409 .  it 1 an-trap
410 .  ps -1
411 .  ft B
412 .  if \\n[.$] \&\\$*
415 .de1 TP
416 .  sp \\n[PD]u
417 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
418 .  it 1 an-trap
419 .  in 0
420 .  ll -\\n[an-margin]u
421 .  if !\\n[an-div?] .di an-div
422 .  nr an-div? 1
425 .de1 an-trap
426 .  if \\n[need_eo_h]>0 .DEVTAG-EO-H
427 .  nr need_eo_h 0
428 .  if \\n[need_col2]>0 .DEVTAG-COL 2
429 .  nr need_col2 0
430 .  ft R
431 .  ps \\n[PS]u
432 .  vs \\n[VS]u
433 .  if \\n[an-break-flag] \{\
434 .    br
435 .    nr an-break-flag 0
436 .  \}
437 .  if \\n[an-no-space-flag] \{\
438 .    ns
439 .    nr an-no-space-flag 0
440 .  \}
441 .  if \\n[an-div?] .an-do-tag
444 .de an-do-tag
445 .  br
446 .  di
447 .  nr an-div? 0
448 .  ll
449 .  \" We must emit the diversion in a separate environment to
450 .  \" assure that a possible margin character is printed correctly.
451 .  ev an-2
452 .  evc 0
453 .  mc
454 .  nf
455 .  in \\n[an-margin]u
456 .  ie (\\n[dl] + \\n[an-tag-sep] > \\n[an-prevailing-indent]) \{\
457 .    ne (2v + 1u)
458 .    an-div
459 .    ev
460 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
461 .  \}
462 .  el \{\
463 .    \" In nroff mode, the indentation value should be an integer multiple
464 .    \" of the character cell, to avoid different results compared to the
465 .    \" the .ie part above.
466 .    ne (1v + 1u)
467 .    DEVTAG-COL 1
468 .    an-div
469 .    sp -1
470 .    ev
471 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
472 .    DEVTAG-COL-NEXT 2
473 .  \}
476 .de1 LP
477 .  sp \\n[PD]u
478 .  ps \\n[PS]u
479 .  vs \\n[VS]u
480 .  ft R
481 .  in \\n[an-margin]u
482 .  nr an-prevailing-indent \\n[IN]
483 .  ns
486 .als PP LP
487 .als P LP
489 .de1 IP
490 .  ie !\\n[.$] \{\
491 .    ps \\n[PS]u
492 .    vs \\n[VS]u
493 .    ft R
494 .    sp \\n[PD]u
495 .    ne (1v + 1u)
496 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
497 .    ns
498 .  \}
499 .  el \{\
500 .    ie (\\n[.$] - 1) .TP "\\$2"
501 .    el               .TP
502 \&\\$1
503 .  \}
506 .de1 HP
507 .  ps \\n[PS]u
508 .  vs \\n[VS]u
509 .  ft R
510 .  sp \\n[PD]u
511 .  ne (1v + 1u)
512 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
513 .  in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
514 .  ti \\n[an-margin]u
515 .  DEVTAG-COL 1
516 .  nr need_col2 1
517 .  ns
520 .ds an-empty \" this is referenced to avoid looping on eg .RB ( \\ )
522 .de1 RI
523 .  if \\n[.$] \{\
524 .    ds an-result \&\f[R]\\$1\"
525 .    shift
526 .    while (\\n[.$] >= 2) \{\
527 .      as an-result \,\f[I]\\$1\f[R]\/\\$2\\*[an-empty]\"
528 .      shift 2
529 .    \}
530 .    if \\n[.$] .as an-result \,\f[I]\\$1\"
531 \\*[an-result]
532 .    ft R
533 .  \}
536 .de1 IR
537 .  if \\n[.$] \{\
538 .    ds an-result \&\f[I]\\$1\f[R]\"
539 .    shift
540 .    while (\\n[.$] >= 2) \{\
541 .      as an-result \/\\$1\f[I]\,\\$2\f[R]\"
542 .      shift 2
543 .    \}
544 .    if \\n[.$] .as an-result \/\\$1\"
545 \\*[an-result]
546 .    ft R
547 .  \}
550 .de1 IB
551 .  if \\n[.$] \{\
552 .    ds an-result \&\f[I]\\$1\"
553 .    shift
554 .    while (\\n[.$] >= 2) \{\
555 .      as an-result \/\f[B]\\$1\f[I]\,\\$2\\*[an-empty]\"
556 .      shift 2
557 .    \}
558 .    if \\n[.$] .as an-result \/\f[B]\\$1\"
559 \\*[an-result]
560 .    ft R
561 .  \}
564 .de1 BI
565 .  if \\n[.$] \{\
566 .    ds an-result \&\f[B]\\$1\"
567 .    shift
568 .    while (\\n[.$] >= 2) \{\
569 .      as an-result \,\f[I]\\$1\f[B]\/\\$2\\*[an-empty]\"
570 .      shift 2
571 .    \}
572 .    if \\n[.$] .as an-result \,\f[I]\\$1\"
573 \\*[an-result]
574 .    ft R
575 .  \}
578 .de1 RB
579 .  ds an-result \&\"
580 .  while (\\n[.$] >= 2) \{\
581 .    as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]\"
582 .    shift 2
583 .  \}
584 .  if \\n[.$] .as an-result \f[R]\\$1\"
585 \\*[an-result]
586 .  ft R
589 .de1 BR
590 .  ds an-result \&\"
591 .  while (\\n[.$] >= 2) \{\
592 .    as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]\"
593 .    shift 2
594 .  \}
595 .  if \\n[.$] .as an-result \f[B]\\$1\"
596 \\*[an-result]
597 .  ft R
600 .de1 RS
601 .  nr an-saved-margin\\n[an-level] \\n[an-margin]
602 .  nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
603 .  ie \\n[.$] .nr an-margin +(n;\\$1)
604 .  el         .nr an-margin +\\n[an-prevailing-indent]
605 .  in \\n[an-margin]u
606 .  nr an-prevailing-indent \\n[IN]
607 .  nr an-level +1
610 .de1 RE
611 .  ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
612 .  el         .nr an-level -1
613 .  nr an-level (1 >? \\n[an-level])
614 .  nr an-margin \\n[an-saved-margin\\n[an-level]]
615 .  nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
616 .  in \\n[an-margin]u
619 .\" table support
621 .de1 TS
622 .  sp \\n[PD]u
623 .  HTML-IMAGE
626 .de1 T&
629 .de1 TE
630 .  HTML-IMAGE-END
633 .\" dummy equation delimiters
634 .de1 EQ
635 .  HTML-IMAGE
637 .de1 EN
638 .  HTML-IMAGE-END
641 .de1 R
643 .  ie \\n[.$] \{\
644 .    tm `R' is a string (producing the registered sign), not a macro.
645 .    nop \\$*
646 .  \}
647 .  el \{\
648 .    ie c\[rg] \
649 .      nop \[rg]\c
650 .    el \
651 .      nop (Reg.)\c
652 .  \}
655 .\" these strings must work in compatibility mode also
657 .ds S \s'\\n(PSu'\"
658 .ie c\[tm] .ds Tm \(tm\"
659 .el        .ds Tm (TM)\"
660 .ds lq \(lq\"
661 .ds rq \(rq\"
663 .if !\n[an-html] \{\
664 .  if !rHY \{\
665 .    ie \n[cR] \
666 .      nr HY 12
667 .    el \
668 .      nr HY 14
669 .  \}
670 .  hy \n[HY]
673 .\" For UTF-8, map some characters conservatively for the sake
674 .\" of easy cut and paste.
676 .if '\*[.T]'utf8' \{\
677 .  rchar \- - ' `
679 .  char \- \N'45'
680 .  char  - \N'45'
681 .  char  ' \N'39'
682 .  char  ` \N'96'
685 .\" Load man macro extensions.
686 .mso an-ext.tmac
688 .\" Load local modifications.
689 .mso man.local
691 .cp \n[_C]
693 .\" s-ts-mode