summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/context/lua/mtx-context.lua45
-rw-r--r--scripts/context/lua/mtxrun.lua8
-rw-r--r--scripts/context/ruby/base/tex.rb54
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua8
-rw-r--r--scripts/context/stubs/unix/mtxrun8
-rw-r--r--tex/context/base/buff-imp-default.lua (renamed from tex/context/base/v-default.lua)0
-rw-r--r--tex/context/base/buff-imp-default.mkiv (renamed from tex/context/base/v-default.mkiv)0
-rw-r--r--tex/context/base/buff-imp-escaped.lua (renamed from tex/context/base/v-escaped.lua)0
-rw-r--r--tex/context/base/buff-imp-escaped.mkiv (renamed from tex/context/base/v-escaped.mkiv)0
-rw-r--r--tex/context/base/buff-imp-lua.lua (renamed from tex/context/base/v-lua.lua)0
-rw-r--r--tex/context/base/buff-imp-lua.mkiv (renamed from tex/context/base/v-lua.mkiv)0
-rw-r--r--tex/context/base/buff-imp-mp.lua (renamed from tex/context/base/v-mp.lua)0
-rw-r--r--tex/context/base/buff-imp-mp.mkiv (renamed from tex/context/base/v-mp.mkiv)0
-rw-r--r--tex/context/base/buff-imp-nested.lua (renamed from tex/context/base/v-nested.lua)0
-rw-r--r--tex/context/base/buff-imp-nested.mkiv (renamed from tex/context/base/v-nested.mkiv)0
-rw-r--r--tex/context/base/buff-imp-parsed-xml.lua (renamed from tex/context/base/v-parsed-xml.lua)0
-rw-r--r--tex/context/base/buff-imp-parsed-xml.mkiv (renamed from tex/context/base/v-parsed-xml.mkiv)0
-rw-r--r--tex/context/base/buff-imp-tex.lua (renamed from tex/context/base/v-tex.lua)0
-rw-r--r--tex/context/base/buff-imp-tex.mkiv (renamed from tex/context/base/v-tex.mkiv)0
-rw-r--r--tex/context/base/buff-imp-xml.lua (renamed from tex/context/base/v-xml.lua)0
-rw-r--r--tex/context/base/buff-imp-xml.mkiv (renamed from tex/context/base/v-xml.mkiv)0
-rw-r--r--tex/context/base/buff-ver.lua6
-rw-r--r--tex/context/base/colo-ema.mkii (renamed from tex/context/base/colo-ema.tex)0
-rw-r--r--tex/context/base/colo-hex.mkii125
-rw-r--r--tex/context/base/colo-imp-ema.mkiv590
-rw-r--r--tex/context/base/colo-imp-rgb.mkiv (renamed from tex/context/base/colo-rgb.tex)0
-rw-r--r--tex/context/base/colo-imp-run.mkiv (renamed from tex/context/base/colo-run.tex)0
-rw-r--r--tex/context/base/colo-imp-x11.mkiv (renamed from tex/context/base/colo-x11.tex)0
-rw-r--r--tex/context/base/colo-imp-xwi.mkiv (renamed from tex/context/base/colo-xwi.tex)0
-rw-r--r--tex/context/base/colo-ini.lua16
-rw-r--r--tex/context/base/colo-ini.mkii6
-rw-r--r--tex/context/base/colo-ini.mkiv27
-rw-r--r--tex/context/base/colo-rgb.mkii530
-rw-r--r--tex/context/base/colo-run.mkii257
-rw-r--r--tex/context/base/colo-x11.mkii677
-rw-r--r--tex/context/base/colo-xwi.mkii142
-rw-r--r--tex/context/base/cont-cs.mkii (renamed from tex/context/base/cont-cs.tex)15
-rw-r--r--tex/context/base/cont-cs.mkiv22
-rw-r--r--tex/context/base/cont-de.mkii (renamed from tex/context/base/cont-de.tex)20
-rw-r--r--tex/context/base/cont-de.mkiv22
-rw-r--r--tex/context/base/cont-en.mkii28
-rw-r--r--tex/context/base/cont-en.mkiv22
-rw-r--r--tex/context/base/cont-en.tex44
-rw-r--r--tex/context/base/cont-fr.mkii28
-rw-r--r--tex/context/base/cont-fr.mkiv22
-rw-r--r--tex/context/base/cont-fr.tex40
-rw-r--r--tex/context/base/cont-gb.mkii28
-rw-r--r--tex/context/base/cont-gb.mkiv22
-rw-r--r--tex/context/base/cont-gb.tex40
-rw-r--r--tex/context/base/cont-it.mkii28
-rw-r--r--tex/context/base/cont-it.mkiv22
-rw-r--r--tex/context/base/cont-it.tex39
-rw-r--r--tex/context/base/cont-log.mkii (renamed from tex/context/base/cont-log.tex)0
-rw-r--r--tex/context/base/cont-log.mkiv249
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/cont-nl.mkii28
-rw-r--r--tex/context/base/cont-nl.mkiv22
-rw-r--r--tex/context/base/cont-nl.tex40
-rw-r--r--tex/context/base/cont-pe.mkiv22
-rw-r--r--tex/context/base/cont-pe.tex43
-rw-r--r--tex/context/base/cont-ro.mkii (renamed from tex/context/base/cont-ro.tex)20
-rw-r--r--tex/context/base/cont-ro.mkiv22
-rw-r--r--tex/context/base/context.mkii44
-rw-r--r--tex/context/base/context.mkiv53
-rw-r--r--tex/context/base/context.tex225
-rw-r--r--tex/context/base/core-fil.mkii2
-rw-r--r--tex/context/base/core-fil.mkiv2
-rw-r--r--tex/context/base/enco-ini.mkii10
-rw-r--r--tex/context/base/font-ini.mkii22
-rw-r--r--tex/context/base/font-ini.mkiv22
-rw-r--r--tex/context/base/java-ans.mkii (renamed from tex/context/base/java-ans.tex)0
-rw-r--r--tex/context/base/java-exa.mkii (renamed from tex/context/base/java-exa.tex)0
-rw-r--r--tex/context/base/java-fil.mkii (renamed from tex/context/base/java-fil.tex)0
-rw-r--r--tex/context/base/java-fld.mkii (renamed from tex/context/base/java-fld.tex)0
-rw-r--r--tex/context/base/java-imp-ans.mkiv28
-rw-r--r--tex/context/base/java-imp-exa.mkiv395
-rw-r--r--tex/context/base/java-imp-fil.mkiv48
-rw-r--r--tex/context/base/java-imp-fld.mkiv475
-rw-r--r--tex/context/base/java-imp-stp.mkiv (renamed from tex/context/base/java-stp.tex)0
-rw-r--r--tex/context/base/java-ini.lua138
-rw-r--r--tex/context/base/java-ini.mkii32
-rw-r--r--tex/context/base/java-ini.mkiv162
-rw-r--r--tex/context/base/java-stp.mkii121
-rw-r--r--tex/context/base/lang-alt.mkiv63
-rw-r--r--tex/context/base/lang-ana.mkiv24
-rw-r--r--tex/context/base/lang-ara.mkiv63
-rw-r--r--tex/context/base/lang-art.mkiv26
-rw-r--r--tex/context/base/lang-bal.mkiv44
-rw-r--r--tex/context/base/lang-cel.mkiv26
-rw-r--r--tex/context/base/lang-cjk.mkiv48
-rw-r--r--tex/context/base/lang-cyr.mkiv60
-rw-r--r--tex/context/base/lang-def.mkiv715
-rw-r--r--tex/context/base/lang-ger.mkiv259
-rw-r--r--tex/context/base/lang-grk.mkiv48
-rw-r--r--tex/context/base/lang-ind.mkiv26
-rw-r--r--tex/context/base/lang-ini.mkii2
-rw-r--r--tex/context/base/lang-ita.mkiv157
-rw-r--r--tex/context/base/lang-sla.mkiv179
-rw-r--r--tex/context/base/lang-txt.lua3
-rw-r--r--tex/context/base/lang-ura.mkiv63
-rw-r--r--tex/context/base/lang-vn.mkiv43
-rw-r--r--tex/context/base/lpdf-wid.lua2
-rw-r--r--tex/context/base/luat-fmt.lua8
-rw-r--r--tex/context/base/math-ini.mkii4
-rw-r--r--tex/context/base/meta-clp.mkii (renamed from tex/context/base/meta-clp.tex)0
-rw-r--r--tex/context/base/meta-dum.mkii (renamed from tex/context/base/meta-dum.tex)0
-rw-r--r--tex/context/base/meta-fig.mkiv1
-rw-r--r--tex/context/base/meta-imp-clp.mkiv164
-rw-r--r--tex/context/base/meta-imp-dum.mkiv123
-rw-r--r--tex/context/base/meta-imp-mis.mkiv (renamed from tex/context/base/meta-mis.tex)0
-rw-r--r--tex/context/base/meta-imp-nav.mkiv (renamed from tex/context/base/meta-nav.tex)0
-rw-r--r--tex/context/base/meta-imp-pre.mkiv (renamed from tex/context/base/meta-pre.tex)0
-rw-r--r--tex/context/base/meta-imp-txt.mkiv (renamed from tex/context/base/meta-txt.tex)0
-rw-r--r--tex/context/base/meta-ini.lua24
-rw-r--r--tex/context/base/meta-ini.mkii6
-rw-r--r--tex/context/base/meta-ini.mkiv13
-rw-r--r--tex/context/base/meta-mis.mkii54
-rw-r--r--tex/context/base/meta-nav.mkii65
-rw-r--r--tex/context/base/meta-pre.mkii68
-rw-r--r--tex/context/base/meta-txt.mkii304
-rw-r--r--tex/context/base/metatex.tex12
-rw-r--r--tex/context/base/page-app.mkiv7
-rw-r--r--tex/context/base/page-lay.mkii10
-rw-r--r--tex/context/base/page-lay.mkiv10
-rw-r--r--tex/context/base/s-inf-01.mkiv78
-rw-r--r--tex/context/base/scrn-int.mkiv11
-rw-r--r--tex/context/base/supp-fil.lua33
-rw-r--r--tex/context/base/symb-ini.mkii2
-rw-r--r--tex/context/base/symb-ini.mkiv2
-rw-r--r--tex/context/base/syst-ini.mkii (renamed from tex/context/base/syst-ini.tex)0
-rw-r--r--tex/context/base/syst-ini.mkiv925
-rw-r--r--tex/context/base/type-ini.lua33
-rw-r--r--tex/context/base/type-ini.mkii2
-rw-r--r--tex/context/base/type-ini.mkiv19
-rw-r--r--tex/context/base/type-set.mkiv12
-rw-r--r--tex/context/base/unic-ini.mkii4
-rw-r--r--tex/context/base/x-fo.mkii2
-rw-r--r--tex/context/base/x-res-01.mkiv695
-rw-r--r--tex/context/base/x-res-50.mkiv4
-rw-r--r--tex/context/base/x-set-01.mkii (renamed from tex/context/base/x-set-01.tex)0
-rw-r--r--tex/context/base/x-set-02.mkii (renamed from tex/context/base/x-set-02.tex)0
-rw-r--r--tex/context/base/x-set-11.mkii266
-rw-r--r--tex/context/base/x-set-11.mkiv266
-rw-r--r--tex/context/base/x-set-12.mkii (renamed from tex/context/base/x-set-12.tex)0
-rw-r--r--tex/context/base/x-set-12.mkiv258
-rw-r--r--tex/context/base/x-set-99.tex283
-rw-r--r--tex/context/base/x-xtag.mkiv14
-rw-r--r--tex/context/base/xtag-cml.mkii (renamed from tex/context/base/xtag-cml.tex)0
-rw-r--r--tex/context/base/xtag-ent.mkii (renamed from tex/context/base/xtag-ent.tex)0
-rw-r--r--tex/context/base/xtag-exp.mkii (renamed from tex/context/base/xtag-exp.tex)0
-rw-r--r--tex/context/base/xtag-ext.mkii (renamed from tex/context/base/xtag-ext.tex)0
-rw-r--r--tex/context/base/xtag-hyp.mkii (renamed from tex/context/base/xtag-hyp.tex)0
-rw-r--r--tex/context/base/xtag-ini.mkii (renamed from tex/context/base/xtag-ini.tex)8
-rw-r--r--tex/context/base/xtag-map.mkii (renamed from tex/context/base/xtag-map.tex)0
-rw-r--r--tex/context/base/xtag-mea.mkii (renamed from tex/context/base/xtag-mea.tex)0
-rw-r--r--tex/context/base/xtag-meb.mkii (renamed from tex/context/base/xtag-meb.tex)0
-rw-r--r--tex/context/base/xtag-mec.mkii (renamed from tex/context/base/xtag-mec.tex)0
-rw-r--r--tex/context/base/xtag-meh.mkii (renamed from tex/context/base/xtag-meh.tex)0
-rw-r--r--tex/context/base/xtag-men.mkii (renamed from tex/context/base/xtag-men.tex)0
-rw-r--r--tex/context/base/xtag-meo.mkii (renamed from tex/context/base/xtag-meo.tex)0
-rw-r--r--tex/context/base/xtag-mer.mkii (renamed from tex/context/base/xtag-mer.tex)0
-rw-r--r--tex/context/base/xtag-mmc.mkii (renamed from tex/context/base/xtag-mmc.tex)0
-rw-r--r--tex/context/base/xtag-mml.mkii (renamed from tex/context/base/xtag-mml.tex)0
-rw-r--r--tex/context/base/xtag-mmp.mkii (renamed from tex/context/base/xtag-mmp.tex)0
-rw-r--r--tex/context/base/xtag-mxa.mkii (renamed from tex/context/base/xtag-mxa.tex)0
-rw-r--r--tex/context/base/xtag-mxb.mkii (renamed from tex/context/base/xtag-mxb.tex)0
-rw-r--r--tex/context/base/xtag-mxc.mkii (renamed from tex/context/base/xtag-mxc.tex)0
-rw-r--r--tex/context/base/xtag-mxh.mkii (renamed from tex/context/base/xtag-mxh.tex)0
-rw-r--r--tex/context/base/xtag-mxn.mkii (renamed from tex/context/base/xtag-mxn.tex)0
-rw-r--r--tex/context/base/xtag-mxo.mkii (renamed from tex/context/base/xtag-mxo.tex)0
-rw-r--r--tex/context/base/xtag-mxr.mkii (renamed from tex/context/base/xtag-mxr.tex)0
-rw-r--r--tex/context/base/xtag-pml.mkii (renamed from tex/context/base/xtag-pml.tex)0
-rw-r--r--tex/context/base/xtag-pmu.mkii (renamed from tex/context/base/xtag-pmu.tex)0
-rw-r--r--tex/context/base/xtag-pre.mkii (renamed from tex/context/base/xtag-pre.tex)0
-rw-r--r--tex/context/base/xtag-prs.mkii (renamed from tex/context/base/xtag-prs.tex)0
-rw-r--r--tex/context/base/xtag-raw.mkii (renamed from tex/context/base/xtag-raw.tex)0
-rw-r--r--tex/context/base/xtag-rng.mkii (renamed from tex/context/base/xtag-rng.tex)0
-rw-r--r--tex/context/base/xtag-run.mkii (renamed from tex/context/base/xtag-run.tex)0
-rw-r--r--tex/context/base/xtag-stk.mkii (renamed from tex/context/base/xtag-stk.tex)0
-rw-r--r--tex/context/base/xtag-utf.mkii (renamed from tex/context/base/xtag-utf.tex)0
-rw-r--r--tex/context/base/xtag-xsd.mkii (renamed from tex/context/base/xtag-xsd.tex)0
-rw-r--r--tex/context/base/xtag-xsl.mkii (renamed from tex/context/base/xtag-xsl.tex)0
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua2
184 files changed, 7926 insertions, 2887 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index 12ab2ecd8..4cb00301d 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -1080,7 +1080,7 @@ function scripts.context.metapost()
end
function scripts.context.version()
- local name = resolvers.findfile("context.tex")
+ local name = resolvers.findfile("context.mkiv")
if name ~= "" then
logs.simple("main context file: %s",name)
local data = io.loaddata(name)
@@ -1095,7 +1095,7 @@ function scripts.context.version()
logs.simple("context version: unknown, load error")
end
else
- logs.simple("main context file: unknown, 'context.tex' not found")
+ logs.simple("main context file: unknown, 'context.mkiv' not found")
end
end
@@ -1215,29 +1215,30 @@ local function touch(name,pattern)
end
end
-local touchables = { "cont-new.mkii", "cont-new.mkiv" }
+local function touchfiles(suffix)
+ local done, oldversion, newversion, foundname = touch(file.addsuffix("context",suffix),"(\\edef\\contextversion{)(.-)(})")
+ if done then
+ logs.simple("old version : %s", oldversion)
+ logs.simple("new version : %s", newversion)
+ logs.simple("touched file: %s", foundname)
+ local ok, _, _, foundname = touch(file.addsuffix("cont-new",suffix), "(\\newcontextversion{)(.-)(})")
+ if ok then
+ logs.simple("touched file: %s", foundname)
+ end
+ end
+end
function scripts.context.touch()
if environment.argument("expert") then
- local done, oldversion, newversion, foundname = touch("context.tex", "(\\edef\\contextversion{)(.-)(})")
- if done then
- logs.simple("old version : %s", oldversion)
- logs.simple("new version : %s", newversion)
- logs.simple("touched file: %s", foundname)
- for i=1,#touchables do
- local ok, _, _, foundname = touch(touchables[i], "(\\newcontextversion{)(.-)(})")
- if ok then
- logs.simple("touched file: %s", foundname)
- end
- end
- end
+ touchfiles("mkii")
+ touchfiles("mkiv")
end
end
-- extras
function scripts.context.extras(pattern)
- local found = resolvers.findfile("context.tex")
+ local found = resolvers.findfile("context.mkiv")
if found == "" then
logs.simple("unknown extra: %s", extra)
else
@@ -1332,12 +1333,12 @@ function scripts.context.update()
local force = environment.argument("force")
local socket = require("socket")
local http = require("socket.http")
- local basepath = resolvers.findfile("context.tex") or ""
+ local basepath = resolvers.findfile("context.mkiv") or ""
if basepath == "" then
- logs.simple("quiting, no 'context.tex' found")
+ logs.simple("quiting, no 'context.mkiv' found")
return
end
- local basetree = basepath.match(basepath,"^(.-)tex/context/base/context.tex$") or ""
+ local basetree = basepath.match(basepath,"^(.-)tex/context/base/context.mkiv$") or ""
if basetree == "" then
logs.simple("quiting, no proper tds structure (%s)",basepath)
return
@@ -1379,12 +1380,12 @@ function scripts.context.update()
logs.simple("quiting, unable to open '%s'",zipname)
return
end
- local newfile = zip.loaddata(zipfile,"tex/context/base/context.tex")
+ local newfile = zip.loaddata(zipfile,"tex/context/base/context.mkiv")
if not newfile then
- logs.simple("quiting, unable to open '%s'","context.tex")
+ logs.simple("quiting, unable to open '%s'","context.mkiv")
return
end
- local oldfile = io.loaddata(resolvers.findfile("context.tex")) or ""
+ local oldfile = io.loaddata(resolvers.findfile("context.mkiv")) or ""
local function versiontonumber(what,str)
local version = str:match("\\edef\\contextversion{(.-)}") or ""
local year, month, day, hour, minute = str:match("\\edef\\contextversion{(%d+)%.(%d+)%.(%d+) *(%d+)%:(%d+)}")
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 4fc678333..f414d1707 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -13418,10 +13418,14 @@ function environment.make_format(name)
end
logs.simple("format path: %s",lfs.currentdir())
-- check source file
- local texsourcename = file.addsuffix(name,"tex")
+ local texsourcename = file.addsuffix(name,"mkiv")
local fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
if fulltexsourcename == "" then
- logs.simple("no tex source file with name: %s",texsourcename)
+ texsourcename = file.addsuffix(name,"tex")
+ fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
+ end
+ if fulltexsourcename == "" then
+ logs.simple("no tex source file with name: %s (mkiv or tex)",name)
lfs.chdir(olddir)
return
else
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index 5c9fa2c98..72cf7dad0 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -118,18 +118,16 @@ class TEX
# todo norwegian (no)
- ['plain'] .each do |f| @@texformats[f] = 'plain' end
- ['cont-en','en','english','context','standard'].each do |f| @@texformats[f] = 'cont-en' end
- ['cont-nl','nl','dutch'] .each do |f| @@texformats[f] = 'cont-nl' end
- ['cont-de','de','german'] .each do |f| @@texformats[f] = 'cont-de' end
- ['cont-it','it','italian'] .each do |f| @@texformats[f] = 'cont-it' end
- ['cont-fr','fr','french'] .each do |f| @@texformats[f] = 'cont-fr' end
- ['cont-cs','cs','cont-cz','cz','czech'] .each do |f| @@texformats[f] = 'cont-cs' end
- ['cont-ro','ro','romanian'] .each do |f| @@texformats[f] = 'cont-ro' end
- ['cont-gb','gb','cont-uk','uk','british'] .each do |f| @@texformats[f] = 'cont-gb' end
- ['cont-pe','pe','persian'] .each do |f| @@texformats[f] = 'cont-pe' end
- ['cont-xp','xp','experimental'] .each do |f| @@texformats[f] = 'cont-xp' end
- ['mptopdf'] .each do |f| @@texformats[f] = 'mptopdf' end
+ ['plain'] .each do |f| @@texformats[f] = 'plain' end
+ ['cont-en','en','english','context','standard'].each do |f| @@texformats[f] = 'cont-en.mkii' end
+ ['cont-nl','nl','dutch'] .each do |f| @@texformats[f] = 'cont-nl.mkii' end
+ ['cont-de','de','german'] .each do |f| @@texformats[f] = 'cont-de.mkii' end
+ ['cont-it','it','italian'] .each do |f| @@texformats[f] = 'cont-it.mkii' end
+ ['cont-fr','fr','french'] .each do |f| @@texformats[f] = 'cont-fr.mkii' end
+ ['cont-cs','cs','cont-cz','cz','czech'] .each do |f| @@texformats[f] = 'cont-cs.mkii' end
+ ['cont-ro','ro','romanian'] .each do |f| @@texformats[f] = 'cont-ro.mkii' end
+ ['cont-gb','gb','cont-uk','uk','british'] .each do |f| @@texformats[f] = 'cont-gb.mkii' end
+ ['mptopdf'] .each do |f| @@texformats[f] = 'mptopdf' end
['latex'] .each do |f| @@texformats[f] = 'latex.ltx' end
@@ -142,10 +140,15 @@ class TEX
['latex','pdflatex'] .each do |p| @@prognames[p] = 'latex' end
['plain','default','standard','mptopdf'] .each do |f| @@texmethods[f] = 'plain' end
- ['cont-en','cont-nl','cont-de','cont-it',
- 'cont-fr','cont-cs','cont-ro','cont-gb',
- 'cont-pe','cont-xp'] .each do |f| @@texmethods[f] = 'context' end
- ['latex','pdflatex'] .each do |f| @@texmethods[f] = 'latex' end
+ ['cont-en','cont-en.mkii',
+ 'cont-nl','cont-nl.mkii',
+ 'cont-de','cont-de.mkii',
+ 'cont-it','cont-it.mkii',
+ 'cont-fr','cont-fr.mkii',
+ 'cont-cs','cont-cs.mkii',
+ 'cont-ro','cont-ro.mkii',
+ 'cont-gb','cont-gb.mkii'] .each do |f| @@texmethods[f] = 'context' end
+ ['latex','latex.ltx','pdflatex'] .each do |f| @@texmethods[f] = 'latex' end # untested
['plain','default','standard'] .each do |f| @@mpsmethods[f] = 'plain' end
['metafun'] .each do |f| @@mpsmethods[f] = 'metafun' end
@@ -442,14 +445,6 @@ class TEX
if str.class == String then str.split(',') else str.flatten end
end
- def validtexformat(str) validsomething(str,@@texformats,'tex') end
- def validmpsformat(str) validsomething(str,@@mpsformats,'mp' ) end
- def validtexengine(str) validsomething(str,@@texengines,'pdftex') end
- def validmpsengine(str) validsomething(str,@@mpsengines,'mpost' ) end
-
- def validtexmethod(str) [validsomething(str,@@texmethods)].flatten.first end
- def validmpsmethod(str) [validsomething(str,@@mpsmethods)].flatten.first end
-
def validsomething(str,something,type=nil)
if str then
list = [str].flatten.collect do |s|
@@ -471,6 +466,15 @@ class TEX
end
end
+ def validtexformat(str) validsomething(str,@@texformats,'tex') ||
+ validsomething(str,@@texformats,'mkii') end
+ def validmpsformat(str) validsomething(str,@@mpsformats,'mp' ) end
+ def validtexengine(str) validsomething(str,@@texengines,'pdftex') end
+ def validmpsengine(str) validsomething(str,@@mpsengines,'mpost' ) end
+
+ def validtexmethod(str) [validsomething(str,@@texmethods)].flatten.first end
+ def validmpsmethod(str) [validsomething(str,@@mpsmethods)].flatten.first end
+
def validbackend(str)
if str && @@backends.key?(str) then
@@backends[str]
@@ -562,7 +566,7 @@ class TEX
# will go to context/process context/listing etc
def contextversion # ook elders gebruiken
- filename = Kpse.found('context.tex')
+ filename = Kpse.found('context.mkii')
version = 'unknown'
begin
if FileTest.file?(filename) && IO.read(filename).match(/\\contextversion\{(\d+\.\d+\.\d+.*?)\}/) then
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 4fc678333..f414d1707 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -13418,10 +13418,14 @@ function environment.make_format(name)
end
logs.simple("format path: %s",lfs.currentdir())
-- check source file
- local texsourcename = file.addsuffix(name,"tex")
+ local texsourcename = file.addsuffix(name,"mkiv")
local fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
if fulltexsourcename == "" then
- logs.simple("no tex source file with name: %s",texsourcename)
+ texsourcename = file.addsuffix(name,"tex")
+ fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
+ end
+ if fulltexsourcename == "" then
+ logs.simple("no tex source file with name: %s (mkiv or tex)",name)
lfs.chdir(olddir)
return
else
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 4fc678333..f414d1707 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -13418,10 +13418,14 @@ function environment.make_format(name)
end
logs.simple("format path: %s",lfs.currentdir())
-- check source file
- local texsourcename = file.addsuffix(name,"tex")
+ local texsourcename = file.addsuffix(name,"mkiv")
local fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
if fulltexsourcename == "" then
- logs.simple("no tex source file with name: %s",texsourcename)
+ texsourcename = file.addsuffix(name,"tex")
+ fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
+ end
+ if fulltexsourcename == "" then
+ logs.simple("no tex source file with name: %s (mkiv or tex)",name)
lfs.chdir(olddir)
return
else
diff --git a/tex/context/base/v-default.lua b/tex/context/base/buff-imp-default.lua
index 2e3707442..2e3707442 100644
--- a/tex/context/base/v-default.lua
+++ b/tex/context/base/buff-imp-default.lua
diff --git a/tex/context/base/v-default.mkiv b/tex/context/base/buff-imp-default.mkiv
index f9a821f0f..f9a821f0f 100644
--- a/tex/context/base/v-default.mkiv
+++ b/tex/context/base/buff-imp-default.mkiv
diff --git a/tex/context/base/v-escaped.lua b/tex/context/base/buff-imp-escaped.lua
index 060f48ea3..060f48ea3 100644
--- a/tex/context/base/v-escaped.lua
+++ b/tex/context/base/buff-imp-escaped.lua
diff --git a/tex/context/base/v-escaped.mkiv b/tex/context/base/buff-imp-escaped.mkiv
index 780d0b518..780d0b518 100644
--- a/tex/context/base/v-escaped.mkiv
+++ b/tex/context/base/buff-imp-escaped.mkiv
diff --git a/tex/context/base/v-lua.lua b/tex/context/base/buff-imp-lua.lua
index abe8de211..abe8de211 100644
--- a/tex/context/base/v-lua.lua
+++ b/tex/context/base/buff-imp-lua.lua
diff --git a/tex/context/base/v-lua.mkiv b/tex/context/base/buff-imp-lua.mkiv
index 4ed04f169..4ed04f169 100644
--- a/tex/context/base/v-lua.mkiv
+++ b/tex/context/base/buff-imp-lua.mkiv
diff --git a/tex/context/base/v-mp.lua b/tex/context/base/buff-imp-mp.lua
index 7c356a5c8..7c356a5c8 100644
--- a/tex/context/base/v-mp.lua
+++ b/tex/context/base/buff-imp-mp.lua
diff --git a/tex/context/base/v-mp.mkiv b/tex/context/base/buff-imp-mp.mkiv
index 30eb23f8b..30eb23f8b 100644
--- a/tex/context/base/v-mp.mkiv
+++ b/tex/context/base/buff-imp-mp.mkiv
diff --git a/tex/context/base/v-nested.lua b/tex/context/base/buff-imp-nested.lua
index e37e1bb58..e37e1bb58 100644
--- a/tex/context/base/v-nested.lua
+++ b/tex/context/base/buff-imp-nested.lua
diff --git a/tex/context/base/v-nested.mkiv b/tex/context/base/buff-imp-nested.mkiv
index e1d582d81..e1d582d81 100644
--- a/tex/context/base/v-nested.mkiv
+++ b/tex/context/base/buff-imp-nested.mkiv
diff --git a/tex/context/base/v-parsed-xml.lua b/tex/context/base/buff-imp-parsed-xml.lua
index 530060b57..530060b57 100644
--- a/tex/context/base/v-parsed-xml.lua
+++ b/tex/context/base/buff-imp-parsed-xml.lua
diff --git a/tex/context/base/v-parsed-xml.mkiv b/tex/context/base/buff-imp-parsed-xml.mkiv
index b99328be7..b99328be7 100644
--- a/tex/context/base/v-parsed-xml.mkiv
+++ b/tex/context/base/buff-imp-parsed-xml.mkiv
diff --git a/tex/context/base/v-tex.lua b/tex/context/base/buff-imp-tex.lua
index 1973017f3..1973017f3 100644
--- a/tex/context/base/v-tex.lua
+++ b/tex/context/base/buff-imp-tex.lua
diff --git a/tex/context/base/v-tex.mkiv b/tex/context/base/buff-imp-tex.mkiv
index 5cd5753bb..5cd5753bb 100644
--- a/tex/context/base/v-tex.mkiv
+++ b/tex/context/base/buff-imp-tex.mkiv
diff --git a/tex/context/base/v-xml.lua b/tex/context/base/buff-imp-xml.lua
index bf6945e26..bf6945e26 100644
--- a/tex/context/base/v-xml.lua
+++ b/tex/context/base/buff-imp-xml.lua
diff --git a/tex/context/base/v-xml.mkiv b/tex/context/base/buff-imp-xml.mkiv
index 3cc9244f2..3cc9244f2 100644
--- a/tex/context/base/v-xml.mkiv
+++ b/tex/context/base/buff-imp-xml.mkiv
diff --git a/tex/context/base/buff-ver.lua b/tex/context/base/buff-ver.lua
index 91bf1c6a0..9c7f6e371 100644
--- a/tex/context/base/buff-ver.lua
+++ b/tex/context/base/buff-ver.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['buff-ver'] = {
license = "see context related readme files"
}
--- The default visualizers have reserved names starting with v-*. Users are
+-- The default visualizers have reserved names starting with buff-imp-*. Users are
-- supposed to use different names for their own variants.
local type, next, rawset, rawget, setmetatable, getmetatable = type, next, rawset, rawget, setmetatable, getmetatable
@@ -224,8 +224,8 @@ function visualizers.load(name)
name = lower(name)
if rawget(specifications,name) == nil then
name = lower(name)
- local texname = findfile(format("v-%s.mkiv",name))
- local luaname = findfile(format("v-%s.lua" ,name))
+ local texname = findfile(format("buff-imp-%s.mkiv",name))
+ local luaname = findfile(format("buff-imp-%s.lua" ,name))
if texname == "" or luaname == "" then
-- assume a user specific file
luaname = findfile(addsuffix(name,"mkiv"))
diff --git a/tex/context/base/colo-ema.tex b/tex/context/base/colo-ema.mkii
index e5e90b235..e5e90b235 100644
--- a/tex/context/base/colo-ema.tex
+++ b/tex/context/base/colo-ema.mkii
diff --git a/tex/context/base/colo-hex.mkii b/tex/context/base/colo-hex.mkii
new file mode 100644
index 000000000..db67f1841
--- /dev/null
+++ b/tex/context/base/colo-hex.mkii
@@ -0,0 +1,125 @@
+%D \module
+%D [ file=colo-hex,
+%D version=2004.06.23,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=Hex Colors,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\ifdefined \hexcolorprefix
+ \expandafter \endinput
+\fi
+
+\writestatus{loading}{ConTeXt Color Macros / Hexadecimal}
+
+% \edef\testcolor{\string#FFC0C0}
+% \edef\testcolor{\string#55}
+%
+% \setupcolors[state=start]
+%
+% \expanded{\definecolor[thehexcolor][\hexcolorspec\testcolor]}
+%
+% \checkhexcolor[\testcolor]
+%
+% \definecolor[thehexcolor][\testcolor]
+%
+% \starttext
+%
+% test \color[thehexcolor]{rood}
+% test \color[red]{rood}
+% test \color[\testcolor]{rood}
+%
+% \stoptext
+
+\unprotect
+
+% \definecolor[rgbtestcolor] [r=0.87843,g=0.87451,b=0.89020] % RGB(224,223,227)
+% \definecolor[hextestcolor] [h=E0DFE3]
+%
+% \startMPpage
+% path p ; % example by Peter Rolf
+% p := unitsquare xyscaled(5cm,5cm) ;
+% fill (point 0 of p -- point 1 of p -- point 2 of p --cycle) withcolor \MPcolor{rgbtestcolor} ; % bottom right part of the square
+% fill (point 0 of p -- point 3 of p -- point 2 of p --cycle) withcolor \MPcolor{hextestcolor} ; % top left part
+% \stopMPpage
+
+\newdimen\hexcolorfraction \hexcolorfraction=\dimexpr1pt/255\relax
+
+\chardef\hexcolorprefix=`#
+
+\def\hexcolorspec #1{\expandafter\dohexcolorspec #1\empty\empty\empty\empty\relax}
+\def\hexcolorpattern#1{\expandafter\dohexcolorpattern#1\empty\empty\empty\empty\relax}
+
+\ifx\dohexstringtonumber\undefined \def\dohexstringtonumber{"} \fi
+
+\def\hexcolorcomponent#1#2%
+ {\ifnum\dohexstringtonumber#1#2=\zerocount0\else\ifnum\dohexstringtonumber#1#2=\plusone1\else
+ \expandafter\withoutpt\the\dimexpr\dohexstringtonumber#1#2\hexcolorfraction\relax
+ \fi\fi}
+
+\def\dohexcolorspec#1#2#3#4#5#6#7#8\relax
+ {\ifx#4\empty
+ s=\hexcolorcomponent#2#3%
+ \else
+ r=\hexcolorcomponent#2#3,g=\hexcolorcomponent#4#5,b=\hexcolorcomponent#6#7%
+ \fi}
+
+\def\dohexcolorpattern#1#2#3#4#5#6#7#8\relax
+ {0\ifx#4\empty
+ S:\hexcolorcomponent#2#3%
+ \else
+ R:\hexcolorcomponent#2#3:\hexcolorcomponent#4#5:\hexcolorcomponent#6#7%
+ \fi:0:0}
+
+\def\doifhexcolorelse#1%
+ {\expandafter\dodoifhexcolorelse#10\od} % 0 is a dirty trick to catch an empty #1
+
+\def\dodoifhexcolorelse#1#2\od
+ {\ifnum`#1=\hexcolorprefix
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+
+\def\docheckhexcolor#1%
+ {\doifhexcolorelse{#1}{\doifundefined{#1}{\setxvalue{\??cr#1}{\hexcolorpattern{#1}}}}\donothing}
+
+\def\checkhexcolor[#1]%
+ {\expanded{\docheckhexcolor{#1}}}
+
+\def\colorHpattern{\@EA\hexcolorpattern\@EA{\@EA*\@@cl@@h}} % * == dummy placeholder
+
+\let\dodododefinecolor\dododefinecolor % we will overload this one
+
+\def\dododefinecolor#1#2#3#4[#5][#6]%
+ {\doifhexcolorelse{#6}
+ {\setxvalue{\??cr#5}{\hexcolorpattern{#6}}}
+ {\dodododefinecolor#1#2#3#4[#5][#6]}}
+
+%D For Adam Lindsay and his XeTeX special driver:
+
+% because we intercept the zero condition, the .23pt in 1.23pt will disappear in the
+% ifcase zero part branch
+
+\def\colorhexcomponent#1%
+ {\ifdim#1\points<.005\points
+ 00\else\lchexnumbers{\the\dimexpr255\dimexpr#1\points\relax+.5\points\relax}%
+ \fi}
+
+% the faster one
+
+\newdimen\hex@color@a \hex@color@a=.005pt
+\newdimen\hex@color@b \hex@color@b=.5pt
+\chardef \hex@color@c =255
+
+\def\colorhexcomponent#1%
+ {\ifdim#1\points<\hex@color@a
+ 00\else\lchexnumbers{\the\dimexpr#1\points*\hex@color@c+\hex@color@b\relax}%
+ \fi}
+
+\protect \endinput
diff --git a/tex/context/base/colo-imp-ema.mkiv b/tex/context/base/colo-imp-ema.mkiv
new file mode 100644
index 000000000..e5e90b235
--- /dev/null
+++ b/tex/context/base/colo-imp-ema.mkiv
@@ -0,0 +1,590 @@
+%D \module
+%D [ file=colo-ema,
+%D version=2003.03.20,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=Emacs Colors,
+%D author=Peter Rolf,
+%D date=\currentdate,
+%D copyright=PRAGMA ADE]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% author : Peter Rolf <peter.rolf@arcor.de>
+% last change : 17 march 2003
+% origin : /emacs/etc/rgb.txt
+%
+% USAGE:
+%
+% - select emacs menu: Edit -> Text Properties -> Display
+% Colors, if you don't know what I'm talking about
+% - copy this file to your /texmf/tex/context/user directory
+% and add "\input colo-emacs" to your tex-file
+%
+% IMPORTANT NOTES:
+%
+% - all color names are written as ONE word in lowercase
+% letters (no redundancy as in rgb.txt) so if you want to
+% use the color "Light Sky Blue"/"light sky blue" it's new
+% name is lightskyblue
+% - the grayX values [X=0..100] can only be used with \color
+% [grayX]
+% - use it at your own risk :)
+%
+% HINT:
+%
+% I only include this file (\showcolor [ema]) until I've
+% found the colors I want. Copy and paste the color
+% definitions to a seperate file, to decrease compilation
+% time (540 color definitions).
+
+\definecolor [snow] [r=1,g=.980392,b=.980392]
+\definecolor [ghostwhite] [r=.972549,g=.972549,b=1]
+\definecolor [whitesmoke] [s=.960784]
+\definecolor [gainsboro] [s=.862745]
+\definecolor [floralwhite] [r=1,g=.980392,b=.941176]
+\definecolor [oldlace] [r=.992157,g=.960784,b=.901961]
+\definecolor [linen] [r=.980392,g=.941176,b=.901961]
+\definecolor [antiquewhite] [r=.980392,g=.921569,b=.843137]
+\definecolor [papayawhip] [r=1,g=.937255,b=.835294]
+\definecolor [blanchedalmond] [r=1,g=.921569,b=.803922]
+\definecolor [bisque] [r=1,g=.894118,b=.768627]
+\definecolor [peachpuff] [r=1,g=.854902,b=.72549]
+\definecolor [navajowhite] [r=1,g=.870588,b=.678431]
+\definecolor [moccasin] [r=1,g=.894118,b=.709804]
+\definecolor [cornsilk] [r=1,g=.972549,b=.862745]
+\definecolor [ivory] [r=1,g=1,b=.941176]
+\definecolor [lemonchiffon] [r=1,g=.980392,b=.803922]
+\definecolor [seashell] [r=1,g=.960784,b=.933333]
+\definecolor [honeydew] [r=.941176,g=1,b=.941176]
+\definecolor [mintcream] [r=.960784,g=1,b=.980392]
+\definecolor [azure] [r=.941176,g=1,b=1]
+\definecolor [aliceblue] [r=.941176,g=.972549,b=1]
+\definecolor [lavender] [r=.901961,g=.901961,b=.980392]
+\definecolor [lavenderblush] [r=1,g=.941176,b=.960784]
+\definecolor [mistyrose] [r=1,g=.894118,b=.882353]
+%definecolor[white] [s=1]
+%definecolor[black] [s=0]
+\definecolor [darkslategray] [r=.184314,g=.309804,b=.309804]
+\definecolor [dimgray] [s=.411765]
+\definecolor [slategray] [r=.439216,g=.501961,b=.564706]
+\definecolor [lightslategray] [r=.466667,g=.533333,b=.6]
+\definecolor [gray] [s=.745098]
+\definecolor [lightgray] [s=.827451]
+\definecolor [midnightblue] [r=.098039,g=.098039,b=.439216]
+\definecolor [navy] [b=.501961]
+\definecolor [navyblue] [navy]
+\definecolor [cornflowerblue] [r=.392157,g=.584314,b=.929412]
+\definecolor [darkslateblue] [r=.282353,g=.239216,b=.545098]
+\definecolor [slateblue] [r=.415686,g=.352941,b=.803922]
+\definecolor [mediumslateblue] [r=.482353,g=.407843,b=.933333]
+\definecolor [lightslateblue] [r=.517647,g=.439216,b=1]
+\definecolor [mediumblue] [b=.803922]
+\definecolor [royalblue] [r=.254902,g=.411765,b=.882353]
+%definecolor[blue] [b=1]
+\definecolor [dodgerblue] [r=.117647,g=.564706,b=1]
+\definecolor [deepskyblue] [g=.74902,b=1]
+\definecolor [skyblue] [r=.529412,g=.807843,b=.921569]
+\definecolor [lightskyblue] [r=.529412,g=.807843,b=.980392]
+\definecolor [steelblue] [r=.27451,g=.509804,b=.705882]
+\definecolor [lightsteelblue] [r=.690196,g=.768627,b=.870588]
+\definecolor [lightblue] [r=.678431,g=.847059,b=.901961]
+\definecolor [powderblue] [r=.690196,g=.878431,b=.901961]
+\definecolor [paleturquoise] [r=.686275,g=.933333,b=.933333]
+\definecolor [darkturquoise] [g=.807843,b=.819608]
+\definecolor [mediumturquoise] [r=.282353,g=.819608,b=.8]
+\definecolor [turquoise] [r=.25098,g=.878431,b=.815686]
+%definecolor[cyan] [g=1,b=1]
+\definecolor [lightcyan] [r=.878431,g=1,b=1]
+\definecolor [cadetblue] [r=.372549,g=.619608,b=.627451]
+\definecolor [mediumaquamarine] [r=.4,g=.803922,b=.666667]
+\definecolor [aquamarine] [r=.498039,g=1,b=.831373]
+\definecolor [darkgreen] [g=.392157]
+\definecolor [darkolivegreen] [r=.333333,g=.419608,b=.184314]
+\definecolor [darkseagreen] [r=.560784,g=.737255,b=.560784]
+\definecolor [seagreen] [r=.180392,g=.545098,b=.341176]
+\definecolor [mediumseagreen] [r=.235294,g=.701961,b=.443137]
+\definecolor [lightseagreen] [r=.12549,g=.698039,b=.666667]
+\definecolor [palegreen] [r=.596078,g=.984314,b=.596078]
+\definecolor [springgreen] [g=1,b=.498039]
+\definecolor [lawngreen] [r=.486275,g=.988235]
+%definecolor[green] [g=1]
+\definecolor [chartreuse] [r=.498039,g=1]
+\definecolor [mediumspringgreen] [g=.980392,b=.603922]
+\definecolor [greenyellow] [r=.678431,g=1,b=.184314]
+\definecolor [limegreen] [r=.196078,g=.803922,b=.196078]
+\definecolor [yellowgreen] [r=.603922,g=.803922,b=.196078]
+\definecolor [forestgreen] [r=.133333,g=.545098,b=.133333]
+\definecolor [olivedrab] [r=.419608,g=.556863,b=.137255]
+\definecolor [darkkhaki] [r=.741176,g=.717647,b=.419608]
+\definecolor [khaki] [r=.941176,g=.901961,b=.54902]
+\definecolor [palegoldenrod] [r=.933333,g=.909804,b=.666667]
+\definecolor [lightgoldenrodyellow] [r=.980392,g=.980392,b=.823529]
+\definecolor [lightyellow] [r=1,g=1,b=.878431]
+%definecolor[yellow] [r=1,g=1]
+\definecolor [gold] [r=1,g=.843137]
+\definecolor [lightgoldenrod] [r=.933333,g=.866667,b=.509804]
+\definecolor [goldenrod] [r=.854902,g=.647059,b=.12549]
+\definecolor [darkgoldenrod] [r=.721569,g=.52549,b=.043137]
+\definecolor [rosybrown] [r=.737255,g=.560784,b=.560784]
+\definecolor [indianred] [r=.803922,g=.360784,b=.360784]
+\definecolor [saddlebrown] [r=.545098,g=.270588,b=.07451]
+\definecolor [sienna] [r=.627451,g=.321569,b=.176471]
+\definecolor [peru] [r=.803922,g=.521569,b=.247059]
+\definecolor [burlywood] [r=.870588,g=.721569,b=.529412]
+\definecolor [beige] [r=.960784,g=.960784,b=.862745]
+\definecolor [wheat] [r=.960784,g=.870588,b=.701961]
+\definecolor [sandybrown] [r=.956863,g=.643137,b=.376471]
+\definecolor [tan] [r=.823529,g=.705882,b=.54902]
+\definecolor [chocolate] [r=.823529,g=.411765,b=.117647]
+\definecolor [firebrick] [r=.698039,g=.133333,b=.133333]
+\definecolor [brown] [r=.647059,g=.164706,b=.164706]
+\definecolor [darksalmon] [r=.913725,g=.588235,b=.478431]
+\definecolor [salmon] [r=.980392,g=.501961,b=.447059]
+\definecolor [lightsalmon] [r=1,g=.627451,b=.478431]
+\definecolor [orange] [r=1,g=.647059]
+\definecolor [darkorange] [r=1,g=.54902]
+\definecolor [coral] [r=1,g=.498039,b=.313725]
+\definecolor [lightcoral] [r=.941176,g=.501961,b=.501961]
+\definecolor [tomato] [r=1,g=.388235,b=.278431]
+\definecolor [orangered] [r=1,g=.270588]
+%definecolor[red] [r=1]
+\definecolor [hotpink] [r=1,g=.411765,b=.705882]
+\definecolor [deeppink] [r=1,g=.078431,b=.576471]
+\definecolor [pink] [r=1,g=.752941,b=.796078]
+\definecolor [lightpink] [r=1,g=.713725,b=.756863]
+\definecolor [palevioletred] [r=.858824,g=.439216,b=.576471]
+\definecolor [maroon] [r=.690196,g=.188235,b=.376471]
+\definecolor [mediumvioletred] [r=.780392,g=.082353,b=.521569]
+\definecolor [violetred] [r=.815686,g=.12549,b=.564706]
+%definecolor[magenta] [r=1,b=1]
+\definecolor [violet] [r=.933333,g=.509804,b=.933333]
+\definecolor [plum] [r=.866667,g=.627451,b=.866667]
+\definecolor [orchid] [r=.854902,g=.439216,b=.839216]
+\definecolor [mediumorchid] [r=.729412,g=.333333,b=.827451]
+\definecolor [darkorchid] [r=.6,g=.196078,b=.8]
+\definecolor [darkviolet] [r=.580392,b=.827451]
+\definecolor [blueviolet] [r=.541176,g=.168627,b=.886275]
+\definecolor [purple] [r=.627451,g=.12549,b=.941176]
+\definecolor [mediumpurple] [r=.576471,g=.439216,b=.858824]
+\definecolor [thistle] [r=.847059,g=.74902,b=.847059]
+\definecolor [snow1] [r=1,g=.980392,b=.980392]
+\definecolor [snow2] [r=.933333,g=.913725,b=.913725]
+\definecolor [snow3] [r=.803922,g=.788235,b=.788235]
+\definecolor [snow4] [r=.545098,g=.537255,b=.537255]
+\definecolor [seashell1] [r=1,g=.960784,b=.933333]
+\definecolor [seashell2] [r=.933333,g=.898039,b=.870588]
+\definecolor [seashell3] [r=.803922,g=.772549,b=.74902]
+\definecolor [seashell4] [r=.545098,g=.52549,b=.509804]
+\definecolor [antiquewhite1] [r=1,g=.937255,b=.858824]
+\definecolor [antiquewhite2] [r=.933333,g=.87451,b=.8]
+\definecolor [antiquewhite3] [r=.803922,g=.752941,b=.690196]
+\definecolor [antiquewhite4] [r=.545098,g=.513725,b=.470588]
+\definecolor [bisque1] [r=1,g=.894118,b=.768627]
+\definecolor [bisque2] [r=.933333,g=.835294,b=.717647]
+\definecolor [bisque3] [r=.803922,g=.717647,b=.619608]
+\definecolor [bisque4] [r=.545098,g=.490196,b=.419608]
+\definecolor [peachpuff1] [r=1,g=.854902,b=.72549]
+\definecolor [peachpuff2] [r=.933333,g=.796078,b=.678431]
+\definecolor [peachpuff3] [r=.803922,g=.686275,b=.584314]
+\definecolor [peachpuff4] [r=.545098,g=.466667,b=.396078]
+\definecolor [navajowhite1] [r=1,g=.870588,b=.678431]
+\definecolor [navajowhite2] [r=.933333,g=.811765,b=.631373]
+\definecolor [navajowhite3] [r=.803922,g=.701961,b=.545098]
+\definecolor [navajowhite4] [r=.545098,g=.47451,b=.368627]
+\definecolor [lemonchiffon1] [r=1,g=.980392,b=.803922]
+\definecolor [lemonchiffon2] [r=.933333,g=.913725,b=.74902]
+\definecolor [lemonchiffon3] [r=.803922,g=.788235,b=.647059]
+\definecolor [lemonchiffon4] [r=.545098,g=.537255,b=.439216]
+\definecolor [cornsilk1] [r=1,g=.972549,b=.862745]
+\definecolor [cornsilk2] [r=.933333,g=.909804,b=.803922]
+\definecolor [cornsilk3] [r=.803922,g=.784314,b=.694118]
+\definecolor [cornsilk4] [r=.545098,g=.533333,b=.470588]
+\definecolor [ivory1] [r=1,g=1,b=.941176]
+\definecolor [ivory2] [r=.933333,g=.933333,b=.878431]
+\definecolor [ivory3] [r=.803922,g=.803922,b=.756863]
+\definecolor [ivory4] [r=.545098,g=.545098,b=.513725]
+\definecolor [honeydew1] [r=.941176,g=1,b=.941176]
+\definecolor [honeydew2] [r=.878431,g=.933333,b=.878431]
+\definecolor [honeydew3] [r=.756863,g=.803922,b=.756863]
+\definecolor [honeydew4] [r=.513725,g=.545098,b=.513725]
+\definecolor [lavenderblush1] [r=1,g=.941176,b=.960784]
+\definecolor [lavenderblush2] [r=.933333,g=.878431,b=.898039]
+\definecolor [lavenderblush3] [r=.803922,g=.756863,b=.772549]
+\definecolor [lavenderblush4] [r=.545098,g=.513725,b=.52549]
+\definecolor [mistyrose1] [r=1,g=.894118,b=.882353]
+\definecolor [mistyrose2] [r=.933333,g=.835294,b=.823529]
+\definecolor [mistyrose3] [r=.803922,g=.717647,b=.709804]
+\definecolor [mistyrose4] [r=.545098,g=.490196,b=.482353]
+\definecolor [azure1] [r=.941176,g=1,b=1]
+\definecolor [azure2] [r=.878431,g=.933333,b=.933333]
+\definecolor [azure3] [r=.756863,g=.803922,b=.803922]
+\definecolor [azure4] [r=.513725,g=.545098,b=.545098]
+\definecolor [slateblue1] [r=.513725,g=.435294,b=1]
+\definecolor [slateblue2] [r=.478431,g=.403922,b=.933333]
+\definecolor [slateblue3] [r=.411765,g=.34902,b=.803922]
+\definecolor [slateblue4] [r=.278431,g=.235294,b=.545098]
+\definecolor [royalblue1] [r=.282353,g=.462745,b=1]
+\definecolor [royalblue2] [r=.262745,g=.431373,b=.933333]
+\definecolor [royalblue3] [r=.227451,g=.372549,b=.803922]
+\definecolor [royalblue4] [r=.152941,g=.25098,b=.545098]
+\definecolor [blue1] [blue]
+\definecolor [blue2] [b=.933333]
+\definecolor [blue3] [b=.803922]
+\definecolor [blue4] [b=.545098]
+\definecolor [dodgerblue1] [r=.117647,g=.564706,b=1]
+\definecolor [dodgerblue2] [r=.109804,g=.52549,b=.933333]
+\definecolor [dodgerblue3] [r=.094118,g=.454902,b=.803922]
+\definecolor [dodgerblue4] [r=.062745,g=.305882,b=.545098]
+\definecolor [steelblue1] [r=.388235,g=.721569,b=1]
+\definecolor [steelblue2] [r=.360784,g=.67451,b=.933333]
+\definecolor [steelblue3] [r=.309804,g=.580392,b=.803922]
+\definecolor [steelblue4] [r=.211765,g=.392157,b=.545098]
+\definecolor [deepskyblue1] [g=.74902,b=1]
+\definecolor [deepskyblue2] [g=.698039,b=.933333]
+\definecolor [deepskyblue3] [g=.603922,b=.803922]
+\definecolor [deepskyblue4] [g=.407843,b=.545098]
+\definecolor [skyblue1] [r=.529412,g=.807843,b=1]
+\definecolor [skyblue2] [r=.494118,g=.752941,b=.933333]
+\definecolor [skyblue3] [r=.423529,g=.65098,b=.803922]
+\definecolor [skyblue4] [r=.290196,g=.439216,b=.545098]
+\definecolor [lightskyblue1] [r=.690196,g=.886275,b=1]
+\definecolor [lightskyblue2] [r=.643137,g=.827451,b=.933333]
+\definecolor [lightskyblue3] [r=.552941,g=.713725,b=.803922]
+\definecolor [lightskyblue4] [r=.376471,g=.482353,b=.545098]
+\definecolor [slategray1] [r=.776471,g=.886275,b=1]
+\definecolor [slategray2] [r=.72549,g=.827451,b=.933333]
+\definecolor [slategray3] [r=.623529,g=.713725,b=.803922]
+\definecolor [slategray4] [r=.423529,g=.482353,b=.545098]
+\definecolor [lightsteelblue1] [r=.792157,g=.882353,b=1]
+\definecolor [lightsteelblue2] [r=.737255,g=.823529,b=.933333]
+\definecolor [lightsteelblue3] [r=.635294,g=.709804,b=.803922]
+\definecolor [lightsteelblue4] [r=.431373,g=.482353,b=.545098]
+\definecolor [lightblue1] [r=.74902,g=.937255,b=1]
+\definecolor [lightblue2] [r=.698039,g=.87451,b=.933333]
+\definecolor [lightblue3] [r=.603922,g=.752941,b=.803922]
+\definecolor [lightblue4] [r=.407843,g=.513725,b=.545098]
+\definecolor [lightcyan1] [r=.878431,g=1,b=1]
+\definecolor [lightcyan2] [r=.819608,g=.933333,b=.933333]
+\definecolor [lightcyan3] [r=.705882,g=.803922,b=.803922]
+\definecolor [lightcyan4] [r=.478431,g=.545098,b=.545098]
+\definecolor [paleturquoise1] [r=.733333,g=1,b=1]
+\definecolor [paleturquoise2] [r=.682353,g=.933333,b=.933333]
+\definecolor [paleturquoise3] [r=.588235,g=.803922,b=.803922]
+\definecolor [paleturquoise4] [r=.4,g=.545098,b=.545098]
+\definecolor [cadetblue1] [r=.596078,g=.960784,b=1]
+\definecolor [cadetblue2] [r=.556863,g=.898039,b=.933333]
+\definecolor [cadetblue3] [r=.478431,g=.772549,b=.803922]
+\definecolor [cadetblue4] [r=.32549,g=.52549,b=.545098]
+\definecolor [turquoise1] [g=.960784,b=1]
+\definecolor [turquoise2] [g=.898039,b=.933333]
+\definecolor [turquoise3] [g=.772549,b=.803922]
+\definecolor [turquoise4] [g=.52549,b=.545098]
+\definecolor [cyan1] [cyan]
+\definecolor [cyan2] [g=.933333,b=.933333]
+\definecolor [cyan3] [g=.803922,b=.803922]
+\definecolor [cyan4] [g=.545098,b=.545098]
+\definecolor [darkslategray1] [r=.592157,g=1,b=1]
+\definecolor [darkslategray2] [r=.552941,g=.933333,b=.933333]
+\definecolor [darkslategray3] [r=.47451,g=.803922,b=.803922]
+\definecolor [darkslategray4] [r=.321569,g=.545098,b=.545098]
+\definecolor [aquamarine1] [r=.498039,g=1,b=.831373]
+\definecolor [aquamarine2] [r=.462745,g=.933333,b=.776471]
+\definecolor [aquamarine3] [r=.4,g=.803922,b=.666667]
+\definecolor [aquamarine4] [r=.270588,g=.545098,b=.454902]
+\definecolor [darkseagreen1] [r=.756863,g=1,b=.756863]
+\definecolor [darkseagreen2] [r=.705882,g=.933333,b=.705882]
+\definecolor [darkseagreen3] [r=.607843,g=.803922,b=.607843]
+\definecolor [darkseagreen4] [r=.411765,g=.545098,b=.411765]
+\definecolor [seagreen1] [r=.329412,g=1,b=.623529]
+\definecolor [seagreen2] [r=.305882,g=.933333,b=.580392]
+\definecolor [seagreen3] [r=.262745,g=.803922,b=.501961]
+\definecolor [seagreen4] [r=.180392,g=.545098,b=.341176]
+\definecolor [palegreen1] [r=.603922,g=1,b=.603922]
+\definecolor [palegreen2] [r=.564706,g=.933333,b=.564706]
+\definecolor [palegreen3] [r=.486275,g=.803922,b=.486275]
+\definecolor [palegreen4] [r=.329412,g=.545098,b=.329412]
+\definecolor [springgreen1] [g=1,b=.498039]
+\definecolor [springgreen2] [g=.933333,b=.462745]
+\definecolor [springgreen3] [g=.803922,b=.4]
+\definecolor [springgreen4] [g=.545098,b=.270588]
+\definecolor [green1] [green]
+\definecolor [green2] [g=.933333]
+\definecolor [green3] [g=.803922]
+\definecolor [green4] [g=.545098]
+\definecolor [chartreuse1] [r=.498039,g=1]
+\definecolor [chartreuse2] [r=.462745,g=.933333]
+\definecolor [chartreuse3] [r=.4,g=.803922]
+\definecolor [chartreuse4] [r=.270588,g=.545098]
+\definecolor [olivedrab1] [r=.752941,g=1,b=.243137]
+\definecolor [olivedrab2] [r=.701961,g=.933333,b=.227451]
+\definecolor [olivedrab3] [r=.603922,g=.803922,b=.196078]
+\definecolor [olivedrab4] [r=.411765,g=.545098,b=.133333]
+\definecolor [darkolivegreen1] [r=.792157,g=1,b=.439216]
+\definecolor [darkolivegreen2] [r=.737255,g=.933333,b=.407843]
+\definecolor [darkolivegreen3] [r=.635294,g=.803922,b=.352941]
+\definecolor [darkolivegreen4] [r=.431373,g=.545098,b=.239216]
+\definecolor [khaki1] [r=1,g=.964706,b=.560784]
+\definecolor [khaki2] [r=.933333,g=.901961,b=.521569]
+\definecolor [khaki3] [r=.803922,g=.776471,b=.45098]
+\definecolor [khaki4] [r=.545098,g=.52549,b=.305882]
+\definecolor [lightgoldenrod1] [r=1,g=.92549,b=.545098]
+\definecolor [lightgoldenrod2] [r=.933333,g=.862745,b=.509804]
+\definecolor [lightgoldenrod3] [r=.803922,g=.745098,b=.439216]
+\definecolor [lightgoldenrod4] [r=.545098,g=.505882,b=.298039]
+\definecolor [lightyellow1] [r=1,g=1,b=.878431]
+\definecolor [lightyellow2] [r=.933333,g=.933333,b=.819608]
+\definecolor [lightyellow3] [r=.803922,g=.803922,b=.705882]
+\definecolor [lightyellow4] [r=.545098,g=.545098,b=.478431]
+\definecolor [yellow1] [yellow]
+\definecolor [yellow2] [r=.933333,g=.933333]
+\definecolor [yellow3] [r=.803922,g=.803922]
+\definecolor [yellow4] [r=.545098,g=.545098]
+\definecolor [gold1] [r=1,g=.843137]
+\definecolor [gold2] [r=.933333,g=.788235]
+\definecolor [gold3] [r=.803922,g=.678431]
+\definecolor [gold4] [r=.545098,g=.458824]
+\definecolor [goldenrod1] [r=1,g=.756863,b=.145098]
+\definecolor [goldenrod2] [r=.933333,g=.705882,b=.133333]
+\definecolor [goldenrod3] [r=.803922,g=.607843,b=.113725]
+\definecolor [goldenrod4] [r=.545098,g=.411765,b=.078431]
+\definecolor [darkgoldenrod1] [r=1,g=.72549,b=.058824]
+\definecolor [darkgoldenrod2] [r=.933333,g=.678431,b=.054902]
+\definecolor [darkgoldenrod3] [r=.803922,g=.584314,b=.047059]
+\definecolor [darkgoldenrod4] [r=.545098,g=.396078,b=.031373]
+\definecolor [rosybrown1] [r=1,g=.756863,b=.756863]
+\definecolor [rosybrown2] [r=.933333,g=.705882,b=.705882]
+\definecolor [rosybrown3] [r=.803922,g=.607843,b=.607843]
+\definecolor [rosybrown4] [r=.545098,g=.411765,b=.411765]
+\definecolor [indianred1] [r=1,g=.415686,b=.415686]
+\definecolor [indianred2] [r=.933333,g=.388235,b=.388235]
+\definecolor [indianred3] [r=.803922,g=.333333,b=.333333]
+\definecolor [indianred4] [r=.545098,g=.227451,b=.227451]
+\definecolor [sienna1] [r=1,g=.509804,b=.278431]
+\definecolor [sienna2] [r=.933333,g=.47451,b=.258824]
+\definecolor [sienna3] [r=.803922,g=.407843,b=.223529]
+\definecolor [sienna4] [r=.545098,g=.278431,b=.14902]
+\definecolor [burlywood1] [r=1,g=.827451,b=.607843]
+\definecolor [burlywood2] [r=.933333,g=.772549,b=.568627]
+\definecolor [burlywood3] [r=.803922,g=.666667,b=.490196]
+\definecolor [burlywood4] [r=.545098,g=.45098,b=.333333]
+\definecolor [wheat1] [r=1,g=.905882,b=.729412]
+\definecolor [wheat2] [r=.933333,g=.847059,b=.682353]
+\definecolor [wheat3] [r=.803922,g=.729412,b=.588235]
+\definecolor [wheat4] [r=.545098,g=.494118,b=.4]
+\definecolor [tan1] [r=1,g=.647059,b=.309804]
+\definecolor [tan2] [r=.933333,g=.603922,b=.286275]
+\definecolor [tan3] [r=.803922,g=.521569,b=.247059]
+\definecolor [tan4] [r=.545098,g=.352941,b=.168627]
+\definecolor [chocolate1] [r=1,g=.498039,b=.141176]
+\definecolor [chocolate2] [r=.933333,g=.462745,b=.129412]
+\definecolor [chocolate3] [r=.803922,g=.4,b=.113725]
+\definecolor [chocolate4] [r=.545098,g=.270588,b=.07451]
+\definecolor [firebrick1] [r=1,g=.188235,b=.188235]
+\definecolor [firebrick2] [r=.933333,g=.172549,b=.172549]
+\definecolor [firebrick3] [r=.803922,g=.14902,b=.14902]
+\definecolor [firebrick4] [r=.545098,g=.101961,b=.101961]
+\definecolor [brown1] [r=1,g=.25098,b=.25098]
+\definecolor [brown2] [r=.933333,g=.231373,b=.231373]
+\definecolor [brown3] [r=.803922,g=.2,b=.2]
+\definecolor [brown4] [r=.545098,g=.137255,b=.137255]
+\definecolor [salmon1] [r=1,g=.54902,b=.411765]
+\definecolor [salmon2] [r=.933333,g=.509804,b=.384314]
+\definecolor [salmon3] [r=.803922,g=.439216,b=.329412]
+\definecolor [salmon4] [r=.545098,g=.298039,b=.223529]
+\definecolor [lightsalmon1] [r=1,g=.627451,b=.478431]
+\definecolor [lightsalmon2] [r=.933333,g=.584314,b=.447059]
+\definecolor [lightsalmon3] [r=.803922,g=.505882,b=.384314]
+\definecolor [lightsalmon4] [r=.545098,g=.341176,b=.258824]
+\definecolor [orange1] [r=1,g=.647059]
+\definecolor [orange2] [r=.933333,g=.603922]
+\definecolor [orange3] [r=.803922,g=.521569]
+\definecolor [orange4] [r=.545098,g=.352941]
+\definecolor [darkorange1] [r=1,g=.498039]
+\definecolor [darkorange2] [r=.933333,g=.462745]
+\definecolor [darkorange3] [r=.803922,g=.4]
+\definecolor [darkorange4] [r=.545098,g=.270588]
+\definecolor [coral1] [r=1,g=.447059,b=.337255]
+\definecolor [coral2] [r=.933333,g=.415686,b=.313725]
+\definecolor [coral3] [r=.803922,g=.356863,b=.270588]
+\definecolor [coral4] [r=.545098,g=.243137,b=.184314]
+\definecolor [tomato1] [r=1,g=.388235,b=.278431]
+\definecolor [tomato2] [r=.933333,g=.360784,b=.258824]
+\definecolor [tomato3] [r=.803922,g=.309804,b=.223529]
+\definecolor [tomato4] [r=.545098,g=.211765,b=.14902]
+\definecolor [orangered1] [r=1,g=.270588]
+\definecolor [orangered2] [r=.933333,g=.25098]
+\definecolor [orangered3] [r=.803922,g=.215686]
+\definecolor [orangered4] [r=.545098,g=.145098]
+\definecolor [red1] [red]
+\definecolor [red2] [r=.933333]
+\definecolor [red3] [r=.803922]
+\definecolor [red4] [r=.545098]
+\definecolor [deeppink1] [r=1,g=.078431,b=.576471]
+\definecolor [deeppink2] [r=.933333,g=.070588,b=.537255]
+\definecolor [deeppink3] [r=.803922,g=.062745,b=.462745]
+\definecolor [deeppink4] [r=.545098,g=.039216,b=.313725]
+\definecolor [hotpink1] [r=1,g=.431373,b=.705882]
+\definecolor [hotpink2] [r=.933333,g=.415686,b=.654902]
+\definecolor [hotpink3] [r=.803922,g=.376471,b=.564706]
+\definecolor [hotpink4] [r=.545098,g=.227451,b=.384314]
+\definecolor [pink1] [r=1,g=.709804,b=.772549]
+\definecolor [pink2] [r=.933333,g=.662745,b=.721569]
+\definecolor [pink3] [r=.803922,g=.568627,b=.619608]
+\definecolor [pink4] [r=.545098,g=.388235,b=.423529]
+\definecolor [lightpink1] [r=1,g=.682353,b=.72549]
+\definecolor [lightpink2] [r=.933333,g=.635294,b=.678431]
+\definecolor [lightpink3] [r=.803922,g=.54902,b=.584314]
+\definecolor [lightpink4] [r=.545098,g=.372549,b=.396078]
+\definecolor [palevioletred1] [r=1,g=.509804,b=.670588]
+\definecolor [palevioletred2] [r=.933333,g=.47451,b=.623529]
+\definecolor [palevioletred3] [r=.803922,g=.407843,b=.537255]
+\definecolor [palevioletred4] [r=.545098,g=.278431,b=.364706]
+\definecolor [maroon1] [r=1,g=.203922,b=.701961]
+\definecolor [maroon2] [r=.933333,g=.188235,b=.654902]
+\definecolor [maroon3] [r=.803922,g=.160784,b=.564706]
+\definecolor [maroon4] [r=.545098,g=.109804,b=.384314]
+\definecolor [violetred1] [r=1,g=.243137,b=.588235]
+\definecolor [violetred2] [r=.933333,g=.227451,b=.54902]
+\definecolor [violetred3] [r=.803922,g=.196078,b=.470588]
+\definecolor [violetred4] [r=.545098,g=.133333,b=.321569]
+\definecolor [magenta1] [magenta]
+\definecolor [magenta2] [r=.933333,b=.933333]
+\definecolor [magenta3] [r=.803922,b=.803922]
+\definecolor [magenta4] [r=.545098,b=.545098]
+\definecolor [orchid1] [r=1,g=.513725,b=.980392]
+\definecolor [orchid2] [r=.933333,g=.478431,b=.913725]
+\definecolor [orchid3] [r=.803922,g=.411765,b=.788235]
+\definecolor [orchid4] [r=.545098,g=.278431,b=.537255]
+\definecolor [plum1] [r=1,g=.733333,b=1]
+\definecolor [plum2] [r=.933333,g=.682353,b=.933333]
+\definecolor [plum3] [r=.803922,g=.588235,b=.803922]
+\definecolor [plum4] [r=.545098,g=.4,b=.545098]
+\definecolor [mediumorchid1] [r=.878431,g=.4,b=1]
+\definecolor [mediumorchid2] [r=.819608,g=.372549,b=.933333]
+\definecolor [mediumorchid3] [r=.705882,g=.321569,b=.803922]
+\definecolor [mediumorchid4] [r=.478431,g=.215686,b=.545098]
+\definecolor [darkorchid1] [r=.74902,g=.243137,b=1]
+\definecolor [darkorchid2] [r=.698039,g=.227451,b=.933333]
+\definecolor [darkorchid3] [r=.603922,g=.196078,b=.803922]
+\definecolor [darkorchid4] [r=.407843,g=.133333,b=.545098]
+\definecolor [purple1] [r=.607843,g=.188235,b=1]
+\definecolor [purple2] [r=.568627,g=.172549,b=.933333]
+\definecolor [purple3] [r=.490196,g=.14902,b=.803922]
+\definecolor [purple4] [r=.333333,g=.101961,b=.545098]
+\definecolor [mediumpurple1] [r=.670588,g=.509804,b=1]
+\definecolor [mediumpurple2] [r=.623529,g=.47451,b=.933333]
+\definecolor [mediumpurple3] [r=.537255,g=.407843,b=.803922]
+\definecolor [mediumpurple4] [r=.364706,g=.278431,b=.545098]
+\definecolor [thistle1] [r=1,g=.882353,b=1]
+\definecolor [thistle2] [r=.933333,g=.823529,b=.933333]
+\definecolor [thistle3] [r=.803922,g=.709804,b=.803922]
+\definecolor [thistle4] [r=.545098,g=.482353,b=.545098]
+\definecolor [gray0] [black]
+\definecolor [gray1] [s=.01]
+\definecolor [gray2] [s=.02]
+\definecolor [gray3] [s=.03]
+\definecolor [gray4] [s=.04]
+\definecolor [gray5] [s=.05]
+\definecolor [gray6] [s=.06]
+\definecolor [gray7] [s=.07]
+\definecolor [gray8] [s=.08]
+\definecolor [gray9] [s=.09]
+\definecolor [gray10] [s=.1]
+\definecolor [gray11] [s=.11]
+\definecolor [gray12] [s=.12]
+\definecolor [gray13] [s=.13]
+\definecolor [gray14] [s=.14]
+\definecolor [gray15] [s=.15]
+\definecolor [gray16] [s=.16]
+\definecolor [gray17] [s=.17]
+\definecolor [gray18] [s=.18]
+\definecolor [gray19] [s=.19]
+\definecolor [gray20] [s=.2]
+\definecolor [gray21] [s=.21]
+\definecolor [gray22] [s=.22]
+\definecolor [gray23] [s=.23]
+\definecolor [gray24] [s=.24]
+\definecolor [gray25] [s=.25]
+\definecolor [gray26] [s=.26]
+\definecolor [gray27] [s=.27]
+\definecolor [gray28] [s=.28]
+\definecolor [gray29] [s=.29]
+\definecolor [gray30] [s=.3]
+\definecolor [gray31] [s=.31]
+\definecolor [gray32] [s=.32]
+\definecolor [gray33] [s=.33]
+\definecolor [gray34] [s=.34]
+\definecolor [gray35] [s=.35]
+\definecolor [gray36] [s=.36]
+\definecolor [gray37] [s=.37]
+\definecolor [gray38] [s=.38]
+\definecolor [gray39] [s=.39]
+\definecolor [gray40] [s=.4]
+\definecolor [gray41] [s=.41]
+\definecolor [gray42] [s=.42]
+\definecolor [gray43] [s=.43]
+\definecolor [gray44] [s=.44]
+\definecolor [gray45] [s=.45]
+\definecolor [gray46] [s=.46]
+\definecolor [gray47] [s=.47]
+\definecolor [gray48] [s=.48]
+\definecolor [gray49] [s=.49]
+\definecolor [gray50] [s=.5]
+\definecolor [gray51] [s=.51]
+\definecolor [gray52] [s=.52]
+\definecolor [gray53] [s=.53]
+\definecolor [gray54] [s=.54]
+\definecolor [gray55] [s=.55]
+\definecolor [gray56] [s=.56]
+\definecolor [gray57] [s=.57]
+\definecolor [gray58] [s=.58]
+\definecolor [gray59] [s=.59]
+\definecolor [gray60] [s=.6]
+\definecolor [gray61] [s=.61]
+\definecolor [gray62] [s=.62]
+\definecolor [gray63] [s=.63]
+\definecolor [gray64] [s=.64]
+\definecolor [gray65] [s=.65]
+\definecolor [gray66] [s=.66]
+\definecolor [gray67] [s=.67]
+\definecolor [gray68] [s=.68]
+\definecolor [gray69] [s=.69]
+\definecolor [gray70] [s=.7]
+\definecolor [gray71] [s=.71]
+\definecolor [gray72] [s=.72]
+\definecolor [gray73] [s=.73]
+\definecolor [gray74] [s=.74]
+\definecolor [gray75] [s=.75]
+\definecolor [gray76] [s=.76]
+\definecolor [gray77] [s=.77]
+\definecolor [gray78] [s=.78]
+\definecolor [gray79] [s=.79]
+\definecolor [gray80] [s=.8]
+\definecolor [gray81] [s=.81]
+\definecolor [gray82] [s=.82]
+\definecolor [gray83] [s=.83]
+\definecolor [gray84] [s=.84]
+\definecolor [gray85] [s=.85]
+\definecolor [gray86] [s=.86]
+\definecolor [gray87] [s=.87]
+\definecolor [gray88] [s=.88]
+\definecolor [gray89] [s=.89]
+\definecolor [gray90] [s=.9]
+\definecolor [gray91] [s=.91]
+\definecolor [gray92] [s=.92]
+\definecolor [gray93] [s=.93]
+\definecolor [gray94] [s=.94]
+\definecolor [gray95] [s=.95]
+\definecolor [gray96] [s=.96]
+\definecolor [gray97] [s=.97]
+\definecolor [gray98] [s=.98]
+\definecolor [gray99] [s=.99]
+\definecolor [gray100] [white]
+\definecolor [darkgray] [s=.662745]
+\definecolor [darkblue] [b=.545098]
+\definecolor [darkcyan] [g=.545098,b=.545098]
+\definecolor [darkmagenta] [r=.545098,b=.545098]
+\definecolor [darkred] [r=.545098]
+\definecolor [lightgreen] [r=.564706,g=.933333,b=.564706]
diff --git a/tex/context/base/colo-rgb.tex b/tex/context/base/colo-imp-rgb.mkiv
index 038e0ab0b..038e0ab0b 100644
--- a/tex/context/base/colo-rgb.tex
+++ b/tex/context/base/colo-imp-rgb.mkiv
diff --git a/tex/context/base/colo-run.tex b/tex/context/base/colo-imp-run.mkiv
index d94ea9801..d94ea9801 100644
--- a/tex/context/base/colo-run.tex
+++ b/tex/context/base/colo-imp-run.mkiv
diff --git a/tex/context/base/colo-x11.tex b/tex/context/base/colo-imp-x11.mkiv
index 45d3aac62..45d3aac62 100644
--- a/tex/context/base/colo-x11.tex
+++ b/tex/context/base/colo-imp-x11.mkiv
diff --git a/tex/context/base/colo-xwi.tex b/tex/context/base/colo-imp-xwi.mkiv
index 81e09d871..81e09d871 100644
--- a/tex/context/base/colo-xwi.tex
+++ b/tex/context/base/colo-imp-xwi.mkiv
diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua
index b12e383c6..6f4c73336 100644
--- a/tex/context/base/colo-ini.lua
+++ b/tex/context/base/colo-ini.lua
@@ -590,6 +590,21 @@ function colors.defineintermediatecolor(name,fraction,c_one,c_two,a_one,a_two,sp
end
end
+-- for the moment downward compatible
+
+local patterns = { "colo-imp-%s.mkiv", "colo-imp-%s.tex", "colo-%s.mkiv", "colo-%s.tex" }
+
+function colors.usecolors(name)
+ commands.uselibrary(name,patterns,function(name,foundname)
+ context.startreadingfile()
+ context.input(foundname)
+ context.showcolormessage("colors",4,name)
+ context.stopreadingfile()
+ end, function(name)
+ context.showcolormessage("colors",5,name)
+ end)
+end
+
-- interface
local setcolormodel = colors.setmodel
@@ -632,3 +647,4 @@ function commands.doifdrawingblackelse()
commands.doifelse(colors.isblack(gettexattribute(a_color)))
end
+commands.usecolors = colors.usecolors
diff --git a/tex/context/base/colo-ini.mkii b/tex/context/base/colo-ini.mkii
index 2d2a7bdaa..484a085fe 100644
--- a/tex/context/base/colo-ini.mkii
+++ b/tex/context/base/colo-ini.mkii
@@ -271,9 +271,11 @@
\def\dodosetupcolor#1%
{\makeshortfilename[\truefilename{\f!colorprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename
+ \readsysfile{\shortfilename.\mksuffix}
{\showmessage\m!colors4\colorstyle}
- {\showmessage\m!colors5\colorstyle}%
+ {\readsysfile{\shortfilename.tex}
+ {\showmessage\m!colors4\colorstyle}
+ {\showmessage\m!colors5\colorstyle}}%
\stopreadingfile}
\let\usecolors\setupcolor
diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv
index 3b84634d2..3818ea37b 100644
--- a/tex/context/base/colo-ini.mkiv
+++ b/tex/context/base/colo-ini.mkiv
@@ -200,35 +200,18 @@
%D where \type{\f!colorprefix} is \unprotect {\tttf \f!colorprefix}.
%D Loading such a file is done by \protect
%D
-%D \showsetup{setupcolor}
+%D \showsetup{usecolors}
%D
%D Some default colors are specified in \type{colo-rgb.tex},
%D which is loaded into the format by:
%D
%D \starttyping
-%D \setupcolor[rgb]
+%D \usecolors[rgb]
%D \stoptyping
-\let\colorstyle\empty
+\unexpanded\def\usecolors[#1]{\ctxlua{commands.usecolors(\!!bs#1\!!es)}}
-\unexpanded\def\setupcolor
- {\dosingleargument\dosetupcolor}
-
-\def\dosetupcolor[#1]%
- {\doifnot{#1}\colorstyle
- {\def\colorstyle{#1}%
- \processcommalist[#1]\dodosetupcolor}}
-
-\def\dodosetupcolor#1% todo: mkii / mkiv
- {\startreadingfile
- \readsysfile{\truefilename{\f!colorprefix#1}}
- {\showcolormessage\m!colors4\colorstyle}
- {\showcolormessage\m!colors5\colorstyle}%
- \stopreadingfile}
-
-\let\usecolors\setupcolor
-
-% check: \startcolormode
+\let\setupcolor\usecolors
%D \macros
%D {definetransparency}
@@ -298,7 +281,7 @@
\fi\fi
\doifelse\@@clstate\v!stop
{\incolorfalse\forcegrayMPcolorstrue}%
- {\ifincolor\else\showcolormessage\m!colors1\colorstyle\fi\incolortrue\let\@@clstate\v!start}%
+ {\incolortrue\let\@@clstate\v!start}%
\dosetupcolormodel
\the\everysetupcolors}
diff --git a/tex/context/base/colo-rgb.mkii b/tex/context/base/colo-rgb.mkii
new file mode 100644
index 000000000..038e0ab0b
--- /dev/null
+++ b/tex/context/base/colo-rgb.mkii
@@ -0,0 +1,530 @@
+%D \module
+%D [ file=colo-rgb,
+%D version=1995.01.01,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=RGB,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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 Just to give users a start we define some colors. While
+%D switching fonts is as international as can be, thanks to the
+%D mnemonics, naming colors is very interface dependant. To
+%D support international setups, we define both english and
+%D interface dependant colors. We use the color inheritance
+%D mechanisms to implement the interface dependant ones.
+
+%D First we define some simple primary \cap{RGB} and \cap{CMYK}
+%D colors. All colors are defined in \cap{RGB} color space.
+
+\definecolor [red] [r=1, g=0, b=0]
+\definecolor [green] [r=0, g=1, b=0]
+\definecolor [blue] [r=0, g=0, b=1]
+
+\definecolor [cyan] [r=0, g=1, b=1]
+\definecolor [magenta] [r=1, g=0, b=1]
+\definecolor [yellow] [r=1, g=1, b=0]
+
+\definecolor [white] [s=1] % [r=1, g=1, b=1]
+\definecolor [black] [s=0]
+\definecolor [gray] [s=.9]
+
+\definecolor [darkred] [r=.8, g=0, b=0]
+\definecolor [middlered] [r=.9, g=0, b=0]
+\definecolor [lightred] [r=1, g=0, b=0]
+
+\definecolor [darkgreen] [r=0, g=.6, b=0]
+\definecolor [middlegreen] [r=0, g=.8, b=0]
+\definecolor [lightgreen] [r=0, g=1, b=0]
+
+\definecolor [darkblue] [r=0, g=0, b=.8]
+\definecolor [middleblue] [r=0, g=0, b=.9]
+\definecolor [lightblue] [r=0, g=0, b=1]
+
+\definecolor [darkcyan] [r=.6, g=.8, b=.8]
+\definecolor [middlecyan] [r=0, g=.8, b=.8]
+
+\definecolor [darkmagenta] [r=.8, g=.6, b=.8]
+\definecolor [middlemagenta] [r=1, g=0, b=.6]
+
+\definecolor [darkyellow] [r=.8, g=.8, b=.6]
+\definecolor [middleyellow] [r=1, g=1, b=.2]
+
+\definecolor [darkgray] [s=.5]
+\definecolor [middlegray] [s=.7]
+\definecolor [lightgray] [s=.9]
+
+%D These colors are mapped to interface dependant colornames.
+
+\startinterface dutch
+
+ \definecolor [rood] [red]
+ \definecolor [groen] [green]
+ \definecolor [blauw] [blue]
+
+ \definecolor [cyaan] [cyan]
+ \definecolor [magenta] [magenta]
+ \definecolor [geel] [yellow]
+
+ \definecolor [wit] [white]
+ \definecolor [grijs] [gray]
+ \definecolor [zwart] [black]
+
+ \definecolor [donkerrood] [darkred]
+ \definecolor [middelrood] [middlered]
+ \definecolor [lichtrood] [lightred]
+
+ \definecolor [donkergroen] [darkgreen]
+ \definecolor [middelgroen] [middlegreen]
+ \definecolor [lichtgroen] [lightgreen]
+
+ \definecolor [donkerblauw] [darkblue]
+ \definecolor [middelblauw] [middleblue]
+ \definecolor [lichtblauw] [lightblue]
+
+ \definecolor [donkercyaan] [darkcyan]
+ \definecolor [middelcyaan] [middlecyan]
+
+ \definecolor [donkermagenta] [darkmagenta]
+ \definecolor [middelmagenta] [middlemagenta]
+
+ \definecolor [donkergeel] [darkyellow]
+ \definecolor [middelgeel] [middleyellow]
+
+ \definecolor [donkergrijs] [darkgray]
+ \definecolor [middengrijs] [middlegray]
+ \definecolor [lichtgrijs] [lightgray]
+
+\stopinterface
+
+\startinterface german
+
+ \definecolor [rot] [red]
+ \definecolor [gruen] [green]
+ \definecolor [blau] [blue]
+
+ \definecolor [cyan] [cyan]
+ \definecolor [magenta] [magenta]
+ \definecolor [gelb] [yellow]
+
+ \definecolor [weiss] [white]
+ \definecolor [grau] [gray]
+ \definecolor [schwarz] [black]
+
+ \definecolor [dunkelrot] [darkred]
+ \definecolor [mittelrot] [middlered]
+ \definecolor [hellrot] [lightred]
+
+ \definecolor [dunkelgruen] [darkgreen]
+ \definecolor [mittelgruen] [middlegreen]
+ \definecolor [hellgruen] [lightgreen]
+
+ \definecolor [dunkelblau] [darkblue]
+ \definecolor [mittelblau] [middleblue]
+ \definecolor [hellblau] [lightblue]
+
+ \definecolor [dunkelcyan] [darkcyan]
+ \definecolor [mittelcyan] [middlecyan]
+
+ \definecolor [dunkelmagenta] [darkmagenta]
+ \definecolor [mittelmagenta] [middlemagenta]
+
+ \definecolor [dunkelgelb] [darkyellow]
+ \definecolor [mittelgelb] [middleyellow]
+
+ \definecolor [dunkelgrau] [darkgray]
+ \definecolor [mittelgrau] [middlegray]
+ \definecolor [hellgrau] [lightgray]
+
+\stopinterface
+
+\startinterface czech
+
+ \definecolor [cervena] [red]
+ \definecolor [zelena] [green]
+ \definecolor [modra] [blue]
+
+ \definecolor [azurova] [cyan]
+ \definecolor [fialova] [magenta]
+ \definecolor [zluta] [yellow]
+
+ \definecolor [bila] [white]
+ \definecolor [cerna] [black]
+
+ \definecolor [tmavecervena] [darkred]
+ \definecolor [strednecervena] [middlered]
+ \definecolor [svetlecervena] [lightred]
+
+ \definecolor [tmavezelena] [darkgreen]
+ \definecolor [strednezelena] [middlegreen]
+ \definecolor [svetlezelena] [lightgreen]
+
+ \definecolor [tmavemodra] [darkblue]
+ \definecolor [strednemodra] [middleblue]
+ \definecolor [svetlemodra] [lightblue]
+
+ \definecolor [tmaveazurova] [darkcyan]
+ \definecolor [stredneazurova] [middlecyan]
+
+ \definecolor [tmavefialova] [darkmagenta]
+ \definecolor [strednefialova] [middlemagenta]
+
+ \definecolor [tmavezluta] [darkyellow]
+ \definecolor [strednezluta] [middleyellow]
+
+ \definecolor [tmaveseda] [darkgray]
+ \definecolor [stredneseda] [middlegray]
+ \definecolor [svetleseda] [lightgray]
+
+\stopinterface
+
+\startinterface italian
+
+ \definecolor [rosso] [red]
+ \definecolor [verde] [green]
+ \definecolor [blu] [blue]
+
+ \definecolor [azzurro] [cyan]
+ \definecolor [turchino] [cyan]
+ \definecolor [ciano] [cyan]
+ \definecolor [cremisi] [magenta]
+ \definecolor [giallo] [yellow]
+
+ \definecolor [bianco] [white]
+ \definecolor [grigio] [gray]
+ \definecolor [nero] [black]
+
+ \definecolor [rossoscuro] [darkred]
+ \definecolor [rossomedio] [middlered]
+ \definecolor [rossochiaro] [lightred]
+
+ \definecolor [verdescuro] [darkgreen]
+ \definecolor [verdemedio] [middlegreen]
+ \definecolor [verdechiaro] [lightgreen]
+
+ \definecolor [bluscuro] [darkblue]
+ \definecolor [blumedio] [middleblue]
+ \definecolor [bluchiaro] [lightblue]
+
+ \definecolor [azzurroscuro] [darkcyan]
+ \definecolor [azzurrochiaro] [middlecyan]
+
+ \definecolor [cremisiscuro] [darkmagenta]
+ \definecolor [cremisichiaro] [middlemagenta]
+
+
+ \definecolor [gialloscuro] [darkyellow]
+ \definecolor [giallomedio] [middleyellow]
+
+ \definecolor [grigioscuro] [darkgray]
+ \definecolor [grigiomedio] [middlegray]
+ \definecolor [grigiochiaro] [lightgray]
+
+\stopinterface
+
+\startinterface romanian
+
+ \definecolor [rosu] [red]
+ \definecolor [verde] [green]
+ \definecolor [albastru] [blue]
+
+ \definecolor [cian] [cyan]
+ \definecolor [magenta] [magenta]
+ \definecolor [galben] [yellow]
+
+ \definecolor [alb] [white]
+ \definecolor [gri] [gray]
+ \definecolor [negru] [black]
+
+ \definecolor [rosuinchis] [darkred]
+ \definecolor [rosumediu] [middlered]
+ \definecolor [rosudeschis] [lightred]
+
+ \definecolor [verdeinchis] [darkgreen]
+ \definecolor [verdemediu] [middlegreen]
+ \definecolor [verdedeschis] [lightgreen]
+
+ \definecolor [albastruinchis] [darkblue]
+ \definecolor [albastrumediu] [middleblue]
+ \definecolor [albastrudeschis] [lightblue]
+
+ \definecolor [cianinchis] [darkcyan]
+ \definecolor [cianmediu] [middlecyan]
+
+ \definecolor [magentainchis] [darkmagenta]
+ \definecolor [magentamediu] [middlemagenta]
+
+ \definecolor [galbeninchis] [darkyellow]
+ \definecolor [galbenmediu] [middleyellow]
+
+ \definecolor [griinchis] [darkgray]
+ \definecolor [grimediu] [middlegray]
+ \definecolor [grideschis] [lightgray]
+
+\stopinterface
+
+%D Like colors, we first define the english colorgroups. These
+%D colorgroups are tuned for distinctive gray scale printing.
+
+% todo : more efficient and real gray
+
+\definecolorgroup
+ [gray]
+ [0.95:0.95:0.95,
+ 0.90:0.90:0.90,
+ 0.80:0.80:0.80,
+ 0.70:0.70:0.70,
+ 0.60:0.60:0.60,
+ 0.50:0.50:0.50,
+ 0.40:0.40:0.40,
+ 0.30:0.30:0.30,
+ 0.20:0.20:0.20,
+ 0.10:0.10:0.10,
+ 0.00:0.00:0.00]
+
+\definecolorgroup
+ [red]
+ [1.00:0.90:0.90,
+ 1.00:0.80:0.80,
+ 1.00:0.70:0.70,
+ 1.00:0.55:0.55,
+ 1.00:0.40:0.40,
+ 1.00:0.25:0.25,
+ 1.00:0.15:0.15,
+ 0.90:0.00:0.00]
+
+\definecolorgroup
+ [green]
+ [0.90:1.00:0.90,
+ 0.70:1.00:0.70,
+ 0.50:1.00:0.50,
+ 0.30:1.00:0.30,
+ 0.15:0.90:0.15,
+ 0.00:0.80:0.00,
+ 0.00:0.65:0.00,
+ 0.00:0.50:0.00]
+
+\definecolorgroup
+ [blue]
+ [0.90:0.95:1.00,
+ 0.80:0.90:1.00,
+ 0.55:0.85:1.00,
+ 0.30:0.80:1.00,
+ 0.15:0.75:1.00,
+ 0.00:0.70:1.00,
+ 0.00:0.55:1.00,
+ 0.00:0.40:1.00]
+
+\definecolorgroup
+ [cyan]
+ [0.80:1.00:1.00,
+ 0.60:1.00:1.00,
+ 0.30:1.00:1.00,
+ 0.00:0.95:0.95,
+ 0.00:0.85:0.85,
+ 0.00:0.75:0.75,
+ 0.00:0.60:0.60,
+ 0.00:0.50:0.50]
+
+\definecolorgroup
+ [magenta]
+ [1.00:0.90:1.00,
+ 1.00:0.80:1.00,
+ 1.00:0.65:1.00,
+ 1.00:0.50:1.00,
+ 1.00:0.35:1.00,
+ 1.00:0.15:1.00,
+ 0.90:0.05:0.90,
+ 0.80:0.00:0.80]
+
+\definecolorgroup
+ [yellow]
+ [1.00:1.00:0.70,
+ 1.00:1.00:0.00,
+ 1.00:0.85:0.05,
+ 1.00:0.70:0.00,
+ 1.00:0.55:0.00,
+ 0.95:0.40:0.00,
+ 0.80:0.30:0.00,
+ 0.60:0.30:0.00]
+
+\definecolorgroup
+ [red*]
+ [1.00:0.95:0.95,
+ 1.00:0.90:0.90,
+ 1.00:0.80:0.80,
+ 1.00:0.70:0.70,
+ 1.00:0.60:0.60,
+ 1.00:0.50:0.50,
+ 1.00:0.40:0.40,
+ 1.00:0.30:0.30]
+
+\definecolorgroup
+ [green*]
+ [0.95:1.00:0.95,
+ 0.90:1.00:0.90,
+ 0.80:1.00:0.80,
+ 0.70:1.00:0.70,
+ 0.60:1.00:0.60,
+ 0.50:1.00:0.50,
+ 0.40:1.00:0.40,
+ 0.30:1.00:0.30]
+
+\definecolorgroup
+ [blue*]
+ [0.95:0.95:1.00,
+ 0.90:0.90:1.00,
+ 0.80:0.80:1.00,
+ 0.70:0.70:1.00,
+ 0.60:0.60:1.00,
+ 0.50:0.50:1.00,
+ 0.40:0.40:1.00,
+ 0.30:0.30:1.00]
+
+\definecolorgroup
+ [yellow*]
+ [1.00:1.00:0.10,
+ 1.00:1.00:0.00,
+ 0.90:0.90:0.00,
+ 0.80:0.80:0.00,
+ 0.70:0.70:0.00,
+ 0.60:0.60:0.00,
+ 0.50:0.50:0.00,
+ 0.40:0.40:0.00]
+
+%D For the sake of implementing interface dependant color
+%D groups we support colorgroup duplication.
+
+\startinterface dutch
+ \definecolorgroup [grijs] [gray]
+ \definecolorgroup [rood] [red]
+ \definecolorgroup [groen] [green]
+ \definecolorgroup [blauw] [blue]
+ \definecolorgroup [cyaan] [cyan]
+ \definecolorgroup [magenta] [magenta]
+ \definecolorgroup [geel] [yellow]
+ \definecolorgroup [rood*] [red*]
+ \definecolorgroup [groen*] [green*]
+ \definecolorgroup [blauw*] [blue*]
+ \definecolorgroup [geel*] [yellow*]
+\stopinterface
+
+\startinterface german
+ \definecolorgroup [grau] [gray]
+ \definecolorgroup [rot] [red]
+ \definecolorgroup [gruen] [green]
+ \definecolorgroup [blau] [blue]
+ \definecolorgroup [cyan] [cyan]
+ \definecolorgroup [magenta] [magenta]
+ \definecolorgroup [gelb] [yellow]
+ \definecolorgroup [rot*] [red*]
+ \definecolorgroup [gruen*] [green*]
+ \definecolorgroup [blau*] [blue*]
+ \definecolorgroup [gelb*] [yellow*]
+\stopinterface
+
+\startinterface czech
+ \definecolorgroup [seda] [gray]
+ \definecolorgroup [cervena] [red]
+ \definecolorgroup [zelena] [green]
+ \definecolorgroup [modra] [blue]
+ \definecolorgroup [azurova] [cyan]
+ \definecolorgroup [fialova] [magenta]
+ \definecolorgroup [zluta] [yellow]
+ \definecolorgroup [cervena*] [red*]
+ \definecolorgroup [zelena*] [green*]
+ \definecolorgroup [modra*] [blue*]
+ \definecolorgroup [zluta*] [yellow*]
+\stopinterface
+
+\startinterface italian
+ \definecolorgroup [grigio] [gray]
+ \definecolorgroup [rosso] [red]
+ \definecolorgroup [verde] [green]
+ \definecolorgroup [blu] [blue]
+ \definecolorgroup [ciano] [cyan]
+ \definecolorgroup [azzurro] [cyan]
+ \definecolorgroup [turchino][cyan]
+ \definecolorgroup [magenta] [magenta]
+ \definecolorgroup [cremisi] [magenta]
+ \definecolorgroup [giallo] [yellow]
+ \definecolorgroup [rosso*] [red*]
+ \definecolorgroup [verde*] [green*]
+ \definecolorgroup [blu*] [blue*]
+ \definecolorgroup [giallo*] [yellow*]
+\stopinterface
+
+%D The next set of color palets is quite language independant.
+%D These palets are meant as examples.
+
+\definepalet
+ [alfa]
+ [ top=red:7,
+ bottom=green:6,
+ up=blue:5,
+ down=cyan:4,
+ strange=magenta:3,
+ charm=yellow:2]
+
+\definepalet
+ [beta]
+ [ top=red:7,
+ bottom=green:5,
+ up=blue:3,
+ down=cyan:6,
+ strange=magenta:2,
+ charm=yellow:1]
+
+\definepalet
+ [gamma]
+ [ top=red:2,
+ bottom=green:5,
+ up=blue:3,
+ down=cyan:6,
+ strange=magenta:7,
+ charm=yellow:4]
+
+\definepalet
+ [delta]
+ [ top=yellow*:5,
+ bottom=yellow*:3,
+ up=yellow*:2,
+ down=magenta:6,
+ strange=blue:4,
+ charm=blue:1]
+
+\definepalet
+ [epsilon]
+ [ top=cyan:7,
+ bottom=cyan:5,
+ up=blue:3,
+ down=yellow:6,
+ strange=yellow:4,
+ charm=yellow:2]
+
+\definepalet
+ [zeta]
+ [ top=red:6,
+ bottom=green:5,
+ up=blue:7,
+ down=cyan:4,
+ strange=magenta:3,
+ charm=yellow:2]
+
+%D The next four colors are used for typesetting verbatim \TEX\
+%D in color.
+
+\definecolor [texcolorone] [middlered]
+\definecolor [texcolortwo] [middlegreen]
+\definecolor [texcolorthree] [middleblue]
+\definecolor [texcolorfour] [darkyellow]
+
+%D Bonus (needed for FO test):
+
+\definecolor [orange] [r=1,g=.5]
+
+\endinput
diff --git a/tex/context/base/colo-run.mkii b/tex/context/base/colo-run.mkii
new file mode 100644
index 000000000..d94ea9801
--- /dev/null
+++ b/tex/context/base/colo-run.mkii
@@ -0,0 +1,257 @@
+%D \module
+%D [ file=colo-run,
+%D version=1997.04.01,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=Runtime loaded commands,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+% temp hack (not do be documented)
+
+% \gdef\doformatcolorP#1:#2:#3:#4:#5:#6\od % was undefined in colo-ini
+% {#1\colorformatseparator
+% \dodoformatcolor{#2}\colorformatseparator
+% \dodoformatcolor{#3}\colorformatseparator
+% \dodoformatcolor{#4}\colorformatseparator}
+
+% \gdef\doformatgrayP#1:#2:#3:#4:#5:#6\od
+% {todo}
+
+% so far
+
+\gdef\showpalet
+ {\dodoubleargument\doshowpalet}
+
+\gdef\doshowpalet[#1][#2]%
+ {\doifdefined{\??pa#1}
+ {\doifinsetelse\v!vertical{#2}
+ {\showverticalpalet[#1][#2]}
+ {\showhorizontalpalet[#1][#2]}}}
+
+\gdef\showverticalpalet[#1][#2]%
+ {\localvbox
+ {\offinterlineskip
+ \setuppalet[#1]
+ \def\rule
+ {\vrule\!!width3em\!!height\strutht\!!depth\strutdp}
+ \tabskip\zeropoint
+ \def\doshowpalet##1%
+ {\doifinsetelse\v!number{#2}{##1\hskip.5em}{}&
+ \color[##1]{\rule}\graycolor[##1]{\rule}&
+ \doifinset\v!value{#2}{\hskip.5em\colorvalue{##1}}\crcr}
+ \halign
+ {\hss##&\hss##\hss&##\cr
+ &\doifinset{\v!name}{#2}{\strut#1}&\cr%
+ \processpalet[#1]\doshowpalet\crcr}}}
+
+\gdef\showhorizontalpalet[#1][#2]%
+ {\localvbox
+ {\offinterlineskip
+ \setuppalet[#1]
+ \tabskip\zeropoint
+ \!!widtha\zeropoint
+ \doifinset\v!number{#2}
+ {\def\doshowpalet##1%
+ {\setbox0\hbox{##1}%
+ \ifdim\!!widtha<\wd0\!!widtha\wd0\fi}%
+ \processpalet[#1]\doshowpalet}%
+ \advance\!!widtha 1em
+ \ifdim\!!widtha<5em
+ \!!widtha5em
+ \fi
+ \halign
+ {##&&\hbox to \!!widtha{\hss##\hss}\cr
+ \doifinset\v!number{#2}
+ {\def\doshowpalet##1{&\strut##1}%
+ \processpalet[#1]\doshowpalet}\cr
+ \doifinset\v!name{#2}{#1\hskip.5em}%
+ \def\doshowpalet##1%
+ {&\strut\color[##1]{\vrule\!!width\!!widtha\!!height\strutht\!!depth\zeropoint}}%
+ \processpalet[#1]\doshowpalet\crcr
+ \noalign{\vskip-\strutdepth}%
+ \def\doshowpalet##1%
+ {&\graycolor[##1]{\vrule\!!width\!!widtha\!!height\zeropoint\!!depth\strutdp}}%
+ \processpalet[#1]\doshowpalet\crcr
+ \doifinset\v!value{#2}
+ {\def\doshowpalet##1%
+ {&\vbox
+ {\hsize\!!widtha
+ \vskip.25ex
+ \everypar{\strut}
+ \veryraggedcenter
+ \let\colorformatseparator=\endgraf
+ \colorvalue{##1}}}%
+ \processpalet[#1]\doshowpalet}%
+ \crcr}}}
+
+\gdef\processpalet[#1]%
+ {\expanded{\globalprocesscommalist[\getvalue{\??pa#1}]}}
+
+\gdef\showcolorgroup
+ {\dodoubleargument\doshowcolorgroup}
+
+\gdef\doshowcolorgroup[#1][#2]%
+ {\doifcolor{#1:1}
+ {\doifinsetelse\v!vertical{#2}
+ {\showverticalcolorgroup[#1][#2]}
+ {\showhorizontalcolorgroup[#1][#2]}}}
+
+\gdef\showhorizontalcolorgroup[#1][#2]%
+ {\localvbox
+ {\offinterlineskip
+ \setuppalet
+ \tabskip\zeropoint
+ \def\rule
+ {\vrule\!!width4em\!!height\strutht\!!depth\strutdp}
+ \def\colorformatseparator{\strut\cr}
+ \def\dodoshowgroup##1%
+ {\halign
+ {\hss####\hss\cr
+ \doifinset\v!number{#2}{\strut##1}\cr
+ \color[#1:##1]{\vrule\!!width4em\!!height\strutht\!!depth\zeropoint}\cr
+ \graycolor[#1:##1]{\vrule\!!width4em\!!height\zeropoint\!!depth\strutdp}\cr
+ \doifinset\v!value{#2}{\colorvalue{#1:##1}\strut}\crcr}}
+ \def\doshowgroup##1%
+ {\doifcolor{#1:##1}
+ {\vbox{\dodoshowgroup{##1}}}}%
+ \hbox
+ {\doifinset\v!name{#2}
+ {\strut
+ \doifinsetelse\v!value{#2}
+ {\raise3\lineheight\hbox{#1\hskip.5em}}
+ {#1}%
+ \hskip.5em}%
+ \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4%
+ \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}}
+
+\gdef\showverticalcolorgroup[#1][#2]%
+ {\localvbox
+ {\offinterlineskip
+ \setuppalet
+ \tabskip\zeropoint
+ \def\rule
+ {\vrule\!!width2.5em\!!height\strutht\!!depth\strutdp}%
+ \def\doshowgroup##1%
+ {\doifcolor{#1:##1}
+ {\doifinset\v!number{#2}{##1\hskip.5em}&
+ \color[#1:##1]{\rule}\graycolor[#1:##1]{\rule}&
+ \doifinset\v!value{#2}{\hskip.5em\colorvalue{#1:##1}}\crcr}}%
+ \halign
+ {\hss##&\hss##\hss&##\hss\cr
+ &\doifinset\v!name{#2}{\strut#1}&\crcr
+ \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4%
+ \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}}
+
+\gdef\showcolor
+ {\dosingleempty\doshowcolor}
+
+\gdef\doshowcolor[#1]%
+ {\bgroup
+ \iffirstargument
+ \let\colorlist\empty % not really used, only for colo-run
+ \let\colorstyle\empty
+ \settrue\collectcolorsinlist
+ \setupcolor[#1]%
+ \fi
+ \def\rule
+ {\vrule\!!width4em\!!height\strutht\!!depth\strutdp}%
+ \def\docommand##1%
+ {\NC\graycolor[##1]{\rule}\NC\color[##1]{\rule}\NC\grayvalue{##1}\NC\colorvalue{##1}\NC##1\NC\NR}%
+ \starttabulate[|l|l|l|l|l|l|l|]
+ \expanded{\globalprocesscommalist[\colorlist]}\docommand
+ \stoptabulate
+ \egroup}
+
+\gdef\comparepalet
+ {\dosingleargument\docomparepalet}
+
+\gdef\docomparepalet[#1]%
+ {\doifdefined{\??pa#1}
+ {\hbox
+ {\dodocomparepalet\color[#1]%
+ \quad
+ \dodocomparepalet\graycolor[#1]}}}
+
+\gdef\dodocomparepalet#1[#2]%
+ {\localvbox
+ {\offinterlineskip
+ \setuppalet[#2]
+ \getcommacommandsize[\getvalue{\??pa#2}]
+ \!!widtha2em\relax
+ \hsize\commalistsize\!!widtha
+ \def\rule%
+ {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex}
+ \def\dododocomparepalet##1%
+ {\hbox
+ {\setbox0\hbox
+ {#1[##1]{\vrule\!!width\hsize\!!height3ex}}%
+ \wd0\zeropoint
+ \box0
+ \hbox to \hsize
+ {\def\dododocomparepalet####1%
+ {\hbox to \!!widtha
+ {\hss#1[####1]{\rule}\hss}}%
+ \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}}
+ \endgraf}
+ \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}}
+
+\gdef\comparecolorgroup
+ {\dosingleargument\docomparecolorgroup}
+
+\gdef\docomparecolorgroup[#1]%
+ {\doifcolor{#1:1}
+ {\hbox
+ {\dodocomparecolorgroup\color[#1]%
+ \quad
+ \dodocomparecolorgroup\graycolor[#1]}}}
+
+\gdef\dodocomparecolorgroup#1[#2]%
+ {\localvbox
+ {\!!counta\zerocount
+ \dorecurse{15}
+ {\doifcolor{#2:\recurselevel}{\advance\!!counta\plusone}}
+ \!!widtha2em\relax
+ \hsize\!!counta\!!widtha
+ \def\rule
+ {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex}
+ \def\dododocomparecolorgroup##1%
+ {\hbox to \hsize
+ {\setbox0\hbox
+ {#1[#2:##1]{\vrule\!!width\hsize\!!height3ex}}%
+ \wd0\zeropoint
+ \box0
+ \hbox to \hsize
+ {\hss\dorecurse\!!counta{#1[#2:\recurselevel]{\rule}\hss}}}
+ \endgraf}
+ \dorecurse\!!counta{\dododocomparecolorgroup\recurselevel}}}
+
+\gdef\dogetcolorcomponents#1%
+ {\doifelsenothing{#1}
+ {\appendtoks
+ \TB
+ \to \scratchtoks}
+ {\appendtoks
+ \NC\showcolorbar[#1]\NC#1\NC\transparencycomponents{#1}\NC\colorcomponents{#1}\NC \NR
+ \to \scratchtoks}}
+
+\gdef\showcolorbar[#1]%
+ {\backgroundline[#1]{\strut\enspace\color[white]{white}\enspace\color[black]{black}\enspace}}
+
+\gdef\showcolorcomponents[#1]%
+ {\begingroup
+ \scratchtoks{\TB}%
+ \processcommacommand[#1]\dogetcolorcomponents
+ \starttabulate[|lT|lT|lT|lT|]
+ \NC color \NC name \NC transparency \NC specification \NC\NR
+ \the\scratchtoks
+ \stoptabulate
+ \endgroup}
+
+\protect \endinput
diff --git a/tex/context/base/colo-x11.mkii b/tex/context/base/colo-x11.mkii
new file mode 100644
index 000000000..45d3aac62
--- /dev/null
+++ b/tex/context/base/colo-x11.mkii
@@ -0,0 +1,677 @@
+%D \module
+%D [ file=colo-x11,
+%D version=2009.11.13,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=X11,
+%D author=Alan Braslau]
+%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 Standard X11 rgb colors (from \type {/usr/share/X11/rgb.txt}):
+
+\doifnotmode{mkiv} {
+ \input colo-hex.mkii
+}
+
+\definecolor [snow] [h=fffafa]
+\definecolor [ghostwhite] [h=f8f8ff]
+\definecolor [whitesmoke] [s=0.96]
+\definecolor [gainsboro] [s=0.86]
+\definecolor [floralwhite] [h=fffaf0]
+\definecolor [oldlace] [h=fdf5e6]
+\definecolor [linen] [h=faf0e6]
+\definecolor [antiquewhite] [h=faebd7]
+\definecolor [papayawhip] [h=ffefd5]
+\definecolor [blanchedalmond] [h=ffebcd]
+\definecolor [bisque] [h=ffe4c4]
+\definecolor [peachpuff] [h=ffdab9]
+\definecolor [navajowhite] [h=ffdead]
+\definecolor [moccasin] [h=ffe4b5]
+\definecolor [cornsilk] [h=fff8dc]
+\definecolor [ivory] [h=fffff0]
+\definecolor [lemonchiffon] [h=fffacd]
+\definecolor [seashell] [h=fff5ee]
+\definecolor [honeydew] [h=f0fff0]
+\definecolor [mintcream] [h=f5fffa]
+\definecolor [azure] [h=f0ffff]
+\definecolor [aliceblue] [h=f0f8ff]
+\definecolor [lavender] [h=e6e6fa]
+\definecolor [lavenderblush] [h=fff0f5]
+\definecolor [mistyrose] [h=ffe4e1]
+\definecolor [white] [s=1]
+\definecolor [black] [s=0]
+\definecolor [darkslategray] [h=2f4f4f]
+\definecolor [darkslategrey] [darkslategray]
+\definecolor [dimgray] [s=0.41]
+\definecolor [dimgrey] [dimgray]
+\definecolor [slategray] [h=708090]
+\definecolor [slategrey] [slategray]
+\definecolor [lightslategray] [h=778899]
+\definecolor [lightslategrey] [lightslategray]
+\definecolor [gray] [s=0.75]
+\definecolor [grey] [gray]
+\definecolor [lightgrey] [s=0.83]
+\definecolor [lightgray] [lightgrey]
+\definecolor [midnightblue] [h=191970]
+\definecolor [navy] [h=000080]
+\definecolor [navyblue] [navy]
+\definecolor [cornflowerblue] [h=6495ed]
+\definecolor [darkslateblue] [h=483d8b]
+\definecolor [slateblue] [h=6a5acd]
+\definecolor [mediumslateblue] [h=7b68ee]
+\definecolor [lightslateblue] [h=8470ff]
+\definecolor [mediumblue] [h=0000cd]
+\definecolor [royalblue] [h=4169e1]
+\definecolor [blue] [h=0000ff]
+\definecolor [dodgerblue] [h=1e90ff]
+\definecolor [deepskyblue] [h=00bfff]
+\definecolor [skyblue] [h=87ceeb]
+\definecolor [lightskyblue] [h=87cefa]
+\definecolor [steelblue] [h=4682b4]
+\definecolor [lightsteelblue] [h=b0c4de]
+\definecolor [lightblue] [h=add8e6]
+\definecolor [powderblue] [h=b0e0e6]
+\definecolor [paleturquoise] [h=afeeee]
+\definecolor [darkturquoise] [h=00ced1]
+\definecolor [mediumturquoise] [h=48d1cc]
+\definecolor [turquoise] [h=40e0d0]
+\definecolor [cyan] [h=00ffff]
+\definecolor [lightcyan] [h=e0ffff]
+\definecolor [cadetblue] [h=5f9ea0]
+\definecolor [mediumaquamarine] [h=66cdaa]
+\definecolor [aquamarine] [h=7fffd4]
+\definecolor [darkgreen] [h=006400]
+\definecolor [darkolivegreen] [h=556b2f]
+\definecolor [darkseagreen] [h=8fbc8f]
+\definecolor [seagreen] [h=2e8b57]
+\definecolor [mediumseagreen] [h=3cb371]
+\definecolor [lightseagreen] [h=20b2aa]
+\definecolor [palegreen] [h=98fb98]
+\definecolor [springgreen] [h=00ff7f]
+\definecolor [lawngreen] [h=7cfc00]
+\definecolor [green] [h=00ff00]
+\definecolor [chartreuse] [h=7fff00]
+\definecolor [mediumspringgreen] [h=00fa9a]
+\definecolor [greenyellow] [h=adff2f]
+\definecolor [limegreen] [h=32cd32]
+\definecolor [yellowgreen] [h=9acd32]
+\definecolor [forestgreen] [h=228b22]
+\definecolor [olivedrab] [h=6b8e23]
+\definecolor [darkkhaki] [h=bdb76b]
+\definecolor [khaki] [h=f0e68c]
+\definecolor [palegoldenrod] [h=eee8aa]
+\definecolor [lightgoldenrodyellow] [h=fafad2]
+\definecolor [lightyellow] [h=ffffe0]
+\definecolor [yellow] [h=ffff00]
+\definecolor [gold] [h=ffd700]
+\definecolor [lightgoldenrod] [h=eedd82]
+\definecolor [goldenrod] [h=daa520]
+\definecolor [darkgoldenrod] [h=b8860b]
+\definecolor [rosybrown] [h=bc8f8f]
+\definecolor [indianred] [h=cd5c5c]
+\definecolor [saddlebrown] [h=8b4513]
+\definecolor [sienna] [h=a0522d]
+\definecolor [peru] [h=cd853f]
+\definecolor [burlywood] [h=deb887]
+\definecolor [beige] [h=f5f5dc]
+\definecolor [wheat] [h=f5deb3]
+\definecolor [sandybrown] [h=f4a460]
+\definecolor [tan] [h=d2b48c]
+\definecolor [chocolate] [h=d2691e]
+\definecolor [firebrick] [h=b22222]
+\definecolor [brown] [h=a52a2a]
+\definecolor [darksalmon] [h=e9967a]
+\definecolor [salmon] [h=fa8072]
+\definecolor [lightsalmon] [h=ffa07a]
+\definecolor [orange] [h=ffa500]
+\definecolor [darkorange] [h=ff8c00]
+\definecolor [coral] [h=ff7f50]
+\definecolor [lightcoral] [h=f08080]
+\definecolor [tomato] [h=ff6347]
+\definecolor [orangered] [h=ff4500]
+\definecolor [red] [h=ff0000]
+\definecolor [hotpink] [h=ff69b4]
+\definecolor [deeppink] [h=ff1493]
+\definecolor [pink] [h=ffc0cb]
+\definecolor [lightpink] [h=ffb6c1]
+\definecolor [palevioletred] [h=db7093]
+\definecolor [maroon] [h=b03060]
+\definecolor [mediumvioletred] [h=c71585]
+\definecolor [violetred] [h=d02090]
+\definecolor [magenta] [h=ff00ff]
+\definecolor [violet] [h=ee82ee]
+\definecolor [plum] [h=dda0dd]
+\definecolor [orchid] [h=da70d6]
+\definecolor [mediumorchid] [h=ba55d3]
+\definecolor [darkorchid] [h=9932cc]
+\definecolor [darkviolet] [h=9400d3]
+\definecolor [blueviolet] [h=8a2be2]
+\definecolor [purple] [h=a020f0]
+\definecolor [mediumpurple] [h=9370db]
+\definecolor [thistle] [h=d8bfd8]
+\definecolor [snow1] [h=fffafa]
+\definecolor [snow2] [h=eee9e9]
+\definecolor [snow3] [h=cdc9c9]
+\definecolor [snow4] [h=8b8989]
+\definecolor [seashell1] [h=fff5ee]
+\definecolor [seashell2] [h=eee5de]
+\definecolor [seashell3] [h=cdc5bf]
+\definecolor [seashell4] [h=8b8682]
+\definecolor [antiquewhite1] [h=ffefdb]
+\definecolor [antiquewhite2] [h=eedfcc]
+\definecolor [antiquewhite3] [h=cdc0b0]
+\definecolor [antiquewhite4] [h=8b8378]
+\definecolor [bisque1] [h=ffe4c4]
+\definecolor [bisque2] [h=eed5b7]
+\definecolor [bisque3] [h=cdb79e]
+\definecolor [bisque4] [h=8b7d6b]
+\definecolor [peachpuff1] [h=ffdab9]
+\definecolor [peachpuff2] [h=eecbad]
+\definecolor [peachpuff3] [h=cdaf95]
+\definecolor [peachpuff4] [h=8b7765]
+\definecolor [navajowhite1] [h=ffdead]
+\definecolor [navajowhite2] [h=eecfa1]
+\definecolor [navajowhite3] [h=cdb38b]
+\definecolor [navajowhite4] [h=8b795e]
+\definecolor [lemonchiffon1] [h=fffacd]
+\definecolor [lemonchiffon2] [h=eee9bf]
+\definecolor [lemonchiffon3] [h=cdc9a5]
+\definecolor [lemonchiffon4] [h=8b8970]
+\definecolor [cornsilk1] [h=fff8dc]
+\definecolor [cornsilk2] [h=eee8cd]
+\definecolor [cornsilk3] [h=cdc8b1]
+\definecolor [cornsilk4] [h=8b8878]
+\definecolor [ivory1] [h=fffff0]
+\definecolor [ivory2] [h=eeeee0]
+\definecolor [ivory3] [h=cdcdc1]
+\definecolor [ivory4] [h=8b8b83]
+\definecolor [honeydew1] [h=f0fff0]
+\definecolor [honeydew2] [h=e0eee0]
+\definecolor [honeydew3] [h=c1cdc1]
+\definecolor [honeydew4] [h=838b83]
+\definecolor [lavenderblush1] [h=fff0f5]
+\definecolor [lavenderblush2] [h=eee0e5]
+\definecolor [lavenderblush3] [h=cdc1c5]
+\definecolor [lavenderblush4] [h=8b8386]
+\definecolor [mistyrose1] [h=ffe4e1]
+\definecolor [mistyrose2] [h=eed5d2]
+\definecolor [mistyrose3] [h=cdb7b5]
+\definecolor [mistyrose4] [h=8b7d7b]
+\definecolor [azure1] [h=f0ffff]
+\definecolor [azure2] [h=e0eeee]
+\definecolor [azure3] [h=c1cdcd]
+\definecolor [azure4] [h=838b8b]
+\definecolor [slateblue1] [h=836fff]
+\definecolor [slateblue2] [h=7a67ee]
+\definecolor [slateblue3] [h=6959cd]
+\definecolor [slateblue4] [h=473c8b]
+\definecolor [royalblue1] [h=4876ff]
+\definecolor [royalblue2] [h=436eee]
+\definecolor [royalblue3] [h=3a5fcd]
+\definecolor [royalblue4] [h=27408b]
+\definecolor [blue1] [h=0000ff]
+\definecolor [blue2] [h=0000ee]
+\definecolor [blue3] [h=0000cd]
+\definecolor [blue4] [h=00008b]
+\definecolor [dodgerblue1] [h=1e90ff]
+\definecolor [dodgerblue2] [h=1c86ee]
+\definecolor [dodgerblue3] [h=1874cd]
+\definecolor [dodgerblue4] [h=104e8b]
+\definecolor [steelblue1] [h=63b8ff]
+\definecolor [steelblue2] [h=5cacee]
+\definecolor [steelblue3] [h=4f94cd]
+\definecolor [steelblue4] [h=36648b]
+\definecolor [deepskyblue1] [h=00bfff]
+\definecolor [deepskyblue2] [h=00b2ee]
+\definecolor [deepskyblue3] [h=009acd]
+\definecolor [deepskyblue4] [h=00688b]
+\definecolor [skyblue1] [h=87ceff]
+\definecolor [skyblue2] [h=7ec0ee]
+\definecolor [skyblue3] [h=6ca6cd]
+\definecolor [skyblue4] [h=4a708b]
+\definecolor [lightskyblue1] [h=b0e2ff]
+\definecolor [lightskyblue2] [h=a4d3ee]
+\definecolor [lightskyblue3] [h=8db6cd]
+\definecolor [lightskyblue4] [h=607b8b]
+\definecolor [slategray1] [h=c6e2ff]
+\definecolor [slategray2] [h=b9d3ee]
+\definecolor [slategray3] [h=9fb6cd]
+\definecolor [slategray4] [h=6c7b8b]
+\definecolor [lightsteelblue1] [h=cae1ff]
+\definecolor [lightsteelblue2] [h=bcd2ee]
+\definecolor [lightsteelblue3] [h=a2b5cd]
+\definecolor [lightsteelblue4] [h=6e7b8b]
+\definecolor [lightblue1] [h=bfefff]
+\definecolor [lightblue2] [h=b2dfee]
+\definecolor [lightblue3] [h=9ac0cd]
+\definecolor [lightblue4] [h=68838b]
+\definecolor [lightcyan1] [h=e0ffff]
+\definecolor [lightcyan2] [h=d1eeee]
+\definecolor [lightcyan3] [h=b4cdcd]
+\definecolor [lightcyan4] [h=7a8b8b]
+\definecolor [paleturquoise1] [h=bbffff]
+\definecolor [paleturquoise2] [h=aeeeee]
+\definecolor [paleturquoise3] [h=96cdcd]
+\definecolor [paleturquoise4] [h=668b8b]
+\definecolor [cadetblue1] [h=98f5ff]
+\definecolor [cadetblue2] [h=8ee5ee]
+\definecolor [cadetblue3] [h=7ac5cd]
+\definecolor [cadetblue4] [h=53868b]
+\definecolor [turquoise1] [h=00f5ff]
+\definecolor [turquoise2] [h=00e5ee]
+\definecolor [turquoise3] [h=00c5cd]
+\definecolor [turquoise4] [h=00868b]
+\definecolor [cyan1] [h=00ffff]
+\definecolor [cyan2] [h=00eeee]
+\definecolor [cyan3] [h=00cdcd]
+\definecolor [cyan4] [h=008b8b]
+\definecolor [darkslategray1] [h=97ffff]
+\definecolor [darkslategray2] [h=8deeee]
+\definecolor [darkslategray3] [h=79cdcd]
+\definecolor [darkslategray4] [h=528b8b]
+\definecolor [aquamarine1] [h=7fffd4]
+\definecolor [aquamarine2] [h=76eec6]
+\definecolor [aquamarine3] [h=66cdaa]
+\definecolor [aquamarine4] [h=458b74]
+\definecolor [darkseagreen1] [h=c1ffc1]
+\definecolor [darkseagreen2] [h=b4eeb4]
+\definecolor [darkseagreen3] [h=9bcd9b]
+\definecolor [darkseagreen4] [h=698b69]
+\definecolor [seagreen1] [h=54ff9f]
+\definecolor [seagreen2] [h=4eee94]
+\definecolor [seagreen3] [h=43cd80]
+\definecolor [seagreen4] [h=2e8b57]
+\definecolor [palegreen1] [h=9aff9a]
+\definecolor [palegreen2] [h=90ee90]
+\definecolor [palegreen3] [h=7ccd7c]
+\definecolor [palegreen4] [h=548b54]
+\definecolor [springgreen1] [h=00ff7f]
+\definecolor [springgreen2] [h=00ee76]
+\definecolor [springgreen3] [h=00cd66]
+\definecolor [springgreen4] [h=008b45]
+\definecolor [green1] [h=00ff00]
+\definecolor [green2] [h=00ee00]
+\definecolor [green3] [h=00cd00]
+\definecolor [green4] [h=008b00]
+\definecolor [chartreuse1] [h=7fff00]
+\definecolor [chartreuse2] [h=76ee00]
+\definecolor [chartreuse3] [h=66cd00]
+\definecolor [chartreuse4] [h=458b00]
+\definecolor [olivedrab1] [h=c0ff3e]
+\definecolor [olivedrab2] [h=b3ee3a]
+\definecolor [olivedrab3] [h=9acd32]
+\definecolor [olivedrab4] [h=698b22]
+\definecolor [darkolivegreen1] [h=caff70]
+\definecolor [darkolivegreen2] [h=bcee68]
+\definecolor [darkolivegreen3] [h=a2cd5a]
+\definecolor [darkolivegreen4] [h=6e8b3d]
+\definecolor [khaki1] [h=fff68f]
+\definecolor [khaki2] [h=eee685]
+\definecolor [khaki3] [h=cdc673]
+\definecolor [khaki4] [h=8b864e]
+\definecolor [lightgoldenrod1] [h=ffec8b]
+\definecolor [lightgoldenrod2] [h=eedc82]
+\definecolor [lightgoldenrod3] [h=cdbe70]
+\definecolor [lightgoldenrod4] [h=8b814c]
+\definecolor [lightyellow1] [h=ffffe0]
+\definecolor [lightyellow2] [h=eeeed1]
+\definecolor [lightyellow3] [h=cdcdb4]
+\definecolor [lightyellow4] [h=8b8b7a]
+\definecolor [yellow1] [h=ffff00]
+\definecolor [yellow2] [h=eeee00]
+\definecolor [yellow3] [h=cdcd00]
+\definecolor [yellow4] [h=8b8b00]
+\definecolor [gold1] [h=ffd700]
+\definecolor [gold2] [h=eec900]
+\definecolor [gold3] [h=cdad00]
+\definecolor [gold4] [h=8b7500]
+\definecolor [goldenrod1] [h=ffc125]
+\definecolor [goldenrod2] [h=eeb422]
+\definecolor [goldenrod3] [h=cd9b1d]
+\definecolor [goldenrod4] [h=8b6914]
+\definecolor [darkgoldenrod1] [h=ffb90f]
+\definecolor [darkgoldenrod2] [h=eead0e]
+\definecolor [darkgoldenrod3] [h=cd950c]
+\definecolor [darkgoldenrod4] [h=8b6508]
+\definecolor [rosybrown1] [h=ffc1c1]
+\definecolor [rosybrown2] [h=eeb4b4]
+\definecolor [rosybrown3] [h=cd9b9b]
+\definecolor [rosybrown4] [h=8b6969]
+\definecolor [indianred1] [h=ff6a6a]
+\definecolor [indianred2] [h=ee6363]
+\definecolor [indianred3] [h=cd5555]
+\definecolor [indianred4] [h=8b3a3a]
+\definecolor [sienna1] [h=ff8247]
+\definecolor [sienna2] [h=ee7942]
+\definecolor [sienna3] [h=cd6839]
+\definecolor [sienna4] [h=8b4726]
+\definecolor [burlywood1] [h=ffd39b]
+\definecolor [burlywood2] [h=eec591]
+\definecolor [burlywood3] [h=cdaa7d]
+\definecolor [burlywood4] [h=8b7355]
+\definecolor [wheat1] [h=ffe7ba]
+\definecolor [wheat2] [h=eed8ae]
+\definecolor [wheat3] [h=cdba96]
+\definecolor [wheat4] [h=8b7e66]
+\definecolor [tan1] [h=ffa54f]
+\definecolor [tan2] [h=ee9a49]
+\definecolor [tan3] [h=cd853f]
+\definecolor [tan4] [h=8b5a2b]
+\definecolor [chocolate1] [h=ff7f24]
+\definecolor [chocolate2] [h=ee7621]
+\definecolor [chocolate3] [h=cd661d]
+\definecolor [chocolate4] [h=8b4513]
+\definecolor [firebrick1] [h=ff3030]
+\definecolor [firebrick2] [h=ee2c2c]
+\definecolor [firebrick3] [h=cd2626]
+\definecolor [firebrick4] [h=8b1a1a]
+\definecolor [brown1] [h=ff4040]
+\definecolor [brown2] [h=ee3b3b]
+\definecolor [brown3] [h=cd3333]
+\definecolor [brown4] [h=8b2323]
+\definecolor [salmon1] [h=ff8c69]
+\definecolor [salmon2] [h=ee8262]
+\definecolor [salmon3] [h=cd7054]
+\definecolor [salmon4] [h=8b4c39]
+\definecolor [lightsalmon1] [h=ffa07a]
+\definecolor [lightsalmon2] [h=ee9572]
+\definecolor [lightsalmon3] [h=cd8162]
+\definecolor [lightsalmon4] [h=8b5742]
+\definecolor [orange1] [h=ffa500]
+\definecolor [orange2] [h=ee9a00]
+\definecolor [orange3] [h=cd8500]
+\definecolor [orange4] [h=8b5a00]
+\definecolor [darkorange1] [h=ff7f00]
+\definecolor [darkorange2] [h=ee7600]
+\definecolor [darkorange3] [h=cd6600]
+\definecolor [darkorange4] [h=8b4500]
+\definecolor [coral1] [h=ff7256]
+\definecolor [coral2] [h=ee6a50]
+\definecolor [coral3] [h=cd5b45]
+\definecolor [coral4] [h=8b3e2f]
+\definecolor [tomato1] [h=ff6347]
+\definecolor [tomato2] [h=ee5c42]
+\definecolor [tomato3] [h=cd4f39]
+\definecolor [tomato4] [h=8b3626]
+\definecolor [orangered1] [h=ff4500]
+\definecolor [orangered2] [h=ee4000]
+\definecolor [orangered3] [h=cd3700]
+\definecolor [orangered4] [h=8b2500]
+\definecolor [red1] [h=ff0000]
+\definecolor [red2] [h=ee0000]
+\definecolor [red3] [h=cd0000]
+\definecolor [red4] [h=8b0000]
+\definecolor [debianred] [h=d70751]
+\definecolor [deeppink1] [h=ff1493]
+\definecolor [deeppink2] [h=ee1289]
+\definecolor [deeppink3] [h=cd1076]
+\definecolor [deeppink4] [h=8b0a50]
+\definecolor [hotpink1] [h=ff6eb4]
+\definecolor [hotpink2] [h=ee6aa7]
+\definecolor [hotpink3] [h=cd6090]
+\definecolor [hotpink4] [h=8b3a62]
+\definecolor [pink1] [h=ffb5c5]
+\definecolor [pink2] [h=eea9b8]
+\definecolor [pink3] [h=cd919e]
+\definecolor [pink4] [h=8b636c]
+\definecolor [lightpink1] [h=ffaeb9]
+\definecolor [lightpink2] [h=eea2ad]
+\definecolor [lightpink3] [h=cd8c95]
+\definecolor [lightpink4] [h=8b5f65]
+\definecolor [palevioletred1] [h=ff82ab]
+\definecolor [palevioletred2] [h=ee799f]
+\definecolor [palevioletred3] [h=cd6889]
+\definecolor [palevioletred4] [h=8b475d]
+\definecolor [maroon1] [h=ff34b3]
+\definecolor [maroon2] [h=ee30a7]
+\definecolor [maroon3] [h=cd2990]
+\definecolor [maroon4] [h=8b1c62]
+\definecolor [violetred1] [h=ff3e96]
+\definecolor [violetred2] [h=ee3a8c]
+\definecolor [violetred3] [h=cd3278]
+\definecolor [violetred4] [h=8b2252]
+\definecolor [magenta1] [h=ff00ff]
+\definecolor [magenta2] [h=ee00ee]
+\definecolor [magenta3] [h=cd00cd]
+\definecolor [magenta4] [h=8b008b]
+\definecolor [orchid1] [h=ff83fa]
+\definecolor [orchid2] [h=ee7ae9]
+\definecolor [orchid3] [h=cd69c9]
+\definecolor [orchid4] [h=8b4789]
+\definecolor [plum1] [h=ffbbff]
+\definecolor [plum2] [h=eeaeee]
+\definecolor [plum3] [h=cd96cd]
+\definecolor [plum4] [h=8b668b]
+\definecolor [mediumorchid1] [h=e066ff]
+\definecolor [mediumorchid2] [h=d15fee]
+\definecolor [mediumorchid3] [h=b452cd]
+\definecolor [mediumorchid4] [h=7a378b]
+\definecolor [darkorchid1] [h=bf3eff]
+\definecolor [darkorchid2] [h=b23aee]
+\definecolor [darkorchid3] [h=9a32cd]
+\definecolor [darkorchid4] [h=68228b]
+\definecolor [purple1] [h=9b30ff]
+\definecolor [purple2] [h=912cee]
+\definecolor [purple3] [h=7d26cd]
+\definecolor [purple4] [h=551a8b]
+\definecolor [mediumpurple1] [h=ab82ff]
+\definecolor [mediumpurple2] [h=9f79ee]
+\definecolor [mediumpurple3] [h=8968cd]
+\definecolor [mediumpurple4] [h=5d478b]
+\definecolor [thistle1] [h=ffe1ff]
+\definecolor [thistle2] [h=eed2ee]
+\definecolor [thistle3] [h=cdb5cd]
+\definecolor [thistle4] [h=8b7b8b]
+\definecolor [gray0] [s=0.00]
+\definecolor [grey0] [gray0]
+\definecolor [gray1] [s=0.01]
+\definecolor [grey1] [gray1]
+\definecolor [gray2] [s=0.02]
+\definecolor [grey2] [gray2]
+\definecolor [gray3] [s=0.03]
+\definecolor [grey3] [gray3]
+\definecolor [gray4] [s=0.04]
+\definecolor [grey4] [gray4]
+\definecolor [gray5] [s=0.05]
+\definecolor [grey5] [gray5]
+\definecolor [gray6] [s=0.06]
+\definecolor [grey6] [gray6]
+\definecolor [gray7] [s=0.07]
+\definecolor [grey7] [gray7]
+\definecolor [gray8] [s=0.08]
+\definecolor [grey8] [gray8]
+\definecolor [gray9] [s=0.09]
+\definecolor [grey9] [gray9]
+\definecolor [gray10] [s=0.10]
+\definecolor [grey10] [gray10]
+\definecolor [gray11] [s=0.11]
+\definecolor [grey11] [gray11]
+\definecolor [gray12] [s=0.12]
+\definecolor [grey12] [gray12]
+\definecolor [gray13] [s=0.13]
+\definecolor [grey13] [gray13]
+\definecolor [gray14] [s=0.14]
+\definecolor [grey14] [gray14]
+\definecolor [gray15] [s=0.15]
+\definecolor [grey15] [gray15]
+\definecolor [gray16] [s=0.16]
+\definecolor [grey16] [gray16]
+\definecolor [gray17] [s=0.17]
+\definecolor [grey17] [gray17]
+\definecolor [gray18] [s=0.18]
+\definecolor [grey18] [gray18]
+\definecolor [gray19] [s=0.19]
+\definecolor [grey19] [gray19]
+\definecolor [gray20] [s=0.20]
+\definecolor [grey20] [gray20]
+\definecolor [gray21] [s=0.21]
+\definecolor [grey21] [gray21]
+\definecolor [gray22] [s=0.22]
+\definecolor [grey22] [gray22]
+\definecolor [gray23] [s=0.23]
+\definecolor [grey23] [gray23]
+\definecolor [gray24] [s=0.24]
+\definecolor [grey24] [gray24]
+\definecolor [gray25] [s=0.25]
+\definecolor [grey25] [gray25]
+\definecolor [gray26] [s=0.26]
+\definecolor [grey26] [gray26]
+\definecolor [gray27] [s=0.27]
+\definecolor [grey27] [gray27]
+\definecolor [gray28] [s=0.28]
+\definecolor [grey28] [gray28]
+\definecolor [gray29] [s=0.29]
+\definecolor [grey29] [gray29]
+\definecolor [gray30] [s=0.30]
+\definecolor [grey30] [gray30]
+\definecolor [gray31] [s=0.31]
+\definecolor [grey31] [gray31]
+\definecolor [gray32] [s=0.32]
+\definecolor [grey32] [gray32]
+\definecolor [gray33] [s=0.33]
+\definecolor [grey33] [gray33]
+\definecolor [gray34] [s=0.34]
+\definecolor [grey34] [gray34]
+\definecolor [gray35] [s=0.35]
+\definecolor [grey35] [gray35]
+\definecolor [gray36] [s=0.36]
+\definecolor [grey36] [gray36]
+\definecolor [gray37] [s=0.37]
+\definecolor [grey37] [gray37]
+\definecolor [gray38] [s=0.38]
+\definecolor [grey38] [gray38]
+\definecolor [gray39] [s=0.39]
+\definecolor [grey39] [gray39]
+\definecolor [gray40] [s=0.40]
+\definecolor [grey40] [gray40]
+\definecolor [gray41] [s=0.41]
+\definecolor [grey41] [gray41]
+\definecolor [gray42] [s=0.42]
+\definecolor [grey42] [gray42]
+\definecolor [gray43] [s=0.43]
+\definecolor [grey43] [gray43]
+\definecolor [gray44] [s=0.44]
+\definecolor [grey44] [gray44]
+\definecolor [gray45] [s=0.45]
+\definecolor [grey45] [gray45]
+\definecolor [gray46] [s=0.46]
+\definecolor [grey46] [gray46]
+\definecolor [gray47] [s=0.47]
+\definecolor [grey47] [gray47]
+\definecolor [gray48] [s=0.48]
+\definecolor [grey48] [gray48]
+\definecolor [gray49] [s=0.49]
+\definecolor [grey49] [gray49]
+\definecolor [gray50] [s=0.50]
+\definecolor [grey50] [gray50]
+\definecolor [gray51] [s=0.51]
+\definecolor [grey51] [gray51]
+\definecolor [gray52] [s=0.52]
+\definecolor [grey52] [gray52]
+\definecolor [gray53] [s=0.53]
+\definecolor [grey53] [gray53]
+\definecolor [gray54] [s=0.54]
+\definecolor [grey54] [gray54]
+\definecolor [gray55] [s=0.55]
+\definecolor [grey55] [gray55]
+\definecolor [gray56] [s=0.56]
+\definecolor [grey56] [gray56]
+\definecolor [gray57] [s=0.57]
+\definecolor [grey57] [gray57]
+\definecolor [gray58] [s=0.58]
+\definecolor [grey58] [gray58]
+\definecolor [gray59] [s=0.59]
+\definecolor [grey59] [gray59]
+\definecolor [gray60] [s=0.60]
+\definecolor [grey60] [gray60]
+\definecolor [gray61] [s=0.61]
+\definecolor [grey61] [gray61]
+\definecolor [gray62] [s=0.62]
+\definecolor [grey62] [gray62]
+\definecolor [gray63] [s=0.63]
+\definecolor [grey63] [gray63]
+\definecolor [gray64] [s=0.64]
+\definecolor [grey64] [gray64]
+\definecolor [gray65] [s=0.65]
+\definecolor [grey65] [gray65]
+\definecolor [gray66] [s=0.66]
+\definecolor [grey66] [gray66]
+\definecolor [gray67] [s=0.67]
+\definecolor [grey67] [gray67]
+\definecolor [gray68] [s=0.68]
+\definecolor [grey68] [gray68]
+\definecolor [gray69] [s=0.69]
+\definecolor [grey69] [gray69]
+\definecolor [gray70] [s=0.70]
+\definecolor [grey70] [gray70]
+\definecolor [gray71] [s=0.71]
+\definecolor [grey71] [gray71]
+\definecolor [gray72] [s=0.72]
+\definecolor [grey72] [gray72]
+\definecolor [gray73] [s=0.73]
+\definecolor [grey73] [gray73]
+\definecolor [gray74] [s=0.74]
+\definecolor [grey74] [gray74]
+\definecolor [gray75] [s=0.75]
+\definecolor [grey75] [gray75]
+\definecolor [gray76] [s=0.76]
+\definecolor [grey76] [gray76]
+\definecolor [gray77] [s=0.77]
+\definecolor [grey77] [gray77]
+\definecolor [gray78] [s=0.78]
+\definecolor [grey78] [gray78]
+\definecolor [gray79] [s=0.79]
+\definecolor [grey79] [gray79]
+\definecolor [gray80] [s=0.80]
+\definecolor [grey80] [gray80]
+\definecolor [gray81] [s=0.81]
+\definecolor [grey81] [gray81]
+\definecolor [gray82] [s=0.82]
+\definecolor [grey82] [gray82]
+\definecolor [gray83] [s=0.83]
+\definecolor [grey83] [gray83]
+\definecolor [gray84] [s=0.84]
+\definecolor [grey84] [gray84]
+\definecolor [gray85] [s=0.85]
+\definecolor [grey85] [gray85]
+\definecolor [gray86] [s=0.86]
+\definecolor [grey86] [gray86]
+\definecolor [gray87] [s=0.87]
+\definecolor [grey87] [gray87]
+\definecolor [gray88] [s=0.88]
+\definecolor [grey88] [gray88]
+\definecolor [gray89] [s=0.89]
+\definecolor [grey89] [gray89]
+\definecolor [gray90] [s=0.90]
+\definecolor [grey90] [gray90]
+\definecolor [gray91] [s=0.91]
+\definecolor [grey91] [gray91]
+\definecolor [gray92] [s=0.92]
+\definecolor [grey92] [gray92]
+\definecolor [gray93] [s=0.93]
+\definecolor [grey93] [gray93]
+\definecolor [gray94] [s=0.94]
+\definecolor [grey94] [gray94]
+\definecolor [gray95] [s=0.95]
+\definecolor [grey95] [gray95]
+\definecolor [gray96] [s=0.96]
+\definecolor [grey96] [gray96]
+\definecolor [gray97] [s=0.97]
+\definecolor [grey97] [gray97]
+\definecolor [gray98] [s=0.98]
+\definecolor [grey98] [gray98]
+\definecolor [gray99] [s=0.99]
+\definecolor [grey99] [gray99]
+\definecolor [gray100] [s=1.00]
+\definecolor [grey100] [gray100]
+\definecolor [darkgrey] [s=0.66]
+\definecolor [darkgray] [darkgrey]
+\definecolor [darkblue] [h=00008b]
+\definecolor [darkcyan] [h=008b8b]
+\definecolor [darkmagenta] [h=8b008b]
+\definecolor [darkred] [h=8b0000]
+\definecolor [lightgreen] [h=90ee90]
+
+\endinput
diff --git a/tex/context/base/colo-xwi.mkii b/tex/context/base/colo-xwi.mkii
new file mode 100644
index 000000000..81e09d871
--- /dev/null
+++ b/tex/context/base/colo-xwi.mkii
@@ -0,0 +1,142 @@
+%D \module
+%D [ file=colo-xwi,
+%D version=1995.01.01,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=X Windows,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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 I've forgotten where I got these definitions from, but maybe
+%D they can be of use.
+
+\definecolor [aliceblue] [r=0.94,g=0.97,b=1.00]
+\definecolor [antiquewhite] [r=0.98,g=0.92,b=0.84]
+\definecolor [aquamarine] [r=0.50,g=1.00,b=0.83]
+\definecolor [azure] [r=0.94,g=1.00,b=1.00]
+\definecolor [beige] [r=0.96,g=0.96,b=0.86]
+\definecolor [bisque] [r=1.00,g=0.89,b=0.77]
+\definecolor [black] [s=0] % [r=0.00,g=0.00,b=0.00]
+\definecolor [blanchedalmond] [r=1.00,g=0.92,b=0.80]
+\definecolor [blue] [r=0.00,g=0.00,b=1.00]
+\definecolor [blueviolet] [r=0.54,g=0.17,b=0.89]
+\definecolor [brown] [r=0.65,g=0.16,b=0.16]
+\definecolor [burlywood] [r=0.87,g=0.72,b=0.53]
+\definecolor [cadetblue] [r=0.37,g=0.62,b=0.63]
+\definecolor [chartreuse] [r=0.50,g=1.00,b=0.00]
+\definecolor [chocolate] [r=0.82,g=0.41,b=0.12]
+\definecolor [coral] [r=1.00,g=0.50,b=0.31]
+\definecolor [cornflowerblue] [r=0.39,g=0.58,b=0.93]
+\definecolor [cornsilk] [r=1.00,g=0.97,b=0.86]
+\definecolor [cyan] [r=0.00,g=1.00,b=1.00]
+\definecolor [darkgoldenrod] [r=0.72,g=0.53,b=0.04]
+\definecolor [darkgreen] [r=0.00,g=0.39,b=0.00]
+\definecolor [darkkhaki] [r=0.74,g=0.72,b=0.42]
+\definecolor [darkolivegreen] [r=0.33,g=0.42,b=0.18]
+\definecolor [darkorange] [r=1.00,g=0.55,b=0.00]
+\definecolor [darkorchid] [r=0.60,g=0.20,b=0.80]
+\definecolor [darksalmon] [r=0.91,g=0.59,b=0.48]
+\definecolor [darkseagreen] [r=0.56,g=0.74,b=0.56]
+\definecolor [darkslateblue] [r=0.28,g=0.24,b=0.55]
+\definecolor [darkturquoise] [r=0.00,g=0.81,b=0.82]
+\definecolor [darkviolet] [r=0.58,g=0.00,b=0.83]
+\definecolor [deeppink] [r=1.00,g=0.08,b=0.58]
+\definecolor [deepskyblue] [r=0.00,g=0.75,b=1.00]
+\definecolor [dodgerblue] [r=0.12,g=0.56,b=1.00]
+\definecolor [firebrick] [r=0.70,g=0.13,b=0.13]
+\definecolor [floralwhite] [r=1.00,g=0.98,b=0.94]
+\definecolor [forestgreen] [r=0.13,g=0.55,b=0.13]
+\definecolor [gainsboro] [r=0.86,g=0.86,b=0.86]
+\definecolor [ghostwhite] [r=0.97,g=0.97,b=1.00]
+\definecolor [gold] [r=1.00,g=0.84,b=0.00]
+\definecolor [goldenrod] [r=0.85,g=0.65,b=0.13]
+\definecolor [green] [r=0.00,g=1.00,b=0.00]
+\definecolor [greenyellow] [r=0.68,g=1.00,b=0.18]
+\definecolor [honeydew] [r=0.94,g=1.00,b=0.94]
+\definecolor [hotpink] [r=1.00,g=0.41,b=0.71]
+\definecolor [indianred] [r=0.80,g=0.36,b=0.36]
+\definecolor [ivory] [r=1.00,g=1.00,b=0.94]
+\definecolor [khaki] [r=0.94,g=0.90,b=0.55]
+\definecolor [lavender] [r=0.90,g=0.90,b=0.98]
+\definecolor [lavenderblush] [r=1.00,g=0.94,b=0.96]
+\definecolor [lawngreen] [r=0.49,g=0.99,b=0.00]
+\definecolor [lemonchiffon] [r=1.00,g=0.98,b=0.80]
+\definecolor [lightblue] [r=0.68,g=0.85,b=0.90]
+\definecolor [lightcoral] [r=0.94,g=0.50,b=0.50]
+\definecolor [lightcyan] [r=0.88,g=1.00,b=1.00]
+\definecolor [lightgoldenrod] [r=0.93,g=0.87,b=0.51]
+\definecolor [lightgoldenrodyellow] [r=0.98,g=0.98,b=0.82]
+\definecolor [lightpink] [r=1.00,g=0.71,b=0.76]
+\definecolor [lightsalmon] [r=1.00,g=0.63,b=0.48]
+\definecolor [lightseagreen] [r=0.13,g=0.70,b=0.67]
+\definecolor [lightskyblue] [r=0.53,g=0.81,b=0.98]
+\definecolor [lightslateblue] [r=0.52,g=0.44,b=1.00]
+\definecolor [lightsteelblue] [r=0.69,g=0.77,b=0.87]
+\definecolor [lightyellow] [r=1.00,g=1.00,b=0.88]
+\definecolor [limegreen] [r=0.20,g=0.80,b=0.20]
+\definecolor [linen] [r=0.98,g=0.94,b=0.90]
+\definecolor [magenta] [r=1.00,g=0.00,b=1.00]
+\definecolor [maroon] [r=0.69,g=0.19,b=0.38]
+\definecolor [mediumaquamarine] [r=0.40,g=0.80,b=0.67]
+\definecolor [mediumblue] [r=0.00,g=0.00,b=0.80]
+\definecolor [mediumorchid] [r=0.73,g=0.33,b=0.83]
+\definecolor [mediumpurple] [r=0.58,g=0.44,b=0.86]
+\definecolor [mediumseagreen] [r=0.24,g=0.70,b=0.44]
+\definecolor [mediumslateblue] [r=0.48,g=0.41,b=0.93]
+\definecolor [mediumspringgreen] [r=0.00,g=0.98,b=0.60]
+\definecolor [mediumturquoise] [r=0.28,g=0.82,b=0.80]
+\definecolor [mediumvioletred] [r=0.78,g=0.08,b=0.52]
+\definecolor [midnightblue] [r=0.10,g=0.10,b=0.44]
+\definecolor [mintcream] [r=0.96,g=1.00,b=0.98]
+\definecolor [mistyrose] [r=1.00,g=0.89,b=0.88]
+\definecolor [moccasin] [r=1.00,g=0.89,b=0.71]
+\definecolor [navajowhite] [r=1.00,g=0.87,b=0.68]
+\definecolor [navy] [r=0.00,g=0.00,b=0.50]
+\definecolor [navyblue] [r=0.00,g=0.00,b=0.50]
+\definecolor [oldlace] [r=0.99,g=0.96,b=0.90]
+\definecolor [olivedrab] [r=0.42,g=0.56,b=0.14]
+\definecolor [orange] [r=1.00,g=0.65,b=0.00]
+\definecolor [orangered] [r=1.00,g=0.27,b=0.00]
+\definecolor [orchid] [r=0.85,g=0.44,b=0.84]
+\definecolor [palegoldenrod] [r=0.93,g=0.91,b=0.67]
+\definecolor [palegreen] [r=0.60,g=0.98,b=0.60]
+\definecolor [paleturquoise] [r=0.69,g=0.93,b=0.93]
+\definecolor [palevioletred] [r=0.86,g=0.44,b=0.58]
+\definecolor [papayawhip] [r=1.00,g=0.94,b=0.84]
+\definecolor [peachpuff] [r=1.00,g=0.85,b=0.73]
+\definecolor [peru] [r=0.80,g=0.52,b=0.25]
+\definecolor [pink] [r=1.00,g=0.75,b=0.80]
+\definecolor [plum] [r=0.87,g=0.63,b=0.87]
+\definecolor [powderblue] [r=0.69,g=0.88,b=0.90]
+\definecolor [purple] [r=0.63,g=0.13,b=0.94]
+\definecolor [red ] [r=1.00,g=0.00,b=0.00]
+\definecolor [rosybrown] [r=0.74,g=0.56,b=0.56]
+\definecolor [royalblue] [r=0.25,g=0.41,b=0.88]
+\definecolor [saddlebrown] [r=0.55,g=0.27,b=0.07]
+\definecolor [salmon] [r=0.98,g=0.50,b=0.45]
+\definecolor [sandybrown] [r=0.96,g=0.64,b=0.38]
+\definecolor [seagreen] [r=0.18,g=0.55,b=0.34]
+\definecolor [seashell] [r=1.00,g=0.96,b=0.93]
+\definecolor [sienna] [r=0.63,g=0.32,b=0.18]
+\definecolor [skyblue] [r=0.53,g=0.81,b=0.92]
+\definecolor [slateblue] [r=0.42,g=0.35,b=0.80]
+\definecolor [snow] [r=1.00,g=0.98,b=0.98]
+\definecolor [springgreen] [r=0.00,g=1.00,b=0.50]
+\definecolor [steelblue] [r=0.27,g=0.51,b=0.71]
+\definecolor [tan ] [r=0.82,g=0.71,b=0.55]
+\definecolor [thistle] [r=0.85,g=0.75,b=0.85]
+\definecolor [tomato] [r=1.00,g=0.39,b=0.28]
+\definecolor [turquoise] [r=0.25,g=0.88,b=0.82]
+\definecolor [violet] [r=0.93,g=0.51,b=0.93]
+\definecolor [violetred] [r=0.82,g=0.13,b=0.56]
+\definecolor [wheat] [r=0.96,g=0.87,b=0.70]
+\definecolor [white] [r=1.00,g=1.00,b=1.00]
+\definecolor [whitesmoke] [s=0.96] % [r=0.96,g=0.96,b=0.96]
+\definecolor [yellow] [r=1.00,g=1.00,b=0.00]
+\definecolor [yellowgreen] [r=0.60,g=0.80,b=0.20]
+
+\endinput
diff --git a/tex/context/base/cont-cs.tex b/tex/context/base/cont-cs.mkii
index 10fd16748..82980acc2 100644
--- a/tex/context/base/cont-cs.tex
+++ b/tex/context/base/cont-cs.mkii
@@ -13,24 +13,13 @@
\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{czech}
-\input context.tex
+\input context.mkii
\unprotect
\setupcurrentlanguage[\s!cs]
-\installlanguage [\s!en] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!sk] [\c!state=\v!start]
-\installlanguage [\s!cs] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
- % will be runtime option: typeface
- \appendtoks
- \usetypescript[modern]
- \setuptypeface[modern]
- \to \everyjob
-\else
+\ifnum\texengine=\luatexengine \else
\setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
\fi
diff --git a/tex/context/base/cont-cs.mkiv b/tex/context/base/cont-cs.mkiv
new file mode 100644
index 000000000..552bc5f51
--- /dev/null
+++ b/tex/context/base/cont-cs.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-cs,
+%D version=1998.12.02,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ Czech Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{czech}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!cs]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-de.tex b/tex/context/base/cont-de.mkii
index 19743527e..3aec10a93 100644
--- a/tex/context/base/cont-de.tex
+++ b/tex/context/base/cont-de.mkii
@@ -13,29 +13,13 @@
\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{german}
-\input context.tex
+\input context.mkii
\unprotect
\setupcurrentlanguage[\s!de]
-\installlanguage [\s!us] [\c!state=\v!start]
-\installlanguage [\s!gb] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!fr] [\c!state=\v!start]
-\installlanguage [\s!es] [\c!state=\v!start]
-\installlanguage [\s!nl] [\c!state=\v!start]
-\installlanguage [\s!it] [\c!state=\v!start]
-
-\installlanguage [deo] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
- % will be runtime option: typeface
- \appendtoks
- \usetypescript[modern]
- \setuptypeface[modern]
- \to \everyjob
-\else
+\ifnum\texengine=\luatexengine \else
\setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
\fi
diff --git a/tex/context/base/cont-de.mkiv b/tex/context/base/cont-de.mkiv
new file mode 100644
index 000000000..43251a206
--- /dev/null
+++ b/tex/context/base/cont-de.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-de,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ German Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{german}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!de]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-en.mkii b/tex/context/base/cont-en.mkii
new file mode 100644
index 000000000..5e91365bd
--- /dev/null
+++ b/tex/context/base/cont-en.mkii
@@ -0,0 +1,28 @@
+%D \module
+%D [ file=cont-en,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ English Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english}
+
+\input context.mkii
+
+\unprotect
+
+\setupcurrentlanguage[\s!en]
+
+\setupencoding[default=ec]
+
+\usetypescript[fallback][\defaultencoding]
+
+\setupbodyfont[rm,12pt]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-en.mkiv b/tex/context/base/cont-en.mkiv
new file mode 100644
index 000000000..88724ca8f
--- /dev/null
+++ b/tex/context/base/cont-en.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-en,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ English Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!en]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-en.tex b/tex/context/base/cont-en.tex
deleted file mode 100644
index 42ad12b1a..000000000
--- a/tex/context/base/cont-en.tex
+++ /dev/null
@@ -1,44 +0,0 @@
-%D \module
-%D [ file=cont-en,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ English Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english}
-
-\input context.tex
-
-\unprotect
-
-\setupcurrentlanguage[\s!en]
-
-% Do we need more defaults? or maybe all languages?
-
-\installlanguage [\s!us] [\c!state=\v!start]
-\installlanguage [\s!gb] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!fr] [\c!state=\v!start]
-\installlanguage [\s!es] [\c!state=\v!start]
-\installlanguage [\s!pt] [\c!state=\v!start]
-\installlanguage [\s!it] [\c!state=\v!start]
-\installlanguage [\s!nl] [\c!state=\v!start]
-\installlanguage [\s!cs] [\c!state=\v!start]
-\installlanguage [\s!sk] [\c!state=\v!start]
-\installlanguage [\s!pl] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
-% \prependtoks
-% \the \everysetupdocument
-% \to \everyjob
-\else
- \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-\fi
-
-\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-fr.mkii b/tex/context/base/cont-fr.mkii
new file mode 100644
index 000000000..aea4cb625
--- /dev/null
+++ b/tex/context/base/cont-fr.mkii
@@ -0,0 +1,28 @@
+%D \module
+%D [ file=cont-de,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ French Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{french}
+
+\input context.mkii
+
+\unprotect
+
+\setupcurrentlanguage[\s!fr]
+
+\setupencoding[default=ec]
+
+\usetypescript[fallback][\defaultencoding]
+
+\setupbodyfont[rm,12pt]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-fr.mkiv b/tex/context/base/cont-fr.mkiv
new file mode 100644
index 000000000..5de684314
--- /dev/null
+++ b/tex/context/base/cont-fr.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-de,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ French Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{french}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!fr]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-fr.tex b/tex/context/base/cont-fr.tex
deleted file mode 100644
index 0b9b98df2..000000000
--- a/tex/context/base/cont-fr.tex
+++ /dev/null
@@ -1,40 +0,0 @@
-%D \module
-%D [ file=cont-de,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ French Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{french}
-
-\input context.tex
-
-\unprotect
-
-\setupcurrentlanguage[\s!fr]
-
-\installlanguage [\s!us] [\c!state=\v!start]
-\installlanguage [\s!gb] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!fr] [\c!state=\v!start]
-\installlanguage [\s!es] [\c!state=\v!start]
-\installlanguage [\s!nl] [\c!state=\v!start]
-\installlanguage [\s!it] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
- % will be runtime option: typeface
- \appendtoks
- \usetypescript[modern]
- \setuptypeface[modern]
- \to \everyjob
-\else
- \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-\fi
-
-\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-gb.mkii b/tex/context/base/cont-gb.mkii
new file mode 100644
index 000000000..24f52416d
--- /dev/null
+++ b/tex/context/base/cont-gb.mkii
@@ -0,0 +1,28 @@
+%D \module
+%D [ file=cont-uk,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ English Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english}
+
+\input context.mkii
+
+\unprotect
+
+\setupcurrentlanguage[\s!gb]
+
+\setupencoding[default=ec]
+
+\usetypescript[fallback][\defaultencoding]
+
+\setupbodyfont[rm,12pt]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-gb.mkiv b/tex/context/base/cont-gb.mkiv
new file mode 100644
index 000000000..ed4f65b66
--- /dev/null
+++ b/tex/context/base/cont-gb.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-uk,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ English Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!gb]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-gb.tex b/tex/context/base/cont-gb.tex
deleted file mode 100644
index bd18f20ff..000000000
--- a/tex/context/base/cont-gb.tex
+++ /dev/null
@@ -1,40 +0,0 @@
-%D \module
-%D [ file=cont-uk,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ English Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english}
-
-\input context.tex
-
-\unprotect
-
-\setupcurrentlanguage[\s!gb]
-
-\installlanguage [\s!us] [\c!state=\v!start]
-\installlanguage [\s!gb] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!fr] [\c!state=\v!start]
-\installlanguage [\s!es] [\c!state=\v!start]
-\installlanguage [\s!nl] [\c!state=\v!start]
-\installlanguage [\s!it] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
- % will be runtime option: typeface
- \appendtoks
- \usetypescript[modern]
- \setuptypeface[modern]
- \to \everyjob
-\else
- \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-\fi
-
-\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-it.mkii b/tex/context/base/cont-it.mkii
new file mode 100644
index 000000000..5c8163a4e
--- /dev/null
+++ b/tex/context/base/cont-it.mkii
@@ -0,0 +1,28 @@
+%D \module
+%D [ file=cont-it,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ Italian Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{italian}
+
+\input context.mkii
+
+\unprotect
+
+\setupcurrentlanguage[\s!it]
+
+\setupencoding[default=ec]
+
+\usetypescript[fallback][\defaultencoding]
+
+\setupbodyfont[rm,12pt]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-it.mkiv b/tex/context/base/cont-it.mkiv
new file mode 100644
index 000000000..02e831891
--- /dev/null
+++ b/tex/context/base/cont-it.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-it,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ Italian Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{italian}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!it]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-it.tex b/tex/context/base/cont-it.tex
deleted file mode 100644
index 03a1e5175..000000000
--- a/tex/context/base/cont-it.tex
+++ /dev/null
@@ -1,39 +0,0 @@
-%D \module
-%D [ file=cont-it,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Italian Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{italian}
-
-\input context.tex
-
-\unprotect
-
-\setupcurrentlanguage[\s!it]
-
-\installlanguage [\s!us] [\c!state=\v!start]
-\installlanguage [\s!gb] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!fr] [\c!state=\v!start]
-\installlanguage [\s!es] [\c!state=\v!start]
-\installlanguage [\s!it] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
- % will be runtime option: typeface
- \appendtoks
- \usetypescript[modern]
- \setuptypeface[modern]
- \to \everyjob
-\else
- \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-\fi
-
-\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-log.tex b/tex/context/base/cont-log.mkii
index c89a2dd8f..c89a2dd8f 100644
--- a/tex/context/base/cont-log.tex
+++ b/tex/context/base/cont-log.mkii
diff --git a/tex/context/base/cont-log.mkiv b/tex/context/base/cont-log.mkiv
new file mode 100644
index 000000000..158aee85c
--- /dev/null
+++ b/tex/context/base/cont-log.mkiv
@@ -0,0 +1,249 @@
+%D \module
+%D [ file=cont-log,
+%D version=1995.10.10,
+%D title=\CONTEXT\ Miscellaneous Macros,
+%D subtitle=\TEX\ Logos,
+%D author=J. Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt TeX Logos}
+
+%D The system that is used to typeset this text is called \TEX,
+%D typeset with an lowered~E. From te beginning of \TEX,
+%D authors of macro packages adapted this raising and lowering
+%D style. In this module we define some of those logos.
+
+\unprotect
+
+\def\Mkern#1%
+ {{\setbox\scratchbox\hbox{M}\kern#1\wd\scratchbox}}
+
+\unexpanded\def\TeX
+ {T%
+ \Mkern{-.1667}\lower.5ex\hbox{E}%
+ \Mkern{-.125}X}
+
+\unexpanded\def\ConTeXt{Con\TeX t}
+\unexpanded\def\PPCHTeX{ppch\TeX}
+\unexpanded\def\PRAGMA {Pragma ADE}
+
+\unexpanded\def\LaTeX % requested by erik frambach
+ {{\setbox\scratchbox\hbox{L}%
+ \scratchdimen\ht\scratchbox
+ \setbox\scratchbox\hbox{\txx A}%
+ L\kern-.55\wd\scratchbox
+ \raise\scratchdimen\hbox{\lower\ht\scratchbox\copy\scratchbox}%
+ \kern-.2\wd\scratchbox\TeX}}
+
+\unexpanded\def\TaBlE
+ {T%
+ \kern-.27em\lower.5ex\hbox{A}%
+ \kern-.18emB%
+ \kern-.1em\lower.5ex\hbox{L}%
+ \kern-.075emE}
+
+\unexpanded\def\PiCTeX
+ {P%
+ \kern-.12em\lower.5ex\hbox{I}%
+ \kern-.075em C%
+ \kern-.11em\TeX}
+
+\def\AMSswitch#1%
+ {$\cal\ifdim\bodyfontsize>1.1em\scriptstyle\fi#1$}
+
+\unexpanded\def\AmSTeX
+ {\AMSswitch A%
+ \kern-.1667em\lower.5ex\hbox{\AMSswitch M}%
+ \kern-.125em\AMSswitch S%
+ -\TeX}
+
+\unexpanded\def\LamSTeX
+ {L%
+ \kern-.4em\raise.3ex\hbox{\AMSswitch A}%
+ \kern-.25em\lower.4ex\hbox{\AMSswitch M}%
+ \kern-.1em{\AMSswitch S}%
+ -\TeX}
+
+\unexpanded\def\AmSLaTeX
+ {\AMSswitch A%
+ \kern-.1667em\lower.5ex\hbox{\AMSswitch M}%
+ \kern-.125em\AMSswitch S%
+ -\LaTeX}
+
+%D Alternative \CONTEXT\ logo, first Idris S.~Hamid's version:
+%D
+%D \def\Context
+%D {{\sc C\kern -.0667emo\kern -.0667emn\kern -.0549emt\kern
+%D -.1667em\lower.5ex\hbox {e}\kern -.125emx\kern -.0549emt}}
+%D
+%D I changed this into one that adapts itself:
+
+\unexpanded\def\Context
+ {{C\kern -.0667em\getscaledglyph{.8}\empty{O\kern -.0667emN\kern
+ -.0549emT\doifitalicelse{\kern-.1em}{\kern-.1667em}\lower.5ex\hbox
+ {E}\doifitalicelse\empty{\kern-.11em}X\kern-.055emT}}}
+
+%D The \METAFONT\ and \METAPOST\ logos adapt themselves to the
+%D current fontsize, an ugly but usefull hack.
+
+\let\logofont\nullfont
+
+\loadmapfile[original-base.map]
+
+\unexpanded\def\setMFPfont% more sensitive for low level changes
+ {\font\logofont=logo%
+ \ifx\fontalternative\c!bf\else
+ \ifx\fontalternative\c!it\else
+ \ifx\fontalternative\c!sl\else
+ \ifx\fontalternative\c!bi\else
+ \ifx\fontalternative\c!bs\else
+ \fi\fi\fi\fi\fi
+ 10 at \currentfontscale\bodyfontsize
+ \logofont}
+
+\def\MetaHyphen% there is no hyphenchar in this font
+ {\discretionary{\vrule\!!height.33em\!!depth-.27em\!!width.33em}{}{}}
+
+\unexpanded\def\MetaFont
+ {{\setMFPfont META\MetaHyphen FONT}}
+
+\unexpanded\def\MetaPost
+ {{\setMFPfont META\MetaHyphen POST}}
+
+\unexpanded\def\MetaFun
+ {MetaFun}
+
+%D \macros
+%D {TEX, METAFONT, METAPOST, METAFUN,
+%D PICTEX, TABLE,
+%D CONTEXT, PPCHTEX,
+%D AMSTEX, LATEX, LAMSTEX}
+%D
+%D We define the funny written ones as well as the less
+%D error prone upper case names (in \CONTEXT\ we tend to
+%D write all user defined commands, like abbreviations, in
+%D uppercase.)
+
+\unexpanded\def\METAFONT {\MetaFont}
+\unexpanded\def\METAPOST {\MetaPost}
+\unexpanded\def\PPCHTEX {\PPCHTeX}
+\unexpanded\def\CONTEXT {\ConTeXt}
+\unexpanded\def\METAFUN {\MetaFun}
+
+\unexpanded\def\TEX {\TeX}
+\unexpanded\def\LATEX {\LaTeX}
+\unexpanded\def\PICTEX {\PiCTeX}
+\unexpanded\def\TABLE {\TaBlE}
+\unexpanded\def\AMSTEX {\AmSTeX}
+\unexpanded\def\LAMSTEX {\LamSTeX}
+\unexpanded\def\INRSTEX {inrs\TeX}
+
+%D And this is how they show up: \TeX, \MetaFont, \MetaPost,
+%D \PiCTeX, \TaBlE, \ConTeXt, \PPCHTeX, \AmSTeX, \LaTeX,
+%D \LamSTeX.
+
+%D Some placeholders:
+
+\unexpanded\def\eTeX {\mathematics{\varepsilon}-\TeX}
+\unexpanded\def\pdfTeX {pdf\TeX}
+\unexpanded\def\pdfeTeX{pdfe-\TeX}
+\unexpanded\def\luaTeX {lua\TeX}
+\unexpanded\def\metaTeX{meta\TeX}
+\unexpanded\def\XeTeX {X\lower.5ex\hbox{\kern-.15em\mirror{E}}\kern-.1667em\TeX}
+
+% Adapted from a patch by Mojca:
+
+\def\@XeTeX@
+ {\setbox\scratchbox\hbox{E}%
+ \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}}
+
+\unexpanded\def\XeTeX
+ {X\lower.5ex
+ \hbox
+ {\kern-.15em
+ \iffontchar\font"018E\relax
+ \char"018E%
+ \else
+ \ifx\fontalternative\c!bf\mirror{E}\else
+ \ifx\fontalternative\c!it \@XeTeX@\else
+ \ifx\fontalternative\c!sl \@XeTeX@\else
+ \ifx\fontalternative\c!bi \@XeTeX@\else
+ \ifx\fontalternative\c!bs \@XeTeX@\else
+ \mirror{E}\fi\fi\fi\fi\fi
+ \fi}%
+ \kern-.1667em \TeX}
+
+\let\ETEX \eTeX
+\let\PDFTEX \pdfTeX
+\let\PDFETEX\pdfeTeX
+\let\LUATEX \luaTeX
+\let\LuaTeX \luaTeX
+\let\XETEX \XeTeX
+
+\unexpanded\def\MkApproved % joke, not used so it might move
+ {\dontleavehmode\rotate
+ [\c!rotation={\ifnum\texengine=\luatexengine\ctxlua{tex.write(45-45*\the\luatexversion/100)}\else0\fi},
+ \c!align=\v!middle,
+ \c!foregroundstyle=\v!type,
+ \c!foregroundcolor=darkred,
+ \c!frame=\v!on,
+ \c!offset=1ex,
+ \c!background=\v!color,
+ \c!backgroundcolor=lightgray,
+ \c!framecolor=darkred,
+ \c!rulethickness=2pt]
+ {Mk\ifnum\texengine=\luatexengine IV\else II\fi\\approved}}
+
+% \unexpanded\def\luaTeX
+% {\dontleavehmode\begingroup
+% Lua%
+% \setbox0\hbox{oT}%
+% \setbox2\hbox{o\kern0ptT}%
+% \ifdim\wd0=\wd2
+% \setbox0\hbox dir TRT{To}%
+% \setbox2\hbox{T\kern0pto}%
+% \hskip\dimexpr\wd0-\wd2\relax
+% \fi
+% \TeX
+% \endgroup}
+%
+% a further iteration from the list, patched again
+
+% \ifx\fontalternative\c!it -\else
+% \ifx\fontalternative\c!sl -\else
+% \ifx\fontalternative\c!bi -\else
+% \ifx\fontalternative\c!bs -\fi\fi\fi\fi
+
+\def\LuaTeX
+ {\dontleavehmode
+ \begingroup
+ Lua%
+ % hope for kerning, try aT
+ \setbox0\hbox{aT}%
+ \setbox2\hbox{a\kern\zeropoint T}%
+ \ifdim\wd0=\wd2 % kerns can go two ways
+ % no aT kerning, try oT as a is not symmetrical
+ \setbox0\hbox{oT}%
+ \setbox2\hbox{o\kern\zeropoint T}%
+ \ifdim\wd0=\wd2 % kerns can go two ways
+ % no aT and oT kerning, try To
+ \setbox0\hbox{To}%
+ \setbox2\hbox{T\kern\zeropoint o}%
+ % maybe we need to compensate for the angle (sl/it/bs/bi)
+ \fi
+ \ifdim\wd0=\wd2\else
+ \kern\dimexpr\wd0-\wd2\relax
+ \fi
+ \fi
+ \TeX
+ \endgroup}
+
+\let\luaTeX \LuaTeX
+\let\LUATEX \LuaTeX
+
+\protect \endinput
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index a1600a876..3e7c555e3 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2011.01.24 10:00}
+\newcontextversion{2011.01.24 23:51}
%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/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index e4ad7d28a..4d19378a0 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2011.01.24 10:00}
+\newcontextversion{2011.01.24 23:51}
%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/cont-nl.mkii b/tex/context/base/cont-nl.mkii
new file mode 100644
index 000000000..f013c0d79
--- /dev/null
+++ b/tex/context/base/cont-nl.mkii
@@ -0,0 +1,28 @@
+%D \module
+%D [ file=cont-nl,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ Dutch Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{dutch}
+
+\input context.mkii
+
+\unprotect
+
+\setupcurrentlanguage[\s!nl]
+
+\setupencoding[default=ec]
+
+\usetypescript[fallback][\defaultencoding]
+
+\setupbodyfont[rm,12pt]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-nl.mkiv b/tex/context/base/cont-nl.mkiv
new file mode 100644
index 000000000..4b64b6aeb
--- /dev/null
+++ b/tex/context/base/cont-nl.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-nl,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ Dutch Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{dutch}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!nl]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-nl.tex b/tex/context/base/cont-nl.tex
deleted file mode 100644
index 1b02d4242..000000000
--- a/tex/context/base/cont-nl.tex
+++ /dev/null
@@ -1,40 +0,0 @@
-%D \module
-%D [ file=cont-nl,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Dutch Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{dutch}
-
-\input context.tex
-
-\unprotect
-
-\setupcurrentlanguage[\s!nl]
-
-\installlanguage [\s!us] [\c!state=\v!start]
-\installlanguage [\s!gb] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!fr] [\c!state=\v!start]
-\installlanguage [\s!es] [\c!state=\v!start]
-\installlanguage [\s!nl] [\c!state=\v!start]
-\installlanguage [\s!it] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
- % will be runtime option: typeface
- \appendtoks
- \usetypescript[modern]
- \setuptypeface[modern]
- \to \everyjob
-\else
- \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-\fi
-
-\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-pe.mkiv b/tex/context/base/cont-pe.mkiv
new file mode 100644
index 000000000..a6f259ea4
--- /dev/null
+++ b/tex/context/base/cont-pe.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-en,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ English Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{persian} \def\messageinterface{english}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!pe]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-pe.tex b/tex/context/base/cont-pe.tex
deleted file mode 100644
index cd3557f9c..000000000
--- a/tex/context/base/cont-pe.tex
+++ /dev/null
@@ -1,43 +0,0 @@
-%D \module
-%D [ file=cont-en,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ English Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{persian} \def\messageinterface{english}
-
-\input context.tex
-
-\unprotect
-
-\setupcurrentlanguage[\s!pe]
-
-% Do we need more defaults? or maybe all languages?
-
-\installlanguage [\s!us] [\c!state=\v!start]
-\installlanguage [\s!gb] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!fr] [\c!state=\v!start]
-\installlanguage [\s!es] [\c!state=\v!start]
-\installlanguage [\s!it] [\c!state=\v!start]
-\installlanguage [\s!nl] [\c!state=\v!start]
-\installlanguage [\s!pe] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
- % will be runtime option: typeface
- \appendtoks
- \usetypescript[modern]
- \setuptypeface[modern]
- \to \everyjob
-\else
- \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-\fi
-
-\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-ro.tex b/tex/context/base/cont-ro.mkii
index 0b1dc2c09..84c31167b 100644
--- a/tex/context/base/cont-ro.tex
+++ b/tex/context/base/cont-ro.mkii
@@ -13,24 +13,16 @@
\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{romanian}
-\input context.tex
+\input context.mkii
\unprotect
\setupcurrentlanguage[\s!ro]
-\installlanguage [\s!en] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!ro] [\c!state=\v!start]
-
-\ifnum\texengine=\luatexengine
- % will be runtime option: typeface
- \appendtoks
- \usetypescript[modern]
- \setuptypeface[modern]
- \to \everyjob
-\else
- \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-\fi
+\setupencoding[default=ec]
+
+\usetypescript[fallback][\defaultencoding]
+
+\setupbodyfont[rm,12pt]
\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/cont-ro.mkiv b/tex/context/base/cont-ro.mkiv
new file mode 100644
index 000000000..d52bd1e3a
--- /dev/null
+++ b/tex/context/base/cont-ro.mkiv
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=cont-ro,
+%D version=2000.01.09,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ Romanian Format Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{romanian}
+
+\input context.mkiv
+
+\unprotect
+
+\setupcurrentlanguage[\s!ro]
+
+\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index db0f1a210..b45b5e22e 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -11,11 +11,39 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+
+%D From the next string (which is set by the script that assembles the
+%D distribution) later on we will calculate a number that can be used
+%D by use modules to identify the feature level. Starting with version
+%D 2004.8.30 the low level interface is english. Watch out and adapt
+%D your styles an modules.
+
+\edef\contextformat {\jobname}
+\edef\contextversion{2011.01.24 23:51}
+
+%D For those who want to use this:
+
+\let\fmtname \contextformat
+\let\fmtversion\contextversion
+
+%D Loading:
+
+\edef\mksuffix {mkii}
+\edef\contextmark{MKII}
+
+\ifx\normalinput\undefined \let\normalinput\input \fi
+
+\def\loadcorefile#1{\normalinput#1\relax}
+\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax}
+\def\loadmkiifile#1{\normalinput#1\relax}
+\def\loadmkivfile#1{}
+
%D First we load the system modules. These implement a lot of
%D manipulation macros. The first one loads \PLAIN\ \TEX, as
%D minimal as possible.
-\loadcorefile{syst-ini}
+\loadmarkfile{syst-ini}
\loadmarkfile{syst-pln}
\loadmarkfile{norm-tex}
@@ -348,12 +376,12 @@
%D These macros are loaded last since they overload and|/|or
%D extend previously defined ones.
-\loadcorefile{xtag-ini}
-\loadcorefile{xtag-ext}
-\loadcorefile{xtag-exp}
-\loadcorefile{xtag-pre}
-\loadcorefile{xtag-xsd}
-\loadcorefile{xtag-rng}
+\loadmarkfile{xtag-ini}
+\loadmarkfile{xtag-ext}
+\loadmarkfile{xtag-exp}
+\loadmarkfile{xtag-pre}
+\loadmarkfile{xtag-xsd}
+\loadmarkfile{xtag-rng}
%D How about this:
@@ -362,7 +390,7 @@
%D \TEX\ related logo's are always typeset in a special way.
%D Here they come:
-\loadcorefile{cont-log}
+\loadmarkfile{cont-log}
%D This one overloads af few things:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index f0c6417cf..040247a97 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -11,11 +11,39 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+
+%D From the next string (which is set by the script that assembles the
+%D distribution) later on we will calculate a number that can be used
+%D by use modules to identify the feature level. Starting with version
+%D 2004.8.30 the low level interface is english. Watch out and adapt
+%D your styles an modules.
+
+\edef\contextformat {\jobname}
+\edef\contextversion{2011.01.24 23:51}
+
+%D For those who want to use this:
+
+\let\fmtname \contextformat
+\let\fmtversion\contextversion
+
+%D Loading:
+
+\edef\mksuffix {mkiv}
+\edef\contextmark{MKIV}
+
+\ifx\normalinput\undefined \let\normalinput\input \fi
+
+\def\loadcorefile#1{\normalinput#1\relax}
+\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax}
+\def\loadmkiifile#1{}
+\def\loadmkivfile#1{\normalinput#1\relax}
+
%D First we load the system modules. These implement a lot of
%D manipulation macros. We start with setting up some basic \TEX\
%D machinery.
-\loadcorefile{syst-ini}
+\loadmarkfile{syst-ini}
%D We just quit if new functionality is expected.
@@ -138,24 +166,7 @@
\loadmarkfile{lang-mis}
\loadmarkfile{lang-url}
-
-\loadmarkfile{lang-ger}
-\loadmarkfile{lang-ita}
-\loadmarkfile{lang-sla}
-\loadmarkfile{lang-alt}
-\loadmarkfile{lang-ana}
-\loadmarkfile{lang-art}
-\loadmarkfile{lang-bal}
-\loadmarkfile{lang-cel}
-\loadmarkfile{lang-grk}
-\loadmarkfile{lang-ind}
-\loadmarkfile{lang-ura}
-\loadmarkfile{lang-vn}
-\loadmarkfile{lang-cyr}
-
-\loadmarkfile{lang-ara}
-\loadmarkfile{lang-cjk}
-
+\loadmarkfile{lang-def}
\loadmarkfile{lang-wrd} % can be optional
\loadmarkfile{symb-ini}
@@ -363,7 +374,7 @@
\loadmarkfile{meta-xml}
-\loadcorefile{cont-log}
+\loadmarkfile{cont-log}
\loadmarkfile{task-ini}
@@ -399,7 +410,7 @@
\to \everyjob
\appendtoks
- \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.tex")}% can become automatic
+ \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkiv")}% can become automatic
\to \everydump
\protect \errorstopmode \dump \endinput
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
deleted file mode 100644
index a58bf3377..000000000
--- a/tex/context/base/context.tex
+++ /dev/null
@@ -1,225 +0,0 @@
-%D \module
-%D [ file=context,
-%D version=1995.10.10,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
-
-%D From the next string (which is set by the script that assembles the
-%D distribution) later on we will calculate a number that can be used
-%D by use modules to identify the feature level. Starting with version
-%D 2004.8.30 the low level interface is english. Watch out and adapt
-%D your styles an modules.
-
-\edef\contextformat {\jobname}
-\edef\contextversion{2011.01.24 10:00}
-
-%D For those who want to use this:
-
-\let\fmtname \contextformat
-\let\fmtversion\contextversion
-
-\let\showcontextbanner\relax
-
-%D Here we will test for what branch of source files we will take. The
-%D file suffix depends on the maintream engine: either lua enhanced,
-%D or traditional:
-%D
-%D \starttyping
-%D mki : low level dutch
-%D mkii : low level english
-%D mkiv : lua enhanced
-%D \stoptyping
-%D
-%D There is no \type {mkiii} unless you want to tag the transition
-%D version that way (going completely etex, code cleanup and such).
-
-\ifx\normalinput\undefined \let\normalinput\input \fi
-
-%D We have two versions, one for \PDFTEX\ and \XETEX, and one for
-%D \LUATEX.
-
-\chardef\contextmarkmode = \ifx\directlua\undefined 2 \else 4 \fi
-
-\def\loadcorefile#1{\normalinput#1\relax}
-\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax}
-
-\ifnum\contextmarkmode=4
- \def\loadmarkiifile#1{} \let\loadmarkivfile\loadcorefile \edef\mksuffix {mkiv} \edef\contextmark{MKIV}
-\else
- \def\loadmarkivfile#1{} \let\loadmarkiifile\loadcorefile \edef\mksuffix {mkii} \edef\contextmark{MKII}
-\fi
-
-\let\loadmkiifile\loadmarkiifile
-\let\loadmkivfile\loadmarkivfile
-\let\loadmkfile \loadmarkfile
-
-%D Welcome to the main module. When this module is ran through
-%D \type{initex} or \type {tex -i} or \type {whatevertex} using
-%D \type{whatever switch}, the \CONTEXT\ format file is
-%D generated. During this process the user is asked for an
-%D interface language. Supplying \type{dutch} will generate a
-%D dutch version of \CONTEXT, supplying \type {english} will of
-%D course end op in a english version.
-%D
-%D Another option is to use \TEXEXEC\ (for \MKII):
-%D
-%D \starttyping
-%D texexec --make [--alone] [--engine] [--all]
-%D texexec --make [--alone] [--engine] en nl ... metafun mptopdf
-%D \stoptyping
-%D
-%D More information can be found in the \TEXEXEC\ manual.
-%D
-%D For \MKIV\ you have to do:
-%D
-%D \starttyping
-%D luatools --generate
-%D context --make en nl ...
-%D \stoptyping
-
-%D When you write modules (or extensions) you should avoid
-%D conflicts with existing macro names and mechanisms. If you are
-%D coming from another macro package, don't assume that macros
-%D with the same name are doing the same! \CONTEXT\ was written
-%D from scratch and therefore similarities are often a coincidence
-%D (to some extent one always ends up with the same names for
-%D similar concepts). The underlying models for elementary subsystems
-%D that deal with encodings, languages and fonts probably differ.
-%D
-%D Time has learned that users coming from \LATEX\ should not fall
-%D into thinking that macros like \type {\protect} represent the
-%D same functionality in both systems; actually, due to the way
-%D \CONTEXT\ is set up, some of those macros do complete different
-%D things. Macro packages evolve independent of each other, which
-%D means that code written for one system will not work in another
-%D system, unless it's real generic code.
-%D
-%D An API will become available soon (keep an eye on the ConTeXt
-%D Wiki www.contextgarden.org) and or listen in to the context
-%D mailing list (ntg-context@ntg.nl). Much additional information
-%D can be found at the PRAGMA website (www.pragma-ade.com).
-
-%D We now go either the \MKII\ or \MKIV\ route:
-
-\loadmarkfile{context}
-
-%D Let's quit this file when doing a \type {cont-..} generation.
-
-\doifparentfileelse{context}{\donothing}{\endinput}
-
-%D Unless we're generating a \type {cont-..} format, we also
-%D do the following.
-
-%D Except from english, no hyphenation patterns are loaded
-%D yet. Users can specify their needs in the next module:
-
-\loaduserspecifications
-
-%D Next we default to the same language as the interface.
-
-\unprotect
-
-\installlanguage [\s!us] [\c!state=\v!start]
-
-\startinterface english
- \installlanguage [\s!gb] [\c!state=\v!start]
-\stopinterface
-
-\appendtoks \language [\s!us] \to \everyjob
-\appendtoks \mainlanguage [\s!us] \to \everyjob
-
-\startinterface german
-
- \installlanguage [\s!de] [\c!state=\v!start]
-
- \appendtoks \language [\s!de] \to \everyjob
- \appendtoks \mainlanguage [\s!de] \to \everyjob
-
-\stopinterface
-
-\startinterface dutch
-
- \installlanguage [\s!nl] [\c!state=\v!start]
-
- \appendtoks \language [\s!nl] \to \everyjob
- \appendtoks \mainlanguage [\s!nl] \to \everyjob
-
-\stopinterface
-
-\startinterface czech
-
- \installlanguage [\s!cs] [\c!state=\v!start]
-
- \appendtoks \language [\s!cs] \to \everyjob
- \appendtoks \mainlanguage [\s!cs] \to \everyjob
-
-\stopinterface
-
-\startinterface italian
-
- \installlanguage [\s!it] [\c!state=\v!start]
-
- \appendtoks \language [\s!it] \to \everyjob
- \appendtoks \mainlanguage [\s!it] \to \everyjob
-
-\stopinterface
-
-\startinterface romanian
-
- \installlanguage [\s!ro] [\c!state=\v!start]
-
- \appendtoks \language [\s!ro] \to \everyjob
- \appendtoks \mainlanguage [\s!ro] \to \everyjob
-
-\stopinterface
-
-\startinterface french
-
- \installlanguage [\s!fr] [\c!state=\v!start]
-
- \appendtoks \language [\s!fr] \to \everyjob
- \appendtoks \mainlanguage [\s!fr] \to \everyjob
-
-\stopinterface
-
-\startinterface persian
-
- \installlanguage [\s!pe] [\c!state=\v!start]
-
- \appendtoks \language [\s!pe] \to \everyjob
- \appendtoks \mainlanguage [\s!pe] \to \everyjob
-
-\stopinterface
-
-\protect
-
-%D Finally we (pre)load some fonts.
-
-\setupencoding[default=ec]
-
-\usetypescript[fallback][\defaultencoding]
-
-\setupbodyfont[rm,12pt]
-
-%D The next hook can be used to generate a local (extended)
-%D format. This file is only searched for at the current
-%D path.
-
-% \readlocfile{cont-def.tex}
-% {\writestatus{loading}{adding extensions from cont-def}}
-% {}
-
-%D Now dumping the format is all that's left to be done.
-
-\errorstopmode \dump
-
-\endinput
diff --git a/tex/context/base/core-fil.mkii b/tex/context/base/core-fil.mkii
index ad22ade1e..0355920c7 100644
--- a/tex/context/base/core-fil.mkii
+++ b/tex/context/base/core-fil.mkii
@@ -324,7 +324,7 @@
\startreadingfile
\startnointerference % \bgroup
\cleanupfeatures % better \setnormalcatcodes / test first
- \readfile{#2}\donothing\donothing
+ \readfile{#2.\mksuffix}\donothing\donothing
\stopnointerference % \egroup
\stopreadingfile
\doglobal\setflag{#2}}%
diff --git a/tex/context/base/core-fil.mkiv b/tex/context/base/core-fil.mkiv
index ac3f88d26..e54095bb1 100644
--- a/tex/context/base/core-fil.mkiv
+++ b/tex/context/base/core-fil.mkiv
@@ -212,7 +212,7 @@
\startreadingfile
\startnointerference % \bgroup
\cleanupfeatures % better \setnormalcatcodes / test first
- \readfile{#2}\donothing\donothing
+ \readfile{#2.\mksuffix}\donothing\donothing
\stopnointerference % \egroup
\stopreadingfile
\doglobal\setflag{#2}}%
diff --git a/tex/context/base/enco-ini.mkii b/tex/context/base/enco-ini.mkii
index 33825f94d..a277e7450 100644
--- a/tex/context/base/enco-ini.mkii
+++ b/tex/context/base/enco-ini.mkii
@@ -747,11 +747,11 @@
%D can be used to check the correct loading of hyphenation
%D patterns.
-\fetchruntimecommand \showaccents {\f!encodingprefix\s!run.mkii}
-\fetchruntimecommand \showcharacters {\f!encodingprefix\s!run.mkii}
-\fetchruntimecommand \showcharacterbounds {\f!encodingprefix\s!run.mkii}
-\fetchruntimecommand \showhyphenations {\f!encodingprefix\s!run.mkii}
-\fetchruntimecommand \showmapping {\f!encodingprefix\s!run.mkii}
+\fetchruntimecommand \showaccents {\f!encodingprefix\s!run}
+\fetchruntimecommand \showcharacters {\f!encodingprefix\s!run}
+\fetchruntimecommand \showcharacterbounds {\f!encodingprefix\s!run}
+\fetchruntimecommand \showhyphenations {\f!encodingprefix\s!run}
+\fetchruntimecommand \showmapping {\f!encodingprefix\s!run}
%D \macros
%D {everyuppercase, EveryUppercase,
diff --git a/tex/context/base/font-ini.mkii b/tex/context/base/font-ini.mkii
index e0b7a3e4e..7b84125fa 100644
--- a/tex/context/base/font-ini.mkii
+++ b/tex/context/base/font-ini.mkii
@@ -3663,7 +3663,7 @@
%D The implementation is rather straightforward in using
%D \type{\halign}.
-\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run}
%D \macros
%D {showfontstrip, testminimalbaseline, showminimalbaseline}
@@ -3674,9 +3674,9 @@
%D
%D \showfontstrip \blank \showminimalbaseline
-\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run}
+\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run}
+\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run}
%D \macros
%D {showkerning}
@@ -3685,7 +3685,7 @@
%D
%D \showkerning{Can you guess what kerning is?}
-\fetchruntimecommand \showkerning {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showkerning {\f!fontprefix\s!run}
%D \macros
%D {showbodyfontenvironment}
@@ -3698,7 +3698,7 @@
%D
%D \showsetup{showbodyfontenvironment}
-\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run}
%D \macros
%D {showfont,showfontstyle,showligatures}
@@ -3719,11 +3719,11 @@
% to be internationalized
-\fetchruntimecommand \showfont {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showligature {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showligatures {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showcharratio {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showfont {\f!fontprefix\s!run}
+\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run}
+\fetchruntimecommand \showligature {\f!fontprefix\s!run}
+\fetchruntimecommand \showligatures {\f!fontprefix\s!run}
+\fetchruntimecommand \showcharratio {\f!fontprefix\s!run}
%D \macros
%D {getglyph, symbolicfont}
diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv
index f0f63f465..ffd099318 100644
--- a/tex/context/base/font-ini.mkiv
+++ b/tex/context/base/font-ini.mkiv
@@ -3554,7 +3554,7 @@
%D The implementation is rather straightforward in using
%D \type{\halign}.
-\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run}
%D \macros
%D {showfontstrip, testminimalbaseline, showminimalbaseline}
@@ -3565,9 +3565,9 @@
%D
%D \showfontstrip \blank \showminimalbaseline
-\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run.mkiv}
-\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run.mkiv}
-\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run}
+\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run}
+\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run}
%D \macros
%D {showkerning}
@@ -3576,7 +3576,7 @@
%D
%D \showkerning{Can you guess what kerning is?}
-\fetchruntimecommand \showkerning {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showkerning {\f!fontprefix\s!run}
%D \macros
%D {showbodyfontenvironment}
@@ -3589,7 +3589,7 @@
%D
%D \showsetup{showbodyfontenvironment}
-\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run}
%D \macros
%D {showfont,showfontstyle,showligatures}
@@ -3605,11 +3605,11 @@
% to be internationalized
-\fetchruntimecommand \showfont {\f!fontprefix\s!run.mkiv}
-\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run.mkiv}
-\fetchruntimecommand \showligature {\f!fontprefix\s!run.mkiv}
-\fetchruntimecommand \showligatures {\f!fontprefix\s!run.mkiv}
-\fetchruntimecommand \showcharratio {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showfont {\f!fontprefix\s!run}
+\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run}
+\fetchruntimecommand \showligature {\f!fontprefix\s!run}
+\fetchruntimecommand \showligatures {\f!fontprefix\s!run}
+\fetchruntimecommand \showcharratio {\f!fontprefix\s!run}
%D \macros
%D {getglyph, symbolicfont}
diff --git a/tex/context/base/java-ans.tex b/tex/context/base/java-ans.mkii
index 636c894f9..636c894f9 100644
--- a/tex/context/base/java-ans.tex
+++ b/tex/context/base/java-ans.mkii
diff --git a/tex/context/base/java-exa.tex b/tex/context/base/java-exa.mkii
index f40f70f84..f40f70f84 100644
--- a/tex/context/base/java-exa.tex
+++ b/tex/context/base/java-exa.mkii
diff --git a/tex/context/base/java-fil.tex b/tex/context/base/java-fil.mkii
index 4d79a2ace..4d79a2ace 100644
--- a/tex/context/base/java-fil.tex
+++ b/tex/context/base/java-fil.mkii
diff --git a/tex/context/base/java-fld.tex b/tex/context/base/java-fld.mkii
index 93a90dc0a..93a90dc0a 100644
--- a/tex/context/base/java-fld.tex
+++ b/tex/context/base/java-fld.mkii
diff --git a/tex/context/base/java-imp-ans.mkiv b/tex/context/base/java-imp-ans.mkiv
new file mode 100644
index 000000000..636c894f9
--- /dev/null
+++ b/tex/context/base/java-imp-ans.mkiv
@@ -0,0 +1,28 @@
+%D \module
+%D [ file=java-ans,
+%D version=1998.06.01,
+%D title=\CONTEXT\ JavaScript Macros,
+%D subtitle=Answer Analization,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startJSpreamble{Do_Check_Answer} used later
+
+ function Do_Check_Answer (field, value)
+ { if (event.value.toLowerCase()==value.toLowerCase())
+ { event.target.hidden = true }
+ % { event.target.display = display.hidden }
+ return("\040") } // funny, "" does not work
+
+\stopJSpreamble
+
+\startJScode{Check_Answer} uses {Do_Check_Answer}
+ event.value = Do_Check_Answer(JS_S_1, JS_S_2) ;
+\stopJScode
+
+\endinput
diff --git a/tex/context/base/java-imp-exa.mkiv b/tex/context/base/java-imp-exa.mkiv
new file mode 100644
index 000000000..f40f70f84
--- /dev/null
+++ b/tex/context/base/java-imp-exa.mkiv
@@ -0,0 +1,395 @@
+%D \module
+%D [ file=java-exa,
+%D version=2002.??.??,
+%D title=\CONTEXT\ JavaScript Macros,
+%D subtitle=Example Support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% XFDF versus HTML
+% localhost versus remote versus set
+
+% filename | filename-nr => name
+% fakename | fakename-nr => file upload, unless localhost
+%
+% we erase the list because otherwise we end up in browser remembering
+% problems; also, it is not possible to set upload fields 'manually'
+
+\startJSpreamble request_1 used now
+
+ var example_method = "HTML" ;
+ var example_host = "" ;
+ var example_port = "" ;
+ var example_url = "" ;
+ var example_file = "" ;
+
+ var example_log = true ; % false
+
+ function stripped_exa_value( name ) {
+ f = this.getField(name) ;
+ if (f) {
+ str = f.value ;
+ if (str.indexOf(name+'-')==0) {
+ str = str.substr(name.length+1) ;
+ }
+ return str ;
+ } else {
+ return "" ;
+ }
+ }
+
+ function identify_example_url ( ) {
+ if (example_log) {
+ console.clear ;
+ console.println("base url: "+this.baseURL) ;
+ console.println("this url: "+this.URL) ;
+ }
+ if (this.baseURL != "") {
+ example_url = this.baseURL ;
+ } else {
+ if (this.URL != "") {
+ example_url = this.URL
+ }
+ }
+ if (example_url.indexOf("file://")>=0) {
+ example_url = "" ;
+ }
+ str = stripped_exa_value("examplehost") ;
+ if (str != "auto") {
+ example_host = str ;
+ if (str == "localhost") {
+ example_port = "8061"
+ }
+ }
+ str = stripped_exa_value("exampleport") ;
+ if (str != "auto") {
+ example_port = str ;
+ }
+ if (example_log) {
+ console.println("example_url: "+example_url) ;
+ console.println("example_host: "+example_host) ;
+ console.println("example_port: "+example_port) ;
+ }
+ }
+
+ function check_example_url ( url ) {
+ if (url.indexOf("file://")>=0) {
+ url = "http://localhost:8061" ;
+ console.println("file url replaced by: "+url) ;
+ } else {
+ if (url.indexOf("://")<0) {
+ url = "http://" + url ;
+ }
+ if (example_log) {
+ console.println("url before check: "+url) ;
+ }
+% url = url.replace(/(http:\\\/\\\/.+)(\\\/.*$)/, "$1") ;
+ url = url.replace(/(https*:\\\/\\\/.+?)(\\\/.*$)/, "$1/exarequest") ;
+ if (example_log) {
+ console.println("url after check: "+url) ;
+ }
+ }
+ return url ;
+ }
+
+ function set_example_xfdf ( method ) {
+ example_method = method ;
+ }
+
+ function set_example_file ( file ) {
+ example_method = file ;
+ }
+
+ function set_example_host ( host ) {
+ example_host = host ;
+ }
+
+ function set_example_port ( port ) {
+ example_host = host ;
+ }
+
+ function do_erase_example_file(tag) {
+ f = this.getField(tag) ;
+ if (f) {
+ f.value = "" ;
+ }
+ }
+
+ function do_erase_example_list(tag) {
+ for (i=1;i<=100;i++) {
+ f = this.getField(tag+"-"+i) ;
+ if (f) {
+ f.value = "" ;
+ } else {
+ return
+ }
+ }
+ }
+
+ function do_submit_example_url ( url ) {
+ if ((example_method == "XFDF" ) || (url.indexOf("localhost")>=0)) {
+ do_erase_example_file("fakename") ;
+ do_erase_example_list("fakename") ;
+ }
+ url = check_example_url(url) ;
+ if (example_log) {
+ console.println("submitting form to "+url+" using method "+example_method) ;
+ }
+ if (example_file != "") {
+ url = url + "/" + example_file ;
+ }
+ % we need the bFDF for acrobat 5
+ this.submitForm({cURL : url, bFDF : false, cSubmitAs : example_method}) ;
+ }
+
+ function submit_example_form ( ) {
+ identify_example_url() ;
+ if (example_host != "") {
+ if (example_port != "") {
+ do_submit_example_url(example_host+":"+example_port) ;
+ } else {
+ do_submit_example_url(example_host) ;
+ }
+ } else {
+ if (example_url != "") {
+ do_submit_example_url(example_url) ;
+ } else {
+ if (example_port != "") {
+ do_submit_example_url("localhost"+":"+example_port) ;
+ } else {
+ do_submit_example_url("localhost:8061") ; % local exampler
+ }
+ }
+ }
+ resetfilename () ;
+ }
+
+ function submit_form ( host, port) {
+ set_example_host(host) ;
+ set_example_post(post) ;
+ submit_example_form ;
+ }
+
+\stopJSpreamble
+
+\startJSpreamble request_2 used now
+
+ var exa_command = "" ;
+ var exa_option = "" ;
+ var exa_filename = "" ;
+ var exa_filelist = "" ;
+ var exa_registered = "" ;
+
+ function set_request (command,option) {
+ exa_command = command ;
+ if (exa_command == "") {
+ exa_option = option ;
+ } else { if (option == "") {
+ exa_option = "" ;
+ } else { if (option.indexOf("--")<0) {
+ exa_option = "--action=" + option ;
+ } else {
+ exa_option = option ;
+ } } }
+ }
+
+ function assemble_request ( ) {
+ v = this.getField('filename') ;
+ if (v) {
+ exa_filename = v.value ;
+ }
+ v = this.getField('filelist') ;
+ if (v) {
+ exa_filelist = v.value ;
+ }
+% exa_filename = exa_filename.replace(/\\\\/g,'/') ;
+% exa_filelist = exa_filelist.replace(/\\\\/g,'/') ;
+ str = "<?xml version='1.0' ?>\\n" ;
+ str = str+"<exa:request xmlns:exa='http://www.pragma-ade.com/schemas/example.rng'><exa:application>" ;
+ if (exa_filelist == "") {
+ exa_filelist = exa_registered ;
+ } else { if (exa_registered != "") {
+ exa_filelist = exa_filelist + "\\n" + exa_registered ;
+ } }
+ if (exa_command != "") {
+ str = str+"<exa:command>"+exa_command+"</exa:command>" ;
+ }
+ if (exa_option != "") {
+ str = str+"<exa:option>"+exa_option+"</exa:option>" ;
+ }
+ if (exa_filename != "") {
+ str = str+"<exa:filename>"+exa_filename+"</exa:filename>" ;
+ }
+ var fls = "" ;
+ if (exa_filelist != "") {
+ % old method, soon obsolete
+ lst = exa_filelist.split(/\\s/) ;
+ for (i=0;i<lst.length;i++) {
+ fls = fls+"<exa:entry>"+lst[i]+"</exa:entry>" ;
+ }
+ } else { if (exa_multiple) {
+ for (i=1;i<=100;i++) {
+ % console.println("file field "+i) ;
+ f = this.getField("filename-"+ i) ;
+% if (f) { if (f.value != "") {
+% if (g) { if (g.value == "") {
+% fls = fls+"<exa:entry>"+f.value+"</exa:entry>" ;
+% } else {
+% fls = fls+"<exa:entry label='" + g.value + "'>"+f.value+"</exa:entry>" ;
+% } } else {
+% fls = fls+"<exa:entry>"+f.value+"</exa:entry>" ;
+% }
+% } }
+ if (f) { if (f.value != "") {
+ fls = fls + "<exa:entry" ;
+ g = this.getField("dataname-"+ i) ;
+ if (g) { if (g.value == "") {
+ % console.println("a") ;
+ fls = fls + ">" ;
+ } else {
+ % console.println("b") ;
+ fls = fls + " label='" + g.value + "'>" ;
+ } } else {
+ % console.println("c") ;
+ fls = fls + ">" ;
+ }
+ fls = fls + f.value + "</exa:entry>" ;
+ } }
+ }
+ } }
+ if (fls != "") {
+ str = str + "<exa:filelist>" + fls + "</exa:filelist>" ;
+ }
+ str = str + "</exa:application></exa:request>" ;
+ v = this.getField('exa:request') ;
+ if (v) {
+ v.value = str ;
+ }
+ }
+
+\stopJSpreamble
+
+\startJSpreamble request_3 used now
+
+ var exa_multiple = false ;
+
+ function setfilename ( suffixes ) {
+ if (event.targetName) {
+ var name = event.targetName ;
+ var fake = name.replace(/filename/,"fakename") ;
+ } else {
+ var name = 'filename' ;
+ var fake = 'fakename' ;
+ }
+ f = this.getField(fake) ;
+ if (f) {
+ f.browseForFileToSubmit() ;
+ if ((suffixes != "") && (f.value != "")) {
+ %
+ s = suffixes.replace(/,/g,"|") ;
+ r = new RegExp() ;
+ s = "\\\\.(" + s + ")$" ;
+ r.compile(s, "i") ;
+ if (f.value.search(r)<=0) {
+ f.value = "" ;
+ app.alert('This filetype is not permitted.') ;
+ %
+ % lst = suffixes.split(/,/) ;
+ % ok = false ;
+ % for (i=0;i<lst.length;i++) {
+ % if (f.value == lst[i]) {
+ % ok = true ;
+ % }
+ % }
+ % if (! ok) {
+ % f.value = "" ;
+ % app.alert('This filetype is not permitted.') ;
+ %
+ }
+ }
+ g = this.getField(name) ;
+ if (g) {
+ g.value = f.value ;
+ }
+% we need to set the value of the selector to empty else
+% we get some funny preloading of multimeg files in spite
+% of the specs that say that xml fields will not get sent
+% if (example_method == "XFDF" ) {
+% f.value = "" ;
+% } else {
+% identify_example_url ;
+% if (example_url.indexOf("localhost")>=0) {
+% f.value = "" ;
+% }
+% }
+ }
+ this.dirty = false ;
+ }
+
+ function addfilename () {
+ if (exa_multiple) {
+ h = this.getField("filelist") ;
+ g = this.getField("filename") ;
+ if ((g) && (h)) {
+ str = g.value ;
+ if (h.value == "") {
+ h.value = str ;
+ } else {
+ h.value = h.value + "\\n" + str ;
+ }
+ g.value = "" ;
+ this.value = "" ;
+ }
+ }
+ this.dirty = false ;
+ }
+
+ % this only works with client that assembles request
+
+ function registerfilename (str) {
+ if (str!="") {
+ h = this.getField("filelist") ;
+ if (h) {
+ if (h.value != "") {
+ h.value = h.value + "\\n" ;
+ }
+ h.value = h.value + str ;
+ } else {
+ if (exa_registered != "") {
+ exa_registered = exa_registered + "\\n" ;
+ }
+ exa_registered = exa_registered + str ;
+ }
+ }
+ console.show ;
+ console.println('registered files') ;
+ console.println("file: "+str) ;
+ console.println("list: "+exa_registered) ;
+ this.dirty = false ;
+ }
+
+ function checkfilename () {
+ }
+
+ function getfilename ( suffixes ) {
+ setfilename(suffixes) ;
+ checkfilename() ;
+ addfilename() ;
+ }
+
+ function resetfilename () {
+ do_erase_example_file("fakename") ;
+ do_erase_example_file("filename") ;
+ do_erase_example_file("filelist") ;
+ do_erase_example_list("filename") ;
+ do_erase_example_list("fakename") ;
+ }
+
+\stopJSpreamble
+
+\endinput
diff --git a/tex/context/base/java-imp-fil.mkiv b/tex/context/base/java-imp-fil.mkiv
new file mode 100644
index 000000000..4d79a2ace
--- /dev/null
+++ b/tex/context/base/java-imp-fil.mkiv
@@ -0,0 +1,48 @@
+%D \module
+%D [ file=java-fil,
+%D version=1998.06.01,
+%D title=\CONTEXT\ JavaScript Macros,
+%D subtitle=Filing and Printing,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startJSpreamble Auxiliary used now
+
+ function DocumentFileName ()
+ { var Paths = this.path.split("/") ;
+ Paths = Paths[Paths.length-1].split(".") ;
+ return(Paths[0]) }
+
+ function Print_Page_Range(From, To) % gaat mis, nog geen args mogelijk
+ { if ((Number(From)>0)&&(Number(To)>=Number(From)))
+ { var myFrom = Number(From)-1 ;
+ var myTo = Number(To)-1 ;
+ this.print(false,myFrom,myTo,true) } }
+
+ function Print_This_Page ()
+ { this.print(false,this.pageNum,this.pageNum,true) }
+
+\stopJSpreamble
+
+\definereference
+ [PrintSubPaginas]
+ [JS(Print_Page_Range{\firstsubpage,\lastsubpage})]
+
+\definereference
+ [PrintSubPages]
+ [JS(Print_Page_Range{\firstsubpage,\lastsubpage})]
+
+\definereference
+ [PrintDezePagina]
+ [JS(Print_This_Page)]
+
+\definereference
+ [PrintThisPage]
+ [JS(Print_This_Page)]
+
+\endinput
diff --git a/tex/context/base/java-imp-fld.mkiv b/tex/context/base/java-imp-fld.mkiv
new file mode 100644
index 000000000..93a90dc0a
--- /dev/null
+++ b/tex/context/base/java-imp-fld.mkiv
@@ -0,0 +1,475 @@
+%D \module
+%D [ file=java-fld,
+%D version=1998.05.20,
+%D title=\CONTEXT\ JavaScript Macros,
+%D subtitle=Field Support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% will be simplified, since we now parse functions
+
+% nu nog alles geladen, moet dus anders
+
+\startJSpreamble {Sanitize_TeX_Input} used later
+
+ function Sanitized_TeX_String (value)
+ { var v = value ;
+ v = v.replace( /\\\\oe/g,"\\234") ;
+ v = v.replace( /\\\\<</g,"\\253") ;
+ v = v.replace( /\\\\>>/g,"\\273") ;
+ v = v.replace( /\\\\`A/g,"\\300") ;
+ v = v.replace( /\\\\'A/g,"\\301") ;
+ v = v.replace( /\\\\^A/g,"\\302") ;
+ v = v.replace( /\\\\~A/g,"\\303") ;
+ v = v.replace( /\\\\"A/g,"\\304") ;
+ v = v.replace( /\\\\oA/g,"\\305") ;
+ v = v.replace( /\\\\AE/g,"\\306") ;
+ v = v.replace( /\\\\,C/g,"\\307") ;
+ v = v.replace( /\\\\`E/g,"\\310") ;
+ v = v.replace( /\\\\'E/g,"\\311") ;
+ v = v.replace( /\\\\^E/g,"\\312") ;
+ v = v.replace( /\\\\"E/g,"\\313") ;
+ v = v.replace( /\\\\`I/g,"\\314") ;
+ v = v.replace( /\\\\'I/g,"\\315") ;
+ v = v.replace( /\\\\^I/g,"\\316") ;
+ v = v.replace( /\\\\"I/g,"\\317") ;
+ v = v.replace( /\\\\~N/g,"\\321") ;
+ v = v.replace( /\\\\`O/g,"\\322") ;
+ v = v.replace( /\\\\'O/g,"\\323") ;
+ v = v.replace( /\\\\^O/g,"\\324") ;
+ v = v.replace( /\\\\~O/g,"\\325") ;
+ v = v.replace( /\\\\"O/g,"\\326") ;
+ v = v.replace( /\\\\`U/g,"\\331") ;
+ v = v.replace( /\\\\'U/g,"\\332") ;
+ v = v.replace( /\\\\^U/g,"\\333") ;
+ v = v.replace( /\\\\"U/g,"\\334") ;
+ v = v.replace( /\\\\'Y/g,"\\335") ;
+ v = v.replace( /\\\\ss/g,"\\337") ;
+ v = v.replace( /\\\\`a/g,"\\340") ;
+ v = v.replace( /\\\\'a/g,"\\341") ;
+ v = v.replace( /\\\\^a/g,"\\342") ;
+ v = v.replace( /\\\\~a/g,"\\343") ;
+ v = v.replace( /\\\\"a/g,"\\344") ;
+ v = v.replace( /\\\\oa/g,"\\345") ;
+ v = v.replace( /\\\\ae/g,"\\346") ;
+ v = v.replace( /\\\\,c/g,"\\347") ;
+ v = v.replace( /\\\\`e/g,"\\350") ;
+ v = v.replace( /\\\\'e/g,"\\351") ;
+ v = v.replace( /\\\\^e/g,"\\352") ;
+ v = v.replace( /\\\\"e/g,"\\353") ;
+ v = v.replace( /\\\\`i/g,"\\354") ;
+ v = v.replace( /\\\\'i/g,"\\355") ;
+ v = v.replace( /\\\\^i/g,"\\356") ;
+ v = v.replace( /\\\\"i/g,"\\357") ;
+ v = v.replace( /\\\\~n/g,"\\361") ;
+ v = v.replace( /\\\\`o/g,"\\362") ;
+ v = v.replace( /\\\\'o/g,"\\363") ;
+ v = v.replace( /\\\\^o/g,"\\364") ;
+ v = v.replace( /\\\\~o/g,"\\365") ;
+ v = v.replace( /\\\\"o/g,"\\366") ;
+ v = v.replace( /\\\\`u/g,"\\371") ;
+ v = v.replace( /\\\\'u/g,"\\372") ;
+ v = v.replace( /\\\\^u/g,"\\373") ;
+ v = v.replace( /\\\\"u/g,"\\374") ;
+ v = v.replace( /\\\\'y/g,"\\375") ;
+ v = v.replace( /\\\\"y/g,"\\377") ;
+ return(v) }
+
+ var TeX_Key_Mode = 0 ;
+
+ function Initialize_TeX_Keystroke ()
+ { TeX_Key_Char = "" ;
+ TeX_Key_Mode = 0 }
+
+ function Sanitized_TeX_Keystroke (change)
+ { if (change=="\\\\")
+ { TeX_Key_Mode = 1 ;
+ return("") }
+ else if (TeX_Key_Mode==1)
+ { TeX_Key_Mode = 2 ;
+ TeX_Key_Char = change ;
+ return("") }
+ else if (TeX_Key_Mode==2)
+ { TeX_Key_Mode = 0 ;
+ TeX_Key_Char = "\\\\"+TeX_Key_Char+change ;
+ return(Sanitized_TeX_String(TeX_Key_Char)) }
+ else
+ { TeX_Key_Mode = 0 ;
+ return(change) } }
+
+\stopJSpreamble
+
+\startJScode {Initialize_TeX_Key} uses {Sanitize_TeX_Input}
+ Initialize_TeX_Keystroke() ;
+\stopJScode
+
+\startJScode {Convert_TeX_Key} uses {Sanitize_TeX_Input}
+ if (!event.willCommit)
+ { event.change = Sanitized_TeX_Keystroke(event.change) }
+\stopJScode
+
+\startJScode{Convert_TeX_String} uses {Sanitize_TeX_Input}
+ event.value = Sanitized_TeX_String(event.value) ;
+\stopJScode
+
+\startJSpreamble fields_1 used now
+
+var visible_field = new Array() ;
+var visible_fields = 0 ;
+
+function PresetFields ( )
+ { this.syncAnnotScan() }
+
+function Preset_Fields ( )
+ { this.syncAnnotScan() }
+
+function Hide_When_Down ( )
+ { event.target.hidden = true }
+
+function Hide_Field ( Name )
+ { var v = this.getField(Name) ;
+ if (v)
+ { v.hidden = true ;
+ v.readonly = true ;
+ this.dirty = false } }
+
+function Do_Vide_Field ( Name, Closable )
+ { var v = this.getField(Name) ;
+ if (v)
+ { ++visible_fields ;
+ visible_field[visible_fields] = Name ;
+ v.hidden = false ;
+ if (Closable)
+ { v.readonly = false ;
+ v.value = "On" }
+ this.dirty = false } }
+
+function Vide_Field ( Name )
+ { Do_Vide_Field(Name,false) }
+
+function Vide_Hide_Field ( Name )
+ { Do_Vide_Field(Name,true) }
+
+function Hide_Fields ()
+ { while (visible_fields>0)
+ { Hide_Field(visible_field[visible_fields]) ;
+ --visible_fields } }
+
+function Vide_Fields ( Name )
+ { Hide_Fields () ;
+ Vide_Field ( Name) }
+
+function Vide_Hide_Fields ( Name )
+ { Hide_Fields () ;
+ Vide_Hide_Field ( Name) }
+
+function Toggle_Hide ( Name )
+ { var v = this.getField(Name) ;
+ if (v)
+ { v.hidden = !v.hidden ;
+ this.dirty = false } }
+
+function Field_On ( Name )
+ { v = this.getField(Name) ;
+ if (v) { v.value = "On" ; this.dirty = false } }
+
+function Field_Off ( Name )
+ { var v = this.getField(Name) ;
+ if (v) { v.value = "Off" ; this.dirty = false } }
+
+function Toggle_Value ( Name )
+ { var v = this.getField(Name) ;
+ if (v)
+ { if (v.value=="On")
+ { v.value = "Off" }
+ else
+ { v.value = "On" } }
+ this.dirty = false }
+
+function Toggle_Read ( Name )
+ { var v = this.getField(Name);
+ if (v) { v.readonly = !v.readonly } }
+
+function Flip_Fields ( Name )
+ { var Names = Name.split(",") ;
+ for (var i=0;i<Names.length;i++)
+ { v = this.getField(Names[i]) ;
+ if (v)
+ { v.hidden = !v.hidden ;
+ v.value = "On" } } }
+
+function Forget_Changes ()
+ { this.dirty = false }
+
+function ForgetChanges ()
+ { this.dirty = false }
+\stopJSpreamble
+
+%\startJScode{Hide_When_Down} Hide_When_Down() \stopJScode
+%\startJScode{Hide_Field} Hide_Field(JS_S_1) \stopJScode
+%\startJScode{Vide_Field} Vide_Field(JS_S_1) \stopJScode
+%\startJScode{Toggle_Hide} Toggle_Hide(JS_S_1) \stopJScode
+%\startJScode{Field_On} Field_On(JS_S_1) \stopJScode
+%\startJScode{Field_Off} Field_Off(JS_S_1) \stopJScode
+%\startJScode{Toggle_Value} Toggle_Value(JS_S_1) \stopJScode
+%\startJScode{Toggle_Read} Toggle_Read(JS_S_1) \stopJScode
+%\startJScode{Flip_Fields} Flip_Fields(JS_S_1) \stopJScode
+%
+%\startJScode{Forget_Changes} this.dirty = false \stopJScode
+
+\definereference[ForgetChanges][JS(Forget_Changes)]
+
+% This can be done more efficient, by keeping track of the
+% current top of the stack.
+
+\startJSpreamble FieldStack used later
+
+function Reset_Fields ( FieldSet ) {
+ var i = 1 ;
+ while (true) {
+ v = this.getField(FieldSet+":"+i) ;
+ if (!v) {
+ break ;
+ } else {
+ v.value = "Off" ;
+ }
+ i++ ;
+ }
+}
+
+function Set_Fields ( FieldSet ) {
+ var i = 1 ;
+ while (true) {
+ v = this.getField(FieldSet+":"+i) ;
+ if (!v) {
+ break ;
+ } else {
+ v.value = "On" ;
+ }
+ i++ ;
+ }
+}
+
+function Set_Field ( FieldSet, FieldName ) {
+ Reset_Fields(FieldSet) ;
+ v = this.getField(FieldSet+":"+FieldName) ;
+ if (v) {
+ v.value = "On" ;
+ }
+}
+
+function Reset_Field ( FieldSet, FieldName ) {
+ Set_Fields(FieldSet) ;
+ v = this.getField(FieldSet+":"+FieldName) ;
+ if (v) {
+ v.value = "Off" ;
+ }
+}
+
+function Walk_Field ( FieldSet ) {
+ var i = 1 ;
+ while (true) {
+ v = this.getField(FieldSet+":"+i) ;
+ if (v) {
+ if (v.value=="On") {
+ v.value = "Off" ;
+ var ii = i ;
+ ii++ ;
+ v = this.getField(FieldSet+":"+ii) ;
+ if (!v) {
+ v = this.getField(FieldSet+":"+1) ;
+ }
+ if (v) {
+ v.value = "On" ;
+ }
+ break ;
+ }
+ i++ ;
+ } else {
+ break ;
+ }
+ }
+}
+
+var FieldSets = new Array() ;
+
+function Do_Get_Check_Walk_Field ( FieldSet ) {
+ var f = FieldSets[FieldSet]
+ if (! f) {
+ f = new Array() ;
+ f.number = 0 ;
+ f.delay = 500 ;
+ f.paused = false ;
+ f.running = false ;
+ f.name = FieldSet ;
+ f.timeout = null ;
+ FieldSets[FieldSet] = f ;
+ }
+ return f
+}
+
+function Do_Next_Auto_Walk_Field ( FieldSet ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ var v = this.getField(FieldSet + ":" + fieldset.number) ;
+ if (v) {
+ if (v.value == "On") {
+ v.value = "Off" ;
+ }
+ }
+ fieldset.number++ ;
+ v = this.getField(FieldSet + ":" + fieldset.number) ;
+ if (! v) {
+ fieldset.number = 1 ;
+ v = this.getField(FieldSet + ":" + fieldset.number) ;
+ }
+ if (v) {
+ v.value = "On"
+ }
+ }
+}
+
+function Do_Stop_Auto_Walk_Field ( FieldSet ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ try {
+ app.clearInterval(fieldset.timeout) ;
+ app.clearTimeOut(fieldset.timeout) ;
+ } catch (e) {
+ }
+ }
+}
+
+function Do_Start_Auto_Walk_Field ( FieldSet ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ Do_Stop_Auto_Walk_Field(FieldSet) ;
+ fieldset.timeout = app.setInterval("Do_Next_Auto_Walk_Field('"+FieldSet+"')", fieldset.delay) ;
+ }
+}
+
+function Start_Walk_Field ( FieldSet, Delay ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ fieldset.number = 0 ;
+ if (Delay) {
+ fieldset.delay = Delay ;
+ }
+ Reset_Fields(FieldSet) ;
+ Do_Start_Auto_Walk_Field(FieldSet) ;
+ fieldset.running = true ;
+ fieldset.paused = false ;
+ }
+}
+
+function Pause_Walk_Field ( FieldSet ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ if (fieldset.running) {
+ if (fieldset.paused) {
+ Do_Start_Auto_Walk_Field(FieldSet) ;
+ fieldset.paused = false ;
+ } else {
+ Do_Stop_Auto_Walk_Field(FieldSet) ;
+ fieldset.paused = true ;
+ }
+ }
+ }
+}
+
+function Stop_Walk_Field ( FieldSet ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ Do_Stop_Auto_Walk_Field(FieldSet) ;
+ fieldset.running = false ;
+ fieldset.paused = false ;
+ }
+}
+
+function Reset_Walk_Field ( FieldSet ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ Do_Stop_Auto_Walk_Field(FieldSet) ;
+ fieldset.number = 0 ;
+ fieldset.running = false ;
+ fieldset.paused = false ;
+ Reset_Fields(FieldSet) ;
+ }
+}
+
+function Previous_Walk_Field ( FieldSet ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ Do_Stop_Auto_Walk_Field(FieldSet) ;
+ fieldset.running = false ;
+ fieldset.paused = false ;
+ if (fieldset.number>0) {
+ var v = this.getField(FieldSet + ":" + fieldset.number) ;
+ if (v) {
+ if (v.value == "On") {
+ v.value = "Off" ;
+ }
+ }
+ fieldset.number-- ;
+ v = this.getField(FieldSet + ":" + fieldset.number) ;
+ if (v) {
+ v.value = "On" ;
+ }
+ }
+ }
+}
+
+function Next_Walk_Field ( FieldSet ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ Do_Stop_Auto_Walk_Field(FieldSet) ;
+ fieldset.running = false ;
+ fieldset.paused = false ;
+ var f = fieldset.number + 1 ;
+ var v = this.getField(FieldSet + ":" + f) ;
+ if (v) {
+ var v = this.getField(FieldSet + ":" + fieldset.number) ;
+ if (v) {
+ if (v.value == "On") {
+ v.value = "Off" ;
+ }
+ }
+ fieldset.number++ ;
+ v = this.getField(FieldSet + ":" + fieldset.number) ;
+ if (v) {
+ v.value = "On" ;
+ }
+ }
+ }
+}
+
+function Set_Walk_Field_Delay ( FieldSet, Delay ) {
+ var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
+ if (fieldset) {
+ if (Delay) {
+ fieldset.delay = Delay ;
+ if (fieldset.running) {
+ Do_Stop_Auto_Walk_Field(FieldSet) ;
+ Do_Start_Auto_Walk_Field(FieldSet) ;
+ }
+ }
+ }
+}
+
+\stopJSpreamble
+
+\definereference[Walk] [JS(Walk_Field)]
+\definereference[StartWalk] [JS(Start_Walk_Field)]
+\definereference[StopWalk] [JS(Stop_Walk_Field)]
+\definereference[PauseWalk] [JS(Pause_Walk_Field)]
+\definereference[ResetWalk] [JS(Reset_Walk_Field)]
+\definereference[PreviousWalk][JS(Previous_Walk_Field)]
+\definereference[NextWalk] [JS(Next_Walk_Field)]
+\definereference[SetWalkDelay][JS(Set_Walk_Field_Delay)]
+
+\endinput
diff --git a/tex/context/base/java-stp.tex b/tex/context/base/java-imp-stp.mkiv
index df4fbcc2f..df4fbcc2f 100644
--- a/tex/context/base/java-stp.tex
+++ b/tex/context/base/java-imp-stp.mkiv
diff --git a/tex/context/base/java-ini.lua b/tex/context/base/java-ini.lua
deleted file mode 100644
index bdd3488f5..000000000
--- a/tex/context/base/java-ini.lua
+++ /dev/null
@@ -1,138 +0,0 @@
-if not modules then modules = { } end modules ['java-ini'] = {
- version = 1.001,
- comment = "companion to java-ini.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local format = string.format
-local concat = table.concat
-local lpegmatch, lpegP, lpegR, lpegS, lpegC = lpeg.match, lpeg.P, lpeg.R, lpeg.S, lpeg.C
-
-local allocate = utilities.storage.allocate
-
--- todo: don't flush scripts if no JS key
-
-interactions.javascripts = interactions.javascripts or { }
-local javascripts = interactions.javascripts
-
-javascripts.codes = allocate()
-javascripts.preambles = allocate()
-javascripts.functions = allocate()
-
-local codes, preambles, functions = javascripts.codes, javascripts.preambles, javascripts.functions
-
-local preambled = { }
-
-local function storefunction(s)
- functions[s] = true
-end
-
-local uses = lpegP("uses")
-local used = lpegP("used")
-local left = lpegP("{")
-local right = lpegP("}")
-local space = lpegS(" \r\n")
-local spaces = space^0
-local braced = left * lpegC((1-right-space)^1) * right
-local unbraced = lpegC((1-space)^1)
-local name = spaces * (braced + unbraced) * spaces
-local any = lpegP(1)
-local script = lpegC(any^1)
-local funct = lpegP("function")
-local leftp = lpegP("(")
-local rightp = lpegP(")")
-local fname = spaces * funct * spaces * (((1-space-left)^1)/storefunction) * spaces * leftp
-
-local parsecode = name * ((uses * name) + lpeg.Cc("")) * spaces * script
-local parsepreamble = name * ((used * name) + lpeg.Cc("")) * spaces * script
-local parsefunctions = (fname + any)^0
-
-function javascripts.storecode(str)
- local name, uses, script = lpegmatch(parsecode,str)
- if name and name ~= "" then
- codes[name] = { uses, script }
- end
-end
-
-function javascripts.storepreamble(str) -- now later
- local name, used, script = lpegmatch(parsepreamble,str)
- if name and name ~= "" then
- preambles[#preambles+1] = { name, used, script }
- preambled[name] = #preambles
- lpegmatch(parsefunctions,script)
- end
-end
-
-function javascripts.setpreamble(name,script) -- now later
- if name and name ~= "" then
- preambles[#preambles+1] = { name, "now", script }
- preambled[name] = #preambles
- lpegmatch(parsefunctions,script)
- end
-end
-
-function javascripts.addtopreamble(name,script) -- now later
- if name and name ~= "" then
- local p = preambled[name]
- if p then
- preambles[p] = { "now", preambles[p] .. " ;\n" .. script }
- else
- preambles[#preambles+1] = { name, "now", script }
- preambled[name] = #preambles
- lpegmatch(parsefunctions,script)
- end
- end
-end
-
-function javascripts.usepreamblenow(name) -- now later
- if name and name ~= "" and preambled[name] then
- preambles[preambled[name]][2] = "now"
- end
-end
-
-local splitter = lpeg.Ct(lpeg.splitat(lpeg.patterns.commaspacer))
-
-local used = false
-
-function javascripts.code(name,arguments)
- local c = codes[name]
- if c then
- local u, code = c[1], c[2]
- if u ~= "" then
- local p = preambled[u]
- if p then
- preambles[p][1] = "now"
- end
- end
- used = true
- return code
- end
- local f = functions[name]
- if f then
- used = true
- if arguments then
- local args = lpegmatch(splitter,arguments)
- for i=1,#args do -- can be a helper
- args[i] = format("%q",args[i])
- end
- return format("%s(%s)",name,concat(args,","))
- else
- return format("%s()",name)
- end
- end
-end
-
-function javascripts.flushpreambles()
- local t = { }
- if used then
- for i=1,#preambles do
- local preamble = preambles[i]
- if preamble[2] == "now" then
- t[#t+1] = { preamble[1], preamble[3] }
- end
- end
- end
- return t
-end
diff --git a/tex/context/base/java-ini.mkii b/tex/context/base/java-ini.mkii
index e929da108..68516ec4e 100644
--- a/tex/context/base/java-ini.mkii
+++ b/tex/context/base/java-ini.mkii
@@ -33,24 +33,7 @@
%D \JAVA\ support is not implemented as a generic support
%D module. The main reason for this is that passing system
%D variables to a \JAVASCRIPT\ is closely related to other core
-%D macros. First some messages:
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
+%D macros.
%D \TEX\ is not the right tool to check the \JAVA\ code; the
%D most we can do is reporting some passed variables:
@@ -125,13 +108,6 @@
%D JS_R_3="overflow";
%D JS_P_3=3;
%D \stoptyping
-% %D
-% %D Finally we have a counter that tells\JAVA\ how many
-% %D arguments were passed,
-% %D
-% %D \starttyping
-% %D JS_N
-% %D \stoptyping
%D We will also support direct function calls. In that case
%D no intermediate variables are used.
@@ -699,7 +675,11 @@
\letgvalueempty{\c!file\f!javascriptprefix#1}%
\makeshortfilename[\f!javascriptprefix#1]%
\startreadingfile
- \readsysfile\shortfilename{\showmessage\m!javascript1{#1}}\donothing
+ \readsysfile{\shortfilename.\mksuffix}
+ {\showmessage\m!javascript1{#1}}
+ {\readsysfile{\shortfilename.tex}
+ {\showmessage\m!javascript1{#1}}
+ \donothing}%
\stopreadingfile
\stopnointerference}}}
diff --git a/tex/context/base/java-ini.mkiv b/tex/context/base/java-ini.mkiv
deleted file mode 100644
index a26c562b4..000000000
--- a/tex/context/base/java-ini.mkiv
+++ /dev/null
@@ -1,162 +0,0 @@
-%D \module
-%D [ file=java-ini,
-%D version=1998.01.30,
-%D title=\CONTEXT\ JavaScript Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt JavaScript Macros / Initialization}
-
-\registerctxluafile{java-ini}{1.001}
-
-\unprotect
-
-%D \macros
-%D {JS*}
-%D
-%D Because \JAVASCRIPT's are activated by the user, for
-%D instance by activating on a button, their support is closely
-%D related to the referencing mechanism. Integration takes
-%D place by
-%D
-%D \starttyping
-%D \goto{calculate total}[Sum()]
-%D \stoptyping
-%D
-%D The \type{()} classify this as a script. If they are absent,
-%D the keyword is treated as a normal reference.
-%D
-%D One can pass arguments to such a script by saying:
-%D
-%D \starttyping
-%D \goto{calculate total}[Sum(1.5,2.3)]
-%D \stoptyping
-
-
-%D \macros
-%D {startJScode}
-%D
-%D A piece of \JAVASCRIPT\ code is defined by saying:
-%D
-%D \starttyping
-%D \startJScode{name}
-%D name = 4 ;
-%D \stopJScode
-%D \stoptyping
-%D
-%D This assumes uses no preamble or presumes that the preamble is
-%D always loaded, the next definition also tells \CONTEXT\ to
-%D actually include the preamble needed.
-%D
-%D \starttyping
-%D \startJScode{uses} uses {later}
-%D uses = 6 ;
-%D \stopJScode
-%D \stoptyping
-%D
-%D \macros
-%D {startJSpreamble}
-%D
-%D One can define insert \JAVASCRIPT\ code at the document level
-%D by using:
-%D
-%D \starttyping
-%D \startJSpreamble{oeps}
-%D oeps = 1 ;
-%D \stopJSpreamble
-%D \stoptyping
-%D
-%D which is the same as:
-%D
-%D \starttyping
-%D \startJSpreamble{now} used now
-%D now = 2 ;
-%D \stopJSpreamble
-%D \stoptyping
-%D
-%D while the next definition is only included when actually
-%D used.
-%D
-%D \starttyping
-%D \startJSpreamble{later} used later
-%D later = 3 ;
-%D \stopJSpreamble
-%D \stoptyping
-%D
-%D This command may be used more that once, but always before
-%D the first page is shipped out.
-%D
-%D \macros
-%D {setJSpreamble, addtoJSpreamble}
-%D
-%D In addition to the previous preamble definitions, we can
-%D set a preamble \quote {in||line} and add tokens to a
-%D preamble.
-%D
-%D \macros
-%D {useJSpreamblenow}
-%D
-%D This macro can be used to force inclusion of postponed
-%D \JAVASCRIPT\ preambles.
-
-\unexpanded\def\startJScode
- {\begingroup\obeylualines\obeyluatokens\dostartJScode}
-
-\long\def\dostartJScode#1\stopJScode
- {\normalexpanded{\endgroup\ctxlua{interactions.javascripts.storecode(\!!bs#1\!!es)}}}
-
-\let\stopJScode\relax
-
-\unexpanded\def\startJSpreamble
- {\begingroup\obeylualines\obeyluatokens\dostartJSpreamble}
-
-\long\def\dostartJSpreamble#1\stopJSpreamble
- {\normalexpanded{\endgroup\ctxlua{interactions.javascripts.storepreamble(\!!bs#1\!!es)}}}
-
-\let\stopJSpreamble\relax
-
-\def\setJSpreamble #1#2{\ctxlua{interactions.javascripts.storepreamble ("#1",\!!bs#2\!!es)}}
-\def\addtoJSpreamble #1#2{\ctxlua{interactions.javascripts.addtopreamble ("#1",\!!bs#2\!!es)}}
-\def\useJSpreamblenow #1{\ctxlua{interactions.javascripts.usepreamblenow("#1")}}
-
-%D \macros
-%D {useJSscripts}
-%D
-%D In due time, users will build their collections of scripts,
-%D which can be used (loaded) when applicable. Although not all
-%D public, we will provide some general purpose scripts,
-%D collected in files with names like \type{java-...}. One can
-%D load these scripts with \type{\useJSscripts}, like:
-%D
-%D \starttyping
-%D \useJSscripts[fld]
-%D \stoptyping
-%D
-%D The not so complicated implementation of this macro is:
-
-\def\dodouseJSscripts#1%
- {\doifelse{#1}\v!reset
- {\let\allJSpreambles\empty}
- {\ifcsname\c!file\f!javascriptprefix#1\endcsname \else
- \startnointerference
- \letgvalueempty{\c!file\f!javascriptprefix#1}%
- \startreadingfile
- \readsysfile{\truefilename{\f!javascriptprefix#1}}{\showmessage\m!javascript1{#1}}\donothing
- \stopreadingfile
- \stopnointerference
- \fi}}
-
-\def\douseJSscripts[#1][#2]%
- {\processcommalist[#1]\dodouseJSscripts
- \processcommalist[#2]\useJSpreamblenow}
-
-\def\useJSscripts
- {\dodoubleempty\douseJSscripts}
-
-\protect \endinput
diff --git a/tex/context/base/java-stp.mkii b/tex/context/base/java-stp.mkii
new file mode 100644
index 000000000..df4fbcc2f
--- /dev/null
+++ b/tex/context/base/java-stp.mkii
@@ -0,0 +1,121 @@
+%D \module
+%D [ file=java-stp,
+%D version=2004.03.15,
+%D title=\CONTEXT\ JavaScript Macros,
+%D subtitle=Stepping,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% we define ocglist global, otherwise we quickly run into a memory hog (even
+% out of memory in a 512 Meg machine)
+
+% we cannot use doc_visited[this.pageNum] instead of doc_currentstep because
+% of some funny side effect (i.e. dup or so)
+
+\startJSpreamble Steps used now
+
+ var doc_ocglist = this.getOCGs() ;
+ var doc_stepname = "step" ;
+ var doc_currentstep = 0 ;
+ var doc_maxstep = 50 ;
+ var doc_visited = new Array() ;
+ var doc_busy = new Array() ;
+
+ function SetupStepper ( layername, laststep ) {
+ doc_stepname = layername ;
+ doc_maxstep = laststep ;
+ for (var i=0; i<=this.numPages; i++) {
+ doc_visited[i] = 0 ;
+ doc_busy[i] = 0 ;
+ }
+ }
+
+ for (var i=0; i<=this.numPages; i++) {
+ doc_visited[i] = 0 ;
+ doc_busy[i] = 0 ;
+ }
+
+ function GetOCG ( name ) {
+ for (var i=0; i < doc_ocglist.length; i++) {
+ if (doc_ocglist[i].name == name) {
+ return doc_ocglist[i] ;
+ }
+ }
+ return null ;
+ }
+
+ function CheckBusy ( ) {
+ var ocg = GetOCG("step:busy") ;
+ if (ocg != null) {
+ if (doc_visited[this.pageNum]==0) {
+ ocg.state = true ;
+ } else {
+ if (doc_visited[this.pageNum]<doc_busy[this.pageNum]) {
+ ocg.state = true ;
+ } else {
+ ocg.state = false ;
+ }
+ }
+ }
+ }
+
+ function SetStepper ( maxstep, state ) {
+ for (var i=1; i<=maxstep; i++) {
+ try {
+ var ocg = GetOCG(doc_stepname + ':' + String(i)) ;
+ if (ocg != null) {
+ ocg.state = state ;
+ }
+ } catch (e) {
+ return ;
+ }
+ }
+ }
+
+ function CheckStepper ( maxsteps ) {
+ SetStepper(doc_visited[this.pageNum], true) ;
+ doc_busy[this.pageNum] = Number(maxsteps) ;
+ doc_currentstep = doc_visited[this.pageNum] ;
+ CheckBusy() ;
+ }
+
+ function ResetStepper ( ) {
+ SetStepper(doc_maxstep, false) ;
+ doc_currentstep = 0 ;
+ }
+
+ function InvokeStepper ( ) {
+ try {
+ if (doc_currentstep<doc_busy[this.pageNum]) {
+ doc_currentstep += 1 ;
+ doc_visited[this.pageNum] = doc_currentstep ;
+ var ocg = GetOCG(doc_stepname + ':' + String(doc_currentstep)) ;
+ if (ocg != null) {
+ ocg.state = true ;
+ }
+ } else {
+ if (this.pageNum+1==this.numPages) {
+ this.pageNum = 0 ;
+ } else {
+ this.pageNum += 1 ;
+ }
+ }
+ CheckBusy() ;
+ } catch (e) {
+ return ;
+ }
+ }
+
+\stopJSpreamble
+
+% \definereference [SetupStepper] [JS(SetupStepper{step,50})]
+% \definereference [ResetStepper] [JS(ResetStepper)]
+% \definereference [CheckStepper] [JS(CheckStepper{\StepCounter})]
+% \definereference [InvokeStepper] [JS(InvokeStepper)]
+
+\endinput
diff --git a/tex/context/base/lang-alt.mkiv b/tex/context/base/lang-alt.mkiv
deleted file mode 100644
index 078076c50..000000000
--- a/tex/context/base/lang-alt.mkiv
+++ /dev/null
@@ -1,63 +0,0 @@
-%D \module
-%D [ file=lang-alt,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Altaic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Altaic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-% Uigur, Uzbek
-% Azeri/Azerbaijani, Chuvash, Turkish, Turkmen
-% Kazakh, Kazar, Kireghiz, Noghay, Talar
-% Buryat, Kalmuck, Khalkha
-%
-% Turkmen translation by Nazar Annagurban <nazartm at gmail.com> 18. March 2010
-
-\unprotect
-
-\installlanguage
- [\s!tr]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
-
-\installlanguage
- [\s!tk]
- [\c!spacing=\v!broad,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day}
- \s!patterns=\s!tk,
- \s!lefthyphenmin=1,
- \s!righthyphenmin=2]
-
-\installlanguage [turkish] [\s!tr]
-\installlanguage [turkmen] [\s!tk]
-
-\protect \endinput
diff --git a/tex/context/base/lang-ana.mkiv b/tex/context/base/lang-ana.mkiv
deleted file mode 100644
index c108655c4..000000000
--- a/tex/context/base/lang-ana.mkiv
+++ /dev/null
@@ -1,24 +0,0 @@
-%D \module
-%D [ file=lang-ana,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Anatolian Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Anatolian Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-\unprotect
-
-\protect \endinput
diff --git a/tex/context/base/lang-ara.mkiv b/tex/context/base/lang-ara.mkiv
deleted file mode 100644
index d576df488..000000000
--- a/tex/context/base/lang-ara.mkiv
+++ /dev/null
@@ -1,63 +0,0 @@
-%D \module
-%D [ file=lang-ara,
-%D version=2008.06.20,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Arabic Languages,
-%D author=Khaled Hosny,
-%D date=\currentdate,
-%D copyright=PRAGMA-ADE]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Arabic Languages}
-
-\unprotect
-
-\definesystemconstant {arabic}
-\definesystemvariable {ar}
-
-\installlanguage
- [\s!ar]
- [\c!spacing=\v!broad,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,{،\ },\v!year}]
-
-\installlanguage [\s!arabic] [\s!ar]
-
-% Just aliases to "ar" for now
-
-\installlanguage[\s!ar-ae][\c!default=\s!ar] % U.A.E.
-\installlanguage[\s!ar-bh][\c!default=\s!ar] % Bahrain
-\installlanguage[\s!ar-eg][\c!default=\s!ar] % Egypt
-\installlanguage[\s!ar-in][\c!default=\s!ar] % India?
-\installlanguage[\s!ar-kw][\c!default=\s!ar] % Kuwait
-\installlanguage[\s!ar-ly][\c!default=\s!ar] % Libya
-\installlanguage[\s!ar-om][\c!default=\s!ar] % Oman
-\installlanguage[\s!ar-qa][\c!default=\s!ar] % Qatar
-\installlanguage[\s!ar-sa][\c!default=\s!ar] % Saudi Arabia
-\installlanguage[\s!ar-sd][\c!default=\s!ar] % Sudan
-\installlanguage[\s!ar-tn][\c!default=\s!ar] % Tunisia
-\installlanguage[\s!ar-ye][\c!default=\s!ar] % Yemen
-
-% Syriac months
-
-\installlanguage[\s!ar-sy][\c!default=\s!ar] % Syria
-\installlanguage[\s!ar-iq][\c!default=\s!ar-sy] % Iraq
-\installlanguage[\s!ar-jo][\c!default=\s!ar-sy] % Jordan
-\installlanguage[\s!ar-lb][\c!default=\s!ar-sy] % Lebanon
-
-% Maghribi months
-
-\installlanguage[\s!ar-dz][\c!default=\s!ar] % Algeria
-\installlanguage[\s!ar-ma][\c!default=\s!ar] % Morocco
-
-\protect \endinput
diff --git a/tex/context/base/lang-art.mkiv b/tex/context/base/lang-art.mkiv
deleted file mode 100644
index e8be91630..000000000
--- a/tex/context/base/lang-art.mkiv
+++ /dev/null
@@ -1,26 +0,0 @@
-%D \module
-%D [ file=lang--art,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Artificial Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Artificial Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-% Esperanto
-
-\unprotect
-
-\protect \endinput
diff --git a/tex/context/base/lang-bal.mkiv b/tex/context/base/lang-bal.mkiv
deleted file mode 100644
index a6d03a2ab..000000000
--- a/tex/context/base/lang-bal.mkiv
+++ /dev/null
@@ -1,44 +0,0 @@
-%D \module
-%D [ file=lang-bal,
-%D version=2010.01.21,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Baltic Languages,
-%D author=Marius Aleknevičius,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Baltic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D all the translations were done by Marius Aleknevičius. If
-%D you have suggestions, don't hesitate to send us an email.
-
-%D This file is in \UTF\ encoding and is meant for \MKIV.
-
-% Lettish/Latvian, Lietuvių/Lithuanian
-
-\unprotect
-
-\installlanguage
- [\s!lt]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftdoubleninequote,
- \c!rightquote=\upperrightdoublesixquote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!year,~m.,\ ,\v!month,\ ,\v!day,~d.},
- \s!patterns=\s!lt,
- \s!lefthyphenmin=2,
- \s!righthyphenmin=2]
-
-\installlanguage [lithuanian] [\s!lt]
-
-\protect \endinput
diff --git a/tex/context/base/lang-cel.mkiv b/tex/context/base/lang-cel.mkiv
deleted file mode 100644
index 4d93957f1..000000000
--- a/tex/context/base/lang-cel.mkiv
+++ /dev/null
@@ -1,26 +0,0 @@
-%D \module
-%D [ file=lang-cel,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Celtic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Celtic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-% Breton, Welsh, Irish, Manx, Scottish Gaelic
-
-\unprotect
-
-\protect \endinput
diff --git a/tex/context/base/lang-cjk.mkiv b/tex/context/base/lang-cjk.mkiv
deleted file mode 100644
index 4594c52b4..000000000
--- a/tex/context/base/lang-cjk.mkiv
+++ /dev/null
@@ -1,48 +0,0 @@
-%D \module
-%D [ file=lang-chi,
-%D version=2009.03.02,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Chinese,
-%D author={Hans Hagen \& Wang Lei},
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%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 Derived from \MKII\ files.
-
-\writestatus{loading}{ConTeXt Language Macros / CJK}
-
-\definesystemconstant {chinese} \definesystemconstant {cn}
-\definesystemconstant {japanese} \definesystemconstant {ja}
-\definesystemconstant {korean} \definesystemconstant {kr}
-
-\unprotect
-
-\installlanguage
- [\s!cn]
- [\c!leftsentence=——,
- \c!rightsentence=——,
- \c!leftsubsentence=——,
- \c!rightsubsentence=——,
- \c!leftquote=‘,
- \c!rightquote=’,
- \c!leftquotation=“,
- \c!rightquotation=”,
- \c!date={\v!year,年,\ ,\v!month,\v!day,日}]
-
-\installlanguage
- [\s!ja]
- [\c!leftsentence=——,
- \c!rightsentence=——,
- \c!leftsubsentence=——,
- \c!rightsubsentence=——,
- \c!leftquote=‘,
- \c!rightquote=’,
- \c!leftquotation=「,
- \c!rightquotation=」,
- \c!date={西暦,\v!year,年,\v!month,月,\v!day,日}]
-
-\protect \endinput
diff --git a/tex/context/base/lang-cyr.mkiv b/tex/context/base/lang-cyr.mkiv
deleted file mode 100644
index a07fe8d4a..000000000
--- a/tex/context/base/lang-cyr.mkiv
+++ /dev/null
@@ -1,60 +0,0 @@
-%D \module
-%D [ file=lang-cyr,
-%D version=2003.01.24,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Cyrillic Languages,
-%D author=see below,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Cyrillic Languages}
-
-%D The cyrillic languages always use a dedicated input regime.
-%D Therefore we define the labels using symbolic names.
-%D Support for cyrillic is initiated by Olga Briginets who
-%D also layed the base for the language, encoding and font
-%D definition. Later Alexander Bokovoy and Victor Figurnov
-%D improved things. I (Hans Hagen) mainly cleaned things up
-%D a bit.
-
-\unprotect
-
-\installlanguage
- [\s!ru]
- [\s!lefthyphenmin=2,
- \s!righthyphenmin=2,
- \c!spacing=\v!packed,
- \c!leftsentence=\leftguillemot,
- \c!rightsentence=\rightguillemot,
- \c!leftsubsentence=\lowerleftdoubleninequote,
- \c!rightsubsentence=\upperrightdoubleninequote,
- \c!leftquote=\lowerleftdoubleninequote,
- \c!rightquote=\upperrightdoubleninequote,
- \c!leftquotation=\leftguillemot,
- \c!rightquotation=\rightguillemot,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!ua]
- [\s!lefthyphenmin=2,
- \s!righthyphenmin=2,
- \c!spacing=\v!packed,
- \c!leftsentence=\leftguillemot,
- \c!rightsentence=\rightguillemot,
- \c!leftsubsentence=\lowerleftdoubleninequote,
- \c!rightsubsentence=\upperrightdoubleninequote,
- \c!leftquote=\lowerleftdoubleninequote,
- \c!rightquote=\upperrightdoubleninequote,
- \c!leftquotation=\leftguillemot,
- \c!rightquotation=\rightguillemot,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year},
- \s!patterns=\s!uk]
-
-\installlanguage [russian] [\s!ru]
-\installlanguage [ukrainian] [\s!ua]
-
-\protect \endinput
diff --git a/tex/context/base/lang-def.mkiv b/tex/context/base/lang-def.mkiv
new file mode 100644
index 000000000..88f4f1cdf
--- /dev/null
+++ b/tex/context/base/lang-def.mkiv
@@ -0,0 +1,715 @@
+%D \module
+%D [ file=lang-def,
+%D version=2011.01.24, % merge of language files
+%D title=\CONTEXT\ Language Macros,
+%D subtitle=Languages Definitions,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Language Macros / Definitions}
+
+%D See \type {lang-*.tex} for some historic notes.
+
+\unprotect
+
+% Germanic Languages: Danish, Faeroese, Icelandic, Norwegian,
+% Swedish, German, Yiddish, Afrikaans, Dutch, English, Flemush,
+% Frisian, Plattdeutsch
+
+\installlanguage
+ [\s!nl]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!en]
+ [\c!spacing=\v!broad,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!month,\ ,\v!day,{,\ },\v!year},
+ \s!patterns=\s!us,
+ \s!lefthyphenmin=2,
+ \s!righthyphenmin=3]
+
+\installlanguage
+ [\s!de]
+ [\c!spacing=\v!packed,
+ \s!lefthyphenmin=3,
+ \s!righthyphenmin=3,
+ \c!leftsentence={\hbox{--~}},
+ \c!rightsentence={\hbox{~--}},
+ \c!leftsubsentence={--},
+ \c!rightsubsentence={--},
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsinglesixquote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoublesixquote,
+ \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!da]
+ [\c!spacing=\v!packed,
+ \c!leftsentence={\hbox{--\hskip.5em}},
+ \c!rightsentence={\hbox{\hskip.5em--}},
+ \c!leftsubsentence={--},
+ \c!rightsubsentence={--},
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsinglesixquote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoublesixquote,
+ \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!sv]
+ [\c!spacing=\v!packed,
+ \c!leftsentence={\hbox{--~}},
+ \c!rightsentence={\hbox{~--}},
+ \c!leftsubsentence={--},
+ \c!rightsubsentence={--},
+ \c!leftquote=\upperrightsingleninequote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperrightdoubleninequote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!af]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
+
+\installlanguage
+ [\s!nb]
+ [spacing=packed,
+ lefthyphenmin=2,
+ righthyphenmin=2,
+ leftsentence=---,
+ rightsentence=---,
+ leftsubsentence=---,
+ rightsubsentence=---,
+ leftquote=\upperleftsinglesixquote,
+ rightquote=\upperrightsingleninequote,
+ leftquotation=\leftguillemot,
+ rightquotation=\rightguillemot,
+ date={day,{.},\ ,month,\ ,year}]
+
+\installlanguage
+ [\s!nn]
+ [spacing=packed,
+ lefthyphenmin=2,
+ righthyphenmin=2,
+ leftsentence=---,
+ rightsentence=---,
+ leftsubsentence=---,
+ rightsubsentence=---,
+ leftquote=\upperleftsinglesixquote,
+ rightquote=\upperrightsingleninequote,
+ leftquotation=\leftguillemot,
+ rightquotation=\rightguillemot,
+ date={day,{.},\ ,month,\ ,year}]
+
+\installlanguage [\s!no] [\s!nb]
+\installlanguage [\s!norwegian] [\s!nb]
+\installlanguage [\s!bokmal] [\s!nb]
+\installlanguage [\s!nynorsk] [\s!nn]
+
+\installlanguage % old german
+ [deo]
+ [\c!spacing=\v!packed,
+ \c!default=\s!de]
+
+\installlanguage
+ [de-de]
+ [\c!spacing=\v!packed,
+ \c!default=\s!de]
+
+\installlanguage
+ [de-at]
+ [\c!spacing=\v!packed,
+ \c!default=\s!de,
+ \c!leftquote=\leftguillemot,
+ \c!rightquote=\rightguillemot,
+ \c!leftquotation=\leftguillemot,
+ \c!rightquotation=\rightguillemot]
+
+\installlanguage
+ [de-ch]
+ [\c!spacing=\v!packed,
+ \c!default=\s!de]
+
+%D And some alternative (but very real) english patterns:
+
+\installlanguage
+ [en-gb]
+ [\c!default=\s!en,
+ \s!patterns=\s!gb,
+ \s!lefthyphenmin=3,
+ \s!righthyphenmin=3]
+
+\installlanguage
+ [en-us]
+ [\c!default=\s!en,
+ \s!patterns=\s!us]
+
+\installlanguage [\s!uk] [\s!en-\s!gb]
+\installlanguage [\s!us] [\s!en-\s!us]
+
+\installlanguage [usenglish] [\s!en-\s!us]
+\installlanguage [ukenglish] [\s!en-\s!gb]
+\installlanguage [english] [\s!en]
+\installlanguage [dutch] [\s!nl]
+\installlanguage [german] [\s!de]
+\installlanguage [danish] [\s!da]
+\installlanguage [swedish] [\s!sv]
+\installlanguage [afrikaans] [\s!af]
+
+%D Next we implement couple of ordinal mumber converters:
+
+\def\enordinaldaynumber#1%
+ {#1\ifnum\lasttwodigits{#1}=11
+ \highordinalstr{th}%
+ \else\ifnum\lasttwodigits{#1}=12
+ \highordinalstr{th}%
+ \else\ifnum\lasttwodigits{#1}=13
+ \highordinalstr{th}%
+ \else\ifcase\lastdigit{#1}%
+ \highordinalstr{th}%
+ \or % 1
+ \highordinalstr{st}%
+ \or % 2
+ \highordinalstr{nd}%
+ \or % 3
+ \highordinalstr{rd}%
+ \else
+ \highordinalstr{th}%
+ \fi\fi\fi\fi}
+
+% \def\enordinaldaynumber#1%
+% {#1\ordinalstr{\ifnum\lasttwodigits{#1}=11 th\else\ifcase\lastdigit{#1}
+% th\or st\or nd\or rd\else th\fi\fi}}
+
+\def\nlordinaldaynumber#1%
+ {#1\highordinalstr{e}}
+
+% Slavic Languages: Belarussian, Russian, Ukrainian, Bulgarian,
+% Macedonian, Serbian, Croatian, Slovenian, Czech, Kushubian,
+% Lusatian/Sorbian/Wendish, Polish, Slovak, Albanian, Illyrian,
+% Armenian
+
+\installlanguage
+ [\s!pl]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!cs]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=\thickglue--\thickglue\penalty-20\relax, % hh, \relax added
+ \c!rightsentence=\thickglue--\thickglue\penalty-20\relax,
+ \c!leftsubsentence=~---~\penalty-20\relax,
+ \c!rightsubsentence=~---~\penalty-20\relax,
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsinglesixquote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoublesixquote,
+ \c!date={\v!day,{.\,},\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!sk]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!day,{.\,},\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!hr]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!sl]
+ [\c!spacing=\v!packed,
+ \c!leftsentence={\hbox{--~}},
+ \c!rightsentence={\hbox{~--}},
+ \c!leftsubsentence={--},
+ \c!rightsubsentence={--},
+ %\c!leftquote=\lowerleftsingleninequote,
+ %\c!rightquote=\upperrightsinglesixquote,
+ %\c!leftquotation=\lowerleftdoubleninequote,
+ %\c!rightquotation=\upperrightdoublesixquote,
+ \c!leftquote=\guilsingleright,
+ \c!rightquote=\guilsingleleft,
+ \c!leftquotation=\rightguillemot,
+ \c!rightquotation=\leftguillemot,
+ \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
+
+\installlanguage [polish] [\s!pl]
+\installlanguage [czech] [\s!cs]
+\installlanguage [slovak] [\s!sk]
+\installlanguage [croatian] [\s!hr]
+\installlanguage [slovenian] [\s!sl]
+\installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?)
+
+\installlanguage [cz] [\s!cs]
+
+\def\doconvertsloveniancharacters{\dodoconvertcharacters{25}}
+
+\def\sloveniancharacters{\doconvertsloveniancharacters\sloveniancharacter}
+\def\slovenianCharacters{\doconvertsloveniancharacters\slovenianCharacter}
+
+%D Define general-purpose macros for Slovenian character enumerations:
+
+\defineconversion [sloveniancharacter] [\sloveniancharacter]
+\defineconversion [slovenianCharacter] [\slovenianCharacter]
+
+\defineconversion [sloveniancharacters] [\sloveniancharacters]
+\defineconversion [slovenianCharacters] [\slovenianCharacters]
+
+%D Define these as the general character enumeration when
+%D language is Slovenian. If you feel uncomfortable with this,
+%D mail Mojca, since she promised to to take the heat.
+
+\defineconversion [sl] [character] [\sloveniancharacter]
+\defineconversion [sl] [Character] [\slovenianCharacter]
+
+\defineconversion [sl] [characters] [\sloveniancharacters]
+\defineconversion [sl] [Characters] [\slovenianCharacters]
+
+\defineconversion [sl] [a] [\sloveniancharacters]
+\defineconversion [sl] [A] [\slovenianCharacters]
+\defineconversion [sl] [AK] [\smallcapped\sloveniancharacters]
+\defineconversion [sl] [KA] [\smallcapped\sloveniancharacters]
+
+\def\sloveniancharacters#1{\ctxlua{converters.alphabetic(\number#1,"sl")}}
+\def\slovenianCharacters#1{\ctxlua{converters.Alphabetic(\number#1,"sl")}}
+
+% Cyrillic Languages
+
+\installlanguage
+ [\s!ru]
+ [\s!lefthyphenmin=2,
+ \s!righthyphenmin=2,
+ \c!spacing=\v!packed,
+ \c!leftsentence=\leftguillemot,
+ \c!rightsentence=\rightguillemot,
+ \c!leftsubsentence=\lowerleftdoubleninequote,
+ \c!rightsubsentence=\upperrightdoubleninequote,
+ \c!leftquote=\lowerleftdoubleninequote,
+ \c!rightquote=\upperrightdoubleninequote,
+ \c!leftquotation=\leftguillemot,
+ \c!rightquotation=\rightguillemot,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!ua]
+ [\s!lefthyphenmin=2,
+ \s!righthyphenmin=2,
+ \c!spacing=\v!packed,
+ \c!leftsentence=\leftguillemot,
+ \c!rightsentence=\rightguillemot,
+ \c!leftsubsentence=\lowerleftdoubleninequote,
+ \c!rightsubsentence=\upperrightdoubleninequote,
+ \c!leftquote=\lowerleftdoubleninequote,
+ \c!rightquote=\upperrightdoubleninequote,
+ \c!leftquotation=\leftguillemot,
+ \c!rightquotation=\rightguillemot,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year},
+ \s!patterns=\s!uk]
+
+\installlanguage [russian] [\s!ru]
+\installlanguage [ukrainian] [\s!ua]
+
+% Uralic Languages: Cheremiss, Estonian, Finnish, Karelian, Laap,
+% Mordvinian, Permian tongues, Hungarian, Ostyak, Vogul, Samoyed
+
+\installlanguage
+ [\s!fi]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
+
+\installlanguage
+ [\s!hu]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!year,.,\ ,\v!month,\ ,\v!day,.}]
+
+\installlanguage [finish] [\s!fi]
+\installlanguage [hungarian] [\s!hu]
+
+% Altaic Languages: Uigur, Uzbek, Azeri/Azerbaijani, Chuvash,
+% Turkish, Turkmen, Kazakh, Kazar, Kireghiz, Noghay, Talar,
+% Buryat, Kalmuck, Khalkha
+
+\installlanguage
+ [\s!tr]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
+
+\installlanguage
+ [\s!tk]
+ [\c!spacing=\v!broad,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!year,\ ,\v!month,\ ,\v!day}
+ \s!patterns=\s!tk,
+ \s!lefthyphenmin=1,
+ \s!righthyphenmin=2]
+
+\installlanguage [turkish] [\s!tr]
+\installlanguage [turkmen] [\s!tk]
+
+% Anatolian Languages
+
+% Arabic Languages
+
+\definesystemconstant {arabic}
+\definesystemvariable {ar}
+
+\installlanguage
+ [\s!ar]
+ [\c!spacing=\v!broad,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!day,\ ,\v!month,{،\ },\v!year}]
+
+\installlanguage [\s!arabic] [\s!ar]
+
+% Just aliases to "ar" for now
+
+\installlanguage[\s!ar-ae][\c!default=\s!ar] % U.A.E.
+\installlanguage[\s!ar-bh][\c!default=\s!ar] % Bahrain
+\installlanguage[\s!ar-eg][\c!default=\s!ar] % Egypt
+\installlanguage[\s!ar-in][\c!default=\s!ar] % India?
+\installlanguage[\s!ar-kw][\c!default=\s!ar] % Kuwait
+\installlanguage[\s!ar-ly][\c!default=\s!ar] % Libya
+\installlanguage[\s!ar-om][\c!default=\s!ar] % Oman
+\installlanguage[\s!ar-qa][\c!default=\s!ar] % Qatar
+\installlanguage[\s!ar-sa][\c!default=\s!ar] % Saudi Arabia
+\installlanguage[\s!ar-sd][\c!default=\s!ar] % Sudan
+\installlanguage[\s!ar-tn][\c!default=\s!ar] % Tunisia
+\installlanguage[\s!ar-ye][\c!default=\s!ar] % Yemen
+
+% Syriac months
+
+\installlanguage[\s!ar-sy][\c!default=\s!ar] % Syria
+\installlanguage[\s!ar-iq][\c!default=\s!ar-sy] % Iraq
+\installlanguage[\s!ar-jo][\c!default=\s!ar-sy] % Jordan
+\installlanguage[\s!ar-lb][\c!default=\s!ar-sy] % Lebanon
+
+% Maghribi months
+
+\installlanguage[\s!ar-dz][\c!default=\s!ar] % Algeria
+\installlanguage[\s!ar-ma][\c!default=\s!ar] % Morocco
+
+% Artificial Languages: Esperanto
+
+% Baltic Languages: Lettish/Latvian, Lietuvių/Lithuanian
+
+\installlanguage
+ [\s!lt]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\lowerleftdoubleninequote,
+ \c!rightquote=\upperrightdoublesixquote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoublesixquote,
+ \c!date={\v!year,~m.,\ ,\v!month,\ ,\v!day,~d.},
+ \s!patterns=\s!lt,
+ \s!lefthyphenmin=2,
+ \s!righthyphenmin=2]
+
+\installlanguage [lithuanian] [\s!lt]
+
+% Celtic: Breton, Welsh, Irish, Manx, Scottish Gaelic
+
+% CJK
+
+\definesystemconstant {chinese} \definesystemconstant {cn}
+\definesystemconstant {japanese} \definesystemconstant {ja}
+\definesystemconstant {korean} \definesystemconstant {kr}
+
+\installlanguage
+ [\s!cn]
+ [\c!leftsentence=——,
+ \c!rightsentence=——,
+ \c!leftsubsentence=——,
+ \c!rightsubsentence=——,
+ \c!leftquote=‘,
+ \c!rightquote=’,
+ \c!leftquotation=“,
+ \c!rightquotation=”,
+ \c!date={\v!year,年,\ ,\v!month,\v!day,日}]
+
+\installlanguage
+ [\s!ja]
+ [\c!leftsentence=——,
+ \c!rightsentence=——,
+ \c!leftsubsentence=——,
+ \c!rightsubsentence=——,
+ \c!leftquote=‘,
+ \c!rightquote=’,
+ \c!leftquotation=「,
+ \c!rightquotation=」,
+ \c!date={西暦,\v!year,年,\v!month,月,\v!day,日}]
+
+% Greek
+
+\installlanguage
+ [\s!gr]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\greekleftquot,
+ \c!rightquote=\greekrightquot,
+ \c!leftquotation=\greekleftquot,
+ \c!rightquotation=\greekrightquot,
+ \c!date={\v!day\ \v!month\ \v!year},
+ \s!patterns=\s!agr] % ok?
+
+\installlanguage [greek] [\s!gr]
+
+\installlanguage
+ [\s!agr]
+ [\s!default=\s!gr,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote]
+
+\installlanguage [ancientgreek] [\s!agr]
+\installlanguage [grk] [\s!agr]
+
+% Indo-Iranian Languages: 34.
+
+% Italic Languages: Latin, Italian, Rhaeto-Romanic, Rumanian,
+% Sardian, Catalan, French, Ladino, Portuguese, Proven\c{c}al,
+% Spanish
+
+\ifx\guillemotspace\undefined \let\guillemotspace\empty \fi
+\ifx\sentencespace \undefined \let\sentencespace \empty \fi
+
+\installlanguage
+ [\s!fr]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=\emdash,
+ \c!rightsentence=\emdash,
+ \c!leftsubsentence=\emdash,
+ \c!rightsubsentence=\emdash,
+ \c!leftquote=\leftguillemot,
+ \c!rightquote=\rightguillemot,
+ \c!leftquotation=\leftguillemot,
+ \c!rightquotation=\rightguillemot,
+ \c!date={\v!day+,\v!space,\v!month,\v!space,\v!year}]
+
+\installlanguage
+ [\s!es]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
+
+\installlanguage [sp] [\s!es] % old times context
+
+\installlanguage
+ [\s!ca]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
+
+% Note GB left|/|right (sub)sentences are for \quote {incisi}.
+
+\installlanguage
+ [\s!it]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=--,
+ \c!rightsubsentence=--,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!leftspeech=\leftguillemot,
+ \c!middlespeech=\leftguillemot,
+ \c!rightspeech=\rightguillemot,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
+
+\installlanguage % the same as italian
+ [\s!la]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\lowerrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\lowerrightdoubleninequote,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
+
+\installlanguage
+ [\s!pt]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
+
+\installlanguage
+ [\s!ro]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\leftguillemot,
+ \c!rightquote=\rightguillemot,
+ \c!leftquotation=\lowerrightdoubleninequote,
+ \c!rightquotation=\upperleftdoublesixquote,
+ \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
+
+%D For compatibility reasons we also define:
+
+\installlanguage [fa] [\s!fr] % for dutchies only
+
+\installlanguage [french] [\s!fr]
+\installlanguage [spanish] [\s!es]
+\installlanguage [catalan] [\s!ca]
+\installlanguage [italian] [\s!it]
+\installlanguage [latin] [\s!la]
+\installlanguage [portuguese] [\s!pt]
+\installlanguage [romanian] [\s!ro]
+
+%D Ordinal converters:
+
+\def\frordinaldaynumber#1% date is masculine
+ {\number#1\ifcase#1\or
+ \highordinalstr{er}%
+ \fi}
+
+\defineconversion [\s!fr] [\v!day+] [\frordinaldaynumber]
+
+% Vietnamese Language
+
+\installlanguage
+ [\s!vi]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\quoteleft,
+ \c!rightquote=\quoteright,
+ \c!leftquotation=\quotedblleft,
+ \c!rightquotation=\quotedblright,
+ \c!date={{ },dd,{/},mm,{/},yy}]
+
+\installlanguage [vietnamese] [\s!vi]
+
+\protect \endinput
diff --git a/tex/context/base/lang-ger.mkiv b/tex/context/base/lang-ger.mkiv
deleted file mode 100644
index abba341a4..000000000
--- a/tex/context/base/lang-ger.mkiv
+++ /dev/null
@@ -1,259 +0,0 @@
-%D \module
-%D [ file=lang-ger,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Germanic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Germanic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Norwegian \NC Hans Fredrik Nordhaug \NC \NR
-%D \NC Danish \NC Arne Jorgensen \NC \NR % check the o
-%D \NC Afrikaans \NC \NC \NR
-%D \stoptabulate
-
-% Danish, Faeroese, Icelandic, Norwegian, Swedish, German, Yiddish
-% Afrikaans, Dutch, English, Flemush, Frisian, Plattdeutsch
-
-\unprotect
-
-\installlanguage
- [\s!nl]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!en]
- [\c!spacing=\v!broad,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!month,\ ,\v!day,{,\ },\v!year},
- \s!patterns=\s!us,
- \s!lefthyphenmin=2,
- \s!righthyphenmin=3]
-
-\installlanguage
- [\s!de]
- [\c!spacing=\v!packed,
- \s!lefthyphenmin=3,
- \s!righthyphenmin=3,
- \c!leftsentence={\hbox{--~}},
- \c!rightsentence={\hbox{~--}},
- \c!leftsubsentence={--},
- \c!rightsubsentence={--},
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsinglesixquote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!da]
- [\c!spacing=\v!packed,
- \c!leftsentence={\hbox{--\hskip.5em}},
- \c!rightsentence={\hbox{\hskip.5em--}},
- \c!leftsubsentence={--},
- \c!rightsubsentence={--},
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsinglesixquote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!sv]
- [\c!spacing=\v!packed,
- \c!leftsentence={\hbox{--~}},
- \c!rightsentence={\hbox{~--}},
- \c!leftsubsentence={--},
- \c!rightsubsentence={--},
- \c!leftquote=\upperrightsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperrightdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!af]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
-
-\installlanguage
- [\s!nb]
- [spacing=packed,
- lefthyphenmin=2,
- righthyphenmin=2,
- leftsentence=---,
- rightsentence=---,
- leftsubsentence=---,
- rightsubsentence=---,
- leftquote=\upperleftsinglesixquote,
- rightquote=\upperrightsingleninequote,
- leftquotation=\leftguillemot,
- rightquotation=\rightguillemot,
- date={day,{.},\ ,month,\ ,year}]
-
-\installlanguage
- [\s!nn]
- [spacing=packed,
- lefthyphenmin=2,
- righthyphenmin=2,
- leftsentence=---,
- rightsentence=---,
- leftsubsentence=---,
- rightsubsentence=---,
- leftquote=\upperleftsinglesixquote,
- rightquote=\upperrightsingleninequote,
- leftquotation=\leftguillemot,
- rightquotation=\rightguillemot,
- date={day,{.},\ ,month,\ ,year}]
-
-\installlanguage [\s!no] [\s!nb]
-\installlanguage [\s!norwegian] [\s!nb]
-\installlanguage [\s!bokmal] [\s!nb]
-\installlanguage [\s!nynorsk] [\s!nn]
-
-%D Extra:
-
-% \mainlanguage[en]
-% \mainlanguage[de]
-% \mainlanguage[deo]
-% \mainlanguage[de-de]
-% \mainlanguage[de-at]
-% \mainlanguage[de-ch]
-%
-% \starttext
-% Die Herren Meier\index{Meier}, Müller\index{Müller}, Huber\index{Huber}
-% und Schmidt\index{Schmidt} arbeiten in der gleichen Firma.
-%
-% \index{Mass}\index{Mas}\index{Maß}\index{Maße}\index{Masse}
-% \index{Muller}\index{Mûller}
-% \index{Hutte}\index{Hütte}\index{Huttf}
-% \index{paar}\index{Paar}
-% \index{a}\index{aa}\index{ä}\index{az}\index{aza}
-% \index{o}\index{oo}\index{ö}\index{oz}\index{oza}
-% \index{u}\index{uu}\index{ü}\index{uz}\index{uza}\index{üa}
-% \index{call}\index{chip}
-%
-% \subject{Index} \placeindex
-% \stoptext
-
-\installlanguage % old german
- [deo]
- [\c!spacing=\v!packed,
- \c!default=\s!de]
-
-\installlanguage
- [de-de]
- [\c!spacing=\v!packed,
- \c!default=\s!de]
-
-\installlanguage
- [de-at]
- [\c!spacing=\v!packed,
- \c!default=\s!de,
- \c!leftquote=\leftguillemot,
- \c!rightquote=\rightguillemot,
- \c!leftquotation=\leftguillemot,
- \c!rightquotation=\rightguillemot]
-
-\installlanguage
- [de-ch]
- [\c!spacing=\v!packed,
- \c!default=\s!de]
-
-%D And some alternative (but very real) english patterns:
-
-\installlanguage
- [en-gb]
- [\c!default=\s!en,
- \s!patterns=\s!gb,
- \s!lefthyphenmin=3,
- \s!righthyphenmin=3]
-
-\installlanguage
- [en-us]
- [\c!default=\s!en,
- \s!patterns=\s!us]
-
-\installlanguage [\s!uk] [\s!en-\s!gb]
-\installlanguage [\s!us] [\s!en-\s!us]
-
-%D For compatibility reasons we also define:
-
-%installlanguage [du] [\s!de] % old times context
-%installlanguage [sp] [\s!es] % old times context /lang-ita
-
-\installlanguage [usenglish] [\s!en-\s!us]
-\installlanguage [ukenglish] [\s!en-\s!gb]
-\installlanguage [english] [\s!en]
-\installlanguage [dutch] [\s!nl]
-\installlanguage [german] [\s!de]
-\installlanguage [danish] [\s!da]
-\installlanguage [swedish] [\s!sv]
-\installlanguage [afrikaans] [\s!af]
-
-%D Next we implement couple of ordinal mumber converters:
-
-\def\enordinaldaynumber#1%
- {#1\ifnum\lasttwodigits{#1}=11
- \highordinalstr{th}%
- \else\ifnum\lasttwodigits{#1}=12
- \highordinalstr{th}%
- \else\ifnum\lasttwodigits{#1}=13
- \highordinalstr{th}%
- \else\ifcase\lastdigit{#1}%
- \highordinalstr{th}%
- \or % 1
- \highordinalstr{st}%
- \or % 2
- \highordinalstr{nd}%
- \or % 3
- \highordinalstr{rd}%
- \else
- \highordinalstr{th}%
- \fi\fi\fi\fi}
-
-% \def\enordinaldaynumber#1%
-% {#1\ordinalstr{\ifnum\lasttwodigits{#1}=11 th\else\ifcase\lastdigit{#1}
-% th\or st\or nd\or rd\else th\fi\fi}}
-
-\def\nlordinaldaynumber#1%
- {#1\highordinalstr{e}}
-
-\protect \endinput
diff --git a/tex/context/base/lang-grk.mkiv b/tex/context/base/lang-grk.mkiv
deleted file mode 100644
index 92bd9aca6..000000000
--- a/tex/context/base/lang-grk.mkiv
+++ /dev/null
@@ -1,48 +0,0 @@
-%D \module
-%D [ file=lang-grk,
-%D version=2003.04.01,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Uralic Languages,
-%D author=Apostolos Syropoulos
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Greek}
-
-%D The framework of this module is set up by Hans Hagen while
-%D all the translations have been done by Apostolos Syropoulos
-
-\unprotect
-
-\installlanguage
- [\s!gr]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\greekleftquot,
- \c!rightquote=\greekrightquot,
- \c!leftquotation=\greekleftquot,
- \c!rightquotation=\greekrightquot,
- \c!date={\v!day\ \v!month\ \v!year},
- \s!patterns=\s!agr] % ok?
-
-\installlanguage [greek] [\s!gr]
-
-\installlanguage
- [\s!agr]
- [\s!default=\s!gr,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote]
-
-\installlanguage [ancientgreek] [\s!agr]
-\installlanguage [grk] [\s!agr]
-
-\protect \endinput
diff --git a/tex/context/base/lang-ind.mkiv b/tex/context/base/lang-ind.mkiv
deleted file mode 100644
index 9b6e5ff1d..000000000
--- a/tex/context/base/lang-ind.mkiv
+++ /dev/null
@@ -1,26 +0,0 @@
-%D \module
-%D [ file=lang--ind,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Indo Iranian Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Indo-Iranian Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-% 34 languages
-
-\unprotect
-
-\protect \endinput
diff --git a/tex/context/base/lang-ini.mkii b/tex/context/base/lang-ini.mkii
index 91ac59847..50a3689cf 100644
--- a/tex/context/base/lang-ini.mkii
+++ b/tex/context/base/lang-ini.mkii
@@ -265,7 +265,7 @@
\fi
\egroup}
-\fetchruntimecommand \showpatterns {\f!languageprefix\s!run.mkii}
+\fetchruntimecommand \showpatterns {\f!languageprefix\s!run}
%D Since we can only load patterns in ini\TeX, we nil the
%D loading before dumping (which saves a bit of memory, but
diff --git a/tex/context/base/lang-ita.mkiv b/tex/context/base/lang-ita.mkiv
deleted file mode 100644
index 2443825de..000000000
--- a/tex/context/base/lang-ita.mkiv
+++ /dev/null
@@ -1,157 +0,0 @@
-%D \module
-%D [ file=lang-ita,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Italic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% Todo: replace \'.. by \namedglyph
-
-\writestatus{loading}{ConTeXt Language Macros / Italic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Italian \NC Giuseppe Bilotta \NC \NR
-%D \NC Romanian \NC Dan Seracu \NC \NR
-%D \NC Portuguese \NC Pedro F. M. Mendon\c a \NC \NR
-%D \stoptabulate
-
-% Latin, Italian, Rhaeto-Romanic, Rumanian, Sardian
-% Catalan, French, Ladino, Portuguese, Proven\c{c}al, Spanish
-
-\unprotect
-
-\ifx\guillemotspace\undefined \let\guillemotspace\empty \fi
-\ifx\sentencespace \undefined \let\sentencespace \empty \fi
-
-\installlanguage
- [\s!fr]
- [\c!spacing=\v!packed,
- \c!leftsentence=\emdash,
- \c!rightsentence=\emdash,
- \c!leftsubsentence=\emdash,
- \c!rightsubsentence=\emdash,
- \c!leftquote=\leftguillemot,
- \c!rightquote=\rightguillemot,
- \c!leftquotation=\leftguillemot,
- \c!rightquotation=\rightguillemot,
- \c!date={\v!day+,\v!space,\v!month,\v!space,\v!year}]
-
-\installlanguage
- [\s!es]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage [sp] [\s!es] % old times context
-
-\installlanguage
- [\s!ca]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-% Note GB left|/|right (sub)sentences are for \quote {incisi}.
-
-\installlanguage
- [\s!it]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=--,
- \c!rightsubsentence=--,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!leftspeech=\leftguillemot,
- \c!middlespeech=\leftguillemot,
- \c!rightspeech=\rightguillemot,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage % the same as italian
- [\s!la]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\lowerrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\lowerrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!pt]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
-
-\installlanguage
- [\s!ro]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\leftguillemot,
- \c!rightquote=\rightguillemot,
- \c!leftquotation=\lowerrightdoubleninequote,
- \c!rightquotation=\upperleftdoublesixquote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-%D For compatibility reasons we also define:
-
-\installlanguage [fa] [\s!fr] % for dutchies only
-
-\installlanguage [french] [\s!fr]
-\installlanguage [spanish] [\s!es]
-\installlanguage [catalan] [\s!ca]
-\installlanguage [italian] [\s!it]
-\installlanguage [latin] [\s!la]
-\installlanguage [portuguese] [\s!pt]
-\installlanguage [romanian] [\s!ro]
-
-%D Ordinal converters:
-
-\def\frordinaldaynumber#1% date is masculine
- {\number#1\ifcase#1\or
- \highordinalstr{er}%
- \fi}
-
-\defineconversion [\s!fr] [\v!day+] [\frordinaldaynumber]
-
-\protect \endinput
diff --git a/tex/context/base/lang-sla.mkiv b/tex/context/base/lang-sla.mkiv
deleted file mode 100644
index 3bcf04c57..000000000
--- a/tex/context/base/lang-sla.mkiv
+++ /dev/null
@@ -1,179 +0,0 @@
-%D \module
-%D [ file=lang-sla,
-%D version=1999.09.13, % 1997.09.03
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Slavic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% Todo: replace \'.. by \namedglyph
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Czech \NC Tom Hudec, Petr Sojka \NC \NR
-%D \NC Polish \NC Grzegorz Sapijaszko \NC \NR
-%D \NC Croatian \NC \Zcaron eljko Vrba \NC \NR
-%D \NC Slovenian \NC Mojca Miklavec \NC \NR
-%D \NC Cz and Sk \NC Richard Gabriel \NC \NR
-%D \stoptabulate
-
-% Belarussian, Russian, Ukrainian, Bulgarian, Macedonian,
-% Serbian, Croatian, Slovenian, Czech, Kushubian,
-% Lusatian/Sorbian/Wendish, Polish, Slovak, Albanian,
-% Illyrian, Armenian
-
-\writestatus{loading}{ConTeXt Language Macros / Slavic Languages}
-
-\unprotect
-
-\installlanguage
- [\s!pl]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!cs]
- [\c!spacing=\v!packed,
- \c!leftsentence=\thickglue--\thickglue\penalty-20\relax, % hh, \relax added
- \c!rightsentence=\thickglue--\thickglue\penalty-20\relax,
- \c!leftsubsentence=~---~\penalty-20\relax,
- \c!rightsubsentence=~---~\penalty-20\relax,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsinglesixquote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!day,{.\,},\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!sk]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,{.\,},\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!hr]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
-
-%D The default quotation marks for Slovenian were chosen as
-%D \lowerleftdoubleninequote these ones\upperrightdoublesixquote\
-%D which was probably due to the strong influence computers
-%D had on typesetting, but \rightguillemot these ones\leftguillemot\
-%D are \quotation{more correct}.
-%D
-%D If you still want the other quotation marks, use this:
-%D
-%D \starttyping
-%D \installlanguage
-%D [sl]
-%D [leftquote=\lowerleftsingleninequote,
-%D rightquote=\upperrightsinglesixquote,
-%D leftquotation=\lowerleftdoubleninequote,
-%D rightquotation=\upperrightdoublesixquote]
-%D \stoptyping
-%D
-%D If you disagree with the change, please send an email to Mojca, but
-%D best use some pretty strong arguments because she loves S{\sl love}nia
-%D too much to compromise on this.
-%D
-%D German faces approximately the same problem. I (MM) would prefer to
-%D have something like:
-%D
-%D \starttyping
-%D \mainlanguage[sl][quotationstyle=guillemot|doublequote] % better name needed
-%D \stoptyping
-%D
-%D but users are expected to respect the rules of nice and correct
-%D typography anyway.
-
-\installlanguage
- [\s!sl]
- [\c!spacing=\v!packed,
- \c!leftsentence={\hbox{--~}},
- \c!rightsentence={\hbox{~--}},
- \c!leftsubsentence={--},
- \c!rightsubsentence={--},
- %\c!leftquote=\lowerleftsingleninequote,
- %\c!rightquote=\upperrightsinglesixquote,
- %\c!leftquotation=\lowerleftdoubleninequote,
- %\c!rightquotation=\upperrightdoublesixquote,
- \c!leftquote=\guilsingleright,
- \c!rightquote=\guilsingleleft,
- \c!leftquotation=\rightguillemot,
- \c!rightquotation=\leftguillemot,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
-
-\installlanguage [polish] [\s!pl]
-\installlanguage [czech] [\s!cs]
-\installlanguage [slovak] [\s!sk]
-\installlanguage [croatian] [\s!hr]
-\installlanguage [slovenian] [\s!sl]
-\installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?)
-
-\installlanguage [cz] [\s!cs]
-
-\def\doconvertsloveniancharacters{\dodoconvertcharacters{25}}
-
-\def\sloveniancharacters{\doconvertsloveniancharacters\sloveniancharacter}
-\def\slovenianCharacters{\doconvertsloveniancharacters\slovenianCharacter}
-
-%D Define general-purpose macros for Slovenian character enumerations:
-
-\defineconversion [sloveniancharacter] [\sloveniancharacter]
-\defineconversion [slovenianCharacter] [\slovenianCharacter]
-
-\defineconversion [sloveniancharacters] [\sloveniancharacters]
-\defineconversion [slovenianCharacters] [\slovenianCharacters]
-
-%D Define these as the general character enumeration when
-%D language is Slovenian. If you feel uncomfortable with this,
-%D mail Mojca, since she promised to to take the heat.
-
-\defineconversion [sl] [character] [\sloveniancharacter]
-\defineconversion [sl] [Character] [\slovenianCharacter]
-
-\defineconversion [sl] [characters] [\sloveniancharacters]
-\defineconversion [sl] [Characters] [\slovenianCharacters]
-
-\defineconversion [sl] [a] [\sloveniancharacters]
-\defineconversion [sl] [A] [\slovenianCharacters]
-\defineconversion [sl] [AK] [\smallcapped\sloveniancharacters]
-\defineconversion [sl] [KA] [\smallcapped\sloveniancharacters]
-
-\def\sloveniancharacters#1{\ctxlua{converters.alphabetic(\number#1,"sl")}}
-\def\slovenianCharacters#1{\ctxlua{converters.Alphabetic(\number#1,"sl")}}
-
-\protect \endinput
diff --git a/tex/context/base/lang-txt.lua b/tex/context/base/lang-txt.lua
index 05e6f03bf..d0168356d 100644
--- a/tex/context/base/lang-txt.lua
+++ b/tex/context/base/lang-txt.lua
@@ -9,7 +9,8 @@ if not modules then modules = { } end modules ['lang-txt'] = {
-- The content of this file is derived from the mkii lang-* files and
-- early 2011 the mkii labels are generated from this file. The
-- translations have been collected over years by users, using named
--- glyphs. This file uses utf exclusively.
+-- glyphs. This file uses utf exclusively. For those involved in the
+-- translations see the 'lang-*.mkii' files.
-- For the moment we keep this table in memory. In the future we can then
-- enable labels.
diff --git a/tex/context/base/lang-ura.mkiv b/tex/context/base/lang-ura.mkiv
deleted file mode 100644
index 3b69d4696..000000000
--- a/tex/context/base/lang-ura.mkiv
+++ /dev/null
@@ -1,63 +0,0 @@
-%D \module
-%D [ file=lang-sla,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Uralic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% Todo: replace \'.. by \namedglyph
-
-\writestatus{loading}{ConTeXt Language Macros / Uralic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Finnish \NC \NC \NR
-%D \NC Hungarian \NC Balazs Nagy \NC \NR
-%D \stoptabulate
-
-% Cheremiss, Estonian, Finnish, Karelian, Laap, Mordvinian,
-% Permian tongues, Hungarian, Ostyak, Vogul, Samoyed
-
-\unprotect
-
-\installlanguage
- [\s!fi]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
-
-\installlanguage
- [\s!hu]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,.,\ ,\v!month,\ ,\v!day,.}]
-
-\installlanguage [finish] [\s!fi]
-\installlanguage [hungarian] [\s!hu]
-
-\protect \endinput
diff --git a/tex/context/base/lang-vn.mkiv b/tex/context/base/lang-vn.mkiv
deleted file mode 100644
index 1e852d762..000000000
--- a/tex/context/base/lang-vn.mkiv
+++ /dev/null
@@ -1,43 +0,0 @@
-%D \module
-%D [ file=lang-vn,
-%D version=2004.11.22, % 1999.12.12,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Vietnamese,
-%D author={Han The Thanh \& Adam Lindsay \& Hans Hagen},
-%D date=\currentdate,
-%D copyright=\PRAGMA]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Language Macros / Vietnamese Language}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Vietnamese \NC \THANH\ \NC \NR
-%D \stoptabulate
-
-\unprotect
-
-\installlanguage
- [\s!vi]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\quoteleft,
- \c!rightquote=\quoteright,
- \c!leftquotation=\quotedblleft,
- \c!rightquotation=\quotedblright,
- \c!date={{ },dd,{/},mm,{/},yy}]
-
-\installlanguage [vietnamese] [\s!vi]
-
-\protect \endinput
diff --git a/tex/context/base/lpdf-wid.lua b/tex/context/base/lpdf-wid.lua
index 6caf2f6c4..7b535d1b1 100644
--- a/tex/context/base/lpdf-wid.lua
+++ b/tex/context/base/lpdf-wid.lua
@@ -227,7 +227,7 @@ function codeinjections.attachfile(specification)
local width = specification.width or 0
local height = specification.height or 0
local depth = specification.depth or 0
- write_node(pdfannotation_node(width,height,depth,d()))
+ write_node(pdfannotation_node(width,height,depth,d())) -- somehow the dimensions come out wrong
end
function codeinjections.attachmentid(filename)
diff --git a/tex/context/base/luat-fmt.lua b/tex/context/base/luat-fmt.lua
index 2be205d8c..04f3143dd 100644
--- a/tex/context/base/luat-fmt.lua
+++ b/tex/context/base/luat-fmt.lua
@@ -35,10 +35,14 @@ function environment.make_format(name)
end
logs.simple("format path: %s",lfs.currentdir())
-- check source file
- local texsourcename = file.addsuffix(name,"tex")
+ local texsourcename = file.addsuffix(name,"mkiv")
local fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
if fulltexsourcename == "" then
- logs.simple("no tex source file with name: %s",texsourcename)
+ texsourcename = file.addsuffix(name,"tex")
+ fulltexsourcename = resolvers.findfile(texsourcename,"tex") or ""
+ end
+ if fulltexsourcename == "" then
+ logs.simple("no tex source file with name: %s (mkiv or tex)",name)
lfs.chdir(olddir)
return
else
diff --git a/tex/context/base/math-ini.mkii b/tex/context/base/math-ini.mkii
index f9dd859c4..9f7ab49e5 100644
--- a/tex/context/base/math-ini.mkii
+++ b/tex/context/base/math-ini.mkii
@@ -405,8 +405,8 @@
\appendtoks\autoenablemathcollection\to\mathstrategies
-\fetchruntimecommand \showmathcharacters {\f!mathprefix\s!run.mkii}
-\fetchruntimecommand \showmathtoken {\f!mathprefix\s!run.mkii}
+\fetchruntimecommand \showmathcharacters {\f!mathprefix\s!run}
+\fetchruntimecommand \showmathtoken {\f!mathprefix\s!run}
\def\resetmathcollection[#1]%
{\def\mathcollection{#1}%
diff --git a/tex/context/base/meta-clp.tex b/tex/context/base/meta-clp.mkii
index be2506b19..be2506b19 100644
--- a/tex/context/base/meta-clp.tex
+++ b/tex/context/base/meta-clp.mkii
diff --git a/tex/context/base/meta-dum.tex b/tex/context/base/meta-dum.mkii
index bc19f3c5f..bc19f3c5f 100644
--- a/tex/context/base/meta-dum.tex
+++ b/tex/context/base/meta-dum.mkii
diff --git a/tex/context/base/meta-fig.mkiv b/tex/context/base/meta-fig.mkiv
index 4738316da..8c8ed03a7 100644
--- a/tex/context/base/meta-fig.mkiv
+++ b/tex/context/base/meta-fig.mkiv
@@ -58,6 +58,7 @@
\setupMPpage
[\c!scale=1000,
+ \c!pagestate=,
\c!strut=\v!no,
\c!align=,
\c!offset=\v!overlay,
diff --git a/tex/context/base/meta-imp-clp.mkiv b/tex/context/base/meta-imp-clp.mkiv
new file mode 100644
index 000000000..be2506b19
--- /dev/null
+++ b/tex/context/base/meta-imp-clp.mkiv
@@ -0,0 +1,164 @@
+%D \module
+%D [ file=meta-clp,
+%D version=2000.07.06,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Clipping,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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 In this library, we define a bunch of clipping paths that
+%D can be fed to \type {\clip}.
+
+\startMPclip{ellipse}
+ clip currentpicture to unitcircle
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{negellipse}
+ clip currentpicture to (unitcircle peepholed unitsquare)
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{urellipse}
+ clip currentpicture to urcircle scaled 2
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{ulellipse}
+ clip currentpicture to ulcircle scaled 2 shifted (1,0)
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{llellipse}
+ clip currentpicture to llcircle scaled 2 shifted (1,1)
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{lrellipse}
+ clip currentpicture to lrcircle scaled 2 shifted (0,1)
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{tellipse}
+ clip currentpicture to tcircle shifted (.5,0) yscaled 2
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{bellipse}
+ clip currentpicture to bcircle shifted (.5,.5) yscaled 2
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{lellipse}
+ clip currentpicture to lcircle shifted (.5,.5) xscaled 2
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{rellipse}
+ clip currentpicture to rcircle shifted (0,.5) xscaled 2
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{diamond}
+ clip currentpicture to unitdiamond
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{negdiamond}
+ clip currentpicture to (unitdiamond peepholed unitsquare)
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{urtriangle}
+ clip currentpicture to urtriangle scaled 2
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{ultriangle}
+ clip currentpicture to ultriangle scaled 2 shifted (1,0)
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{lltriangle}
+ clip currentpicture to lltriangle scaled 2 shifted (1,1)
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+\startMPclip{lrtriangle}
+ clip currentpicture to lrtriangle scaled 2 shifted (0,1)
+ xscaled \width yscaled \height ;
+\stopMPclip
+
+% More efficient:
+%
+% \def\dosimpleMPclip#1
+% {clip currentpicture to (#1) xscaled \width yscaled \height ;}
+%
+% \def\simpleMPclip#1#2%
+% {\startMPclip{#1}\dosimpleMPclip{#2}\stopMPclip}
+%
+% \simpleMPclip {ellipse} {unitcircle}
+% \simpleMPclip {diamond} {unitdiamond}
+%
+% \simpleMPclip {negellipse} {unitcircle peepholed unitsquare}
+% \simpleMPclip {negdiamond} {unitdiamond peepholed unitsquare}
+%
+% \simpleMPclip {urellipse} {urcircle scaled 2 shifted (0,0)}
+% \simpleMPclip {ulellipse} {ulcircle scaled 2 shifted (1,0)}
+% \simpleMPclip {llellipse} {llcircle scaled 2 shifted (1,1)}
+% \simpleMPclip {lrellipse} {lrcircle scaled 2 shifted (0,1)}
+%
+% \simpleMPclip {tellipse} {tcircle shifted (.5,0) yscaled 2}
+% \simpleMPclip {bellipse} {bcircle shifted (.5,.5) yscaled 2}
+% \simpleMPclip {lellipse} {lcircle shifted (.5,.5) xscaled 2}
+% \simpleMPclip {rellipse} {rcircle shifted (0,.5) xscaled 2}
+%
+% \simpleMPclip {urtriangle} {urtriangle scaled 2 shifted (0,0)}
+% \simpleMPclip {ultriangle} {ultriangle scaled 2 shifted (1,0)}
+% \simpleMPclip {lltriangle} {lltriangle scaled 2 shifted (1,1)}
+% \simpleMPclip {lrtriangle} {lrtriangle scaled 2 shifted (0,1)}
+
+%D \in {Figure} [fig:clipping paths] shows which paths are
+%D predefined. When applied to a whole picture, their usage
+%D is:
+%D
+%D \starttyping
+%D \clip[nx=1,ny=1,mp=ellipse]{some clippable content}
+%D \stoptyping
+%D
+%D \startbuffer
+%D \setupclipping [nx=1,ny=1,x=1,y=1]
+%D \setupblackrules[width=2cm,height=1cm]
+%D \startcombination[6*3] % \startcombination[6*3]
+%D {\clip[mp=urellipse] {\blackrule}} {urellipse}
+%D {\clip[mp=ulellipse] {\blackrule}} {ulellipse}
+%D {\clip[mp=llellipse] {\blackrule}} {llellipse}
+%D {\clip[mp=lrellipse] {\blackrule}} {lrellipse}
+%D {\clip[mp=ellipse] {\blackrule}} {ellipse}
+%D {\clip[mp=negellipse]{\blackrule}} {negellipse}
+%D {\clip[mp=tellipse] {\blackrule}} {tellipse}
+%D {\clip[mp=bellipse] {\blackrule}} {bellipse}
+%D {\clip[mp=lellipse] {\blackrule}} {lellipse}
+%D {\clip[mp=rellipse] {\blackrule}} {rellipse}
+%D {} {}
+%D {} {}
+%D {\clip[mp=urtriangle]{\blackrule}} {urtriangle}
+%D {\clip[mp=ultriangle]{\blackrule}} {ultriangle}
+%D {\clip[mp=lltriangle]{\blackrule}} {lltriangle}
+%D {\clip[mp=lrtriangle]{\blackrule}} {lrtriangle}
+%D {\clip[mp=diamond] {\blackrule}} {diamond}
+%D {\clip[mp=negdiamond]{\blackrule}} {negdiamond}
+%D \stopcombination % \stopcombination
+%D \stopbuffer
+%D
+%D \placefigure % \placefigure
+%D [here][fig:clipping paths]
+%D {The predefined clipping paths.}
+%D {\getbuffer} % {\getbuffer}
+
+\endinput
diff --git a/tex/context/base/meta-imp-dum.mkiv b/tex/context/base/meta-imp-dum.mkiv
new file mode 100644
index 000000000..bc19f3c5f
--- /dev/null
+++ b/tex/context/base/meta-imp-dum.mkiv
@@ -0,0 +1,123 @@
+%D \module
+%D [ file=meta-dum,
+%D version=2003.03.21,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Dummy (External) Graphics,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D This library overloads the normal external figure
+%D placeholder by a nicer one.
+%D
+%D \startbuffer
+%D \useMPlibrary[dum]
+%D
+%D \startlinecorrection
+%D \externalfigure[unknown-a][width=3cm,height=1cm]
+%D \stoplinecorrection
+%D
+%D \startlinecorrection
+%D \externalfigure[unknown-b][width=4cm,height=5cm]
+%D \stoplinecorrection
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+% currently preparempvariables is unable to resolve number
+% fractions like reduction
+
+% June 22, 2003, this definition was patched to adapt itself
+% to transparent colors
+
+\startuseMPgraphic{placeholder}{width,height,reduction,color}
+ numeric w, h, d, r ; color c, b, cc ; path p ; boolean t ;
+ t := is_transparent(\MPvar{color}) ;
+ c := not_transparent(\MPvar{color}) ;
+ b := not_transparent(white) ;
+ w := \MPvar{width} ;
+ h := \MPvar{height} ;
+ r := \MPvar{reduction} ;
+ d := max(w,h) ;
+ p := unitsquare xyscaled (w,h) ;
+ cc := r[.5c,b] ;
+ fill p withcolor if t : transparent(1,.5,cc) else : cc fi ;
+ for i := 1 upto 60 :
+ cc := r[c randomized(.3,.9),b] ;
+ fill fullcircle
+ scaled (d/5 randomized (d/5))
+ shifted (center p randomized (d))
+ withcolor if t : transparent(1,.5,cc) else : cc fi ;
+ endfor ;
+ clip currentpicture to p ;
+\stopuseMPgraphic
+
+\definepalet
+ [placeholder]
+ [1=red,2=green,3=blue,4=cyan,5=magenta,6=yellow]
+
+% \newcounter \figurereplacementcycle
+
+\let\figurereplacementcycle\relax
+
+\setupexternalfigures
+ [\c!reduction=0,
+ \c!text=\v!yes]
+
+\let\normalexternalfigurereplacement\externalfigurereplacement
+
+\def\externalfigurereplacement#1#2#3%
+ {\getpaletsize[placeholder]%
+ \ifx\figurereplacementcycle\relax
+ \getrandomnumber \figurereplacementcycle \!!plusone \paletsize
+ \globallet \figurereplacementcycle \figurereplacementcycle
+ \else
+ \doglobal\increment\figurereplacementcycle
+ \fi
+ \ifnum\figurereplacementcycle>\paletsize
+ \globallet\figurereplacementcycle\!!plusone
+ \fi
+ \weightGRAYfalse % monochrome anyway
+ \MPcmykcolorsfalse
+ \MPspotcolorsfalse
+ \defineoverlay
+ [\s!dummy]
+ [\useMPgraphic
+ {placeholder}%
+ {width=\figurewidth,
+ height=\figureheight,
+ reduction=\@@efreduction,
+ color=placeholder:\figurereplacementcycle}]%
+ \expanded{\localframed
+ [\??ef]
+ [\c!width=\figurewidth,
+ \c!height=\figureheight,
+ \c!frame=\v!off,
+ \c!strut=\v!no,
+ \c!background=\s!dummy,
+ \c!foregroundcolor=\s!white]}%
+ {\doif\@@eftext\v!yes
+ {\infofont \setupinterlinespace \dohyphens % \nohyphens
+ \doifelse{#1}\s!dummy \!!doneafalse\!!doneatrue
+ \doifelse{#2}\s!dummy \!!donebfalse\!!donebtrue
+ \doifelse{#3}\s!unknown\!!donecfalse\!!donectrue
+ \if!!donea
+ name: \expanded{\verbatimstring{#1}}\strut\endgraf
+ \fi
+ \if!!doneb
+ \if!!donea file: \else \if!!donec file: \fi \fi
+ \expanded{\verbatimstring{#2}}\strut\endgraf
+ \fi
+ \if!!donec
+ state: \expanded{\verbatimstring{#3}}\strut\endgraf
+ \fi}}}
+
+\def\dummyfigure{\externalfigure[placeholder]}
+
+\protect \endinput
diff --git a/tex/context/base/meta-mis.tex b/tex/context/base/meta-imp-mis.mkiv
index 29ab43007..29ab43007 100644
--- a/tex/context/base/meta-mis.tex
+++ b/tex/context/base/meta-imp-mis.mkiv
diff --git a/tex/context/base/meta-nav.tex b/tex/context/base/meta-imp-nav.mkiv
index 9c1cbb4db..9c1cbb4db 100644
--- a/tex/context/base/meta-nav.tex
+++ b/tex/context/base/meta-imp-nav.mkiv
diff --git a/tex/context/base/meta-pre.tex b/tex/context/base/meta-imp-pre.mkiv
index cb861ff20..cb861ff20 100644
--- a/tex/context/base/meta-pre.tex
+++ b/tex/context/base/meta-imp-pre.mkiv
diff --git a/tex/context/base/meta-txt.tex b/tex/context/base/meta-imp-txt.mkiv
index 474253a40..474253a40 100644
--- a/tex/context/base/meta-txt.tex
+++ b/tex/context/base/meta-imp-txt.mkiv
diff --git a/tex/context/base/meta-ini.lua b/tex/context/base/meta-ini.lua
new file mode 100644
index 000000000..776814f1d
--- /dev/null
+++ b/tex/context/base/meta-ini.lua
@@ -0,0 +1,24 @@
+if not modules then modules = { } end modules ['meta-ini'] = {
+ version = 1.001,
+ comment = "companion to meta-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format = string.format
+
+metapost = metapost or { }
+
+-- for the moment downward compatible
+
+local patterns = { "meta-imp-%s.mkiv", "meta-imp-%s.tex", "meta-%s.mkiv", "meta-%s.tex" } -- we are compatible
+
+function metapost.uselibrary(name)
+ commands.uselibrary(name,patterns,function(name,foundname)
+ context.startreadingfile()
+ context.showmessage("metapost",1,name)
+ context.input(foundname)
+ context.stopreadingfile()
+ end)
+end
diff --git a/tex/context/base/meta-ini.mkii b/tex/context/base/meta-ini.mkii
index c07a5ada9..fd6ef9a61 100644
--- a/tex/context/base/meta-ini.mkii
+++ b/tex/context/base/meta-ini.mkii
@@ -626,7 +626,11 @@
\letvalueempty{\c!file\f!metapostprefix#1}%
\makeshortfilename[\truefilename{\f!metapostprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename{\showmessage\m!metapost1{#1}}\donothing
+ \readsysfile{\shortfilename.\mksuffix}
+ {\showmessage\m!metapost1{#1}}
+ {\readsysfile{\shortfilename.tex}
+ {\showmessage\m!metapost1{#1}}
+ \donothing}%
\stopreadingfile
\fi}
diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv
index 917201b27..145251d87 100644
--- a/tex/context/base/meta-ini.mkiv
+++ b/tex/context/base/meta-ini.mkiv
@@ -13,6 +13,8 @@
\writestatus{loading}{MetaPost Graphics / Initializations}
+\registerctxluafile{meta-ini}{1.001}
+
\unprotect
%D Instead of sharing code with \MKII, I decided to copy
@@ -837,16 +839,7 @@
%D Loading specific \METAPOST\ related definitions is
%D accomplished by:
-\def\douseMPlibrary#1%
- {\ifcsname\c!file\f!metapostprefix#1\endcsname\else
- \letvalueempty{\c!file\f!metapostprefix#1}%
- \startreadingfile
- \readsysfile{\truefilename{\f!metapostprefix#1}}{\showmessage\m!metapost1{#1}}\donothing
- \stopreadingfile
- \fi}
-
-\def\useMPlibrary[#1]%
- {\processcommalist[#1]\douseMPlibrary}
+\unexpanded\def\useMPlibrary[#1]{\ctxlua{metapost.uselibrary(\!!bs#1\!!es)}}
%D \macros
%D {setMPtext, MPtext, MPstring, MPbetex}
diff --git a/tex/context/base/meta-mis.mkii b/tex/context/base/meta-mis.mkii
new file mode 100644
index 000000000..29ab43007
--- /dev/null
+++ b/tex/context/base/meta-mis.mkii
@@ -0,0 +1,54 @@
+%D \module
+%D [ file=meta-mis,
+%D version=2006.06.06,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Misc Test Graphics,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+% p/s 1/false 1/true 2/false 2/true
+%
+% MKII 8.5 8.0 8.8 8.5
+% MKIV 16.1 7.2 16.3 7.4
+
+\startuseMPgraphic{mptopdf-test}
+ prologues := 2;
+ mpprocset := 1 ;
+ fill fullcircle scaled 3cm withcolor red ;
+ fill fullcircle scaled 2cm withcolor green ;
+ fill fullcircle scaled 1cm withcolor blue ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ fill fullcircle scaled 3cm withcolor cmyk(0,0,1,0) ;
+ fill fullcircle scaled 2cm withcolor cmyk(0,1,0,0) ;
+ fill fullcircle scaled 1cm withcolor cmyk(1,0,0,0) ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ draw fullcircle scaled 3cm dashed evenly ;
+ draw fullcircle scaled 2cm dashed withdots ;
+ draw origin withpen pencircle scaled 3mm;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red);
+ fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red);
+ fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green);
+ fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5));
+ currentpicture := currentpicture shifted (12cm,-4cm) ;
+ draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ % bug: shift
+ draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ;
+ draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ;
+ filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ % shade cannot handle shift
+ circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ;
+ circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ;
+ filldraw boundingbox currentpicture enlarged (-bbheight(currentpicture)/2+2.5mm) withpen pencircle scaled 1pt withcolor .5white ;
+\stopuseMPgraphic
+
+\protect \endinput
diff --git a/tex/context/base/meta-nav.mkii b/tex/context/base/meta-nav.mkii
new file mode 100644
index 000000000..9c1cbb4db
--- /dev/null
+++ b/tex/context/base/meta-nav.mkii
@@ -0,0 +1,65 @@
+%D \module
+%D [ file=meta-nav,
+%D version=2003.03.28,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Navigational Graphics,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startuniqueMPgraphic{navplus}{size,color,type,mode}
+ color c ; numeric s, t ; path p ;
+ t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ;
+ if \MPvar{mode} = 1 : c := .5[c,white] fi ;
+ if t = 1 :
+ p := ((0,0)--(1/2,0)--(1,1/3)--(1,1)--(0,1)--(0,0)--cycle)
+ xyscaled (3,4) ;
+ elseif t = 2 :
+ p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle)
+ xyscaled (4,3) ;
+ else :
+ p := fullsquare xyscaled (3,3) ;
+ fi ;
+ draw p withpen pencircle scaled (1/2) withcolor .75white ;
+ fill p withcolor c ;
+ draw p withpen pencircle scaled (1/3) withcolor .5c ;
+ currentpicture := currentpicture scaled s ;
+ currentpicture := currentpicture shifted -center currentpicture ;
+\stopuniqueMPgraphic
+
+\setupMPvariables
+ [navplus]
+ [size=1ex,
+ color=black,
+ type=1,
+ mode=0]
+
+\definepalet
+ [navplus]
+ [attach=darkred,
+ comment=darkblue]
+
+\definesymbol
+ [comment-normal]
+ [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}]
+\definesymbol
+ [comment-down]
+ [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}]
+
+\definesymbol
+ [attach-normal]
+ [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}]
+\definesymbol
+ [attach-down]
+ [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}]
+
+\unprotect
+
+\setupcomment [\c!symbol={comment-normal,comment-down}]
+\setupattachments[\c!symbol={attach-normal,attach-down}]
+
+\protect \endinput
diff --git a/tex/context/base/meta-pre.mkii b/tex/context/base/meta-pre.mkii
new file mode 100644
index 000000000..cb861ff20
--- /dev/null
+++ b/tex/context/base/meta-pre.mkii
@@ -0,0 +1,68 @@
+%D \module
+%D [ file=meta-pre,
+%D version=2001.03.21,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Predefined Goodies,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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 In this library, we define a couple of handy graphics.
+
+% todo: use the predefine grid macros, mp code will move to
+% mp-* file
+
+\startuseMPgraphic{pagegrid}
+ StartPage ;
+ drawoptions(withcolor .8white) ;
+ fill Field[Text][Text] ;
+ drawoptions(withcolor .65white) ;
+ fill Field[Footer][Text] ;
+ fill Field[Header][Text] ;
+ fill Field[LeftMargin][Text] ;
+ fill Field[RightMargin][Text] ;
+ drawoptions(withcolor .65yellow) ;
+ fill Field[LeftEdge][Text] ;
+ fill Field[RightEdge][Text] ;
+ fill Field[Bottom][Text] ;
+ fill Field[Top][Text] ;
+ drawoptions(withpen pencircle scaled .3pt withcolor .65white) ;
+ for i=-3cm step 1cm until PaperWidth+3cm :
+ draw (i,-3cm)--(i,PaperHeight+3cm) ;
+ endfor ;
+ for i=PaperHeight+3cm step -1cm until -3cm :
+ draw (-3cm,i)--(PaperWidth+3cm,i) ;
+ endfor ;
+ drawoptions(withpen pencircle scaled .15pt) ;
+ for i=.5cm-3cm step 1cm until PaperWidth+3cm :
+ draw (i,-3cm)--(i,PaperHeight+3cm) ;
+ endfor ;
+ for i=PaperHeight-.5cm+3cm step -1cm until -3cm :
+ draw (-3cm,i)--(PaperWidth+3cm,i) ;
+ endfor ;
+ drawoptions(withpen pencircle scaled .3pt withcolor .65red) ;
+ for i=0 step 1cm until PaperWidth :
+ draw (i,0)--(i,PaperHeight) ;
+ endfor ;
+ for i=PaperHeight step -1cm until 0 :
+ draw (0,i)--(PaperWidth,i) ;
+ endfor ;
+ drawoptions(withpen pencircle scaled .15pt withcolor .65red) ;
+ for i=.5cm step 1cm until PaperWidth :
+ draw (i,0)--(i,PaperHeight) ;
+ endfor ;
+ for i=PaperHeight-.5cm step -1cm until 0 :
+ draw (0,i)--(PaperWidth,i) ;
+ endfor ;
+ drawoptions(withpen pencircle scaled 5pt withcolor .65red) ;
+ draw ulcorner Page ;
+ StopPage ;
+\stopuseMPgraphic
+
+\defineoverlay[pagegrid][\useMPgraphic{pagegrid}]
+
+\endinput
diff --git a/tex/context/base/meta-txt.mkii b/tex/context/base/meta-txt.mkii
new file mode 100644
index 000000000..474253a40
--- /dev/null
+++ b/tex/context/base/meta-txt.mkii
@@ -0,0 +1,304 @@
+%D \module
+%D [ file=meta-txt,
+%D version=2000.07.06,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Text Tricks,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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 In this library some handy text manipulations are
+%D defined. Some can and will be improved as soon as the
+%D \TEX||\METAPOST\ interface is stable. Some of the
+%D solutions may look weird, which is entirely my fault,
+%D since I implemented them in the process of getting grip
+%D on this kind of manipulations. Undoubtly better
+%D \METAPOST\ code is possible, but my way of learning
+%D this kind of trickery happens to be by \quote {trial
+%D and error} and \quote {look and feel} (as well as
+%D identifying tricks in Hobby's code).
+
+% textext ipv btex ... etex
+
+% we need a proper prefix here
+
+\unprotect
+
+\startMPextensions
+ if unknown context_text: input mp-text; fi;
+\stopMPextensions
+
+%%%%%%%
+
+% \def\newchar#1{\chardef#1=0 }
+
+\ifdefined\MPtoks \else \newtoks\MPtoks \fi
+\ifdefined\MPbox \else \newbox \MPbox \fi
+
+\ifdefined\parwidth \else \newdimen\parwidth \fi
+\ifdefined\parheight \else \newdimen\parheight \fi
+\ifdefined\parvoffset \else \newdimen\parvoffset \fi
+\ifdefined\parhoffset \else \newdimen\parhoffset \fi
+\ifdefined\parlines \else \newcount\parlines \fi
+\ifdefined\partoks \else \newtoks \partoks \fi
+\ifdefined\shapetextbox \else \newbox \shapetextbox \fi
+ \newif \ifparseries
+\ifdefined\parfirst \else \chardef \parfirst=0 \fi
+
+\def\startshapetext[#1]%
+ {\global\newcounter\currentshapetext
+ \global\setbox\shapetextbox\vbox\bgroup
+ \expanded{\switchtobodyfont[\@@shbodyfont]}%
+ \dontcomplain
+ \hsize\parwidth
+ \setuptolerance[\v!verytolerant,\v!stretch]%
+ \!!counta\zerocount
+ \!!toksa\emptytoks
+ \def\docommand##1%
+ {\setbox\scratchbox\hbox{\useMPgraphic{##1}}%
+ \global\chardef\parfirst\zerocount
+ \getMPdata % \readlocfile{\MPdatafile}{}{}%
+ \setshapecharacteristics
+ \advance\!!counta by \parlines
+ \expandafter\appendtoks\the\partoks\to\!!toksa}%
+ \processcommalist[#1]\docommand
+ \global\parseriestrue
+ \xdef\totalparlines{\the\!!counta}%
+ \global\partoks\!!toksa
+ %\ifx\partoks\emptytoks\else % safeguard
+ \expanded{\parshape \the\!!counta \the\!!toksa}%
+ %\fi
+ \setshapecharacteristics % extra dummy
+ \ifparseries\def\par{\endgraf\adaptparshape}\fi
+ \EveryPar{\begstrut}}
+
+\def\stopshapetext
+ {\endstrut
+ %\removebottomthings
+ \egroup
+ \global\newcounter\currentshapetext
+ \getshapecharacteristics}
+
+\def\adaptparshape%
+ {\def\docommand##1%
+ {\ifcase\!!counta
+ \expandafter\appendtoks\space##1 \to\!!toksa
+ \else
+ \advance\!!counta \minusone
+ \fi}%
+ \!!counta\prevgraf
+ \doglobal\decrement(\totalparlines,\!!counta)%
+ \multiply\!!counta \plustwo
+ \!!toksa\emptytoks
+ \expanded{\processseparatedlist[\the\partoks][\space]}\docommand
+ \global\partoks\!!toksa
+ %\ifx\partoks\emptytoks\else % safeguard
+ \expanded{\parshape\totalparlines\the\partoks}%
+ }%\fi}
+
+\def\getshapecharacteristics%
+ {\doglobal\increment\currentshapetext
+ \doifdefinedelse{parlines:\currentshapetext}
+ {\global\parlines \getvalue{parlines:\currentshapetext}%
+ \global\chardef\parfirst \getvalue{parfirst:\currentshapetext}%
+ \global\parvoffset \getvalue{parvoffset:\currentshapetext}%
+ \global\parhoffset \getvalue{parhoffset:\currentshapetext}%
+ \global\parwidth \getvalue{parwidth:\currentshapetext}%
+ \global\parheight \getvalue{parheight:\currentshapetext}}
+ {\global\parlines \plusone
+ \global\chardef\parfirst \zerocount
+ \global\parvoffset \zeropoint
+ \global\parhoffset \zeropoint
+ \global\parwidth \hsize
+ \global\parheight \vsize}}
+
+\def\setshapecharacteristics%
+ {\doglobal\increment\currentshapetext
+ \setxvalue{parlines:\currentshapetext }{\the\parlines}%
+ \setxvalue{parfirst:\currentshapetext }{\the\parfirst}%
+ \setxvalue{parvoffset:\currentshapetext}{\the\parvoffset}%
+ \setxvalue{parhoffset:\currentshapetext}{\the\parhoffset}%
+ \setxvalue{parwidth:\currentshapetext }{\the\parwidth}%
+ \setxvalue{parheight:\currentshapetext }{\the\parheight}}
+
+\def\getshapetext% option: unvbox
+ {\vbox\bgroup
+ \forgetall
+ \setbox\scratchbox\vbox to \parheight
+ {\expanded{\switchtobodyfont[\@@shbodyfont]}% evt strutheight en
+ \splittopskip\strutheight % lineheight opslaan
+ \vskip\parvoffset % scheelt switch en
+ \ifcase\parfirst\or\vskip\lineheight\fi % is ook veiliger
+ \hskip\parhoffset
+ \hbox{\vsplit\shapetextbox to \parlines\lineheight}}%
+ \wd\scratchbox\parwidth
+ \ht\scratchbox\parheight
+ \dp\scratchbox\zeropoint
+ \box\scratchbox
+ \getshapecharacteristics
+ \egroup}
+
+\def\setupshapetexts%
+ {\dodoubleempty\getparameters[\??sh]}
+
+\setupshapetexts%
+ [\c!bodyfont=]
+
+%%%%%%% rotfont nog definieren
+
+\doifundefined{RotFont}{\definefont[RotFont][RegularBold]}
+
+\def\processfollowingtoken#1% strut toegevoegd
+ {\appendtoks#1\to\MPtoks
+ \setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}%
+ \startMPdrawing
+ n := n + 1 ; len[n] := \the\wd\MPbox ;
+ \stopMPdrawing
+ \startMPdrawing[-]
+ % pic[n] := textext{\RotFont\setstrut\strut#1} ; % btex \RotFont\setstrut\strut#1 etex ;
+ pic[n] := btex \RotFont\setstrut\strut#1 etex ;
+ pic[n] := pic[n] shifted - llcorner pic[n] ;
+ \stopMPdrawing}
+
+\startuseMPgraphic{followtokens}
+ % we default to nothing
+\stopuseMPgraphic
+
+\def\followtokens#1%
+ {\vbox\bgroup
+ \forgetall
+ \dontcomplain
+ \startMPenvironment
+ \doifundefined{RotFont}{\definefont[RotFont][RegularBold]}
+ \stopMPenvironment
+ \MPtoks\emptytoks
+ \resetMPdrawing
+ \startMPdrawing
+ \includeMPgraphic{followtokens} ;
+ picture pic[] ; numeric len[], n ; n := 0 ;
+ \stopMPdrawing
+ \handletokens#1\with\processfollowingtoken
+ \startMPdrawing
+ if unknown RotPath : path RotPath ; RotPath := origin ; fi ;
+ if unknown RotColor : color RotColor ; RotColor := black ; fi ;
+ if unknown TraceRot : boolean TraceRot ; TraceRot := false ; fi ;
+ if unknown ExtraRot : numeric ExtraRot ; ExtraRot := 0 ; fi ;
+ numeric al, at, pl, wid, pos ; pair ap, ad ;
+ al := arclength RotPath ;
+ if al=0 :
+ al := len[n] + ExtraRot ;
+ RotPath := origin -- (al,0) ;
+ fi ;
+ if al<len[n]:
+ RotPath := RotPath scaled ((len[n]+ExtraRot)/al) ;
+ al := arclength RotPath ;
+ fi ;
+ pl := (al-len[n])/(if n>1 : (n-1) else : 1 fi) ;
+ if TraceRot :
+ draw RotPath withpen pencircle scaled 1pt withcolor blue ;
+ fi ;
+ for i=1 upto n :
+ wid := abs(xpart urcorner pic[i] - xpart llcorner pic[i]) ;
+ pos := len[i]-wid/2 + (i-1)*pl ;
+ at := arctime pos of RotPath ;
+ ap := point at of RotPath ;
+ ad := direction at of RotPath ;
+ draw pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap
+ withcolor RotColor ;
+ if TraceRot :
+ draw boundingbox
+ pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap
+ withpen pencircle scaled .25pt withcolor red ;
+ draw ap
+ withpen pencircle scaled .50pt withcolor green ;
+ fi ;
+ endfor ;
+ \stopMPdrawing
+ \MPdrawingdonetrue
+ \getMPdrawing
+ \resetMPdrawing
+ \egroup}
+
+% \followtokens
+% {This is just a dummy text, kerned by T{\kern
+% -.1667em\lower .5ex\hbox {E}}{\kern -.125emX} and typeset
+% in a circle using {\setMFPfont M}{\setMFPfont
+% E}{\setMFPfont T}{\setMFPfont A}{\setMFPfont
+% P}{\setMFPfont O}{\setMFPfont S}{\setMFPfont T}.\quad}
+
+\startuseMPgraphic{fuzzycount}
+ begingroup
+ save height, span, drift, d, cp ;
+ height := 3/ 5 * \baselinedistance ;
+ span := 1/ 3 * height ;
+ drift := 1/10 * height ;
+ pickup pencircle scaled (1/12 * height) ;
+ def d = (uniformdeviate drift) enddef ;
+ for i := 1 upto \MPvar{n} :
+ draw
+ if (i mod 5)=0 : ((-d-4.5span,d)--(+d-0.5span,height-d))
+ else : ((-d,+d)--(+d,height-d)) fi
+ shifted (span*i,d-drift) ;
+ endfor;
+ picture cp ; cp := currentpicture ; % for readability
+ setbounds currentpicture to
+ (llcorner cp shifted (0,-ypart llcorner cp) --
+ lrcorner cp shifted (0,-ypart lrcorner cp) --
+ urcorner cp -- ulcorner cp -- cycle) ;
+ endgroup ;
+\stopuseMPgraphic
+
+\setupMPvariables
+ [fuzzycount]
+ [n=10]
+
+\def\fuzzycount#1%
+ {{\tx\useMPgraphic{fuzzycount}{n=#1}}}
+
+\defineconversion[fuzzy][\fuzzycount]
+
+%%%%%%%
+
+\setupMPvariables
+ [EnglishRule]
+ [height=1ex,
+ width=\the\localhsize, % without \the, problems in non e-tex
+ color=darkgray]
+
+\defineblank
+ [EnglishRule]
+ [medium]
+
+\startuniqueMPgraphic{EnglishRule}{height,width,color}
+ height = \MPvar{height} ;
+ x1 = 0 ; x3 = \MPvar{width} ; x2 = x4 = .5x3 ;
+ y1 = y3 = 0 ; y2 = -y4 = height/2 ;
+ fill z1..z2..z3 & z3..z4..z1 & cycle withcolor \MPvar{color} ;
+\stopuniqueMPgraphic
+
+\def\EnglishRule%
+ {\startlinecorrection[EnglishRule]
+ \setlocalhsize \noindent \reuseMPgraphic{EnglishRule}
+ \stoplinecorrection}
+
+%D The following macro returns a tight bound character
+%D sequence.
+%D
+%D \useMPlibrary[txt]
+%D
+%D \startlinecorrection
+%D \TightText{\ss\bf 123}{0cm}{3cm}{red}
+%D \stoplinecorrection
+
+\def\TightText#1#2#3#4%
+ {\hbox % \ruledhbox
+ {\startMPcode
+ picture p ; p := image (graphictext "#1" withfillcolor red) ;
+ draw p xsized #2 ysized #3 withcolor \MPcolor{#4} ;
+ \stopMPcode}}
+
+\protect \endinput
diff --git a/tex/context/base/metatex.tex b/tex/context/base/metatex.tex
index f9753cf83..cb965dc48 100644
--- a/tex/context/base/metatex.tex
+++ b/tex/context/base/metatex.tex
@@ -42,7 +42,7 @@
\def\loadcorefile#1{\normalinput#1.tex \relax}
\def\loadmarkfile#1{\normalinput#1.mkiv\relax}
-\loadcorefile{syst-ini}
+\loadmarkfile{syst-ini}
\ifnum\luatexversion<60 % also change message
\writestatus{!!!!}{Your luatex binary is too old, you need at least version 0.60!}
@@ -51,7 +51,7 @@
\newtoks\metatexversiontoks \metatexversiontoks\expandafter{\metatexversion} % at the lua end
-\loadcorefile{syst-pln} % plain tex initializations of internal registers (no further code)
+\loadmarkfile{syst-pln} % plain tex initializations of internal registers (no further code)
\loadmarkfile{syst-mes}
\loadmarkfile{luat-cod} %
@@ -61,10 +61,10 @@
% needs stripping:
\loadmarkfile{catc-ini} % catcode table management
-\loadcorefile{catc-act} % active character definition mechanisms
-\loadcorefile{catc-def} % some generic catcode tables
-\loadcorefile{catc-ctx} % a couple of context specific tables but expected by later modules
-\loadcorefile{catc-sym} % some definitions related to \letter<tokens>
+\loadmarkfile{catc-act} % active character definition mechanisms
+\loadmarkfile{catc-def} % some generic catcode tables
+\loadmarkfile{catc-ctx} % a couple of context specific tables but expected by later modules
+\loadmarkfile{catc-sym} % some definitions related to \letter<tokens>
% helpers, maybe less
diff --git a/tex/context/base/page-app.mkiv b/tex/context/base/page-app.mkiv
index 7dd71cf2a..9fade501b 100644
--- a/tex/context/base/page-app.mkiv
+++ b/tex/context/base/page-app.mkiv
@@ -13,8 +13,7 @@
\writestatus{loading}{ConTeXt Page Macros / Applications}
-%D The fitting page code is moved from \type {meta-fig} to
-%D here.
+%D This needs an update with a proper define and inheritance.
\unprotect
@@ -35,7 +34,6 @@
\c!rightmargin=\!!zeropoint,\c!rightedge=\!!zeropoint,
\c!header=\!!zeropoint,\c!footer=\!!zeropoint]
-
\def\dostartfittingpage[#1][#2]%
{\page % this is kind of tricky! there can be preceding page refs
\autostarttext
@@ -85,7 +83,7 @@
\c!height=\fittinght]%
\setuplayout
[\v!page]%
- \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!page=]%
+ \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!pagestate=\getvalue{\currentfittingpage\c!pagestate}]%
\centerbox{\box\scratchbox}%
\stopmakeup
\stoplocallayout
@@ -111,6 +109,7 @@
\setupTEXpage
[\c!scale=1000,
+ \c!pagestate=,
\c!strut=\v!no,
\c!align=\v!normal, % needed, else problems !
\c!offset=\v!overlay,
diff --git a/tex/context/base/page-lay.mkii b/tex/context/base/page-lay.mkii
index 8da9ba852..0bf375102 100644
--- a/tex/context/base/page-lay.mkii
+++ b/tex/context/base/page-lay.mkii
@@ -1150,11 +1150,11 @@
%D \showsetup{showsetups}
%D %showsetup{showmargins}
-\fetchruntimecommand \showprint {page-run.mkii}
-\fetchruntimecommand \showframe {page-run.mkii}
-\fetchruntimecommand \showlayout {page-run.mkii}
-\fetchruntimecommand \showsetups {page-run.mkii}
-\fetchruntimecommand \showmargins {page-run.mkii}
+\fetchruntimecommand \showprint {page-run}
+\fetchruntimecommand \showframe {page-run}
+\fetchruntimecommand \showlayout {page-run}
+\fetchruntimecommand \showsetups {page-run}
+\fetchruntimecommand \showmargins {page-run}
%D The default dimensions are quite old and will not change.
%D The funny fractions were introduced when we went from fixed
diff --git a/tex/context/base/page-lay.mkiv b/tex/context/base/page-lay.mkiv
index 4944712bb..261bf849d 100644
--- a/tex/context/base/page-lay.mkiv
+++ b/tex/context/base/page-lay.mkiv
@@ -1172,11 +1172,11 @@
%D \showsetup{showsetups}
%D %showsetup{showmargins}
-\fetchruntimecommand \showprint {page-run.mkiv}
-\fetchruntimecommand \showframe {page-run.mkiv}
-\fetchruntimecommand \showlayout {page-run.mkiv}
-\fetchruntimecommand \showsetups {page-run.mkiv}
-\fetchruntimecommand \showmargins {page-run.mkiv}
+\fetchruntimecommand \showprint {page-run}
+\fetchruntimecommand \showframe {page-run}
+\fetchruntimecommand \showlayout {page-run}
+\fetchruntimecommand \showsetups {page-run}
+\fetchruntimecommand \showmargins {page-run}
%D The default dimensions are quite old and will not change.
%D The funny fractions were introduced when we went from fixed
diff --git a/tex/context/base/s-inf-01.mkiv b/tex/context/base/s-inf-01.mkiv
index 80c40fa40..dc55735fe 100644
--- a/tex/context/base/s-inf-01.mkiv
+++ b/tex/context/base/s-inf-01.mkiv
@@ -26,54 +26,60 @@
local skip = {
"prag%-.*%.tex", "docs%-.*.tex", "list%-.*%.tex", "test%-.*%.tex", "demo%-.*%.tex",
"opti%-.*%.tex", "chrt%-.*%.tex", ".*%-old", ".*%-obs", ".*%-tst", "supp%-.*%.tex",
- "colo%-pan.tex",
+ "colo%-pan.tex", ".*test.*"
}
local types = {
"tex", "mkii", "mkiv", "mkvi", "lua"
}
+ local patterns = {
+ "^([a-z][a-z][a-z][a-z])%-[a-z0-9%-]+%.[a-z]+",
+ "^([xms])%-[a-z0-9%-]+%.[a-z]+",
+ }
local function collect(list,suffix,n)
- local path = file.dirname(resolvers.find_file("context.tex"),".")
+ local path = file.dirname(resolvers.find_file("context.mkiv"),".")
local pattern = path .. "/*." .. suffix
local texfiles = dir.glob(pattern)
for _, name in ipairs(texfiles) do
local base = file.basename(name)
- local category = match(base,"^([a-z][a-z][a-z][a-z])%-[a-z0-9]+%.[a-z]+")
- if category and lfs.isfile(name) then
- local okay = true
- for s=1,#skip do
- if find(base,skip[s]) then
- okay = false
- break
- end
- end
- if okay then
- local lm, sm, cm = list[category], size[category], comp[category]
- if not lm then
- lm, sm, cm = { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }
- list[category], size[category], comp[category] = lm, sm, cm
- end
- lm[n] = lm[n] + 1
- local done = true
- for o=1,#omit do
- if find(base,omit[o]) then
- done = false
+ for p=1,#patterns do
+ local category = match(base,patterns[p])
+ if category and lfs.isfile(name) then
+ local okay = true
+ for s=1,#skip do
+ if find(base,skip[s]) then
+ okay = false
break
end
end
- local data = io.loaddata(name)
- if suffix == "lua" then
- data = gsub(data,"%-%-%[%[.-%]%]%-%-","")
- data = gsub(data,"%-%-.-[\n\r]","")
- else
- data = gsub(data,"%%.-[\n\r]","")
- end
- data = gsub(data,"%s","")
- sm[n+5] = sm[n+5] + #data
- if done then
- sm[n] = sm[n] + #data
- else
- cm[n] = cm[n] + 1
+ if okay then
+ local lm, sm, cm = list[category], size[category], comp[category]
+ if not lm then
+ lm, sm, cm = { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }
+ list[category], size[category], comp[category] = lm, sm, cm
+ end
+ lm[n] = lm[n] + 1
+ local done = true
+ for o=1,#omit do
+ if find(base,omit[o]) then
+ done = false
+ break
+ end
+ end
+ local data = io.loaddata(name)
+ if suffix == "lua" then
+ data = gsub(data,"%-%-%[%[.-%]%]%-%-","")
+ data = gsub(data,"%-%-.-[\n\r]","")
+ else
+ data = gsub(data,"%%.-[\n\r]","")
+ end
+ data = gsub(data,"%s","")
+ sm[n+5] = sm[n+5] + #data
+ if done then
+ sm[n] = sm[n] + #data
+ else
+ cm[n] = cm[n] + 1
+ end
end
end
end
@@ -106,7 +112,7 @@
function document.context_state_1(what)
local max, what, norm = prepare(what)
- context.starttabulate { "|Tc|T|T|T|T|T|" }
+ context.starttabulate { "|Tl|T|T|T|T|T|" }
context.NC()
context(category)
context.NC()
diff --git a/tex/context/base/scrn-int.mkiv b/tex/context/base/scrn-int.mkiv
index eea71debc..f819789e9 100644
--- a/tex/context/base/scrn-int.mkiv
+++ b/tex/context/base/scrn-int.mkiv
@@ -411,15 +411,18 @@
\def\douseattachment[#1][#2][#3][#4]% tag title newname filename
{\iffourthargument
- \ctxlua{interactions.attachments.register{ label="#1", title="#2", newname="#3", filename="#4" }}%
+ \dodouseattachment{#1}{#2}{#3}{#4}%
\else\ifthirdargument
- \ctxlua{interactions.attachments.register{ label="#1", title="#2", newname="#2", filename="#3" }}%
+ \dodouseattachment{#1}{#2}{#2}{#3}%
\else\ifsecondargument
- \ctxlua{interactions.attachments.register{ label="#1", title="#2", newname="#2", filename="#2" }}%
+ \dodouseattachment{#1}{#2}{#2}{#2}%
\else
- \ctxlua{interactions.attachments.register{ label="#1", title="#1", newname="#1", filename="#1" }}%
+ \dodouseattachment{#1}{#1}{#1}{#1}%
\fi\fi\fi}
+\def\dodouseattachment#1#2#3#4% tag title newname filename
+ {\ctxlua{interactions.attachments.register{label="#1",title="#2",newname="#3",filename="#4"}}}
+
\def\attachment
{\dodoubleempty\doattachment}
diff --git a/tex/context/base/supp-fil.lua b/tex/context/base/supp-fil.lua
index 7f573c038..4370e1163 100644
--- a/tex/context/base/supp-fil.lua
+++ b/tex/context/base/supp-fil.lua
@@ -145,14 +145,18 @@ openers.fix = openers.file loaders.fix = loaders.file
openers.set = openers.file loaders.set = loaders.file
openers.any = openers.file loaders.any = loaders.file
-function commands.doreadfile(scheme,path,name) -- better do a split and then pass table
+function finders.doreadfile(scheme,path,name) -- better do a split and then pass table
local fullname
if url.hasscheme(name) then
fullname = name
else
fullname = ((path == "") and format("%s:///%s",scheme,name)) or format("%s:///%s/%s",scheme,path,name)
end
- context(resolvers.findtexfile(fullname)) -- can be more direct
+ return resolvers.findtexfile(fullname) or "" -- can be more direct
+end
+
+function commands.doreadfile(scheme,path,name)
+ context(finders.doreadfile(scheme,path,name))
end
-- modules can have a specific suffix or can specify one
@@ -294,6 +298,31 @@ function commands.usemodules(prefix,askedname,truename)
modstatus[hashname] = status
end
+local loaded = { }
+
+function commands.uselibrary(name,patterns,action,failure)
+ local files = utilities.parsers.settings_to_array(name)
+ local done = false
+ for i=1,#files do
+ local filename = files[i]
+ if not loaded[filename] then
+ loaded[filename] = true
+ for i=1,#patterns do
+ local filename = format(patterns[i],filename)
+ -- local foundname = resolvers.find_file(filename) or ""
+ local foundname = finders.doreadfile("any",".",filename)
+ if foundname ~= "" then
+ action(name,foundname)
+ done = true
+ end
+ end
+ end
+ end
+ if not done then
+ failure(name)
+ end
+end
+
statistics.register("loaded tex modules", function()
if next(modstatus) then
local t, f, nt, nf = { }, { }, 0, 0
diff --git a/tex/context/base/symb-ini.mkii b/tex/context/base/symb-ini.mkii
index d8adc94e6..1df1fe688 100644
--- a/tex/context/base/symb-ini.mkii
+++ b/tex/context/base/symb-ini.mkii
@@ -255,7 +255,7 @@
%D
%D \showsetup{showsymbolset}
-\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run.mkii}
+\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run}
%D \macros
%D {usesymbols}
diff --git a/tex/context/base/symb-ini.mkiv b/tex/context/base/symb-ini.mkiv
index de1e11396..bbefe9930 100644
--- a/tex/context/base/symb-ini.mkiv
+++ b/tex/context/base/symb-ini.mkiv
@@ -248,7 +248,7 @@
%D
%D \showsetup{showsymbolset}
-\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run.mkiv}
+\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run}
%D \macros
%D {usesymbols}
diff --git a/tex/context/base/syst-ini.tex b/tex/context/base/syst-ini.mkii
index c2c3e1947..c2c3e1947 100644
--- a/tex/context/base/syst-ini.tex
+++ b/tex/context/base/syst-ini.mkii
diff --git a/tex/context/base/syst-ini.mkiv b/tex/context/base/syst-ini.mkiv
new file mode 100644
index 000000000..5f9162aa2
--- /dev/null
+++ b/tex/context/base/syst-ini.mkiv
@@ -0,0 +1,925 @@
+%D \module
+%D [ file=syst-ini,
+%D version=2008.11.04, % 2001.11.16, % 1999.03.17, % an oldie: 1995.10.10
+%D title=\CONTEXT\ System Macros,
+%D subtitle=Bootstrapping \TEX,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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 We used to load plain \TEX\ in a special way, but redefining
+%D a couple of primitives so that for instance font loading was
+%D ignored. For those interested, this loader is found in
+%D \type {syst-tex.tex}. Some of the comment's are Don Knuth's
+%D and more of it can be found in the plain \TEX\ format.
+
+%D Characters can have special states, that can be triggered
+%D by setting their category coded. Some are preset, others
+%D are to be set as soon as possible, otherwise we cannot
+%D define any useful macros.
+
+%catcode`\^^@ = 9 % ascii null is ignored
+%catcode`\\ = 0 % backslash is TeX escape character
+
+\catcode`\{ = 1 % left brace is begin-group character
+\catcode`\} = 2 % right brace is end-group character
+\catcode`\$ = 3 % dollar sign is math shift
+\catcode`\& = 4 % ampersand is alignment tab
+\catcode`\# = 6 % hash mark is macro parameter character
+\catcode`\^ = 7 % circumflex and uparrow are for superscripts
+\catcode`\_ = 8 % underline and downarrow are for subscripts
+\catcode`\^^I = 10 % ascii tab is a blank space
+
+%catcode`\^^M = 5 % ascii return is end-line
+%catcode`\% = 14 % percent sign is comment character
+%catcode`\ = 10 % ascii space is blank space
+%catcode`\^^? = 15 % ascii delete is invalid
+
+\catcode`\~ = 13 % tilde is active
+\catcode`\^^L = 13 % ascii form-feed
+
+%catcode`\A = 11
+%.......
+%catcode`\Z = 11
+
+%catcode`\a = 11
+%.......
+%catcode`\z = 11
+
+\chardef\activecatcode = 13 % later this will become a counter
+
+\def ^^L{\par}
+\def\^^M{\ } % control <return> = control <space>
+\def\^^I{\ } % same for <tab>
+
+%D In \CONTEXT, we simply ignore end||of||file tokens:
+
+\catcode`\^^Z=9
+
+%D It makes sense to know what engine we're running so let's
+%D try to deduce it.
+
+\chardef\unknownengine = 0
+\chardef\pdftexengine = 1
+\chardef\xetexengine = 2
+\chardef\luatexengine = 3
+
+\ifx\directlua\undefined
+ \ifx\XeTeXversion\undefined
+ \ifx\pdftexversion\undefined
+ \let\texengine\unknownengine
+ \else
+ \let\texengine\pdftexengine
+ \fi
+ \else
+ \let\texengine\xetexengine
+ \fi
+\else
+ \let\texengine\luatexengine
+\fi
+
+\ifnum\texengine=\luatexengine
+ % for historic reasons we keep some mkii code around
+\else
+ \immediate\write16{>>>}
+ \immediate\write16{>>> only luatex is supported}
+ \immediate\write16{>>>}
+ \let\dump\relax
+ \expandafter\end
+\fi
+
+% todo: pdfsave pdfrestore pdfcolor... don't initialize them
+
+\ifnum\texengine=\luatexengine
+ \directlua 0 { % this info is stored in the format
+ lua.name[0] = "main ctx instance"
+ local extraprimitives = tex.extraprimitives
+ local enableprimitives = tex.enableprimitives
+ local core = extraprimitives('core')
+ local btex = extraprimitives('tex')
+ local etex = extraprimitives('etex')
+ local pdftex = extraprimitives('pdftex')
+ local luatex = extraprimitives('luatex')
+ local omega = {
+ "textdir", "pagedir", "mathdir", "pardir", "bodydir",
+ "leftghost", "rightghost", "localleftbox", "localrightbox",
+ "localinterlinepenalty", "localbrokenpenalty",
+ }
+ local aleph = {
+ "boxdir", "pagebottomoffset", "pagerightoffset",
+ }
+ for _, subset in next, { etex, pdftex, luatex, omega, aleph } do
+ enableprimitives('',subset)
+ end
+ for _, subset in next, { core, btex, etex, pdftex, luatex, omega, aleph } do
+ enableprimitives('normal',subset)
+ end
+ }
+\fi
+
+%D \ETEX\ has a not so handy way of telling you the version number,
+%D i.e. the revision number has a period in it:
+
+\long\def\gobbleoneargument#1{} % will be defined later on anyway
+
+\mathchardef\etexversion =
+ \numexpr\eTeXversion*100+\expandafter\gobbleoneargument\eTeXrevision\relax
+
+%D First we define a simplified version of the \CONTEXT\
+%D protection mechanism.
+
+\def\unprotect{\catcode`@=11 }
+\def\protect {\catcode`@=12 }
+
+\unprotect
+
+%D Some pretty important definitions:
+
+\let\bgroup={
+\let\egroup=}
+
+%D Allocation of registers is done slightly different than in plain
+%D \TEX. First of all we use different reserved counters. We also
+%D don't implement a family handler because users are not supposed
+%D to implement their own math. We reserve the lowest 31 registers
+%D for scratch purposes. Keep in mind that in the core engine
+%D some registers are reserved: counters 0 upto 9, and counter 255.
+%D
+%D As with plain \TEX\ we recommend that macro designers always use
+%D \type {\global} assignments with respect to registers numbered 1,
+%D 3, 5 \unknown\ 31, and always non||\type {\global} assignments
+%D with respect to registers 0, 2, 4, \unknown\ 30. This will prevent
+%D \quote {save stack buildup} that might otherwise occur.
+%D
+%D We reserve some registers for special (management) purposes:
+
+% 0 - 20 : scratch
+% 21 - 127 : internal
+% 128 - 254 : inserts
+% 255 : page
+% 256 - : user
+
+\countdef \minallocatedregister = 52 \minallocatedregister = 256
+\countdef \maxallocatedregister = 53 \maxallocatedregister = 32767
+\countdef \minallocatediochannel = 54 \minallocatediochannel = -1
+\countdef \maxallocatediochannel = 55 \maxallocatediochannel = 16
+\countdef \minallocatedlanguage = 56 \minallocatedlanguage = 0
+\countdef \maxallocatedlanguage = 57 \maxallocatedlanguage = 255
+\countdef \maxallocatedinsert = 58 \maxallocatedinsert = 254
+\countdef \minallocatedinsert = 59 \minallocatedinsert = 128
+\countdef \minallocatedfamily = 60 \minallocatedfamily = 128
+\countdef \maxallocatedfamily = 61 \maxallocatedfamily = 255
+
+\countdef \lastallocatedcount = 32 \lastallocatedcount = \minallocatedregister
+\countdef \lastallocateddimen = 33 \lastallocateddimen = \minallocatedregister
+\countdef \lastallocatedskip = 34 \lastallocatedskip = \minallocatedregister
+\countdef \lastallocatedmuskip = 35 \lastallocatedmuskip = \minallocatedregister
+\countdef \lastallocatedbox = 36 \lastallocatedbox = \minallocatedregister
+\countdef \lastallocatedtoks = 37 \lastallocatedtoks = \minallocatedregister
+\countdef \lastallocatedread = 38 \lastallocatedread = \minallocatediochannel
+\countdef \lastallocatedwrite = 39 \lastallocatedwrite = \minallocatediochannel
+\countdef \lastallocatedmarks = 40 \lastallocatedmarks = \minallocatedregister
+\countdef \lastallocatedlanguage = 41 \lastallocatedlanguage = \minallocatedlanguage % not used in context
+\countdef \lastallocatedinsertion = 42 \lastallocatedinsertion = \minallocatedinsert
+\countdef \lastallocatedfamily = 43 \lastallocatedfamily = \minallocatedfamily % not used in context
+\countdef \lastallocatedattribute = 44 \lastallocatedattribute = \minallocatedregister
+
+\countdef \mincountervalue = 125 \mincountervalue = -"7FFFFFFF % beware, we use index 125 at the lua end
+\countdef \maxcountervalue = 126 \maxcountervalue = "7FFFFFFF % beware, we use index 126 at the lua end
+
+%countdef \minusone = 127 \minusone = -1
+%chardef \zerocount = 0
+%chardef \plusone = 1
+
+\countdef \zerocount = 120 \zerocount = 0
+\countdef \plusone = 121 \plusone = 1
+\countdef \minusone = 122 \minusone = -1
+
+%chardef \normalpagebox = 255
+\countdef \normalpagebox = 127 \normalpagebox = 255 % hardcoded in pdftex/xetex
+
+% A few traditional allocations:
+
+\countdef \count@ = 255 % hm, used in \newif .. todo: replace it there
+\dimendef \dimen@ = 0
+\dimendef \dimen@i = 1 % global only
+\dimendef \dimen@ii = 2
+
+%D So, effectively we start allocating from 256 and upwards. The
+%D inserts sit in the range 128 upto 254. Page numbers use the
+%D counters 0 upto 9 and the pagebox is 255. Users can use the
+%D scratch registers upto 31 without problem but all others are
+%D reserved.
+
+\def\wlog#1{} % \def\wlog{\immediate\write\minusone} % write on log file (only)
+
+%D The allocators share a common helper macro.
+
+\def\newcount {\allocateregister\lastallocatedcount \count \countdef \maxallocatedregister}
+\def\newdimen {\allocateregister\lastallocateddimen \dimen \dimendef \maxallocatedregister}
+\def\newskip {\allocateregister\lastallocatedskip \skip \skipdef \maxallocatedregister}
+\def\newmuskip {\allocateregister\lastallocatedmuskip \muskip \muskipdef \maxallocatedregister}
+\def\newbox {\allocateregister\lastallocatedbox \box \mathchardef\maxallocatedregister}
+\def\newtoks {\allocateregister\lastallocatedtoks \toks \toksdef \maxallocatedregister}
+\def\newread {\allocateregister\lastallocatedread \read \chardef \maxallocatediochannel}
+\def\newwrite {\allocateregister\lastallocatedwrite \write \chardef \maxallocatediochannel}
+\def\newmarks {\allocateregister\lastallocatedmarks \marks \mathchardef\maxallocatedregister}
+\def\newinsert {\allocateregister\lastallocatedinsertion\insert \chardef \maxallocatedinsert}
+
+%D We don't need these in \CONTEXT:
+
+\def\newlanguage{\allocateregister\lastallocatedlanguage \language\chardef \maxallocatedlanguage}
+\def\newfamily {\allocateregister\lastallocatedfamily \fam \chardef \maxallocatedfamily}
+
+\let\newfam\newfamily
+
+% Watch out, for the moment we disable the check for already being defined
+% later we will revert this but first all chardefs must be replaced.
+
+\def\newconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1}
+\def\setnewconstant#1{\ifdefined#1\let#1\undefined\fi\newcount#1#1} % just a number
+
+% maybe setconstant with check
+
+% %D The next definitions are really needed (in \CONTEXT):
+
+%newlinechar=10 \def\outputnewlinechar{\rawcharacter{10}}
+\newlinechar=10 \edef\outputnewlinechar{^^J}
+
+%D One reason to start high with allocation is that it permits us to
+%D allocate consecutive ranges more easily, for instance in \MPLIB\
+%D we want to allocate a continuous range of boxes. It also permits us
+%D to do a proper upward allocation for inserts. The current code
+%D evolved from code that dealt with older engines but as all engines
+%D now provide many registers we removed all traces.
+
+\def\writestatus#1#2{\immediate\write16{#1: #2}} \def\space { }
+
+\def\allocateregisteryes#1#2#3#4#5% last class method max name
+ {\ifnum#1<#4\relax
+ \global\advance#1\plusone
+ \global#3#5=#1\relax
+ \else
+ \writestatus{warning}{no room for \string#2\space \string#5\space (max: \number#4)}%
+ \fi}
+
+\def\allocateregisternop#1#2#3#4#5% last class method max name
+ {\writestatus{warning}{\string#2 \string#5 is already defined (\string\relax\space it first)}}
+
+\def\allocateregister#1#2#3#4#5% last class method max name
+ {\ifx#5\undefined
+ \expandafter\allocateregisteryes
+ \else\ifx#5\relax
+ \expandafter\expandafter\expandafter\allocateregisteryes
+ \else
+ \expandafter\expandafter\expandafter\allocateregisternop
+ \fi\fi
+ #1#2#3#4#5}
+
+%D Since the number of chars exceed 256 now, we can use \type
+%D {\chardef} instead of the more limited \type {\mathchardef}.
+
+\ifnum\texengine>\pdftexengine
+ \def\newbox {\allocateregister\lastallocatedbox \box \chardef\maxallocatedregister}
+ \def\newmarks{\allocateregister\lastallocatedmarks\marks\chardef\maxallocatedregister}
+\fi
+
+%D Attributes are something very \LUATEX. In \CONTEXT\ you are not
+%D supposed to use the attributes directly but always allocate then
+%D first. For instance attribute~0 is reserved for special purposes
+%D (this might change).
+
+\ifnum\texengine=\luatexengine
+ \let\attributeunsetvalue\mincountervalue % used to be \minusone
+ \def\newattribute{\allocateregister\lastallocatedattribute\attribute\attributedef\maxallocatedregister}
+\fi
+
+%D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a
+%D trick to force strings instead of tokens that take more memory.
+%D It's a trick to trick to force strings.
+
+\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}}
+
+%D \macros
+%D {scratchcounter,
+%D scratchdimen,scratchskip,scratchmuskip,
+%D scratchbox,
+%D scratchtoks}
+%D
+%D We now define a few scratch registers, so that successive
+%D loads at least have some available.
+
+\newcount \scratchcounter \newcount \globalscratchcounter
+\newdimen \scratchdimen \newdimen \globalscratchdimen
+\newskip \scratchskip \newskip \globalscratchskip
+\newmuskip \scratchmuskip \newmuskip \globalscratchmuskip
+\newtoks \scratchtoks \newtoks \globalscratchtoks
+\newbox \scratchbox \newbox \globalscratchbox
+
+\newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree
+\newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree
+\newdimen \scratchskipone \newdimen \scratchskiptwo \newdimen \scratchskipthree
+\newbox \scratchmuskipone \newbox \scratchmuskiptwo \newbox \scratchmuskipthree
+\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree
+\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree
+
+%D More allocations:
+
+\newskip \zeroskip \zeroskip = 0pt plus 0pt minus 0pt
+\newdimen\zeropoint \zeropoint = 0pt
+\newdimen\onepoint \onepoint = 1pt
+\newdimen\maxdimen \maxdimen = 16383.99999pt
+\newdimen\onebasepoint \onebasepoint = 1bp
+\newdimen\scaledpoint \scaledpoint = 1sp
+\newdimen\thousandpoint\thousandpoint= 1000pt
+
+\let\points\onepoint
+
+\newtoks \emptytoks
+
+%D And even more: (todo: countdefs 60+)
+
+%newcount \minusone \minusone = -1
+\newcount \minustwo \minustwo = -2
+%chardef \zerocount = 0
+%chardef \plusone = 1
+\chardef \plustwo = 2
+\chardef \plusthree = 3
+\chardef \plusfour = 4
+\chardef \plusfive = 5
+\chardef \plussix = 6
+\chardef \plusseven = 7
+\chardef \pluseight = 8
+\chardef \plusnine = 9
+\chardef \plusten = 10
+\chardef \plussixteen = 16
+\chardef \plushundred = 100
+\chardef \pluscxxvii = 127
+\chardef \pluscxxviii = 128
+\chardef \pluscclv = 255
+
+\ifnum\texengine=\luatexengine
+ \chardef \pluscclvi = 256
+ \chardef \plusthousand = 1000
+ \chardef \plustenthousand = 10000
+ \chardef \plustwentythousand = 20000
+ \chardef \medcard = 32768
+ \chardef \maxcard = 65536 % pdftex has less mathchars
+\else
+ \mathchardef\pluscclvi = 256
+ \mathchardef\plusthousand = 1000
+ \mathchardef\plustenthousand = 10000
+ \mathchardef\plustwentythousand = 20000
+ \newcount \medcard \medcard = 32768 % pdftex has less mathchars
+ \newcount \maxcard \maxcard = 65536 % pdftex has less mathchars
+\fi
+
+%D We prefer the more readable variant than in plain
+%D \TEX. User should only use \type {\emptybox}:
+
+\newbox\voidbox % public
+
+\let\normalhbox\hbox
+\let\normalvbox\vbox
+
+\def\unvoidbox{\unhbox\voidbox}
+\def\emptybox {\box \voidbox} % used in initializations so no attributes
+\def\emptyvbox{\normalvbox{}} % no copy as we need to set attributes
+\def\emptyhbox{\normalhbox{}} % no copy as we need to set attributes
+
+\let\leavevmode\unvoidbox % we prefer to use \dontleavehmode
+
+%D Some expected plain variants follow. We don't reuse registers
+%D because we don't want clashes.
+
+\newdimen\p@ \p@ \onepoint
+\newcount\m@ne \m@ne \minusone
+\newdimen\z@ \z@ \zeropoint
+\let \@ne \plusone
+\let \tw@ \plustwo
+\let \thr@@ \plusthree
+\let \sixt@@n \sixteen
+\let \@cclv \pluscclv
+\let \@cclvi \pluscclvi
+\newbox \voidb@x
+\newtoks \toks@
+
+%D We define \type {\newif} a la plain \TEX, but will
+%D redefine it later. As Knuth says:
+%D
+%D \startnarrower
+%D And here's a different sort of allocation: for example,
+%D
+%D \starttyping
+%D \newif\iffoo
+%D \stoptyping
+%D
+%D creates \type {\footrue}, \type {\foofalse} to go
+%D with \type {\iffoo}.
+%D \stopnarrower
+
+\def\newif#1%
+ {\count@\escapechar
+ \escapechar\minusone
+ \expandafter\expandafter\expandafter\def\@if #1{true}{\let#1\iftrue }%
+ \expandafter\expandafter\expandafter\def\@if#1{false}{\let#1\iffalse}%
+ \@if#1{false}% the condition starts out false
+ \escapechar\count@}
+
+\def\@if#1#2%
+ {\csname\expandafter\if@\string#1#2\endcsname}
+
+\bgroup % `if' is required
+
+ \uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}}
+
+\egroup
+
+%D Let's test this one:
+
+\newif\ifdone
+
+%D Potential primitive in \LUATEX:
+
+\ifdefined\htdp \else \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi
+
+%D \macros
+%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment,
+%D @@endofline,@@parameter,@@superscript,@@subscript,
+%D @@ignore,@@space,@@letter,@@other,@@active,@@comment}
+%D
+%D In \CONTEXT\ we sometimes manipulate the \CATCODES\ of certain
+%D characters. Because we are not that good at remembering numbers,
+%D we introduce some symbolic names.
+
+%D As we now have catc-* files, we also have more readable names but
+%D We will keep the following around for a while.
+
+\chardef\@@escape = 0
+\chardef\@@begingroup = 1
+\chardef\@@endgroup = 2
+\chardef\@@mathshift = 3
+\chardef\@@alignment = 4
+\chardef\@@endofline = 5
+\chardef\@@parameter = 6
+\chardef\@@superscript = 7
+\chardef\@@subscript = 8
+\chardef\@@ignore = 9
+\chardef\@@space = 10
+\chardef\@@letter = 11
+\chardef\@@other = 12
+\chardef\@@active = 13
+\chardef\@@comment = 14
+
+%D Constants to be used with \type {\currentgrouptype}.
+
+\chardef\@@bottomlevelgroup = 0
+\chardef\@@simplegroup = 1
+\chardef\@@hboxgroup = 2
+\chardef\@@adjustedhboxgroup = 3
+\chardef\@@vboxgroup = 4
+\chardef\@@vtopgroup = 5
+\chardef\@@aligngroup = 6
+\chardef\@@noaligngroup = 7
+\chardef\@@outputgroup = 8
+\chardef\@@mathgroup = 9
+\chardef\@@discretionarygroup = 10
+\chardef\@@insertgroup = 11
+\chardef\@@vcentergroup = 12
+\chardef\@@mathchoicegroup = 13
+\chardef\@@semisimplegroup = 14
+\chardef\@@mathshiftgroup = 15
+\chardef\@@mathleftgroup = 16
+
+\chardef\@@vadjustgroup = \@@insertgroup
+
+%D Constants to be used with \type {\interactionmode}.
+
+\chardef\@@batchmode = 0
+\chardef\@@nonstopmode = 1
+\chardef\@@scrollmode = 2
+\chardef\@@errorstopmode = 3
+
+%D Constants to be used with \type {\lastnodetype}. The \type
+%D {\lastnodetype} primitive is \ETEX\ compliant. The valid range is
+%D still -1 .. 15 and glyph nodes have number 0 (used to be char
+%D node) and ligature nodes are mapped to 7. That way macro packages
+%D can use the same symbolic names as in traditional \ETEX. Keep in
+%D mind that the internal node numbers are different and that there
+%D are more node types that 15.
+
+\chardef\@@charnode = 0
+\chardef\@@hlistnode = 1
+\chardef\@@vlistnode = 2
+\chardef\@@rulenode = 3
+\chardef\@@insertnode = 4
+\chardef\@@marknode = 5
+\chardef\@@adjustnode = 6
+\chardef\@@ligaturenode = 7
+\chardef\@@discretionarynode = 8
+\chardef\@@whatsitnode = 9
+\chardef\@@mathnode = 10
+\chardef\@@gluenode = 11
+\chardef\@@kernnode = 12
+\chardef\@@penaltynode = 13
+\chardef\@@unsetnode = 14
+\chardef\@@mathsnode = 15
+
+%D Constants to be used with \type {\currentiftype}.
+
+\chardef\@@charif = 1
+\chardef\@@catif = 2
+\chardef\@@numif = 3
+\chardef\@@dimif = 4
+\chardef\@@oddif = 5
+\chardef\@@vmodeif = 6
+\chardef\@@hmodeif = 7
+\chardef\@@mmodeif = 8
+\chardef\@@innerif = 9
+\chardef\@@voidif = 10
+\chardef\@@hboxif = 11
+\chardef\@@vboxif = 12
+\chardef\@@xif = 13
+\chardef\@@eofif = 14
+\chardef\@@trueif = 15
+\chardef\@@falseif = 16
+\chardef\@@caseif = 17
+\chardef\@@definedif = 18
+\chardef\@@csnameif = 19
+\chardef\@@fontcharif = 20
+
+%D Of course we want even bigger log files, so we copied this
+%D from the \ETEX\ source files.
+%D
+%D When watching such logs, beware of nasty side effects of
+%D \type {\scantokens}, as in:
+%D
+%D \starttyping
+%D \bgroup
+%D \lccode`a=12\lowercase{\xdef\whatever{a}}\egroup
+%D \def\whatever{test \whatever test}
+%D \scantokens\expandafter{\whatever}
+%D \egroup
+%D \stoptyping
+%D
+%D In \LUATEX\ we have ways around this.
+
+\def\tracingall
+ {\tracingonline \plusone
+ \tracingcommands \plusthree
+ \tracingstats \plustwo
+ \tracingpages \plusone
+ \tracingoutput \plusone
+ \tracinglostchars \plustwo
+ \tracingmacros \plustwo
+ \tracingparagraphs\plusone
+ \tracingrestores \plusone
+ \showboxbreadth \maxdimen
+ \showboxdepth \maxdimen
+ \tracinggroups \plusone
+ \tracingifs \plusone
+ \tracingscantokens\plusone
+ \tracingnesting \plusone
+ \tracingassigns \plustwo
+ \errorstopmode}
+
+\def\loggingall
+ {\tracingall
+ \tracingonline \zerocount}
+
+\def\tracingnone
+ {\tracingassigns \zerocount
+ \tracingnesting \zerocount
+ \tracingscantokens\zerocount
+ \tracingifs \zerocount
+ \tracinggroups \zerocount
+ \showboxdepth \plusthree
+ \showboxbreadth \plusfive
+ \tracingrestores \zerocount
+ \tracingparagraphs\zerocount
+ \tracingmacros \zerocount
+ \tracinglostchars \plusone
+ \tracingoutput \zerocount
+ \tracingpages \zerocount
+ \tracingstats \zerocount
+ \tracingcommands \zerocount
+ \tracingonline \zerocount}
+
+%D Just for tracing purposes we set:
+
+\tracingstats\plusone
+
+%D Here we also save \type {\input}, more will be saved later.
+
+\ifdefined\normalinput \else \let\normalinput\input \fi
+
+%D We don't like outer commands, and we always want access
+%D to the original \type {\input} primitive.
+
+\let\normalouter\outer \def\outer{} % no longer \relax
+
+%D To circumvent dependencies, we can postpone certain
+%D initializations to dumping time, by appending them to the
+%D \type {\everydump} token register.
+
+\ifdefined\normaldump \else \let\normaldump\dump \fi
+
+\newtoks\everydump
+
+\def\dump{\the\everydump\normaldump}
+
+%D The same applies for the startup actions.
+
+\ifdefined\normaleveryjob \else \let\normaleveryjob\everyjob \fi
+
+\let\everyjob\relax \newtoks\everyjob
+
+\normaleveryjob{\the\everyjob}
+
+\def\appendtotoks #1{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=}
+\def\prependtotoks#1{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=}
+
+\def\doappendtotoks {\expandafter\expandafter\expandafter{\expandafter\the\expandafter\temp\the\scratchtoks}}
+\def\doprependtotoks{\expandafter\expandafter\expandafter{\expandafter\the\expandafter\scratchtoks\the\temp}}
+
+%D \macros
+%D {begcsname}
+%D
+%D Handy for \ETEX-only usage (avoids making \type {\relax}'s:
+
+\def\begcsname#1\endcsname{\ifcsname#1\endcsname\csname#1\endcsname\fi}
+
+%D Now come a few macros that might be needed in successive loading:
+
+\let\endgraf\par
+\let\endline\cr
+
+\def\space{ }
+\def\empty{}
+\def\null {\hbox{}}
+
+%D The following two might be overloaded later on but some modules need
+%D then earlier. These functionality is reflected in the name and will not
+%D change.
+
+\bgroup
+ \catcode`\^^M=\activecatcode%
+ \gdef\obeylines{\catcode`\^^M\activecatcode \let^^M\par}%
+ \global\let^^M\par%
+\egroup
+
+\bgroup
+ \gdef\obeyspaces{\catcode`\ \activecatcode}%
+ \obeyspaces\global\let =\space%
+\egroup
+
+%D A constant:
+
+\let\endoflinetoken=^^M
+
+%D Also needed might be a simple loop structure and we borrow
+%D plain \TEX's one as it is often expected to be present and
+%D it is about the fastest you can get. Beware: this macro
+%D does not support nested loops. We use a namespace prefix
+%D \type {@@pln}.
+
+\long\def\loop#1\repeat{\long\def\@@plnbody{#1}\@@plniterate}
+
+%D The following makes \type {\loop} \unknown\ \type {\if}
+%D \unknown\ \type {\repeat} skippable (clever trick):
+
+\let\repeat\fi % so both \loop and \repeat are reserved words!
+
+%D The original (no \type {@@pln} there):
+%D
+%D \starttyping
+%D \def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next}
+%D \stoptyping
+%D
+%D A more efficient alternative:
+%D
+%D \starttyping
+%D \def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\expandafter\relax\fi}
+%D \stoptyping
+%D
+%D An even more efficient one:
+
+\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\fi}
+
+%D We don't define a real output routine yet but at least get rid
+%D of pages:
+
+\output{\shipout\box\normalpagebox}
+
+%D Although we don't add pagenumbers yet we alias the default
+%D register used for counting pages:
+
+\countdef\pageno=0 \pageno=1 % first page is number 1
+
+%D Beside the raw counter \type {\pageno} the \type {\folio}
+%D macro provides the value.
+
+\def\folio{\the\pageno} % kind of expected and therefore reserved
+
+%D The following registers are kind of standard and (for the moment)
+%D we define them here. This might change.
+
+\newskip \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt
+\newskip \medskipamount \medskipamount = 6pt plus 2pt minus 2pt
+\newskip \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt
+
+\baselineskip = 12pt
+\lineskip = 1pt
+\lineskiplimit = 0pt
+
+%D Again a few kind-of-extensions the core:
+
+\newskip \hideskip \hideskip = -1000pt plus 1fill
+\newskip \centering \centering = 0pt plus 1000pt minus 1000pt
+
+\def\hidewidth % for alignment entries that can stick out
+ {\hskip\hideskip}
+
+\def\ialign % initialized \halign
+ {\everycr{}%
+ \tabskip\zeroskip
+ \halign}
+
+\newcount \mscount
+
+\def\spanomit{\span\omit} % bypass error message
+
+\def\multispan#1%
+ {\omit
+ \mscount#1\relax
+ \loop
+ \ifnum\mscount>\plusone
+ \spanomit \advance\mscount\minusone
+ \repeat}
+
+%D The next section deals with selective definitions in
+%D later modules. One can of course use the \type {\texengine}
+%D number that we defined earlier instead.
+
+\bgroup \obeylines
+ \gdef\pickupSOMETEX#1%
+ {\expandafter\gdef\csname begin#1\endcsname{\bgroup\obeylines\dopickupSOMETEX{#1}}}
+ \gdef\dopickupSOMETEX#1#2
+ % {\egroup\immediate\write16{special code for #1 -> [line \the\inputlineno] \detokenize{#2}}}
+ {\egroup}
+\egroup
+
+\let\endTEX \relax \long\def\beginTEX #1\endTEX {}
+\let\endETEX \relax \long\def\beginETEX #1\endETEX {}
+\let\endXETEX \relax \long\def\beginXETEX #1\endXETEX {}
+\let\endLUATEX\relax \long\def\beginLUATEX#1\endLUATEX{}
+\let\endOLDTEX\relax \long\def\beginOLDTEX#1\endOLDTEX{}
+\let\endNEWTEX\relax \long\def\beginNEWTEX#1\endNEWTEX{}
+
+\pickupSOMETEX{ETEX}
+
+\ifnum\texengine=\xetexengine
+ \pickupSOMETEX{XETEX}
+\fi
+\ifnum\texengine=\luatexengine
+ \pickupSOMETEX{LUATEX}
+\fi
+\ifnum\texengine<\xetexengine
+ \pickupSOMETEX{OLDTEX}
+\else
+ \pickupSOMETEX{NEWTEX}
+\fi
+
+%D \macros
+%D {bindprimitive}
+%D
+%D We can remap primitives (which is needed because of changes in
+%D for instance \PDFTEX).
+
+\def\bindprimitive#1 #2 % new old
+ {\ifcsname#1\endcsname \else \ifcsname#2\endcsname
+ \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname
+ \fi \fi}
+
+%D Because \XETEX\ also implements some \PDFTEX\ functionality, we take
+%D care of this here instead of a dedicated module. Later modules need
+%D to handle the undefined cases.
+
+%D These messy checks will disappear.
+
+% new after 1.10, watch the change in prefix
+
+\bindprimitive quitvmode ptexquitvmode
+\bindprimitive noligatures ptexnoligatures
+\bindprimitive setrandomseed ptexsetrandomseed
+\bindprimitive uniformdeviate ptexuniformdeviate
+
+\bindprimitive quitvmode pdfquitvmode
+\bindprimitive noligatures pdfnoligatures
+\bindprimitive setrandomseed pdfsetrandomseed
+\bindprimitive uniformdeviate pdfuniformdeviate
+
+\bindprimitive resettimer pdfresettimer
+\bindprimitive elapsedtime pdfelapsedtime
+
+% new per 1.40
+
+\bindprimitive ifprimitive ifpdfprimitive
+\bindprimitive primitive pdfprimitive
+\bindprimitive ifabsdim ifpdfabsdim
+\bindprimitive ifabsnum ifpdfabsnum
+
+\ifnum\texengine=\xetexengine \else % this test might disappear some day
+
+ \pdfminorversion \plusfive
+
+ \ifdefined\pdfcompresslevel \else \newcount\pdfcompresslevel \fi
+ \ifdefined\pdfobjcompresslevel \else \newcount\pdfobjcompresslevel \fi
+ \ifdefined\pdfgentounicode \else \newcount\pdfgentounicode \fi \pdfgentounicode \plusone
+ \ifdefined\pdfinclusioncopyfonts\else \newcount\pdfinclusioncopyfonts \fi \pdfinclusioncopyfonts\plusone
+
+ \def\nopdfcompression {\pdfobjcompresslevel\zerocount \pdfcompresslevel\zerocount}
+ \def\maximumpdfcompression{\pdfobjcompresslevel\plusnine \pdfcompresslevel\plusnine }
+ \def\normalpdfcompression {\pdfobjcompresslevel\plusthree \pdfcompresslevel\plusthree}
+
+ \normalpdfcompression
+
+ \let\normalsetrandomseed \setrandomseed
+ \let\normaluniformdeviate\uniformdeviate
+
+\fi
+
+%D Handy.
+
+\ifnum\texengine=\luatexengine
+ \ifdefined\suppresslongerror % for the moment test
+ \suppresslongerror\plusone
+ \fi
+\fi
+
+%D Basic status stuff.
+
+\newif\ifproductionrun
+
+%D We need to make sure that we start up in \DVI\ mode, so,
+%D after testing for running \PDFTEX, we default to \DVI.
+
+\ifx\pdftexversion\undefined \newcount\pdfoutput \fi \pdfoutput=0
+
+%D For those who expect this \unknown
+
+\ifx\fmtname \undefined \def\fmtname {ConTeXt Minimized Plain TeX} \fi
+\ifx\fmtversion\undefined \def\fmtversion{3.1415926} \fi
+
+\let\normalfmtversion\fmtversion
+
+%D A few bonus macros:
+
+\def\modulonumber#1#2{\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax}
+\def\dividonumber#1#2{\the\numexpr(#2-(#1/2))/#1\relax}
+
+\ifnum\texengine=\xetexengine
+ \edef\xetexversion {\numexpr\XeTeXversion*100+(\expandafter\gobbleoneargument\XeTeXrevision-5)/10\relax}
+ \edef\xetexrevision {\the\numexpr(\expandafter\gobbleoneargument\XeTeXrevision-50)/100\relax}
+\fi
+
+\ifcase\texengine
+ \def\texenginename {impossible}
+ \edef\texengineversion{0}
+\or
+ \def\texenginename {pdfTeX}
+ \edef\texengineversion{\dividonumber{100}\pdftexversion.\modulonumber{100}\pdftexversion.\pdftexrevision}
+\or
+ \def\texenginename {XeTeX}
+ \edef\texengineversion{\dividonumber{100}\xetexversion .\modulonumber{100}\xetexversion .\xetexrevision}
+\or
+ \def\texenginename {LuaTeX}
+ \edef\texengineversion{\dividonumber{100}\luatexversion.\modulonumber{100}\luatexversion.\luatexrevision}
+\else
+ \def\texenginename {impossible}
+ \edef\texengineversion{0}
+\fi
+
+%D While cleaning this code up a bit I was listening to Heather
+%D Nova's \CD\ Redbird. The first song on that \CD\ ends with
+%D a few lines suitable for ending this initialization module:
+%D
+%D \startlines
+%D And there's so much I can do for you
+%D Given time I know that I can prove
+%D Now my world is opened up to you
+%D Come inside
+%D
+%D Welcome to my life
+%D Welcome to my world
+%D Come inside
+%D \stoplines
+%D
+%D So let's see what \TEX\ can do now that we've opened up
+%D the basic machinery.
+
+\protect \endinput
diff --git a/tex/context/base/type-ini.lua b/tex/context/base/type-ini.lua
new file mode 100644
index 000000000..668766f4e
--- /dev/null
+++ b/tex/context/base/type-ini.lua
@@ -0,0 +1,33 @@
+if not modules then modules = { } end modules ['type-ini'] = {
+ version = 1.001,
+ comment = "companion to type-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- more code will move here
+
+local format, gsub = string.format, string.gsub
+local find_file = resolvers.find_file
+
+local patterns = { "type-imp-%s.mkiv", "type-imp-%s.tex", "type-%s.mkiv", "type-%s.tex" }
+
+function commands.doprocesstypescriptfile(name)
+ name = gsub(name,"^type%-","")
+ for i=1,#patterns do
+ local filename = format(patterns[i],name)
+ -- local foundname = find_file(filename) or ""
+ local foundname = resolvers.finders.doreadfile("any",".",filename)
+ if foundname ~= "" then
+ context.startreadingfile()
+ context.pushendofline()
+ context.unprotect()
+ context.input(foundname)
+ context.protect()
+ context.popendofline()
+ context.stopreadingfile()
+ return
+ end
+ end
+end
diff --git a/tex/context/base/type-ini.mkii b/tex/context/base/type-ini.mkii
index a9800d2e9..d15bb565b 100644
--- a/tex/context/base/type-ini.mkii
+++ b/tex/context/base/type-ini.mkii
@@ -719,7 +719,7 @@
\the\scratchtoks
\fi}
-\fetchruntimecommand \typetypescript {\f!typeprefix\s!run.mkii}
+\fetchruntimecommand \typetypescript {\f!typeprefix\s!run}
% \usetypescript [berry] [ec]
diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv
index bd3f5e6c9..64db2c698 100644
--- a/tex/context/base/type-ini.mkiv
+++ b/tex/context/base/type-ini.mkiv
@@ -13,6 +13,8 @@
\writestatus{loading}{ConTeXt Typescript Macros / Initialization}
+\registerctxluafile{type-ini}{1.001}
+
%D The default fontclass is empty. We could demand always using fontclasses,
%D and then make the calling macros simplier (always assume fontclass) but
%D apart from downward compatibility issues, it would make global, class
@@ -168,13 +170,7 @@
\expandafter\let\csname\??ts:\c!file:\currenttypefile\endcsname\loadedtypescripts}
\def\doprocesstypescriptfile
- {\startreadingfile
- \pushendofline
- \unprotect
- \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}%
- \protect
- \popendofline
- \stopreadingfile}
+ {\ctxlua{commands.doprocesstypescriptfile("\currenttypefile")}}
\def\usetypescriptonce
{\dotripleempty\dousetypescriptonce}
@@ -476,9 +472,10 @@
\fi \fi \fi
\ifmmode\mr\else\tf\fi} % needed ?
-\def\usetypefile[#1]% recurses on path !
- {\edef\currenttypefile{\f!typeprefix#1}%
- \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}}
+\def\usetypefile[#1]% recurses on path ! % no storage? obsolete?
+ %{\edef\currenttypefile{\f!typeprefix#1}%
+ {\edef\currenttypefile{#1}%
+ \ctxlua{commands.doprocesstypescriptfile("\currenttypefile")}}
%D For Taco:
%D
@@ -515,7 +512,7 @@
\let\checkfontclass\gobbleoneargument
-\fetchruntimecommand \typetypescript {\f!typeprefix\s!run.mkiv} % will become module
+\fetchruntimecommand \typetypescript {\f!typeprefix\s!run} % will become module
\protect \endinput
diff --git a/tex/context/base/type-set.mkiv b/tex/context/base/type-set.mkiv
index b09e4ac69..89dd68a8f 100644
--- a/tex/context/base/type-set.mkiv
+++ b/tex/context/base/type-set.mkiv
@@ -67,11 +67,11 @@
%definefontsynonym [SansCaps] [SansBold]
\stopsetups
-%usetypescriptfile[\f!typeprefix def] % preloaded in main context.mkiv file
-%usetypescriptfile[\f!typeprefix lua] % preloaded in main context.mkiv file
-%usetypescriptfile[\f!typeprefix tmf] % replaced by otf (mkiv) en one (mkii)
-\usetypescriptfile[\f!typeprefix siz]
-\usetypescriptfile[\f!typeprefix otf]
-\usetypescriptfile[\f!typeprefix loc]
+%usetypescriptfile[def] % preloaded in main context.mkiv file
+%usetypescriptfile[lua] % preloaded in main context.mkiv file
+%usetypescriptfile[tmf] % replaced by otf (mkiv) en one (mkii)
+\usetypescriptfile[siz]
+\usetypescriptfile[otf]
+\usetypescriptfile[loc]
\protect \endinput
diff --git a/tex/context/base/unic-ini.mkii b/tex/context/base/unic-ini.mkii
index 5f28ba555..7e358341d 100644
--- a/tex/context/base/unic-ini.mkii
+++ b/tex/context/base/unic-ini.mkii
@@ -761,8 +761,8 @@
%D Goodies:
-\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run.mkii}
-\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run.mkii}
+\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run}
+\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run}
%D Well, let's at least preload a few familiar ones. Here we
%D also load the \UTF\ regime.
diff --git a/tex/context/base/x-fo.mkii b/tex/context/base/x-fo.mkii
index b2b0b59f9..83cfe2433 100644
--- a/tex/context/base/x-fo.mkii
+++ b/tex/context/base/x-fo.mkii
@@ -28,8 +28,6 @@
\useXMLfilter[prs,run]
-% \input xtag-run
-
\unprotect
% syst-new.tex
diff --git a/tex/context/base/x-res-01.mkiv b/tex/context/base/x-res-01.mkiv
index dc14e7054..b82d60484 100644
--- a/tex/context/base/x-res-01.mkiv
+++ b/tex/context/base/x-res-01.mkiv
@@ -18,10 +18,10 @@
%D style to a database by saying:
%D
%D \starttyping
-%D texexec --pdf --use=fig-make yourfile.xml
+%D context --input=d-res-01.xml auto:x-res-01.mkiv
%D \stoptyping
%D
-%D The following modes are supported:
+%D The following modes are supported (not all yet in mkiv):
%D
%D \starttabulate[|lT|l|]
%D \NC letter \NC map the preview on letter size \NC \NR
@@ -36,122 +36,20 @@
%D The resulting file has the following characteristics:
%D
%D \startitemize[packed]
-%D \item the document is split into three sections: first each
-%D figure is shown at its own page, then an overview of
-%D figures is shown with some data alongside, and
-%D finally an index and table of contents shows up
-%D \item there is no title page, which means that one can
-%D access a figure by page number without offset
-%D \item the document is opened at the first overview page,
-%D that is, when the viewer supports it
-%D \item the graphic is shown 3~times: on a page of its own,
-%D scaled to a fixed dimension, and relative to a4 or
-%D letter paper size
-%D \item the labels can be accessed in an index and list at
-%D the end of the document
+%D \startitem the document is split into three sections: first each
+%D figure is shown at its own page, then an overview of figures is
+%D shown with some data alongside, and finally an index and table of
+%D contents shows up \stopitem
+%D \startitem there is no title page, which means that one can access
+%D a figure by page number without offset \stopitem
+%D \startitem the document is opened at the first overview page, that
+%D is, when the viewer supports it \stopitem
+%D \startitem the graphic is shown 3~times: on a page of its own,
+%D scaled to a fixed dimension, and relative to a4 or letter paper
+%D size \stopitem
+%D \startitem the labels can be accessed in an index and list at the
+%D end of the document \stopitem
%D \stopitemize
-%D
-%D We use named destinations, which means that one can
-%D access a figure by name from an external application.
-
-\usemodule[res-00]
-
-\autoXMLnamespace[rl]
-
-\setupoutput[pdftex] \overcomePDFspacefalse
-
-\setjobfullname {xml} % default suffix
-
-\doifnothing {\jobfullname} {\end}
-\doiffileelse {\jobfullname} {} {\end}
-
-\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}]
-\setupattachments [symbol=attachment]
-\useattachment [datafile] [\jobname.xml]
-
-\def\StartDescription
- {\bgroup}
-
-\def\StopDescription
- {\subject {Figure collection}
- \starttabulate[|lBe|p|]
- \doifXMLdataelse{rl:organization}
- {\NC organization \NC \XMLflush{rl:organization} \NC \NR}{}
- \doifXMLdataelse{rl:project}
- {\NC project \NC \XMLflush{rl:project} \NC \NR}{}
- \doifXMLdataelse{rl:product}
- {\NC product \NC \XMLflush{rl:product} \NC \NR}{}
- \doifXMLdataelse{rl:comment}
- {\NC comment \NC \XMLflush{rl:comment} \NC \NR}{}
- \NC specification \NC \attachment[datafile] \NC \NR
- \stoptabulate
- \blank[2*big]
- \egroup}
-
-
-\def\localexternalfigurereplacement#1#2#3% hack, no reuse of dummies (yet), todo: pass objname
- {\doifelsenothing{\XMLflush{rl:label}}
- {\edef\FigureName{\XMLflush{rl:label}}}
- {\edef\FigureName{\XMLflush{rl:file}}}%
- \doifobjectfoundelse{rl}\FigureName
- {}
- {\setobject{rl}\FigureName\vbox{\normalexternalfigurereplacement{#1}{#2}{#3}}}%
- \getobject{rl}\FigureName}
-
-\startmode[dummy]
-
- \useMPlibrary[dum]
-
- \def\StartFigureA
- {\bgroup
- \XMLassign{rl:file}{dummy}}
-
- \let\normalexternalfigurereplacement\externalfigurereplacement
- \let\externalfigurereplacement \localexternalfigurereplacement
-
-\stopmode
-
-\startnotmode[dummy]
-
- \def\StartFigureA
- {\bgroup
- \XMLassign{rl:file}{unknown}}
-
-\stopnotmode
-
-\startbuffer[unknown]
- \framed
- [width=\XMLpar{rl:dummy}{width}{12cm},
- height=\XMLpar{rl:dummy}{height}{8cm},
- background=color,
- backgroundcolor=gray,
- foregroundcolor=darkred,
- align={lohi,middle}, % normal,
- frame=off]
- {\bf \XMLflush{rl:dummy}}
-\stopbuffer
-
-\useexternalfigure[unknown][unknown][type=buffer,object=no]
-
-\defineoverlay[page][\overlaybutton{Description}]
-
-% \def\externalfigurereplacement#1#2#3%
-% {\getbuffer[rl-unknown]}
-
-\def\StopFigureA
- {\doglobal\increment\CurrentPage
- \setupbackgrounds[page][background=page]
- \doifelsenothing{\XMLflush{rl:label}}
- {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}%
- \expanded{\pagereference[\XMLflush{rl:file}]}}
- {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}%
- \expanded{\pagereference[\XMLflush{rl:label}]}}
- \pagefigure[\XMLflush{rl:file}]
- \setupbackgrounds[page][background=]
- \egroup}
-
-\def\StartFigureB
- {\StartFigureA}
\defineregister
[figureindex]
@@ -159,58 +57,14 @@
\setupregister
[figureindex]
- [ownnumber=yes,
- criterium=text,
- interaction=text,
- indicator=no]
-
-\definelist
- [figurelist]
-
-\setuplist
- [figurelist]
[criterium=text,
+ interaction=text,
pagenumber=no,
- width=2em,
- interaction=all]
-
-\setupcolors
- [state=start]
+ indicator=no]
\setuptolerance
[verytolerant]
-% Ulgy:
-
-\startmode[letter] % downward compatible
- \enablemode[previewpage-letter]
-\stopmode
-
-\startnotmode[previewpage-letter,previewpage-S6]
- \enablemode[previewpage-A4]
-\stopnotmode
-
-\startsetups[paper]
-\startmode[previewpage-A4]
- \framed
- [width=210mm,height=297mm,offset=overlay,frame=off,
- background=color,backgroundcolor=white]
- {\externalfigure[\XMLflush{rl:file}][reset=yes]}
-\stopmode
-\startmode[previewpage-letter]
- \framed
- [width=8.5in,height=11in,offset=overlay,frame=off,
- background=color,backgroundcolor=white]
- {\externalfigure[\XMLflush{rl:file}][reset=yes]}
-\stopmode
-\startmode[previewpage-S6]
- \framed
- [width=600pt,height=450pt,offset=overlay,frame=off,
- background=color,backgroundcolor=white]
- {\externalfigure[\XMLflush{rl:file}][reset=yes]}
-\stopmode
-\stopsetups
-
\setupbuttons
[offset=10pt,
width=broad,
@@ -218,103 +72,15 @@
rulethickness=1pt,
framecolor=darkred]
-\definecolor[XMLRLcolor][white]
-
-\def\StopFigureB
- {\doglobal\increment\CurrentPage
- \doifelsenothing{\XMLflush{rl:label}}
- {\expanded{\definereference[Figure][\XMLflush{rl:file}]}%
- \expanded{\definereference[GridPg][grid:\XMLflush{rl:file}]}}
- {\expanded{\definereference[Figure][\XMLflush{rl:label}]}%
- \expanded{\definereference[GridPg][grid:\XMLflush{rl:label}]}}%
- \button
- {\hbox to \hsize
- {\forgetall \dontcomplain
- \doifelsenothing{\XMLflush{rl:label}}
- {\expanded{\pagereference[about:\XMLflush{rl:file}]}}
- {\expanded{\pagereference[about:\XMLflush{rl:label}]}}%
- % moved here, because descriptions may be absent
- \ifnum\CurrentPage=1 \pagereference[begin]\fi
- %
- \expanded{\writetolist[figurelist]{\CurrentPage}{\XMLflush{rl:label}}}%
- \expanded{\figureindex{\CurrentPage}{\XMLflush{rl:label}}}%
- \startnotmode[compact]%
- \vbox to 100pt
- {\hsize30pt
- \vskip5pt
- \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}%
- \vfill}%
- \advance\hsize by -30pt
- \stopnotmode
- \startmode[compact]%
- \advance\hsize by -10pt
- \hskip10pt
- \stopmode
- \button % \framed
- [width=150pt,height=100pt,offset=10pt,frame=off,
- background=color,backgroundcolor=white,color=]
- {\externalfigure
- [\XMLflush{rl:file}]
- %[maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}%
- [factor=max]}%
- [GridPg]%
- \let\FigWid\figurenaturalwidth
- \let\FigHei\figurenaturalheight
- \advance\hsize by -150pt
- \hskip10pt
- \advance\hsize by -10pt
- \vbox to 100pt
- {\hsize40pt
- %\externalfigure
- % [paper]
- % [type=buffer,frame=on,
- % framecolor=darkred,rulethickness=.5pt,
- % width=40pt,object=no]
- \framed
- [offset=overlay,
- framecolor=darkred,
- rulethickness=.5pt]
- {\scale[width=40pt]{\setups[paper]}}%
- \startmode[compact]%
- \vfill
- \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}%
- \stopmode
- \vfill}%
- \advance\hsize by -40pt
- \hskip10pt
- \advance\hsize by -10pt
- \vbox to 100pt
- {\blank[disable]
- \starttabulate[|Bel|p|]
- \NC file \NC \XMLflush{rl:file} \NC \NR
- \doifXMLdata{rl:label}
- {\NC label \NC \XMLflush{rl:label} \NC \NR}
- \NC w$\times$h \NC \FigWid$\times$\FigHei \NC \NR
- \doifXMLdata{rl:copyright}
- {\NC copyright \NC \XMLflush{rl:copyright} \NC \NR}
- \doifXMLdata{rl:status}
- {\doifelse{\XMLflush{rl:status}}{obsolete}
- {\NC status \NC \dontleavehmode \color[darkred]{\bf\XMLflush{rl:status}} \NC \NR}
- {\NC status \NC \XMLflush{rl:status} \NC \NR}}
- \doifXMLdata{rl:comment}
- {\NC comment \NC \XMLflush{rl:comment} \NC \NR}
- \stoptabulate
- \vfill}}}%
- [Figure]
- \vskip10pt
- \egroup}
-
-\def\StartFigureC
- {\StartFigureA}
-
-\def\StopFigureC
- {\doglobal\increment\NumberOfFigures
- \egroup}
-
\setuplayout
- [topspace=15pt,backspace=15pt,
- header=0pt,footer=0pt,bottom=20pt,bottomdistance=10pt,
- width=middle,height=fit]
+ [topspace=15pt,
+ backspace=15pt,
+ header=0pt,
+ footer=0pt,
+ bottom=20pt,
+ bottomdistance=10pt,
+ width=middle,
+ height=fit]
\setupbackgrounds
[page]
@@ -325,9 +91,6 @@
[width=max,
height=max]
-\setupcolors
- [state=start]
-
\setupinteraction
[style=,
color=,
@@ -338,9 +101,6 @@
[section]
[style=bfb]
-% \setupbodyfont
-% [pos]
-
\setupinteractionmenu
[bottom]
[left=\hfill,
@@ -352,40 +112,16 @@
foregroundcolor=white]
\startinteractionmenu[bottom]
- \but [begin] begin \\
- \but [index] index \\
- \but [list] list \\
- \but [CloseDocument] close \\
- \but [PreviousJump] go back \\
+ \but [begin] begin \\
+ \but [index] index \\
+ \but [list] list \\
+ \but [CloseDocument] close \\
+ \but [PreviousJump] go back \\
\stopinteractionmenu
\setupinteraction
[openaction=begin]
-\defineXMLenvironment [rl:figurelibrary] \StartLibrary \StopLibrary
-\defineXMLenvironment [rl:library] \StartLibrary \StopLibrary
-
-\starttext
-
-\def\StartLibrary{\mainlanguage[\XMLpar{rl:library}{language}{en}]}
-\def\StopLibrary {}
-
-\defineXMLignore [rl:description]
-\defineXMLenvironment [rl:figure] \StartFigureC \StopFigureC
-
-\doglobal\newcounter\CurrentPage
-
-\processXMLfilegrouped{\jobfullname}
-
-\increment\NumberOfFigures
-
-\defineXMLignore [rl:description]
-\defineXMLenvironment [rl:figure] \StartFigureA \StopFigureA
-
-\doglobal\newcounter\CurrentPage
-
-\processXMLfilegrouped{\jobfullname}
-
\setuppapersize
[S6][S6]
@@ -396,92 +132,297 @@
\setupinteraction
[menu=on]
-\defineXMLenvironment [rl:description] \StartDescription \StopDescription
-\defineXMLenvironment [rl:figure] \StartFigureB \StopFigureB
-
-\doglobal\newcounter\CurrentPage
-
-\processXMLfilegrouped{\jobfullname} \page
-
-\subject [list] {List of figures}
-
-\placelist[figurelist] \page
-
-\subject [index] {Index of figures}
-
-\startcolumns
-\placeregister[figureindex]
-\stopcolumns
-
-\doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext}
-
-\startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type}
- numeric gdx, gdy, lbx, lby ;
- if \MPvar{type}=1 :
- gdx := \MPvar{dy} ;
- gdy := \MPvar{dx} ;
- else :
- gdx := OverlayWidth /\MPvar{nx} ;
- gdy := OverlayHeight/\MPvar{ny} ;
- fi ;
- lbx := gdx ;
- lby := gdy ;
- defaultfont := "\truefontname{Mono}" ;
- defaultscale := .5 ;
- numeric pen ; pen := .25pt ;
- def MyGrid text t =
- draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ;
- draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ;
- enddef ;
- pickup pencircle scaled pen ;
- MyGrid withcolor white ;
- MyGrid dashed evenly scaled pen ;
- draw OverlayBox withcolor white ;
- draw OverlayBox dashed evenly scaled pen ;
- draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ;
- draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ;
- setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ;
-\stopuniqueMPgraphic
-
-\presetMPvariable[clipgrid][dx=10pt]
-\presetMPvariable[clipgrid][dy=10pt]
-\presetMPvariable[clipgrid][nx=10]
-\presetMPvariable[clipgrid][ny=10]
-
-\startmode[clipgrid-distance]
- \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}]
+\setupbodyfont
+ [tt,10pt]
+
+\definesymbol [attachment] [{\strut\bf\color[darkred]{\jobname.xml}}]
+\setupattachments [symbol=attachment,alternative=]
+\useattachment [datafile] [\inputfilename]
+
+\xmlloadonly{main}{\inputfilename}{}
+
+\mainlanguage[\xmlattributedef{main}{/rl:library}{language}{en}]
+
+\startxmlsetups xml:resource:asis
+ \startTEXpage[pagestate=start]
+ \xmldoifelsetext{#1}{/rl:label} {
+ \edef\CurrentLabel{\xmltext{#1}{rl:label}}
+ } {
+ \edef\CurrentLabel{\xmltext{#1}{rl:file}}
+ }
+ \pagereference [
+ asis:\CurrentLabel
+ ]
+ \gotobox {
+ \externalfigure[\xmltext{#1}{/rl:file}]
+ }[% tricky no space before [
+ data:\CurrentLabel
+ ]
+ \stopTEXpage
+\stopxmlsetups
+
+\definemeasure[figure:width] [210mm]
+\definemeasure[figure:height][297mm]
+
+\startmode[letter]
+ \enablemode[previewpage-letter]
+\stopmode
+
+\startmode[previewpage-A4]
+ \definemeasure[figure:width] [210mm]
+ \definemeasure[figure:height][297mm]
+\stopmode
+
+\startmode[previewpage-letter]
+ \definemeasure[figure:width] [8.5in]
+ \definemeasure[figure:height][11in]
\stopmode
-\startmode[clipgrid-steps]
- \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}]
+\startmode[previewpage-S6]
+ \definemeasure[figure:width] [600pt]
+ \definemeasure[figure:height][450pt]
\stopmode
-\setupexternalfigures
- [background={color,foreground,grid},
- backgroundcolor=white]
-
-\def\StartFigureD
- {\StartFigureA}
-
-\def\StopFigureD
- {\doglobal\increment\CurrentPage
- \setupbackgrounds[page][background=page]
- \startpagefigure[\XMLflush{rl:file}][offset=20pt]%
- \doifelsenothing{\XMLflush{rl:label}}
- {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}%
- \expanded{\pagereference[grid:\XMLflush{rl:file}]}}
- {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}%
- \expanded{\pagereference[grid:\XMLflush{rl:label}]}}
- \stoppagefigure
- %\pagefigure[\XMLflush{rl:file}][offset=20pt]
- \setupbackgrounds[page][background=]
- \egroup}
-
-\defineXMLignore [rl:description]
-\defineXMLenvironment [rl:figure] \StartFigureD \StopFigureD
-
-\doglobal\newcounter\CurrentPage
-
-\processXMLfilegrouped{\jobfullname} \page
+\startxmlsetups xml:resource:a
+ \button
+ [
+ width=150pt,
+ height=100pt,
+ offset=10pt,
+ frame=off,
+ background=color,
+ backgroundcolor=white,
+ color=
+ ]
+ {
+ \externalfigure
+ [\xmltext{#1}{rl:file}]
+ [factor=max]
+ }
+ [
+ grid:\CurrentLabel
+ ]
+\stopxmlsetups
+
+\startxmlsetups xml:resource:b
+ \framed
+ [
+ width=150pt,
+ height=100pt,
+ offset=10pt,
+ frame=off,
+ background=color,
+ backgroundcolor=white,
+ color=
+ ]
+ {
+ \externalfigure [
+ \xmltext{#1}{rl:file}
+ ] [
+ factor=max
+ ]
+ }
+\stopxmlsetups
+
+\startxmlsetups xml:resource:data
+
+ % using a layer makes more sense but we had this ...
+
+ \xmldoifelsetext{#1}{/rl:label} {
+ \edef\CurrentLabel{\xmltext{#1}{rl:label}}
+ } {
+ \edef\CurrentLabel{\xmltext{#1}{rl:file}}
+ }
+
+ \button {
+ \hbox to \hsize {
+ \forgetall
+ \dontcomplain
+ \pagereference[data:\CurrentLabel]
+
+ %\ifnum\CurrentPage=1 \pagereference[begin]\fi
+
+ \expanded{\figureindex{\xmltext{#1}{/rl:label}}}
+
+ \vbox to 100pt {
+ \hsize30pt
+ \vskip5pt
+ \hbox to \hsize {
+ \hss
+ \strut
+ \bf
+ \at[asis:\CurrentLabel]
+ \hss
+ }
+ \vfill
+ }
+ \advance\hsize by -30pt
+ \doifmodeelse {clipgrid-distance,clipgrid-steps} {
+ \xmlsetup{#1}{xml:resource:a}
+ } {
+ \xmlsetup{#1}{xml:resource:b}
+ }
+ \edef\CurrentWidth {\the\dimexpr\figurenaturalwidth}
+ \edef\CurrentHeight{\the\dimexpr\figurenaturalheight}
+ \advance\hsize by -150pt
+ \hskip10pt
+ \advance\hsize by -10pt
+ \vbox to 100pt {
+ \hsize40pt
+ \framed [
+ offset=overlay,
+ framecolor=darkred,
+ rulethickness=.5pt
+ ] {
+ \scale [
+ width=40pt
+ ] {
+ \framed [
+ width=\measure{figure:width},
+ height=\measure{figure:height},
+ offset=overlay,
+ frame=off,
+ background=color,
+ backgroundcolor=white
+ ] {
+ \externalfigure
+ [
+ \xmltext{#1}{rl:file}
+ ] [
+ reset=yes
+ ]
+ }
+ }
+ }
+ \vfill
+ }
+ \advance\hsize by -40pt
+ \hskip10pt
+ \advance\hsize by -10pt
+ \vbox to 100pt {
+ \blank[disable]
+ \starttabulate[|Bel|p|]
+ \NC file \NC \xmltext{#1}{/rl:file} \NC \NR
+ \xmldoif{#1}{/rl:label} {\NC label \NC \xmltext{#1}{/rl:label} \NC \NR}
+ \NC dimensions \NC \CurrentWidth\ * \CurrentHeight \NC \NR
+ \xmldoif{#1}{/rl:copyright} {\NC copyright \NC \xmltext{#1}{/rl:copyright} \NC \NR}
+ \xmldoif{#1}{/rl:status} {\NC status \NC \xmltext{#1}{/rl:status} \NC \NR}
+ \xmldoif{#1}{/rl:comment} {\NC comment \NC \xmltext{#1}{/rl:comment} \NC \NR}
+ \stoptabulate
+ \vfill
+ }
+ }
+ } [
+ asis:\CurrentLabel
+ ]
+
+ \vskip10pt
+
+\stopxmlsetups
+
+\startxmlsetups xml:description
+
+ \starttabulate[|lBe|p|]
+ \xmldoif{#1}{/rl:organization} {\NC organization \NC \xmltext{#1}{/rl:organization} \NC \NR}
+ \xmldoif{#1}{/rl:project} {\NC project \NC \xmltext{#1}{/rl:project} \NC \NR}
+ \xmldoif{#1}{/rl:product} {\NC product \NC \xmltext{#1}{/rl:product} \NC \NR}
+ \xmldoif{#1}{/rl:comment} {\NC comment \NC \xmltext{#1}{/rl:comment} \NC \NR}
+ \NC specification \NC \attachment[datafile] \NC \NR
+ \stoptabulate
+
+\stopxmlsetups
+
+\starttext
+
+ \xmlfilter{main}{/rl:library/rl:resource/command(xml:resource:asis)}
+
+ \subject {Figure collection}
+
+ \xmlfilter{main}{/rl:library/rl:description/command(xml:description)}
+
+ \subject [list] {List of figures}
+
+ \xmlfilter{main}{/rl:library/rl:resource/command(xml:resource:data)}
+
+ \page
+
+ \subject [index] {Index of figures}
+
+ \startcolumns
+ \placeregister[figureindex]
+ \stopcolumns
+
+\stoptext
+
+% \doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext}
+
+% \startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type}
+% numeric gdx, gdy, lbx, lby ;
+% if \MPvar{type}=1 :
+% gdx := \MPvar{dy} ;
+% gdy := \MPvar{dx} ;
+% else :
+% gdx := OverlayWidth /\MPvar{nx} ;
+% gdy := OverlayHeight/\MPvar{ny} ;
+% fi ;
+% lbx := gdx ;
+% lby := gdy ;
+% defaultfont := "\truefontname{Mono}" ;
+% defaultscale := .5 ;
+% numeric pen ; pen := .25pt ;
+% def MyGrid text t =
+% draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ;
+% draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ;
+% enddef ;
+% pickup pencircle scaled pen ;
+% MyGrid withcolor white ;
+% MyGrid dashed evenly scaled pen ;
+% draw OverlayBox withcolor white ;
+% draw OverlayBox dashed evenly scaled pen ;
+% draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ;
+% draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ;
+% setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ;
+% \stopuniqueMPgraphic
+
+% \presetMPvariable[clipgrid][dx=10pt]
+% \presetMPvariable[clipgrid][dy=10pt]
+% \presetMPvariable[clipgrid][nx=10]
+% \presetMPvariable[clipgrid][ny=10]
+
+% \startmode[clipgrid-distance]
+% \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}]
+% \stopmode
+
+% \startmode[clipgrid-steps]
+% \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}]
+% \stopmode
+
+% \setupexternalfigures
+% [background={color,foreground,grid},
+% backgroundcolor=white]
+
+% \def\StartFigureD
+% {\StartFigureA}
+
+% \def\StopFigureD
+% {\doglobal\increment\CurrentPage
+% \setupbackgrounds[page][background=page]
+% \startpagefigure[\XMLflush{rl:file}][offset=20pt]%
+% \doifelsenothing{\XMLflush{rl:label}}
+% {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}%
+% \expanded{\pagereference[grid:\XMLflush{rl:file}]}}
+% {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}%
+% \expanded{\pagereference[grid:\XMLflush{rl:label}]}}
+% \stoppagefigure
+% %\pagefigure[\XMLflush{rl:file}][offset=20pt]
+% \setupbackgrounds[page][background=]
+% \egroup}
+
+% \defineXMLignore [rl:description]
+% \defineXMLenvironment [rl:figure] \StartFigureD \StopFigureD
+
+% \doglobal\newcounter\CurrentPage
+
+% \processXMLfilegrouped{\jobfullname} \page
\stoptext
diff --git a/tex/context/base/x-res-50.mkiv b/tex/context/base/x-res-50.mkiv
index b4c6b4560..87b63dd97 100644
--- a/tex/context/base/x-res-50.mkiv
+++ b/tex/context/base/x-res-50.mkiv
@@ -11,7 +11,9 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D TO BE REDONE!
+%D The xml mapping has to be redone!
+
+\endinput
%D This is a preliminary module, using a preliminary xml media format that
%D looks as follows (record is embedded in resource library element):
diff --git a/tex/context/base/x-set-01.tex b/tex/context/base/x-set-01.mkii
index 75e1d43e2..75e1d43e2 100644
--- a/tex/context/base/x-set-01.tex
+++ b/tex/context/base/x-set-01.mkii
diff --git a/tex/context/base/x-set-02.tex b/tex/context/base/x-set-02.mkii
index bb0b7583c..bb0b7583c 100644
--- a/tex/context/base/x-set-02.tex
+++ b/tex/context/base/x-set-02.mkii
diff --git a/tex/context/base/x-set-11.mkii b/tex/context/base/x-set-11.mkii
index 450382a95..3207ef5f9 100644
--- a/tex/context/base/x-set-11.mkii
+++ b/tex/context/base/x-set-11.mkii
@@ -16,7 +16,271 @@
%
% texmfstart texexec --int=nl --pdf --global --result=setup-nl x-set-12
-\usemodule[set-99] % interface messages
+\startmessages dutch library: setup
+ title: setup
+ formula: formule
+ number: getal
+ list: lijst
+ dimension: maat
+ mark: markering
+ reference: verwijzing
+ command: commando
+ file: file
+ name: naam
+ identifier: naam
+ text: tekst
+ section: sectie
+ singular: naam enkelvoud
+ plural: naam meervoud
+ matrix: n*m
+ see: zie
+ inherits: erft van
+ 1: de karakters < en > zijn globaal actief!
+ 2: -- wordt verwerkt
+ 3: -- is niet gedefinieerd
+ 4: -- wordt nogmaals verwerkt
+ optional: optioneel
+ displaymath: formule
+ index: ingang
+ math: formule
+ nothing: leeg
+ file: file
+ position: positie
+ reference: verwijzing
+ csname: naam
+ destination: bestemming
+ triplet: triplet
+ word: woord
+ content: tekst
+\stopmessages
+
+\startmessages english library: setup
+ title: setup
+ formula: formula
+ number: number
+ list: list
+ dimension: dimension
+ mark: mark
+ reference: reference
+ command: command
+ file: file
+ name: name
+ identifier: identifier
+ text: text
+ section: section
+ singular: singular name
+ plural: plural name
+ matrix: n*m
+ see: see
+ inherits: inherits from
+ 1: the characters < and > are globally active!
+ 2: -- is processed
+ 3: -- is undefined
+ 4: -- is processed again
+ optional: optional
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages german library: setup
+ title: Setup
+ formula: Formel
+ number: Nummer
+ list: Liste
+ dimension: Dimension
+ mark: Beschriftung
+ reference: Referenz
+ command: Befehl
+ file: Datei
+ name: Name
+ identifier: Name
+ text: Text
+ section: Abschnitt
+ singular: singular
+ plural: plural
+ matrix: n*m
+ see: siehe
+ inherits: inherits from
+ 1: Die Zeichen < und > gelten global!
+ 2: -- wird verarbeitet
+ 3: -- ist undefiniert
+ 4: -- ist mehrmals verarbeitet
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages czech library: setup
+ title: setup
+ formula: rovnice
+ number: cislo
+ list: seznam
+ dimension: dimenze
+ mark: znacka
+ reference: reference
+ command: prikaz
+ file: soubor
+ name: jmeno
+ identifier: jmeno
+ text: text
+ section: sekce
+ singular: jmeno v singularu
+ plural: jmeno v pluralu
+ matrix: n*m
+ see: viz
+ inherits: inherits from
+ 1: znaky < a > jsou globalne aktivni!
+ 2: -- je zpracovano
+ 3: -- je nedefinovano
+ 4: -- je zpracovano znovu
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages italian library: setup
+ title: setup
+ formula: formula
+ number: number
+ list: list
+ dimension: dimension
+ mark: mark
+ reference: reference
+ command: command
+ file: file
+ name: name
+ identifier: name
+ text: text
+ section: section
+ singular: singular name
+ plural: plural name
+ matrix: n*m
+ see: see
+ inherits: inherits from
+ 1: the characters < and > are globally active!
+ 2: -- is processed
+ 3: -- is undefined
+ 4: -- is processed again
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages romanian library: setup
+ title: setari
+ formula: formula
+ number: numar
+ list: lista
+ dimension: dimensiune
+ mark: marcaj
+ reference: referinta
+ command: comanda
+ file: fisier
+ name: nume
+ identifier: nume
+ text: text
+ section: sectiune
+ singular: nume singular
+ plural: nume pluram
+ matrix: n*m
+ see: vezi
+ inherits: inherits from
+ 1: caracterele < si > sunt active global!
+ 2: este procesat --
+ 3: -- este nedefinit
+ 4: -- este procesat din nou
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages french library: setup
+ title: réglage
+ formula: formule
+ number: numéro
+ list: liste
+ dimension: dimension
+ mark: marquage
+ reference: reference
+ command: commande
+ file: fichier
+ name: nom
+ identifier: identificateur
+ text: texte
+ section: section
+ singular: nom singulier
+ plural: nom pluriel
+ matrix: n*m
+ see: vois
+ inherits: herite de
+ 1: les caractères < et > sont globalement actifs !
+ 2: -- est traité
+ 3: -- n'est pas défini
+ 4: -- est traité de nouveau
+ optional: optionel
+ displaymath: formule
+ index: entrée
+ math: formule
+ nothing: vide
+ file: fichier
+ position: position
+ reference: réference
+ csname: nom
+ destination: destination
+ triplet: triplet
+ word: mot
+ content: texte
+\stopmessages
\unprotect
diff --git a/tex/context/base/x-set-11.mkiv b/tex/context/base/x-set-11.mkiv
index f445459ee..4db75ef06 100644
--- a/tex/context/base/x-set-11.mkiv
+++ b/tex/context/base/x-set-11.mkiv
@@ -34,7 +34,271 @@
%
% register, interaction
-\usemodule[set-99] % interface messages
+\startmessages dutch library: setup
+ title: setup
+ formula: formule
+ number: getal
+ list: lijst
+ dimension: maat
+ mark: markering
+ reference: verwijzing
+ command: commando
+ file: file
+ name: naam
+ identifier: naam
+ text: tekst
+ section: sectie
+ singular: naam enkelvoud
+ plural: naam meervoud
+ matrix: n*m
+ see: zie
+ inherits: erft van
+ 1: de karakters < en > zijn globaal actief!
+ 2: -- wordt verwerkt
+ 3: -- is niet gedefinieerd
+ 4: -- wordt nogmaals verwerkt
+ optional: optioneel
+ displaymath: formule
+ index: ingang
+ math: formule
+ nothing: leeg
+ file: file
+ position: positie
+ reference: verwijzing
+ csname: naam
+ destination: bestemming
+ triplet: triplet
+ word: woord
+ content: tekst
+\stopmessages
+
+\startmessages english library: setup
+ title: setup
+ formula: formula
+ number: number
+ list: list
+ dimension: dimension
+ mark: mark
+ reference: reference
+ command: command
+ file: file
+ name: name
+ identifier: identifier
+ text: text
+ section: section
+ singular: singular name
+ plural: plural name
+ matrix: n*m
+ see: see
+ inherits: inherits from
+ 1: the characters < and > are globally active!
+ 2: -- is processed
+ 3: -- is undefined
+ 4: -- is processed again
+ optional: optional
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages german library: setup
+ title: Setup
+ formula: Formel
+ number: Nummer
+ list: Liste
+ dimension: Dimension
+ mark: Beschriftung
+ reference: Referenz
+ command: Befehl
+ file: Datei
+ name: Name
+ identifier: Name
+ text: Text
+ section: Abschnitt
+ singular: singular
+ plural: plural
+ matrix: n*m
+ see: siehe
+ inherits: inherits from
+ 1: Die Zeichen < und > gelten global!
+ 2: -- wird verarbeitet
+ 3: -- ist undefiniert
+ 4: -- ist mehrmals verarbeitet
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages czech library: setup
+ title: setup
+ formula: rovnice
+ number: cislo
+ list: seznam
+ dimension: dimenze
+ mark: znacka
+ reference: reference
+ command: prikaz
+ file: soubor
+ name: jmeno
+ identifier: jmeno
+ text: text
+ section: sekce
+ singular: jmeno v singularu
+ plural: jmeno v pluralu
+ matrix: n*m
+ see: viz
+ inherits: inherits from
+ 1: znaky < a > jsou globalne aktivni!
+ 2: -- je zpracovano
+ 3: -- je nedefinovano
+ 4: -- je zpracovano znovu
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages italian library: setup
+ title: setup
+ formula: formula
+ number: number
+ list: list
+ dimension: dimension
+ mark: mark
+ reference: reference
+ command: command
+ file: file
+ name: name
+ identifier: name
+ text: text
+ section: section
+ singular: singular name
+ plural: plural name
+ matrix: n*m
+ see: see
+ inherits: inherits from
+ 1: the characters < and > are globally active!
+ 2: -- is processed
+ 3: -- is undefined
+ 4: -- is processed again
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages romanian library: setup
+ title: setari
+ formula: formula
+ number: numar
+ list: lista
+ dimension: dimensiune
+ mark: marcaj
+ reference: referinta
+ command: comanda
+ file: fisier
+ name: nume
+ identifier: nume
+ text: text
+ section: sectiune
+ singular: nume singular
+ plural: nume pluram
+ matrix: n*m
+ see: vezi
+ inherits: inherits from
+ 1: caracterele < si > sunt active global!
+ 2: este procesat --
+ 3: -- este nedefinit
+ 4: -- este procesat din nou
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages french library: setup
+ title: réglage
+ formula: formule
+ number: numéro
+ list: liste
+ dimension: dimension
+ mark: marquage
+ reference: reference
+ command: commande
+ file: fichier
+ name: nom
+ identifier: identificateur
+ text: texte
+ section: section
+ singular: nom singulier
+ plural: nom pluriel
+ matrix: n*m
+ see: vois
+ inherits: herite de
+ 1: les caractères < et > sont globalement actifs !
+ 2: -- est traité
+ 3: -- n'est pas défini
+ 4: -- est traité de nouveau
+ optional: optionel
+ displaymath: formule
+ index: entrée
+ math: formule
+ nothing: vide
+ file: fichier
+ position: position
+ reference: réference
+ csname: nom
+ destination: destination
+ triplet: triplet
+ word: mot
+ content: texte
+\stopmessages
\unprotect
diff --git a/tex/context/base/x-set-12.tex b/tex/context/base/x-set-12.mkii
index d79901433..d79901433 100644
--- a/tex/context/base/x-set-12.tex
+++ b/tex/context/base/x-set-12.mkii
diff --git a/tex/context/base/x-set-12.mkiv b/tex/context/base/x-set-12.mkiv
new file mode 100644
index 000000000..d79901433
--- /dev/null
+++ b/tex/context/base/x-set-12.mkiv
@@ -0,0 +1,258 @@
+%D \module
+%D [ file=x-set-12,
+%D version=2004.10.31,
+%D remark=setupx.tex: 1998.07.20 and later,
+%D title=\CONTEXT\ Setup Definitions,
+%D subtitle=Macro Definitions,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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[set-11]
+
+\unprotect
+
+% \starttext
+% \setup{installlanguage}
+% \placesetup
+% \stoptext
+
+\definecolor[TitleColor][r=.375,g=.125,b=.125]
+\definecolor[TitleColor][r=.125,g=.375,b=.125]
+\definecolor[TitleColor][r=.125,g=.125,b=.375]
+\definecolor[TitleColor][r=.375,g=.375,b=.125]
+\definecolor[TitleColor][r=.375,g=.125,b=.375]
+\definecolor[TitleColor][r=.125,g=.375,b=.375]
+
+\definecolor[TitleColor][r=.25,g=.20,b=.15]
+\definecolor[TitleColor][r=.25,g=.15,b=.20]
+\definecolor[TitleColor][r=.20,g=.15,b=.25]
+\definecolor[TitleColor][r=.20,g=.25,b=.15]
+\definecolor[TitleColor][r=.15,g=.20,b=.25]
+\definecolor[TitleColor][r=.15,g=.25,b=.20]
+
+\startinterface english \loadsetups[cont-en.xml] \stopinterface
+\startinterface dutch \loadsetups[cont-nl.xml] \stopinterface
+\startinterface german \loadsetups[cont-de.xml] \stopinterface
+\startinterface french \loadsetups[cont-fr.xml] \stopinterface
+\startinterface italian \loadsetups[cont-it.xml] \stopinterface
+\startinterface czech \loadsetups[cont-cs.xml] \stopinterface
+\startinterface romanian \loadsetups[cont-ro.xml] \stopinterface
+
+\startinterface dutch \definecolor[LocalColor][r=.75,g=.25,b=.25] \stopinterface
+\startinterface english \definecolor[LocalColor][r=.25,g=.75,b=.25] \stopinterface
+\startinterface german \definecolor[LocalColor][r=.25,g=.25,b=.75] \stopinterface
+\startinterface french \definecolor[LocalColor][r=.75,g=.75,b=.25] \stopinterface
+\startinterface czech \definecolor[LocalColor][r=.75,g=.25,b=.75] \stopinterface
+\startinterface italian \definecolor[LocalColor][r=.25,g=.75,b=.75] \stopinterface
+\startinterface romanian \definecolor[LocalColor][r=.5,g=.4,b=.3] \stopinterface
+% \definecolor[LocalColor][r=.5,g=.3,b=.4]
+% \definecolor[LocalColor][r=.4,g=.3,b=.5]
+% \definecolor[LocalColor][r=.4,g=.5,b=.3]
+% \definecolor[LocalColor][r=.3,g=.4,b=.5]
+% \definecolor[LocalColor][r=.3,g=.5,b=.4]
+
+\startinterface english \definecolor[TitleColor][r=.375,g=.125,b=.125] \stopinterface
+\startinterface dutch \definecolor[TitleColor][r=.125,g=.375,b=.125] \stopinterface
+\startinterface german \definecolor[TitleColor][r=.125,g=.125,b=.375] \stopinterface
+\startinterface french \definecolor[TitleColor][r=.375,g=.375,b=.125] \stopinterface
+\startinterface italian \definecolor[TitleColor][r=.375,g=.125,b=.375] \stopinterface
+\startinterface czech \definecolor[TitleColor][r=.125,g=.375,b=.375] \stopinterface
+\startinterface romanian \definecolor[TitleColor][r=.25,g=.20,b=.15] \stopinterface
+% \definecolor[TitleColor][r=.25,g=.15,b=.20]
+% \definecolor[TitleColor][r=.20,g=.15,b=.25]
+% \definecolor[TitleColor][r=.20,g=.25,b=.15]
+% \definecolor[TitleColor][r=.15,g=.20,b=.25]
+% \definecolor[TitleColor][r=.15,g=.25,b=.20]
+
+\definecolor [lightgray] [s=.9]
+\definecolor [darkgray] [s=.1]
+
+\usetypescript[palatino]
+\setupbodyfont[palatino,9pt]
+
+\setupcolors
+ [\c!state=\v!start]
+
+\defineoverlay
+ [cover]
+ [\hbox to \paperwidth{\hss\reuseMPgraphic{cover+back}}]
+
+\defineoverlay
+ [back]
+ [\hbox to \paperwidth{\reuseMPgraphic{cover+back}\hss}]
+
+\startreusableMPgraphic{cover+back}
+ numeric h, w ; path p, q, r ; color f, d ; pair s ;
+ h := OverlayHeight ; w := 2*OverlayWidth ;
+ r := unitsquare xyscaled (w,h) ;
+ fill r withcolor \MPcolor{lightgray} ;
+ set_grid(w,h,w/8,w/16) ;
+ forever :
+ s := center r randomized (w,h) ;
+ if new_on_grid(xpart s, ypart s) :
+ s := (dx,dy) ;
+ p := fullsquare xyscaled(w/4,w/8) ;
+ q := (-4w,ypart ulcorner p) --
+ .5[ulcorner p, urcorner p] --
+ (4w,ypart urcorner p) ;
+ q := q shifted (0,-w/24) ;
+ p := p randomized (w/40,w/40) ;
+ q := q randomized (0,w/100) ;
+ q := q cutafter (p cutafter point 3 of p) ;
+ q := q cutbefore (p cutbefore point 3 of p) ;
+ d := .5[\MPcolor{LocalColor},\MPcolor{lightgray}] randomized (.5,.9) ;
+ f := \MPcolor{lightgray} randomized (.5,.9) ;
+ pickup pencircle scaled (w/100) ;
+ fill p shifted s withcolor f ;
+ draw p shifted s withcolor d ;
+ draw q shifted s withcolor d ;
+ fi ;
+ exitif grid_full ;
+ endfor ;
+ setbounds currentpicture to r ;
+\stopreusableMPgraphic
+
+\definelayout
+ [titlepage]
+ [\c!backspace=1cm,
+ \c!topspace=1cm,
+ \c!width=\v!middle,
+ \c!height=\v!middle,
+ \c!header=0pt,
+ \c!footer=0pt]
+
+\setuplayout
+ [\c!backspace=2cm,
+ \c!topspace=1.5cm,
+ \c!header=0cm,
+ \c!footer=0cm,
+ \c!width=\v!middle,
+ \c!height=\v!middle]
+
+\setuppagenumbering
+ [\c!alternative=\v!doublesided]
+
+\setupsetup
+ [\c!criterium=\v!all,
+ \c!reference=0]
+
+\setupframedtexts
+ [setuptext]
+ [\c!frame=\v!on,
+ \c!rulethickness=1pt,
+ \c!framecolor=TitleColor]
+
+\setupunderbar
+ [\c!rulethickness=1pt,
+ \c!rulecolor=TitleColor]
+
+\starttext
+
+\setupbackgrounds
+ [\v!rightpage]
+ [\c!background=cover]
+
+\setuplayout
+ [titlepage]
+
+\startsetups text:commands
+ \startinterface dutch \strut commando's \par \stopinterface
+ \startinterface english \strut commands \par \stopinterface
+ \startinterface german \strut befehle \par \stopinterface
+ \startinterface french \strut commandes \par \stopinterface
+ \startinterface czech \strut p\v{r}ikazy \par \stopinterface
+ \startinterface italian \strut comandi \par \stopinterface
+ \startinterface romanian \strut comenzile \par \stopinterface
+\stopsetups
+
+\startsetups text:uppercase
+ \startinterface dutch NL\stopinterface
+ \startinterface english EN\stopinterface
+ \startinterface german DE\stopinterface
+ \startinterface french FR\stopinterface
+ \startinterface czech CS\stopinterface
+ \startinterface italian IT\stopinterface
+ \startinterface romanian RO\stopinterface
+\stopsetups
+
+\startsetups text:lowercase
+ \startinterface dutch \strut nl / nederlands \par \stopinterface
+ \startinterface english \strut en / english \par \stopinterface
+ \startinterface german \strut de / deutsch \par \stopinterface
+ \startinterface french \strut fr / fran\c{c}ais \par \stopinterface
+ \startinterface czech \strut cs / \v{c}esk\'y \par \stopinterface
+ \startinterface italian \strut it / italiano \par \stopinterface
+ \startinterface romanian \strut ro / rom\^{a}n\u{a} \par \stopinterface
+\stopsetups
+
+\startmakeup[\v!standard]
+ \dontcomplain
+ \setupalign[\v!left]
+ \startcolor[TitleColor]
+ \definedfont[RegularBold at 100pt]\setstrut
+ \strut Con\TeX t \par
+ \definedfont[RegularBold at 50pt]\setstrut
+ \setups[text:commands]
+ \vfill
+ \definedfont[RegularBold at 150pt]\setstrut
+ \setups[text:uppercase]
+ \stopcolor
+\stopmakeup
+
+\setuplayout % needed ?
+
+\setupbackgrounds
+ [\v!rightpage]
+ [\c!background=]
+
+\startmakeup[\v!standard]
+ \dontcomplain
+ \startcolor[TitleColor]
+ \definedfont[RegularBold at 100pt]\setstrut
+ \setupalign[\v!left]
+ \strut Con\TeX t \par
+ \definedfont[RegularBold at 50pt]\setstrut
+ \setups[text:commands]
+ \vfill
+ \definedfont[RegularBold at 24pt]\setupinterlinespace
+ \setups[text:lowercase]
+ \par \strut \currentdate \par
+ \stopcolor
+\stopmakeup
+
+\protect
+
+\placeeverysetup
+
+\unprotect
+
+\page[\v!yes,\v!blank,\v!right,\v!left]
+
+\setuplayout
+ [titlepage]
+
+\setupbackgrounds
+ [\v!leftpage]
+ [\c!background=back]
+
+\startmakeup[\v!standard][\c!page=]
+ \dontcomplain
+ \startcolor[TitleColor]
+ \definedfont[RegularBold at 24pt]\setupinterlinespace
+ \setupalign[\v!left]
+ \vfill
+ PRAGMA ADE \par
+ Ridderstraat 27 \par
+ 8061GH Hasselt NL \par
+ www.pragma-ade.com \par
+ \stopcolor
+\stopmakeup
+
+\protect
+
+\stoptext
diff --git a/tex/context/base/x-set-99.tex b/tex/context/base/x-set-99.tex
deleted file mode 100644
index 64d2b1db3..000000000
--- a/tex/context/base/x-set-99.tex
+++ /dev/null
@@ -1,283 +0,0 @@
-%D \module
-%D [ file=x-set-99,
-%D version=2004.10.31,
-%D remark=setupx.tex: 1998.07.20 and later,
-%D title=\CONTEXT\ Setup Definitions,
-%D subtitle=Macro Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% shared list
-
-\startmessages dutch library: setup
- title: setup
- formula: formule
- number: getal
- list: lijst
- dimension: maat
- mark: markering
- reference: verwijzing
- command: commando
- file: file
- name: naam
- identifier: naam
- text: tekst
- section: sectie
- singular: naam enkelvoud
- plural: naam meervoud
- matrix: n*m
- see: zie
- inherits: erft van
- 1: de karakters < en > zijn globaal actief!
- 2: -- wordt verwerkt
- 3: -- is niet gedefinieerd
- 4: -- wordt nogmaals verwerkt
- optional: optioneel
- displaymath: formule
- index: ingang
- math: formule
- nothing: leeg
- file: file
- position: positie
- reference: verwijzing
- csname: naam
- destination: bestemming
- triplet: triplet
- word: woord
- content: tekst
-\stopmessages
-
-\startmessages english library: setup
- title: setup
- formula: formula
- number: number
- list: list
- dimension: dimension
- mark: mark
- reference: reference
- command: command
- file: file
- name: name
- identifier: identifier
- text: text
- section: section
- singular: singular name
- plural: plural name
- matrix: n*m
- see: see
- inherits: inherits from
- 1: the characters < and > are globally active!
- 2: -- is processed
- 3: -- is undefined
- 4: -- is processed again
- optional: optional
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages german library: setup
- title: Setup
- formula: Formel
- number: Nummer
- list: Liste
- dimension: Dimension
- mark: Beschriftung
- reference: Referenz
- command: Befehl
- file: Datei
- name: Name
- identifier: Name
- text: Text
- section: Abschnitt
- singular: singular
- plural: plural
- matrix: n*m
- see: siehe
- inherits: inherits from
- 1: Die Zeichen < und > gelten global!
- 2: -- wird verarbeitet
- 3: -- ist undefiniert
- 4: -- ist mehrmals verarbeitet
- optional: optioneel
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages czech library: setup
- title: setup
- formula: rovnice
- number: cislo
- list: seznam
- dimension: dimenze
- mark: znacka
- reference: reference
- command: prikaz
- file: soubor
- name: jmeno
- identifier: jmeno
- text: text
- section: sekce
- singular: jmeno v singularu
- plural: jmeno v pluralu
- matrix: n*m
- see: viz
- inherits: inherits from
- 1: znaky < a > jsou globalne aktivni!
- 2: -- je zpracovano
- 3: -- je nedefinovano
- 4: -- je zpracovano znovu
- optional: optioneel
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages italian library: setup
- title: setup
- formula: formula
- number: number
- list: list
- dimension: dimension
- mark: mark
- reference: reference
- command: command
- file: file
- name: name
- identifier: name
- text: text
- section: section
- singular: singular name
- plural: plural name
- matrix: n*m
- see: see
- inherits: inherits from
- 1: the characters < and > are globally active!
- 2: -- is processed
- 3: -- is undefined
- 4: -- is processed again
- optional: optioneel
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages romanian library: setup
- title: setari
- formula: formula
- number: numar
- list: lista
- dimension: dimensiune
- mark: marcaj
- reference: referinta
- command: comanda
- file: fisier
- name: nume
- identifier: nume
- text: text
- section: sectiune
- singular: nume singular
- plural: nume pluram
- matrix: n*m
- see: vezi
- inherits: inherits from
- 1: caracterele < si > sunt active global!
- 2: este procesat --
- 3: -- este nedefinit
- 4: -- este procesat din nou
- optional: optioneel
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages french library: setup
- title: réglage
- formula: formule
- number: numéro
- list: liste
- dimension: dimension
- mark: marquage
- reference: reference
- command: commande
- file: fichier
- name: nom
- identifier: identificateur
- text: texte
- section: section
- singular: nom singulier
- plural: nom pluriel
- matrix: n*m
- see: vois
- inherits: herite de
- 1: les caractères < et > sont globalement actifs !
- 2: -- est traité
- 3: -- n'est pas défini
- 4: -- est traité de nouveau
- optional: optionel
- displaymath: formule
- index: entrée
- math: formule
- nothing: vide
- file: fichier
- position: position
- reference: réference
- csname: nom
- destination: destination
- triplet: triplet
- word: mot
- content: texte
-\stopmessages
-
-\endinput
diff --git a/tex/context/base/x-xtag.mkiv b/tex/context/base/x-xtag.mkiv
index 560e1b702..be593300c 100644
--- a/tex/context/base/x-xtag.mkiv
+++ b/tex/context/base/x-xtag.mkiv
@@ -16,13 +16,15 @@
\ifdefined\XMLbanner \endinput \fi
+\writestatus{xtag}{this module is obsolete, use the mkiv-xml features or use mkii instead}
+
\loadmarkfile{catc-xml}
-\loadcorefile{xtag-ini}
-\loadcorefile{xtag-ext}
-\loadcorefile{xtag-exp}
-\loadcorefile{xtag-pre} % has old encoding code
-\loadcorefile{xtag-xsd} % will go away (stub anyway)
-\loadcorefile{xtag-rng} % will go away (stub anyway)
+\loadcorefile{xtag-ini.mkii}
+\loadcorefile{xtag-ext.mkii}
+\loadcorefile{xtag-exp.mkii}
+\loadcorefile{xtag-pre.mkii} % has old encoding code
+\loadcorefile{xtag-xsd.mkii} % will go away (stub anyway)
+\loadcorefile{xtag-rng.mkii} % will go away (stub anyway)
\endinput
diff --git a/tex/context/base/xtag-cml.tex b/tex/context/base/xtag-cml.mkii
index 6da7fd26f..6da7fd26f 100644
--- a/tex/context/base/xtag-cml.tex
+++ b/tex/context/base/xtag-cml.mkii
diff --git a/tex/context/base/xtag-ent.tex b/tex/context/base/xtag-ent.mkii
index f4c3e4b06..f4c3e4b06 100644
--- a/tex/context/base/xtag-ent.tex
+++ b/tex/context/base/xtag-ent.mkii
diff --git a/tex/context/base/xtag-exp.tex b/tex/context/base/xtag-exp.mkii
index 337b49348..337b49348 100644
--- a/tex/context/base/xtag-exp.tex
+++ b/tex/context/base/xtag-exp.mkii
diff --git a/tex/context/base/xtag-ext.tex b/tex/context/base/xtag-ext.mkii
index 9a132c677..9a132c677 100644
--- a/tex/context/base/xtag-ext.tex
+++ b/tex/context/base/xtag-ext.mkii
diff --git a/tex/context/base/xtag-hyp.tex b/tex/context/base/xtag-hyp.mkii
index e4e048e2b..e4e048e2b 100644
--- a/tex/context/base/xtag-hyp.tex
+++ b/tex/context/base/xtag-hyp.mkii
diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.mkii
index 8da2ec3fb..85b481419 100644
--- a/tex/context/base/xtag-ini.tex
+++ b/tex/context/base/xtag-ini.mkii
@@ -2891,8 +2891,12 @@
{\doifundefined{\c!file\f!xtagprefix#1}
{\letvalue{\c!file\f!xtagprefix#1}\empty
\startreadingfile
- % will be \showmessage
- \readsysfile{\truefilename{\f!xtagprefix#1}}{\writestatus{xml}{loading module #1}}\donothing
+ % \truefilename removed
+ \readsysfile{\f!xtagprefix#1.mkii}
+ {\writestatus{xml}{loading module #1.mkii}}
+ {\readsysfile{\f!xtagprefix#1.tex}
+ {\writestatus{xml}{loading module #1.tex}}
+ \donothing}%
\stopreadingfile}}
%D Temporarily here.
diff --git a/tex/context/base/xtag-map.tex b/tex/context/base/xtag-map.mkii
index cbde4f1b1..cbde4f1b1 100644
--- a/tex/context/base/xtag-map.tex
+++ b/tex/context/base/xtag-map.mkii
diff --git a/tex/context/base/xtag-mea.tex b/tex/context/base/xtag-mea.mkii
index d56d6c54b..d56d6c54b 100644
--- a/tex/context/base/xtag-mea.tex
+++ b/tex/context/base/xtag-mea.mkii
diff --git a/tex/context/base/xtag-meb.tex b/tex/context/base/xtag-meb.mkii
index ba370cadf..ba370cadf 100644
--- a/tex/context/base/xtag-meb.tex
+++ b/tex/context/base/xtag-meb.mkii
diff --git a/tex/context/base/xtag-mec.tex b/tex/context/base/xtag-mec.mkii
index 9e941897c..9e941897c 100644
--- a/tex/context/base/xtag-mec.tex
+++ b/tex/context/base/xtag-mec.mkii
diff --git a/tex/context/base/xtag-meh.tex b/tex/context/base/xtag-meh.mkii
index 1636f2a2b..1636f2a2b 100644
--- a/tex/context/base/xtag-meh.tex
+++ b/tex/context/base/xtag-meh.mkii
diff --git a/tex/context/base/xtag-men.tex b/tex/context/base/xtag-men.mkii
index d548c8394..d548c8394 100644
--- a/tex/context/base/xtag-men.tex
+++ b/tex/context/base/xtag-men.mkii
diff --git a/tex/context/base/xtag-meo.tex b/tex/context/base/xtag-meo.mkii
index f19f80fbe..f19f80fbe 100644
--- a/tex/context/base/xtag-meo.tex
+++ b/tex/context/base/xtag-meo.mkii
diff --git a/tex/context/base/xtag-mer.tex b/tex/context/base/xtag-mer.mkii
index becff584a..becff584a 100644
--- a/tex/context/base/xtag-mer.tex
+++ b/tex/context/base/xtag-mer.mkii
diff --git a/tex/context/base/xtag-mmc.tex b/tex/context/base/xtag-mmc.mkii
index 27e2c42ea..27e2c42ea 100644
--- a/tex/context/base/xtag-mmc.tex
+++ b/tex/context/base/xtag-mmc.mkii
diff --git a/tex/context/base/xtag-mml.tex b/tex/context/base/xtag-mml.mkii
index 051d15b00..051d15b00 100644
--- a/tex/context/base/xtag-mml.tex
+++ b/tex/context/base/xtag-mml.mkii
diff --git a/tex/context/base/xtag-mmp.tex b/tex/context/base/xtag-mmp.mkii
index 75167c9e9..75167c9e9 100644
--- a/tex/context/base/xtag-mmp.tex
+++ b/tex/context/base/xtag-mmp.mkii
diff --git a/tex/context/base/xtag-mxa.tex b/tex/context/base/xtag-mxa.mkii
index 5e83367df..5e83367df 100644
--- a/tex/context/base/xtag-mxa.tex
+++ b/tex/context/base/xtag-mxa.mkii
diff --git a/tex/context/base/xtag-mxb.tex b/tex/context/base/xtag-mxb.mkii
index c325a9e44..c325a9e44 100644
--- a/tex/context/base/xtag-mxb.tex
+++ b/tex/context/base/xtag-mxb.mkii
diff --git a/tex/context/base/xtag-mxc.tex b/tex/context/base/xtag-mxc.mkii
index e692f2a24..e692f2a24 100644
--- a/tex/context/base/xtag-mxc.tex
+++ b/tex/context/base/xtag-mxc.mkii
diff --git a/tex/context/base/xtag-mxh.tex b/tex/context/base/xtag-mxh.mkii
index 3cf0103c8..3cf0103c8 100644
--- a/tex/context/base/xtag-mxh.tex
+++ b/tex/context/base/xtag-mxh.mkii
diff --git a/tex/context/base/xtag-mxn.tex b/tex/context/base/xtag-mxn.mkii
index 35eeade9a..35eeade9a 100644
--- a/tex/context/base/xtag-mxn.tex
+++ b/tex/context/base/xtag-mxn.mkii
diff --git a/tex/context/base/xtag-mxo.tex b/tex/context/base/xtag-mxo.mkii
index 045b4f406..045b4f406 100644
--- a/tex/context/base/xtag-mxo.tex
+++ b/tex/context/base/xtag-mxo.mkii
diff --git a/tex/context/base/xtag-mxr.tex b/tex/context/base/xtag-mxr.mkii
index ed1498f81..ed1498f81 100644
--- a/tex/context/base/xtag-mxr.tex
+++ b/tex/context/base/xtag-mxr.mkii
diff --git a/tex/context/base/xtag-pml.tex b/tex/context/base/xtag-pml.mkii
index 53d22c52a..53d22c52a 100644
--- a/tex/context/base/xtag-pml.tex
+++ b/tex/context/base/xtag-pml.mkii
diff --git a/tex/context/base/xtag-pmu.tex b/tex/context/base/xtag-pmu.mkii
index b913475f5..b913475f5 100644
--- a/tex/context/base/xtag-pmu.tex
+++ b/tex/context/base/xtag-pmu.mkii
diff --git a/tex/context/base/xtag-pre.tex b/tex/context/base/xtag-pre.mkii
index 94a213d94..94a213d94 100644
--- a/tex/context/base/xtag-pre.tex
+++ b/tex/context/base/xtag-pre.mkii
diff --git a/tex/context/base/xtag-prs.tex b/tex/context/base/xtag-prs.mkii
index 02bdcf21c..02bdcf21c 100644
--- a/tex/context/base/xtag-prs.tex
+++ b/tex/context/base/xtag-prs.mkii
diff --git a/tex/context/base/xtag-raw.tex b/tex/context/base/xtag-raw.mkii
index e6dfdea41..e6dfdea41 100644
--- a/tex/context/base/xtag-raw.tex
+++ b/tex/context/base/xtag-raw.mkii
diff --git a/tex/context/base/xtag-rng.tex b/tex/context/base/xtag-rng.mkii
index 254282424..254282424 100644
--- a/tex/context/base/xtag-rng.tex
+++ b/tex/context/base/xtag-rng.mkii
diff --git a/tex/context/base/xtag-run.tex b/tex/context/base/xtag-run.mkii
index 035268104..035268104 100644
--- a/tex/context/base/xtag-run.tex
+++ b/tex/context/base/xtag-run.mkii
diff --git a/tex/context/base/xtag-stk.tex b/tex/context/base/xtag-stk.mkii
index e126ae5c7..e126ae5c7 100644
--- a/tex/context/base/xtag-stk.tex
+++ b/tex/context/base/xtag-stk.mkii
diff --git a/tex/context/base/xtag-utf.tex b/tex/context/base/xtag-utf.mkii
index fec84d279..fec84d279 100644
--- a/tex/context/base/xtag-utf.tex
+++ b/tex/context/base/xtag-utf.mkii
diff --git a/tex/context/base/xtag-xsd.tex b/tex/context/base/xtag-xsd.mkii
index 96169afa2..96169afa2 100644
--- a/tex/context/base/xtag-xsd.tex
+++ b/tex/context/base/xtag-xsd.mkii
diff --git a/tex/context/base/xtag-xsl.tex b/tex/context/base/xtag-xsl.mkii
index 3ad096c28..3ad096c28 100644
--- a/tex/context/base/xtag-xsl.tex
+++ b/tex/context/base/xtag-xsl.mkii
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index 69a2b3e8c..cb61067af 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 01/24/11 10:00:19
+-- merge date : 01/24/11 23:51:55
do -- begin closure to overcome local limits and interference