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