summaryrefslogtreecommitdiff
path: root/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-narrowstripe.tex
blob: 52ca9d8b4127e36aeb7406f68372810bf40847fa (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
%D \module
%D   [      file=t-narrowstripe,
%D        version=2007.07.25, 
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module narrowstripe,
%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{narrowstripe} 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 narrowstripe}

\startmodule[narrowstripe]

\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 The narrowframe module has parameters of its own; we set them up and use
%D them:

\setupmodule[color=blue]

\processaction[\currentmoduleparameter{color}]
	[         red=>\def\colormode{redmode},
                 blue=>\def\colormode{bluemode},
                green=>\def\colormode{greenmode},
           \v!unknown=>\def\colormode{bluemode},
           \v!default=>\def\colormode{bluemode}]

\enablemode[\colormode]

%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.8cm,
              rightmargindistance=0pt,
              height=fit, 
              header=2.5cm, 
              footer=0cm, 
              topspace=.4cm, 
              backspace=3.2cm,
	      cutspace=3.7cm,
              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=32mm]

\define[1]\Slidetitle{\page\setlayer[slidetitle]%
     {\framed[framecolor=red,frame=off,width=\textwidth,height=2.25cm,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[d]{#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[d]{\getvariable{taspresent}{title}}}
\blank[2*line]
\midaligned{\color[d]{\getvariable{taspresent}{author}}}
\blank[3*line]
\midaligned{\color[d]{\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, depending on the mode:

\startmode[bluemode]
\definecolor [Item]            [b=.8]
\definecolor [a]               [s=.95]
\definecolor [b]               [r=0,g=0,b=1]
\definecolor [c]               [r=.69,g=.69,b=.97]
\definecolor [d]               [b=.8]
\stopmode

\startmode[redmode]
\definecolor [Item]            [r=.8]
\definecolor [a]               [s=.95]
\definecolor [b]               [r=1]
\definecolor [c]               [b=.69,g=.69,r=.97]
\definecolor [d]               [r=.8]
\stopmode

\startmode[greenmode]
\definecolor [Item]            [g=.4]
\definecolor [a]               [s=.95]
\definecolor [b]               [g=.4]
\definecolor [c]               [b=.68,r=.68,g=.79]
\definecolor [d]               [g=.4]
\stopmode

%D We let Metapost calculate the background:

\startuseMPgraphic{narrow}
StartPage ;
numeric a ;
numeric b ;
numeric c ;
c = PaperHeight - a/2 ;
pair za[] ;
path p[] ;
a = 2.25cm ;
b = 0.4 cm ;
za1 = ulcorner Page shifted (0,-a) ;
za2 = ulcorner Page shifted (0,-a-b) ;
za3 = urcorner Page shifted (0,-a-b) ;
za4 = urcorner Page shifted (0,-a) ;
za5 = ulcorner Page shifted (a,0) ;
za6 = ulcorner Page shifted (a+b,0) ;
za7 = llcorner Page shifted (a+b,0) ;
za8 = llcorner Page shifted (a,0) ;
za9 = ulcorner Page shifted (a,-a) ;
za10 = ulcorner Page shifted (a+b,-a) ;
za11 = ulcorner Page shifted (a+b,-a-b) ;
za12 = ulcorner Page shifted (a,-a-b) ;
p[1] = za1 -- za2 -- za3 -- za4 -- cycle ;
p[2] = za5 -- za6 -- za7 -- za8 -- cycle ;
p[3] = za9 -- za10 --za11 -- za12 -- cycle ;
linear_shade(p[1],1,\MPcolor{a},\MPcolor{b}) ;
linear_shade(p[2],2,\MPcolor{b},\MPcolor{a}) ;
fill p[3] withcolor \MPcolor{c} ;
draw \sometxt{\framed[frame=off,width=2.25cm,height=2.25cm]{\color[d]{\tfx \folio}}} shifted (0,PaperHeight-a) ;
StopPage ;
\stopuseMPgraphic

%D We define these backgrounds as overlays:

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

%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{\setupbackgrounds[page][background={lecbackground,slidetitle}]}
\define\titback{\setupbackgrounds[page][background=lecbackground]}
\define\picback{\setupbackgrounds[page][background={lecbackground,slidetitle}]}
\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=d]

\protect
\stopmodule

\endinput