1
2
3
4
5
6
7
8
9
10
11
12
13
14\usemodule [ present general ]
15
16\startmodule [ present colorful ]
17
18
19
20
21
22
23
24
25\setupbodyfont [ postscript , 1 4 . 4 pt ]
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43\setupcolors [ state = start ]
44
45\definecolor [ NoneColor ] [ s = . 6 ]
46\definecolor [ GotoColor ] [ b = . 6 ] \definecolor [ blue ] [ GotoColor ]
47\definecolor [ ExitColor ] [ r = . 6 ] \definecolor [ red ] [ ExitColor ]
48\definecolor [ JumpColor ] [ s = . 6 ]
49\definecolor [ UserColor ] [ g = . 6 ] \definecolor [ green ] [ UserColor ]
50
51\definecolor [ StepColor ] [ y = . 8 ] \definecolor [ yellow ] [ StepColor ]
52
53\definecolor [ PageColor ] [ s = . 8 0 ] \definecolor [ gray ] [ PageColor ]
54\definecolor [ TextColor ] [ s = . 9 0 ]
55\definecolor [ TitleColor ] [ s = . 9 0 ]
56
57
58
59
60
61
62\setuppapersize
63 [ S 6 ] [ S 6 ]
64
65
66
67
68
69
70
71\setuplayout
72 [ width = 5 3 0 pt ,
73 height = 4 0 0 pt ,
74 header = 0 pt ,
75 footer = 0 pt ,
76 backspace = 1 5 pt ,
77 topspace = 1 5 pt ,
78 bottomdistance = 1 5 pt ,
79 bottom = 1 0 pt ,
80 margin = 0 pt ,
81 rightedgedistance = 1 5 pt ,
82 rightedge = 3 0 pt ]
83
84\setupinteractionscreen
85 [ option = max ]
86
87
88
89
90
91
92
93
94\setupbackgrounds
95 [ page ]
96 [ background = color ,
97 backgroundcolor = PageColor ]
98
99\setupbackgrounds
100 [ text ] [ text ]
101 [ background = color ,
102 backgroundcolor = TextColor ,
103 backgroundoffset = 5 pt ]
104
105
106
107
108
109
110\setupinteraction
111 [ state = start ,
112 menu = on ,
113 color = UserColor ,
114 contrastcolor = NoneColor ]
115
116
117
118
119
120
121
122\setupsubpagenumber
123 [ state = start ,
124 way = bytext ]
125
126
127
128
129
130
131
132\setupinteractionmenu
133 [ right ]
134 [ state = start ,
135 frame = off ,
136 strut = no ,
137 offset = 0 pt ,
138 inbetween = ,
139 bottomoffset = 5 pt ,
140 topoffset = 5 pt ]
141
142
143
144
145
146
147
148
149
150\startinteractionmenu [ right ]
151 \setupinteraction [ color = GotoColor ]
152 \but [ previoussubpage ] \Triangle { 9 0 } \hsize \interactioncolor \\
153 \vskip 1 0 pt
154 \but [ nextsubpage ] \Triangle { 2 7 0 } \hsize \interactioncolor \\
155 \vfill
156 \but [ PreviousJump ] \Triangle { 1 8 0 } \hsize { NoneColor } \\
157 \vskip 5 pt
158 \but [ NextJump ] \Triangle { 0 } \hsize { NoneColor } \\
159\stopinteractionmenu
160
161
162
163
164
165
166
167\setupinteractionbar
168 [ width = \textwidth ,
169 height = \bottomheight ,
170 distance = 1 0 pt ,
171 color = NoneColor ,
172 contrastcolor = StepColor ]
173
174
175
176
177
178
179\setupbottomtexts
180 [ { \interactionbar [ alternative = f ] } ]
181
182
183
184\unexpanded \def \CloseButton
185 { \ifnum \realpageno > \plusone
186 \button
187 [ width = \rightedgewidth ,
188 height = \bottomheight ,
189 offset = overlay ,
190 background = color ,
191 backgroundcolor = ExitColor ,
192 frame = off ]
193 { }
194 [ CloseDocument ]
195 \fi }
196
197\setupbottomtexts
198 [ edge ] [ ] [ \CloseButton ]
199
200
201
202
203
204
205
206\definesymbol [ 1 ] [ \blacktriangleright ]
207\definesymbol [ 2 ] [ \blacktriangledown ]
208\definesymbol [ 3 ] [ \blacktriangleright ]
209\definesymbol [ 4 ] [ \blacktriangledown ]
210
211\setupitemize [ each ] [ color = NoneColor ]
212
213
214
215
216
217
218
219
220
221\defineoverlay [ TitleGraphic ] [ \useMPgraphic { title } ]
222\defineoverlay [ NextPage ] [ \overlaybutton { nextpage } ]
223
224\unexpanded \def \StartTitlePage
225 { \setupbackgrounds [ page ] [ background = { color , TitleGraphic , NextPage } ]
226 \setupbackgrounds [ text ] [ text ] [ background = ]
227 \setupinteraction [ menu = off ]
228 \setupinteractionbar [ state = stop ]
229 \startpagemakeup
230 \switchtobodyfont [ 2 4 pt ]
231 \bfd \setupinterlinespace
232 \setupalign [ middle ]
233 \vfil
234 \enforced \let \\ \vfil
235 \scale
236 [ factor = max ] \bgroup
237 \framed
238 [ frame = off ,
239 align = middle ,
240 foregroundcolor = TitleColor ,
241 offset = . 0 5 \textwidth ]
242 \bgroup }
243
244\unexpanded \def \StopTitlePage
245 { \egroup
246 \egroup
247 \vfil \vfil \vfil
248 \stoppagemakeup
249 \setupinteraction [ menu = on ]
250 \setupinteractionbar [ state = start ]
251 \setupbackgrounds [ page ] [ background = color ]
252 \setupbackgrounds [ text ] [ text ] [ background = color ] }
253
254\unexpanded \def \TitlePage # 1
255 { \StartTitlePage # 1 \StopTitlePage }
256
257
258
259
260
261
262
263
264\definehead [ Topic ] [ chapter ]
265\definehead [ Nopic ] [ title ]
266\definehead [ Subject ] [ section ]
267
268\setuphead
269 [ Topic , Nopic ]
270 [ after = { \blank [ 3 * medium ] } ,
271 number = no ,
272 style = \bfb ,
273 page = yes ,
274 alternative = middle ]
275
276\setuphead
277 [ Subject ]
278 [ after = \blank ,
279 number = no ,
280 page = yes ,
281 continue = no ,
282 style = \bfa ]
283
284
285
286
287
288
289
290
291
292\setuplist
293 [ Topic , Subject ]
294 [ alternative = g ,
295 interaction = all ,
296 before = ,
297 after = ]
298
299\setuplist
300 [ Topic ]
301 [ criterium = all ]
302
303\unexpanded \def \Topics # 1
304 { \determinelistcharacteristics [ Topic ]
305 \ifnum \utilitylistlength > 0
306 \Nopic [ Topics ] { # 1 }
307 \ifnum \utilitylistlength > 1 2
308 \startcolumns
309 \placelist [ Topic ]
310 \stopcolumns
311 \else
312 \placelist [ Topic ]
313 \fi
314 \fi }
315
316\unexpanded \def \Subjects
317 { \placelist [ Subject ] }
318
319
320
321\setupMPvariables
322 [ triangle ]
323 [ width = 1 cm ,
324 rotation = 0 ,
325 color = black ]
326
327\startuniqueMPgraphic { triangle } { width,rotation,color }
328 fill triangle xsized \MPvar { width } rotated \MPvar { rotation } withcolor \MPvar { color } ;
329\stopuniqueMPgraphic
330
331\unexpanded \def \Triangle # 1 # 2 # 3
332 { \uniqueMPgraphic { triangle } { rotation=#1,width=#2,c:color=#3 } }
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354\startuseMPgraphic { title }
355 path p ; numeric sx , sy , cc ;
356 fill Page withcolor " StepColor " ;
357 for i = 1 upto 1000 :
358 sx : = 50 uniformdeviate 50 ;
359 sy : = 50 uniformdeviate 50 ;
360 cc : = round ( uniformdeviate 2 ) ;
361 if round ( uniformdeviate 1 ) = 0 :
362 p : = unitsquare xscaled sx yscaled sy ;
363 else :
364 p : = unittriangle scaled sx rotated ( round ( uniformdeviate 3 ) 90 ) ;
365 fi ;
366 p : = p shifted ( uniformdeviate OverlayWidth , uniformdeviate OverlayHeight ) ;
367 fill p
368 withcolor
369 if cc = 0 : " GotoColor "
370 elseif cc = 1 : " ExitColor "
371 elseif cc = 2 : " StepColor " fi ;
372 draw p
373 withpen pencircle scaled 1 2
374 withcolor white ;
375 endfor ;
376\stopuseMPgraphic
377
378\stopmodule
379
380\continueifinputfile { s present colorful . mkiv }
381
382\usemodule [ present common ]
383
384\inputpresentationfile { examples present colorful 0 0 1 . tex }
385 |