groff before CVS: release 1.06
[s-roff.git] / tmac / tmac.psatk
blobb59d23a24e7ee1a64e675146b418e579095cd3a7
1 .\" Implementation of the ATK PB and PE macros for use with groff and grops.
2 .\" Load this after tmac.atk.
3 .nr zT 0
4 .if '\*(.T'ps' .nr zT 1
5 .nr psatk-unit 1p
6 .de psatk-defs
7 ps: mdef 5
8 /PB {
9         /saved save def
10         currentpoint translate
11         \n[psatk-unit] u -\n[psatk-unit] u scale
12         userdict begin
13         /showpage {} def
14 } bind def
15 /PE {
16         end
17         saved restore
18 } bind def
19 /troffadjust {
20         pop 0
21 } bind def
23 .de PB
24 .ne \\$1p
25 .nr zT \\n(zT>0
26 \\*[PB\\n(zT]\\
28 .de PE
29 \\*[PE\\n(zT]\\
31 .ds PB0
32 .\" The last line before the "'PE" is "\}" rather than ".\}".  This
33 .\" would cause a spurious space to be introduced before any picture
34 .\" that was the first thing on a line.  So we have to catch that and
35 .\" remove it.
36 .de PB1
37 .ev psatk
38 .fi
39 .di psatk-mac
40 \!ps: exec PB
42 .de PE0
43 \v'-.75m'\
44 \D'l \\$1p 0'\D'l 0 \\$2p'\D'l -\\$1p 0'\D'l 0 -\\$2p'\
45 \h'\\$1p'\v'.75m'\x'\\$2p-1m>?0'\c
47 .ds psatk-init \Y[psatk-defs]
48 .de PE1
49 \!PE
50 .di
51 .di null
52 .br
53 .di
54 .rm null
55 .ev
56 \v'-.75m'\
57 \\*[psatk-init]\Y[psatk-mac]\
58 \h'\\$1p'\v'.75m'\x'\\$2p-1m>?0'\c
59 .rm psatk-mac
60 .if \\n(.P .ds psatk-init