1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
|
%D \module
%D [ file=s-pre-26,
%D version=2001.02.18,
%D title=\CONTEXT\ Style File,
%D subtitle=Presentation Environment 26,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
%D modes: reverse
%D This is a nice and simple style, written in februari
%D 2001. It uses a square papersize, derived from \type {S4}.
%D Because this style is meant to be used with Zapf
%D Chancery, I dedicate this style to Volker Schaa, a fan of
%D Zapf.
\setuppapersize
[S44][S44]
\startmode[asintended]
\definetypeface[zaphy][cg][calligraphy][chancery]
\setupbodyfont[zaphy,cg,12pt]
\stopmode
\startnotmode[asintended]
\setupbodyfont[13pt]
\stopnotmode
%D We use the whole page.
\setuplayout
[backspace=0pt,
topspace=0pt,
header=0pt,
footer=0pt,
bottom=0pt,
width=middle,
height=middle]
%D We will be very tolerant in alignment.
\setuptolerance
[verytolerant,stretch]
%D Of course use navigation, but we hide the in this case
%D ugly reverse video hyper spot.
\setupinteraction
[state=start,
color=white,
contrastcolor=white,
style=\underbar,
click=no]
%D This style looks best in a dark room, full screen.
\setupinteractionscreen
[option=max]
%D We use colors and remap a couple of standard colors.
\setupcolors
[state=start]
\definecolor[white] [s=.8]
\definecolor[red] [r=.7]
\definecolor[green] [g=.7]
\definecolor[blue] [b=.7]
\definecolor[yellow][r=.7,g=.7]
\definecolor [PageColor][black]
%D These colors will cyclic be assigned to \type
%D {TextColor}.
\definecolor [TextColor 0][white]
\definecolor [TextColor 1][red]
\definecolor [TextColor 2][green]
\definecolor [TextColor 3][blue]
\definecolor [TextColor 4][yellow]
\definecolor [TextColor] [TextColor 0]
%D We will collect everything in a layer.
\definelayer
[main]
[state=repeat]
%D We have quite some overlays.
\defineoverlay [page] [\reuseMPgraphic{page}]
\defineoverlay [text] [\useMPgraphic{text}]
\defineoverlay [next] [\overlaybutton{nextpage}]
\defineoverlay [prev] [\overlaybutton{previouspage}]
\defineoverlay [main] [\composedlayer{main}]
%D These end up as paper, page and text backgrounds. We need
%D to locate the foreground, otherwise hyperlinks will not
%D work.
\setupbackgrounds % otherwise in acrobat 5 rounding error
[paper] % and one pixel white line
[backgroundcolor=Pagecolor,
background=page]
\setupbackgrounds
[page]
[background={page,prev,foreground,main}]
\setupbackgrounds
[text]
[background=next,
backgroundoffset=-10pt]
%D This means that clicking on the center brings you to the
%D next page, while clicking on teh page frame brings you one
%D page back.
%D As usual, the graphics are handled by \METAPOST:
\startuseMPgraphic{text}
path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
color c ; c := (.7+uniformdeviate.3)*\MPcolor{TextColor} ;
p := p enlarged -1.25pt ;
filldraw p withcolor c ;
draw p withpen pencircle scaled 2.5pt withcolor .75c ;
\stopuseMPgraphic
\startreusableMPgraphic{page}
path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
color c ; c := \MPcolor{PageColor} ;
filldraw p enlarged 5pt withcolor c ; % bleeding
\stopreusableMPgraphic
%D The text is typeset in a framed text. We cycle trough the
%D colors by means of a counter. This counter also determines
%D the positioning on the main layer. The width is slightly
%D random.
\newcounter\KindOfTopic % and cycle through corners
\newdimen \TopicWidth % with randomized widths
\defineframedtext
[TopicText]
[frame=off,
offset=10pt,
style=bold,
width=\TopicWidth,
background=text,
before=,
after=,
align=normal]
\def\BeforeTopic
{\ifcase\KindOfTopic\relax
\TopicWidth=.7\textwidth
\definecolor[CharColor][black]
\else
\getrandomdimen\TopicWidth{.55\textwidth}{.7\textwidth}
\definecolor[CharColor][white]
\fi
\doifmode{reverse}
{\setupframedtexts[TopicText][foregroundcolor=CharColor]}
\definecolor[TextColor][TextColor \KindOfTopic]
\ifcase\KindOfTopic\relax
\setuplayer[main][x=.5\textwidth,y=.5\textheight,location=c] \or
\setuplayer[main][x=0pt, y=0pt, location=rb] \or
\setuplayer[main][x=\textwidth, y=0pt, location=lb] \or
\setuplayer[main][x=\textwidth, y=\textheight, location=lt] \or
\setuplayer[main][x=0pt, y=\textheight, location=rt] \fi}
\def\AfterTopic
{\ifnum\KindOfTopic=4
\gdef\KindOfTopic{1}
\else
\doglobal\increment\KindOfTopic
\fi}
\def\StartTopic
{\BeforeTopic
\startstandardmakeup
\setlayer[main] \bgroup \startTopicText[none]
}%\setupwhitespace[big]} % generates an empty line
\def\StopTopic
{\stopTopicText \egroup
\stopstandardmakeup
\AfterTopic}
%D The title and colofon page are centered on the page.
\def\StartNopic
{\doglobal\newcounter\KindOfTopic % centered at the page
\StartTopic
\bfd\setupinterlinespace
\setupinteraction[color=,contrastcolor=]%
\def\\{\blank\bfb\setupinterlinespace\def\\{\blank}}%
\raggedcenter\ignorespaces}
\def\StopNopic
{\StopTopic}
\let\StartTitlePage\StartNopic \let\StartColofonPage\StartNopic
\let\StopTitlePage \StopNopic \let\StopColofonPage \StopNopic
\def\TitlePage #1{\StartTitlePage #1\StopTitlePage}
\def\ColofonPage#1{\StartColofonPage#1\StopColofonPage}
%D We provide a minimum of title commands.
\definehead
[Title]
[title]
\definehead
[Subject]
[subject]
\setuphead
[Title]
[style=\bfb,
page=,
before=,
after=\blank]
\setuphead
[Subject]
[style=\bfa,
before=\blank,
after=\blank]
\doifnotmode{demo}{\endinput}
\def\Sample #1 {\input #1 \par \rightaligned{--- #1 ---}}
\starttext
\StartNopic The \ConTeXt\ Test Quotes \\ \currentdate \StopNopic
\StartTopic \Sample tufte \StopTopic
\StartTopic \Sample knuth \StopTopic
\StartTopic \Sample zapf \StopTopic
\StartTopic \Sample douglas \StopTopic
\StartTopic \Sample stork \StopTopic
\StartTopic \Sample materie \StopTopic
\StartNopic There Will Be Some More \StopNopic
\stoptext
|