1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22\setuppapersize
23 [S44][S44]
24
25\startmode[asintended]
26 \definetypeface[zaphy][cg][calligraphy][chancery]
27 \setupbodyfont[zaphy,cg,12pt]
28\stopmode
29
30\startnotmode[asintended]
31 \setupbodyfont[13pt]
32\stopnotmode
33
34
35
36\setuplayout
37 [backspace=0pt,
38 topspace=0pt,
39 header=0pt,
40 footer=0pt,
41 bottom=0pt,
42 width=middle,
43 height=middle]
44
45
46
47\setuptolerance
48 [verytolerant,stretch]
49
50
51
52
53\setupinteraction
54 [state=start,
55 color=white,
56 contrastcolor=white,
57 style=\underbar,
58 click=no]
59
60
61
62\setupinteractionscreen
63 [option=max]
64
65
66
67\setupcolors
68 [state=start]
69
70\definecolor[white] [s=.8]
71\definecolor[red] [r=.7]
72\definecolor[green] [g=.7]
73\definecolor[blue] [b=.7]
74\definecolor[yellow][r=.7,g=.7]
75
76\definecolor [PageColor][black]
77
78
79
80
81\definecolor [TextColor 0][white]
82\definecolor [TextColor 1][red]
83\definecolor [TextColor 2][green]
84\definecolor [TextColor 3][blue]
85\definecolor [TextColor 4][yellow]
86
87\definecolor [TextColor] [TextColor 0]
88
89
90
91\definelayer
92 [main]
93 [state=repeat]
94
95
96
97\defineoverlay [page] [\reuseMPgraphic{page}]
98\defineoverlay [text] [\useMPgraphic{text}]
99\defineoverlay [next] [\overlaybutton{nextpage}]
100\defineoverlay [prev] [\overlaybutton{previouspage}]
101\defineoverlay [main] [\composedlayer{main}]
102
103
104
105
106
107\setupbackgrounds
108 [paper]
109 [backgroundcolor=Pagecolor,
110 background=page]
111
112\setupbackgrounds
113 [page]
114 [background={page,prev,foreground,main}]
115
116\setupbackgrounds
117 [text]
118 [background=next,
119 backgroundoffset=10pt]
120
121
122
123
124
125
126
127\startuseMPgraphic{text}
128 path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
129 color c ; c := (.7uniformdeviate.3)\MPcolor{TextColor} ;
130 p := p enlarged -1.25pt ;
131 filldraw p withcolor c ;
132 draw p withpen pencircle scaled 2.5pt withcolor .75c ;
133\stopuseMPgraphic
134
135\startreusableMPgraphic{page}
136 path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
137 color c ; c := \MPcolor{PageColor} ;
138 filldraw p enlarged 5pt withcolor c ;
139\stopreusableMPgraphic
140
141
142
143
144
145
146\newcounter\KindOfTopic
147\newdimen \TopicWidth
148
149\defineframedtext
150 [TopicText]
151 [frame=off,
152 offset=10pt,
153 style=bold,
154 width=\TopicWidth,
155 background=text,
156 before=,
157 after=,
158 align=normal]
159
160\def\BeforeTopic
161 {\ifcase\KindOfTopic\relax
162 \TopicWidth=.7\textwidth
163 \definecolor[CharColor][black]
164 \else
165 \getrandomdimen\TopicWidth{.55\textwidth}{.7\textwidth}
166 \definecolor[CharColor][white]
167 \fi
168 \doifmode{reverse}
169 {\setupframedtexts[TopicText][foregroundcolor=CharColor]}
170 \definecolor[TextColor][TextColor \KindOfTopic]
171 \ifcase\KindOfTopic\relax
172 \setuplayer[main][x=.5\textwidth,y=.5\textheight,location=c] \or
173 \setuplayer[main][x=0pt, y=0pt, location=rb] \or
174 \setuplayer[main][x=\textwidth, y=0pt, location=lb] \or
175 \setuplayer[main][x=\textwidth, y=\textheight, location=lt] \or
176 \setuplayer[main][x=0pt, y=\textheight, location=rt] \fi}
177
178\def\AfterTopic
179 {\ifnum\KindOfTopic=4
180 \gdef\KindOfTopic{1}
181 \else
182 \doglobal\increment\KindOfTopic
183 \fi}
184
185\def\StartTopic
186 {\BeforeTopic
187 \startstandardmakeup
188 \setlayer[main] \bgroup \startTopicText[none]
189 }
190
191\def\StopTopic
192 {\stopTopicText \egroup
193 \stopstandardmakeup
194 \AfterTopic}
195
196
197
198\def\StartNopic
199 {\doglobal\newcounter\KindOfTopic
200 \StartTopic
201 \bfd\setupinterlinespace
202 \setupinteraction[color=,contrastcolor=]
203 \def\\{\blank\bfb\setupinterlinespace\def\\{\blank}}
204 \raggedcenter\ignorespaces}
205
206\def\StopNopic
207 {\StopTopic}
208
209\let\StartTitlePage\StartNopic \let\StartColofonPage\StartNopic
210\let\StopTitlePage \StopNopic \let\StopColofonPage \StopNopic
211
212\def\TitlePage #1{\StartTitlePage #1\StopTitlePage}
213\def\ColofonPage#1{\StartColofonPage#1\StopColofonPage}
214
215
216
217\definehead
218 [Title]
219 [title]
220
221\definehead
222 [Subject]
223 [subject]
224
225\setuphead
226 [Title]
227 [style=\bfb,
228 page=,
229 before=,
230 after=\blank]
231
232\setuphead
233 [Subject]
234 [style=\bfa,
235 before=\blank,
236 after=\blank]
237
238\doifnotmode{demo}{\endinput}
239
240\def\Sample #1 {\input #1 \par \rightaligned{ #1 }}
241
242\starttext
243
244\StartNopic The \ConTeXt\ Test Quotes \\ \currentdate \StopNopic
245
246\StartTopic \Sample tufte \StopTopic
247\StartTopic \Sample knuth \StopTopic
248\StartTopic \Sample zapf \StopTopic
249\StartTopic \Sample douglas \StopTopic
250\StartTopic \Sample stork \StopTopic
251\StartTopic \Sample materie \StopTopic
252
253\StartNopic There Will Be Some More \StopNopic
254
255\stoptext
256 |