summaryrefslogtreecommitdiff
path: root/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-redframe.tex
blob: 9538360af8af86971ae42546c0834ee015b50042 (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
%D \module
%D   [      file=t-redframe,
%D        version=2007.07.17, 
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module redframe,
%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{redframe} style for the presentation
%D module. It is loaded at runtime. The look of this style was inspired by the
%D screen version of the Metafun manual. 

\writestatus{loading}{module redframe}

\startmodule[redframe]

\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 start colors:

\setupcolors[state=start]

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

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

%D The page layout:

\setuplayout [width=fit,
              margin=2cm,
              height=fit,
	      leftmargindistance=1cm,
	      rightmargindistance=0cm,
              header=2.8cm, 
              footer=1cm, 
              topspace=.7cm, 
              backspace=2cm,
              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=20mm,
    y=16mm]

\define[1]\Slidetitle{\page\setlayer[slidetitle]%
     {\framed[frame=off,width=\textwidth,height=2.3cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[FrameColor]{#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.

\define\Maketitle{%
\titback
\null
\vfill
\midaligned{\switchtobodyfont[\Titlesize]\color[FrameColor]{\getvariable{taspresent}{title}}}
\blank[2*line]
\midaligned{\color[FrameColor]{\getvariable{taspresent}{author}}}
\blank[3*line]
\midaligned{\color[FrameColor]{\currentdate}}
\vfill
\null}

%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 define our colors:

\definecolor [lightb]           [s=.75]
\definecolor [darkb] 	        [s=.2]
\definecolor [BackgroundColor]  [s=.6]
\definecolor [FrameColor]       [r=.55, g=0, b=.04]
\definecolor [Item]             [r=.55, g=0, b=.04]
\definecolor [DarkYellow]       [s=.6]%[r=.73, g=.61, b=.25] % gray looks better?

%D We let Metapost calculate the background:

\startuniqueMPgraphic{slide} 
StartPage ;
path p[] ;
a=1.5cm ;
fill Page withcolor \MPcolor{lightb} ;
path Main ;
z1 = ulcorner Page shifted (a,0) ;
z2 = urcorner Page shifted (-a,0) ;
z3 = urcorner Page shifted (0,-a) ;
z4 = lrcorner Page shifted (0,a) ;
z5 = (x2,0) ;
z6 = (x1,0) ;
z7 = (0,y4) ;
z8 = (0,y3) ;
z9 = (x1,y3) ;
z10 = (x2,y3) ;
z11 = (x2,y4) ;
z12 = (x1,y4) ;
p[1] = z9 -- z12 -- z7 -- z8 -- cycle ;
p[2] = z10 -- z3 -- z4 -- z11 --cycle ;
p[3] = z12 -- z11 -- z5 -- z6 --cycle ;
p[4] = z9 -- z10 -- z2 -- z1 -- cycle ;
fill p[1] withcolor \MPcolor{darkb} ;
fill p[2] withcolor \MPcolor{darkb} ;
fill p[3] withcolor \MPcolor{darkb} ;
fill p[4] withcolor \MPcolor{darkb} ;
pickup pencircle scaled 8 pt ;
draw z1 -- z6 withcolor \MPcolor{FrameColor} ;
draw z2 -- z5 withcolor \MPcolor{FrameColor} ;
draw z7 -- z4 withcolor \MPcolor{FrameColor} ;
draw z8 -- z3 withcolor \MPcolor{FrameColor} ;
StopPage ;
\stopuniqueMPgraphic 

\startuseMPgraphic{Bottombg}
StartPage
path Q[] ;
path R[] ;
z4 = llcorner Page shifted (2cm,0.75cm) ;
z5 = lrcorner Page shifted (-2cm,0.75cm) ;
Q[1] = z4 -- z[5] ;
oa = NOfPages - 2 ;
ob = PageNumber - 2 ;
oc = arclength(Q[1]) ;
od = oc/oa ;
oe = oc/oa ;
Q[2] = fullcircle scaled .4 cm shifted (2cm,0.65cm) ;
fill Q[2] withcolor \MPcolor{DarkYellow} ;
for i = 1 upto NOfPages-2:
	R[i] = Q[2] shifted (i*od,0) ;
	fill R[i] withcolor \MPcolor{DarkYellow} ;
endfor ;
if PageNumber > 1 :
	Q[2] := Q[2] shifted (od*ob,0) ;
	fill Q[2] withcolor yellow ;
fi ;
StopPage
\stopuseMPgraphic

%D We define these backgrounds as overlays:

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

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

\defineoverlay 
[bottom] 
[\useMPgraphic{Bottombg}] 

%D These are shortcuts to switch backgrounds:

\define\lecback{\setuplayout[header=2.8cm]\setupbackgrounds[page][background={lecbackground,bottom,slidetitle}]}
\define\titback{\setuplayout[header=1cm]\setupbackgrounds[page][background=lecbackground]}
\define\picback{\setuplayout[header=1cm]\setupbackgrounds[page][background={lecbackground,bottom}]}
\define\noback{\setupbackgrounds[page][background=nobackground]}

%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 The symbol for the first level of itemizations. 

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

\protect
\stopmodule

\endinput