summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/third/taspresent/t-greenblue.tex
blob: 311fe74d711096cdd359e17ada7dc64d6286a906 (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
%D \module
%D   [      file=t-greenblue,
%D        version=2007.07.25, 
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module greenblue,
%D         author=Thomas A. Schmitz,
%D           date=\currentdate,
%D      copyright={Thomas A. Schmitz}]
%C
%C Copyright 2007 Thomas A. Schmitz.
%C This file may be distributed under the GNU General Public License v. 2.0.

%D This file provides the \quotation{greenblue} style for the presentation
%D module. It is loaded at runtime. The theme for this style is inspired by the
%D \quotation{Berkeley} theme of the \LaTeX\ Beamer package.

\writestatus{loading}{module greenblue}

\startmodule[greenblue]

\unprotect

%D The taspresentation module provides a skeleton into which different styles
%D can be hooked. It uses a number of variables and macros which have to be set
%D beforehand. Some parts are optional. We begin with the necessary definitions:

%D We define our colors:

\definecolor [Item]            [r=.09,g=.2,b=.41]
\definecolor [a]               [s=.95]
\definecolor [b]               [r=.58,g=.81,b=.58]
\definecolor [c]               [r=.09,g=.2,b=.41]
\definecolor [d]               [r=.04,g=.4,b=.4]

%D We start colors; textcolor is white:

\setupcolors[state=start,textcolor=c]

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

\define\NormalHeight{\textheight}
\define\NormalWidth{.476\textwidth}
\define\PictureFrameHeight{\textheight}
\define\PictureFrameWidth{.476\textwidth}

%D The page layout:

\setuplayout [width=fit,
              leftmargin=1.5cm,
	      rightmargin=0cm,
              leftmargindistance=1.2cm,
              rightmargindistance=0pt,
              height=fit, 
              header=5.3cm, 
              footer=0cm, 
              topspace=.4cm, 
              backspace=2.5cm,
	      cutspace=3.2cm,
              bottomspace=0cm,
              bottom=0pt,
              location=singlesided]

%D The macro for typesetting the Slidetitle; this is adapted from a sample
%D document that Brooks Moses published on the wiki:

\definelayer[slidetitle]
    [width=\paperwidth,
    height=\paperheight,
    x=25mm,
    y=25mm]

\define[1]\Slidetitle{\page\setlayer[slidetitle]%
     {\framed[frame=off,width=\textwidth,height=2cm,offset=0pt,align=right,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[d]{\bf #1}}}}

%D The macro \tex{Maketitle} produces a default title page with the author, the
%D title of the presentation, and the date. Using it is not mandatory.

\definelayer[prestitle]
    [width=\paperwidth,
    height=\paperheight,
    y=30mm]

\definelayer[presauthor]
    [width=.5\paperwidth,
    height=.5\paperheight,
    x=104mm,
    y=118mm]

\define\Maketitle{%
\titback\null
\setlayer[prestitle]%
{\framed[frame=off,width=\paperwidth,height=4cm,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[c]{\bf \getvariable{taspresent}{title}}}}
\setlayer[presauthor]%
{\framed[frame=off,width=.5\paperwidth,height=4cm,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Normalsize]\color[c]{\getvariable{taspresent}{author}}}}}

%D The following parts are optional; if you don't use backgrounds and are
%D content with CONTEXT's default itemization, you don't have to set these
%D macros. 

%D We let Metapost calculate the background:

\startuseMPgraphic{greenframe}
StartPage ;
fill Page withcolor \MPcolor{a} ;
numeric a ; a = 2cm ;
numeric b ; b = 0.7cm ;
numeric c ; c = 6cm ;
numeric d ; d = .7cm ;
pair zc[] ;
zc1 = llcorner Page shifted (a,0) ;
zc2 = ulcorner Page shifted (a,-a-b) ;
zc3 = ulcorner Page shifted (a+b/4,-a-b/4) ;
zc4 = ulcorner Page shifted (a+b,-a) ;
zc5 = urcorner Page shifted (0,-a) ;
zc6 = ulcorner Page shifted (c,0) ;
zc7 = ulcorner Page shifted (c,-a) ;
path pa[] ;
pa[1] = llcorner Page -- zc1 -- zc2 .. zc3 .. zc4 -- zc7 -- zc6 -- ulcorner Page -- cycle ;
fill pa[1] withcolor \MPcolor{b} ;
draw \sometxt{\framed[frame=off,width=2cm,height=2cm]{\color[a]{\pagenumber}}} ;
StopPage ;
\stopuseMPgraphic

\startuniqueMPgraphic{bluebeam}
StartPage ;
numeric a ; a = 2cm ;
numeric b ; b = 0.7cm ;
numeric c ; c = 6cm ;
numeric d ; d = .7cm ;
pair zc[] ;
zc8 = ulcorner Page shifted (a/2,-2.2*a) ;
zc9 = zc8 shifted (0,-d) ;
zc10 = urcorner Page shifted (-a,-2.2*a-d) ;
zc11 = zc10 shifted (0,d) ;
zc12 = zc8 shifted (-d/2,-d/2) ;
path pa[] ;
pa[3] = zc8 .. zc12 .. zc9 -- zc10 -- zc11 -- cycle ;
fill pa[3] withcolor \MPcolor{c} ;
StopPage ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{Titlebg}
StartPage ;
numeric a ; a = 4cm ;
numeric b ; b = 3cm ;
numeric c ; c = 8cm ;
numeric d ; d = .7cm ;
path pa[] ;
pair zc [] ;
fill Page withcolor \MPcolor{a} ;
pa[1] = ulcorner Page -- ulcorner Page shifted (PaperWidth/2,0) -- llcorner Page shifted (PaperWidth/2,0) -- llcorner Page -- cycle ;
fill pa[1] withcolor \MPcolor{b} ;
zc1 = ulcorner Page shifted (PaperWidth/2,-b) ;
zc2 = zc1 shifted (-c,0) ;
zc3 = zc2 shifted (0,-a) ;
zc4 = zc3 shifted (c,0) ;
zc5 = zc2 shifted (-1.5cm,-a/2) ;
pa[2] = zc1 -- zc2 .. zc5 .. zc3 -- zc4 -- cycle ;
fill pa[2] withcolor \MPcolor{a} ;
zc6 = llcorner Page shifted (PaperWidth/2,0) ;
zc7 = 1/2[zc6,zc4] ;
zc8 = zc7 shifted (-.75*b,d/2) ;
zc9 = zc8 shifted (0,-d) ;
zc10 = zc9 shifted (1.3*c,0) ;
zc11 = zc10 shifted (0,d) ;
zc12 = zc10 shifted (d/2,d/2) ;
pa[3] = zc8 -- zc9 -- zc10 .. zc12 .. zc11 -- cycle ;
fill pa[3] withcolor \MPcolor{c} ;
StopPage ;
\stopuniqueMPgraphic

%D We define these backgrounds as overlays:

\defineoverlay
[picbackground]
[\useMPgraphic{greenframe}]

\defineoverlay
[lecbackground]
[\useMPgraphic{bluebeam}]

\defineoverlay
[titlebackground]
[\useMPgraphic{Titlebg}]

%D We use combinations for placing vertical pictures and text side by side, and
%D we want a distance of 1.1 cm between both.

\setupcombinations[distance=1.1cm]

%D These are shortcuts to switch backgrounds:

\define\lecback{\setuplayout[header=5.3cm]\setupbackgrounds[page][background={picbackground,lecbackground,slidetitle}]}
\define\titback{\setuplayout[header=2.3cm]\setupbackgrounds[page][background={titlebackground,prestitle,presauthor}]}
\define\picback{\setuplayout[header=2.3cm]\setupbackgrounds[page][background=picbackground]}
\define\noback{\setupbackgrounds[page][background=nobackground]}

\setupbackgrounds[page][background=lecbackground] 

%D The symbol for the first level of itemizations. 

\definesymbol[1][\useMPgraphic{ItSquare}]
\setupitemize[1][inmargin][color=c]

\protect
\stopmodule

\endinput