s-present-green.mkiv /size: 7959 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=s-present-green, % was s-pre-02
3
%D version=1998.04.21,
4
%D title=\CONTEXT\ Style File,
5
%D subtitle=Presentation Environment Green,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
\startmodule
[
present
-
green
]
15 16
%D Here is another original presentation style, actually the second one we made.
17
%D Not much adaption was needed for \MKIV.
18 19
\usemodule
[
pre
-
general
]
20 21
%D \macros
22
%D {setupbodyfont, switchtobodyfont, setuplayout}
23
%D
24
%D At \PRAGMA\ we prefer using the Lucida Bright fonts, but one can of course load
25
%D another typeface.
26 27
\doifelsemode
{
asintended
}
{
28
\setupbodyfont
[
ludicaot
,
1
4
.
4
pt
]
29
}
{
30
\setupbodyfont
[
pagella
,
1
4
.
4
pt
]
31
}
32 33
\setuplayout
34
[
style
=
smallbodyfont
]
35 36
%D \macros
37
%D {setuppapersize, setuplayout}
38
%D
39
%D The papersize suits the screen dimensions. The layout is rather simple. We use
40
%D the whole width of the screen and only have navigational tools at the bottom of
41
%D the screen.
42 43
\setuppapersize
44
[
S
6
][
S
6
]
45 46
\setuplayout
47
[
backspace
=
1
cm
,
48
topspace
=
1
cm
,
49
margin
=
0
pt
,
50
header
=
0
pt
,
51
footer
=
0
pt
,
52
bottomdistance
=
.
8
7
5
cm
,
53
bottom
=
1
cm
,
54
width
=
fit
,
55
height
=
fit
]
56 57
%D \macros
58
%D {setupwhitespace, setuptyping}
59
%D
60
%D We don't have much height, so we use a more cramped spacing. Verbatim text looks
61
%D better when indented.
62 63
\setupwhitespace
64
[
medium
]
65 66
\setuptyping
67
[
margin
=
standard
]
68 69
%D \macros
70
%D {definecolor}
71
%D
72
%D Of course we enable color. We define some logical colors, of which most default
73
%D to the same green shade.
74 75
\definecolor
[
BackgroundColor
]
[
r
=
.
8
,
g
=
.
8
,
b
=
.
8
]
76
\definecolor
[
OrnamentColor
]
[
r
=
0
,
g
=
.
7
,
b
=
.
4
]
77 78
%D \macros
79
%D {setupinteraction, setupinteractionscreen}
80
%D
81
%D We still have to enable interaction mode. We go full screen!
82 83
\setupinteraction
84
[
state
=
start
,
85
color
=
OrnamentColor
,
86
contrastcolor
=
OrnamentColor
]
87 88
\setupinteractionscreen
89
[
option
=
max
,
90
width
=
fit
,
91
height
=
fit
]
92 93
%D \macros
94
%D {setupitemize}
95
%D
96
%D And why not bring some color in itemizations too?
97 98
\setupitemize
99
[
color
=
OrnamentColor
]
100 101
%D \macros
102
%D {defineoverlay, setupbackgrounds}
103
%D
104
%D The navigational elements and the backgrounds are provided by \METAPOST.
105 106
\startuniqueMPgraphic
{
PageBackground
}
107
fill
unitsquare
108
xyscaled
(
OverlayWidth
,
OverlayHeight
)
109
withcolor
OverlayColor
;
110
draw
unitsquare
111
xyscaled
(
OverlayWidth
,
OverlayHeight
)
112
enlarged
(
-2
*
OverlayLineWidth
)
113
withpen
pencircle
scaled
OverlayLineWidth
114
withcolor
OverlayLineColor
;
115
\stopuniqueMPgraphic
116 117
\defineoverlay
118
[
PageBackground
]
119
[
\uniqueMPgraphic
{
PageBackground
}
]
120 121
\setupbackgrounds
122
[
page
]
123
[
background
=
PageBackground
,
124
backgroundcolor
=
BackgroundColor
,
125
rulethickness
=
.
1
2
5
cm
,
126
framecolor
=
OrnamentColor
]
127 128
%D \macros
129
%D {setuptexttexts}
130
%D
131
%D By clicking on the text area, one goes to the next page. We hook this feature
132
%D into the text backgrounds.
133 134
\startuniqueMPgraphic
{
TextBackground
}
135
draw
unitsquare
136
xyscaled
(
OverlayWidth
,
OverlayHeight
)
137
enlarged
(
4
*
OverlayLineWidth
)
138
withpen
pencircle
scaled
OverlayLineWidth
139
withcolor
OverlayLineColor
;
140
\stopuniqueMPgraphic
141 142
\defineoverlay
143
[
TextBackground
]
144
[
\uniqueMPgraphic
{
TextBackground
}
]
145 146
\defineoverlay
147
[
NextPage
]
148
[
\overlaybutton
{
nextpage
}
]
149 150
\setupbackgrounds
151
[
text
]
152
[
background
=
{
TextBackground
,
NextPage
}
,
153
backgroundcolor
=
BackgroundColor
,
154
rulethickness
=
.
0
6
2
5
cm
,
155
framecolor
=
OrnamentColor
]
156 157
%D \macros
158
%D {setupinteractionmenu,startinteractionmenu}
159
%D
160
%D At the bottom of the screen, we show three buttons. These direct us to the
161
%D previous or next jump or exit the document.
162 163
\setupMPvariables
[
RightArrow
][
height
=
\bottomheight
]
164
\setupMPvariables
[
LeftArrow
]
[
height
=
\bottomheight
]
165
\setupMPvariables
[
Circle
]
[
height
=
\bottomheight
]
166
\setupMPvariables
[
UpArrow
]
[
height
=
\bottomheight
]
167 168
\startuniqueMPgraphic
{
RightArrow
}
{
height
}
169
fill
righttriangle
xysized
(
\MPvar
{
height
}
,
\MPvar
{
height
}
)
170
withpen
pencircle
scaled
(
\MPvar
{
height
}
/
5
)
171
withcolor
"
OrnamentColor
"
;
172
\stopuniqueMPgraphic
173 174
\startuniqueMPgraphic
{
LeftArrow
}
{
height
}
175
fill
lefttriangle
xysized
(
\MPvar
{
height
}
,
\MPvar
{
height
}
)
176
withpen
pencircle
scaled
(
\MPvar
{
height
}
/
5
)
177
withcolor
"
OrnamentColor
"
;
178
\stopuniqueMPgraphic
179 180
\startuniqueMPgraphic
{
Circle
}
{
height
}
181
fill
fullcircle
sized
\MPvar
{
height
}
182
withpen
pencircle
scaled
(
\MPvar
{
height
}
/
5
)
183
withcolor
"
OrnamentColor
"
;
184
\stopuniqueMPgraphic
185 186
\startuniqueMPgraphic
{
UpArrow
}
{
height
}
187
fill
uptriangle
xysized
(
\MPvar
{
height
}
,
\MPvar
{
height
}
)
188
withpen
pencircle
scaled
(
\MPvar
{
height
}
/
5
)
189
withcolor
"
OrnamentColor
"
;
190
\stopuniqueMPgraphic
191 192
\setupinteractionmenu
193
[
bottom
]
194
[
state
=
start
,
195
frame
=
off
,
196
width
=
.
3
\textwidth
,
197
height
=
\bottomheight
]
198 199
\setupinteraction
200
[
menu
=
on
]
201 202
\def
\WhateverButton
203
{
\doifreferencefoundelse
{
Whatever
}
204
{
\raw
[
Whatever
]
\uniqueMPgraphic
{
UpArrow
}
\\
}
205
{}}
206 207
\startinteractionmenu
[
bottom
]
208
\but
[
Topics
]
\\
% secret button
209
\hfill
210
\WhateverButton
% user specific
211
\kern
2
\bottomheight
212
\raw
[
previouspage
]
\uniqueMPgraphic
{
LeftArrow
}
\\
213
\kern
.
5
\bottomheight
214
\raw
[
CloseDocument
]
\uniqueMPgraphic
{
Circle
}
\\
215
\kern
.
5
\bottomheight
216
\raw
[
nextpage
]
\uniqueMPgraphic
{
RightArrow
}
\\
217
\kern
.
5
\bottomheight
218
\stopinteractionmenu
219 220
%D \macros
221
%D {TitlePage, Topics, Topic, Subject}
222
%D
223
%D A presentation after loading this module looks like:
224
%D
225
%D \starttyping
226
%D \TitlePage {About Whatever\\Topics}
227
%D
228
%D \Topics {Todays Talk}
229
%D
230
%D \Topic {Some topic}
231
%D
232
%D .....
233
%D
234
%D \Topic {Next Topic}
235
%D
236
%D .....
237
%D \stoptyping
238 239
%D \macros
240
%D {StartTitlePage, TitlePage}
241
%D
242
%D The titlepage is rather simple and can be typeset in two
243
%D ways:
244
%D
245
%D \starttyping
246
%D \StartTitlePage
247
%D text \\ text \\ text
248
%D \StopTitlepage
249
%D \stoptyping
250
%D
251
%D or as one||liner:
252
%D
253
%D \starttyping
254
%D \TitlePage{text\\text\\text}
255
%D \stoptyping
256
%D
257
%D The first alternative can be used for more complicated title pages.
258 259
\unexpanded
\def
\StartTitlePage
260
{
\startstandardmakeup
261
\bfd
\setupinterlinespace
262
\setupalign
[
middle
]
263
\vfil
264
\let
\\
=
\vfil
}
265 266
\unexpanded
\def
\StopTitlePage
267
{
\vfil\vfil\vfil
268
\stopstandardmakeup
}
269 270
\unexpanded
\def
\TitlePage
#
1
%
271
{
\StartTitlePage
#
1
\StopTitlePage
}
272 273
%D \macros
274
%D {definehead}
275
%D
276
%D The commands \type{\Topic} and \type{\Subject} are defined as copies of head. We
277
%D use \type{\Nopic} for internal purposes.
278 279
\definehead
[
Topic
]
[
chapter
]
280
\definehead
[
Subject
]
[
section
]
281 282
\definehead
[
Nopic
]
[
title
]
283 284
%D \macros
285
%D {setuphead}
286
%D
287
%D We use our own command for typesetting the titles. We hide sectionnumbers from
288
%D viewing. Each topic is followed by a list of subjects that belong to the topic.
289 290
\setuphead
291
[
Topic
,
Nopic
]
292
[
after
=
{
\blank
[
3
*
medium
]
}
,
293
number
=
no
,
294
style
=
\bfb
,
295
page
=
yes
,
296
alternative
=
middle
]
297 298
\setuphead
299
[
Subject
]
300
[
after
=
\blank
,
301
number
=
no
,
302
page
=
yes
,
303
continue
=
no
,
304
style
=
\tfa
]
305 306
%D \macros
307
%D {setuplist}
308
%D
309
%D When found, the subject list is automatically placed after the topic head.
310 311
\setuplist
312
[
Topic
,
Subject
]
313
[
alternative
=
g
,
314
interaction
=
all
,
315
before
=
,
316
after
=]
317 318
\setuplist
319
[
Topic
]
320
[
criterium
=
all
]
321 322
\unexpanded
\def
\Topics
#
1
%
323
{
\determinelistcharacteristics
[
Topic
]
324
\doifmode
{
*
list
}
325
{
\Nopic
[
Topics
]
{
#
1
}
326
\startcolumns
327
\placelist
[
Topic
]
328
\stopcolumns
}}
329 330
\setuplist
331
[
Subject
]
332
[
criterium
=
Topic
]
333 334
\unexpanded
\def
\Subjects
335
{
\determinelistcharacteristics
[
Subject
]
336
\doifmode
{
*
list
}
337
{
\placelist
[
Subject
]
}}
338 339
\setuphead
340
[
Topic
]
341
[
after
=
{
\blank
[
3
*
medium
]
\Subjects
}
]
342 343
\stopmodule
344 345
\continueifinputfile
{
s
-
present
-
green
.
mkiv
}
346 347
\usemodule
[
present
-
common
]
348 349
\inputpresentationfile
{
examples
/
present
-
green
-
0
0
1
.
tex
}
350