1
2
3
4
5
6
7
8
9
10
11
12
13
14\startmodule [ present organic ]
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34\setuppapersize
35 [ S 6 ] [ S 6 ]
36
37
38
39
40
41\setupbodyfont [ pagella ]
42
43
44
45
46
47
48\setuplayout
49 [ topspace = 4 8 pt ,
50 backspace = 4 8 pt ,
51 cutspace = 1 2 pt ,
52 width = 4 0 0 pt ,
53 margin = 0 cm ,
54 rightedge = 8 8 pt ,
55 rightedgedistance = 4 8 pt ,
56 header = 0 cm ,
57 footer = 0 cm ,
58 height = middle ]
59
60
61
62\setupwhitespace
63 [ big ]
64
65
66
67\definecolor [ red ] [ r = . 7 5 ]
68\definecolor [ yellow ] [ r = . 7 5 , g = . 7 5 ]
69\definecolor [ gray ] [ s = . 5 0 ]
70\definecolor [ white ] [ s = . 8 5 ]
71
72\definecolor [ PageColor ] [ yellow ]
73\definecolor [ TextColor ] [ white ]
74\definecolor [ OrnamentColor ] [ red ]
75\definecolor [ InteractionColor ] [ red ]
76\definecolor [ ContrastColor ] [ gray ]
77
78
79
80
81
82
83\setupinteraction
84 [ state = start ,
85 click = off ,
86 color = InteractionColor ,
87 contrastcolor = ContrastColor ,
88 menu = on ]
89
90
91
92
93
94\setupinteractionmenu
95 [ right ]
96 [ frame = off ,
97 position = yes ,
98 align = middle ,
99 topoffset = . 7 5 cm ,
100 bottomoffset = . 7 5 cm ,
101 color = gray ,
102 contrastcolor = gray ,
103 style = bold ,
104 before = ,
105 after = ]
106
107
108
109
110\startinteractionmenu [ right ]
111 \placelist [ Topic ] [ alternative = right ]
112 \vfill
113 \but [ CloseDocument ] close \\
114\stopinteractionmenu
115
116
117
118
119
120
121
122\setupbackgrounds
123 [ page ]
124 [ background = page ]
125
126\defineoverlay
127 [ page ]
128 [ \useMPgraphic { page } ]
129
130\setupMPvariables
131 [ page ]
132 [ alternative = 3 ]
133
134\startuseMPgraphic { page }
135
136 \includeMPgraphic { rightsuperbutton }
137
138 StartPage ;
139
140 path p , q ; pickup pencircle scaled 3 pt ;
141
142 p : = Field [ Text ] [ Text ] enlarged 36 pt superellipsed .90 ;
143
144 fill Page withcolor \MPcolor { PageColor } ;
145 fill p withcolor \MPcolor { TextColor } ;
146 draw p withcolor \MPcolor { OrnamentColor } ;
147
148 p : = Field [ Text ] [ Text ] enlarged 48 pt superellipsed .90 ;
149
150 def right_menu_button ( expr nn , rr , pp , xx , yy , ww , hh , dd ) =
151 if ( pp > 0 ) and ( rr > 0 ) :
152 q : = rightsuperbutton ( p , xx , yy , RightEdgeWidth , hh ) ;
153 fill q withcolor \MPcolor { TextColor } ;
154 draw q withcolor if rr = 2 : \MPcolor { ContrastColor }
155 else : \MPcolor { InteractionColor } fi ;
156 fi ;
157 enddef ;
158
159 \MPmenubuttons { right }
160
161 StopPage ;
162\stopuseMPgraphic
163
164\startuseMPgraphic { page }
165
166 \includeMPgraphic { rightsuperbutton }
167
168 StartPage ;
169
170 numeric alternative , seed , superness , squeezeness , randomness ;
171 path p , q ; transform t ;
172
173 alternative : = \MPvar { alternative } ;
174 seed : = uniformdeviate 100 ;
175
176 if alternative > 10 :
177 superness : = .85 ( ( \realfolio -1 ) max ( \lastpage , 1 ) ) .15 ;
178 squeezeness : = 12 pt ( ( \realfolio -1 ) max ( \lastpage , 1 ) ) 10 pt ;
179 else :
180 superness : = .90 ;
181 squeezeness : = 12 pt ;
182 fi ;
183
184 randomness : = squeezeness ;
185
186 alternative : = alternative mod 10 ;
187
188 t : = identity if alternative = 3 : shifted ( 9 pt , -9 pt ) fi ;
189
190
191
192 randomseed : = seed ;
193
194 p : = Field [ Text ] [ Text ] enlarged if
195 alternative = 1 : 36 pt superellipsed superness elseif
196 alternative = 2 : 36 pt squeezed squeezeness elseif
197 alternative = 3 : 36 pt randomized randomness else
198 : 36 pt fi ;
199
200 pickup pencircle scaled 3 pt ;
201
202 fill Page withcolor \MPcolor { PageColor } ;
203 fill p withcolor \MPcolor { TextColor } ;
204 draw p withcolor \MPcolor { OrnamentColor } ;
205
206
207
208 randomseed : = seed ;
209
210 p : = ( Field [ Text ] [ Text ] enlarged if
211 alternative = 1 : 48 pt superellipsed superness elseif
212 alternative = 2 : 48 pt squeezed squeezeness elseif
213 alternative = 3 : 36 pt randomized randomness else
214 : 48 pt fi ) transformed t ;
215
216
217
218 vardef right_menu_button ( expr nn , rr , pp , xx , yy , ww , hh , dd ) =
219 save q ; path q ;
220 if ( pp > 0 ) and ( rr > 0 ) :
221 q : = rightsuperbutton ( p , xx , yy , RightEdgeWidth , hh ) ;
222 fill q withcolor \MPcolor { TextColor } ;
223 draw q withcolor if rr = 2 : \MPcolor { ContrastColor }
224 else : \MPcolor { InteractionColor } fi ;
225 fi ;
226 enddef ;
227
228
229
230 \MPmenubuttons { right }
231
232 StopPage ;
233\stopuseMPgraphic
234
235\startuseMPgraphic { rightsuperbutton }
236
237 vardef rightsuperbutton ( expr pat , xpos , ypos , wid , hei ) =
238
239 save p , ptop , pbot , t , b , edge , shift , width , height ;
240 path p , ptop , pbot ; pair t , b ; numeric edge , shift , width , height ;
241
242 edge : = xpos wid ; shift : = ypos hei ;
243
244 p : = rightpath pat ;
245
246 ptop : = ( ( infinity , shift ) -- ( edge , shift ) ) ;
247 pbot : = ( ( infinity , shift hei ) -- ( edge , shift hei ) ) ;
248
249 t : = p intersection_point ptop ;
250 b : = p intersection_point pbot ;
251
252 p : = subpath ( 0 , xpart ( p intersectiontimes ptop ) ) of p ;
253 p : = subpath ( xpart ( p intersectiontimes pbot ) , length ( p ) ) of p ;
254
255 ( p -- t -- point 1 of ptop &
256 point 1 of ptop -- point 1 of pbot &
257 point 1 of pbot -- b
258 -- cycle )
259
260 enddef ;
261
262\stopuseMPgraphic
263
264
265
266
267
268\definehead
269 [ Topic ]
270 [ chapter ]
271
272\setuphead
273 [ Topic ]
274 [ number = no ]
275
276
277
278
279\setuplist
280 [ Topic ]
281 [ criterium = all ,
282 style = bold ,
283 before = ,
284 after = ]
285
286
287
288
289\unexpanded \def \StartTitlePage
290 { \startstandardmakeup
291 \switchtobodyfont [ big ]
292 \enforced \protected \def \\ { \vfill \bfb \enforced \let \\ \par }
293 \bfd \setupinterlinespace \gray
294 \vskip . 5 cm \relax }
295
296\unexpanded \def \StopTitlePage
297 { \\
298 \vskip . 5 cm \relax
299 \stopstandardmakeup }
300
301\unexpanded \def \TitlePage # 1
302 { \StartTitlePage # 1 \StopTitlePage }
303
304
305
306\unexpanded \def \Subject { \Topic }
307\unexpanded \def \Topics # 1 { }
308\unexpanded \def \Subjects { }
309
310\startsetups document : start
311 \StartTitlePage
312 \documentvariable { title }
313 \doifsomething { \documentvariable { subtitle } } {
314 \\
315 \documentvariable { subtitle }
316 }
317 \doifsomething { \documentvariable { location } } {
318 \\
319 \documentvariable { location }
320 }
321 \StopTitlePage
322\stopsetups
323
324\startsetups document : stop
325
326\stopsetups
327
328\stopmodule
329
330\continueifinputfile { s present organic . mkiv }
331
332\usemodule [ present common ]
333
334\inputpresentationfile { examples present organic 0 0 1 . tex }
335
336 |