s-present-four.mkiv /size: 4752 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [      file=s-present-four,
3%D        version=2011.04.15, % about
4%D          title=\CONTEXT\ Style File,
5%D       subtitle=Presentation Environment Four,
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 Just another one-time used Bacho\TEX\ presentation style that I found back
15%D when cleaning up old files. It's just simple pages in a shape and this time
16%D we hook it into a section command.
17
18\startmodule[present-four]
19
20\setupbodyfont
21  [dejavu,11pt]
22
23\setupcolors
24  [textcolor=white]
25
26\setupalign
27  [flushleft]
28
29\startuseMPgraphic{page}
30    vardef One =
31            ulcorner Page --
32        .75[ulcorner Page, urcorner Page] --
33        .60[ulcorner Page, lrcorner Page] --
34        .75[ulcorner Page, llcorner Page] --
35            cycle
36    enddef;
37    vardef One =
38            ulcorner Page --
39        .80[ulcorner Page, urcorner Page] --
40        .65[ulcorner Page, lrcorner Page] --
41        .80[ulcorner Page, llcorner Page] --
42            cycle
43    enddef;
44    vardef Two   = One rotatedaround(center Page, 90) enddef ;
45    vardef Three = One rotatedaround(center Page,180) enddef ;
46    vardef Four  = One rotatedaround(center Page,270) enddef ;
47    StartPage ;
48        if CurrentLayout = "layout:0" :
49            fill Two   withcolor .25[red,blue] ;
50            fill Three withcolor .25[blue,yellow] ;
51            fill Four  withcolor .25[yellow,blue] ;
52            fill One   withcolor .5white ;
53        elseif CurrentLayout = "layout:1" :
54            fill Two   withcolor .25[red,blue] ;
55            fill Three withcolor .25[blue,yellow] ;
56            fill Four  withcolor .25[yellow,blue] ;
57            fill One   withcolor .25[green,red] ;
58        elseif CurrentLayout = "layout:2" :
59            fill One   withcolor .25[green,red] ;
60            fill Two   withcolor .25[red,blue] ;
61            fill Three withcolor .25[blue,yellow] ;
62            fill Four  withcolor .25[yellow,blue] ;
63        elseif CurrentLayout = "layout:3" :
64            fill One   withcolor .25[green,red] ;
65            fill Two   withcolor .25[red,blue] ;
66            fill Four  withcolor .25[yellow,blue] ;
67            fill Three withcolor .25[blue,yellow] ;
68        elseif CurrentLayout = "layout:4" :
69            fill One   withcolor .25[green,red] ;
70            fill Three withcolor .25[blue,yellow] ;
71            fill Four  withcolor .25[yellow,blue] ;
72            fill Two   withcolor .25[red,blue] ;
73        fi ;
74    StopPage ;
75\stopuseMPgraphic
76
77\setupbackgrounds
78  [page]
79  [background={page}]
80
81\setupinteraction
82  [state=start,
83   click=no]
84
85\setupinteractionscreen
86  [option=max]
87
88\defineoverlay
89  [page]
90  [\useMPgraphic{page}]
91
92\definepapersize
93  [mine]
94  [width=400pt,
95   height=400pt]
96
97\setuppapersize
98  [mine]
99
100\setuplayout
101  [header=0pt,
102   footer=0pt,
103   margin=0pt,
104   width=middle,
105   height=middle]
106
107% \showframe
108
109\definelayout
110  [layout:0]
111  [backspace=10pt,cutspace=.375\paperwidth,
112   bottomspace=.35\paperheight,topspace=10pt]
113
114\definelayout
115  [layout:1]
116  [backspace=10pt,cutspace=.375\paperwidth,
117   bottomspace=.35\paperheight,topspace=10pt]
118
119\definelayout
120  [layout:2]
121  [backspace=.35\paperwidth,cutspace=10pt,
122   bottomspace=.375\paperheight,topspace=10pt]
123
124\definelayout
125  [layout:3]
126  [backspace=.375\paperwidth,cutspace=10pt,
127   bottomspace=10pt,topspace=.375\paperheight]
128
129\definelayout
130  [layout:4]
131  [backspace=10pt,cutspace=.375\paperwidth,
132   bottomspace=10pt,topspace=.35\paperheight]
133
134\setuptyping
135  [space=fixed]
136
137\startluacode
138    local n = -1
139    function documentdata.StartPage()
140        if n == 4 then
141            n = 1
142        else
143            n = n + 1
144        end
145        context.setuplayout { string.format("layout:%s",n) }
146    end
147    function documentdata.StopPage()
148        context.page()
149    end
150\stopluacode
151
152\unexpanded\def\StartPage
153  {\bgroup
154   \ctxlua{documentdata.StartPage()}}
155
156\unexpanded\def\StopPage
157  {\ctxlua{documentdata.StopPage()}
158   \egroup}
159
160\startsetups subject:start
161    \bgroup
162    \ctxlua{documentdata.StartPage()}
163\stopsetups
164
165\startsetups subject:stop
166    \ctxlua{documentdata.StopPage()}
167    \egroup
168\stopsetups
169
170\setuphead[subject]
171  [beforesection=\directsetup{subject:start},
172   aftersection=\directsetup{subject:stop}]
173
174\startsetups document:start
175    \StartPage
176        \definedfont[SerifBold*default at 48pt]
177        \setupinterlinespace
178        \documentvariable{title}
179    \StopPage
180\stopsetups
181
182\stopmodule
183
184\continueifinputfile{s-present-four.mkiv}
185
186\usemodule[present-common]
187
188\inputpresentationfile{bachotex/2011/bachotex-2011-cld-and-mkvi.tex}
189