Sync: tmac/an-old.tmac: apply groff [3c9796e] (Ingo Schwarze)..
[s-roff.git] / tmac / an-old.tmac
blob7f656fd00ca28bc31e9bb8a19e72d84de1950798
1 .\"@ an-old.tmac
2 .\"
3 .\" Copyright (c) 2014 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
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
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 .  \}
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 .    ie (\\n[.$] > 4) .ds an-extra3 "\\$5\"
152 .    el               .ds an-extra3 \"System Programmer's Manual
153 .    ds an-init
154 \\..
156 .  DT
158 .  nr PS    10z \" default point size
159 .  nr PS-SS 10z
160 .  nr PS-SH 10.95z
161 .  nr VS    12p
163 .  \" use sizes similar to LaTeX
164 .  if t \{\
165 .    ie (\\n[S] == 11) \{\
166 .      nr PS    10.95z
167 .      nr PS-SS 10.95z
168 .      nr PS-SH 12z
169 .      nr VS    13.6p
170 .    \}
171 .    el \{\
172 .      if (\\n[S] == 12) \{\
173 .        nr PS    12z
174 .        nr PS-SS 12z
175 .        nr PS-SH 14.4z
176 .        nr VS    14.5p
177 .      \}
178 .    \}
179 .  \}
181 .  ps \\n[PS]u
182 .  vs \\n[VS]u
183 .  ll \\n[LL]u
185 .\" We must select an integer indentation value for nroff;
186 .\" see comment in an-do-tag.
187 .  if !r IN \{\
188 .    ie t .nr IN 7.2n
189 .    el   .nr IN 7n
190 .  \}
191 .  PD
192 .  if !r SN \
193 .    nr SN 3n \" the indentation of sub-sub-headings relative to sub-headings
194 .  set-an-margin
195 .  nr an-tag-sep 1n
197 .  nr an-no-space-flag 0
198 .  nr an-break-flag 0
199 .  nr an-div? 0
201 .  ie \\n[cR] \
202 .    an-header
203 .  el \{\
204 .    wh 0 an-header
205 .    wh -1i an-footer
206 .    wh \\n[FT]u an-p-footer
208 .    if \\n[nl] \{\
209 .      ie \\n[C] .bp (\\n[%] + 1)
210 .      el        .bp 1
211 .    \}
212 .  \}
215 .\" BSD compatibility macros: .AT and .UC
217 .de1 AT
218 .  ds an-extra2 "7th Edition\"
219 .  if "\\$1"3" .ds an-extra2 "7th Edition\"
220 .  if "\\$1"4" .ds an-extra2 "System III\"
221 .  if "\\$1"5" \{\
222 .    ie "\\$2"" .ds an-extra2 "System V\"
223 .    el .ds an-extra2 "System V Release \\$2\"
224 .  \}
227 .de1 UC
228 .  ds an-extra2 "3rd Berkeley Distribution\"
229 .  if "\\$1"3" .ds an-extra2 "3rd Berkeley Distribution\"
230 .  if "\\$1"4" .ds an-extra2 "4th Berkeley Distribution\"
231 .  if "\\$1"5" .ds an-extra2 "4.2 Berkeley Distribution\"
232 .  if "\\$1"6" .ds an-extra2 "4.3 Berkeley Distribution\"
233 .  if "\\$1"7" .ds an-extra2 "4.4 Berkeley Distribution\"
236 .de1 DT
237 .  ta T .5i \" This sets tabs every .5 inches
240 .de1 PD
241 .  ie \\n[.$] .nr PD (v;\\$1)
242 .  el         .nr PD (.4v >? \n[.V])
245 .\" Redefine these to customize the header & footer
247 .de1 PT
248 .  tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
251 .de1 BT
252 .  if r ps4html \
253 .    return
254 .  ie \\n[D] \{\
255 .    if o .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
256 .    if e .tl '\\*[an-page-string]'\\*[an-extra1]'\\*[an-extra2]'
257 .  \}
258 .  el \
259 .    tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
262 .de1 an-header
263 .  an-init
264 .  if \\n[cR] \{\
265 .    ie \\n[an-first] \
266 .      nr an-first 0
267 .    el \
268 .      sp .5i
269 .  \}
270 .  ev an-1
271 .  ps \\n[PS]u
272 .  vs \\n[VS]u
273 .  lt \\n[LT]u
274 .  ie \\n[an-html] \
275 .    tl ''''
276 .  el \{\
277 .    if !\\n[cR] \
278 .      sp .5i
279 .    PT
280 .    ie !\\n[cR] \
281 .      sp |1i
282 .    el \
283 .      sp .5i
284 .  \}
285 .  ev
286 .  ns
289 .de1 an-footer
290 '  bp
293 .af an-page-letter a
295 .de1 an-p-footer
296 .  ev an-1
297 .  ps \\n[PS]u
298 .  vs \\n[VS]u
299 .  lt \\n[LT]u
300 .  ie \\n[an-html] \{\
301 .    ds an-page-string
302 .    ds an-extra1
303 .    ds an-extra2
304 .  \}
305 .  el \{\
306 .    ie r X \{\
307 .      if (\\n[%] > \\n[X]) \{\
308 .        nr an-page-letter (\\n[%] - \\n[X])
309 .        ds an-page-string \\n[X]\\n[an-page-letter]\"
310 .      \}
311 .    \}
312 .    el \{\
313 .      ie \\n[cR] \
314 .        ds an-page-string "\\*[an-title](\\*[an-section])\"
315 .      el \
316 .        ds an-page-string \\n[%]\"
317 .    \}
318 .  \}
319 .  BT
320 .  ev
323 .de1 an-end
324 .  nr % 1
325 .  pl +4v
326 .  fl
327 .  sp 3
328 .  an-p-footer
329 .  pl \\n[nl]u
332 .if \n[cR] .em an-end
334 .de1 SH
335 .  sp \\n[PD]u
336 .  set-an-margin
337 .  fi
338 .  in \\n[an-margin]u
339 .  ti 0
340 .  nr need_eo_h 1
341 .  DEVTAG-NH \\n[an-level]
342 .  it 1 an-trap
343 .  nr an-no-space-flag 1
344 .  nr an-break-flag 1
345 .  ps \\n[PS-SH]u
346 .  ft \\*[HF]
347 .  ne (2v + 1u)
348 .  if \\n[.$] \&\\$*
351 .de1 SS
352 .  sp \\n[PD]u
353 .  set-an-margin
354 .  fi
355 .  in \\n[IN]u
356 .  ti \\n[SN]u
357 .  it 1 an-trap
358 .  nr an-no-space-flag 1
359 .  nr an-break-flag 1
360 .  ps \\n[PS-SS]u
361 .  ft \\*[HF]
362 .  ne (2v + 1u)
363 .  if \\n[.$] \&\\$*
366 .de1 B
367 .  it 1 an-trap
368 .  ft B
369 .  if \\n[.$] \&\\$*
372 .de1 I
373 .  it 1 an-trap
374 .  ft I
375 .  if \\n[.$] \,\\$*\/
378 .de1 SM
379 .  it 1 an-trap
380 .  ps -1
381 .  if \\n[.$] \&\\$*
384 .de1 SB
385 .  it 1 an-trap
386 .  ps -1
387 .  ft B
388 .  if \\n[.$] \&\\$*
391 .de1 TP
392 .  sp \\n[PD]u
393 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
394 .  it 1 an-trap
395 .  in 0
396 .  ll -\\n[an-margin]u
397 .  if !\\n[an-div?] .di an-div
398 .  nr an-div? 1
401 .de1 an-trap
402 .  if \\n[need_eo_h]>0 .DEVTAG-EO-H
403 .  nr need_eo_h 0
404 .  if \\n[need_col2]>0 .DEVTAG-COL 2
405 .  nr need_col2 0
406 .  ft R
407 .  ps \\n[PS]u
408 .  vs \\n[VS]u
409 .  if \\n[an-break-flag] \{\
410 .    br
411 .    nr an-break-flag 0
412 .  \}
413 .  if \\n[an-no-space-flag] \{\
414 .    ns
415 .    nr an-no-space-flag 0
416 .  \}
417 .  if \\n[an-div?] .an-do-tag
420 .de an-do-tag
421 .  br
422 .  di
423 .  nr an-div? 0
424 .  ll
425 .  \" We must emit the diversion in a separate environment to
426 .  \" assure that a possible margin character is printed correctly.
427 .  ev an-2
428 .  evc 0
429 .  mc
430 .  nf
431 .  in \\n[an-margin]u
432 .  ie (\\n[dl] + \\n[an-tag-sep] > \\n[an-prevailing-indent]) \{\
433 .    ne (2v + 1u)
434 .    an-div
435 .    ev
436 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
437 .  \}
438 .  el \{\
439 .    \" In nroff mode, the indentation value should be an integer multiple
440 .    \" of the character cell, to avoid different results compared to the
441 .    \" the .ie part above.
442 .    ne (1v + 1u)
443 .    DEVTAG-COL 1
444 .    an-div
445 .    sp -1
446 .    ev
447 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
448 .    DEVTAG-COL-NEXT 2
449 .  \}
452 .de1 LP
453 .  sp \\n[PD]u
454 .  ps \\n[PS]u
455 .  vs \\n[VS]u
456 .  ft R
457 .  in \\n[an-margin]u
458 .  nr an-prevailing-indent \\n[IN]
459 .  ns
462 .als PP LP
463 .als P LP
465 .de1 IP
466 .  ie !\\n[.$] \{\
467 .    ps \\n[PS]u
468 .    vs \\n[VS]u
469 .    ft R
470 .    sp \\n[PD]u
471 .    ne (1v + 1u)
472 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
473 .    ns
474 .  \}
475 .  el \{\
476 .    ie (\\n[.$] - 1) .TP "\\$2"
477 .    el               .TP
478 \&\\$1
479 .  \}
482 .de1 HP
483 .  ps \\n[PS]u
484 .  vs \\n[VS]u
485 .  ft R
486 .  sp \\n[PD]u
487 .  ne (1v + 1u)
488 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
489 .  in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
490 .  ti \\n[an-margin]u
491 .  DEVTAG-COL 1
492 .  nr need_col2 1
493 .  ns
496 .ds an-empty \" this is referenced to avoid looping on eg .RB ( \\ )
498 .de1 RI
499 .  if \\n[.$] \{\
500 .    ds an-result \&\f[R]\\$1\"
501 .    shift
502 .    while (\\n[.$] >= 2) \{\
503 .      as an-result \,\f[I]\\$1\f[R]\/\\$2\\*[an-empty]\"
504 .      shift 2
505 .    \}
506 .    if \\n[.$] .as an-result \,\f[I]\\$1\"
507 \\*[an-result]
508 .    ft R
509 .  \}
512 .de1 IR
513 .  if \\n[.$] \{\
514 .    ds an-result \&\f[I]\\$1\f[R]\"
515 .    shift
516 .    while (\\n[.$] >= 2) \{\
517 .      as an-result \/\\$1\f[I]\,\\$2\f[R]\"
518 .      shift 2
519 .    \}
520 .    if \\n[.$] .as an-result \/\\$1\"
521 \\*[an-result]
522 .    ft R
523 .  \}
526 .de1 IB
527 .  if \\n[.$] \{\
528 .    ds an-result \&\f[I]\\$1\"
529 .    shift
530 .    while (\\n[.$] >= 2) \{\
531 .      as an-result \/\f[B]\\$1\f[I]\,\\$2\\*[an-empty]\"
532 .      shift 2
533 .    \}
534 .    if \\n[.$] .as an-result \/\f[B]\\$1\"
535 \\*[an-result]
536 .    ft R
537 .  \}
540 .de1 BI
541 .  if \\n[.$] \{\
542 .    ds an-result \&\f[B]\\$1\"
543 .    shift
544 .    while (\\n[.$] >= 2) \{\
545 .      as an-result \,\f[I]\\$1\f[B]\/\\$2\\*[an-empty]\"
546 .      shift 2
547 .    \}
548 .    if \\n[.$] .as an-result \,\f[I]\\$1\"
549 \\*[an-result]
550 .    ft R
551 .  \}
554 .de1 RB
555 .  ds an-result \&\"
556 .  while (\\n[.$] >= 2) \{\
557 .    as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]\"
558 .    shift 2
559 .  \}
560 .  if \\n[.$] .as an-result \f[R]\\$1\"
561 \\*[an-result]
562 .  ft R
565 .de1 BR
566 .  ds an-result \&\"
567 .  while (\\n[.$] >= 2) \{\
568 .    as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]\"
569 .    shift 2
570 .  \}
571 .  if \\n[.$] .as an-result \f[B]\\$1\"
572 \\*[an-result]
573 .  ft R
576 .de1 RS
577 .  nr an-saved-margin\\n[an-level] \\n[an-margin]
578 .  nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
579 .  ie \\n[.$] .nr an-margin +(n;\\$1)
580 .  el         .nr an-margin +\\n[an-prevailing-indent]
581 .  in \\n[an-margin]u
582 .  nr an-prevailing-indent \\n[IN]
583 .  nr an-level +1
586 .de1 RE
587 .  ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
588 .  el         .nr an-level -1
589 .  nr an-level (1 >? \\n[an-level])
590 .  nr an-margin \\n[an-saved-margin\\n[an-level]]
591 .  nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
592 .  in \\n[an-margin]u
595 .\" table support
597 .de1 TS
598 .  sp \\n[PD]u
599 .  HTML-IMAGE
602 .de1 T&
605 .de1 TE
606 .  HTML-IMAGE-END
609 .\" dummy equation delimiters
610 .de1 EQ
611 .  HTML-IMAGE
613 .de1 EN
614 .  HTML-IMAGE-END
617 .de1 R
619 .  ie \\n[.$] \{\
620 .    tm `R' is a string (producing the registered sign), not a macro.
621 .    nop \\$*
622 .  \}
623 .  el \{\
624 .    ie c\[rg] \
625 .      nop \[rg]\c
626 .    el \
627 .      nop (Reg.)\c
628 .  \}
631 .\" these strings must work in compatibility mode also
633 .ds S \s'\\n(PSu'\"
634 .ie c\[tm] .ds Tm \(tm\"
635 .el        .ds Tm (TM)\"
636 .ds lq \(lq\"
637 .ds rq \(rq\"
639 .if !\n[an-html] \{\
640 .  if !rHY \{\
641 .    ie \n[cR] \
642 .      nr HY 12
643 .    el \
644 .      nr HY 14
645 .  \}
646 .  hy \n[HY]
649 .\" For UTF-8, map some characters conservatively for the sake
650 .\" of easy cut and paste.
652 .if '\*[.T]'utf8' \{\
653 .  rchar \- - ' `
655 .  char \- \N'45'
656 .  char  - \N'45'
657 .  char  ' \N'39'
658 .  char  ` \N'96'
661 .\" Load man macro extensions.
662 .mso an-ext.tmac
664 .\" Load local modifications.
665 .mso man.local
667 .cp \n[_C]
669 .\" s-ts-mode