summaryrefslogtreecommitdiff
path: root/tex/context/modules/common/s-pre-10.tex
blob: a92e5af01c5a2c8fa01f8cfd1015c9d85ee5fa00 (plain)
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
%D \module
%D   [      file=s-pre-10,
%D        version=unknown,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Environment 10,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%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 This style is derived from the ninth style, which was
%D used first at \EUROTEX\ 99 and later at \TUG\ 2000. This
%D alternative build up a page.

\startmode [demo]
  \disablemode[demo] \usemodule[pre-09] \enablemode[demo]
\stopmode

\startnotmode [demo]
  \usemodule[pre-09]
\stopnotmode

%D We use blue colors instead of yellow ones. Since we have
%D used symbolic names, we can easily overload the existing
%D scheme.

\definecolor[LineColor][r=.40,g=.40,b=1.00]

%D Here we don't use fixed dimensions, but fit the sample
%D windows and derive the text windows's width from this one.

\setupframedtexts
  [SampleText]
  [width=fit,height=fit,
   background={background,nextpage}]

%D The topic goes to the top right corner of the screen which
%D means that it is positioned left down to the reference
%D point. Watch how we make data on this layer (here only
%D the topic but it can be more) persistent.

\setuplayer
  [topic]
  [y=0pt,x=\makeupwidth,location=lb,state=repeat,
   hoffset=-\FrameSkip,voffset=\FrameSkip]

%D Clicking on the page brings us back.

\setupbackgrounds
  [page]
  [background={previouspage,color,topic}]

%D All layers end up on the text area. This could have been
%D the page area too since these have the same dimensions.

\setupbackgrounds
  [text]
  [background={common,sample,text}]

%D Because we build up the text window step by step, we will
%D separate the entries by white space.

\startsetups [always]
  \setupwhitespace[big]
  \setupblank[big]
\stopsetups

%D The \type {\Topic} commands can be simplified to:

\def\Topic#1%
  {\resetlayer[topic]
   \setlayer[topic]{\bfb\setstrut\color[TextColor]{#1}}}

%D We also provide a way to erase the topic.

\def\NoTopic
  {\resetlayer[topic]}

%D We have to redefine the structuring commands to support
%D the resetting of buffer counters.

\newcounter\TextN

\def\StartSample
  {\doglobal\newcounter\TextN
   \dostartbuffer[sample][StartSample][StopSample]}

\def\StartText
  {\doglobal\newcounter\TextN
   \dostartbuffer[text][StartText][StopText]}

\def\StartSubText
  {\doglobal\increment\TextN
   \dostartbuffer[text-\TextN][StartSubText][StopSubText]}

\def\StopText
  {\startstandardmakeup
     \DoSampleText{text}{common}{nextpage}
   \stopstandardmakeup}

\def\StopSubText
  {\startstandardmakeup
     \DoSampleText{text}{common}{nextpage}
   \stopstandardmakeup}

%D The \type {\DoSampleText} command is adapted to support
%D addition of subtexts (each subtext goes into its own
%D buffer).

\def\DoSampleText#1#2#3%
  {\setupframedtexts[SampleText][background={background,#3}]
   \bgroup
   \setups[#1]%
   \setups[always]%
   \setbox\nextbox=\hbox
     {\startSampleText[none]
        \getbuffer[#1]\par
        \doif{#1}{text}
          {\dorecurse{\TextN}{\getbuffer[text-\recurselevel]\par}}
      \stopSampleText}
   \xdef\SampleTextWidth{\the\wd\nextbox}
   \setlayer[#2]{\box\nextbox}%
   \egroup}

%D Since we are no longer swapping windows, we end up with a
%D much simplier \type {\Stopidea} macro. We don't reset
%D samples at the inner level.

\def\StartIdea%
  {\bgroup
   \let\StopSample \relax
   \let\StopText   \relax
   \let\StopSubText\relax
   \def\StartSample{\dostartbuffer[sample][StartSample][StopSample]}}

\def\StopIdea%
  {\startstandardmakeup
     \DoSampleText{sample}{sample}{nextpage}
     \SetTextWidth
     \DoSampleText{text}  {text}  {nextpage}
   \stopstandardmakeup
   \egroup}

%D Here we determine the width of the text window. It is
%D derived from the width of the sample and stays the same
%D within a sequence.

\def\SetTextWidth
  {\ifnum\TextN<1 % yes or no, may change
     \scratchdimen=\makeupwidth
     \advance\scratchdimen by -\SampleTextWidth
     \advance\scratchdimen by  \FrameSkip
     \xdef\SampleWidth{\the\scratchdimen}%
   \fi
   \setupframedtexts
     [SampleText]
     [width=\SampleWidth]}

%D We use the (already implemented) second alternative of
%D the titlepage graphic. Please don't change this.

\defineoverlay[joke] [\useMPgraphic{joke}{n=1}] % not to be changed !

\doifnotmode{demo}{\endinput}

%D The demo section. The original presentation uses proper
%D graphics and has better spacing.

\def\SomeSymbol#1#2{\definedfont[ContextNavigation at #1]\char#2}

\setupcombinations[distance=\FrameOffset,inbetween=\vskip\FrameOffset]

\starttext

\TitlePage{Some Famous Symbols}

\Topic{Symbols}

\StartSample
  \startcombination[2*2]
    {\SomeSymbol{5cm}{1}} {}
    {\SomeSymbol{5cm}{3}} {}
    {\SomeSymbol{5cm}{2}} {}
    {\SomeSymbol{5cm}{4}} {}
  \stopcombination
\StopSample

\Topic{Previous}

\StartIdea
  \StartSample
    \SomeSymbol{7cm}{1}
  \StopSample
  \StartText
    This symbol can be used to indicate a hyperlink to a
    previous page.
  \StopText
\StopIdea

\StartIdea
  \StartSubText
    As one can expect there is also a symbol for going to
    the next page.
  \StopSubText
\StopIdea

\Topic{Previous}

\StartIdea
  \StartSample
    \SomeSymbol{9cm}{2}
  \StopSample
  \StartText
     This symbol is actually just a mirrored version of the
     first symbol we showed.
  \StopText
\StopIdea

\NoTopic

\StartText
  Is this nice or not?
\StopText

\Topic{First and Last}

\StartSample
  \SomeSymbol{11cm}{3}
\StopSample

\StartSample
  \SomeSymbol{11cm}{4}
\StopSample

\StartIdea
  \StartSample
    \SomeSymbol{5cm}{3}
  \StopSample
  \StartText
    A few screens back, we saw this symbol.
  \StopText
\StopIdea

\StartIdea
  \StartSubText
    This symbol represents the beginning of something.
  \StopSubText
\StopIdea

\StartIdea
  \StartSample
    \SomeSymbol{5cm}{4}
  \StopSample
  \StartSubText
    Just like this one represents an end.
  \StopSubText
\StopIdea

\StartIdea
  \StartSubText
    They look just like the symbols found on audio and
    video players.
  \StopSubText
\StopIdea

\Topic{Summary}

\StartIdea
  \StartSample
    \SomeSymbol{6cm}{1}
  \StopSample
  \StartText
    So we have a symbol for previous \unknown
  \StopText
\StopIdea

\StartIdea
  \StartSample
    \SomeSymbol{6cm}{2}
  \StopSample
  \StartSubText
    \unknown\ and one for next \unknown
  \StopSubText
\StopIdea

\StartIdea
  \StartSample
    \SomeSymbol{6cm}{3}
  \StopSample
  \StartSubText
    \unknown\ and yet another for first \unknown
  \StopSubText
\StopIdea

\StartIdea
  \StartSample
    \SomeSymbol{6cm}{4}
  \StopSample
  \StartSubText
    \unknown\ and of course for last.
  \StopSubText
\StopIdea

\stoptext