1\environment columnsets000
2
3\startuseMPgraphic{mpos:par:columns}
4 path p ; numeric h ;
5 for i=1 upto nofmultipars :
6 p := multipars[i] ;
7 h := bbheight(p) ;
8 if multikind[i] = "single" :
9 fill p topenlarged -.5h
10 withshademethod "linear"
11 withshadedirection shadedup
12 withcolor \MPcolor{color-1} shadedinto white ;
13 fill p bottomenlarged -.5h
14 withshademethod "linear"
15 withshadedirection shadedup
16 withcolor white shadedinto \MPcolor{color-1} ;
17 elseif multikind[i] = "first" :
18 fill p
19 withshademethod "linear"
20 withshadedirection shadedup
21 withcolor \MPcolor{color-2} shadedinto white ;
22 elseif multikind[i] = "middle" :
23 fill p topenlarged -.5h
24 withshademethod "linear"
25 withshadedirection shadedup
26 withcolor \MPcolor{color-2} shadedinto white ;
27 fill p bottomenlarged -.5h
28 withshademethod "linear"
29 withshadedirection shadedup
30 withcolor white shadedinto \MPcolor{color-3} ;
31 elseif multikind[i] = "last" :
32 fill p
33 withshademethod "linear"
34 withshadedirection shadedup
35 withcolor white shadedinto \MPcolor{color-3} ;
36 fi ;
37 endfor ;
38\stopuseMPgraphic
39
40\definecolumnset
41 [example]
42 [n=4,
43 page=left]
44
45\definetextbackground
46 [shade]
47 [location=paragraph,
48 mp=mpos:par:columns,
49 before=\blank,
50 after=\blank]
51
52\starttext
53
54\startcolumnset[example]
55
56 \dorecurse {40} {
57 \starttextbackground[shade]
58 \fakewords{10}{200}
59 \stoptextbackground
60 \par
61 }
62
63\stopcolumnset
64
65\stoptext
66 |