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