1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17\setuppapersize
18 [S6][S6]
19
20\setuplayout
21 [width=middle,
22 height=middle,
23 header=0pt,
24 footer=0pt,
25 bottomdistance=.5cm,
26 bottom=1cm,
27 topspace=2cm,
28 backspace=2cm]
29
30
31
32
33
34\startmode[asintended] \setupbodyfont[lbr,hw] \stopmode
35
36
37
38
39\setupcolors
40 [state=start]
41
42\definecolor[PageColor] [s=.6]
43\definecolor[TextColor] [s=.8]
44\definecolor[LineColor] [g=.4]
45\definecolor[SymbolColor][r=.4]
46
47
48
49
50\setupinteractionscreen
51 [option=max]
52
53\setupinteractionmenu
54 [bottom]
55 [state=start,
56 height=1cm,
57 middle=\hskip1cm]
58
59\setupinteraction
60 [state=start,
61 menu=on,
62 display=new,
63 click=no,
64 color=SymbolColor,
65 contrastcolor=SymbolColor]
66
67\startinteractionmenu[bottom]
68 \hfill
69 \got [previouspage] \symbol[prevmark] \\
70 \got [nextpage] \symbol[nextmark] \\
71 \got [CloseDocument] \symbol[stopmark] \\
72 \txt \tfd \SymbolColor \pagenumber \\
73\stopinteractionmenu
74
75
76
77
78
79
80\definesymbol[itemmark][\useMPgraphic{itemmark}]
81\definesymbol[stopmark][\useMPgraphic{stopmark}]
82\definesymbol[nextmark][\useMPgraphic{nextmark}]
83\definesymbol[prevmark][\useMPgraphic{prevmark}]
84
85
86
87\defineoverlay [page] [\useMPgraphic{page}]
88\defineoverlay [next] [\overlaybutton{forward}]
89\defineoverlay [prev] [\overlaybutton{PreviousJump}]
90
91\setupbackgrounds
92 [page]
93 [background={page,prev}]
94
95\setupbackgrounds
96 [text]
97 [background=next]
98
99\setuphead
100 [chapter]
101 [alternative=middle,
102 number=no,
103 color=SymbolColor,
104 style=\tfc]
105
106
107
108\setupwhitespace
109 [big]
110
111\setupitemize
112 [1]
113 [symbol=itemmark,
114 width=3\bodyfontsize]
115
116\def\StartTitlePage
117 {\setupinteractionmenu[bottom][state=stop]
118 \startstandardmakeup
119 \setupalign[middle]
120 \def\\
121 {\stopcolor
122 \vfil
123 \bfb\setupinterlinespace
124 \startcolor[black]}
125 \bfd\setupinterlinespace
126 \vfil
127 \startcolor[SymbolColor]}
128
129\def\StopTitlePage
130 {\stopcolor
131 \vfil\vfil
132 \stopstandardmakeup
133 \setupinteractionmenu[bottom][state=start]}
134
135
136\def\TitlePage#1
137 {\StartTitlePage#1\StopTitlePage}
138
139\definehead[Topic][chapter]
140\definehead[Nopic][title]
141
142\setuplist
143 [Topic]
144 [criterium=all,
145 alternative=g,
146 interaction=all,
147 after=\blank]
148
149\def\Topics#1
150 {\Nopic{#1}
151 \bgroup
152 \setupinteraction
153 [color=,
154 contrastcolor=]
155 \determinelistcharacteristics[Topic]
156 \ifnum\utilitylistlength>12
157 \startcolumns[n=2]
158 \placelist[Topic]
159 \stopcolumns
160 \else
161 \placelist[Topic]
162 \fi
163 \egroup}
164
165
166
167\let\Subject \Topic
168\let\Subjects\relax
169
170
171
172
173
174
175\startuseMPgraphic{page}
176
177 width := \overlaywidth ;
178 height := \overlayheight ;
179
180 d := 15 ; dd := d ; dd := 10 ;
181
182 def fuzzy (expr p,dx,dy) =
183 (xpart p dxuniformdeviate dx,ypart pdyuniformdeviate dy)
184 enddef ;
185
186 pair ll, lr, ur, ul ;
187
188 ll := (d,d) ;
189 lr := (widthd,d) ;
190 ur := (widthd,heightd) ;
191 ul := (d,heightd) ;
192
193 path p, q, r, s ;
194
195 p := ll.. for i=.1 step .1 until .9 : fuzzy (i[ll,lr],0,dd).. endfor lr ;
196 q := lr.. for i=.1 step .1 until .9 : fuzzy (i[lr,ur],dd,0).. endfor ur ;
197 r := ur.. for i=.1 step .1 until .9 : fuzzy (i[ur,ul],0,dd).. endfor ul ;
198 s := ul.. for i=.1 step .1 until .9 : fuzzy (i[ul,ll],dd,0).. endfor ll ;
199
200 fill unitsquare xscaled width yscaled height withcolor \MPcolor{PageColor} ;
201
202 fill p & q & r & s -- cycle withcolor \MPcolor{TextColor} ;
203
204 color c ; c := \MPcolor{LineColor} ;
205
206 draw p withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
207 draw q withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
208 draw r withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
209 draw s withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
210
211\stopuseMPgraphic
212
213\startuseMPgraphic{itemmark}
214 width := BodyFontSize ; height := width4 ;
215 maxheight := StrutHeight ; line := 3width2 ;
216
217 def fuzzy = (height4)uniformdeviate (height2) enddef ;
218
219 draw
220 ((0,0fuzzy)--(width,heightfuzzy2))
221 shifted (line2,0)
222 withpen pencircle
223 xscaled line yscaled (line4)
224 rotated (25uniformdeviate 10) withcolor \MPcolor{SymbolColor} ;
225
226 setbounds currentpicture to unitsquare xyscaled(width,maxheight) ;
227\stopuseMPgraphic
228
229\startuseMPgraphic{nextmark}
230 LoadPageState ; width := BottomHeight ; height := line := width2 ;
231
232 def fuzzy = (height8)uniformdeviate (height4) enddef ;
233
234 z1 = (0,0fuzzy) ; z2 = (width,height2fuzzy2) ; z3 = (0,heightfuzzy) ;
235
236 draw
237 (z1..{right}z2 & z2{left}..z3)
238 withpen pencircle
239 xscaled line yscaled (line4)
240 rotated 30 withcolor \MPcolor{SymbolColor} ;
241
242 setbounds currentpicture to unitsquare xyscaled(width,height) ;
243\stopuseMPgraphic
244
245\startuseMPgraphic{prevmark}
246 LoadPageState ; width := BottomHeight ; height := line := width2 ;
247
248 def fuzzy = (height8)uniformdeviate (height4) enddef ;
249
250 z1 = (width,0fuzzy) ; z2 = (0,height2fuzzy2) ; z3 = (width,heightfuzzy) ;
251
252 draw
253 (z1..{left}z2 & z2{right}..z3)
254 withpen pencircle
255 xscaled line yscaled (line4)
256 rotated 30 withcolor \MPcolor{SymbolColor} ;
257
258 setbounds currentpicture to unitsquare xyscaled(width,height) ;
259\stopuseMPgraphic
260
261\startuseMPgraphic{stopmark}
262 LoadPageState ; width := BottomHeight ; height := line := width2 ;
263
264 def fuzzy = (height8)uniformdeviate (height4) enddef ;
265
266 z1 = (0,0fuzzy) ;
267 z2 = (width,heightfuzzy) ;
268 z3 = (width,0fuzzy) ;
269 z4 = (0,heightfuzzy) ;
270 z5 = (width2,height2) ;
271
272 drawoptions
273 (withpen pencircle
274 xscaled line yscaled (line4)
275 rotated 30 withcolor \MPcolor{SymbolColor}) ;
276
277 draw z1..{right}z5..z2 ; draw z3..{left}z5..z4 ;
278
279 setbounds currentpicture to unitsquare xyscaled(width,height) ;
280\stopuseMPgraphic
281
282\doifnotmode{demo}{\endinput}
283
284
285
286\starttext
287
288\TitlePage{Title Page\\prewriting}
289
290\Topics{Some Nice Quotes}
291
292\Topic{A Few}
293
294\Subject{Knuth} \input knuth
295\Subject{Tufte} \input tufte
296
297\Topic{Some More}
298
299\Subject{Zapf} \input zapf
300\Subject{Bryson} \input bryson
301
302\stoptext
303 |