Sync: tmac/fallbacks.tmac: import, adjust troffrc
[s-roff.git] / tmac / an-old.tmac
blob5542e74e0412d21813ee23501416a374dacd11bc
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-margin \\n[IN]
129 .ds an-extra1
130 .ds an-extra2
131 .ds an-extra3
133 .\" .TH title section extra1 extra2 extra3
134 .de1 TH
135 .  if \\n[an-html] \{\
136 .    DEVTAG-TL
137 .    nop \\$1
138 .    DEVTAG-EO-TL
139 .  \}
141 .  de an-init \" We have to do it like this to get multiple man pages right.
142 .    ds an-title "\\$1\"
143 .    ds an-section "\\$2\"
144 .    ds an-extra1 "\\$3\"
145 .    ie (\\n[.$] > 3) .ds an-extra2 "\\$4\"
146 .    el               .ds an-extra2 \"Sun Release 4.0
147 .    ie (\\n[.$] > 4) .ds an-extra3 "\\$5\"
148 .    el               .ds an-extra3 \"System Programmer's Manual
149 .    ds an-init
150 \\..
152 .  DT
154 .  nr PS    10z \" default point size
155 .  nr PS-SS 10z
156 .  nr PS-SH 10.95z
157 .  nr VS    12p
159 .  \" use sizes similar to LaTeX
160 .  if t \{\
161 .    ie (\\n[S] == 11) \{\
162 .      nr PS    10.95z
163 .      nr PS-SS 10.95z
164 .      nr PS-SH 12z
165 .      nr VS    13.6p
166 .    \}
167 .    el \{\
168 .      if (\\n[S] == 12) \{\
169 .        nr PS    12z
170 .        nr PS-SS 12z
171 .        nr PS-SH 14.4z
172 .        nr VS    14.5p
173 .      \}
174 .    \}
175 .  \}
177 .  ps \\n[PS]u
178 .  vs \\n[VS]u
179 .  ll \\n[LL]u
181 .\" We must select an integer indentation value for nroff;
182 .\" see comment in an-do-tag.
183 .  if !r IN \{\
184 .    ie t .nr IN 7.2n
185 .    el   .nr IN 7n
186 .  \}
187 .  PD
188 .  if !r SN \
189 .    nr SN 3n \" the indentation of sub-sub-headings relative to sub-headings
190 .  nr an-level 1
191 .  set-an-margin
192 .  nr an-prevailing-indent \\n[IN]
193 .  nr an-tag-sep 1n
195 .  nr an-no-space-flag 0
196 .  nr an-break-flag 0
197 .  nr an-div? 0
199 .  ie \\n[cR] \
200 .    an-header
201 .  el \{\
202 .    wh 0 an-header
203 .    wh -1i an-footer
204 .    wh \\n[FT]u an-p-footer
206 .    if \\n[nl] \{\
207 .      ie \\n[C] .bp (\\n[%] + 1)
208 .      el        .bp 1
209 .    \}
210 .  \}
213 .\" BSD compatibility macros: .AT and .UC
215 .de1 AT
216 .  ds an-extra2 "7th Edition\"
217 .  if "\\$1"3" .ds an-extra2 "7th Edition\"
218 .  if "\\$1"4" .ds an-extra2 "System III\"
219 .  if "\\$1"5" \{\
220 .    ie "\\$2"" .ds an-extra2 "System V\"
221 .    el .ds an-extra2 "System V Release \\$2\"
222 .  \}
225 .de1 UC
226 .  ds an-extra2 "3rd Berkeley Distribution\"
227 .  if "\\$1"3" .ds an-extra2 "3rd Berkeley Distribution\"
228 .  if "\\$1"4" .ds an-extra2 "4th Berkeley Distribution\"
229 .  if "\\$1"5" .ds an-extra2 "4.2 Berkeley Distribution\"
230 .  if "\\$1"6" .ds an-extra2 "4.3 Berkeley Distribution\"
231 .  if "\\$1"7" .ds an-extra2 "4.4 Berkeley Distribution\"
234 .de1 DT
235 .  ta T .5i \" This sets tabs every .5 inches
238 .de1 PD
239 .  ie \\n[.$] .nr PD (v;\\$1)
240 .  el         .nr PD (.4v >? \n[.V])
243 .\" Redefine these to customize the header & footer
245 .de1 PT
246 .  tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
249 .de1 BT
250 .  if r ps4html \
251 .    return
252 .  ie \\n[D] \{\
253 .    if o .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
254 .    if e .tl '\\*[an-page-string]'\\*[an-extra1]'\\*[an-extra2]'
255 .  \}
256 .  el \
257 .    tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
260 .de1 an-header
261 .  an-init
262 .  if \\n[cR] \{\
263 .    ie \\n[an-first] \
264 .      nr an-first 0
265 .    el \
266 .      sp .5i
267 .  \}
268 .  ev an-1
269 .  ps \\n[PS]u
270 .  vs \\n[VS]u
271 .  lt \\n[LT]u
272 .  ie \\n[an-html] \
273 .    tl ''''
274 .  el \{\
275 .    if !\\n[cR] \
276 .      sp .5i
277 .    PT
278 .    ie !\\n[cR] \
279 .      sp |1i
280 .    el \
281 .      sp .5i
282 .  \}
283 .  ev
284 .  ns
287 .de1 an-footer
288 '  bp
291 .af an-page-letter a
293 .de1 an-p-footer
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 .    ds an-page-string
300 .    ds an-extra1
301 .    ds an-extra2
302 .  \}
303 .  el \{\
304 .    ie r X \{\
305 .      if (\\n[%] > \\n[X]) \{\
306 .        nr an-page-letter (\\n[%] - \\n[X])
307 .        ds an-page-string \\n[X]\\n[an-page-letter]\"
308 .      \}
309 .    \}
310 .    el \{\
311 .      ie \\n[cR] \
312 .        ds an-page-string "\\*[an-title](\\*[an-section])\"
313 .      el \
314 .        ds an-page-string \\n[%]\"
315 .    \}
316 .  \}
317 .  BT
318 .  ev
321 .de1 an-end
322 .  nr % 1
323 .  pl +4v
324 .  fl
325 .  sp 3
326 .  an-p-footer
327 .  pl \\n[nl]u
330 .if \n[cR] .em an-end
332 .de1 SH
333 .  sp \\n[PD]u
334 .  nr an-level 1
335 .  set-an-margin
336 .  nr an-prevailing-indent \\n[IN]
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 .  nr an-level 1
354 .  set-an-margin
355 .  nr an-prevailing-indent \\n[IN]
356 .  fi
357 .  in \\n[IN]u
358 .  ti \\n[SN]u
359 .  it 1 an-trap
360 .  nr an-no-space-flag 1
361 .  nr an-break-flag 1
362 .  ps \\n[PS-SS]u
363 .  ft \\*[HF]
364 .  ne (2v + 1u)
365 .  if \\n[.$] \&\\$*
368 .de1 B
369 .  it 1 an-trap
370 .  ft B
371 .  if \\n[.$] \&\\$*
374 .de1 I
375 .  it 1 an-trap
376 .  ft I
377 .  if \\n[.$] \,\\$*\/
380 .de1 SM
381 .  it 1 an-trap
382 .  ps -1
383 .  if \\n[.$] \&\\$*
386 .de1 SB
387 .  it 1 an-trap
388 .  ps -1
389 .  ft B
390 .  if \\n[.$] \&\\$*
393 .de1 TP
394 .  sp \\n[PD]u
395 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
396 .  it 1 an-trap
397 .  in 0
398 .  ll -\\n[an-margin]u
399 .  if !\\n[an-div?] .di an-div
400 .  nr an-div? 1
403 .de1 an-trap
404 .  if \\n[need_eo_h]>0 .DEVTAG-EO-H
405 .  nr need_eo_h 0
406 .  if \\n[need_col2]>0 .DEVTAG-COL 2
407 .  nr need_col2 0
408 .  ft R
409 .  ps \\n[PS]u
410 .  vs \\n[VS]u
411 .  if \\n[an-break-flag] \{\
412 .    br
413 .    nr an-break-flag 0
414 .  \}
415 .  if \\n[an-no-space-flag] \{\
416 .    ns
417 .    nr an-no-space-flag 0
418 .  \}
419 .  if \\n[an-div?] .an-do-tag
422 .de an-do-tag
423 .  br
424 .  di
425 .  nr an-div? 0
426 .  ll
427 .  \" We must emit the diversion in a separate environment to
428 .  \" assure that a possible margin character is printed correctly.
429 .  ev an-2
430 .  evc 0
431 .  mc
432 .  nf
433 .  in \\n[an-margin]u
434 .  ie (\\n[dl] + \\n[an-tag-sep] > \\n[an-prevailing-indent]) \{\
435 .    ne (2v + 1u)
436 .    an-div
437 .    ev
438 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
439 .  \}
440 .  el \{\
441 .    \" In nroff mode, the indentation value should be an integer multiple
442 .    \" of the character cell, to avoid different results compared to the
443 .    \" the .ie part above.
444 .    ne (1v + 1u)
445 .    DEVTAG-COL 1
446 .    an-div
447 .    sp -1
448 .    ev
449 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
450 .    DEVTAG-COL-NEXT 2
451 .  \}
454 .de1 LP
455 .  sp \\n[PD]u
456 .  ps \\n[PS]u
457 .  vs \\n[VS]u
458 .  ft R
459 .  in \\n[an-margin]u
460 .  nr an-prevailing-indent \\n[IN]
461 .  ns
464 .als PP LP
465 .als P LP
467 .de1 IP
468 .  ie !\\n[.$] \{\
469 .    ps \\n[PS]u
470 .    vs \\n[VS]u
471 .    ft R
472 .    sp \\n[PD]u
473 .    ne (1v + 1u)
474 .    in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
475 .    ns
476 .  \}
477 .  el \{\
478 .    ie (\\n[.$] - 1) .TP "\\$2"
479 .    el               .TP
480 \&\\$1
481 .  \}
484 .de1 HP
485 .  ps \\n[PS]u
486 .  vs \\n[VS]u
487 .  ft R
488 .  sp \\n[PD]u
489 .  ne (1v + 1u)
490 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)
491 .  in (\\n[an-margin]u + \\n[an-prevailing-indent]u)
492 .  ti \\n[an-margin]u
493 .  DEVTAG-COL 1
494 .  nr need_col2 1
495 .  ns
498 .ds an-empty \" this is referenced to avoid looping on eg .RB ( \\ )
500 .de1 RI
501 .  if \\n[.$] \{\
502 .    ds an-result \&\f[R]\\$1\"
503 .    shift
504 .    while (\\n[.$] >= 2) \{\
505 .      as an-result \,\f[I]\\$1\f[R]\/\\$2\\*[an-empty]\"
506 .      shift 2
507 .    \}
508 .    if \\n[.$] .as an-result \,\f[I]\\$1\"
509 \\*[an-result]
510 .    ft R
511 .  \}
514 .de1 IR
515 .  if \\n[.$] \{\
516 .    ds an-result \&\f[I]\\$1\f[R]\"
517 .    shift
518 .    while (\\n[.$] >= 2) \{\
519 .      as an-result \/\\$1\f[I]\,\\$2\f[R]\"
520 .      shift 2
521 .    \}
522 .    if \\n[.$] .as an-result \/\\$1\"
523 \\*[an-result]
524 .    ft R
525 .  \}
528 .de1 IB
529 .  if \\n[.$] \{\
530 .    ds an-result \&\f[I]\\$1\"
531 .    shift
532 .    while (\\n[.$] >= 2) \{\
533 .      as an-result \/\f[B]\\$1\f[I]\,\\$2\\*[an-empty]\"
534 .      shift 2
535 .    \}
536 .    if \\n[.$] .as an-result \/\f[B]\\$1\"
537 \\*[an-result]
538 .    ft R
539 .  \}
542 .de1 BI
543 .  if \\n[.$] \{\
544 .    ds an-result \&\f[B]\\$1\"
545 .    shift
546 .    while (\\n[.$] >= 2) \{\
547 .      as an-result \,\f[I]\\$1\f[B]\/\\$2\\*[an-empty]\"
548 .      shift 2
549 .    \}
550 .    if \\n[.$] .as an-result \,\f[I]\\$1\"
551 \\*[an-result]
552 .    ft R
553 .  \}
556 .de1 RB
557 .  ds an-result \&\"
558 .  while (\\n[.$] >= 2) \{\
559 .    as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]\"
560 .    shift 2
561 .  \}
562 .  if \\n[.$] .as an-result \f[R]\\$1\"
563 \\*[an-result]
564 .  ft R
567 .de1 BR
568 .  ds an-result \&\"
569 .  while (\\n[.$] >= 2) \{\
570 .    as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]\"
571 .    shift 2
572 .  \}
573 .  if \\n[.$] .as an-result \f[B]\\$1\"
574 \\*[an-result]
575 .  ft R
578 .de1 RS
579 .  nr an-saved-margin\\n[an-level] \\n[an-margin]
580 .  nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
581 .  ie \\n[.$] .nr an-margin +(n;\\$1)
582 .  el         .nr an-margin +\\n[an-prevailing-indent]
583 .  in \\n[an-margin]u
584 .  nr an-prevailing-indent \\n[IN]
585 .  nr an-level +1
588 .de1 RE
589 .  ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
590 .  el         .nr an-level -1
591 .  nr an-level (1 >? \\n[an-level])
592 .  nr an-margin \\n[an-saved-margin\\n[an-level]]
593 .  nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
594 .  in \\n[an-margin]u
597 .\" table support
599 .de1 TS
600 .  sp \\n[PD]u
601 .  HTML-IMAGE
604 .de1 T&
607 .de1 TE
608 .  HTML-IMAGE-END
611 .\" dummy equation delimiters
612 .de1 EQ
613 .  HTML-IMAGE
615 .de1 EN
616 .  HTML-IMAGE-END
619 .de1 R
621 .  ie \\n[.$] \{\
622 .    tm `R' is a string (producing the registered sign), not a macro.
623 .    nop \\$*
624 .  \}
625 .  el \{\
626 .    ie c\[rg] \
627 .      nop \[rg]\c
628 .    el \
629 .      nop (Reg.)\c
630 .  \}
633 .\" these strings must work in compatibility mode also
635 .ds S \s'\\n(PSu'\"
636 .ie c\[tm] .ds Tm \(tm\"
637 .el        .ds Tm (TM)\"
638 .ds lq \(lq\"
639 .ds rq \(rq\"
641 .if !\n[an-html] \{\
642 .  if !rHY \{\
643 .    ie \n[cR] \
644 .      nr HY 12
645 .    el \
646 .      nr HY 14
647 .  \}
648 .  hy \n[HY]
651 .\" For UTF-8, map some characters conservatively for the sake
652 .\" of easy cut and paste.
654 .if '\*[.T]'utf8' \{\
655 .  rchar \- - ' `
657 .  char \- \N'45'
658 .  char  - \N'45'
659 .  char  ' \N'39'
660 .  char  ` \N'96'
663 .\" Load man macro extensions.
664 .mso an-ext.tmac
666 .\" Load local modifications.
667 .mso man.local
669 .cp \n[_C]
671 .\" s-ts-mode