summaryrefslogtreecommitdiff
path: root/tex/context
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2016-11-01 11:41:49 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-11-01 11:41:49 +0100
commit5a501d72ddc9ab9003746aa46fad3a12046e20ec (patch)
tree961dfe1070db46aa798ec0dc553f19b60f8355c6 /tex/context
parentf0bc9c17c5298a3a4645f28a39273f52c27c646a (diff)
downloadcontext-5a501d72ddc9ab9003746aa46fad3a12046e20ec.tar.gz
2016-11-01 10:15:00
Diffstat (limited to 'tex/context')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkiv/cldf-ini.lua44
-rw-r--r--tex/context/base/mkiv/cont-fil.mkiv43
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/l-string.lua12
-rw-r--r--tex/context/base/mkiv/l-table.lua11
-rw-r--r--tex/context/base/mkiv/lang-def.mkiv8
-rw-r--r--tex/context/base/mkiv/page-flw.mkiv39
-rw-r--r--tex/context/base/mkiv/publ-dat.lua31
-rw-r--r--tex/context/base/mkiv/publ-tra.lua21
-rw-r--r--tex/context/base/mkiv/scrn-bar.mkvi34
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin25670 -> 25644 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin368426 -> 368441 bytes
-rw-r--r--tex/context/base/mkiv/strc-def.mkiv2
-rw-r--r--tex/context/base/mkiv/strc-pag.mkiv2
-rw-r--r--tex/context/base/mkiv/strc-ren.mkiv49
-rw-r--r--tex/context/base/mkiv/strc-sec.mkiv10
-rw-r--r--tex/context/base/mkiv/syst-aux.mkiv7
-rw-r--r--tex/context/base/mkiv/typo-mar.mkiv42
-rw-r--r--tex/context/base/mkiv/util-jsn.lua21
-rw-r--r--tex/context/base/mkiv/util-tab.lua10
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin836213 -> 835924 bytes
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin60767 -> 60764 bytes
-rw-r--r--tex/context/interface/mkiv/i-section.xml6
-rw-r--r--tex/context/modules/common/s-pre-00.tex2
-rw-r--r--tex/context/modules/common/s-pre-12.tex92
-rw-r--r--tex/context/modules/common/s-pre-15.tex70
-rw-r--r--tex/context/modules/common/s-pre-16.tex80
-rw-r--r--tex/context/modules/common/s-pre-23.tex14
-rw-r--r--tex/context/modules/mkii/s-pre-01.mkii (renamed from tex/context/modules/common/s-pre-01.tex)0
-rw-r--r--tex/context/modules/mkii/s-pre-02.mkii (renamed from tex/context/modules/common/s-pre-02.tex)0
-rw-r--r--tex/context/modules/mkii/s-pre-03.mkii (renamed from tex/context/modules/common/s-pre-03.tex)0
-rw-r--r--tex/context/modules/mkii/s-pre-04.mkii (renamed from tex/context/modules/common/s-pre-04.tex)0
-rw-r--r--tex/context/modules/mkii/s-pre-05.mkii (renamed from tex/context/modules/common/s-pre-05.tex)2
-rw-r--r--tex/context/modules/mkii/s-pre-09.mkii (renamed from tex/context/modules/common/s-pre-09.tex)0
-rw-r--r--tex/context/modules/mkii/s-pre-10.mkii (renamed from tex/context/modules/common/s-pre-10.tex)0
-rw-r--r--tex/context/modules/mkii/s-pre-11.mkii (renamed from tex/context/modules/common/s-pre-11.tex)30
-rw-r--r--tex/context/modules/mkiv/s-present-banner.mkiv2
-rw-r--r--tex/context/modules/mkiv/s-present-colorful.mkiv384
-rw-r--r--tex/context/modules/mkiv/s-present-common.mkiv4
-rw-r--r--tex/context/modules/mkiv/s-present-funny.mkiv208
-rw-r--r--tex/context/modules/mkiv/s-present-fuzzy.mkiv225
-rw-r--r--tex/context/modules/mkiv/s-present-green.mkiv349
-rw-r--r--tex/context/modules/mkiv/s-present-grow.mkiv171
-rw-r--r--tex/context/modules/mkiv/s-present-original.mkiv397
-rw-r--r--tex/context/modules/mkiv/s-present-punk.mkiv27
-rw-r--r--tex/context/modules/mkiv/s-present-random.mkiv42
-rw-r--r--tex/context/modules/mkiv/s-present-shaded.mkiv12
-rw-r--r--tex/context/modules/mkiv/s-present-stack.mkiv194
-rw-r--r--tex/context/modules/mkiv/s-present-stepper.mkiv134
-rw-r--r--tex/context/modules/mkiv/s-present-stepwise.mkiv10
-rw-r--r--tex/context/modules/mkiv/s-present-windows.mkiv350
54 files changed, 2766 insertions, 433 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index ccbf33ef8..3e4ba8a57 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2016.10.25 09:57}
+\newcontextversion{2016.11.01 10:08}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index a8c8bd00b..47fce6bfe 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2016.10.25 09:57}
+\edef\contextversion{2016.11.01 10:08}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua
index 3d8671149..66582ae4f 100644
--- a/tex/context/base/mkiv/cldf-ini.lua
+++ b/tex/context/base/mkiv/cldf-ini.lua
@@ -1317,18 +1317,34 @@ do
-- formatted.command([catcodes,]format[,...])
+-- local function formattedflush(parent,c,catcodes,fmt,...)
+-- if type(catcodes) == "number" then
+-- if fmt then
+-- local result
+-- pushcatcodes(catcodes)
+-- result = writer(parent,c,formatters[fmt](...))
+-- popcatcodes()
+-- return result
+-- else
+-- -- no need to change content catcodes
+-- return writer(parent,c)
+-- end
+-- else
+-- return writer(parent,c,formatters[catcodes](fmt,...))
+-- end
+-- end
+
local function formattedflush(parent,c,catcodes,fmt,...)
- if type(catcodes) == "number" then
- if fmt then
- local result
- pushcatcodes(catcodes)
- result = writer(parent,c,formatters[fmt](...))
- popcatcodes()
- return result
- else
- -- no need to change content catcodes
- return writer(parent,c)
- end
+ if not catcodes then
+ return writer(parent,c)
+ elseif not fmt then
+ return writer(parent,c,catcodes)
+ elseif type(catcodes) == "number" then
+ local result
+ pushcatcodes(catcodes)
+ result = writer(parent,c,formatters[fmt](...))
+ popcatcodes()
+ return result
else
return writer(parent,c,formatters[catcodes](fmt,...))
end
@@ -1356,10 +1372,10 @@ do
local function caller(parent,catcodes,fmt,...)
if not catcodes then
-- nothing
+ elseif not fmt then
+ flush(catcodes)
elseif type(catcodes) == "number" then
- if fmt then
- flush(catcodes,formatters[fmt](...))
- end
+ flush(catcodes,formatters[fmt](...))
else
flush(formatters[catcodes](fmt,...))
end
diff --git a/tex/context/base/mkiv/cont-fil.mkiv b/tex/context/base/mkiv/cont-fil.mkiv
index 4e5075b6b..e4a63a30e 100644
--- a/tex/context/base/mkiv/cont-fil.mkiv
+++ b/tex/context/base/mkiv/cont-fil.mkiv
@@ -12,7 +12,7 @@
%C details.
% todo: use full names and remove calls at the tex end (now integrated in
-% lua library code
+% lua library code .. then we can load it at runtime when needed.
\writestatus{loading}{ConTeXt File Synonyms}
@@ -45,21 +45,28 @@
\definefilesynonym [res-log] [res-09]
\definefilesynonym [res-identify] [res-12]
-\definefilesynonym [med-show] [res-50]
+ \definefilesynonym [med-show] [res-50]
\definefilesynonym [pre-general] [pre-00]
-
-\definefilesynonym [pre-original] [pre-01]
-\definefilesynonym [pre-green] [pre-02]
-\definefilesynonym [pre-funny] [pre-03]
-\definefilesynonym [pre-colorful] [pre-04]
-\definefilesynonym [pre-fuzzy] [pre-05]
+\definefilesynonym [pre-01] [present-original]
+\definefilesynonym [pre-original] [present-original]
+\definefilesynonym [pre-02] [present-green]
+\definefilesynonym [pre-green] [present-green]
+\definefilesynonym [pre-03] [present-funny]
+\definefilesynonym [pre-funny] [present-funny]
+\definefilesynonym [pre-04] [present-colorful]
+\definefilesynonym [pre-colorful] [present-colorful]
+\definefilesynonym [pre-05] [present-fuzzy]
+\definefilesynonym [pre-fuzzy] [present-fuzzy]
\definefilesynonym [pre-polish] [pre-06]
\definefilesynonym [pre-spider] [pre-07]
\definefilesynonym [pre-wonder] [pre-08]
-\definefilesynonym [pre-windows] [pre-09]
-\definefilesynonym [pre-grow] [pre-10]
-\definefilesynonym [pre-stack] [pre-11]
+\definefilesynonym [pre-09] [present-windows]
+\definefilesynonym [pre-windows] [present-windows]
+\definefilesynonym [pre-10] [present-grow]
+\definefilesynonym [pre-grow] [present-grow]
+\definefilesynonym [pre-11] [present-stack]
+\definefilesynonym [pre-stack] [present-stack]
\definefilesynonym [pre-arrows] [pre-12]
\definefilesynonym [pre-writing] [pre-13]
\definefilesynonym [pre-split] [pre-14]
@@ -72,7 +79,6 @@
\definefilesynonym [pre-zoom] [pre-21]
\definefilesynonym [pre-cycle] [pre-22]
\definefilesynonym [pre-super] [pre-23]
-
%definefilesynonym [pre-more] [pre-24]
%definefilesynonym [pre-more] [pre-25]
\definefilesynonym [pre-more] [pre-26]
@@ -80,20 +86,17 @@
%definefilesynonym [pre-more] [pre-28]
%definefilesynonym [pre-more] [pre-29]
%definefilesynonym [pre-more] [pre-30]
-
\definefilesynonym [pre-41] [present-tiles]
-\definefilesynonym [pre-62] [present-overlap]
-
\definefilesynonym [pre-60] [present-stepwise]
+\definefilesynonym [pre-stepwise] [present-stepwise]
\definefilesynonym [pre-61] [present-stepper]
+\definefilesynonym [pre-stepper] [present-stepper]
+\definefilesynonym [pre-62] [present-overlap]
\definefilesynonym [pre-69] [present-wobbling]
+\definefilesynonym [pre-punk] [present-punk]
\definefilesynonym [pre-70] [present-punk]
-\definefilesynonym [pre-71] [present-random]
-
-\definefilesynonym [pre-stepwise] [present-stepwise]
-\definefilesynonym [pre-stepper] [present-stepper]
\definefilesynonym [pre-random] [present-random]
-\definefilesynonym [pre-punk] [present-punk]
+\definefilesynonym [pre-71] [present-random]
\definefilesynonym [abr-pseudocaps] [abr-01]
\definefilesynonym [abr-smallcaps] [abr-02]
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index e78789676..f1b595bd9 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2016.10.25 09:57}
+\newcontextversion{2016.11.01 10:08}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 8f31103a2..d27ac04e8 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2016.10.25 09:57}
+\edef\contextversion{2016.11.01 10:08}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/l-string.lua b/tex/context/base/mkiv/l-string.lua
index 88297f2e6..be8f397ae 100644
--- a/tex/context/base/mkiv/l-string.lua
+++ b/tex/context/base/mkiv/l-string.lua
@@ -75,19 +75,19 @@ local collapser = patterns.collapser
local longtostring = patterns.longtostring
function string.strip(str)
- return lpegmatch(stripper,str) or ""
+ return str and lpegmatch(stripper,str) or ""
end
function string.fullstrip(str)
- return lpegmatch(fullstripper,str) or ""
+ return str and lpegmatch(fullstripper,str) or ""
end
function string.collapsespaces(str)
- return lpegmatch(collapser,str) or ""
+ return str and lpegmatch(collapser,str) or ""
end
function string.longtostring(str)
- return lpegmatch(longtostring,str) or ""
+ return str and lpegmatch(longtostring,str) or ""
end
-- function string.is_empty(str)
@@ -99,7 +99,7 @@ local pattern = P(" ")^0 * P(-1) -- maybe also newlines
-- patterns.onlyspaces = pattern
function string.is_empty(str)
- if str == "" then
+ if not str or str == "" then
return true
else
return lpegmatch(pattern,str) and true or false
@@ -163,7 +163,7 @@ function string.escapedpattern(str,simple)
end
function string.topattern(str,lowercase,strict)
- if str=="" or type(str) ~= "string" then
+ if str == "" or type(str) ~= "string" then
return ".*"
elseif strict then
str = lpegmatch(pattern_c,str)
diff --git a/tex/context/base/mkiv/l-table.lua b/tex/context/base/mkiv/l-table.lua
index 498f51833..1cf63db0c 100644
--- a/tex/context/base/mkiv/l-table.lua
+++ b/tex/context/base/mkiv/l-table.lua
@@ -1077,7 +1077,7 @@ function table.count(t)
return n
end
-function table.swapped(t,s) -- hash
+function table.swapped(t,s) -- hash, we need to make sure we don't mess up next
local n = { }
if s then
for k, v in next, s do
@@ -1090,7 +1090,14 @@ function table.swapped(t,s) -- hash
return n
end
-function table.mirrored(t) -- hash
+function table.hashed(t) -- list, add hash to index (save because we are not yet mixed
+ for i=1,#t do
+ t[t[i]] = i
+ end
+ return t
+end
+
+function table.mirrored(t) -- hash, we need to make sure we don't mess up next
local n = { }
for k, v in next, t do
n[v] = k
diff --git a/tex/context/base/mkiv/lang-def.mkiv b/tex/context/base/mkiv/lang-def.mkiv
index 0cda6547c..ef53c13e3 100644
--- a/tex/context/base/mkiv/lang-def.mkiv
+++ b/tex/context/base/mkiv/lang-def.mkiv
@@ -525,10 +525,10 @@
\c!rightsentence=\emdash,
\c!leftsubsentence=\emdash,
\c!rightsubsentence=\emdash,
- \c!leftquote=\greekleftquot,
- \c!rightquote=\greekrightquot,
- \c!leftquotation=\greekleftquot,
- \c!rightquotation=\greekrightquot,
+ \c!leftquote=“,
+ \c!rightquote=”,
+ \c!leftquotation=«,
+ \c!rightquotation=»,
\c!date={\v!day\space\v!month\space\v!year},
\s!patterns=\s!agr] % ok?
diff --git a/tex/context/base/mkiv/page-flw.mkiv b/tex/context/base/mkiv/page-flw.mkiv
index afedc3ee2..688791fe5 100644
--- a/tex/context/base/mkiv/page-flw.mkiv
+++ b/tex/context/base/mkiv/page-flw.mkiv
@@ -141,3 +141,42 @@
\endgroup}
\protect \endinput
+
+% \setuppapersize [A6]
+% \setupbodyfont [pagella, 12pt]
+%
+% \definetextflow [even] [width=\textwidth]
+% \definetextflow [odd] [width=\textwidth]
+%
+% \starttextflow [even] \dorecurse{15}{\input bryson} \stoptextflow
+% \starttextflow [odd] \dorecurse {5}{\input knuth } \stoptextflow
+%
+% \starttext
+%
+% \doloop {
+% \ifodd\realpageno
+% \doiftextflowelse{odd} {
+% \bgroup
+% \vsize\dimexpr\textheight-\strutdp\relax
+% \flushtextflow{odd}
+% \egroup
+% } {
+% \null
+% }
+% \page
+% \else
+% \doiftextflowelse{even} {
+% \bgroup
+% \vsize\dimexpr\textheight-\strutdp\relax
+% \flushtextflow{even}
+% \egroup
+% } {
+% \null
+% }
+% \page
+% \fi
+% \doiftextflowelse{even}\donothing{\doiftextflowelse{odd}\donothing\exitloop}
+% }
+%
+% \stoptext
+
diff --git a/tex/context/base/mkiv/publ-dat.lua b/tex/context/base/mkiv/publ-dat.lua
index 98bff25e6..5fc1031cd 100644
--- a/tex/context/base/mkiv/publ-dat.lua
+++ b/tex/context/base/mkiv/publ-dat.lua
@@ -578,8 +578,18 @@ do
local p_left = (p_whitespace^0 * left) / ""
local p_right = (right * p_whitespace^0) / ""
+ local keyword = C((R("az","AZ","09") + S("@_:-"))^1)
+ local key = C((1-space-equal)^1)
+ local tag = C((1-space-comma)^0)
+ local category = C((1-space-left)^1)
+ local s_quoted = ((escape*single) + collapsed + (1-single))^0
+ local d_quoted = ((escape*double) + collapsed + (1-double))^0
+
+ local reference = P("@{") * C((R("az","AZ","09") + S("_:-"))^1) * P("}")
+ local r_value = reference * Carg(1) / resolve
+
local balanced = P {
- [1] = ((escape * (left+right)) + (collapsed + 1 - (left+right))^1 + V(2))^0,
+ [1] = ((escape * (left+right)) + (collapsed + r_value + 1 - (left+right))^1 + V(2))^0,
[2] = left * V(1) * right,
}
@@ -590,26 +600,22 @@ do
local unbalanced = (left/"") * balanced * (right/"") * P(-1)
- local keyword = C((R("az","AZ","09") + S("@_:-"))^1)
- local key = C((1-space-equal)^1)
- local tag = C((1-space-comma)^0)
- local reference = keyword
- local category = C((1-space-left)^1)
- local s_quoted = ((escape*single) + collapsed + (1-single))^0
- local d_quoted = ((escape*double) + collapsed + (1-double))^0
-
+ local reference = P("@") * C((R("az","AZ","09") + S("_:-"))^1)
local b_value = p_left * balanced * p_right
-- local u_value = p_left * unbalanced * p_right -- get rid of outer { }
-- local s_value = (single/"") * (u_value + s_quoted) * (single/"")
-- local d_value = (double/"") * (u_value + d_quoted) * (double/"")
local s_value = (single/"") * (unbalanced + s_quoted) * (single/"")
local d_value = (double/"") * (unbalanced + d_quoted) * (double/"")
- local r_value = reference * Carg(1) /resolve
+ local r_value = reference * Carg(1) / resolve
local somevalue = d_value + b_value + s_value + r_value
local value = Cs((somevalue * ((spacing * hash * spacing)/"" * somevalue)^0))
- value = value / function(s) return lpegmatch(lpegpatterns.stripper,s) end
+ local stripper = lpegpatterns.stripper
+ value = value / function(s)
+ return lpegmatch(stripper,s)
+ end
local forget = percent^1 * (1-lineending)^0
local spacing = spacing * forget^0 * spacing
@@ -632,6 +638,9 @@ do
-- converttoxml -> dataset.xmldata from dataset.luadata
+ -- author = "al-" # @AHSAI # "," # @SHAYKH # " " # @AHMAD # " Ibn " # @ZAYNIDDIN
+ -- author = {al-@{AHSAI}, @{SHAYKH} @{AHMAD} Ibn @{ZAYNIDDIN}}
+
function publications.loadbibdata(dataset,content,source,kind)
if not source then
report("invalid source for dataset %a",dataset)
diff --git a/tex/context/base/mkiv/publ-tra.lua b/tex/context/base/mkiv/publ-tra.lua
index 12bf7bf63..b3d40be61 100644
--- a/tex/context/base/mkiv/publ-tra.lua
+++ b/tex/context/base/mkiv/publ-tra.lua
@@ -141,8 +141,8 @@ function tracers.showdatasetcompleteness(settings)
ctx_NC()
if indirect then
context("\\darkblue")
- ctx_verbatim(value)
- elseif value then
+ end
+ if value then
ctx_verbatim(value)
end
ctx_NC() ctx_NR()
@@ -153,7 +153,7 @@ function tracers.showdatasetcompleteness(settings)
local function special(done,key,value)
ctx_NC() if not done then ctx_monobold("special") end
ctx_NC() context(key)
- ctx_NC() ctx_verbatim(value)
+ ctx_NC() if value then ctx_verbatim(value) end
ctx_NC() ctx_NR()
return done or true
end
@@ -161,7 +161,7 @@ function tracers.showdatasetcompleteness(settings)
local function extra(done,key,value)
ctx_NC() if not done then ctx_monobold("extra") end
ctx_NC() context(key)
- ctx_NC() ctx_verbatim(value)
+ ctx_NC() if value then ctx_verbatim(value) end
ctx_NC() ctx_NR()
return done or true
end
@@ -348,7 +348,9 @@ function tracers.showdatasetauthors(settings)
ctx_verbatim(i)
end
ctx_NC()
- ctx_verbatim(k)
+ if k then
+ ctx_verbatim(k)
+ end
ctx_EQ()
if type(v) == "table" then
local t = { }
@@ -360,8 +362,9 @@ function tracers.showdatasetauthors(settings)
t[i] = vi
end
end
- ctx_verbatim(concat(t, " | "))
- else
+ v = concat(t, " | ")
+ end
+ if v then
ctx_verbatim(v)
end
ctx_NC()
@@ -376,9 +379,9 @@ function tracers.showdatasetauthors(settings)
end
local function commonrow(key,value)
- ctx_NC() ctx_rlap(function() ctx_verbatim(key) end)
+ ctx_NC() if key then ctx_rlap(function() ctx_verbatim(key) end) end
ctx_NC()
- ctx_EQ() ctx_verbatim(value)
+ ctx_EQ() if value then ctx_verbatim(value) end
ctx_NC() ctx_NR()
end
diff --git a/tex/context/base/mkiv/scrn-bar.mkvi b/tex/context/base/mkiv/scrn-bar.mkvi
index 2f21b0004..efb1a005b 100644
--- a/tex/context/base/mkiv/scrn-bar.mkvi
+++ b/tex/context/base/mkiv/scrn-bar.mkvi
@@ -125,9 +125,10 @@
\def\scrn_bar_buttons_indeed[#settings][#list]%
{\begingroup
- %\let\menuparameter\interactionbarparameter
+ %\let\currentinteractionbar\empty
\setupcurrentinteractionbar[#settings]%
- \d_scrn_bar_width\interactionbarparameter\c!width
+ \d_scrn_bar_width \interactionbarparameter\c!width\relax
+ \d_scrn_bar_distance\interactionbarparameter\c!distance\relax
\ifdim\d_scrn_bar_width=\zeropoint
\d_scrn_bar_width1.5\emwidth
\fi
@@ -157,6 +158,10 @@
\hbox to \scratchdimentwo
{\setnostrut
\startsymbolset[\interactionparameter\c!symbolset]%
+ \setupbuttons
+ [#settings,%
+ \c!height=\the\scratchheight,%
+ \c!width=\the\scratchdimenone]%
\processallactionsinset
[#list]
[ \v!page=>\scrn_bar_goto\v!firstpage
@@ -173,11 +178,7 @@
\endgroup}
\def\scrn_bar_goto#action%
- {\button
- [\c!height=\the\scratchheight,\c!width=\the\scratchdimenone]%
- {\symbol[#action]}% we could expand this one once only
- [#action]%
- \hss}
+ {\button{\symbol[#action]}[#action]\hss}
% todo: this will be \letblackruleparameter\c!width\scratchdimenone (faster)
@@ -346,31 +347,34 @@
\advance\scratchcounterfive \plusone
\ifnum\recurselevel=\firstsubpage\relax \!!doneatrue \fi
\ifnum\recurselevel=\lastsubpage \relax \!!doneatrue \fi
+ \scratchcountersix\therealsubpageno\recurselevel\relax
\c_scrn_bar_mode
\if!!donea
- \ifnum\recurselevel<\realpageno
+ \ifnum\scratchcountersix<\realpageno
\zerocount
- \else\ifnum\recurselevel>\realpageno
+ \else\ifnum\scratchcountersix>\realpageno
\plustwo
\else
\plusfour
\fi\fi
\else
\ifnum\scratchcounterfive=\scratchcountertwo
- \ifnum\recurselevel<\realpageno
+ \ifnum\scratchcountersix<\realpageno
\plusone
- \else\ifnum\recurselevel>\realpageno
+ \else\ifnum\scratchcountersix>\realpageno
\plusthree
\else
\plustwo
\fi\fi
\else
- \plusthree
+ \minusone
\fi
\fi
- \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\scrn_bar_goto_indeed\c_scrn_bar_mode}[page(\therealsubpageno\recurselevel)]}%
- \hss
- \scratchcounterfive\zerocount}%
+ \ifnum\c_scrn_bar_mode<\zerocount\else
+ \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\scrn_bar_goto_indeed\c_scrn_bar_mode}[realpage(\the\scratchcountersix)]}%
+ \hss
+ \scratchcounterfive\zerocount
+ \fi}%
\unskip
\egroup
}\fi}
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 3e2ac5f8c..5f58a77d6 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index f98279189..c09d22644 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/strc-def.mkiv b/tex/context/base/mkiv/strc-def.mkiv
index 962c46b48..b2e86c140 100644
--- a/tex/context/base/mkiv/strc-def.mkiv
+++ b/tex/context/base/mkiv/strc-def.mkiv
@@ -193,6 +193,7 @@
\c!header=,
\c!style=\tfc,
\c!distance=.75\emwidth,
+ \c!textdistance=\emwidth plus \emwidth minus .25\emwidth,
\c!before={\blank[2*\v!big]},
\c!after={\blank[2*\v!big]}]
@@ -202,6 +203,7 @@
%\c!indentnext=\v!no,
\c!style=\tfa,
\c!distance=.75\emwidth,
+ \c!textdistance=\emwidth plus \emwidth minus .25\emwidth,
\c!before={\blank[2*\v!big]},
\c!after=\blank]
diff --git a/tex/context/base/mkiv/strc-pag.mkiv b/tex/context/base/mkiv/strc-pag.mkiv
index cf2533c46..21758d671 100644
--- a/tex/context/base/mkiv/strc-pag.mkiv
+++ b/tex/context/base/mkiv/strc-pag.mkiv
@@ -23,7 +23,7 @@
\countdef\realpageno \zerocount \realpageno \plusone
\countdef\userpageno \plusone \userpageno \plusone
-\countdef\subpageno \plustwo \subpageno \zerocount % !
+\countdef\subpageno \plustwo \subpageno \plusone % was \zerocount but that doesn't work well with bytext
\countdef\arrangeno \plusthree \arrangeno \zerocount % !
\countdef\pagenoshift\plusfour \pagenoshift\zerocount % !
\countdef\lastpageno \plusfive \lastpageno \zerocount % !
diff --git a/tex/context/base/mkiv/strc-ren.mkiv b/tex/context/base/mkiv/strc-ren.mkiv
index 6bdd05de9..507cb9921 100644
--- a/tex/context/base/mkiv/strc-ren.mkiv
+++ b/tex/context/base/mkiv/strc-ren.mkiv
@@ -167,18 +167,6 @@
% helpers
-% \defineinmargin [ChapterInMargin] [outer] [normal] [distance=0.3em]
-%
-% \defineheadplacement[MyTest][horizontal]#1#2%
-% {\startlocalheadsetup
-% %\ChapterInMargin{\headhbox{\strut#2}}% proper destination, ref okay
-% \ChapterInMargin{\strut#2}% zero destination, ref okay
-% \stoplocalheadsetup}
-%
-% \setuphead
-% [chapter]
-% [alternative=MyTest]
-
\unexpanded\def\headhbox{\hbox\headreferenceattributes}
\unexpanded\def\headvbox{\vbox\headreferenceattributes}
@@ -354,12 +342,19 @@
\fi
\getheadsyncs
\else
+ % somehow this goes ok even when we push in the margin probably because we gobble pars
+ % in the process of collecting index entries etc
\strut
\flushnotes % new, here since we're in par mode
\unhbox\b_strc_rendering_head
\getheadsyncs
- \hskip\headnumberdistance\s!plus\headnumberdistance\s!minus.25\dimexpr\headnumberdistance\relax
- \strc_sectioning_inject_continuous_signal
+ \ifconditional\headissomewhere
+ % nothing special
+ \else
+ %\hskip\headnumberdistance\s!plus\headnumberdistance\s!minus.25\dimexpr\headnumberdistance\relax
+ \hskip\headtextdistance\relax
+ \strc_sectioning_inject_continuous_signal
+ \fi
\fi
\ifconditional\headisdisplay
\ifvmode
@@ -453,6 +448,7 @@
\newdimen\headwidth
\newdimen\headtextwidth
+\newskip \headtextdistance
\newdimen\headnumberdistance
\newdimen\headnumberwidth
@@ -470,16 +466,22 @@
\let\currentheadrenderingalternative\v!vertical
\fi
\ifx\currentheadrenderingalternative\v!horizontal
- \global\setfalse\headisdisplay % global
+ \global\setfalse\headisdisplay % global
+ \global\setfalse\headissomewhere % global
+ \else\ifx\currentheadrenderingalternative\v!somewhere
+ \global\setfalse\headisdisplay % global
+ \global\settrue \headissomewhere % global
\else
- \global\settrue\headisdisplay % global
- \fi}
+ \global\settrue \headisdisplay % global
+ \global\setfalse\headissomewhere % global
+ \fi\fi}
\unexpanded\def\strc_rendering_initialize_dimensions
- {\headwidth \headparameter\c!width \relax % \zeropoint == unset
- \headnumberwidth \headparameter\c!numberwidth\relax % \zeropoint == unset
- \headnumberdistance\headparameter\c!distance \relax
- \headtextwidth \headparameter\c!textwidth \relax} % \zeropoint == unset
+ {\headwidth \headparameter\c!width \relax % \zeropoint == unset
+ \headnumberwidth \headparameter\c!numberwidth \relax % \zeropoint == unset
+ \headnumberdistance\headparameter\c!distance \relax
+ \headtextdistance \headparameter\c!textdistance\relax
+ \headtextwidth \headparameter\c!textwidth \relax} % \zeropoint == unset
\unexpanded\def\headtextcontent
{\begingroup
@@ -786,4 +788,9 @@
\fi
\stopsetups
+% see typo-mar.mkiv:
+%
+% \defineheadalternative
+% [\v!margintext]
+
\protect \endinput
diff --git a/tex/context/base/mkiv/strc-sec.mkiv b/tex/context/base/mkiv/strc-sec.mkiv
index 657e6c866..51b464eb9 100644
--- a/tex/context/base/mkiv/strc-sec.mkiv
+++ b/tex/context/base/mkiv/strc-sec.mkiv
@@ -345,6 +345,7 @@
%\c!deeptextcommand=,
%\c!default=,
\c!distance=\zeropoint,
+ \c!textdistance=\zeropoint,
\c!textwidth=\zeropoint, % signal too
\c!numberwidth=\zeropoint, % signal too
\c!width=\zeropoint, % signal too
@@ -660,8 +661,9 @@
\newconditional\c_strc_sectioning_empty
\newconditional\c_strc_sectioning_hidden
-\newconditional\headshownumber % public
-\newconditional\headisdisplay % public
+\newconditional\headshownumber % public
+\newconditional\headisdisplay % public
+\newconditional\headissomewhere % public
\setvalue{\??headincrement\v!yes }{\settrue \c_strc_sectioning_increment\settrue \c_strc_sectioning_to_list}
\setvalue{\??headincrement\v!no }{\setfalse\c_strc_sectioning_increment\setfalse\c_strc_sectioning_to_list}
@@ -796,7 +798,7 @@
{\dontleavehmode
\begingroup
\unexpanded\def\\{\space}% messy here, but the default (and needs to be grouped)
- \settrue\headisdisplay % triggers interlinespace checking
+ \global\settrue\headisdisplay % triggers interlinespace checking
\edef\currenthead{#1}%
\strc_rendering_initialize_style_and_color\c!textstyle\c!textcolor
\relax
@@ -807,7 +809,7 @@
\def\strc_sectioning_place_head_number[#1]%
{\dontleavehmode
\begingroup
- \settrue\headisdisplay % triggers interlinespace checking
+ \global\settrue\headisdisplay % triggers interlinespace checking
\edef\currenthead{#1}%
\strc_rendering_initialize_style_and_color\c!numberstyle\c!numbercolor
\relax
diff --git a/tex/context/base/mkiv/syst-aux.mkiv b/tex/context/base/mkiv/syst-aux.mkiv
index 96a377595..e81f61807 100644
--- a/tex/context/base/mkiv/syst-aux.mkiv
+++ b/tex/context/base/mkiv/syst-aux.mkiv
@@ -3845,15 +3845,16 @@
\global\expandafter\def\csname\??recurseaction\recursedepth\endcsname##1##2{#4}%
\global\expandafter\let\csname\??recurseindex\recursedepth\endcsname\recurselevel
\csname\??recursestepwise
+ % we need the x in order to avoid the \relax that tex adds
\ifnum#3>\zerocount
- \ifnum#2<#1\else d\fi
+ \ifnum#2<#1x\else d\fi
\else\ifnum#3<\zerocount
- \ifnum#1<#2\else r\fi
+ \ifnum#1<#2x\else r\fi
\fi\fi
\expandafter\endcsname\normalexpanded{{\number#1}{\number#2}{\number#3}}}
% \expandafter\endcsname\expandafter{\number#1\expandafter}\expandafter{\number#2\expandafter}\expandafter{\number#3}}
-\letvalue{\??recursestepwise }\syst_helpers_stepwise_exit
+\letvalue{\??recursestepwise x}\syst_helpers_stepwise_exit
\letvalue{\??recursestepwise d}\syst_helpers_stepwise_recurse
\letvalue{\??recursestepwise r}\syst_helpers_stepwise_reverse
diff --git a/tex/context/base/mkiv/typo-mar.mkiv b/tex/context/base/mkiv/typo-mar.mkiv
index 013974086..462cc633e 100644
--- a/tex/context/base/mkiv/typo-mar.mkiv
+++ b/tex/context/base/mkiv/typo-mar.mkiv
@@ -439,4 +439,46 @@
% \let\dostophanchoring \dostopanchoring
% \let\dostopvanchoring \dostopanchoring
+%D Here because in strc-ren we are too early:
+
+% % \definemargindata
+% % [margintext:chapter]
+% % [margintext:section]
+% %
+% % \defineheadalternative
+% % [margintext:chapter]
+% % [margintext]
+% % [margintext=margintext:chapter]
+% %
+% % \setuphead
+% % [chapter]
+% % [alternative=margintext:chapter]
+%
+% \setuphead
+% [chapter]
+% [alternative=margintext]
+
+\definemargindata
+ [\v!margintext:\v!section]
+ [\v!left]
+ [\c!margin=\v!margin,
+ \c!width=\leftmarginwidth,
+ \c!align=\v!flushright]
+
+\defineheadalternative
+ [\v!margintext]
+ [\c!alternative=\v!somewhere,
+ \c!margintext=\v!margintext:\v!section,
+ \c!renderingsetup=\??headrenderings:\v!margintext]
+
+\startsetups[\??headrenderings:\v!margintext]
+ \executeifdefined{\headalternativeparameter\c!margintext}\margintext {
+ \ifconditional\headshownumber
+ \headnumbercontent
+ \hskip\headnumberdistance
+ \fi
+ \headtextcontent
+ }
+\stopsetups
+
\protect \endinput
diff --git a/tex/context/base/mkiv/util-jsn.lua b/tex/context/base/mkiv/util-jsn.lua
index bbe25d89d..e835c07d6 100644
--- a/tex/context/base/mkiv/util-jsn.lua
+++ b/tex/context/base/mkiv/util-jsn.lua
@@ -64,18 +64,19 @@ local jnumber = (1-whitespace-rparent-rbrace-comma)^1 / tonumber
local key = jstring
local jsonconverter = { "value",
- object = lbrace * Cf(Ct("") * V("pair") * (comma * V("pair"))^0,rawset) * rbrace,
- pair = Cg(optionalws * key * optionalws * colon * V("value")),
- array = Ct(lparent * V("value") * (comma * V("value"))^0 * rparent),
- value = optionalws * (jstring + V("object") + V("array") + jtrue + jfalse + jnull + jnumber + #rparent) * optionalws,
+ hash = lbrace * Cf(Ct("") * (V("pair") * (comma * V("pair"))^0 + optionalws),rawset) * rbrace,
+ pair = Cg(optionalws * key * optionalws * colon * V("value")),
+ array = Ct(lparent * (V("value") * (comma * V("value"))^0 + optionalws) * rparent),
+-- value = optionalws * (jstring + V("hash") + V("array") + jtrue + jfalse + jnull + jnumber + #rparent) * optionalws,
+ value = optionalws * (jstring + V("hash") + V("array") + jtrue + jfalse + jnull + jnumber) * optionalws,
}
-- local jsonconverter = { "value",
--- object = lbrace * Cf(Ct("") * V("pair") * (comma * V("pair"))^0,rawset) * rbrace,
--- pair = Cg(optionalws * V("string") * optionalws * colon * V("value")),
--- array = Ct(lparent * V("value") * (comma * V("value"))^0 * rparent),
--- string = jstring,
--- value = optionalws * (V("string") + V("object") + V("array") + jtrue + jfalse + jnull + jnumber) * optionalws,
+-- hash = lbrace * Cf(Ct("") * (V("pair") * (comma * V("pair"))^0 + optionalws),rawset) * rbrace,
+-- pair = Cg(optionalws * V("string") * optionalws * colon * V("value")),
+-- array = Ct(lparent * (V("value") * (comma * V("value"))^0 + optionalws) * rparent),
+-- string = jstring,
+-- value = optionalws * (V("string") + V("hash") + V("array") + jtrue + jfalse + jnull + jnumber) * optionalws,
-- }
-- lpeg.print(jsonconverter) -- size 181
@@ -156,3 +157,5 @@ end
-- inspect(tmp)
-- inspect(json.tostring(true))
+
+return json
diff --git a/tex/context/base/mkiv/util-tab.lua b/tex/context/base/mkiv/util-tab.lua
index 0ebe1b5b1..0521a2a4f 100644
--- a/tex/context/base/mkiv/util-tab.lua
+++ b/tex/context/base/mkiv/util-tab.lua
@@ -486,11 +486,11 @@ end
local selfmapper = { __index = function(t,k) t[k] = k return k end }
-function table.twowaymapper(t)
- if not t then
- t = { }
- else
- local zero = rawget(t,0)
+function table.twowaymapper(t) -- takes a 0/1 .. n indexed table and returns
+ if not t then -- it with string-numbers as indices + reverse
+ t = { } -- mapping (all strings) .. used in cvs etc but
+ else -- typically a helper that one forgets about
+ local zero = rawget(t,0) -- so it might move someplace else
for i=zero and 0 or 1,#t do
local ti = t[i] -- t[1] = "one"
if ti then
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index 1db82c2d1..eaf2b6fa1 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index 93802e7c4..8ea3d9335 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-section.xml b/tex/context/interface/mkiv/i-section.xml
index 6ef89895b..535888871 100644
--- a/tex/context/interface/mkiv/i-section.xml
+++ b/tex/context/interface/mkiv/i-section.xml
@@ -211,6 +211,9 @@
<cd:parameter name="distance">
<cd:constant type="cd:dimension"/>
</cd:parameter>
+ <cd:parameter name="textdistance">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
<cd:parameter name="commandbefore">
<cd:constant type="cd:command"/>
</cd:parameter>
@@ -695,6 +698,7 @@
<cd:parameter name="alternative">
<cd:constant type="horizontal"/>
<cd:constant type="vertical" default="yes"/>
+ <cd:constant type="somewhere"/>
</cd:parameter>
<cd:parameter name="renderingsetup">
<cd:constant type="cd:name"/>
@@ -733,6 +737,8 @@
<cd:command name="headnumberdistance" file="strc-ren.mkiv"/>
+ <cd:command name="headtextdistance" file="strc-ren.mkiv"/>
+
<cd:command name="headsetupspacing" file="strc-ren.mkiv"/>
</cd:interface>
diff --git a/tex/context/modules/common/s-pre-00.tex b/tex/context/modules/common/s-pre-00.tex
index 7f217d5bb..2acbc13b7 100644
--- a/tex/context/modules/common/s-pre-00.tex
+++ b/tex/context/modules/common/s-pre-00.tex
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% This might go away!
+
%D This module provides some non core functionality that can
%D be used in the presentations styles. This module contains
%D experimental macros.
diff --git a/tex/context/modules/common/s-pre-12.tex b/tex/context/modules/common/s-pre-12.tex
index 23418fbba..64949e30c 100644
--- a/tex/context/modules/common/s-pre-12.tex
+++ b/tex/context/modules/common/s-pre-12.tex
@@ -63,7 +63,7 @@
\dorecurse{\CurrentMaxItem}
{\startMPdrawing
initialize_box(\MPpos{item-\realfolio-\recurselevel}) ;
- linewidth := .25cm ;
+ linewidth := .25cm ;
p := tensecircle (wxy,hxy,linewidth) shifted cxy ;
fill p withcolor .9white ;
pickup pencircle scaled linewidth ;
@@ -73,8 +73,8 @@
\else
draw p withcolor \MPcolor{DoneColor} ;
\fi
- dxab := xpart a-xpart b ;
- dyab := ypart a-ypart b ;
+ dxab := xpart a-xpart b ;
+ dyab := ypart a-ypart b ;
sign := if dyab>0 : - fi 1 ;
drawarrow
a --
@@ -82,7 +82,7 @@
if abs(dyab)>4linewidth :
a shifted (-dxab/2,+sign*2linewidth) --
b shifted (+dxab/2,-sign*2linewidth) ..
- fi
+ fi
{left} b shifted (-2linewidth+dxab/2,0) --
b
withcolor \MPcolor{ArrowColor} ;
@@ -107,7 +107,7 @@
\setupinteraction[color=GotoColor,contrastcolor=GotoColor]
\defineoverlay [shape] [\SomeShape]
-\defineoverlay [next] [\overlaybutton{forward}]
+\defineoverlay [next] [\overlaybutton{forward}]
\setupbackgrounds
[page]
@@ -183,44 +183,44 @@
\vfil#1\vfil\vfil
\stopstandardmakeup}
-\endinput
-
-% \starttext
-%
-% \StartIdea
-% \StartTopic
-% What a topic
-% \StopTopic
-% \StartItem
-% \input reich \relax
-% \StopItem
-% \StartItem
-% \input reich \relax
-% \StopItem
-% \StartItem
-% \input reich \relax
-% \StopItem
-% \StopIdea
-%
-% \StartIdea
-% \StartTopic
-% One More Nice Idea
-% \StopTopic
-% \StartItem
-% \input reich \relax
-% \StopItem
-% \StartItem
-% \input reich \relax
-% \StopItem
-% \StopIdea
-%
-% \StartIdea
-% \StartTopic
-% The Last Idea
-% \StopTopic
-% \StartItem
-% \input tufte \relax
-% \StopItem
-% \StopIdea
-%
-% \stoptext
+\doifnotmode{demo}{\endinput}
+
+\starttext
+
+\StartIdea
+ \StartTopic
+ What a topic
+ \StopTopic
+ \StartItem
+ \input reich \relax
+ \StopItem
+ \StartItem
+ \input reich \relax
+ \StopItem
+ \StartItem
+ \input reich \relax
+ \StopItem
+\StopIdea
+
+\StartIdea
+ \StartTopic
+ One More Nice Idea
+ \StopTopic
+ \StartItem
+ \input reich \relax
+ \StopItem
+ \StartItem
+ \input reich \relax
+ \StopItem
+\StopIdea
+
+\StartIdea
+ \StartTopic
+ The Last Idea
+ \StopTopic
+ \StartItem
+ \input tufte \relax
+ \StopItem
+\StopIdea
+
+\stoptext
diff --git a/tex/context/modules/common/s-pre-15.tex b/tex/context/modules/common/s-pre-15.tex
index 25fb35783..90d428243 100644
--- a/tex/context/modules/common/s-pre-15.tex
+++ b/tex/context/modules/common/s-pre-15.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=s-pre-15,
-%D version=1999.09.01,
+%D version=1999.09.01,
%D title=\CONTEXT\ Style File,
%D subtitle=Presentation Environment 15,
%D author=Hans Hagen,
@@ -11,17 +11,17 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D This is one of the styles I made for the presentation on
+%D This is one of the styles I made for the presentation on
%D the \NTS\ project at Euro\TeX\ 1998. You need balls to let
-%D \TEX\ typeset graphics, but this style demonstrates that it
-%D can be done.
-%D
+%D \TEX\ typeset graphics, but this style demonstrates that it
+%D can be done.
+%D
%D This presentation is meant for presentations that build up
-%D an idea stepwise.
-%D
+%D an idea stepwise.
+%D
%D \starttyping
%D \TitlePage{Do you know \TEX ?}
-%D
+%D
%D \StartIdea
%D \StartItem We use \TEX\ for typesetting \unknown \StopItem
%D \StartItem mathematical text \unknown \StopItem
@@ -29,10 +29,10 @@
%D \StartItem or presentations like this \unknown \StopItem
%D \StartItem and whatever you can come up with! \StopItem
%D \StopIdea
-%D \stoptyping
+%D \stoptyping
-%D The basic layout is rather simple and used as much of the
-%D screen as possible.
+%D The basic layout is rather simple and used as much of the
+%D screen as possible.
\setuppapersize
[S6][S6]
@@ -48,10 +48,10 @@
\setupinteraction
[state=start,
display=new,
- color=LineColor,
+ color=LineColor,
contrastcolor=LineColor,
click=no]
-
+
\setupinteractionscreen
[option=max]
@@ -59,8 +59,8 @@
\setupbodyfont[14.4pt]
-%D We use a lot of color. You can remap them if you want
-%D differend ones. The ideas circulate over the colors.
+%D We use a lot of color. You can remap them if you want
+%D differend ones. The ideas circulate over the colors.
\setupcolors
[state=start]
@@ -73,12 +73,12 @@
\definecolor[green][g=.4] \definecolor[magenta][r=.4,b=.4]
\definecolor[blue] [b=.4] \definecolor[yellow] [r=.4,g=.4]
-\definecolor[linecolor 1][red] \definecolor[linecolor 5][cyan]
-\definecolor[linecolor 2][green] \definecolor[linecolor 6][magenta]
-\definecolor[linecolor 3][blue] \definecolor[linecolor 4][yellow]
+\definecolor[linecolor 1][red] \definecolor[linecolor 5][cyan]
+\definecolor[linecolor 2][green] \definecolor[linecolor 6][magenta]
+\definecolor[linecolor 3][blue] \definecolor[linecolor 4][yellow]
-%D We use variables to make sure that the graphics are reused
-%D but unique.
+%D We use variables to make sure that the graphics are reused
+%D but unique.
\setupMPvariables[pageframe][pagecolor=PageColor,linecolor=LineColor]
\setupMPvariables[textframe][textcolor=TextColor,linecolor=LineColor]
@@ -93,35 +93,35 @@
\startuniqueMPgraphic{pageframe}{pagecolor,linecolor}
path p ; p := fullsquare xyscaled (\overlaywidth,\overlayheight) ;
- pickup pencircle scaled 10pt ;
- fill p withcolor \MPvar{pagecolor} ;
- draw p withcolor \MPvar{linecolor} ;
+ pickup pencircle scaled 10pt ;
+ fill p withcolor \MPvar{pagecolor} ;
+ draw p withcolor \MPvar{linecolor} ;
\stopuniqueMPgraphic
\startuniqueMPgraphic{textframe}{textcolor,linecolor}
path p ; p := fullcircle xyscaled (\overlaywidth,\overlayheight) ;
- pickup pencircle scaled 10pt ;
- fill p withcolor \MPvar{textcolor} ;
- draw p withcolor \MPvar{linecolor} ;
+ pickup pencircle scaled 10pt ;
+ fill p withcolor \MPvar{textcolor} ;
+ draw p withcolor \MPvar{linecolor} ;
\stopuniqueMPgraphic
%D The rest of the file implements the nasty part: typesetting
%D text embedded in a graphic. The text is collected in a box
-%D so that we can reuse it.
+%D so that we can reuse it.
\newbox\CollectedIdeas
\newcounter\CurrentTopic
-\def\StartItem%
+\def\StartItem%
{\setbox\CollectedIdeas=\hbox\bgroup
\ifdim\wd\CollectedIdeas>0pt \unhbox\CollectedIdeas\hskip25pt \fi
\setbox\scratchbox=\hbox\bgroup
- \framed
+ \framed
[width=160pt,height=160pt,align=middle,frame=off,
background=textframe,offset=15pt,top=\vfill,bottom=\vfill]
\bgroup}
-\def\StopItem%
+\def\StopItem%
{\egroup
\egroup
\setbox\scratchbox=\hbox{\lower.5\ht\scratchbox\box\scratchbox}%
@@ -134,12 +134,12 @@
\leftskip 0pt plus 50pt
\rightskip 0pt plus 50pt
\parfillskip 0pt
- \baselineskip 100pt
+ \baselineskip 100pt
\unhcopy\CollectedIdeas
\stopstandardmakeup}
\def\StartIdea%
- {\ifnum\CurrentTopic=6 \doglobal\newcounter\CurrentTopic \fi
+ {\ifnum\CurrentTopic=6 \doglobal\newcounter\CurrentTopic \fi
\doglobal\increment\CurrentTopic
\definecolor[LineColor][linecolor \CurrentTopic]
\setbox\CollectedIdeas=\null}
@@ -163,15 +163,15 @@
\doifnotmode{demo}{\endinput}
-%D A simple test on functionality.
+%D A simple test on functionality.
\setupoutput[pdftex]
-\starttext
+\starttext
\TitlePage{Do you know \TEX ?}
-\startbuffer
+\startbuffer
\StartIdea
\StartItem We use \TEX\ for typesetting \unknown \StopItem
\StartItem mathematical text \unknown \StopItem
diff --git a/tex/context/modules/common/s-pre-16.tex b/tex/context/modules/common/s-pre-16.tex
index 715936890..a7e127828 100644
--- a/tex/context/modules/common/s-pre-16.tex
+++ b/tex/context/modules/common/s-pre-16.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=s-pre-16,
-%D version=1999.09.01,
+%D version=1999.09.01,
%D title=\CONTEXT\ Style File,
%D subtitle=Presentation Environment 16,
%D author=Hans Hagen,
@@ -13,7 +13,7 @@
%D The first version of this style was made late summer 1999,
%D but its first usage was during a course I gave in BRNO.
-%D It's a rather simple style with a dominating background.
+%D It's a rather simple style with a dominating background.
\setuppapersize
[S6][S6]
@@ -42,11 +42,11 @@
[state=start]
\definecolor[gray] [s=.4]
-\definecolor[white][s=.8]
+\definecolor[white][s=.8]
-\definecolor[red] [r=.8] \definecolor[cyan] [g=.8,b=.8]
-\definecolor[green][g=.8] \definecolor[magenta][r=.8,b=.8]
-\definecolor[blue] [b=.8] \definecolor[yellow] [r=.8,g=.8]
+\definecolor[red] [r=.8] \definecolor[cyan] [g=.8,b=.8]
+\definecolor[green][g=.8] \definecolor[magenta][r=.8,b=.8]
+\definecolor[blue] [b=.8] \definecolor[yellow] [r=.8,g=.8]
\definecolor[PageColor][gray]
\definecolor[TextColor][yellow]
@@ -66,49 +66,49 @@
symbol=FuzzyDot]
\startuseMPgraphic{FuzzyCircle}
- path p ; numeric w, h, l ;
- w := OverlayWidth ; h := OverlayHeight ;
- def dd = (1 randomized (1/5)) enddef ;
+ path p ; numeric w, h, l ;
+ w := OverlayWidth ; h := OverlayHeight ;
+ def dd = (1 randomized (1/5)) enddef ;
pickup pencircle xscaled 10pt yscaled 2pt rotated 30;
- for i:=1 upto 50 :
- p := (-dd,-dd)..(dd,-dd)..(dd,dd)..(-dd,dd)..cycle ;
- p := p rotatedaround (center p, uniformdeviate 360) ;
- p := p xscaled (w/2) yscaled (h/2) ;
- l := length(p)/2 ;
- p := p cutbefore point (uniformdeviate l) of p ;
- p := p cutafter point (l+uniformdeviate l) of p ;
+ for i:=1 upto 50 :
+ p := (-dd,-dd)..(dd,-dd)..(dd,dd)..(-dd,dd)..cycle ;
+ p := p rotatedaround (center p, uniformdeviate 360) ;
+ p := p xscaled (w/2) yscaled (h/2) ;
+ l := length(p)/2 ;
+ p := p cutbefore point (uniformdeviate l) of p ;
+ p := p cutafter point (l+uniformdeviate l) of p ;
draw p withcolor \MPcolor{LineColor} randomized (.4,1) ;
- endfor ;
+ endfor ;
picture s ; s := currentpicture xysized (w-15,h-15) ;
currentpicture := nullpicture ;
- fill boundingbox s enlarged 60pt withcolor \MPcolor{PageColor} ;
- addto currentpicture also s ;
+ fill boundingbox s enlarged 60pt withcolor \MPcolor{PageColor} ;
+ addto currentpicture also s ;
\stopuseMPgraphic
\startuseMPgraphic{FuzzyDot}
- path p ; numeric w ;
- w := BodyFontSize/2 ;
- def dd = (w randomized (w/2)) enddef ;
+ path p ; numeric w ;
+ w := BodyFontSize/2 ;
+ def dd = (w randomized (w/2)) enddef ;
pickup pencircle xscaled (w/2) yscaled (w/3) rotated 30 ;
- for i=0 step 45 until 135 :
+ for i=0 step 45 until 135 :
p := (-dd,0)--(dd,0) ;
p := p rotatedaround (origin,i-w+uniformdeviate w) ;
draw p withcolor \MPcolor{LineColor} randomized (.3,.8) ;
- endfor ;
+ endfor ;
\stopuseMPgraphic
\defineoverlay [FuzzyCircle] [\useMPgraphic{FuzzyCircle}]
\defineoverlay [GoOn] [{\setupinteraction[click=no]\overlaybutton{forward}}]
\defineoverlay [Again] [\overlaybutton{firstpage}]
-\definesymbol
- [FuzzyDot]
+\definesymbol
+ [FuzzyDot]
[\lower\dp\strutbox\hbox{\useMPgraphic{FuzzyDot}}]
\def\Item%
{\par\noindent\symbol[FuzzyDot]\hskip.5em\nobreak}
-\setupitemize
+\setupitemize
[all]
[packed]
[symbol=FuzzyDot]
@@ -134,15 +134,15 @@
[alternative=g,
interaction=all]
-%D Since we want a colored text, and since color directive
-%D can spoil the spacing, we use a foregroundcolor.
+%D Since we want a colored text, and since color directive
+%D can spoil the spacing, we use a foregroundcolor.
\setupbackgrounds
[text]
[foregroundcolor=TextColor]
-%D Unfortunately this does not work when on the page colors
-%D are set, so we play safe and say:
+%D Unfortunately this does not work when on the page colors
+%D are set, so we play safe and say:
\setupmakeup
[standard]
@@ -165,13 +165,13 @@
\stopcolumns
\page}
-%D Some fakes.
+%D Some fakes.
\def\Subject {\Topic}
\def\Subjects {}
-%D A bonus (copied from \type {s-pre-02} but with a different
-%D vertical alignment.
+%D A bonus (copied from \type {s-pre-02} but with a different
+%D vertical alignment.
\def\StartTitlePage%
{\startstandardmakeup
@@ -188,16 +188,16 @@
{\StartTitlePage#1\StopTitlePage}
\doifnotmode{demo}{\endinput}
-
-\starttext
+
+\starttext
\Topics{...}
-\StartIdea
+\StartIdea
\Topic{...}
- ...
- \NextIdea
+ ...
+ \NextIdea
...
\StopIdea
-\stoptext
+\stoptext
diff --git a/tex/context/modules/common/s-pre-23.tex b/tex/context/modules/common/s-pre-23.tex
index f9983a89e..c5ae82eed 100644
--- a/tex/context/modules/common/s-pre-23.tex
+++ b/tex/context/modules/common/s-pre-23.tex
@@ -14,7 +14,7 @@
%D This style looks a lot like number 22. This time we don't
%D cycle but build up the page. One can click on the text go
%D to the page wanted. Clicking on the titl ebrings you to the
-%D previous page.
+%D previous page.
\startmode [demo]
\disablemode[demo] \usemodule[pre-22] \enablemode[demo]
@@ -24,13 +24,13 @@
\usemodule[pre-22]
\stopnotmode
-%D We use a simple two||color scheme.
+%D We use a simple two||color scheme.
\definecolor[DotColor][r=.5,g=.6,b=.7]
\definecolor[TopColor][r=.7,g=.6,b=.5]
\definecolor[BotColor][TopColor]
-%D We will not delay page building.
+%D We will not delay page building.
\let\BuildPage\relax
@@ -51,14 +51,14 @@
\setlayer[temp]{\foundbox{Subtext}\CurrentSummary}
\stopstandardmakeup}
-%D The title page is not added to the main layer (or
-%D actually, it is, but we erase the layer before it's
-%D used).
+%D The title page is not added to the main layer (or
+%D actually, it is, but we erase the layer before it's
+%D used).
\long\def\MakeTitlePage#1#2%
{\startstandardmakeup
\definereference[thispage][]
- \switchtobodyfont[32pt]
+ \switchtobodyfont[32pt]
\StartSummary{#1}{}#2\StopSummary
\resetlayer[main]
\setlayer[temp]{\foundbox{Summary}\CurrentSummary}
diff --git a/tex/context/modules/common/s-pre-01.tex b/tex/context/modules/mkii/s-pre-01.mkii
index 89c5642f9..89c5642f9 100644
--- a/tex/context/modules/common/s-pre-01.tex
+++ b/tex/context/modules/mkii/s-pre-01.mkii
diff --git a/tex/context/modules/common/s-pre-02.tex b/tex/context/modules/mkii/s-pre-02.mkii
index d7a6fe458..d7a6fe458 100644
--- a/tex/context/modules/common/s-pre-02.tex
+++ b/tex/context/modules/mkii/s-pre-02.mkii
diff --git a/tex/context/modules/common/s-pre-03.tex b/tex/context/modules/mkii/s-pre-03.mkii
index 19a11d24e..19a11d24e 100644
--- a/tex/context/modules/common/s-pre-03.tex
+++ b/tex/context/modules/mkii/s-pre-03.mkii
diff --git a/tex/context/modules/common/s-pre-04.tex b/tex/context/modules/mkii/s-pre-04.mkii
index 088f4e510..088f4e510 100644
--- a/tex/context/modules/common/s-pre-04.tex
+++ b/tex/context/modules/mkii/s-pre-04.mkii
diff --git a/tex/context/modules/common/s-pre-05.tex b/tex/context/modules/mkii/s-pre-05.mkii
index ccffd1f4d..dcb3f5e81 100644
--- a/tex/context/modules/common/s-pre-05.tex
+++ b/tex/context/modules/mkii/s-pre-05.mkii
@@ -217,7 +217,7 @@
endfor ;
\stopuseMPgraphic
-\continueifinputfile{s-pre-05.tex}
+\doifnotmode{demo}{\endinput}
%D The (rather silly) demo section.
diff --git a/tex/context/modules/common/s-pre-09.tex b/tex/context/modules/mkii/s-pre-09.mkii
index a20b9f31a..a20b9f31a 100644
--- a/tex/context/modules/common/s-pre-09.tex
+++ b/tex/context/modules/mkii/s-pre-09.mkii
diff --git a/tex/context/modules/common/s-pre-10.tex b/tex/context/modules/mkii/s-pre-10.mkii
index a92e5af01..a92e5af01 100644
--- a/tex/context/modules/common/s-pre-10.tex
+++ b/tex/context/modules/mkii/s-pre-10.mkii
diff --git a/tex/context/modules/common/s-pre-11.tex b/tex/context/modules/mkii/s-pre-11.mkii
index 48974f6c5..0c445054f 100644
--- a/tex/context/modules/common/s-pre-11.tex
+++ b/tex/context/modules/mkii/s-pre-11.mkii
@@ -36,7 +36,7 @@
\setupinteractionscreen
[option=max]
-\def\SomeShape%
+\unexpanded\def\SomeShape
{\resetMPdrawing
\startMPdrawing
path p[], q[] ; pair a, b ;
@@ -48,11 +48,11 @@
p[\recurselevel] := tensecircle (wxy,hxy,.25cm) shifted cxy ;
fill p[\recurselevel] withcolor .9white ;
pickup pencircle scaled .25cm ;
- \ifnum\recurselevel=\CurrentTopic\space
+ if \recurselevel = \CurrentTopic :
draw p[\recurselevel] withcolor \MPcolor{ShowColor} ;
- \else
+ else :
draw p[\recurselevel] withcolor \MPcolor{DoneColor} ;
- \fi
+ fi ;
\stopMPdrawing}%
\dorecurse{\CurrentMaxItem}
{\startMPdrawing
@@ -61,11 +61,11 @@
q[\recurselevel] := tensecircle (wxy,hxy,linewidth) shifted cxy ;
fill q[\recurselevel] withcolor .9white ;
pickup pencircle scaled linewidth ;
- \ifnum\recurselevel=\CurrentMaxItem\space
+ if \recurselevel = \CurrentMaxItem :
draw q[\recurselevel] withcolor \MPcolor{ShowColor} ;
- \else
+ else :
draw q[\recurselevel] withcolor \MPcolor{DoneColor} ;
- \fi
+ fi ;
\stopMPdrawing}%
\dostepwiserecurse{2}{\CurrentTopic}{1}
{\startMPdrawing
@@ -90,14 +90,14 @@
\MPdrawingdonetrue
\getMPdrawing}
-\def\TitlePage#1%
+\unexpanded\def\TitlePage#1%
{\startstandardmakeup
\setupalign[middle]
\def\\{\vfil\bfb\setupinterlinespace}
\bfd\setupinterlinespace
\vfil#1\vfil\vfil
\stopstandardmakeup}
-
+
\definecolor[PageColor][r=.5,g=.4,b=.3]
\definecolor[LineColor][r=.7,g=.6,b=.5]
@@ -123,19 +123,19 @@
\doglobal\newcounter\CurrentItem
\doglobal\newcounter\CurrentTopic
-\def\StartIdea%
+\unexpanded\def\StartIdea
{\doglobal\newcounter\CurrentItem}
-\def\StartTopic%
+\unexpanded\def\StartTopic
{\doglobal\increment\CurrentTopic
\dostartbuffer[topic-\CurrentTopic][StartTopic][StopTopic]}
-\def\StopIdea%
+\unexpanded\def\StopIdea
{\dorecurse{\CurrentItem}
{\let\CurrentMaxItem\recurselevel
\doStopIdea}}
-\def\doStopIdea%
+\unexpanded\def\doStopIdea
{\startstandardmakeup
\dontcomplain
\vskip.875cm
@@ -170,14 +170,14 @@
\vfilll
\stopstandardmakeup}
-\def\StartItem%
+\unexpanded\def\StartItem
{\doglobal\increment\CurrentItem
\dostartbuffer[item-\CurrentItem][StartItem][StopItem]}
\lefthyphenmin =\maxdimen
\righthyphenmin=\maxdimen
-\doifnotmode{demo}{\endinput}
+% \doifnotmode{demo}{\endinput}
\starttext
diff --git a/tex/context/modules/mkiv/s-present-banner.mkiv b/tex/context/modules/mkiv/s-present-banner.mkiv
index 2ecafe3b9..3f9f360ab 100644
--- a/tex/context/modules/mkiv/s-present-banner.mkiv
+++ b/tex/context/modules/mkiv/s-present-banner.mkiv
@@ -1,4 +1,4 @@
-%D \module
+D \module
%D [ file=s-present-banner,
%D version=2016.04.30, % around
%D title=\CONTEXT\ Style File,
diff --git a/tex/context/modules/mkiv/s-present-colorful.mkiv b/tex/context/modules/mkiv/s-present-colorful.mkiv
new file mode 100644
index 000000000..ed4b5f7c4
--- /dev/null
+++ b/tex/context/modules/mkiv/s-present-colorful.mkiv
@@ -0,0 +1,384 @@
+%D \module
+%D [ file=s-present-colorful, % was s-pre-04
+%D version=1998.09.06,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Colorful,
+%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.
+
+\usemodule[present-general]
+
+\startmodule[present-colorful]
+
+%D \macros
+%D {setupbodyfont}
+%D
+%D This is just another environment for typesetting interactive presentations. I
+%D wrote this module on behalf of a course I gave for the United Kingdom \TeX\ users
+%D group.
+
+\setupbodyfont[postscript,14.4pt]
+
+%D \macros
+%D {setupcolors,definecolor}
+%D
+%D I started using dark blue for the navigational elements. In that context, dark
+%D red is a logical choice for the contrast color. While playing around with the
+%D navigational elements I decided to use the not so dominant color yellow for the
+%D status bar.
+%D
+%D A few days before I wrote this style, the recent acquisition of Mondriaans last
+%D painting by the Dutch governement was a hot topic in the Dutch news scenary.
+%D Therefore I decided to replace the rather dull title page by something more
+%D colorful, in mondriaan colors, but far more random than any of his paintings. For
+%D consistence we remap the already defined primary colors.
+%D
+%D The \MKIV\ version is adapted abit so that the title is better visible.
+
+\setupcolors [state=start]
+
+\definecolor [NoneColor] [s=.6]
+\definecolor [GotoColor] [b=.6] \definecolor[blue] [GotoColor]
+\definecolor [ExitColor] [r=.6] \definecolor[red] [ExitColor]
+\definecolor [JumpColor] [s=.6]
+\definecolor [UserColor] [g=.6] \definecolor[green] [UserColor]
+%definecolor [StepColor] [r=.6,g=.6] \definecolor[yellow][StepColor]
+\definecolor [StepColor] [y=.8] \definecolor[yellow][StepColor]
+
+\definecolor [PageColor] [s=.80] \definecolor[gray] [PageColor]
+\definecolor [TextColor] [s=.90]
+\definecolor [TitleColor][s=.90]
+
+%D \macros
+%D {setuppapersize}
+%D
+%D As usual, we take a screen oriented paper size:
+
+\setuppapersize
+ [S6][S6]
+
+%D \macros
+%D {setuplayout,setupinteractionscreen}
+%D
+%D The layout definition fits into this $600\times450$ point area, but the
+%D dimensions are somewhat diffused by the text background offset.
+
+\setuplayout
+ [width=530pt,
+ height=400pt,
+ header=0pt,
+ footer=0pt,
+ backspace=15pt,
+ topspace=15pt,
+ bottomdistance=15pt,
+ bottom=10pt,
+ margin=0pt,
+ rightedgedistance=15pt,
+ rightedge=30pt]
+
+\setupinteractionscreen
+ [option=max]
+
+%D \macros
+%D {setupbackgrounds}
+%D
+%D Both the page and the text area have a gray background. The \type {[text,text]}
+%D area also has an offset. Later we will see that we have to compensate for that in
+%D the navigational areas.
+
+\setupbackgrounds
+ [page]
+ [background=color,
+ backgroundcolor=PageColor]
+
+\setupbackgrounds
+ [text][text]
+ [background=color,
+ backgroundcolor=TextColor,
+ backgroundoffset=5pt]
+
+%D \macros
+%D {setupinteraction}
+%D
+%D For convenient navigation, we turn on interaction.
+
+\setupinteraction
+ [state=start,
+ menu=on,
+ color=UserColor,
+ contrastcolor=NoneColor]
+
+%D \macros
+%D {setupsubpagenumber}
+%D
+%D When navigating the document, we keep the title page out of sight, therefore we
+%D use sub page numbers.
+
+\setupsubpagenumber
+ [state=start,
+ way=bytext]
+
+%D \macros
+%D {setupinteractionmenu}
+%D
+%D There is only one interaction menu, located in the right edge of the screen. Both
+%D offsets enlarge the edge by the same amount as the text background offset.
+
+\setupinteractionmenu
+ [right]
+ [state=start,
+ frame=off,
+ strut=no,
+ offset=0pt,
+ inbetween=,
+ bottomoffset=-5pt,
+ topoffset=-5pt]
+
+%D \macros
+%D {startinteractionmenu}
+%D
+%D The menu itself is not that spectacular. We use the start||stop alternative for
+%D setting the content. The macro \type {\interactioncolor} expands into either the
+%D interaction color or the contrast color, the latter only when no jump is
+%D possible.
+
+\startinteractionmenu[right]
+ \setupinteraction[color=GotoColor]
+ \but [previoussubpage] \Triangle {90}\hsize\interactioncolor \\
+ \vskip10pt
+ \but [nextsubpage] \Triangle{270}\hsize\interactioncolor \\
+ \vfill
+ \but [PreviousJump] \Triangle{180}\hsize{NoneColor} \\
+ \vskip-5pt
+ \but [NextJump] \Triangle {0}\hsize{NoneColor} \\
+\stopinteractionmenu
+
+%D \macros
+%D {setupinteractionbar}
+%D
+%D The interaction bar at the bottom is also larger than the normal width of the
+%D bottom area.
+
+\setupinteractionbar
+ [width=\textwidth,
+ height=\bottomheight,
+ distance=10pt,
+ color=NoneColor,
+ contrastcolor=StepColor]
+
+%D \macros
+%D {setupbottomtexts}
+%D
+%D The bar is centered in the middle.
+
+\setupbottomtexts
+ [{\interactionbar[alternative=f]}]
+
+%D We can exit viewing with a close button, located on the rightmost bottom area.
+
+\unexpanded\def\CloseButton
+ {\ifnum\realpageno>\plusone
+ \button
+ [width=\rightedgewidth,
+ height=\bottomheight,
+ offset=overlay,
+ background=color,
+ backgroundcolor=ExitColor,
+ frame=off]
+ {}%
+ [CloseDocument]%
+ \fi}
+
+\setupbottomtexts
+ [edge][][\CloseButton]
+
+%D \macros
+%D {definesymbol,setupitemize}
+%D
+%D Because some prominent things are rectangular or triangular, we prefer some
+%D different symbols in itemizations:
+
+\definesymbol[1][\blacktriangleright]
+\definesymbol[2][\blacktriangledown]
+\definesymbol[3][\blacktriangleright]
+\definesymbol[4][\blacktriangledown]
+
+\setupitemize[each][color=NoneColor]
+
+%D \macros
+%D {TitlePage,defineoverlay,button,setupalign,
+%D setupbackgrounds,setupinteraction,setupinteractionbar,
+%D startstandardmakeup,switchtobodyfont,setupinterlinespace}
+%D
+%D Now the main layout and navigational definitions are done, it makes sense to
+%D define and tune some structuring commands. First we build the titlepage.
+
+\defineoverlay [TitleGraphic] [\useMPgraphic{title}]
+\defineoverlay [NextPage] [\overlaybutton{nextpage}]
+
+\unexpanded\def\StartTitlePage
+ {\setupbackgrounds[page][background={color,TitleGraphic,NextPage}]
+ \setupbackgrounds[text][text][background=]
+ \setupinteraction[menu=off]
+ \setupinteractionbar[state=stop]
+ \startpagemakeup
+ \switchtobodyfont[24pt]
+ \bfd\setupinterlinespace
+ \setupalign[middle]
+ \vfil
+ \let\\=\vfil
+ \scale
+ [factor=max]\bgroup
+ \framed
+ [frame=off,
+ align=middle,
+ foregroundcolor=TitleColor,
+ offset=.05\textwidth]
+ \bgroup}
+
+\unexpanded\def\StopTitlePage
+ {\egroup
+ \egroup
+ \vfil\vfil\vfil
+ \stoppagemakeup
+ \setupinteraction[menu=on]
+ \setupinteractionbar[state=start]
+ \setupbackgrounds[page][background=color]
+ \setupbackgrounds[text][text][background=color]}
+
+\unexpanded\def\TitlePage#1%
+ {\StartTitlePage#1\StopTitlePage}
+
+%D \macros
+%D {Topic, Nopic, Subject,
+%D definehead, setuphead}
+%D
+%D We use \type {\Topic} and \type {\Subject} instead of chapters and sections. The
+%D \type {\Nopic} alternative is meant for internal use.
+
+\definehead [Topic] [chapter]
+\definehead [Nopic] [title]
+\definehead [Subject] [section]
+
+\setuphead
+ [Topic,Nopic]
+ [after={\blank[3*medium]},
+ number=no,
+ style=\bfb,
+ page=yes,
+ alternative=middle]
+
+\setuphead
+ [Subject]
+ [after=\blank,
+ number=no,
+ page=yes,
+ continue=no,
+ style=\bfa]
+
+%D \macros
+%D {Topics, Subjects,
+%D setuplist, placelist, startcolumns}
+%D
+%D This style is meant for the more large presentations, and therefore provided for
+%D a list of topics as well as local lists of subjects. When many topics are
+%D introduces, the list is typeset in columns.
+
+\setuplist
+ [Topic,Subject]
+ [alternative=g,
+ interaction=all,
+ before=,
+ after=]
+
+\setuplist
+ [Topic]
+ [criterium=all]
+
+\unexpanded\def\Topics#1%
+ {\determinelistcharacteristics[Topic]
+ \ifnum\utilitylistlength>0
+ \Nopic[Topics]{#1}
+ \ifnum\utilitylistlength>12
+ \startcolumns
+ \placelist[Topic]
+ \stopcolumns
+ \else
+ \placelist[Topic]
+ \fi
+ \fi}
+
+\unexpanded\def\Subjects%
+ {\placelist[Subject]}
+
+%D Last we define the overlays. Look at the way colors are linked into the macros.
+
+\setupMPvariables
+ [triangle]
+ [width=1cm,
+ rotation=0,
+ color=black]
+
+\startuniqueMPgraphic{triangle}{width,rotation,color}
+ fill triangle xsized \MPvar{width} rotated \MPvar{rotation} withcolor \MPvar{color} ;
+\stopuniqueMPgraphic
+
+\unexpanded\def\Triangle#1#2#3%
+ {\uniqueMPgraphic{triangle}{rotation=#1,width=#2,c:color=#3}}
+
+% \startuseMPgraphic{title}
+% path p ; numeric sx, sy, cc ;
+% for i=1 upto 250 :
+% sx := uniformdeviate 30 ;
+% sy := uniformdeviate 30 ;
+% cc := round(uniformdeviate 2) ;
+% if round(uniformdeviate 1) = 0 :
+% p := unitsquare xscaled sx yscaled sy ;
+% else :
+% p := unittriangle scaled sx rotated (round(uniformdeviate 3) * 90) ;
+% fi ;
+% p := p shifted (uniformdeviate OverlayWidth,uniformdeviate OverlayHeight) ;
+% fill p
+% withcolor
+% if cc = 0 : "GotoColor"
+% elseif cc = 1 : "ExitColor"
+% elseif cc = 2 : "StepColor" fi ;
+% endfor ;
+% \stopuseMPgraphic
+
+\startuseMPgraphic{title}
+ path p ; numeric sx, sy, cc ;
+ fill Page withcolor "StepColor" ;
+ for i=1 upto 1000 :
+ sx := 50 + uniformdeviate 50 ;
+ sy := 50 + uniformdeviate 50 ;
+ cc := round(uniformdeviate 2) ;
+ if round(uniformdeviate 1) = 0 :
+ p := unitsquare xscaled sx yscaled sy ;
+ else :
+ p := unittriangle scaled sx rotated (round(uniformdeviate 3) * 90) ;
+ fi ;
+ p := p shifted (uniformdeviate OverlayWidth,uniformdeviate OverlayHeight) ;
+ fill p
+ withcolor
+ if cc = 0 : "GotoColor"
+ elseif cc = 1 : "ExitColor"
+ elseif cc = 2 : "StepColor" fi ;
+ draw p
+ withpen pencircle scaled 1/2
+ withcolor white ;
+ endfor ;
+\stopuseMPgraphic
+
+\stopmodule
+
+\continueifinputfile{s-present-colorful.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-colorful-001.tex}
diff --git a/tex/context/modules/mkiv/s-present-common.mkiv b/tex/context/modules/mkiv/s-present-common.mkiv
index 64da8b700..b4b422ca5 100644
--- a/tex/context/modules/mkiv/s-present-common.mkiv
+++ b/tex/context/modules/mkiv/s-present-common.mkiv
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\startmodule[present-common]
+
\startluacode
-- sources -> presentations
@@ -38,4 +40,4 @@
\unexpanded\def\inputpresentationfile#1%
{\ctxcommand{inputpresentationfile("#1")}}
-\endinput
+\stopmodule
diff --git a/tex/context/modules/mkiv/s-present-funny.mkiv b/tex/context/modules/mkiv/s-present-funny.mkiv
new file mode 100644
index 000000000..4948766ad
--- /dev/null
+++ b/tex/context/modules/mkiv/s-present-funny.mkiv
@@ -0,0 +1,208 @@
+%D \module
+%D [ file=s-present-funny, % was s-pre-03
+%D version=1998.09.06,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Funny,
+%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.
+
+\startmodule[present-funny]
+
+%D This is the third environment for typesetting interactive presentations. I used
+%D this style for a talk on \TEX\ and \JAVASCRIPT\ at \TUG98, mainly because I
+%D didn't want to use the same style three times. Therefore this is a rather simple,
+%D silly style.
+
+\usemodule[pre-general]
+
+%D \macros
+%D {setupbodyfont}
+%D
+%D We use a large bodyfont. Combined with the fancy
+%D background, this does not leave that much room for text, but
+%D presentations should use much text anyway.
+
+\doifelsemode {asintended} {
+ \setupbodyfont[ludicaot,14.4pt]
+} {
+ \setupbodyfont[pagella,14.4pt]
+}
+
+%D \macros
+%D {setuppapersize,setuplayout,setupinteractionscreen}
+%D
+%D The page dimensions are set to size \type {S6}, being 600pt by 450pt. We use wide
+%D margins and discard headers and footers. We also launch the document full screen.
+
+\setuppapersize
+ [S6][S6]
+
+\setuplayout
+ [width=middle,
+ height=middle,
+ topspace=75pt,
+ backspace=100pt,
+ header=0pt,
+ footer=0pt]
+
+\setupinteractionscreen
+ [option=max]
+
+%D \macros
+%D {definecolor}
+%D
+%D Next, color support is turned on and a dark red color is defined. Other red
+%D shades will be derived from this one color.
+
+\definecolor [PageColor] [black]
+\definecolor [BackgroundColor] [s=.85]
+\definecolor [OrnamentColor] [r=.75]
+\definecolor [PositionColor] [s=.55]
+
+%D \macros
+%D {setupinteraction}
+%D
+%D We turn on interaction mode and use the same color for hyperlinks and redundant
+%D hyperlinks (the ones that point to the current page).
+
+\setupinteraction
+ [state=start,
+ contrastcolor=OrnamentColor,
+ color=OrnamentColor]
+
+%D \macros
+%D {defineoverlay, setupbackgrounds}
+%D
+%D The joke in this presentation is the elliptical shape of which the bottom part
+%D includes a page indication.
+
+\defineoverlay
+ [PageShape][\useMPgraphic{PageShape}]
+
+\startuseMPgraphic{PageShape}
+ StartPage ;
+ path p ; pair pa, pb ; numeric len ; color contrastcolor ;
+ fill Page withcolor \MPcolor {PageColor} ;
+ pickup pencircle rotated 45 xscaled 10pt yscaled 20pt ;
+ p := Page enlarged (-10pt,-15pt) superellipsed .8 ;
+ p := p shifted (-1.5pt,0) ; % looks better
+ fill p withcolor \MPcolor{BackgroundColor} ;
+ draw p withcolor \MPcolor{OrnamentColor} ;
+ contrastcolor = \MPcolor{PositionColor} ;
+ if (RealPageNumber > 0) and (NOfPages > 0):
+ draw point 5 of p withcolor contrastcolor ;
+ draw point 7 of p withcolor contrastcolor ;
+ len := 2/NOfPages ;
+ pa := point (5+len* RealPageNumber ) of p ;
+ pb := point (5+len*(RealPageNumber-1)) of p ;
+ draw (p cutafter pa) cutbefore pb
+ withcolor contrastcolor ;
+ fi ;
+ StopPage ;
+\stopuseMPgraphic
+
+%D We use the viewer provided feature to go to the previous or next page.
+
+\defineoverlay[PrevButton][\overlaybutton{PreviousPage}]
+\defineoverlay[NextButton][\overlaybutton{NextPage}]
+
+\setupbackgrounds
+ [page]
+ [background={PageShape,PrevButton}]
+
+\setupbackgrounds
+ [text][text]
+ [background=NextButton]
+
+% or using hard coded next/prev pages:
+%
+% \defineoverlay[PrevButton][\overlaybutton{previouspage}]
+% \defineoverlay[NextButton][\overlaybutton{nextpage}]
+%
+% \setupbackgrounds[state=repeat]
+% \setupbackground[text][text][background=NextButton]
+%
+% or simply (using an repeated layer):
+%
+% \setupbackground[text][background=NextButton]
+
+%D \macros
+%D {definehead, setuphead}
+%D
+%D Like the other presentation styles, we use \type {\Topic} instead of \type
+%D {\chapters}. This time we don't provide an additional sectioning. So we have:
+%D
+%D \starttyping
+%D \TitlePage{How nice}
+%D
+%D \Topics{This is about ...}
+%D
+%D \Topic{The first one}
+%D
+%D \Topic{Another one}
+%D \stoptyping
+
+\definehead [Topic] [chapter]
+\definehead [Nopic] [title]
+
+\setuphead
+ [Topic,Nopic]
+ [after={\blank[3*medium]},
+ number=no,
+ style=\bfb,
+ page=yes,
+ alternative=middle]
+
+\setuplist
+ [Topic]
+ [alternative=g,
+ interaction=all,
+ before=,
+ after=]
+
+\let\Subject\Topic
+
+%D The tables of contents is associated with \type {\Topics}.
+
+\unexpanded\def\Topics#1%
+ {\Nopic[Topics]{#1}
+ \placelist[Topic][criterium=all]}
+
+\unexpanded\def\Subjects
+ {}
+
+%D Instead of \type {\TitlePage}, one can use the pair \type {\StartTitlePage} --
+%D \type {\StopTitlePage}:
+%D
+%D \starttyping
+%D \StartTitlePage
+%D A Self Made Title
+%D \StopTitlePage
+%D \stoptyping
+
+\unexpanded\def\StartTitlePage
+ {\startstandardmakeup
+ \bfd\setupinterlinespace
+ \setupalign[middle]
+ \vfil
+ \def\\{\vfil\bfb\setupinterlinespace}}
+
+\unexpanded\def\StopTitlePage
+ {\vfil\vfil\vfil
+ \stopstandardmakeup}
+
+\unexpanded\def\TitlePage#1%
+ {\StartTitlePage#1\StopTitlePage}
+
+\stopmodule
+
+\continueifinputfile{s-present-funny.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-funny-001.tex}
diff --git a/tex/context/modules/mkiv/s-present-fuzzy.mkiv b/tex/context/modules/mkiv/s-present-fuzzy.mkiv
new file mode 100644
index 000000000..ee029b0e6
--- /dev/null
+++ b/tex/context/modules/mkiv/s-present-fuzzy.mkiv
@@ -0,0 +1,225 @@
+%D \module
+%D [ file=s-present-fuzzy, % was s-pre-05
+%D version=1998.12.12,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Fuzzy,
+%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.
+
+\usemodule[present-general]
+
+\startmodule[present-fuzzy]
+
+%D As all styles sofar, this one has the same structuring commands.
+
+\doifelsemode {asintended} {
+ \setupbodyfont[ludicaot,14.4pt]
+} {
+ \setupbodyfont[pagella,14.4pt]
+}
+
+\definecolor [BackgroundColor] [s=.95]
+\definecolor [OrnamentColor] [r=.6,g=.7,b=.8]
+
+\setuppapersize
+ [S6][S6]
+
+\setuplayout
+ [width=430pt,
+ height=400pt,
+ header=0pt,
+ footer=0pt,
+ margin=0pt,
+ backspace=25pt,
+ topspace=25pt,
+ rightedgedistance=20pt,
+ rightedge=110pt]
+
+\setupinteractionscreen
+ [option=max]
+
+\setupbackgrounds
+ [state=repeat]
+
+\setupbackgrounds
+ [page]
+ [backgroundcolor=white]
+
+\setupbackgrounds
+ [text][text]
+ [background={HashFrameA,NextPage},
+ backgroundoffset=20pt]
+
+\defineoverlay
+ [HashFrameA]
+ [\useMPgraphic{HashFrameA}]
+
+\defineoverlay
+ [HashFrameB]
+ [\useMPgraphic{HashFrameB}]
+
+\setupinteraction
+ [state=start,
+ menu=on,
+ color=OrnamentColor,
+ contrastcolor=OrnamentColor]
+
+%D Watch how we use a list alternative that matches the menu.
+
+\setupinteractionmenu
+ [right]
+ [background=HashFrameB,
+ style=smallbold,
+ frame=off,
+ offset=10pt,
+ height=35pt,
+ before=,
+ after=,
+ inbetween=\endgraf,
+ width=\rightedgewidth]
+
+\startinteractionmenu[right]
+ \placelist
+ [Topic]
+ [criterium=all,
+ alternative=right,
+ maxwidth=.8\rightedgewidth,
+ interaction=all,
+ before=,
+ after=]
+ \vfill
+ \setupinteractionmenu
+ [right]
+ [height=30pt]
+ \but [CloseDocument] Close \\
+\stopinteractionmenu
+
+\setupwhitespace
+ [big]
+
+\setupblank
+ [big]
+
+%D \macros
+%D {TitlePage}
+%D
+%D Now the main layout and navigational definitions are done, it makes sense to
+%D define and tune some structuring commands. First we build the titlepage.
+
+\defineoverlay [TitleGraphic] [\useMPgraphic{TitleGraphic}]
+\defineoverlay [NextPage] [\overlaybutton{forward}]
+
+\unexpanded\def\StartTitlePage
+ {\setupbackgrounds[page][background={color,TitleGraphic,NextPage}]
+ \setupbackgrounds[text][text][background=]
+ \setupinteraction[menu=off]
+ \setupinteractionbar[state=stop]
+ \setuplayout[width=550pt,rightedge=0pt]
+ \startstandardmakeup
+ \switchtobodyfont[24pt]
+ \bfd\setupinterlinespace
+ \setupalign[middle]
+ \vfil
+ \let\\=\vfil}
+
+\unexpanded\def\StopTitlePage
+ {\vfil\vfil\vfil
+ \stopstandardmakeup
+ \setuplayout[width=430pt,rightedge=110pt]
+ \setupinteraction[menu=on]
+ \setupinteractionbar[state=start]
+ \setupbackgrounds[page][background=color]
+ \setupbackgrounds[text][text][background={HashFrameA,NextPage}]}
+
+\unexpanded\def\TitlePage#1%
+ {\StartTitlePage#1\StopTitlePage}
+
+%D \macros
+%D {Topics,Subjects}
+%D
+%D Because the lists are in the menu, we don't honor list placement macros.
+
+\unexpanded\def\Topics#1{}
+\unexpanded\def\Subjects{}
+
+%D \macros
+%D {Topic, Nopic, Subject}
+%D
+%D Since this style is meant for rather flat structured documents, only \type
+%D {\Topic} makes sense.
+
+\definehead [Topic] [chapter]
+\definehead [Nopic] [title]
+\definehead [Subject] [section]
+
+\setuphead
+ [Topic, Nopic]
+ [after={\blank[3*medium]},
+ number=no,
+ style=\tfb,
+ page=yes,
+ alternative=middle]
+
+\setuphead
+ [Subject]
+ [after=\blank,
+ number=no,
+ page=yes,
+ continue=no,
+ style=\tfa]
+
+%D We use only one kind of base graphic, which is sligthly
+%D tuned for the different usage.
+
+\startMPdefinitions
+ def random_hash_frame (expr width, height, offset, linewidth ) =
+
+ def delta = ((uniformdeviate .5offset) + .25offset) enddef ;
+ x1 := offset ; y1 := offset ; x2 := width-offset ; y2 := height-offset ;
+
+ drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{BackgroundColor}) ;
+ fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
+
+ drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
+ draw (x1-delta,y1)--(x2+delta,y1) ;
+ draw (x2,y1-delta)--(x2,y2+delta) ;
+ draw (x2+delta,y2)--(x1-delta,y2) ;
+ draw (x1,y2+delta)--(x1,y1-delta) ;
+
+ drawoptions();
+ setbounds currentpicture to unitsquare xscaled width yscaled height ;
+ enddef ;
+\stopMPdefinitions
+
+\startuseMPgraphic{HashFrameA}
+ random_hash_frame(OverlayWidth,OverlayHeight,15pt,2pt) ;
+\stopuseMPgraphic
+
+\startuseMPgraphic{HashFrameB}
+ random_hash_frame(OverlayWidth,OverlayHeight, 5pt,2pt) ;
+\stopuseMPgraphic
+
+\startuseMPgraphic{TitleGraphic}
+ numeric offset, width, height ;
+ for i=1 upto 300 :
+ offset := uniformdeviate 10pt ;
+ width := 2*offset + 30pt + uniformdeviate 30pt ;
+ height := 2*offset + 10pt + uniformdeviate 10pt ;
+ addto currentpicture also
+ image(random_hash_frame(width,height,offset,1pt)) shifted
+ (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
+ endfor ;
+\stopuseMPgraphic
+
+\stopmodule
+
+\continueifinputfile{s-present-fuzzy.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-fuzzy-001.tex}
diff --git a/tex/context/modules/mkiv/s-present-green.mkiv b/tex/context/modules/mkiv/s-present-green.mkiv
new file mode 100644
index 000000000..e62257ff3
--- /dev/null
+++ b/tex/context/modules/mkiv/s-present-green.mkiv
@@ -0,0 +1,349 @@
+%D \module
+%D [ file=s-present-green, % was s-pre-02
+%D version=1998.04.21,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Green,
+%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.
+
+\startmodule[present-green]
+
+%D Here is another original presentation style, actually the second one we made.
+%D Not much adaption was needed for \MKIV.
+
+\usemodule[pre-general]
+
+%D \macros
+%D {setupbodyfont, switchtobodyfont, setuplayout}
+%D
+%D At \PRAGMA\ we prefer using the Lucida Bright fonts, but one can of course load
+%D another typeface.
+
+\doifelsemode {asintended} {
+ \setupbodyfont[ludicaot,14.4pt]
+} {
+ \setupbodyfont[pagella,14.4pt]
+}
+
+\setuplayout
+ [style=smallbodyfont]
+
+%D \macros
+%D {setuppapersize, setuplayout}
+%D
+%D The papersize suits the screen dimensions. The layout is rather simple. We use
+%D the whole width of the screen and only have navigational tools at the bottom of
+%D the screen.
+
+\setuppapersize
+ [S6][S6]
+
+\setuplayout
+ [backspace=1cm,
+ topspace=1cm,
+ margin=0pt,
+ header=0pt,
+ footer=0pt,
+ bottomdistance=.875cm,
+ bottom=1cm,
+ width=fit,
+ height=fit]
+
+%D \macros
+%D {setupwhitespace, setuptyping}
+%D
+%D We don't have much height, so we use a more cramped spacing. Verbatim text looks
+%D better when indented.
+
+\setupwhitespace
+ [medium]
+
+\setuptyping
+ [margin=standard]
+
+%D \macros
+%D {definecolor}
+%D
+%D Of course we enable color. We define some logical colors, of which most default
+%D to the same green shade.
+
+\definecolor [BackgroundColor] [r=.8, g=.8, b=.8]
+\definecolor [OrnamentColor] [r= 0, g=.7, b=.4]
+
+%D \macros
+%D {setupinteraction, setupinteractionscreen}
+%D
+%D We still have to enable interaction mode. We go full screen!
+
+\setupinteraction
+ [state=start,
+ color=OrnamentColor,
+ contrastcolor=OrnamentColor]
+
+\setupinteractionscreen
+ [option=max,
+ width=fit,
+ height=fit]
+
+%D \macros
+%D {setupitemize}
+%D
+%D And why not bring some color in itemizations too?
+
+\setupitemize
+ [color=OrnamentColor]
+
+%D \macros
+%D {defineoverlay, setupbackgrounds}
+%D
+%D The navigational elements and the backgrounds are provided by \METAPOST.
+
+\startuniqueMPgraphic{PageBackground}
+ fill unitsquare
+ xyscaled(OverlayWidth,OverlayHeight)
+ withcolor OverlayColor ;
+ draw unitsquare
+ xyscaled(OverlayWidth,OverlayHeight)
+ enlarged (-2*OverlayLineWidth)
+ withpen pencircle scaled OverlayLineWidth
+ withcolor OverlayLineColor ;
+\stopuniqueMPgraphic
+
+\defineoverlay
+ [PageBackground]
+ [\uniqueMPgraphic{PageBackground}]
+
+\setupbackgrounds
+ [page]
+ [background=PageBackground,
+ backgroundcolor=BackgroundColor,
+ rulethickness=.125cm,
+ framecolor=OrnamentColor]
+
+%D \macros
+%D {setuptexttexts}
+%D
+%D By clicking on the text area, one goes to the next page. We hook this feature
+%D into the text backgrounds.
+
+\startuniqueMPgraphic{TextBackground}
+ draw unitsquare
+ xyscaled(OverlayWidth,OverlayHeight)
+ enlarged (4*OverlayLineWidth)
+ withpen pencircle scaled OverlayLineWidth
+ withcolor OverlayLineColor ;
+\stopuniqueMPgraphic
+
+\defineoverlay
+ [TextBackground]
+ [\uniqueMPgraphic{TextBackground}]
+
+\defineoverlay
+ [NextPage]
+ [\overlaybutton{nextpage}]
+
+\setupbackgrounds
+ [text]
+ [background={TextBackground,NextPage},
+ backgroundcolor=BackgroundColor,
+ rulethickness=.0625cm,
+ framecolor=OrnamentColor]
+
+%D \macros
+%D {setupinteractionmenu,startinteractionmenu}
+%D
+%D At the bottom of the screen, we show three buttons. These direct us to the
+%D previous or next jump or exit the document.
+
+\setupMPvariables[RightArrow][height=\bottomheight]
+\setupMPvariables[LeftArrow] [height=\bottomheight]
+\setupMPvariables[Circle] [height=\bottomheight]
+\setupMPvariables[UpArrow] [height=\bottomheight]
+
+\startuniqueMPgraphic{RightArrow}{height}
+ fill righttriangle xysized(\MPvar{height},\MPvar{height})
+ withpen pencircle scaled (\MPvar{height}/5)
+ withcolor "OrnamentColor" ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{LeftArrow}{height}
+ fill lefttriangle xysized(\MPvar{height},\MPvar{height})
+ withpen pencircle scaled (\MPvar{height}/5)
+ withcolor "OrnamentColor" ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{Circle}{height}
+ fill fullcircle sized \MPvar{height}
+ withpen pencircle scaled (\MPvar{height}/5)
+ withcolor "OrnamentColor" ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{UpArrow}{height}
+ fill uptriangle xysized(\MPvar{height},\MPvar{height})
+ withpen pencircle scaled (\MPvar{height}/5)
+ withcolor "OrnamentColor" ;
+\stopuniqueMPgraphic
+
+\setupinteractionmenu
+ [bottom]
+ [state=start,
+ frame=off,
+ width=.3\textwidth,
+ height=\bottomheight]
+
+\setupinteraction
+ [menu=on]
+
+\def\WhateverButton
+ {\doifreferencefoundelse{Whatever}
+ {\raw [Whatever] \uniqueMPgraphic{UpArrow} \\}
+ {}}
+
+\startinteractionmenu[bottom]
+ \but [Topics] \\ % secret button
+ \hfill
+ \WhateverButton % user specific
+ \kern2\bottomheight
+ \raw [previouspage] \uniqueMPgraphic{LeftArrow} \\
+ \kern.5\bottomheight
+ \raw [CloseDocument] \uniqueMPgraphic{Circle} \\
+ \kern.5\bottomheight
+ \raw [nextpage] \uniqueMPgraphic{RightArrow} \\
+ \kern.5\bottomheight
+\stopinteractionmenu
+
+%D \macros
+%D {TitlePage, Topics, Topic, Subject}
+%D
+%D A presentation after loading this module looks like:
+%D
+%D \starttyping
+%D \TitlePage {About Whatever\\Topics}
+%D
+%D \Topics {Todays Talk}
+%D
+%D \Topic {Some topic}
+%D
+%D .....
+%D
+%D \Topic {Next Topic}
+%D
+%D .....
+%D \stoptyping
+
+%D \macros
+%D {StartTitlePage, TitlePage}
+%D
+%D The titlepage is rather simple and can be typeset in two
+%D ways:
+%D
+%D \starttyping
+%D \StartTitlePage
+%D text \\ text \\ text
+%D \StopTitlepage
+%D \stoptyping
+%D
+%D or as one||liner:
+%D
+%D \starttyping
+%D \TitlePage{text\\text\\text}
+%D \stoptyping
+%D
+%D The first alternative can be used for more complicated title pages.
+
+\unexpanded\def\StartTitlePage
+ {\startstandardmakeup
+ \bfd\setupinterlinespace
+ \setupalign[middle]
+ \vfil
+ \let\\=\vfil}
+
+\unexpanded\def\StopTitlePage
+ {\vfil\vfil\vfil
+ \stopstandardmakeup}
+
+\unexpanded\def\TitlePage#1%
+ {\StartTitlePage#1\StopTitlePage}
+
+%D \macros
+%D {definehead}
+%D
+%D The commands \type{\Topic} and \type{\Subject} are defined as copies of head. We
+%D use \type{\Nopic} for internal purposes.
+
+\definehead [Topic] [chapter]
+\definehead [Subject] [section]
+
+\definehead [Nopic] [title]
+
+%D \macros
+%D {setuphead}
+%D
+%D We use our own command for typesetting the titles. We hide sectionnumbers from
+%D viewing. Each topic is followed by a list of subjects that belong to the topic.
+
+\setuphead
+ [Topic, Nopic]
+ [after={\blank[3*medium]},
+ number=no,
+ style=\bfb,
+ page=yes,
+ alternative=middle]
+
+\setuphead
+ [Subject]
+ [after=\blank,
+ number=no,
+ page=yes,
+ continue=no,
+ style=\tfa]
+
+%D \macros
+%D {setuplist}
+%D
+%D When found, the subject list is automatically placed after the topic head.
+
+\setuplist
+ [Topic,Subject]
+ [alternative=g,
+ interaction=all,
+ before=,
+ after=]
+
+\setuplist
+ [Topic]
+ [criterium=all]
+
+\unexpanded\def\Topics#1%
+ {\determinelistcharacteristics[Topic]
+ \doifmode{*list}
+ {\Nopic[Topics]{#1}
+ \startcolumns
+ \placelist[Topic]
+ \stopcolumns}}
+
+\setuplist
+ [Subject]
+ [criterium=Topic]
+
+\unexpanded\def\Subjects
+ {\determinelistcharacteristics[Subject]
+ \doifmode{*list}
+ {\placelist[Subject]}}
+
+\setuphead
+ [Topic]
+ [after={\blank[3*medium]\Subjects}]
+
+\stopmodule
+
+\continueifinputfile{s-present-green.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-green-001.tex}
diff --git a/tex/context/modules/mkiv/s-present-grow.mkiv b/tex/context/modules/mkiv/s-present-grow.mkiv
new file mode 100644
index 000000000..b4971e40f
--- /dev/null
+++ b/tex/context/modules/mkiv/s-present-grow.mkiv
@@ -0,0 +1,171 @@
+%D \module
+%D [ file=s-present-grow, % was s-pre-10
+%D version=unknown,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Grow,
+%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 derived from the ninth style, which was used first at \EUROTEX\ 99
+%D and later at \TUG\ 2000. This alternative builds up a page.
+
+\usemodule[present-windows] % not that much used
+
+\startmodule[present-grow]
+
+%D We use blue colors instead of yellow ones. Since we have used symbolic names, we
+%D can easily overload the existing scheme.
+
+\definecolor[LineColor][r=.40,g=.40,b=1.00]
+
+%D Here we don't use fixed dimensions, but fit the sample windows and derive the
+%D text windows's width from this one.
+
+\setupframedtexts
+ [SampleText]
+ [width=fit,height=fit,
+ background={background,nextpage}]
+
+%D The topic goes to the top right corner of the screen which means that it is
+%D positioned left down to the reference point. Watch how we make data on this layer
+%D (here only the topic but it can be more) persistent.
+
+\setuplayer
+ [topic]
+ [y=0pt,x=\makeupwidth,
+ location=lb,
+ state=repeat,
+ hoffset=-\FrameSkip,
+ voffset=\FrameSkip]
+
+%D Clicking on the page brings us back.
+
+\setupbackgrounds
+ [page]
+ [background={previouspage,color,topic}]
+
+%D All layers end up on the text area. This could have been the page area too since
+%D these have the same dimensions.
+
+\setupbackgrounds
+ [text]
+ [background={common,sample,text}]
+
+%D We overload this one (\MKIV):
+
+\defineoverlay [samepage] [\overlaybutton{nextpage}]
+
+%D Because we build up the text window step by step, we will separate the entries by
+%D white space.
+
+\startsetups [always]
+ \setupwhitespace[big]
+ \setupblank[big]
+\stopsetups
+
+%D The \type {\Topic} commands can be simplified to:
+
+\unexpanded\def\Topic#1%
+ {\resetlayer[topic]
+ \setlayer[topic]{\bfb\setstrut\color[TextColor]{#1}}}
+
+%D We also provide a way to erase the topic.
+
+\unexpanded\def\NoTopic
+ {\resetlayer[topic]}
+
+%D We have to redefine the structuring commands to support the resetting of buffer
+%D counters.
+
+\newcounter\TextN
+
+\unexpanded\def\StartSample
+ {\doglobal\newcounter\TextN
+ \dostartbuffer[sample][StartSample][StopSample]}
+
+\unexpanded\def\StartText
+ {\doglobal\newcounter\TextN
+ \dostartbuffer[text][StartText][StopText]}
+
+\unexpanded\def\StartSubText
+ {\doglobal\increment\TextN
+ \dostartbuffer[text-\TextN][StartSubText][StopSubText]}
+
+\unexpanded\def\StopText
+ {\startstandardmakeup
+ \DoSampleText{text}{common}{nextpage}
+ \stopstandardmakeup}
+
+\unexpanded\def\StopSubText
+ {\startstandardmakeup
+ \DoSampleText{text}{common}{nextpage}
+ \stopstandardmakeup}
+
+%D The \type {\DoSampleText} command is adapted to support addition of subtexts
+%D (each subtext goes into its own buffer).
+
+\unexpanded\def\DoSampleText#1#2#3%
+ {\setupframedtexts[SampleText][background={background,#3}]
+ \bgroup
+ \setups[#1]%
+ \setups[always]%
+ \setbox\nextbox=\hbox
+ {\startSampleText[none]
+ \getbuffer[#1]\par
+ \doif{#1}{text}
+ {\dorecurse{\TextN}{\getbuffer[text-\recurselevel]\par}}
+ \stopSampleText}
+ \xdef\SampleTextWidth{\the\wd\nextbox}
+ \setlayer[#2]{\box\nextbox}%
+ \egroup}
+
+%D Since we are no longer swapping windows, we end up with a much simplier \type
+%D {\Stopidea} macro. We don't reset samples at the inner level.
+
+\unexpanded\def\StartIdea
+ {\bgroup
+ \let\StopSample \relax
+ \let\StopText \relax
+ \let\StopSubText\relax
+ \def\StartSample{\dostartbuffer[sample][StartSample][StopSample]}}
+
+\unexpanded\def\StopIdea
+ {\startstandardmakeup
+ \DoSampleText{sample}{sample}{nextpage}
+ \SetTextWidth
+ \DoSampleText{text} {text} {nextpage}
+ \stopstandardmakeup
+ \egroup}
+
+%D Here we determine the width of the text window. It is derived from the width of
+%D the sample and stays the same within a sequence.
+
+\unexpanded\def\SetTextWidth
+ {\ifnum\TextN<1 % yes or no, may change
+ \scratchdimen=\makeupwidth
+ \advance\scratchdimen by -\SampleTextWidth
+ \advance\scratchdimen by \FrameSkip
+ \xdef\SampleWidth{\the\scratchdimen}%
+ \fi
+ \setupframedtexts
+ [SampleText]
+ [width=\SampleWidth]}
+
+%D We use the (already implemented) second alternative of the titlepage graphic.
+%D Please don't change this.
+
+\defineoverlay[joke] [\useMPgraphic{joke}{n=1}] % not to be changed !
+
+\stopmodule
+
+\continueifinputfile{s-present-grow.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-grow-001.tex}
+
diff --git a/tex/context/modules/mkiv/s-present-original.mkiv b/tex/context/modules/mkiv/s-present-original.mkiv
new file mode 100644
index 000000000..809f7b2cb
--- /dev/null
+++ b/tex/context/modules/mkiv/s-present-original.mkiv
@@ -0,0 +1,397 @@
+%D \module
+%D [ file=s-present-original, % was s-pre-01
+%D version=1997.07.22,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Original,
+%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 environment can be used to typeset interactive presentations. This module
+%D was first used at the 1997 \TUG\ meeting. The \MKIV\ variant is mostly the same
+%D but we adapted the colors a bit.
+
+\usemodule[present-general]
+
+\startmodule[present-original]
+
+%D \macros
+%D {language}
+%D
+%D Because this module is defined in english, we default to the english hyphenation
+%D patterns and labels too. This is default anyway.
+
+\mainlanguage
+ [en]
+
+%D \macros
+%D {setupbodyfont,setuplayout}
+%D
+%D For screen reading, a Lucida Bright font looks nice. We use a 14.4 point bodyfont
+%D for the main text, but switch back to 12 points for ornaments.
+
+\doifelsemode {asintended} {
+ \setupbodyfont[ludicaot,14.4pt]
+} {
+ \setupbodyfont[pagella,14.4pt]
+}
+
+\setuplayout
+ [style=smallbodyfont]
+
+\setupalign
+ [tolerant,stretch]
+
+%D \macros
+%D {definecolor}
+%D
+%D Screen presentations without color just look dull, so we enable color support. We
+%D define ourselves a yellowish backgroundcolor and a not too dark blue
+%D interactioncolor.
+
+% \definecolor [BackgroundColor] [r=1, g=1, b=.7]
+% \definecolor [InteractionColor] [r=.1, g=.5, b=.8]
+% \definecolor [ContrastColor] [r=.9, g=.5, b=.2]
+
+\definecolor [BackgroundColor] [r=.7, g=.7, b=.3]
+\definecolor [InteractionColor] [r=.1, g=.5, b=.8]
+\definecolor [ContrastColor] [r=.9, g=.5, b=.2]
+
+%D \macros
+%D {setuppapersize,setuplayout,setupinteractionscreen}
+%D
+%D We use a nice large screen, and dedicate the right edge and bottom part to
+%D navigational tools. We automatically set the width and height of the page and
+%D start up full screen.
+
+\setuppapersize
+ [S6][S6]
+
+\setuplayout
+ [topspace=12pt,
+ header=0pt,
+ footer=0pt,
+ height=402pt, % 450 - 12 - 15 - 12 - 12 + 3
+ bottomdistance=15pt,
+ bottom=12pt,
+ backspace=12pt,
+ margin=0pt,
+ width=fit,
+ edgedistance=12pt,
+ rightedge=96pt]
+
+\setupinteractionscreen
+ [option=max]
+
+%D \macros
+%D {setupbackgrounds}
+%D
+%D We set the pagecolor to yellow except the part of the screen that is used to
+%D display the running text. By seting the offset to 3pt the text will not touch the
+%D yellow parts. We do not set the depth.
+
+\setupbackgrounds
+ [page]
+ [background=color,
+ backgroundcolor=BackgroundColor]
+
+\setupbackgrounds
+ [text][text]
+ [background=color,
+ backgroundcolor=white,
+ backgroundoffset=3pt]
+
+%D I considered the next setup too, but finaly decided to
+%D comment it out.
+%D
+%D \starttyping
+%D \setupbackgrounds
+%D [bottom][text]
+%D [frame=on,
+%D framecolor=white]
+%D \stoptyping
+
+%D \macros
+%D {setupinteraction}
+%D
+%D We did not enable interactive text support yet, so let's do that now. We force
+%D page reference to circumvent problems with named destinations in buggy viewers.
+
+\setupinteraction
+ [page=yes,
+ color=InteractionColor,
+ contrastcolor=ContrastColor,
+ menu=on,
+ state=start]
+
+%D \macros
+%D {setupinteractionmenu,startinteractionmenu}
+%D
+%D At the bottom of the screen we show two navigational bars. At the left we show
+%D the subpage bar, at the right we use a non default backward|/|forward bar.
+
+\setupinteractionmenu
+ [bottom]
+ [leftoffset=3pt,
+ rightoffset=3pt]
+
+\startinteractionmenu[bottom]
+ \startcom \InteractionBar \stopcom
+ \hfill
+ \startcom \InteractionButtons \stopcom
+\stopinteractionmenu
+
+%D \macros
+%D {interactionbar}
+%D
+%D The left bar gets a white border (on the yellow background). Because we don't
+%D want to typeset an empty frame when no subpage bar is shown, we check for the
+%D number of subpages.
+
+\unexpanded\def\InteractionBar
+ {\ifnum\nofsubpages>\plusone
+ \framed
+ [framecolor=white,
+ rulethickness=1pt,
+ height=\bottomheight,
+ strut=no]
+ {\interactionbar[alternative=f,width=.5\makeupwidth,height=1ex]}
+ \fi}
+
+%D \macros
+%D {setupinteractionbar, interactionbuttons}
+%D
+%D The right hand buttons enable us to jump backward and forward, as well as to the
+%D previous and next jump. We also enable to close the presentation.
+
+\setupinteractionbar
+ [framecolor=white,
+ rulethickness=1pt,
+ height=\bottomheight,
+ strut=no]
+
+\unexpanded\def\InteractionButtons
+ {\interactionbuttons
+ [width=15em,
+ framecolor=white,
+ rulethickness=1pt,
+ height=\bottomheight,
+ strut=no,
+ distance=.5em]
+ [PreviousJump,NextJump,
+ firstpage,
+ firstsubpage,previouspage,nextpage,lastsubpage,
+ lastpage,
+ CloseDocument]}
+
+%D \macros
+%D {StartTitlePage, TitlePage}
+%D
+%D The titlepage is rather simple and can be typeset in two ways:
+%D
+%D \starttyping
+%D \StartTitlePage
+%D text \\ text \\ text
+%D \StopTitlepage
+%D \stoptyping
+%D
+%D or more straightforward:
+%D
+%D \starttyping
+%D \TitlePage{text\\text\\text}
+%D \stoptyping
+%D
+%D The first alternative can be used for more complicated title pages.
+
+\unexpanded\def\StartTitlePage
+ {\startstandardmakeup
+ \bfd
+ \setupinterlinespace
+ \setupalign[middle]
+ \vfil
+ \let\\=\vfil}
+
+\unexpanded\def\StopTitlePage
+ {\vfil\vfil\vfil
+ \stopstandardmakeup}
+
+\unexpanded\def\TitlePage#1%
+ {\StartTitlePage#1\StopTitlePage}
+
+%D \macros
+%D {TitlePage, Topics, Topic, Subject}
+%D
+%D A presentation after loading this module looks like:
+%D
+%D \starttyping
+%D \TitlePage {About Whatever\\Topics}
+%D
+%D \Topics {Todays Talk}
+%D
+%D \Topic {Some topic}
+%D
+%D \Subject {Alfa}
+%D
+%D .....
+%D
+%D \Subject {Beta}
+%D
+%D .....
+%D \stoptyping
+
+%D \macros
+%D {definehead}
+%D
+%D The commands \type{\Topic} and \type{\Subject} are defined as copies of head. We
+%D use \type{\Nopic} for internal purposes.
+
+\definehead [Topic] [chapter]
+\definehead [Subject] [section]
+
+\definehead [Nopic] [title]
+
+%D \macros
+%D {setuphead}
+%D
+%D Because chapters and sections do not make sense in presentations, we use our own
+%D command for typesetting the titles. Sectionnumbers are of course hidden from
+%D viewing. Each topic is followed by a list of subjects that belong to the topic.
+
+\setuphead
+ [Topic,Nopic,Subject]
+ [command=\HeadLine,
+ page=yes,
+ style=\bfb,
+ after=\blank,
+ sectionnumber=no]
+
+\setuphead
+ [Topic]
+ [after=\PlaceSubjectList]
+
+\setuphead
+ [Subject]
+ [continue=no]
+
+%D \macros
+%D {framed, midalined}
+%D
+%D The command used to typeset the head lines is rather simple. We just center the
+%D framed title. The frame macro optimizes the alignment and at the same time
+%D enables us to typeset a nice colored rule.
+
+\unexpanded\def\HeadLine#1#2%
+ {\midaligned
+ {\framed
+ [framecolor=BackgroundColor,
+ rulethickness=1pt,
+ width=.8\hsize,
+ align=middle,
+ strut=no]
+ {#2}}}
+
+%D \macros
+%D {setuplist}
+%D
+%D The subject list is automatically placed. We center each subject line by using
+%D one of the default alternatives (g). We could have said:
+%D
+%D \starttyping
+%D \setuplist
+%D [Subject]
+%D [alternative=none,
+%D command=\SubjectListLine,
+%D interaction=all]
+%D
+%D \def\SubjectListLine#1#2#3%
+%D {\midaligned{#2}}
+%D \stoptyping
+%D
+%D But why should we complicate things when we can use alternative~\type{g}. The
+%D test is only needed if one does not automatically goes a new page with each
+%D subject.
+
+\unexpanded\def\PlaceSubjectList
+ {\blank
+ \determinelistcharacteristics[Subject]
+ \doifmode{*list}{\placelist[Subject]}}
+
+\setuplist
+ [Subject,Topic]
+ [alternative=g,
+ interaction=all,
+ before=,
+ after=]
+
+% %D \macros
+% %D {setuptexttexts}
+% %D
+% %D The topics will be listed in the right edge, using:
+%
+% \setuptexttexts
+% [edge]
+% [][\TopicList]
+
+%D \macros
+%D {setuplist, placelist,startinteractionmenu}
+%D
+%D The actual topic list is typeset using a \type{\vbox}. We have to specify
+%D \type{criteriumcriterium=all} because otherwise no list will be typeset. (By
+%D default lists are typeset locally.)
+
+\startinteractionmenu[right]
+ \placelist
+ [Topic]
+ [alternative=f, % command, % none,
+ maxwidth=\hsize,
+ width=\hsize,
+ offset=0pt,
+ criterium=all,
+ align=left,
+ style=\smallbodyfont\bfx]
+\stopinteractionmenu
+
+\unexpanded\def\Topics#1% temporary hack
+ {\Nopic{#1}
+ \placelist[Topic][criterium=all]}
+
+\unexpanded\def\Subjects
+ {}
+
+%D \macros
+%D {setupbackgrounds, overlaybutton}
+%D
+%D During a presentation, we want to use the cursor to point to parts of the text.
+%D Furthermore we want to be able to jump to the next page, without the need to move
+%D the cursor on buttons. Therefore we make the text part of the screen into an
+%D invisible button.
+%D
+%D In \MKII\ we put a button in he texttextsm here we just use an extra background.
+
+\defineoverlay[nextpage][\overlaybutton{nextpage}]
+
+\setupbackgrounds
+ [text][text]
+ [background={color,nextpage}]
+
+%D \macros
+%D {setupsubpagenumber}
+%D
+%D The left bottom navigation bar shows the subpages, which will be counted by text.
+%D One can change this in the preentation itself by saying \type {[way=byTopic]}.
+
+\setupsubpagenumber
+ [way=bytext, % byTopic,
+ state=start]
+
+\stopmodule
+
+\continueifinputfile{s-present-original.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-original-001.tex}
diff --git a/tex/context/modules/mkiv/s-present-punk.mkiv b/tex/context/modules/mkiv/s-present-punk.mkiv
index a43639690..346f7eae8 100644
--- a/tex/context/modules/mkiv/s-present-punk.mkiv
+++ b/tex/context/modules/mkiv/s-present-punk.mkiv
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\startmodule[present-punk]
+
%D At the cost of more runtime and a larger output file, we
%D turn on randomization. The instances are cached in the
%D MkIV cache, so successive runs use the same shapes.
@@ -147,27 +149,10 @@
[chapter]
[after={\blank[big]}]
-\continueifinputfile{s-present-punk.mkiv}
-
-\usemodule[pre-stepwise]
-
-\starttext
+\stopmodule
-\title {Punk for dummies}
-
-\dorecurse{10} {
-
- \title{Just a few dummy pages}
-
- \StartSteps
- \startitemize[packed]
- \startitem bla \FlushStep \stopitem
- \startitem bla bla \FlushStep \stopitem
- \startitem bla bla bla \FlushStep \stopitem
- \startitem bla bla bla bla \FlushStep \stopitem
- \stopitemize
- \StopSteps
+\continueifinputfile{s-present-punk.mkiv}
-}
+\usemodule[present-common]
-\stoptext
+\inputpresentationfile{examples/present-punk-001.tex}
diff --git a/tex/context/modules/mkiv/s-present-random.mkiv b/tex/context/modules/mkiv/s-present-random.mkiv
index f63dc7851..5744241fc 100644
--- a/tex/context/modules/mkiv/s-present-random.mkiv
+++ b/tex/context/modules/mkiv/s-present-random.mkiv
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\startmodule[present-random]
+
%D Unfortunately there are not that many viewers that support javascript
%D control over layers.
@@ -203,41 +205,11 @@
\let\StartText\starttext % for old times sake
\let\StopText \stoptext % for old times sake
+\stopmodule
+
\continueifinputfile{s-present-random.mkiv}
-% \enablemode[paper]
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-random-001.tex}
-% \usemodule[present-stepwise]
-\usemodule[abr-02]
-
-\doifelsemode {atpragma} {
- \usetypescriptfile[type-hgz]
- \usetypescript[palatino-informal]
- \setupbodyfont[palatino-informal,15pt]
-} {
- \setupbodyfont[modern-variable,15pt]
-}
-
-\logo [METAPOST] {MetaPost}
-
-\starttext
-
-\StartTopics
- \StartTopic[1] A \StopTopic
- \StartTopic[5] B \StopTopic
- \StartTopic[9] C \StopTopic
-\StopTopics
-
-\StartTopics
- \StartTopic A \StopTopic
- \StartTopic B \StopTopic
- \StartTopic C \StopTopic
- \StartTopic D \StopTopic
- \StartTopic E \StopTopic
- \StartTopic F \StopTopic
- \StartTopic G \StopTopic
- \StartTopic H \StopTopic
- \StartTopic I \StopTopic
-\StopTopics
-
-\stoptext
diff --git a/tex/context/modules/mkiv/s-present-shaded.mkiv b/tex/context/modules/mkiv/s-present-shaded.mkiv
index debcca0f1..df6ab9c5c 100644
--- a/tex/context/modules/mkiv/s-present-shaded.mkiv
+++ b/tex/context/modules/mkiv/s-present-shaded.mkiv
@@ -156,12 +156,6 @@
\continueifinputfile{s-present-shaded.mkiv}
-\startdocument
- \dorecurse {10} {
- \startchapter[title={Whatever}][color=shade:#1]
- \section{test}
- test #1
- \namedstructureuservariable{chapter}{color}
- \stopchapter
- }
-\stopdocument
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-shaded-001.tex}
diff --git a/tex/context/modules/mkiv/s-present-stack.mkiv b/tex/context/modules/mkiv/s-present-stack.mkiv
new file mode 100644
index 000000000..4cc75404f
--- /dev/null
+++ b/tex/context/modules/mkiv/s-present-stack.mkiv
@@ -0,0 +1,194 @@
+%D \module
+%D [ file=s-present-stack, % was s-pre-11
+%D version=1999.08.20,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Stack,
+%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.
+
+\startmodule[present-stack]
+
+%D This is ancient but shows a few tricks so we keep it around in \MKIV\
+%D anyway.
+
+\setuppapersize
+ [S6][S6]
+
+\setuplayout
+ [topspace=0cm,
+ backspace=0cm,
+ header=0pt,
+ footer=0pt,
+ width=middle,
+ height=middle]
+
+\doifelsemode {asintended} {
+ \setupbodyfont[ludicaot,14.4pt]
+} {
+ \setupbodyfont[pagella,14.4pt]
+}
+
+\setupinteraction
+ [click=no,
+ display=new,
+ state=start]
+
+\setupinteractionscreen
+ [option=max]
+
+\unexpanded\def\SomeShape
+ {\resetMPdrawing
+ \startMPdrawing
+ path p[], q[] ; pair a, b ;
+ StartPage ;
+ \stopMPdrawing
+ \dorecurse{\CurrentTopic}
+ {\startMPdrawing
+ initialize_box(\MPpos{topic-\realfolio-\recurselevel}) ;
+ p[\recurselevel] := tensecircle (wxy,hxy,.25cm) shifted cxy ;
+ fill p[\recurselevel] withcolor .9white ;
+ pickup pencircle scaled .25cm ;
+ if \recurselevel = \CurrentTopic :
+ draw p[\recurselevel] withcolor \MPcolor{ShowColor} ;
+ else :
+ draw p[\recurselevel] withcolor \MPcolor{DoneColor} ;
+ fi ;
+ \stopMPdrawing}%
+ \dorecurse{\CurrentMaxItem}
+ {\startMPdrawing
+ initialize_box(\MPpos{item-\realfolio-\recurselevel}) ;
+ linewidth := .25cm ;
+ q[\recurselevel] := tensecircle (wxy,hxy,linewidth) shifted cxy ;
+ fill q[\recurselevel] withcolor .9white ;
+ pickup pencircle scaled linewidth ;
+ if \recurselevel = \CurrentMaxItem :
+ draw q[\recurselevel] withcolor \MPcolor{ShowColor} ;
+ else :
+ draw q[\recurselevel] withcolor \MPcolor{DoneColor} ;
+ fi ;
+ \stopMPdrawing}%
+ \dostepwiserecurse{2}{\CurrentTopic}{1}
+ {\startMPdrawing
+ draw
+ rt point 3 of p[\recurselevel-1] --
+ lft point 7 of p[\recurselevel]
+ withcolor \MPcolor{ArrowColor} ;
+ \stopMPdrawing}%
+ \dostepwiserecurse{2}{\CurrentMaxItem}{1}
+ {\startMPdrawing
+ draw
+ bot point 9 of q[\recurselevel-1] --
+ top point 5 of q[\recurselevel]
+ withcolor \MPcolor{ArrowColor} ;
+ \stopMPdrawing}%
+ \startMPdrawing
+ draw Page
+ withpen pencircle scaled .5cm
+ withcolor \MPcolor{EdgeColor} ;
+ StopPage ;
+ \stopMPdrawing
+ \MPdrawingdonetrue
+ \getMPdrawing}
+
+\unexpanded\def\TitlePage#1%
+ {\startstandardmakeup
+ \setupalign[middle]
+ \def\\{\vfil\bfb\setupinterlinespace}
+ \bfd\setupinterlinespace
+ \vfil#1\vfil\vfil
+ \stopstandardmakeup}
+
+\definecolor[PageColor][r=.5,g=.4,b=.3]
+\definecolor[LineColor][r=.7,g=.6,b=.5]
+
+\definecolor[PageColor] [s=.60]
+\definecolor[ShowColor] [r=.40]
+\definecolor[EdgeColor] [g=.40]
+\definecolor[DoneColor] [r=.40,g=.40]
+\definecolor[ArrowColor] [b=.40]
+\definecolor[LineColor] [r=.60,g=.60]
+\definecolor[GotoColor] [ArrowColor]
+
+\setupinteraction
+ [color=GotoColor,
+ contrastcolor=GotoColor]
+
+\defineoverlay [shape] [\SomeShape]
+\defineoverlay [next] [\overlaybutton{forward}] % [{nextpage}]
+
+\setupbackgrounds
+ [page]
+ [background={color,next,shape},
+ backgroundcolor=PageColor]
+
+\doglobal\newcounter\CurrentMaxItem
+\doglobal\newcounter\CurrentItem
+\doglobal\newcounter\CurrentTopic
+
+\unexpanded\def\StartIdea
+ {\doglobal\newcounter\CurrentItem}
+
+\unexpanded\def\StartTopic
+ {\doglobal\increment\CurrentTopic
+ \dostartbuffer[topic-\CurrentTopic][StartTopic][StopTopic]}
+
+\unexpanded\def\StopIdea
+ {\dorecurse{\CurrentItem}
+ {\let\CurrentMaxItem\recurselevel
+ \doStopIdea}}
+
+\unexpanded\def\doStopIdea
+ {\startstandardmakeup
+ \dontcomplain
+ \vskip.875cm
+ \hbox to \makeupwidth
+ {\hfill
+ \dorecurse{\CurrentTopic}
+ {\edef\Topic{topic-\realfolio-\recurselevel}%
+ \hpos
+ {\Topic}
+ {\framed
+ [frame=off,align=middle,offset=.25cm]
+ {\getbuffer[topic-\recurselevel]}}%
+ \ifnum\recurselevel<\CurrentTopic
+ \hskip.875cm
+ \fi}%
+ \hfill}
+ \vskip.875cm
+ \vfilll
+ \dorecurse{\CurrentMaxItem}
+ {\edef\Item{item-\realfolio-\recurselevel}
+ \hbox to \makeupwidth
+ {\hfill
+ \hpos
+ {\Item}
+ {\framed
+ [width=.75\makeupwidth,
+ frame=off,
+ align=middle,offset=.125cm]
+ {\getbuffer[item-\recurselevel]}}%
+ \hfill}
+ \vskip.875cm}
+ \vfilll
+ \stopstandardmakeup}
+
+\unexpanded\def\StartItem
+ {\doglobal\increment\CurrentItem
+ \dostartbuffer[item-\CurrentItem][StartItem][StopItem]}
+
+\setupalign
+ [nothyphenated]
+
+\stopmodule
+
+\continueifinputfile{s-present-stack.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-stack-001.tex}
+
diff --git a/tex/context/modules/mkiv/s-present-stepper.mkiv b/tex/context/modules/mkiv/s-present-stepper.mkiv
index c697a36e3..3dd8d9dcd 100644
--- a/tex/context/modules/mkiv/s-present-stepper.mkiv
+++ b/tex/context/modules/mkiv/s-present-stepper.mkiv
@@ -1,8 +1,8 @@
%D \module
-%D [ file=s-pre-61,
+%D [ file=s-present-stepper, % was s-pre-61
%D version=2004.03.15,
%D title=\CONTEXT\ Style File,
-%D subtitle=Presentation Environment 61,
+%D subtitle=Presentation Environment Stepper,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
@@ -13,9 +13,11 @@
%D Optima
+\startmodule[present-stepper]
+
\usemodule[pre-60]
-\doifmodeelse {mkiv} {
+\doifmodeelse {atpragma,asintended} {
\usetypescriptfile[ghz]
\definetypeface[mainface][ss][sans][optima-nova][default]
} {
@@ -24,7 +26,9 @@
}
\setupbodyfont[mainface,ss,18pt]
-\setupinterlinespace[line=3.25ex]
+
+\setupinterlinespace
+ [line=3.25ex]
\setuppapersize
[S6][S6]
@@ -98,8 +102,7 @@
\definecolor [interactioncolor] [r=.8,g=.8,b=.6]
\setupcolors
- [state=start,
- textcolor=maincolor]
+ [textcolor=maincolor]
\setupbackgrounds
[page]
@@ -122,47 +125,38 @@
\defineoverlay[page][\uniqueMPgraphic{page-\ifcase\realpageno\or one\else plus\fi}]
\startuniqueMPgraphic{page-one}
- StartPage ;
- fill Page
- enlarged 4pt
- withcolor \MPcolor{pagecolor} ;
- fill Field[Text][Text]
- enlarged 10pt
- % topenlarged (HeaderHeight+HeaderDistance)
- leftenlarged (BackSpace+4pt)
- rightenlarged (CutSpace +4pt)
- withcolor OverlayColor ;
- StopPage ;
+ StartPage ;
+ fill Page
+ enlarged 4pt
+ withcolor \MPcolor{pagecolor} ;
+ fill Field[Text][Text]
+ enlarged 10pt
+ % topenlarged (HeaderHeight+HeaderDistance)
+ leftenlarged (BackSpace+4pt)
+ rightenlarged (CutSpace +4pt)
+ withcolor OverlayColor ;
+ StopPage ;
\stopuniqueMPgraphic
\startuniqueMPgraphic{page-plus}
- StartPage ;
- fill Page
- enlarged 4pt
- withcolor \MPcolor{pagecolor} ;
- fill Field[Text][Text]
- enlarged 10pt
- leftenlarged (BackSpace+4pt)
- rightenlarged (CutSpace+4pt)
- withcolor OverlayColor ;
- StopPage ;
+ StartPage ;
+ fill Page
+ enlarged 4pt
+ withcolor \MPcolor{pagecolor} ;
+ fill Field[Text][Text]
+ enlarged 10pt
+ leftenlarged (BackSpace+4pt)
+ rightenlarged (CutSpace+4pt)
+ withcolor OverlayColor ;
+ StopPage ;
\stopuniqueMPgraphic
-% this needs to be sorted out !
-
-\appendtoks
- \NormalizeFontHeight \HeadFont {\setstrut\strut\quad} {1.0\headerheight} {SansBold}
- \NormalizeFontHeight \TitleFont {\setstrut\strut\quad} {2.0\headerheight} {SansBold}
- \NormalizeFontHeight \SubTitleFont {\setstrut\strut\quad} {1.5\headerheight} {SansBold}
- \NormalizeFontHeight \SubSubTitleFont {\setstrut\strut\quad} {1.0\headerheight} {SansBold}
-\to \everystarttext
-
-\appendtoks
- \NormalizeFontHeight \HeadFont {\setstrut\strut\quad} {1.0\headerheight} {SansBold}
- \NormalizeFontHeight \TitleFont {\setstrut\strut\quad} {2.0\headerheight} {SansBold}
- \NormalizeFontHeight \SubTitleFont {\setstrut\strut\quad} {1.5\headerheight} {SansBold}
- \NormalizeFontHeight \SubSubTitleFont {\setstrut\strut\quad} {1.0\headerheight} {SansBold}
-\to \everystoptext
+\startsetups fonts:normalize
+ \definefont[HeadFont] [SansBold*default ht \the\dimexpr0.750\headerheight\relax]
+ \definefont[TitleFont] [SansBold*default ht \the\dimexpr1.500\headerheight\relax]
+ \definefont[SubTitleFont] [SansBold*default ht \the\dimexpr0.375\headerheight\relax]
+ \definefont[SubSubTitleFont] [SansBold*default ht \the\dimexpr0.750\headerheight\relax]
+\stopsetups
\setuphead
[chapter]
@@ -192,7 +186,9 @@
[broad,right]
\def\doTitlePage#1#2#3%
- {\startstandardmakeup[headerstate=high]
+ {\setups[fonts:normalize]
+ \resetsetups[fonts:normalize]
+ \startstandardmakeup[headerstate=high]
\def\\{\def\\{\endgraf\quad\quad}\endgraf\quad\ignorespaces#2}%
#1\setstrut\setupinterlinespace\vfil#3\vfil\vfil
\stopstandardmakeup}
@@ -222,54 +218,10 @@
[bottom] [text]
[background=topics]
-\continueifinputfile{s-present-stepper.tex}
-
-\starttext
-
-\TitlePage{Stepwise\\Refinement}
-
-\Topics{Topics}
-
-\Topic{Female Artists}
-
-\StartSteps
-
-\startitemize
-\item Fiona Apple \FlushStep
-\item Tori Amos \FlushStep
-\item Kate Bush \FlushStep
-\item Heather Nova \FlushStep
-\item Alanis Morissette \FlushStep
-\item Suzanne Vega \FlushStep
-\stopitemize
-
-\StopSteps
-
-\Topic{Male Composers}
-
-\StartSteps
-
-\startitemize
-\item John Adams \FlushStep
-\item Steve Reich \FlushStep
-\item Louis Andriessen \FlushStep
-\item Olivier Messiaen \FlushStep
-\stopitemize
-
-\StopSteps
-
-\Topic{And Some More}
-
-\StartSteps
+\stopmodule
-\startitemize
-\item Mark Hollis \FlushStep
-\item Roger Waters \FlushStep
-\item David Gilmore \FlushStep
-\item Peter Gabriel \FlushStep
-\item Randy Newman \FlushStep
-\stopitemize
+\continueifinputfile{s-present-stepper.mkiv}
-\StopSteps
+\usemodule[present-common]
-\stoptext
+\inputpresentationfile{examples/present-stepper-001.tex}
diff --git a/tex/context/modules/mkiv/s-present-stepwise.mkiv b/tex/context/modules/mkiv/s-present-stepwise.mkiv
index 70f8978b0..bc781c499 100644
--- a/tex/context/modules/mkiv/s-present-stepwise.mkiv
+++ b/tex/context/modules/mkiv/s-present-stepwise.mkiv
@@ -1,8 +1,8 @@
%D \module
-%D [ file=s-pre-60,
+%D [ file=s-present-stepwise, % was s-pre-60
%D version=2004.03.15,
%D title=\CONTEXT\ Style File,
-%D subtitle=Presentation Environment 60,
+%D subtitle=Presentation Environment Stepwise,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
@@ -13,6 +13,8 @@
% use lua instead of global mess
+\startmodule[present-stepwise]
+
\unprotect
\startmode[paper,print]
@@ -209,4 +211,6 @@
%D \StopLocalSteps
%D \stoptyping
-\protect \endinput
+\protect
+
+\stopmodule
diff --git a/tex/context/modules/mkiv/s-present-windows.mkiv b/tex/context/modules/mkiv/s-present-windows.mkiv
new file mode 100644
index 000000000..22d6fdba1
--- /dev/null
+++ b/tex/context/modules/mkiv/s-present-windows.mkiv
@@ -0,0 +1,350 @@
+%D \module
+%D [ file=s-resent-windows, % was s-pre-09
+%D version=unknown,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Windows,
+%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.
+
+\startmodule[present-windows]
+
+%D I made this style when I had to give a presentation on the \MAPS\ bibliography
+%D production for several user group meetings. This style is rather tuned for
+%D combinations of examples and explanations. The colors match the \MAPS\
+%D bibliography colors.
+
+\doifelsemode {asintended} {
+ \setupbodyfont[ludicaot,14.4pt]
+} {
+ \setupbodyfont[pagella,14.4pt]
+}
+
+%D A couple of years later, in 2001 this style was documented and made public. While
+%D documenting, I also changed box building on top of overlays into the now
+%D available layer positioning. So, this styles demonstrates quite some tricks.
+%D
+%D I'm sure that nowadays it can be done with less code but therei sno real need to
+%D rewrite history.
+
+\setuppapersize
+ [S6][S6]
+
+\setuplayout
+ [topspace=0cm,
+ backspace=0cm,
+ header=0pt,
+ footer=0pt,
+ width=middle,
+ height=middle]
+
+%D Local environments can be set by using the setups commands. For downward
+%D compatibility, we keep supporting the \type {\...Settings} hooks. Using local
+%D environments is seldom needed.
+
+\let\TextSettings \empty
+\let\SampleSettings\empty
+
+\startsetups [text] \TextSettings \stopsetups
+\startsetups [sample] \SampleSettings \stopsetups
+
+%D The dimensions are kind of fixed.
+
+\def\FrameWidth {448pt}
+\def\FrameHeight {348pt}
+\def\FrameOffset {24pt}
+\def\FrameSkip {12pt}
+
+%D But they {\em can} and {\em will} be changed.
+
+\def\FrameWidth {408pt}
+\def\FrameHeight {318pt}
+
+%D The funny values come from the $3:4$ display aspect ratio.
+
+\definecolor[PageColor] [s=.40]
+\definecolor[TextColor] [s=.90]
+\definecolor[InteractionColor][r=.40]
+\definecolor[LineColor] [r=.60,g=.60]
+
+%D Of course we go interactive and since we will probably open other documents, we
+%D make sure that the viewer opens a new window.
+
+\setupinteraction
+ [color=InteractionColor,
+ contrastcolor=LineColor,
+ display=new,
+ state=start]
+
+\setupinteractionscreen
+ [option=max]
+
+%D Before we come to the real macros, we do a little bit of tuning.
+
+\setupitemize
+ [1][packed]
+
+\setuptyping
+ [blank=medium]
+
+%D Apart from the titlepage, the page gets a simple colored background. Later we
+%D will activate the background.
+
+\setupbackgrounds
+ [page]
+ [backgroundcolor=PageColor]
+
+%D Everything gets frames by a nice \METAPOST\ frame.
+
+\defineoverlay [background] [\uniqueMPgraphic{background}]
+
+\startuniqueMPgraphic{background}
+ pickup pencircle scaled (1.5*\FrameSkip) ;
+ draw OverlayBox withcolor "PageColor" ;
+ pickup pencircle scaled \FrameSkip ;
+ fill OverlayBox withcolor "TextColor" ;
+ draw OverlayBox withcolor "LineColor" ;
+\stopuniqueMPgraphic
+
+%D We will present samples and explanation pair||wise, so we need a hyperlink that
+%D skips a page. Contrary to \MKII\ we put the next button in the page background and
+%D the two windows get buttons that toggle between them. This is easier.
+
+\defineoverlay [nextpage] [\overlaybutton{nextpage}]
+\defineoverlay [previouspage] [\overlaybutton{previouspage}]
+\defineoverlay [skippage] [\overlaybutton{realpage(\number\numexpr\realpageno+2\relax)}]
+\defineoverlay [samepage] [\overlaybutton{realpage(\number\numexpr\realpageno \relax)}]
+
+%D Layers are normally used to position multiple content on a specific overlay. Here
+%D we will use them to position only and since the samples and text will swap place,
+%D we will use quite a few layers.
+
+\defineoverlay [text] [\composedlayer{text}]
+\defineoverlay [sample] [\composedlayer{sample}]
+\defineoverlay [common] [\composedlayer{common}]
+
+%D There are three positions. When combined, the sample and text windows overlap,
+%D otherwise the lone window is centered. We could have used one layer and reversed
+%D the order by setting the \type {direction} parameter, but this approach is more
+%D readable.
+
+\definelayer
+ [text]
+ [x=\makeupwidth,
+ y=\makeupheight,
+ location=lt,
+ hoffset=-\FrameSkip,
+ voffset=-\FrameSkip]
+
+\definelayer
+ [sample]
+ [hoffset=\FrameSkip,
+ voffset=\FrameSkip]
+
+\definelayer
+ [common]
+ [x=.5\makeupwidth,
+ y=.5\makeupheight,
+ location=c]
+
+%D The topic is put in the lower right corner of the text window.
+
+\defineoverlay [topic] [\composedlayer{topic}]
+
+\definelayer
+ [topic]
+ [x=\FrameWidth,
+ y=\FrameHeight,
+ location=lt,
+ hoffset=-\FrameOffset,
+ voffset=-\FrameSkip]
+
+%D The topic is put in a framed box. That way we can make sure that it gets a
+%D background, which looks better when it covers something else. Otherwise we could
+%D have stuck to:
+%D
+%D \starttyping
+%D \def\Topic#1%
+%D {\setlayer[topic]{\color[PageColor]{\bfb\setstrut#1}}}
+%D \stoptyping
+%D
+%D But, we go for the nice alternative:
+
+\unexpanded\def\Topic#1%
+ {\doifsomething{#1}
+ {\setlayer [topic]
+ {\bfb\setstrut
+ \inframed
+ [frame=off,
+ foregroundcolor=PageColor,
+ offset=0pt,
+ background=color,
+ backgroundcolor=TextColor]
+ {#1}}}}
+
+%D The sample as well as the explanation will be collected in a buffer. That way we
+%D can reuse the content. We could have used a box instead, but can we be sure that
+%D the content is not adapting itself? So, buffers we use.
+
+\resetbuffer[sample]
+\resetbuffer[text]
+
+%D Both the sample and explanation are kind of windowed.
+
+\defineframedtext
+ [SampleText]
+ [width=\FrameWidth,
+ height=\FrameHeight,
+ offset=\FrameOffset,
+ frame=off,
+ align=normal,
+ strut=no,
+ before=,
+ after=,
+ background=background]
+
+%D We safe some keying in by combining things in one macro.
+
+\unexpanded\def\DoSampleText#1#2#3% kind layer overlays
+ {\setupframedtexts[SampleText][background={background,#3}]
+ \setlayer[#2]
+ {\startSampleText[none]
+ \setups[#1]
+ \getbuffer[#1]
+ \stopSampleText}}
+
+\unexpanded\def\StartSample{\dostartbuffer[sample][StartSample][StopSample]}
+\unexpanded\def\StartText {\dostartbuffer[text] [StartText] [StopText]}
+
+%D The following definitions apply at the outer level.
+
+\unexpanded\def\StopSample
+ {\startstandardmakeup
+ \DoSampleText{sample}{common}{samepage}
+ \stopstandardmakeup
+ \resetbuffer[sample]}
+
+\unexpanded\def\StopText
+ {\startstandardmakeup
+ \DoSampleText{text}{common}{topic,samepage}
+ \stopstandardmakeup
+ \resetbuffer[text]}
+
+\setupbackgrounds[page][background={color,nextpage}]
+\setupbackgrounds[text][background=common]
+
+%D When we combine sample and text, we get slightly different definitions. As you
+%D can see we generate two pages. Watch how we manipulate the order of the overlays
+%D and teh nature of the buttons. Here some abstraction really pays off.
+
+\unexpanded\def\StartIdea
+ {\bgroup
+ \let\StopSample\relax
+ \let\StopText \relax}
+
+\unexpanded\def\StopIdea
+ {\setupbackgrounds[page][background={color,skippage}]
+ \setupbackgrounds[text][background={text,sample}]
+ \startstandardmakeup
+ \DoSampleText{sample}{sample}{nextpage}
+ \DoSampleText{text} {text} {topic,nextpage}
+ \stopstandardmakeup
+ \setupbackgrounds[page][background={color,nextpage}]
+ \setupbackgrounds[text][background={sample,text}]
+ \startstandardmakeup
+ \DoSampleText{sample}{sample}{previouspage}
+ \DoSampleText{text} {text} {topic,previouspage}
+ \stopstandardmakeup
+ \egroup}
+
+%D The rest of the definitions takes care of the title page. Please don't steal this
+%D one for your own documents.
+
+\defineoverlay[joke] [\useMPgraphic{joke}{n=0}] % not to be changed!
+
+\startuseMPgraphic{joke}{n}
+ StartPage ;
+ path p, q ; numeric w ; pair xy ;
+ set_grid(OverlayWidth,OverlayHeight,OverlayWidth/8,OverlayHeight/8) ;
+ if \MPvar{n}=1 :
+ p := fulldiamond ; fill Page withcolor \MPcolor{TextColor} ;
+ else :
+ p := fullsquare ; fill Page withcolor \MPcolor{PageColor} ;
+ fi ;
+ forever :
+ xy := center Page randomized (OverlayWidth,OverlayHeight) ;
+ if new_on_grid(xpart xy, ypart xy) :
+ q := (p xyscaled (OverlayWidth/5,OverlayHeight/5))
+ randomized (\FrameSkip,\FrameSkip)
+ shifted xy ;
+ w := (\FrameSkip) randomized (\FrameSkip/2) ;
+ draw q withcolor \MPcolor{PageColor} withpen pencircle scaled (1.5w) ;
+ fill q withcolor \MPcolor{TextColor} ;
+ draw q withcolor \MPcolor{LineColor} withpen pencircle scaled ( w) ;
+ fi ;
+ exitif grid_full ;
+ endfor ;
+ StopPage ;
+\stopuseMPgraphic
+
+\defineoverlay[fuzzy][\useMPgraphic{fuzzy}]
+
+\startuseMPgraphic{fuzzy}
+ path p ; numeric w ;
+ p := (fullsquare xyscaled (OverlayWidth,OverlayHeight))
+ randomized (\FrameSkip,\FrameSkip) ;
+ w := (\FrameSkip) randomized (\FrameSkip/2) ;
+ draw p withcolor \MPcolor{PageColor} withpen pencircle scaled (1.5w) ;
+ fill p withcolor \MPcolor{TextColor} ;
+ draw p withcolor \MPcolor{LineColor} withpen pencircle scaled ( w) ;
+\stopuseMPgraphic
+
+%D This time we use a fit window, but with a slightly randomized frame, our
+%D trademark so to say.
+
+\unexpanded\def\StartTitlePage
+ {\bgroup
+ \setupbackgrounds[page][background={joke,nextpage}]
+ \startstandardmakeup
+ \switchtobodyfont[big]
+ \setupframedtexts
+ [SampleText]
+ [background=fuzzy,
+ foregroundcolor=PageColor,
+ width=fit,
+ height=fit,
+ align=middle]
+ \startSampleText[middle]
+ \bfd\setupinterlinespace
+ \def\\{\bfb\setupinterlinespace\vfil\def\\{\vfil}}}
+
+\unexpanded\def\StopTitlePage
+ {\stopSampleText
+ \stopstandardmakeup
+ \egroup}
+
+\unexpanded\def\TitlePage#1%
+ {\StartTitlePage#1\StopTitlePage}
+
+%D Let's nil some error prone presentation macros.
+
+\let\Subject \Topic
+\let\Topics \gobbleoneargument
+\let\Subjects \relax
+
+%D We will avoid \quote {overfull} messages.
+
+\dontcomplain
+
+\stopmodule
+
+\continueifinputfile{s-present-windows.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{examples/present-windows-001.tex}
+