s-pre-67.tex /size: 3968 b    last modification: 2020-07-01 14:35
1
% todo: version of placement that also takes the sync node
2 3
\usemodule
[
s
][
abr
-
0
2
]
4
\usemodule
[
s
][
pre
-
6
0
]
5 6
\definecolor
[
red
:
fullcolor
]
[
r
=
1
]
7
\definecolor
[
red
:
lightcolor
]
[
r
=
.
5
]
8
\definecolor
[
red
:
darkcolor
]
[
r
=
.
3
7
5
]
9 10
\definecolor
[
green
:
fullcolor
]
[
g
=
1
]
11
\definecolor
[
green
:
lightcolor
]
[
g
=
.
5
]
12
\definecolor
[
green
:
darkcolor
]
[
g
=
.
3
7
5
]
13 14
\definecolor
[
blue
:
fullcolor
]
[
b
=
1
]
15
\definecolor
[
blue
:
lightcolor
]
[
b
=
.
5
]
16
\definecolor
[
blue
:
darkcolor
]
[
b
=
.
3
7
5
]
17 18
\definepalet
[
red
-
scheme
]
[
fullcolor
=
red
:
fullcolor
,
lightcolor
=
red
:
lightcolor
,
darkcolor
=
red
:
darkcolor
]
19
\definepalet
[
green
-
scheme
][
fullcolor
=
green
:
fullcolor
,
lightcolor
=
green
:
lightcolor
,
darkcolor
=
green
:
darkcolor
]
20
\definepalet
[
blue
-
scheme
]
[
fullcolor
=
blue
:
fullcolor
,
lightcolor
=
blue
:
lightcolor
,
darkcolor
=
blue
:
darkcolor
]
21 22
\setuppalet
[
red
-
scheme
]
23 24
\setupcolors
25
[
textcolor
=
darkcolor
]
26 27
\setupinteraction
28
[
color
=
darkcolor
,
29
contrastcolor
=
darkcolor
]
30 31
\startuseMPgraphic
{
bullet
}
32
path
b
,
p
;
33
p
:
=
fullsquare
scaled
.5
LineHeight
;
34
b
:
=
boundingbox
p
;
35
p
:
=
p
rotatedaround
(
center
p
,
45
)
;
36
p
:
=
p
shifted
(
0
,
-.125
StrutDepth
)
;
37
fill
p
withcolor
\MPcolor
{
lightcolor
}
;
38
setbounds
currentpicture
to
b
;
39
\stopuseMPgraphic
40 41
\startuseMPgraphic
{
bar
}
42
path
b
,
p
;
43
p
:
=
fullsquare
scaled
.25
LineHeight
;
44
b
:
=
boundingbox
p
;
45
p
:
=
p
rotatedaround
(
center
p
,
45
)
;
46
p
:
=
p
shifted
(
0
,
+.25
StrutDepth
)
;
47
fill
p
withcolor
\MPcolor
{
lightcolor
}
;
48
setbounds
currentpicture
to
b
;
49
\stopuseMPgraphic
50 51
\startuseMPgraphic
{
page
}
52
StartPage
;
53
fill
Page
enlarged
5
mm
withcolor
.1
[
white
,
\MPcolor
{
fullcolor
}
]
;
54
interim
linecap
:
=
butt
;
55
numeric
h
;
h
:
=
bbheight
(
Page
)
/
4
;
56
numeric
w
;
w
:
=
bbwidth
(
Page
)
/
4
;
57
h
:
=
h
randomized
(
h
)
;
58
w
:
=
w
randomized
(
w
)
;
59
draw
60
ulcorner
Page
shifted
(
0
,
-
h
)
--
ulcorner
Page
--
ulcorner
Page
shifted
(
w
,
0
)
61
withpen
pensquare
scaled
.5
cm
62
withcolor
\MPcolor
{
lightcolor
}
;
63
numeric
h
;
h
:
=
bbheight
(
Page
)
/
4
;
64
numeric
w
;
w
:
=
bbwidth
(
Page
)
/
4
;
65
h
:
=
h
randomized
(
h
)
;
66
w
:
=
w
randomized
(
w
)
;
67
draw
68
lrcorner
Page
shifted
(
0
,
h
)
--
lrcorner
Page
--
lrcorner
Page
shifted
(
-
w
,
0
)
69
withpen
pensquare
scaled
.5
cm
70
withcolor
\MPcolor
{
lightcolor
}
;
71
setbounds
currentpicture
to
Page
;
72
StopPage
;
73
\stopuseMPgraphic
74 75
\defineoverlay
[
page
][
\useMPgraphic
{
page
}
]
76 77
\definesymbol
[
1
][
\reuseMPgraphic
{
bullet
}
]
78
\definesymbol
[
2
][
\reuseMPgraphic
{
bar
}
]
79 80
\setupitemgroup
[
itemize
][
2
][
width
=
1
em
]
81 82
\setupinteraction
83
[
state
=
start
,
84
click
=
no
]
85 86
\setuppapersize
87
[
S
6
][
S
6
]
88 89
\setuplayout
90
[
width
=
middle
,
91
height
=
middle
,
92
header
=
0
pt
,
93
footer
=
0
pt
,
94
backspace
=
1
cm
,
95
% topspace=1cm]
96
topspace
=
.
5
cm
]
97 98
\setupbackgrounds
99
[
page
]
100
[
background
=
page
]
101 102
\setuphead
103
[
chapter
]
104
[
command
=
\MyCommand
,
105
before
=
,
106
after
=
{
\blank
[
disable
]
}
,
107
color
=
lightcolor
,
108
style
=
\bfc
]
109 110
\definelayer
111
[
title
]
112
[
width
=
\paperwidth
,
113
height
=
\paperheight
]
114 115
\setupbackgrounds
116
[
page
]
117
[
background
=
{
page
,
title
}
]
118 119
\setupwhitespace
120
[
big
]
121 122
\unexpanded
\def
\MyCommand
#
1
#
2
%
123
{
\setlayer
[
title
][
preset
=
rightbottom
,
x
=
.
7
5
cm
,
y
=
.
5
cm
]
{
#
2
}}
124 125
\def
\titlepage
#
1
#
2
%
126
{
\startstandardmakeup
127
\definefont
[
LargeFont
][
Normal
at
1
0
0
pt
]
128
\setlayerframed
129
[
title
]
130
[
preset
=
lefttop
,
x
=
1
cm
,
y
=
.
2
5
cm
]
131
[
align
=
flushleft
,
foregroundstyle
=
\LargeFont
,
offset
=
0
pt
,
foregroundcolor
=
lightcolor
,
frame
=
off
]
132
{
#
1
}
133
\definefont
[
SmallFont
][
Normal
at
5
0
pt
]
134
\setlayerframed
135
[
title
]
136
[
preset
=
rightbottom
,
x
=
1
cm
,
y
=
.
5
cm
]
137
[
align
=
flushright
,
foregroundstyle
=
\SmallFont
,
offset
=
0
pt
,
foregroundcolor
=
lightcolor
,
frame
=
off
]
138
{
#
2
}
139
\stopstandardmakeup
}
140 141
\let
\Title
\title
142
\let
\TitlePage
\titlepage
143 144
\doifnotmode
{
demo
}{
\endinput
}
145 146
\starttext
147
\chapter
{
Test
}
148
\startitemize
149
\startitem
test
\stopitem
150
\startitem
test
\stopitem
151
\startitem
test
\stopitem
152
\stopitemize
153
\stoptext
154 155
\endinput
156