1\startenvironment macbgraphics
2
3
4
5
6\definecolor[ShapeDarkLine] [s=.4]
7\definecolor[ShapeDarkDots] [r=1]
8\definecolor[ShapeDarkEnd] [g=1]
9\definecolor[ShapeLightLine] [s=.95]
10\definecolor[ShapeLightDots] [r=.9,g=,5,b=.5]
11\definecolor[ShapeLightFill] [s=.95]
12\definecolor[ShapeLightFrame][r=.5,g=.50,b=.9]
13
14\startuseMPgraphic{basic-shape-dark}
15 color shapedotscolor ; shapedotscolor := \MPcolor{ShapeDarkDots} ;
16 color shapelinecolor ; shapelinecolor := \MPcolor{ShapeDarkLine} ;
17 \includeMPgraphic{basicshape}
18\stopuseMPgraphic
19
20\startuseMPgraphic{basic-shape-light}
21 color shapedotscolor ; shapedotscolor := \MPcolor{ShapeLightDots} ;
22 color shapelinecolor ; shapelinecolor := \MPcolor{ShapeLightLine} ;
23 \includeMPgraphic{basicshape}
24\stopuseMPgraphic
25
26\startuseMPgraphic{basic-shape}
27 w := OverlayWidth ; width := 100 ; wfactor := wwidth ;
28 h := OverlayHeight ; height := 100 ; hfactor := hheight ;
29 d := OverlayOffset ;
30
31 def random_delta (expr d) =
32 d (uniformdeviate 2d)
33 enddef;
34
35 z1 = (0,height) ;
36 z2 = (0,0) ;
37 z3 = (width,0) ;
38 z4 = (width,height) ;
39
40 z5 = ( widthrandom_delta(.2width),heightrandom_delta(.2height)) ;
41 z6 = (.5widthrandom_delta(.1width),heightrandom_delta(.1height)) ;
42
43 pickup pencircle
44 xscaled (OverlayLineWidth wfactor)
45 yscaled (OverlayLineWidth(2hfactor))
46 rotated 30 ;
47
48 draw z5 .. z1 .. z2 .. z3 .. z4 .. z6 withcolor shapelinecolor ;
49
50 pickup pencircle
51 xscaled (OverlayLineWidthwfactor)
52 yscaled (OverlayLineWidthhfactor) ;
53
54 draw z1 withcolor shapedotscolor ;
55 draw z2 withcolor shapedotscolor ;
56 draw z3 withcolor shapedotscolor ;
57 draw z4 withcolor shapedotscolor ;
58 draw z5 withcolor shapedotscolor ;
59 draw z6 withcolor shapedotscolor ;
60
61 currentpicture := currentpicture xysized (w,h) ;
62\stopuseMPgraphic
63
64\startuniqueMPpagegraphic{chapter-state}
65 color shapelinecolor ; shapelinecolor := \MPcolor{ShapeDarkLine} ;
66
67 delta := OverlayOffset ;
68 width := OverlayWidth 2delta ;
69 height := (OverlayHeight 2delta) 3 ;
70
71 z1 = (0,3height) ;
72 z2 = (0,2height) ;
73 z3 = (if not odd RealPageNumber : fi width,1.5height) ;
74 z4 = (0,height) ;
75 z5 = (0,0) ;
76
77 pickup pencircle
78 xscaled delta
79 yscaled .5delta
80 rotated 30 ;
81
82 draw z1 -- z2{up} .. z3 .. {up} z4 -- z5 withcolor shapelinecolor ;
83
84 pickup pencircle
85 scaled delta ;
86
87 draw z1 withcolor red ;
88 draw z2 withcolor red ;
89 draw z3 withcolor red ;
90 draw z4 withcolor red ;
91 draw z5 withcolor red ;
92
93\stopuniqueMPpagegraphic
94
95\startreusableMPgraphic{pagenumber-state}
96 color shapelinecolor ; shapelinecolor := \MPcolor{ShapeDarkLine} ;
97
98 delta := OverlayOffset ;
99 width := OverlayWidth 2delta ;
100 height := OverlayHeight 2delta ;
101 lines := 5OverlayOffset ;
102
103 z1 = (0,0) ;
104 z2 = (lines,0) ;
105 z3 = (.5width,height) ;
106 z4 = (widthlines,0) ;
107 z5 = (width,0) ;
108
109 pickup pencircle
110 xscaled delta
111 yscaled .5delta
112 rotated 30;
113
114 draw z1 -- z2 {dir 135} ... z3 ... {dir -135} z4 -- z5 withcolor shapelinecolor ;
115
116 pickup pencircle
117 scaled delta ;
118
119 draw z1 withcolor red ;
120 draw z2 withcolor red ;
121 draw z3 withcolor red ;
122 draw z4 withcolor red ;
123 draw z5 withcolor red ;
124
125\stopreusableMPgraphic
126
127\startreusableMPgraphic{manualsymbol}
128 logo_type := 401 ;
129 input "mp-prag" ;
130 currentpicture := currentpicture scaled 0.25 ;
131\stopreusableMPgraphic
132
133\startuseMPgraphic{frame-shape}
134 delta := OverlayOffset ;
135 width := OverlayWidth 2delta ;
136 height := OverlayHeight 2delta ;
137
138 vardef gamma =
139 g := OverlayOffset ; ((g3) (uniformdeviate (2g3)))
140 enddef;
141
142 z1 = (0,0) ;
143 z2 = (width,0) ;
144 z3 = (width,height) ;
145 z4 = (0,height) ;
146
147 x12= .5[x1,x2] ; y12=y1 gamma ;
148 y23= .5[y2,y3] ; x23=x2 gamma ;
149 x34= .5[x3,x4] ; y34=y3 gamma ;
150 y41= .5[y4,y1] ; x41=x4 gamma ;
151
152 pickup pencircle
153 xscaled OverlayLineWidth
154 yscaled .5OverlayLineWidth
155 rotated 30;
156
157 path p;
158 p :=
159 z1..z12..z2 &
160 z2..z23..z3 &
161 z3..z34..z4 &
162 z4..z41..z1 &
163 cycle ;
164
165 fill p withcolor shapefillcolor ;
166 draw p withcolor shapelinecolor ;
167\stopuseMPgraphic
168
169\startuseMPgraphic{setup-shape}
170 color shapelinecolor ; shapelinecolor := \MPcolor{ShapeLightFrame} ;
171 color shapefillcolor ; shapefillcolor := \MPcolor{ShapeLightFill} ;
172 \includeMPgraphic{frameshape}
173\stopuseMPgraphic
174
175
176
177
178
179
180
181\startuniqueMPgraphic{note-rule}
182 color shapelinecolor ; shapelinecolor := \MPcolor{ShapeDarkLine} ;
183 color shapeendcolor ; shapeendcolor := \MPcolor{ShapeDarkEnd} ;
184
185 draw bottomboundary OverlayBox withcolor shapelinecolor withpen pencircle scaled OverlayLineWidth ;
186 draw llcorner OverlayBox withcolor shapeendcolor withpen pencircle scaled 3OverlayLineWidth ;
187 draw lrcorner OverlayBox withcolor shapeendcolor withpen pencircle scaled 3OverlayLineWidth ;
188
189\stopuniqueMPgraphic
190
191\startuniqueMPgraphic{column-rule}
192 color shapelinecolor ; shapelinecolor := \MPcolor{ShapeDarkLine} ;
193 color shapeendcolor ; shapeendcolor := \MPcolor{ShapeDarkEnd} ;
194
195 draw leftboundary OverlayBox withcolor shapelinecolor withpen pencircle scaled OverlayLineWidth ;
196 draw ulcorner OverlayBox withcolor shapeendcolor withpen pencircle scaled 3OverlayLineWidth ;
197 draw llcorner OverlayBox withcolor shapeendcolor withpen pencircle scaled 3OverlayLineWidth ;
198
199\stopuniqueMPgraphic
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266\stopenvironment
267 |