s-present-split.mkiv /size: 4773 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=s-present-split, % s-pre-14,
3
%D version=1999.08.20,
4
%D title=\CONTEXT\ Style File,
5
%D subtitle=Presentation Environment Split,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
%D In the process of making a couple of simple styles for \EUROTEX\ 99, I came to
15
%D this one. The joke is in the pagenumber. This style can be used for short
16
%D presentations with much text.
17 18
\startmodule
[
present
-
split
]
19 20
\startmode
[
asintended
,
atpragma
]
\setupbodyfont
[
lucidaot
]
\stopmode
21 22
\setupbodyfont
[
1
4
.
4
pt
]
23 24
%D Since we expect text, we can best be very tolerant.
25 26
\setuptolerance
27
[
verytolerant
,
stretch
]
28 29
%D As most styles we choose a large screen page size.
30 31
\setuppapersize
32
[
S
6
][
S
6
]
33 34
\setuplayout
35
[
width
=
fit
,
36
rightedge
=
3
cm
,
37
margin
=
0
pt
,
38
rightedgedistance
=
2
cm
,
39
height
=
middle
,
40
header
=
0
pt
,
41
footer
=
0
pt
,
42
topspace
=
1
cm
,
43
backspace
=
1
cm
]
44 45
%D We only use two colors, named \type {ColorOne} and \type {ColorTwo}:
46 47
\definecolor
[
ColorOne
]
[
r
=
.
6
,
g
=
.
4
,
b
=
.
4
]
48
\definecolor
[
ColorTwo
]
[
r
=
.
4
,
g
=
.
6
,
b
=
.
6
]
49 50
%D If you've looked at the demo file, you will have noticed that the background
51
%D consists of four pieces: two filled rectangles and two half numbers. In older
52
%D versions these are put on the page using four overlays, here we use a much
53
%D cleaner implementation is the following. If you hate \METAPOST, you can run
54
%D this style in the specified mode:
55 56
\setupbackgrounds
57
[
page
]
58
[
background
=
{
number
}
]
59 60
\defineoverlay
[
number
][
\useMPgraphic
{
number
}
]
61 62
\startuseMPgraphic
{
number
}
63
StartPage
;
64
picture
Left
,
Right
;
65
numeric
Shift
;
Shift
:
=
-
TextWidth
-
BackSpace
-
RightEdgeDistance
/
2
;
66
fill
Page
withcolor
"
ColorOne
"
;
67
fill
Page
leftenlarged
Shift
withcolor
"
ColorTwo
"
;
68
if
RealPageNumber
>
1
:
69
Left
:
=
Right
:
=
textext
(
"
\bf\folio
"
)
ysized
3
cm
;
70
clip
Right
to
boundingbox
Right
shifted
(
bbwidth
(
Right
)
/
2
,
0
)
;
71
clip
Left
to
boundingbox
Left
shifted
(
-
bbwidth
(
Left
)
/
2
,
0
)
;
72
draw
Left
shifted
(
-
Shift
,
2.25
cm
)
withcolor
"
ColorTwo
"
;
73
draw
Right
shifted
(
-
Shift
,
2.25
cm
)
withcolor
"
ColorOne
"
;
74
fi
;
75
StopPage
;
76
\stopuseMPgraphic
77 78
%D We use the simple label typesetting present in \METAPOST\ because digits are
79
%D seldom kerned so real \TEX ing is not needed. As in the previous method, we let
80
%D the graphics overlap so that we don't get white lines due to rounding problems in
81
%D viewers.
82
%D
83
%D We put a button behind the text (this overlay is calculated each page).
84 85
\defineoverlay
86
[
nextpage
]
87
[
\overlaybutton
{
nextpage
}
]
88 89
\setupbackgrounds
90
[
text
]
91
[
backgroundoffset
=
.
5
cm
,
92
background
=
nextpage
]
93 94
%D We still have to turn on interaction mode.
95 96
\setupinteraction
97
[
state
=
start
,
98
display
=
new
,
99
menu
=
on
]
100 101
\setupinteraction
102
[
color
=
,
103
contrastcolor
=]
104 105
%D Next we define structuring commands.
106 107
\definehead
[
Topic
]
[
chapter
]
\setuphead
[
Topic
]
[
style
=
\bfc
]
108
\definehead
[
Subject
][
section
]
\setuphead
[
Subject
][
style
=
\bfa
]
109 110
\setuphead
111
[
Topic
,
Subject
]
112
[
number
=
no
,
113
after
=
{
\blank
[
big
]
}
]
114 115
%D Because we will provide a menu, we don't offer lists.
116 117
\let
\Topics
\gobbleoneargument
118
\let
\Subjects
\relax
119 120
%D The table of contents goes to the right edge.
121 122
\startinteractionmenu
[
right
]
123
\setupinteraction
124
[
color
=
black
,
125
contrastcolor
=
Two
]
126
\placelist
127
[
Topic
]
128
[
alternative
=
e
,
129
frame
=
off
,
130
criterium
=
all
]
131
\vfill
132
\stopinteractionmenu
133 134
\setuplist
135
[
Topic
]
136
[
width
=
\rightedgewidth
,
137
maxwidth
=
\rightedgewidth
,
138
style
=
\bfa
]
139 140
%D We safe some space:
141 142
\setupwhitespace
143
[
medium
]
144 145
\setupblank
146
[
medium
]
147 148
%D In the titlepage, we still use the \TEX\ overlays, so that we don't have to
149
%D define a second graphic.
150 151
\unexpanded
\def
\TitlePage
#
1
%
152
{
\StartTitlePage
#
1
\StopTitlePage
}
153 154
\unexpanded
\def
\StartTitlePage
155
{
\startstandardmakeup
156
\setupalign
[
middle
]
157
\unexpanded
\def
\\
{
\vfil
\bfb
\setupinterlinespace
}
158
\bfd
\setupinterlinespace
159
\vfil
}
160 161
\unexpanded
\def
\StopTitlePage
162
{
\vfil\vfil\vfil
163
\stopstandardmakeup
}
164 165
\startsetups
document
:
start
166
\StartTitlePage
167
\documentvariable
{
title
}
168
\doifsomething
{
\documentvariable
{
subtitle
}}
{
169
\\
170
\documentvariable
{
subtitle
}
171
}
172
\doifsomething
{
\documentvariable
{
location
}}
{
173
\\
174
\documentvariable
{
location
}
175
}
176
\StopTitlePage
177
\stopsetups
178 179
\startsetups
document
:
stop
180
%
181
\stopsetups
182 183
\stopmodule
184 185
%D This is it.
186 187
\continueifinputfile
{
s
-
present
-
split
.
mkiv
}
188 189
\usemodule
[
present
-
common
]
190 191
\inputpresentationfile
{
examples
/
present
-
split
-
0
0
1
.
tex
}
192