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