summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/s-present-green.mkiv
blob: e62257ff38384cb29a8409202a6586bd61b06e1f (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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
%D \module
%D   [      file=s-present-green, % was s-pre-02
%D        version=1998.04.21,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Environment Green,
%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.

\startmodule[present-green]

%D Here is another original presentation style, actually the second one we made.
%D Not much adaption was needed for \MKIV.

\usemodule[pre-general]

%D \macros
%D   {setupbodyfont, switchtobodyfont, setuplayout}
%D
%D At \PRAGMA\ we prefer using the Lucida Bright fonts, but one can of course load
%D another typeface.

\doifelsemode {asintended} {
    \setupbodyfont[ludicaot,14.4pt]
} {
    \setupbodyfont[pagella,14.4pt]
}

\setuplayout
  [style=smallbodyfont]

%D \macros
%D   {setuppapersize, setuplayout}
%D
%D The papersize suits the screen dimensions. The layout is rather simple. We use
%D the whole width of the screen and only have navigational tools at the bottom of
%D the screen.

\setuppapersize
  [S6][S6]

\setuplayout
  [backspace=1cm,
   topspace=1cm,
   margin=0pt,
   header=0pt,
   footer=0pt,
   bottomdistance=.875cm,
   bottom=1cm,
   width=fit,
   height=fit]

%D \macros
%D   {setupwhitespace, setuptyping}
%D
%D We don't have much height, so we use a more cramped spacing. Verbatim text looks
%D better when indented.

\setupwhitespace
  [medium]

\setuptyping
  [margin=standard]

%D \macros
%D   {definecolor}
%D
%D Of course we enable color. We define some logical colors, of which most default
%D to the same green shade.

\definecolor [BackgroundColor] [r=.8, g=.8, b=.8]
\definecolor [OrnamentColor]   [r= 0, g=.7, b=.4]

%D \macros
%D   {setupinteraction, setupinteractionscreen}
%D
%D We still have to enable interaction mode. We go full screen!

\setupinteraction
  [state=start,
   color=OrnamentColor,
   contrastcolor=OrnamentColor]

\setupinteractionscreen
  [option=max,
   width=fit,
   height=fit]

%D \macros
%D   {setupitemize}
%D
%D And why not bring some color in itemizations too?

\setupitemize
  [color=OrnamentColor]

%D \macros
%D   {defineoverlay, setupbackgrounds}
%D
%D The navigational elements and the backgrounds are provided by \METAPOST.

\startuniqueMPgraphic{PageBackground}
    fill unitsquare
        xyscaled(OverlayWidth,OverlayHeight)
        withcolor OverlayColor ;
    draw unitsquare
        xyscaled(OverlayWidth,OverlayHeight)
        enlarged (-2*OverlayLineWidth)
        withpen pencircle scaled OverlayLineWidth
        withcolor OverlayLineColor ;
\stopuniqueMPgraphic

\defineoverlay
  [PageBackground]
  [\uniqueMPgraphic{PageBackground}]

\setupbackgrounds
  [page]
  [background=PageBackground,
   backgroundcolor=BackgroundColor,
   rulethickness=.125cm,
   framecolor=OrnamentColor]

%D \macros
%D   {setuptexttexts}
%D
%D By clicking on the text area, one goes to the next page. We hook this feature
%D into the text backgrounds.

\startuniqueMPgraphic{TextBackground}
    draw unitsquare
        xyscaled(OverlayWidth,OverlayHeight)
        enlarged (4*OverlayLineWidth)
        withpen pencircle scaled OverlayLineWidth
        withcolor OverlayLineColor ;
\stopuniqueMPgraphic

\defineoverlay
  [TextBackground]
  [\uniqueMPgraphic{TextBackground}]

\defineoverlay
  [NextPage]
  [\overlaybutton{nextpage}]

\setupbackgrounds
  [text]
  [background={TextBackground,NextPage},
   backgroundcolor=BackgroundColor,
   rulethickness=.0625cm,
   framecolor=OrnamentColor]

%D \macros
%D   {setupinteractionmenu,startinteractionmenu}
%D
%D At the bottom of the screen, we show three buttons. These direct us to the
%D previous or next jump or exit the document.

\setupMPvariables[RightArrow][height=\bottomheight]
\setupMPvariables[LeftArrow] [height=\bottomheight]
\setupMPvariables[Circle]    [height=\bottomheight]
\setupMPvariables[UpArrow]   [height=\bottomheight]

\startuniqueMPgraphic{RightArrow}{height}
    fill righttriangle xysized(\MPvar{height},\MPvar{height})
        withpen pencircle scaled (\MPvar{height}/5)
        withcolor "OrnamentColor" ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{LeftArrow}{height}
    fill lefttriangle xysized(\MPvar{height},\MPvar{height})
        withpen pencircle scaled (\MPvar{height}/5)
        withcolor "OrnamentColor" ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{Circle}{height}
    fill fullcircle sized \MPvar{height}
        withpen pencircle scaled (\MPvar{height}/5)
        withcolor "OrnamentColor" ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{UpArrow}{height}
    fill uptriangle xysized(\MPvar{height},\MPvar{height})
        withpen pencircle scaled (\MPvar{height}/5)
        withcolor "OrnamentColor" ;
\stopuniqueMPgraphic

\setupinteractionmenu
  [bottom]
  [state=start,
   frame=off,
   width=.3\textwidth,
   height=\bottomheight]

\setupinteraction
  [menu=on]

\def\WhateverButton
  {\doifreferencefoundelse{Whatever}
     {\raw [Whatever] \uniqueMPgraphic{UpArrow} \\}
     {}}

\startinteractionmenu[bottom]
  \but [Topics]                                     \\ % secret button
  \hfill
  \WhateverButton                                      % user specific
  \kern2\bottomheight
  \raw [previouspage]  \uniqueMPgraphic{LeftArrow}  \\
  \kern.5\bottomheight
  \raw [CloseDocument] \uniqueMPgraphic{Circle}     \\
  \kern.5\bottomheight
  \raw [nextpage]      \uniqueMPgraphic{RightArrow} \\
  \kern.5\bottomheight
\stopinteractionmenu

%D \macros
%D   {TitlePage, Topics, Topic, Subject}
%D
%D A presentation after loading this module looks like:
%D
%D \starttyping
%D \TitlePage {About Whatever\\Topics}
%D
%D \Topics {Todays Talk}
%D
%D \Topic {Some topic}
%D
%D .....
%D
%D \Topic {Next Topic}
%D
%D .....
%D \stoptyping

%D \macros
%D  {StartTitlePage, TitlePage}
%D
%D The titlepage is rather simple and can be typeset in two
%D ways:
%D
%D \starttyping
%D \StartTitlePage
%D text \\ text \\ text
%D \StopTitlepage
%D \stoptyping
%D
%D or as one||liner:
%D
%D \starttyping
%D \TitlePage{text\\text\\text}
%D \stoptyping
%D
%D The first alternative can be used for more complicated title pages.

\unexpanded\def\StartTitlePage
  {\startstandardmakeup
   \bfd\setupinterlinespace
   \setupalign[middle]
   \vfil
   \let\\=\vfil}

\unexpanded\def\StopTitlePage
  {\vfil\vfil\vfil
   \stopstandardmakeup}

\unexpanded\def\TitlePage#1%
  {\StartTitlePage#1\StopTitlePage}

%D \macros
%D   {definehead}
%D
%D The commands \type{\Topic} and \type{\Subject} are defined as copies of head. We
%D use \type{\Nopic} for internal purposes.

\definehead [Topic]   [chapter]
\definehead [Subject] [section]

\definehead [Nopic]   [title]

%D \macros
%D   {setuphead}
%D
%D We use our own command for typesetting the titles. We hide sectionnumbers from
%D viewing. Each topic is followed by a list of subjects that belong to the topic.

\setuphead
  [Topic, Nopic]
  [after={\blank[3*medium]},
   number=no,
   style=\bfb,
   page=yes,
   alternative=middle]

\setuphead
  [Subject]
  [after=\blank,
   number=no,
   page=yes,
   continue=no,
   style=\tfa]

%D \macros
%D   {setuplist}
%D
%D When found, the subject list is automatically placed after the topic head.

\setuplist
  [Topic,Subject]
  [alternative=g,
   interaction=all,
   before=,
   after=]

\setuplist
  [Topic]
  [criterium=all]

\unexpanded\def\Topics#1%
  {\determinelistcharacteristics[Topic]
   \doifmode{*list}
     {\Nopic[Topics]{#1}
      \startcolumns
      \placelist[Topic]
      \stopcolumns}}

\setuplist
  [Subject]
  [criterium=Topic]

\unexpanded\def\Subjects
  {\determinelistcharacteristics[Subject]
   \doifmode{*list}
     {\placelist[Subject]}}

\setuphead
  [Topic]
  [after={\blank[3*medium]\Subjects}]

\stopmodule

\continueifinputfile{s-present-green.mkiv}

\usemodule[present-common]

\inputpresentationfile{examples/present-green-001.tex}