* src/preproc/grn/main.cc: Slight formatting.
[s-roff.git] / tmac / tmac.pspic
blobef4186f64e76acd4ee623187daa41ac57e75de8b
1 .\" Define the PSPIC macro.
2 .\" When used other than with -Tps, it will draw a box around where
3 .\" the picture would go.
4 .de PSPIC
5 .nr ps-offset-mode 0
6 .if '\\$1'-L' \{\
7 .       nr ps-offset-mode 1
8 .       shift
9 .\}
10 .if '\\$1'-R' \{\
11 .       nr ps-offset-mode 2
12 .       shift
13 .\}
14 .if '\\$1'-I' \{\
15 .       nr ps-offset-mode 3
16 .       nr ps-offset (m;\\$2)
17 .       shift 2
18 .\}
19 .br
20 .psbb \\$1
21 .if (\\n[llx] & \\n[lly] & \\n[urx] & \\n[ury]) \{\
22 .       nr ps-wid (\\n[urx]-\\n[llx])
23 .       nr ps-ht (\\n[ury]-\\n[lly])
24 .       if \\n[ps-wid]<0 .nr ps-wid 0-\\n[ps-wid]
25 .       if \\n[ps-ht]<0 .nr ps-ht 0-\\n[ps-ht]
26 .       ie \\n[.$]>=2 .nr ps-deswid (i;\\$2)
27 .       el .nr ps-deswid \\n[.l]-\\n[.i]<?\\n[ps-wid]p
28 .       nr ps-desht \\n[ps-deswid]*1000+(\\n[ps-wid]/2)/\\n[ps-wid]\
29 *\\n[ps-ht]+500/1000
30 .       if \\n[.$]>=3&(\\n[ps-desht]>(i;0\\$3)) \{\
31 .               nr ps-desht (i;\\$3)
32 .               nr ps-deswid \\n[ps-desht]*1000+(\\n[ps-ht]/2)/\\n[ps-ht]\
33 *\\n[ps-wid]+500/1000
34 .       \}
35 .       ne \\n[ps-desht]u+1v
36 .       if \\n[ps-offset-mode]=0 .nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]/2
37 .       if \\n[ps-offset-mode]=1 .nr ps-offset 0
38 .       if \\n[ps-offset-mode]=2 .nr ps-offset \\n[.l]-\\n[.i]-\\n[ps-deswid]
39 .       ie \\n[.$]>=3 .ds ps-desht \\n[ps-desht]
40 .       el .ds ps-desht \" empty
41 \h'\\n[ps-offset]u'\
42 \X'ps: invis'\
43 \Z'\D'p 0 \\n[ps-desht]u \\n[ps-deswid]u 0 0 -\\n[ps-desht]u''\
44 \X'ps: endinvis'\
45 \v'\\n[ps-desht]u'\X'ps: import \\$1 \
46 \\n[llx] \\n[lly] \\n[urx] \\n[ury] \\n[ps-deswid] \\*[ps-desht]'
47 .       br
48 .       sp \\n[ps-desht]u
49 .\}