19 |
\font\foofontii = cmcss12 scaled 1000 |
\font\foofontii = cmcss12 scaled 1000 |
20 |
etex; |
etex; |
21 |
|
|
22 |
def doc(suffix s)(expr pict) = |
def doc(suffix s)(expr col, pict) = |
23 |
picture s.p; |
picture s.p; |
24 |
s.p = pict; |
s.p = nullpicture; |
25 |
|
addto s.p contour bbox(pict) withcolor col; |
26 |
|
addto s.p also pict; |
27 |
addto s.p doublepath bbox(s.p); |
addto s.p doublepath bbox(s.p); |
28 |
pair s.size; |
pair s.size; |
29 |
s.size = (urcorner pict) - (llcorner pict); |
s.size = (urcorner pict) - (llcorner pict); |
30 |
pair s.loc; |
pair s.loc; |
31 |
|
transform s.tr; |
32 |
|
enddef; |
33 |
|
|
34 |
|
vardef docpicraw(suffix s)(expr locp) = |
35 |
|
s.tr := locp; |
36 |
|
s.loc := (0,0) transformed locp; |
37 |
|
(s.p transformed locp) |
38 |
enddef; |
enddef; |
39 |
|
|
40 |
def docpic(suffix s)(expr locp) = |
def docpic(suffix s)(expr locp) = |
41 |
addto currentpicture also s.p shifted locp; |
addto currentpicture also docpicraw(s, locp); |
42 |
s.loc := locp; |
enddef; |
43 |
|
|
44 |
|
vardef docpicclip(suffix s)(expr locp, clipp) = |
45 |
|
save p; |
46 |
|
picture p; |
47 |
|
p := docpicraw(s, locp); |
48 |
|
clip p to clipp transformed locp; |
49 |
|
addto p doublepath (clipp transformed locp) withpen pencircle scaled 4pt; |
50 |
|
addto currentpicture also p; |
51 |
enddef; |
enddef; |
52 |
|
|
53 |
def ploc(suffix s) = |
def ploc(suffix s) = |
57 |
string lnk[].a; |
string lnk[].a; |
58 |
string lnk[].b; |
string lnk[].b; |
59 |
pair lnk[].a.l; |
pair lnk[].a.l; |
60 |
|
transform lnk[].a.loc; |
61 |
pair lnk[].b.l; |
pair lnk[].b.l; |
62 |
|
transform lnk[].b.loc; |
63 |
path lnk[].a.p; |
path lnk[].a.p; |
64 |
path lnk[].b.p; |
path lnk[].b.p; |
65 |
|
|
67 |
|
|
68 |
def linkend(suffix e)(expr n, ed, ep) = |
def linkend(suffix e)(expr n, ed, ep) = |
69 |
lnk[n].e := ed; |
lnk[n].e := ed; |
|
lnk[n].e.p := ep; |
|
70 |
lnk[n].e.l := center(ep); |
lnk[n].e.l := center(ep); |
71 |
|
lnk[n].e.p := ep shifted -center(ep); |
72 |
enddef; |
enddef; |
73 |
|
|
74 |
def link(sd, sp, ed, ep) = |
def link(expr sd, sp, ed, ep) = |
75 |
linkend(a, nlinks, sd, sp); |
linkend(a, nlinks, sd, sp); |
76 |
linkend(b, nlinks, ed, ep); |
linkend(b, nlinks, ed, ep); |
77 |
nlinks := nlinks+1; |
nlinks := nlinks+1; |
78 |
enddef; |
enddef; |
79 |
|
|
80 |
|
def strloc(expr str) = |
81 |
|
scantokens (str & ".tr") |
82 |
|
enddef; |
83 |
|
|
84 |
|
def locatelinkend(suffix e)(expr ind) = |
85 |
|
lnk[ind].e.loc := identity shifted lnk[ind].e.l transformed strloc(lnk[ind].e) ; |
86 |
|
enddef; |
87 |
|
|
88 |
|
def plainlinkend(suffix e)(expr ind) = |
89 |
|
draw lnk[ind].e.p transformed lnk[ind].e.loc withpen pencircle scaled 4pt; |
90 |
|
enddef; |
91 |
|
|
92 |
|
vardef plainlink(expr ind) = |
93 |
|
locatelinkend(a, ind); |
94 |
|
locatelinkend(b, ind); |
95 |
|
plainlinkend(a, ind) |
96 |
|
plainlinkend(b, ind) |
97 |
|
draw ((0,0) transformed lnk[ind].a.loc){right} .. tension 2 .. |
98 |
|
((0,0) transformed lnk[ind].b.loc){right} withpen pencircle scaled 6pt; |
99 |
|
enddef; |
100 |
|
|
101 |
def cir(expr x, y, r) = |
def cir(expr x, y, r) = |
102 |
(x-r,y)...(x,y-r)...(x+r,y)...(x,y+r)...cycle |
(x-2*r,y)...(x,y-r)...(x+2*r,y)...(x,y+r)...cycle |
103 |
enddef; |
enddef; |
104 |
|
|
105 |
link("a", cir(50,50,40), "c", cir(100,100,30)); |
link("a", cir(50,30,25), "c", cir(75,110,40)); |
106 |
|
link("b", cir(50,230,30), "a", cir(350,290,30)); |
107 |
|
link("b", cir(60,170,35), "d", cir(150,60,50)); |
108 |
|
link("c", cir(70,160,37), "b", cir(58,310,32)); |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
picture p; |
picture p; |
113 |
|
|
114 |
doc(a, btex \hv\vbox{\hsize=3cm\tolerance=10000 |
doc(a, (1,.90,.80), btex \hv\vbox{\hsize=3cm\tolerance=10000 |
115 |
\columnseprule=.4pt |
\columnseprule=.4pt |
116 |
\columnsep=.5cm |
\columnsep=.5cm |
117 |
\parskip .5cm |
\parskip .5cm |
118 |
\linewidth=18cm\begin{multicols}{5}\loremiii |
\linewidth=18cm\begin{multicols}{5}\loremiii |
119 |
\end{multicols}}etex); |
\end{multicols}}etex); |
120 |
|
|
121 |
doc(b, btex |
doc(b, (.75,1,.75), btex \rm\vbox{\hsize=4.5cm\tolerance=10000\loremii}etex); |
122 |
|
|
123 |
|
doc(c, (.90,.80,1), btex |
124 |
|
\foofonti\vbox{\linewidth=15cm\tolerance=10000 |
125 |
|
\begin{multicols}{3}\loremiii\end{multicols}} |
126 |
|
etex); |
127 |
|
doc(d, (.80,1,1), btex |
128 |
|
\foofontii\vbox{\hsize=10.5cm\tolerance=10000\loremii}etex); |
129 |
|
|
130 |
|
doc(e, (1,.80,1), btex |
131 |
\sc\vbox{ |
\sc\vbox{ |
132 |
\linewidth=10cm |
\linewidth=10cm |
133 |
\begin{multicols}{3} |
\begin{multicols}{3} |
135 |
\end{multicols}} |
\end{multicols}} |
136 |
etex); |
etex); |
137 |
|
|
|
doc(c, btex \rm\vbox{\hsize=6cm\tolerance=10000\loremii}etex); |
|
|
|
|
|
doc(d, btex |
|
|
\foofonti\vbox{\linewidth=15cm\tolerance=10000 |
|
|
\begin{multicols}{3}\loremiii\end{multicols}} |
|
|
etex); |
|
|
doc(e, btex |
|
|
\foofontii\vbox{\hsize=10.5cm\tolerance=10000\loremii}etex); |
|
|
|
|
138 |
beginfig(1); |
beginfig(1); |
139 |
|
|
140 |
docpic(a, (0,0)); |
docpic(a, identity); |
141 |
docpic(c, a.loc + (0, -400)); |
docpic(b, identity shifted (a.loc + (0, -ypart(b.size)-50))); |
142 |
docpic(d, c.loc + (xpart(c.size)+50, 0)); |
docpic(c, identity shifted (b.loc + (xpart(b.size)+50, 0))); |
143 |
docpic(e, c.loc + (0, -400)); |
docpic(d, identity shifted (b.loc + (0, -400))); |
144 |
docpic(b, e.loc + (xpart(e.size)+50, 0)); |
docpic(e, identity shifted (d.loc + (xpart(d.size)+50, 0))); |
145 |
|
|
146 |
|
plainlink(0); |
147 |
|
plainlink(1); |
148 |
|
plainlink(2); |
149 |
|
plainlink(3); |
150 |
|
|
151 |
% addto currentpicture also a.p; |
% addto currentpicture also a.p; |
152 |
% |
% |
161 |
|
|
162 |
endfig; |
endfig; |
163 |
|
|
164 |
|
cor = 20; |
165 |
|
path csp; |
166 |
|
csp = (-200, 0){up} ... (-200+cor, 150-cor) ... (0, 150){right}; |
167 |
|
csp := (csp & (reverse csp xscaled -1) ..(csp scaled -1) ..(reverse csp yscaled -1)) .. cycle ; |
168 |
|
|
169 |
|
ccx = 210; |
170 |
|
ccy = 160; |
171 |
|
|
172 |
|
def cscreen = |
173 |
|
clip currentpicture to csp; |
174 |
|
draw csp withpen pencircle scaled 3pt; |
175 |
|
draw (-ccx,-ccy) -- (-ccx,ccy) -- (ccx, ccy) -- (ccx,-ccy) -- cycle |
176 |
|
withpen pencircle scaled 2pt;; |
177 |
|
enddef; |
178 |
|
|
179 |
|
beginfig(2); |
180 |
|
|
181 |
|
docpic(a, identity shifted (-50, -50) scaled 1.2); |
182 |
|
|
183 |
|
docpicclip(c, identity shifted (-lnk0b.l) scaled .7 rotated -15 shifted(150,-60), |
184 |
|
lnk0b.p scaled 1.05 shifted lnk0b.l); |
185 |
|
|
186 |
|
locatelinkend(a, 0); |
187 |
|
locatelinkend(b, 0); |
188 |
|
|
189 |
|
draw ((0,0) transformed lnk0.a.loc) .. |
190 |
|
((0,0) transformed lnk0.b.loc) withpen pencircle scaled 3pt; |
191 |
|
|
192 |
|
cscreen; |
193 |
|
|
194 |
|
endfig; |
195 |
|
|
196 |
|
beginfig(3); |
197 |
|
|
198 |
|
|
199 |
|
docpic(b, identity shifted (-.5*b.size) scaled 1.4); |
200 |
|
|
201 |
|
docpicclip(a, identity shifted (-lnk1b.l) scaled .7 rotated -15 shifted (150,10), |
202 |
|
lnk1b.p scaled 1.5 shifted lnk1b.l); |
203 |
|
|
204 |
|
locatelinkend(a, 1); |
205 |
|
locatelinkend(b, 1); |
206 |
|
|
207 |
|
draw ((0,0) transformed lnk1.a.loc) .. |
208 |
|
((0,0) transformed lnk1.b.loc) withpen pencircle scaled 3pt; |
209 |
|
|
210 |
|
cscreen; |
211 |
|
endfig; |
212 |
|
|
213 |
verbatimtex |
verbatimtex |
214 |
\end{document} |
\end{document} |
215 |
etex |
etex |