summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/modules/mkiv/s-present-overlap.mkiv
blob: 053455b4b6bb6625b2b3d1443db4d35544a3760e (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
%D \module
%D   [      file=s-present-overlap, % was s-pre-62,
%D        version=2005.03.04,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Environment Overlap,
%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.

\usemodule[present-stepwise]

\startmodule[present-overlap]

\doifmodeelse {atpragma} {

    \usetypescriptfile
      [type-ghz]

    \definetypeface[mainface][rm][serif][melior]  [default][encoding=texnansi]
    \definetypeface[mainface][tt][mono] [modern]  [default][encoding=texnansi,rscale=1.05]
    \definetypeface[mainface][ss][serif][melior]  [default][encoding=texnansi]
    \definetypeface[mainface][mm][math] [palatino][default][encoding=texnansi,rscale=0.95]

    \setupbodyfont
      [mainface,14.4pt]

} {

    \setupbodyfont[dejavu,14.4pt]

}

\setuppapersize
  [S6][S6]

\setvariables[layout][dx=0,dy=1,nx=2,ny=2,step=64]

\definemeasure[layoutwd][\dimexpr\paperwidth /\getvariable{layout}{step}\relax]
\definemeasure[layoutht][\dimexpr\paperheight/\getvariable{layout}{step}\relax]

\setuplayout
  [      width=middle,
        height=middle,
        header=0pt,
        footer=0pt,
        margin=0pt,
     backspace=5\measured{layoutwd},
      topspace=5\measured{layoutht}]

\definelayout
  [step]
  [  backspace=\numexpr2+                         \getvariable{layout}{dx}\relax\measured{layoutwd},
      cutspace=\numexpr3+\getvariable{layout}{nx}-\getvariable{layout}{dx}\relax\measured{layoutwd},
      topspace=\numexpr2+                         \getvariable{layout}{dy}\relax\measured{layoutht},
   bottomspace=\numexpr3+\getvariable{layout}{ny}-\getvariable{layout}{dy}\relax\measured{layoutht}]

\definecolor[layout:left]  [t=.5,a=1,b=1]
\definecolor[layout:right] [t=.5,a=1,r=1]
\definecolor[layout:top]   [t=.5,a=1,g=1]
\definecolor[layout:bottom][t=.5,a=1,y=1]
\definecolor[layout:page]  [s=.75]

\definehspace[menu][\measured{layoutwd}]

\setupinteraction
  [state=start,
   click=off,
   style=,
   color=interactioncolor,
   contrastcolor=interactioncolor]

\setupinteractionscreen
  [option=max]

\setupbuttons
  [color=maincolor,
   contrastcolor=maincolor,
   style=\tf, % acceptable
   height=2\measure{layoutht},
   width=2\measure{layoutwd},
   offset=overlay,
   frame=off]

\definecolor[interactioncolor][darkgray]
\definecolor[maincolor]       [lightgray]

\setuptexttexts
  []
  [\vbox to \textheight{\vfill\hfill\setups{menu:content}}]

\startsetups menu:content

    \button{\symbol[firstpage]}[firstpage]
    \hspace[menu]
    \button{\symbol[previouspage]}[previouspage]
    \hspace[menu]
    \button{\StartBusy\symbol[PauseRendering]\StopBusy}[InvokeStepper]
    \hspace[menu]
    \button{\symbol[nextpage]}[nextpage]
    \hspace[menu]
    \button{\symbol[lastpage]}[lastpage]
    \hspace[menu]
    \button{\symbol[CloseDocument]}[CloseDocument]

\stopsetups

\startuseMPgraphic{page}{step}
    StartPage ;
        numeric dx ; dx := PaperWidth /\MPvar{step} ;
        numeric dy ; dy := PaperHeight/\MPvar{step} ;
        fill Page withcolor .5white ;
        fill
            ulcorner Page -- urcorner Page --
            urcorner Page shifted (0,-TopSpace+dy) -- ulcorner Page shifted (0,-TopSpace+dy) -- cycle
            withcolor "layout:top" ;
        fill
            llcorner Page -- lrcorner Page --
            lrcorner Page shifted (0,BottomSpace-dy) -- llcorner Page shifted (0,BottomSpace-dy) -- cycle
            withcolor "layout:bottom" ;
        fill
            ulcorner Page -- llcorner Page --
            llcorner Page shifted (BackSpace-dx,0) -- ulcorner Page shifted (BackSpace-dx,0) -- cycle
            withcolor "layout:left" ;
        fill
            urcorner Page -- lrcorner Page --
            lrcorner Page shifted (-CutSpace+dx,0) -- urcorner Page shifted (-CutSpace+dx,0) -- cycle
            withcolor "layout:right" ;
        fill Field[Text][Text] enlarged (dx,dy) withcolor white ;
        fill Field[Text][Text] enlarged (dx,dy) withcolor "layout:page" ;
    StopPage ;
\stopuseMPgraphic

\defineoverlay[page][\useMPgraphic{page}{step=\getvariable{layout}{step}}]

\setupbackgrounds
  [page]
  [background=page]

\setupcolors
  [state=start]

\startsetups nextstep
  % pagebreak handlers are grouped, so we need to set global
  \ifnum\getvariable{layout}{dx}=\getvariable{layout}{nx}\relax
    \ifnum\getvariable{layout}{dy}=\getvariable{layout}{ny}\relax
      \setxvariables[layout][dy=1]
    \else
      \setxvariables[layout][dy=\the\numexpr\getvariable{layout}{dy}+1\relax]
    \fi
    \setxvariables[layout][dx=1]
  \else
    \setxvariables[layout][dx=\the\numexpr\getvariable{layout}{dx}+1\relax]
  \fi
  % global anyway
  \setuplayout[step]
\stopsetups

\appendtoks
    \definefont[ChapterTitleFont][SerifBold*default sa 2]
    \NormalizeFontHeight \SubTitleFont      {\setstrut\strut\quad} {3\lineheight} {SerifBold*default}
    \NormalizeFontHeight \ChapterNumberFont {XVI}                  {4\lineheight} {SerifBold*default}
\to \everystarttext

\setupsection
  [section-2]
  [bodypartconversion=Romannumerals]

\installpagebreakhandler {step} {\setups{nextstep}}

\definepagebreak[chapter][yes,step]

\setuphead
  [chapter]
  [page=chapter,
   command=\MyChapterCommand,
   after=\nowhitespace]

\definehead[Topic][chapter]
\definehead[Nopic][title]

\setuphead[chapter,Topic,Nopic]
  [numberstyle=\ChapterNumberFont,
   textstyle=\ChapterTitleFont,
   numbercolor=lightgray,
   textcolor=darkgray]

\unexpanded\def\MyChapterCommand#1#2%
  {\hbox \bgroup % we need to nil the strut added by the headplacement
     \setupframed[frame=off,lines=3,offset=overlay]%
     \rlap{\hskip2\lineheight\framed{\setnostrut#1}}%
     \framed{#2}%
   \egroup}

\setupitemize
  [each]
  [R,broad]
  [stopper=,
   color=lightgray]

\startsetups document:start

    \startstandardmakeup[headerstate=high,textstate=stop]

        \setupalign[middle]

        \vfil
        \startcolor[darkgray]
            \dontleavehmode\scale[width=.9\textwidth]{\bf\setstrut\strut\documentvariable{title}}
            \vfil
            \dontleavehmode\scale[width=.7\textwidth]{\bf\setstrut\strut\documentvariable{subtitle}}
            \vfil \vfil \vfil
            \dontleavehmode\scale[width=.5\textwidth]{\bf\setstrut\strut\documentvariable{location}}
        \stopcolor
        \vfil \vfil \vfil

    \stopstandardmakeup

\stopsetups

\stopmodule

\continueifinputfile{s-present-overlap.mkiv}

\usemodule[present-common]

\inputpresentationfile{context/2011/context-2011-mathml-update.tex}
%\inputpresentationfile{context/2011/context-2011-metapost-how-we-adapt.tex}
%\inputpresentationfile{context/2011/context-2011-ebook-export.tex}
%\inputpresentationfile{context/2011/context-2011-sorting-registers.tex}