summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-simpleslides/tex/context/third/simpleslides/s-simpleslides-Framed.tex
blob: 6bb446c1aee5ec4c3111109913d7cbfc5ca8312e (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
%D \module
%D   [      file=simpleslides-s-Framed,
%D        version=2022.07.13,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module --- Framed Style,
%D         author=Aditya Mahajan and Thomas A. Schmitz,
%D           date=\currentdate,
%D      copyright={Aditya Mahajan and Thomas A. Schmitz}]
%C
%C Copyright 2007 Aditya Mahajan and Thomas A. Schmitz
%C This file may be distributed under the GNU General Public License v. 2.0.

%D This file provides the \quotation{Framed} style for the presentation
%D module. It is loaded at runtime.

\writestatus{simpleslides}{loading style Framed}

\startmodule[simpleslides-s-Framed]

\unprotect

%D The page layout:

\setuplayout [width=fit,
              margin=0.6cm,
              height=fit,
              header=2.1cm,
              footer=1.35cm,
	      footerdistance=0.5cm,
              topspace=0.5cm,
              backspace=1cm,
              location=singlesided]

\setuplayout [simpleslides:layout:horizontal][header=2.1cm,backspace=1cm]
\setuplayout [simpleslides:layout:vertical]  [header=0cm,backspace=1cm]
\setuplayout [simpleslides:layout:title]     [header=0cm,backspace=0.5cm]

%D We also specify the position of the slidetitle.

\setuplayer[simpleslides:layer:slidetitle]
    [x=10mm,y=3mm]

%D These macros are used for placing figures/pictures:

\define\NormalHeight        {.975\textheight}
\define\NormalWidth         {.485\textwidth}
\define\PictureFrameHeight  {.975\textheight}
\define\PictureFrameWidth   {.485\textwidth}


%D We define our colors:

\definecolor [simpleslides:backgroundcolor]   [r=.85, g=.85, b=.85]
\definecolor [simpleslides:framecolor]        [r=.42, g=.42, b=.7]
\definecolor [simpleslides:contrastcolor]     [r=0, g=0, b=.5]
\definecolor [simpleslides:variantcolor]      [r=0, g=0, b=1]
\definecolor [simpleslides:itemize:color]     [simpleslides:contrastcolor]

%D We let \METAPOST\ calculate the background. This style have two options for
%D ornaments, square or stripes. We define both, and then choose one depending
%D on the user's choice.

\startuseMPgraphic{simpleslides:MP:ornament:square}
StartPage;

save a,b,c,p;
numeric a; a = 0.955cm ;
numeric b; b = 0.52cm ;
numeric c; c = 0.8cm ;
path p[] ;

for i=1 upto 11:
	p[i] = unitsquare xyscaled (a,a) shifted (b+2*(i-1)*a, c) ;
    fill p[i] withcolor ((i-1)/10)[\MPcolor{simpleslides:contrastcolor},
                                   \MPcolor{simpleslides:variantcolor}] ;
endfor ;

if NOfPages >= 12:
  save n ; numeric n ;
  n := (10*(RealPageNumber - 1) div (NOfPages - 1)) + 1;

  draw llcorner p[n] -- urcorner p[n]
         withpen pencircle scaled 2pt
         withcolor \MPcolor{simpleslides:backgroundcolor} ;
fi ;

StopPage;
\stopuseMPgraphic

\startuseMPgraphic{simpleslides:MP:ornament:stripe}
StartPage;

save p ;
path p[] ;

p[1] := unitsquare xyscaled(0.95*OverlayWidth,1cm) shifted (0.52cm,0.8cm) ;

linear_shade(p[1],0,
            \MPcolor{simpleslides:backgroundcolor},
            \MPcolor{simpleslides:contrastcolor}) ;

save i ;
numeric i;
if NOfPages = 0 :
  i = RealPageNumber ;
else :
  i = RealPageNumber/NOfPages ;
fi ;

p[2] = ulcorner p[1] -- urcorner p[1] ;
p[3] = llcorner p[1] -- lrcorner p[1] ;

save o;
pair o[] ;

o[1] := point i along p[2] ;
o[2] := point i along p[3] ;

p[4] = ulcorner p[1] -- o[1] -- o[2] -- llcorner p[1] -- cycle ;

clip currentpicture to p[4] ;

StopPage;
\stopuseMPgraphic

\startuniqueMPgraphic{simpleslides:MP:vertical}
StartPage ;

fill Page withcolor \MPcolor{simpleslides:backgroundcolor} ;

draw Page enlarged (-.2cm)
          withpen pencircle scaled 4pt
          withcolor \MPcolor{simpleslides:framecolor} ;

draw unitsquare
     xyscaled(0.448*PaperWidth,0.815*PaperHeight)
     shifted (0.528*PaperWidth, 0.15*PaperHeight)
     withpen pencircle scaled 2pt
     withcolor \MPcolor{simpleslides:framecolor} ;

StopPage ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{simpleslides:MP:horizontal}
StartPage ;

fill Page withcolor \MPcolor{simpleslides:backgroundcolor} ;

draw Page enlarged (-.2cm)
          withpen pencircle scaled 4pt
          withcolor \MPcolor{simpleslides:framecolor} ;

draw unitsquare
     xyscaled(0.95*PaperWidth,0.7*PaperHeight)
     shifted (0.025*PaperWidth, 0.15*PaperHeight)
     withpen pencircle scaled 2pt
     withcolor \MPcolor{simpleslides:framecolor} ;

StopPage;
\stopuniqueMPgraphic

%D We define these backgrounds as overlays:


\defineoverlay
  [simpleslides:background:horizontal]
  [\useMPgraphic{simpleslides:MP:horizontal}]

\defineoverlay
  [simpleslides:background:vertical]
  [\useMPgraphic{simpleslides:MP:vertical}]

\defineoverlay
  [simpleslides:background:title]
  [\useMPgraphic{simpleslides:MP:horizontal}]

%D We define the ornament according to user's choice.

\startsetups simpleslides:alternative:square
\defineoverlay
  [simpleslides:background:ornament]
  [\uniqueMPgraphic{simpleslides:MP:ornament:square}]
\stopsetups

\startsetups simpleslides:alternative:stripe
\defineoverlay
  [simpleslides:background:ornament]
  [\uniqueMPgraphic{simpleslides:MP:ornament:stripe}]
\stopsetups

\startsetups simpleslides:alternative:empty
  \setups{simpleslides:alternative:square}
\stopsetups

%D Now we activate the user's choice

\setups{simpleslides:alternative:\moduleparameter{simpleslides}{alternative}}

%D The title is typed in a slightly larger font.

\setupTitle
  [\c!title\c!color={simpleslides:contrastcolor},
   \c!title\c!style=\tfc,
   \c!author\c!color={simpleslides:contrastcolor},
   \c!author\c!style=\tfa,
   \c!date\c!color={simpleslides:contrastcolor},
   \c!date\c!style=\tfa]

%D The slide title is typeset in a layer

\setupSlideTitle
  [\c!color={simpleslides:contrastcolor},
   \c!alternative=layer,
   \c!align=\v!center,
   \c!width=\textwidth,
   \c!height=2.1cm,
   \c!after=]

%D The symbol for the first level of itemizations.

\definesymbol[1][\useMPgraphic{simpleslides:itemize:square}]
\setupitemize[1][color={simpleslides:itemize:color}]

\protect
\stopmodule

\endinput