summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/s-present-slanted.mkiv
blob: a68e0cd8e57962c71cb35898c6dbe03ca609c493 (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
%D \module
%D   [      file=s-present-slanted, % was: s-pre-64,
%D        version=2006.05.11,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Environment Slanted,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D This style is kept as reference (but can be usedof course). It was used at the
%D TUG conference in San Diego in 2007 (the very early days if \LUATEX\ and \MKIV).
%D
%D This was one of he four presentations, each with a different style. The other
%D styles were quite ok but I just lack time (ane motivation) to generalize them,

\usemodule[s][pre-60]

\newcounter\shapesynctag
\newdimen  \slantedshapedimen
\newdimen  \slantedshapestep
\newdimen  \slantedshapeleftskip
\newdimen  \slantedshapeoffset
\newdimen  \slantedshapeextra
\newdimen  \slantedshapedelta

\positioningtrue

\unexpanded\def\AdaptShape
  {\doglobal\increment\shapesynctag
   \getnoflines\textheight
   \slantedshapestep\dimexpr\slantedshapeleftskip/\noflines\relax
   \leftskip\slantedshapeleftskip
   \scratchdimen\dimexpr
     \MPy{text:\MPp\shapesynctag}
    +\MPh{text:\MPp\shapesynctag}
    -\topskip
    -\MPy\shapesynctag
    +\slantedshapeextra
   \relax
   \getnoflines\scratchdimen
   \slantedshapedimen \noflines \slantedshapestep
   \scratchtoks\emptytoks
   \dorecurse{30}
     {\appendetoks
         \the\dimexpr
           -\slantedshapedimen
           +\slantedshapeoffset
           +\slantedshapedelta
         \relax
         \space
         \the\dimexpr
           \hsize
          -2\slantedshapeoffset
         \relax
         \space
      \to\scratchtoks
      \advance\slantedshapedimen \slantedshapestep}%
   \parshape 30 \the\scratchtoks
   \strut\xypos\shapesynctag}

\setuppapersize[S6][S6]

\setupinteraction
  [state=start,
   click=no]

\setupinteractionscreen
  [option=max]

\setuplayout
  [backspace=12pt,
   topspace=24pt,
   height=middle,
   width=middle,
   header=0pt,
   footer=0pt]

\definecolor[maincolor][b=.5]
\definecolor[somecolor][g=.5]
\definecolor[morecolor][r=.5]

\setupcolors
  [textcolor=maincolor]

\setupbodyfont
  [pagella]

\setupbackgrounds
  [text]% [text]
  [background={base,text,invoke}]

\definelayer
  [text]
  [width=\textwidth,
   height=\textheight]

\definelayer
  [base]
  [width=\textwidth,
   height=\textheight]

\definetype [epet] [style=,color=morecolor]
\setuptype         [style=,color=somecolor]
\slantedshapeleftskip150pt
\slantedshapeoffset   12pt
\slantedshapeextra    10pt

\startreusableMPgraphic{page}
    StartPage ;
        fill Page withcolor \MPcolor{maincolor} ;
        path p ; p := Field[Text][Text] enlarged 6pt ;
        p :=
            llcorner p shifted (0,-12pt) --
            lrcorner p shifted (-150pt,0) --
            urcorner p shifted (0,12pt) --
            ulcorner p shifted (150pt,0) --
            cycle ;
        fill p
            withcolor .9white ;
    StopPage ;
\stopreusableMPgraphic

\defineoverlay
  [page]
  [\reuseMPgraphic{page}]

\setupbackgrounds
  [page]
  [background=page]

\setupalign
  [flushleft]

\unexpanded\def\StartItem
  {\blank[line]
   \begingroup
   \EveryPar {\AdaptShape}} % beware: \ABBREV aan begin gaat fout

\unexpanded\def\StopItem
  {\endgraf
   \endgroup
   \blank[line]}

\unexpanded\def\StartType
  {\blank[halfline]
   \begingroup
   \EveryPar {\AdaptShape}
   \dontleavehmode \quad}

\unexpanded\def\StopType
  {\endgraf
   \endgroup
   \blank[halfline]}

\unexpanded\def\StartTopic#1%
  {\page
   \setlayer
     [text]
     [preset=lefttop,
      rotation=90]
     {\color[white]{\scale[height=24pt]{\strut#1}}}}

\unexpanded\def\StopTopic
  {\page}

\startsetups document:start
    \ifdefined\TitleFont \else
        \definedfont[TitleFont][Bold*default sa 4]
    \fi
    \ifdefined\MainTextFont
        \MainTextFont
    \fi
    \Banner{\documentvariable{location}}
    \StartTopic{\documentvariable{author}}
    \startstandardmakeup
        \TitleFont
        \setupinterlinespace[line=3ex]
        \vfill
        \def\docommand##1{\StartItem\dontleavehmode\quad{\morecolor##1}\StopItem}
        \processcommacommand[\documentvariable{title}]\docommand
        \vfill
    \stopstandardmakeup
    \StopTopic
\stopsetups

\startsetups document:stop
\stopsetups

\unexpanded\def\Banner#1%
  {\setuplayer
     [base]
     [state=repeat]
   \setlayer
     [base]
     [preset=rightbottom]
     {\color[white]{\scale[height=9pt]{\strut#1}}}}

\continueifinputfile{s-present-slanted.mkiv}

\usemodule[present-common]

\inputpresentationfile{tug/2007/tug-2007-fonts.tex}