summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-simpleslides/context-simpleslides/tex/context/third/simpleslides/s-simpleslides-NarrowStripes.tex
blob: 29431e026aeb1cac076de297ffdfd6f3f29ff1e5 (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
%D \module
%D   [      file=simpleslides-s-NarrowStripes,
%D        version=2022.07.13,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module NarrowStripes,
%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{NarrowStripes} 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{simpleslides}{loading NarrowStripes style}

\startmodule[simpleslides-s-NarrowStripes]

\unprotect

%D First, we change 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 We also specify the position of the slidetitle.

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

%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:altcontrastcolor]            [r=0,g=0,b=1]
\definecolor [simpleslides:variantcolor]                [r=.69,g=.69,b=.97]
\definecolor [simpleslides:contrastcolor]               [b=.8]
\definecolor [simpleslides:itemize:color]               [b=.8]
\stopsetups

\startsetups simpleslides:setups:red
\definecolor [simpleslides:itemize:color]               [r=.8]
\definecolor [simpleslides:backgroundcolor]             [s=.95]
\definecolor [simpleslides:altcontrastcolor]            [r=1]
\definecolor [simpleslides:variantcolor]                [b=.69,g=.69,r=.97]
\definecolor [simpleslides:contrastcolor]               [r=.8]
\stopsetups

\startsetups simpleslides:setups:green
\definecolor [simpleslides:itemize:color]               [g=.4]
\definecolor [simpleslides:backgroundcolor]             [s=.95]
\definecolor [simpleslides:altcontrastcolor]            [g=.4]
\definecolor [simpleslides:variantcolor]                [b=.68,r=.68,g=.79]
\definecolor [simpleslides:contrastcolor]               [g=.4]
\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:

\definetextext[simpleslides:sometxt:text] {\TaspresentSometxtText}

\unexpanded\def\TaspresentSometxtText#1%
  {\framed[\c!frame=\v!off, \c!width=2.25cm, \c!height=2.25cm]
   {\switchtobodyfont[12pt]\color[simpleslides:contrastcolor]{#1}}}

\startuseMPgraphic{simpleslides:MP:ornament}
StartPage ;

save a,b,c ; numeric a,b,c ;
a = 2.25cm ;
b = 0.4 cm ;
c = PaperHeight - a/2 ;

z1 = ulcorner Page shifted (0,-a) ;
z2 = ulcorner Page shifted (0,-a-b) ;
z3 = urcorner Page shifted (0,-a-b) ;
z4 = urcorner Page shifted (0,-a) ;
z5 = ulcorner Page shifted (a,0) ;
z6 = ulcorner Page shifted (a+b,0) ;
z7 = llcorner Page shifted (a+b,0) ;
z8 = llcorner Page shifted (a,0) ;
z9 = ulcorner Page shifted (a,-a) ;
z10 = ulcorner Page shifted (a+b,-a) ;
z11 = ulcorner Page shifted (a+b,-a-b) ;
z12 = ulcorner Page shifted (a,-a-b) ;

save p; path p[] ;
p[1] = z1 -- z2 -- z3 -- z4 -- cycle ;
p[2] = z5 -- z6 -- z7 -- z8 -- cycle ;
p[3] = z9 -- z10 --z11 -- z12 -- cycle ;

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

linear_shade(p[2],2,
             \MPcolor{simpleslides:altcontrastcolor},
             \MPcolor{simpleslides:backgroundcolor}) ;

fill p[3] withcolor \MPcolor{simpleslides:variantcolor} ;

if RealPageNumber > 1:
	draw \sometxt[simpleslides:sometxt:text]{\pagenumber} shifted (0,PaperHeight-a) ;
fi ;
StopPage ;
\stopuseMPgraphic

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

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

%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.25cm,
   \c!after=]

%D The symbol for the first level of itemizations.

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

\protect
\stopmodule

\endinput