s-present-banner.mkiv /size: 3110 b    last modification: 2020-07-01 14:35
1
2
%D [ file=s-present-banner,
3
%D version=2016.04.30, % around
4
%D title=\CONTEXT\ Style File,
5
%D subtitle=Presentation Environment Banner,
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 This style was made for the Bacho\TeX\ 2016 conference. The banner below
15
%D the text advances through the title.
16 17
\startmodule
[
present
-
banner
]
18 19
\definecolor
[
maincolor
]
[
b
=
.
6
5
]
20
\definecolor
[
othercolor
][
s
=
.
3
5
]
21 22
\startluacode
23
function
mp
.
Banner
(
s
,
mode
)
24
-- local r = tex.count.realpageno
25
local
r
=
tex
.
count
.
realpageno
-
1
26
local
n
=
#
s
27
local
i
=
mode
and
1
or
0
28
local
t
=
string
.
gsub
(
s
,
"
.
"
,
function
(
s
)
29
if
s
=
=
"
"
or
i
>
n
then
30
return
s
31
elseif
i
=
=
r
then
32
i
=
i
+
1
33
if
mode
then
34
return
"
\\color[othercolor]{
"
.
.
s
.
.
"
}
"
35
else
36
return
"
\\maincolor
"
.
.
s
37
end
38
else
39
i
=
i
+
1
40
return
s
41
end
42
end
)
43
mp
.
quoted
(
t
)
44
end
45
\stopluacode
46 47
\startuseMPgraphic
{
page
}
48
StartPage
;
49
fill
Page
withcolor
\MPcolor
{
maincolor
}
;
50
draw
anchored
(
image
(
51
% draw textext.top (lua.mp.Banner("\documentvariable{title}",true))
52
draw
textext
.
top
(
lua.mp.Banner
(
"
\documentvariable{title}
"
,
false
)
)
53
xsized
(
.9
PaperWidth
)
54
withcolor
white
;
55
)
,
center
bottomboundary
Page
)
;
56
% fill Field[Text][Text] enlarged 10pt withcolor (\MPcolor{maincolor})/1.5 ;
57
fill
Field
[
Text
]
[
Text
]
enlarged
10
pt
withcolor
.1
white
;
58
StopPage
;
59
\stopuseMPgraphic
60 61
\setupbackgrounds
62
[
page
]
63
[
background
=
page
]
64 65
\defineoverlay
66
[
page
]
67
[
\useMPgraphic
{
page
}
]
68 69
\setupbodyfont
70
[
lucidaot
,
1
0
pt
]
71 72
\setuppapersize
73
[
S
6
]
74 75
\setuplayout
76
[
backspace
=
3
0
pt
,
77
width
=
middle
,
78
height
=
middle
,
79
topspace
=
3
0
pt
,
80
bottomspace
=
1
0
0
pt
,
81
header
=
0
pt
,
82
footer
=
0
pt
,
83
margin
=
0
pt
]
84 85
\setupcolors
86
[
textcolor
=
white
]
87 88
\setupwhitespace
89
[
big
]
90 91
\setuphead
92
[
chapter
]
93
[
style
=
\bfd
,
94
after
=
{
\blank
[
big
]
}
]
95 96
\setuphead
97
[
section
]
98
[
style
=
\bfa
,
99
before
=
\blank
,
100
after
=
{
\blank
[
medium
]
}
]
101 102
\definehighlight
[
nb
][
style
=
bold
]
103 104
\setupitemgroup
[
itemize
][
before
=
,
after
=]
105
\setupitemgroup
[
itemize
][
packed
]
106 107
\setupdocument
108
[
title
=
Title
,
109
subtitle
=
Subtitle
,
110
location
=
\currentdate
]
111 112
\startsetups
document
:
start
113 114
\startstandardmakeup
115 116
\raggedcenter
117 118
\dontleavehmode
\scale
[
width
=
1
.
0
0
\textwidth
]
{
\documentvariable
{
title
}}
\vfil
119
\dontleavehmode
\scale
[
width
=
0
.
7
5
\textwidth
]
{
\documentvariable
{
subtitle
}}
\vfil
120
\dontleavehmode
\scale
[
width
=
0
.
4
5
\textwidth
]
{
\documentvariable
{
location
}}
\vfil
121 122
\stopstandardmakeup
123 124
\stopsetups
125 126
\stopmodule
127 128
\continueifinputfile
{
s
-
present
-
banner
.
mkiv
}
129 130
\usemodule
[
present
-
common
]
131 132
\inputpresentationfile
{
bachotex
/
2
0
1
6
/
bachotex
-
2
0
1
6
-
opentype
.
tex
}
133