s-present-tiles.mkiv /size: 8379 b    last modification: 2021-10-28 13:51
1%D \module
2%D   [      file=s-present-tiles, % was s-pre-41
3%D        version=2013.03.24,
4%D          title=\CONTEXT\ Style File,
5%D       subtitle=Presentation Environment Tiles,
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 In this style the table of contents is a bunch of rectangular blobs. The layout
15%D adapts itself upto 25 pages. This style was made for Bacho\TeX\ 2013.
16
17\startmodule[present-tiles]
18
19\setupbodyfont[pagella,14.4pt]
20
21\setuppapersize[S6][S6]
22
23\definecolor[maincolor] [.50(darkblue,darkgreen)]
24\definecolor[othercolor][.25(darkblue,darkyellow)]
25\definecolor[mixedcolor][s=.35]
26
27\setupcolors
28  [textcolor=white]
29
30\setupalign
31  [flushleft,nothyphenated]
32
33\definemeasure[layoutunit][\dimexpr\paperheight/25]
34
35\setuplayout
36  [backspace=\measured{layoutunit},
37   topspace=\measured{layoutunit},
38   width=middle,
39   height=middle,
40   header=0pt,
41   footer=0pt]
42
43\definelayout
44  [content]
45  [backspace=.5\measured{layoutunit},
46   topspace=.5\measured{layoutunit}]
47
48\definemeasure [topiclistwidth] [
49    (\textwidth+\backspace)/
50    \ifcase\numexpr\structurelistsize\relax 1 %  0
51    \or1\or1\or1\or2\or1\or3\or3\or3\or3      %  1 -  9
52    \or3\or3\or3\or3\or3\or3\or4              % 10 - 16
53    \or4\or4\or4\or4\or                       % 17 - 20
54    \else5                                    % 21 - 25
55    \fi
56    -\backspace
57]
58
59\definemeasure [topiclistheight] [
60    (\textheight+\topspace)/
61    \ifcase\numexpr\structurelistsize\relax 1 %  0
62    \or1\or2\or3\or2\or5\or2\or3\or3\or3      %  1 -  9
63    \or4\or4\or4\or4\or4\or4\or4              % 10 - 16
64    \or5\or5\or5\or5\or5                      % 17 - 20
65    \else5                                    % 21 - 25
66    \fi
67    -\topspace
68]
69
70\definemeasure [topiclistfontsize] [
71    \ifcase\numexpr\structurelistsize\relax 2.5            %  0
72    \or1.4\or1.4\or1.4\or1.4\or1.4\or1.4\or1.4\or1.4\or1.4 %  1 -  9
73    \or1.3\or1.3\or1.3\or1.3\or1.3\or1.3\or1.3             % 10 - 16
74    \or1.2\or1.2\or1.2\or1.2\or1.2                         % 17 - 20
75    \else1                                                 % 21 - 25
76    \fi
77    \bodyfontsize
78]
79
80\definemeasure [topiclistfont]  [\measured{topiclistfontsize}]
81\definemeasure [topictitlefont] [1.2\measured{layoutunit}]
82\definemeasure [titlepagefont]  [2\measured{layoutunit}]
83
84\predefinefont[MyTopicTitleFont][SerifBold*default at \measure{topictitlefont}]
85\predefinefont[MyTopicListFont] [SerifBold*default at \measure{topiclistfont}]
86
87\defineframed
88  [topiclistentry]
89  [width=\measure{topiclistwidth},
90   height=\measure{topiclistheight},
91   background=color,
92   frame=off,
93   foregroundstyle=MyTopicListFont,
94   backgroundcolor=maincolor,
95   foregroundcolor=white]
96
97\setupwhitespace
98  [big]
99
100\setupblank
101  [big]
102
103\setupinteraction
104 [state=start,
105  color=,
106  contrastcolor=,
107  click=off]
108
109\definemakeup
110  [topic]
111  [standard]
112  [top=,bottom=]
113
114\definemakeup
115  [content]
116  [standard]
117  [top=,bottom=]
118
119\startsetups[topic:start]
120    \starttopicmakeup
121\stopsetups
122
123\startsetups[topic:stop]
124    \vfill
125    \stoptopicmakeup
126\stopsetups
127
128\definehead
129  [topic]
130  [chapter]
131  [before=,
132   style=MyTopicTitleFont,
133   page=,
134   number=off,
135   interaction=list,
136   beforesection=\directsetup{topic:start},
137   aftersection=\directsetup{topic:stop}]
138
139\setuplist
140  [topic]
141  [alternative=topic,
142   interaction=all]
143
144\definelistalternative
145  [topic]
146  [alternative=horizontal,
147   renderingsetup=topic:list]
148
149\startsetups[topic:list]
150    \dontleavehmode
151    \startcurrentlistentrywrapper
152        \topiclistentry{\currentlistentrytitle}
153    \stopcurrentlistentrywrapper
154    \blankspace
155\stopsetups
156
157\defineoverlay[nextpage][\overlaybutton{nextpage}]
158\defineoverlay[prevpage][\overlaybutton{prevpage}]
159\defineoverlay[menupage][\overlaybutton{menupage}]
160\defineoverlay[homepage][\overlaybutton{homepage}]
161
162\setupbackgrounds
163  [text]
164  [backgroundoffset=.5\measured{layoutunit}]
165
166% begin of buttons
167
168\defineframed
169  [bb]
170  [width=\dimexpr\overlaywidth/10,
171   height=\dimexpr\overlayheight/10,
172   background=color,
173   foregroundstyle=\bfa,
174   frame=off]
175
176\defineframed[nb] [bb] [empty=yes]
177\defineframed[rb] [bb] [backgroundcolor=white,foregroundcolor=othercolor]
178\defineframed[db] [bb] [backgroundcolor=mixedcolor,foregroundcolor=white]
179
180\definepushbutton [prev]
181\definepushbutton [next]
182\definepushbutton [menu]
183\definepushbutton [home]
184
185\definepushsymbol [prev] [n] [\nb{prev}]
186\definepushsymbol [prev] [r] [\rb{prev}]
187\definepushsymbol [prev] [d] [\db{prev}]
188
189\definepushsymbol [next] [n] [\nb{next}]
190\definepushsymbol [next] [r] [\rb{next}]
191\definepushsymbol [next] [d] [\db{next}]
192
193\definepushsymbol [menu] [n] [\nb{menu}]
194\definepushsymbol [menu] [r] [\rb{menu}]
195\definepushsymbol [menu] [d] [\db{menu}]
196
197\definepushsymbol [home] [n] [\nb{home}]
198\definepushsymbol [home] [r] [\rb{home}]
199\definepushsymbol [home] [d] [\db{home}]
200
201\definelayer
202  [buttons]
203  [width=\dimexpr\textwidth+\measured{layoutunit}\relax,
204   height=\dimexpr\textheight+\measured{layoutunit}\relax] % a setups
205
206\startsetups [document:buttons]
207
208    \setlayer
209        [buttons]
210        [preset=leftbottom,offset=-.25\measured{layoutunit}]
211        {\pushbutton[prev][previouspage]}
212
213    \setlayer
214        [buttons]
215        [preset=rightbottom,offset=-.25\measured{layoutunit}]
216        {\pushbutton[next][nextpage]}
217
218    \setlayer
219        [buttons]
220        [preset=lefttop,offset=-.25\measured{layoutunit}]
221        {\pushbutton[home][homepage]}
222
223    \setlayer
224        [buttons]
225        [preset=righttop,offset=-.25\measured{layoutunit}]
226        {\pushbutton[menu][menupage]}
227
228\stopsetups
229
230\defineoverlay[setbuttons][\directsetup{document:buttons}]
231
232% end of buttons
233
234\defineframed
235  [conclusion]
236  [location=low,
237   width=max,
238   align={flushleft,lohi},
239   background=color,
240   backgroundcolor=white,
241   foregroundcolor=othercolor]
242
243\startsetups [document:titlepage]
244
245    \definebodyfontenvironment
246      [\measure{titlepagefont}]
247
248    \setupbackgrounds
249      [page]
250      [background={color,menupage},
251       backgroundcolor=othercolor]
252
253    \setupbackgrounds
254      [text]
255      [background={color,menupage},
256       backgroundcolor=othercolor]
257
258    \starttopicmakeup[reference=homepage]
259
260        \switchtobodyfont[\measure{titlepagefont}]
261
262        \enforced\let\\\crlf
263
264        \startalignment[flushleft]
265            \bf
266            \setupinterlinespace
267            \begstrut\documentvariable{title}\endstrut\par
268        \stopalignment
269
270        \vfill
271
272        \startalignment[flushright]
273            \bf
274            \setupinterlinespace
275            \begstrut\documentvariable{subtitle}\endstrut\par
276        \stopalignment
277
278    \stoptopicmakeup
279
280    \setupbackgrounds
281      [page]
282      [background={color,homepage},
283       backgroundcolor=othercolor]
284
285    \setupbackgrounds
286      [text]
287      [background={color,menupage},
288       backgroundcolor=othercolor]
289
290    \startcontentmakeup[reference=menupage]
291
292        \setupalign[tolerant,stretch,paragraph]
293        \flexiblebaselines
294        \placelist[topic][criterium=text]
295
296    \stopcontentmakeup
297
298    \setupbackgrounds
299      [page]
300    % [background={color,menupage},
301      [background={color,invoke},
302       backgroundcolor=maincolor]
303
304    \setupbackgrounds
305      [text]
306    % [background={color,nextpage,setbuttons,buttons},
307      [background={color,setbuttons,buttons},
308       backgroundcolor=othercolor]
309
310\stopsetups
311
312\setupdocument
313  [before=\directsetup{document:titlepage}]
314
315\stopmodule
316
317\continueifinputfile{s-present-tiles.mkiv}
318
319\usemodule[present-common]
320
321%inputpresentationfile{examples/present-tiles-001.tex}
322%inputpresentationfile{context/2013/context-2013-speed.tex}
323\inputpresentationfile{context/2013/context-2013-math.tex}
324%inputpresentationfile{bachotex/2013/bachotex-2013-bits.tex}
325%inputpresentationfile{bachotex/2013/bachotex-2013-bits.pdf}
326%inputpresentationfile{bachotex/2013/bachotex-2013-luatex.tex}
327%inputpresentationfile{bachotex/2013/bachotex-2013-luatex.pdf}
328%inputpresentationfile{bachotex/2013/bachotex-2013-sense.tex}
329%inputpresentationfile{bachotex/2013/bachotex-2013-sense.pdf}
330%inputpresentationfile{bachotex/2013/bachotex-2013-speed.tex}
331%inputpresentationfile{bachotex/2013/bachotex-2013-speed.pdf}
332