summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-simpleslides/tex/context/third/simpleslides/s-simpleslides-HorizontalStripes.tex
blob: 13856fdf085c3b3a022d05f7d726ee478c90c0b4 (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=simpleslides-s-HorizontalStripes,
%D        version=2022.07.13,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module HorizontalStripes,
%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 \filename{HorizontalStripes} style for the
%D presentation module. It is loaded at runtime. The look of this style was
%D inspired by the \quotation{Copenhagen} theme of the \LaTeX\ {\tt beamer}
%D package.

\writestatus{simpleslides}{loading HorizontalStripes style}

\startmodule[simpleslides-s-HorizontalStripes]

\unprotect

%D The page layout:

\setuplayout [width=fit,
              margin=0cm,
              height=fit,
              header=2.73cm,
              footer=0.9cm,
              topspace=0cm,
              backspace=1cm,
              location=singlesided]

\setuplayout [simpleslides:layout:horizontal][header=2.73cm]
\setuplayout [simpleslides:layout:vertical]  [header=0.75cm]
\setuplayout [simpleslides:layout:title]     [header=0cm]

%D Some strings are configurable.

\setuplabeltext [\s!en]    [of=of]
\setuplabeltext [\s!de]    [of=von]

%D In this style, we don't want the ornament background for vertical slides:

\startsetups simpleslides:background:vertical
  \setuplayout[simpleslides:layout:vertical]
  \setupbackgrounds[\v!page]
        [background={simpleslides:background:vertical}]
\stopsetups



%D We also specify the position of the slidetitle.

\setuplayer[simpleslides:layer:slidetitle]
    [width=\paperwidth,
    height=\paperheight,
    x=10mm]

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

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

%D This module has three color schemes, blue, green and red.

\startsetups simpleslides:setups:blue
\definecolor [simpleslides:backgroundcolor]  [s=.95]
\definecolor [simpleslides:framecolor]       [r=.58,g=.58,b=.82]
\definecolor [simpleslides:contrastcolor]    [r=.2,g=.2,b=.73]
\definecolor [simpleslides:itemize:color]    [simpleslides:contrastcolor]
\stopsetups

\startsetups simpleslides:setups:red
\definecolor [simpleslides:backgroundcolor]  [s=.95]
\definecolor [simpleslides:framecolor]       [r=.82,g=.58,b=.58]
\definecolor [simpleslides:contrastcolor]    [r=.73,g=.2,b=.2]
\definecolor [simpleslides:itemize:color]    [simpleslides:contrastcolor]
\stopsetups

\startsetups simpleslides:setups:green
\definecolor [simpleslides:backgroundcolor]  [s=.95]
\definecolor [simpleslides:framecolor]       [r=.58,g=.82,b=.58]
\definecolor [simpleslides:contrastcolor]    [r=.2,g=.73,b=.2]
\definecolor [simpleslides:itemize:color]    [simpleslides:contrastcolor]
\stopsetups

%D Now we choose the scheme that the user asked for

\doifsetupselse{simpleslides:setups:\moduleparameter{simpleslides}{color}}
    {\setups{simpleslides:setups:\moduleparameter{simpleslides}{color}}}
    {\setups{simpleslides:setups:blue}}

%D We let Metapost calculate the background:

\startuseMPgraphic{simpleslides:MP:common}
save a ; numeric a ;
a = 1.5mm ;

save p; path p[] ;

fill Page withcolor \MPcolor{simpleslides:backgroundcolor} ;

z1 = ulcorner Page shifted (0,-a) ;
z2 = urcorner Page shifted (0,-a) ;
z3 = llcorner Page shifted (0,a) ;
z4 = lrcorner Page shifted (0,a) ;

p[1] = ulcorner Page -- z1 -- z2 -- urcorner Page -- cycle ;
p[3] = llcorner Page -- z3 -- z4 -- lrcorner Page -- cycle ;
p[4] = p[3] shifted (0,.75cm) ;

fill p[1] withcolor \MPcolor{simpleslides:framecolor} ;
fill p[3] withcolor \MPcolor{simpleslides:framecolor} ;
fill p[4] withcolor \MPcolor{simpleslides:framecolor} ;
\stopuseMPgraphic

\startuniqueMPgraphic{simpleslides:MP:vertical}
StartPage ;
\includeMPgraphic{simpleslides:MP:common} ;
StopPage ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{simpleslides:MP:horizontal}
StartPage ;
\includeMPgraphic{simpleslides:MP:common} ;

p[2] = p[1] shifted (0,-2cm) ;
fill p[2] 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:vertical}]

%D We define the footer

\setupfooter[\c!color=simpleslides:contrastcolor,
             \c!style={\switchtobodyfont[10pt]},
             \c!strut=\v!yes]

\setupfootertexts[{\framed[\c!frame=\v!off,
                           \c!height=0.65cm,
                           \c!width=\textwidth]
                           {\simpleslidestitleparameter{title}
                            \hfill \pagenumber\ \labeltext{of} \lastpage}}]


%D this sets up the title page:

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

%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.2cm,
   \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