1
2
3
4
5
6
7
8
9
10
11
12
13
14\setuppapersize
15 [ S 4 4 ] [ S 4 4 ]
16
17\definetypeface [ main ] [ rm ] [ casual ] [ informal ] [ default ]
18
19\setupbodyfont [ main , 1 3 pt ]
20
21\setuplayout
22 [ backspace = 0 pt ,
23 topspace = 0 pt ,
24 header = 0 pt ,
25 footer = 0 pt ,
26 bottom = 0 pt ,
27 width = middle ,
28 height = fit ]
29
30\setupbottom
31 [ style = \ssbf ,
32 color = white ]
33
34\setupfooter
35 [ style = \ssbfb ,
36 color = white ]
37
38\setupinteraction
39 [ state = start ,
40 click = no ]
41
42\setupinteractionscreen
43 [ option = max ]
44
45\definecolor [ white ] [ s = . 8 ]
46\definecolor [ red ] [ r = . 7 ]
47\definecolor [ green ] [ g = . 7 ]
48\definecolor [ blue ] [ b = . 7 ]
49\definecolor [ yellow ] [ r = . 7 , g = . 7 ]
50
51\setupcolors
52 [ state = start ]
53
54\defineoverlay [ page ] [ \reuseMPgraphic { page } ]
55\defineoverlay [ text ] [ \useMPgraphic { text } ]
56\defineoverlay [ continue ] [ \overlaybutton { nextpage } ]
57
58\setupbackgrounds
59 [ paper ]
60 [ background = page ]
61
62\setupbackgrounds
63 [ page ]
64 [ background = { page , continue } ]
65
66\definecolor [ PageColor ] [ black ]
67
68\definecolor [ TextColor 0 ] [ white ]
69\definecolor [ TextColor 1 ] [ red ]
70\definecolor [ TextColor 2 ] [ green ]
71\definecolor [ TextColor 3 ] [ blue ]
72\definecolor [ TextColor 4 ] [ yellow ]
73
74\definecolor [ TextColor ] [ TextColor 0 ]
75
76\defineframedtext
77 [ TopicPage ]
78
79\defineframedtext
80 [ TopicText ]
81
82\setupframedtexts
83 [ TopicPage ]
84 [ width = \textwidth ,
85 height = \textheight ,
86 offset = overlay ]
87
88\setupframedtexts
89 [ TopicText ]
90 [ offset = 1 0 pt ,
91 style = bold ,
92 width = \TopicWidth ,
93 background = text ,
94 align = normal ]
95
96\setupframedtexts
97 [ TopicPage , TopicText ]
98 [ frame = off ,
99 depthcorrection = off ,
100 before = ,
101 after = ]
102
103\newbox \TopicBox
104\newcounter \KindOfTopic
105\newdimen \TopicWidth
106
107\setupinteraction
108 [ color = lightgray ,
109 contrastcolor = lightgray ,
110 style = ]
111
112\def \StartTopic
113 { \definecolor [ TextColor ] [ TextColor \KindOfTopic ]
114 \ifcase \KindOfTopic \relax
115 \TopicWidth = . 7 \textwidth
116 \else
117 \getrandomdimen \TopicWidth { . 5 5 \textwidth } { . 7 \textwidth }
118 \fi
119 \ifcase \KindOfTopic \relax
120 \setupframedtexts [ TopicPage ] [ align = { middle , lohi } ] \or
121 \setupframedtexts [ TopicPage ] [ align = { right , high } ] \or
122 \setupframedtexts [ TopicPage ] [ align = { left , high } ] \or
123 \setupframedtexts [ TopicPage ] [ align = { left , low } ] \or
124 \setupframedtexts [ TopicPage ] [ align = { right , low } ] \fi
125 \setbox \scratchbox = \vbox \bgroup \dontcomplain
126 \noindent \startTopicPage [ none ]
127 \noindent \startTopicText [ none ] }
128
129\def \StopTopic
130 { \stopTopicText
131 \stopTopicPage
132 \egroup
133 \global \setbox \TopicBox = \vbox
134 { \startoverlay
135 { \box \TopicBox } { \box \scratchbox }
136 \stopoverlay }
137 \copy \TopicBox
138 \ifnum \KindOfTopic = 4
139 \def \KindOfTopic { 1 }
140 \else
141 \increment \KindOfTopic
142 \fi
143 \getrandomdimen \TopicWidth { . 5 5 \textwidth } { . 7 \textwidth }
144 \page }
145
146\startuseMPgraphic { text }
147 path p ; p : = unitsquare xyscaled ( OverlayWidth , OverlayHeight ) ;
148 color c ; c : = ( .7 uniformdeviate .3 ) \MPcolor { TextColor } ;
149 p : = p enlarged -1.25 pt ;
150 filldraw p withcolor c ;
151 draw p withpen pencircle scaled 2.5 pt withcolor .75 c ;
152\stopuseMPgraphic
153
154\startreusableMPgraphic { page }
155 path p ; p : = unitsquare xyscaled ( OverlayWidth , OverlayHeight ) ;
156 color c ; c : = \MPcolor { PageColor } ;
157 filldraw p enlarged 5 pt withcolor c ;
158 draw p withpen pencircle scaled 2.5 pt withcolor c ;
159\stopreusableMPgraphic
160
161\def \StartNopic
162 { \def \KindOfTopic { 0 }
163 \StartTopic
164 \bfd \setupinterlinespace
165 \def \\ { \blank \bfb \setupinterlinespace }
166 \raggedcenter }
167
168\def \StopNopic
169 { \StopTopic }
170
171\def \TitlePage # 1
172 { \StartNopic # 1 \StopNopic }
173
174\doifnotmode { demo } { \endinput }
175
176\starttext
177
178\StartNopic
179 a dull talk \\ \currentdate
180\StopNopic
181
182\dorecurse { 1 0 } { \StartTopic \input tufte \StopTopic }
183
184\StartNopic
185 that s it \\ goodbye
186\StopNopic
187
188\stoptext
189 |