s-pre-07.tex /size: 5570 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=s-pre-07,
3
%D version=1999.08.20,
4
%D title=\CONTEXT\ Style File,
5
%D subtitle=Presentation Environment 7,
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
%D This style was made for the \NTS\ presentation at
15
%D \EUROTEX\ 1999. It's a wink to programming in a webbed way.
16
%D This is just one way of implementing such a style. Today
17
%D we have more \METAPOST\ interfacing available, and
18
%D thereby moore tools and alternative ways to reach such a
19
%D goal. I must admit that the main macro looks fuzzy. On
20
%D the other hand, the presentation can look quite structured.
21
%D
22
%D \starttyping
23
%D \Topics{...}
24
%D
25
%D \StartIdeas
26
%D \Topic{...}
27
%D \StartIdea ... \StopIdea
28
%D \StartIdea ... \StopIdea
29
%D \StopIdeas
30
%D \stoptyping
31 32
\startmode
[
asintended
]
\setupbodyfont
[
lbr
]
\stopmode
33 34
\setupbodyfont
[
1
4
.
4
pt
]
35 36
\usemodule
37
[
abr
-
0
2
]
38 39
\setuppapersize
40
[
S
6
][
S
6
]
41 42
\setuplayout
43
[
topspace
=
0
cm
,
44
backspace
=
0
cm
,
45
header
=
0
pt
,
46
footer
=
0
pt
,
47
width
=
middle
,
48
height
=
middle
]
49 50
\setupinteractionscreen
51
[
option
=
max
]
52 53
%D In order to prevent loops due to random placement, we
54
%D keep the random seed reasonable constant.
55 56
\setupsystem
57
[
random
=
big
]
58 59
\setupcolors
60
[
state
=
start
]
61 62
\definecolor
[
gray
]
[
s
=
.
4
]
63
\definecolor
[
lightgray
][
s
=
.
9
]
64 65
\definecolor
[
red
]
[
r
=
.
4
]
\definecolor
[
cyan
]
[
g
=
.
4
,
b
=
.
4
]
66
\definecolor
[
green
][
g
=
.
4
]
\definecolor
[
magenta
][
r
=
.
4
,
b
=
.
4
]
67
\definecolor
[
blue
]
[
b
=
.
4
]
\definecolor
[
yellow
]
[
r
=
.
4
,
g
=
.
4
]
68 69
\definecolor
[
PageColor
][
gray
]
70
\definecolor
[
TextColor
][
lightgray
]
71
\definecolor
[
LineColor
][
yellow
]
72 73
\definecolor
[
linecolor
1
][
red
]
\definecolor
[
linecolor
5
][
cyan
]
74
\definecolor
[
linecolor
2
][
green
]
\definecolor
[
linecolor
6
][
magenta
]
75
\definecolor
[
linecolor
3
][
blue
]
\definecolor
[
linecolor
4
][
yellow
]
76 77
\setupinteraction
78
[
state
=
start
,
79
display
=
new
,
80
color
=
LineColor
,
81
contrastcolor
=
LineColor
]
82 83
\startuseMPgraphic
{
shape
}
84
path
p
;
color
c
,
w
;
numeric
width
,
height
;
85
c
:
=
\MPcolor
{
LineColor
}
;
w
:
=
\MPcolor
{
TextColor
}
;
86
width
:
=
\overlaywidth
;
height
:
=
\overlayheight
;
87
pickup
pencircle
scaled
.5
cm
;
88
p
:
=
unitcircle
89
xscaled
\MPw
{
\Idea
}
yscaled
\MPh
{
\Idea
}
90
shifted
\MPxy
{
\Idea
}
;
91
for
z
=
(
0
,
.5
height
)
,
(
width
,
.5
height
)
,
(
.5
width
,
0
)
,
(
.5
width
,
height
)
,
92
(
0
,
0
)
,
(
width
,
height
)
,
(
0
,
height
)
,
(
width
,
0
)
:
93
draw
center
p
--
z
withcolor
c
;
94
endfor
;
95
fill
p
withcolor
w
;
96
draw
p
withcolor
c
;
97
p
:
=
unitcircle
98
xscaled
\MPw
{
\Page
}
yscaled
\MPh
{
\Page
}
99
shifted
\MPxy
{
\Page
}
;
100
pickup
pencircle
scaled
.25
cm
;
101
fill
p
withcolor
w
;
102
draw
p
withcolor
c
;
103
draw
unitsquare
xscaled
width
yscaled
height
withcolor
c
;
104
\stopuseMPgraphic
105 106
\defineoverlay
[
shape
]
[
\useMPgraphic
{
shape
}
]
107
\defineoverlay
[
nextpage
]
[
\overlaybutton
{
nextpage
}
]
108
\defineoverlay
[
previouspage
]
[
\overlaybutton
{
previouspage
}
]
109
\defineoverlay
[
content
]
[
\overlaybutton
{
content
}
]
110
\defineoverlay
[
forward
]
[
\overlaybutton
{
forward
}
]
111 112
\setupbackgrounds
113
[
page
]
114
[
background
=
{
color
,
previouspage
,
shape
}
,
115
backgroundcolor
=
PageColor
]
116 117
\def
\StartIdea
%
118
{
\xdef
\Idea
{
idea
:
\realfolio
}
119
\xdef
\Page
{
page
:
\realfolio
}
120
\startstandardmakeup
121
\dontcomplain
122
\vbox
to
\makeupheight
\bgroup
123
\getrandomdimen
\scratchdimen
{
7
5
pt
}{
6
0
0
pt
}
\vskip
0
pt
plus
\scratchdimen
124
\hbox
to
\makeupwidth
\bgroup
125
\getrandomdimen
\scratchdimen
{
7
5
pt
}{
6
0
0
pt
}
\hskip
0
pt
plus
\scratchdimen
126
\hpos
{
idea
:
\realfolio
}
\bgroup
127
\framed
128
[
width
=
.
6
\hsize
,
height
=
fit
,
offset
=
2
cm
,
align
=
middle
,
129
frame
=
off
,
strut
=
no
,
background
=
forward
]
130
\bgroup
131
\setupwhitespace
[
big
]
}
132 133
\def
\StopIdea
%
134
{
\egroup
135
\egroup
136
\getrandomdimen
\scratchdimen
{
7
5
pt
}{
6
0
0
pt
}
\hskip
0
pt
plus
\scratchdimen
137
\egroup
138
\getrandomdimen
\scratchdimen
{
7
5
pt
}{
6
0
0
pt
}
\vskip
0
pt
plus
\scratchdimen
139
\egroup
140
\ifx
\CurrentTopic
\empty
\else
141
\vskip
-
\makeupheight
142
\vbox
to
\makeupheight
143
{
\vfill
144
\ifx
\CurrentListTopic
\empty
\else
145
\writetolist
[
Topic
]
{}{
\CurrentListTopic
}
146
\fi
147
\hbox
to
\makeupwidth
148
{
\hfill
149
\hpos
{
page
:
\realfolio
}
150
{
\framed
151
[
offset
=
.
5
cm
,
frame
=
off
,
background
=
content
]
152
{
\bf
\ignorespaces
\CurrentTopic
\unskip
}}
%
153
\hskip
.
5
cm
}
154
\vskip
.
5
cm
}
155
\fi
156
\stopstandardmakeup
157
\let
\CurrentListTopic
\empty
}
158 159
\definelist
160
[
Topic
]
161 162
\setuplist
163
[
Topic
]
164
[
alternative
=
f
,
165
expansion
=
command
]
166 167
\let
\CurrentTopic
\empty
168
\let
\CurrentListTopic
\empty
169 170
\long\def
\StartTopic
#
1
\StopTopic
171
{
\long\def
\CurrentTopic
{
#
1
}
172
\let
\CurrentListTopic
\CurrentTopic
}
173 174
\def
\Topic
#
1
%
175
{
\StartTopic
#
1
\StopTopic
}
176 177
\def
\Topics
#
1
%
178
{
\StartIdeas
179
\def
\CurrentTopic
{
#
1
}
180
\StartIdea
181
\pagereference
[
content
]
182
\placelist
[
Topic
][
criterium
=
all
]
183
\StopIdea
184
\StopIdeas
}
185 186
\newcounter
\CurrentIdeas
187 188
\def
\StartIdeas
%
189
{
\ifnum
\CurrentIdeas
=
6
\doglobal
\newcounter
\CurrentIdeas
\fi
190
\doglobal
\increment
\CurrentIdeas
191
\definecolor
[
LineColor
][
linecolor
\CurrentIdeas
]
}
192 193
\def
\StopIdeas
%
194
{}
195 196
\doifnotmode
{
demo
}{
\endinput
}
197 198
%D The (rather silly) demo section.
199 200
\starttext
201 202
\Topics
{
This
is
about
\unknown
}
203 204
\StartIdeas
205
\Topic
{
Some
topic
}
206
\StartIdea
An
idea
\unknown
\StopIdea
207
\StartIdea
\unknown
\
and
another
\StopIdea
208
\StopIdeas
209 210
\stoptext
211 212 213