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