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