2 |
\documentclass{article} |
\documentclass{article} |
3 |
\usepackage{multicol} |
\usepackage{multicol} |
4 |
\begin{document} |
\begin{document} |
5 |
\def\lorem{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
\def\lorem{ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
6 |
|
|
7 |
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
8 |
|
|
25 |
addto s.p doublepath bbox(s.p); |
addto s.p doublepath bbox(s.p); |
26 |
pair s.size; |
pair s.size; |
27 |
s.size = (urcorner pict) - (llcorner pict); |
s.size = (urcorner pict) - (llcorner pict); |
28 |
|
pair s.loc; |
29 |
enddef; |
enddef; |
30 |
|
|
31 |
|
def docpic(suffix s)(expr locp) = |
32 |
|
addto currentpicture also s.p shifted locp; |
33 |
|
s.loc := locp; |
34 |
|
enddef; |
35 |
|
|
36 |
|
def ploc(suffix s) = |
37 |
|
show s.loc; |
38 |
|
enddef; |
39 |
|
|
40 |
|
string lnk[].a; |
41 |
|
string lnk[].b; |
42 |
|
pair lnk[].a.l; |
43 |
|
pair lnk[].b.l; |
44 |
|
path lnk[].a.p; |
45 |
|
path lnk[].b.p; |
46 |
|
|
47 |
|
nlinks = 0; |
48 |
|
|
49 |
|
def linkend(suffix e)(expr n, ed, ep) = |
50 |
|
lnk[n].e := ed; |
51 |
|
lnk[n].e.p := ep; |
52 |
|
lnk[n].e.l := center(ep); |
53 |
|
enddef; |
54 |
|
|
55 |
|
def link(sd, sp, ed, ep) = |
56 |
|
linkend(a, nlinks, sd, sp); |
57 |
|
linkend(b, nlinks, ed, ep); |
58 |
|
nlinks := nlinks+1; |
59 |
|
enddef; |
60 |
|
|
61 |
|
def cir(expr x, y, r) = |
62 |
|
(x-r,y)...(x,y-r)...(x+r,y)...(x,y+r)...cycle |
63 |
|
enddef; |
64 |
|
|
65 |
|
link("a", cir(50,50,40), "c", cir(100,100,30)); |
66 |
|
|
67 |
picture p; |
picture p; |
68 |
|
|
69 |
doc(a, btex \hv\vbox{\hsize=3cm\tolerance=10000 |
doc(a, btex \hv\vbox{\hsize=3cm\tolerance=10000 |
92 |
|
|
93 |
beginfig(1); |
beginfig(1); |
94 |
|
|
95 |
addto currentpicture also a.p; |
docpic(a, (0,0)); |
96 |
addto currentpicture also b.p shifted(xpart(a.size)+50,0); |
docpic(c, a.loc + (0, -400)); |
97 |
|
docpic(d, c.loc + (xpart(c.size)+50, 0)); |
98 |
y2=-400; |
docpic(e, c.loc + (0, -400)); |
99 |
|
docpic(b, e.loc + (xpart(e.size)+50, 0)); |
100 |
addto currentpicture also c.p shifted(0,y2); |
|
101 |
addto currentpicture also d.p shifted(xpart(c.size)+50,y2); |
% addto currentpicture also a.p; |
102 |
addto currentpicture also e.p shifted(0,-800); |
% |
103 |
|
% y2=-400; |
104 |
|
% |
105 |
|
% addto currentpicture also c.p shifted(0,y2); |
106 |
|
% addto currentpicture also d.p shifted(xpart(c.size)+50,y2); |
107 |
|
% addto currentpicture also e.p shifted(0,-800); |
108 |
|
% addto currentpicture also b.p shifted(xpart(e.size)+50,-800); |
109 |
|
|
110 |
|
scantokens("ploc(b)"); |
111 |
|
|
112 |
endfig; |
endfig; |
113 |
|
|