summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkxl2
-rw-r--r--tex/context/base/mkiv/export-example.css50
-rw-r--r--tex/context/base/mkiv/font-sel.lua54
-rw-r--r--tex/context/base/mkiv/lpdf-fld.lua30
-rw-r--r--tex/context/base/mkiv/lxml-aux.lua48
-rw-r--r--tex/context/base/mkiv/lxml-lpt.lua2
-rw-r--r--tex/context/base/mkiv/lxml-tab.lua15
-rw-r--r--tex/context/base/mkiv/mlib-lmp.lua3
-rw-r--r--tex/context/base/mkiv/mlib-svg.lua63
-rw-r--r--tex/context/base/mkiv/mult-prm.lua6
-rw-r--r--tex/context/base/mkiv/node-fnt.lua51
-rw-r--r--tex/context/base/mkiv/pack-com.mkiv2
-rw-r--r--tex/context/base/mkiv/pack-rul.mkiv2
-rw-r--r--tex/context/base/mkiv/pack-rul.mkxl4
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin28109 -> 28096 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin271171 -> 269645 bytes
-rw-r--r--tex/context/base/mkiv/syst-ini.mkiv6
-rw-r--r--tex/context/base/mkiv/syst-ini.mkxl6
-rw-r--r--tex/context/base/mkiv/tabl-ntb.mkiv6
-rw-r--r--tex/context/base/mkiv/tabl-ntb.mkxl3
-rw-r--r--tex/context/modules/mkiv/m-examn.mkiv577
-rw-r--r--tex/context/modules/mkiv/m-scite.mkiv26
-rw-r--r--tex/context/sample/common/cuomo.tex17
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
28 files changed, 826 insertions, 157 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 5c13c209d..437048dc3 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2020.03.10 14:44}
+\newcontextversion{2020.03.26 21:46}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index db1940639..49cb4a154 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.03.10 14:44}
+\edef\contextversion{2020.03.26 21:46}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 7d76e05de..ce1e83666 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2020.03.10 14:44}
+\newcontextversion{2020.03.26 21:46}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index ff4c7f6c6..bdc605cbe 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.03.10 14:44}
+\edef\contextversion{2020.03.26 21:46}
\edef\contextkind {beta}
%D Kind of special:
diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl
index 13e6a100b..42b3d63ba 100644
--- a/tex/context/base/mkiv/context.mkxl
+++ b/tex/context/base/mkiv/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.03.10 14:44}
+\edef\contextversion{2020.03.26 21:46}
\edef\contextkind {beta}
%D Kind of special:
diff --git a/tex/context/base/mkiv/export-example.css b/tex/context/base/mkiv/export-example.css
index 19a2a071e..096408ee1 100644
--- a/tex/context/base/mkiv/export-example.css
+++ b/tex/context/base/mkiv/export-example.css
@@ -405,7 +405,7 @@ context|div.item {
}
itemtag,
-context|div.item {
+context|div.itemtag {
display: none ;
}
@@ -546,44 +546,61 @@ context|div.registerlocation:after {
/* tablerow : display */
/* tablecell : mixed */
+/* we have a few bonus mappings here */
+
table,
context|div.table {
display : table ;
}
-tablerow,
-context|div.tablerow {
+tablerow, tr
+context|div.tablerow, context|div.tr {
display : table-row ;
}
-tablecell[align="middle"],
+tablecell[align="middle"], td[align="middle"],
context|div.tablecell.align-middle {
display : table-cell ;
text-align : center ;
padding : .1em ;
}
-tablecell[align="flushleft"],
+tablecell[align="flushleft"], td[align="flushleft"],
context|div.tablecell.align-flushleft {
display : table-cell ;
text-align : left ;
padding : .1em ;
}
-tablecell[align="flushright"],
+tablecell[align="flushright"], td[align="flushright"],
context|div.tablecell.align-flushright {
display : table-cell ;
text-align : right ;
padding : .1em ;
}
-tablecell,
-context|div.tablecell {
+tablecell, td
+context|div.tablecell, context|div.td {
display : table-cell ;
text-align : left ;
padding : .1em ;
}
+tablehead,
+div.thead, div.tableheader {
+ display : table-header-group ;
+}
+
+tablefoot,
+div.tfoot, div.tablefooter {
+ display : table-footer-group ;
+}
+
+tablebody,
+div.tbody, div.tablebody {
+ display : table-body-group ;
+}
+
/* tabulate : display */
/* tabulaterow : display */
/* tabulatecell : mixed */
@@ -648,6 +665,13 @@ context|div.tabulatecell.kind-equals:before {
content : ":" ;
}
+/*
+
+ A combination needs some processing because it is not a table yet. So, the next
+ mapping is just one row! The tags are a bit confusing now.
+
+*/
+
/* combination : display */
/* combinationpair : display */
/* combinationcontent : mixed */
@@ -660,8 +684,8 @@ context|div.combination {
margin-bottom : 0em ;
}
-combinationpair,
-context|div.combinationpair {
+combinationpair, combinationtext,
+context|div.combinationpair, context|div.combinationtext {
display : table-cell ;
padding-right : 1em ;
}
@@ -727,7 +751,7 @@ context|div.listitem.subsection context|div.listtag {
*/
listitem[detail="chapter"]>listtag,
-context|div.listitem.chapter context|div.listtag {
+context|div.listitem.chapter > context|div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -735,7 +759,7 @@ context|div.listitem.chapter context|div.listtag {
}
listitem[detail="section"]>listtag,
-context|div.listitem.section context|div.listtag {
+context|div.listitem.section > context|div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -743,7 +767,7 @@ context|div.listitem.section context|div.listtag {
}
listitem[detail="subsection"]>listtag,
-context|div.listitem.subsection context|div.listtag {
+context|div.listitem.subsection > context|div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
diff --git a/tex/context/base/mkiv/font-sel.lua b/tex/context/base/mkiv/font-sel.lua
index 15d3838f6..9a611f9fa 100644
--- a/tex/context/base/mkiv/font-sel.lua
+++ b/tex/context/base/mkiv/font-sel.lua
@@ -96,7 +96,7 @@ extras["features"] = function(data,alternative,features)
local e = gsub(gsub(features,"*",d),"{(.*)}","%1")
local f = data.features
if trace_features then
- report_features("Alternative '%s': Saving features '%s'",alternative,e)
+ report_features("alternative '%s': saving features '%s'",alternative,e)
end
if not f then
f = { }
@@ -109,7 +109,7 @@ extras["goodies"] = function(data,alternative,goodies)
local e = gsub(goodies,"{(.*)}","%1")
local g = data.goodies
if trace_goodies then
- report_goodies("Alternative '%s': Saving goodies '%s'",alternative,e)
+ report_goodies("alternative '%s': saving goodies '%s'",alternative,e)
end
if not g then
g = { }
@@ -137,7 +137,7 @@ local function selectfont_savefile(data,alternative,bodyfontsize,size,file)
end
a[bodyfontsize] = { size, n }
if trace_files then
- report_files("Alternative '%s': Saving file '%s' for size '%s'",alternative,n,size)
+ report_files("alternative '%s': saving file '%s' for size '%s'",alternative,n,size)
end
end
@@ -145,7 +145,7 @@ methods["name"] = function(data,alternative,name)
local family = data.metadata.family
local filename = cleanname(gsub(name,"*",family))
if trace_alternatives then
- report_selectfont("Alternative '%s': Using method 'name' with argument '%s'",alternative,filename)
+ report_selectfont("alternative '%s': using method 'name' with argument '%s'",alternative,filename)
end
local fontname = getlookups{ fontname = filename }
local fullname = getlookups{ fullname = filename }
@@ -155,7 +155,7 @@ methods["name"] = function(data,alternative,name)
selectfont_savefile(data,alternative,0,"default",fullname[1])
else
if trace_alternatives then
- report_selectfont("Alternative '%s': No font was found for the requested name '%s'",alternative,filename)
+ report_selectfont("alternative '%s': no font was found for the requested name '%s'",alternative,filename)
end
end
end
@@ -164,14 +164,14 @@ methods["file"] = function(data,alternative,file)
local family = data.metadata.family
local filename = cleanname(gsub(removesuffix(file),"*",family))
if trace_alternatives then
- report_selectfont("Alternative '%s': Using method 'file' with argument '%s'",alternative,filename)
+ report_selectfont("alternative '%s': using method 'file' with argument '%s'",alternative,filename)
end
local filename = getlookups{ cleanfilename = cleanname(filename) }
if #filename > 0 then
selectfont_savefile(data,alternative,0,"default",filename[1])
else
if trace_alternatives then
- report_selectfont("Alternative '%s': No font was found for the requested file '%s'",alternative,cleanname(gsub(removesuffix(file),"*",family)))
+ report_selectfont("alternative '%s': no font was found for the requested file '%s'",alternative,cleanname(gsub(removesuffix(file),"*",family)))
end
end
end
@@ -243,7 +243,7 @@ local function m_style_family(family)
return family
elseif #fontname > 0 then
local fontfamily = fontname[1]["familyname"]
- report_selectfont("The name '%s' is not a proper family name, use '%s' instead.",askedname,fontfamily)
+ report_selectfont("the name '%s' is not a proper family name, use '%s' instead.",askedname,fontfamily)
return nil
else
return nil
@@ -353,7 +353,7 @@ local function m_style_size(data,alternative,entries)
end
else
if trace_alternatives then
- report_selectfont("Alternative '%s': Multiple files are available for the requested style '%s' from '%s'",alternative,style,family)
+ report_selectfont("alternative '%s': multiple files are available for the requested style '%s' from '%s'",alternative,style,family)
end
end
end
@@ -386,7 +386,7 @@ methods["style"] = function(data,alternative,style)
m_style_size(data,alternative,entries)
else
if trace_alternatives then
- report_selectfont("Alternative '%s': No font was found for the requested style '%s' from '%s'",alternative,style,family)
+ report_selectfont("alternative '%s': no font was found for the requested style '%s' from '%s'",alternative,style,family)
end
end
end
@@ -394,21 +394,21 @@ end
methods[v_default] = function(data,alternative)
local family = data.metadata.family
if trace_alternatives then
- report_selectfont("Alternative '%s': Using method 'default'",alternative)
+ report_selectfont("alternative '%s': using method 'default'",alternative)
end
local result = getlookups{ familyname = cleanname(family) }
if #result == 1 and alternative == "tf" then
if trace_alternatives then
- report_selectfont("Alternative '%s': The family '%s' contains only one font",alternative,family)
+ report_selectfont("alternative '%s': the family '%s' contains only one font",alternative,family)
end
selectfont_savefile(data,alternative,0,"default",result[1])
-- if trace_alternatives then
- -- report_selectfont("Alternative '%s': Changing method 'default' to method 'style'",alternative)
+ -- report_selectfont("alternative '%s': changing method 'default' to method 'style'",alternative)
-- end
-- methods["file"](data,alternative,result[1]["filename"])
else
if trace_alternatives then
- report_selectfont("Alternative '%s': Changing method 'default' to method 'style'",alternative)
+ report_selectfont("alternative '%s': changing method 'default' to method 'style'",alternative)
end
methods["style"](data,alternative,alternative)
end
@@ -478,7 +478,7 @@ function selectfont.registerfontalternative(alternative)
local a = alternatives[alternative]
if not a then
if trace_register then
- report_selectfont("Register alternative '%s'",alternative)
+ report_selectfont("register alternative '%s'",alternative)
end
a = true
alternatives[alternative] = a
@@ -598,23 +598,23 @@ function selectfont.fontsynonym(data,class,style,alternative,index)
local fontfallback = formatters["fallback-%s-%s-%s"](fontclass,style,alternative)
for _, fontsize in next, fontsizes do
-- if trace_typescript then
- -- report_typescript("Synonym: '%s', Size: '%s', File: '%s'",fontfile,fontfiles[fontsize][1],fontfiles[fontsize][2])
+ -- report_typescript("synonym: '%s', size: '%s', file: '%s'",fontfile,fontfiles[fontsize][1],fontfiles[fontsize][2])
-- end
registerdesignsizes(fontfile,fontfiles[fontsize][1],fontfiles[fontsize][2])
end
if fallback then
-- if trace_typescript then
- -- report_typescript("Synonym: '%s', File: '%s', Features: '%s'",fontsynonym,fontfile,fontfeature)
+ -- report_typescript("synonym: '%s', file: '%s', features: '%s'",fontsynonym,fontfile,fontfeature)
-- end
ctx_definefontsynonym( { fontsynonym }, { fontfile }, { features = fontfeature } )
else
-- if trace_typescript then
- -- report_typescript("Synonym: '%s', File: '%s', Features: '%s', Goodies: '%s', Fallbacks: '%s'",fontsynonym,fontfile,fontfeature,fontgoodie,fontfallback)
+ -- report_typescript("synonym: '%s', file: '%s', features: '%s', goodies: '%s', fallbacks: '%s'",fontsynonym,fontfile,fontfeature,fontgoodie,fontfallback)
-- end
ctx_definefontsynonym( { fontsynonym }, { fontfile }, { features = fontfeature, goodies = fontgoodie, fallbacks = fontfallback } )
if synonym then
-- if trace_typescript then
- -- report_typescript("Synonym: '%s', File: '%s'",synonym,fontsynonym)
+ -- report_typescript("synonym: '%s', file: '%s'",synonym,fontsynonym)
-- end
ctx_definefontsynonym( { synonym }, { fontsynonym } )
end
@@ -628,13 +628,13 @@ function selectfont.fontfallback(data,class,style,alternative,index)
local force = data.options.force ~= "" and data.options.force or ""
local fontfeature = data.features and data.features[alternative] or data.options.features
local fontclass = lower(class)
- local fontsynonym = formatters ["synonym-%s-%s-%s-%s"](fontclass,style,alternative,index)
- local fontfallback = formatters["fallback-%s-%s-%s"] (fontclass,style,alternative)
+ local fontsynonym = formatters["synonym-%s-%s-%s-%s"](fontclass,style,alternative,index)
+ local fontfallback = formatters["fallback-%s-%s-%s"] (fontclass,style,alternative)
if index == 1 then
ctx_resetfontfallback( { fontfallback } )
end
-- if trace_typescript then
- -- report_typescript("Fallback: '%s', Synonym: '%s', Range: '%s', Scale: '%s', Check: '%s', Force: '%s'",fontfallback,fontsynonym,range,scale,check,force)
+ -- report_typescript("fallback: '%s', synonym: '%s', range: '%s', scale: '%s', check: '%s', force: '%s'",fontfallback,fontsynonym,range,scale,check,force)
-- end
ctx_definefontfallback( { fontfallback }, { fontsynonym }, { range }, { rscale = scale, check = check, force = force } )
end
@@ -653,7 +653,7 @@ function selectfont.filefallback(data,class,style,alternative,index)
ctx_resetfontfallback( { fontfallback } )
end
-- if trace_typescript then
- -- report_typescript("Fallback: '%s', File: '%s', Features: '%s', Range: '%s', Scale: '%s', Check: '%s', Force: '%s', Offset: '%s'",fontfallback,fontfile[2],fontfeature,range,scale,check,force,offset)
+ -- report_typescript("fallback: '%s', file: '%s', features: '%s', range: '%s', scale: '%s', check: '%s', force: '%s', offset: '%s'",fontfallback,fontfile[2],fontfeature,range,scale,check,force,offset)
-- end
ctx_definefontfallback( { fontfallback }, { formatters["file:%s*%s"](fontfile[2],fontfeature) }, { range }, { rscale = scale, check = check, force = force, offset = offset } )
end
@@ -737,7 +737,7 @@ function selectfont.bodyfont(data)
fontsynonym = formatters["synonym-%s-%s-%s"](fontclass,fontstyle,alternative)
fontlist[#fontlist+1] = formatters["%s=%s sa 1"] (alternative,fontsynonym)
-- if trace_typescript then
- -- report_typescript("Alternative '%s': Synonym '%s'",alternative,fontsynonym)
+ -- report_typescript("alternative '%s': synonym '%s'",alternative,fontsynonym)
-- end
end
fontlist = concat(fontlist,",")
@@ -760,7 +760,7 @@ function selectfont.typeface(data)
local size = data.options.designsize ~= "" and data.options.designsize or "default"
local scale = data.options.rscale ~= "" and data.options.rscale or 1
-- if trace_typescript then
- -- report_typescript("Class: '%s', Style: '%s', Size: '%s', Scale: '%s'",fontclass,fontstyle,size,scale)
+ -- report_typescript("class: '%s', style: '%s', size: '%s', scale: '%s'",fontclass,fontstyle,size,scale)
-- end
ctx_definetypeface( { fontclass }, { fontstyle }, { style }, { "" }, { "default" }, { designsize = size, rscale = scale } )
end
@@ -770,7 +770,7 @@ function selectfont.default(data)
local fontclass = data.metadata.typeface
local fontstyle = data.metadata.style
local style = m_style[fontstyle]
- report_selectfont("The requested font '%s' has no files for the 'tf' alternative, Latin Modern is used instead.",family)
+ report_selectfont("the requested font '%s' has no files for the 'tf' alternative, Latin Modern is used instead.",family)
ctx_definetypeface( { fontclass }, { fontstyle }, { style }, { "modern" }, { "default" } )
end
@@ -799,7 +799,7 @@ function selectfont.definefallbackfamily(index)
if fontfiles then
selectfont.registerfallback(index)
else
- report_selectfont("The requested fallback font '%s' for typeface '%s' style '%s' was ignored because no files where found.",family,fontclass,fontstyle)
+ report_selectfont("the requested fallback font '%s' for typeface '%s' style '%s' was ignored because no files where found.",family,fontclass,fontstyle)
end
end
diff --git a/tex/context/base/mkiv/lpdf-fld.lua b/tex/context/base/mkiv/lpdf-fld.lua
index e5a95fdab..e14968eb8 100644
--- a/tex/context/base/mkiv/lpdf-fld.lua
+++ b/tex/context/base/mkiv/lpdf-fld.lua
@@ -1003,17 +1003,17 @@ function nodeinjections.typesetfield(name,specification)
end
end
-local function save_parent(field,specification,d,hasopt)
+local function save_parent(field,specification,d)
local kidsnum = pdfreserveobject()
d.Kids = pdfreference(kidsnum)
field.kidsnum = kidsnum
field.kids = pdfarray()
- if hasopt then
- local optnum = pdfreserveobject()
- d.Opt = pdfreference(optnum)
- field.optnum = optnum
- field.opt = pdfarray()
- end
+-- if d.Opt then
+-- local optnum = pdfreserveobject()
+-- d.Opt = pdfreference(optnum)
+-- field.optnum = optnum
+-- field.opt = pdfarray()
+-- end
local pnum = pdfflushobject(d)
field.pobj = pnum
collected[#collected+1] = pdfreference(pnum)
@@ -1022,12 +1022,12 @@ end
local function save_kid(field,specification,d,optname)
local kn = pdfreserveobject()
field.kids[#field.kids+1] = pdfreference(kn)
- if optname then
- local opt = field.opt
- if opt then
- opt[#opt+1] = optname
- end
- end
+-- if optname then
+-- local opt = field.opt
+-- if opt then
+-- opt[#opt+1] = optname
+-- end
+-- end
local width = specification.width or 0
local height = specification.height or 0
local depth = specification.depth or 0
@@ -1243,7 +1243,7 @@ local function makecheckparent(field,specification)
FT = pdf_btn,
V = fielddefault(field,default),
}
- save_parent(field,specification,d,true)
+ save_parent(field,specification,d)
end
local function makecheckchild(name,specification)
@@ -1371,7 +1371,7 @@ local function makeradioparent(field,specification)
-- H = pdf_n,
V = fielddefault(field),
}
- save_parent(field,specification,d,true)
+ save_parent(field,specification,d)
end
-- local function makeradiochild(name,specification)
diff --git a/tex/context/base/mkiv/lxml-aux.lua b/tex/context/base/mkiv/lxml-aux.lua
index ed0f03fd8..67ee31c88 100644
--- a/tex/context/base/mkiv/lxml-aux.lua
+++ b/tex/context/base/mkiv/lxml-aux.lua
@@ -176,7 +176,7 @@ local function xmltoelement(whatever,root)
end
local element
if type(whatever) == "string" then
- element = xmlinheritedconvert(whatever,root) -- beware, not really a root
+ element = xmlinheritedconvert(whatever,root,true) -- beware, not really a root
else
element = whatever -- we assume a table
end
@@ -430,10 +430,10 @@ local function include(xmldata,pattern,attribute,recursive,loaddata,level)
-- for the moment hard coded
epdt[ek.ni] = xml.escaped(data) -- d[k] = xml.escaped(data)
else
-local settings = xmldata.settings
-local savedresource = settings.currentresource
-settings.currentresource = name
- local xi = xmlinheritedconvert(data,xmldata)
+ local settings = xmldata.settings
+ local savedresource = settings.currentresource
+ settings.currentresource = name
+ local xi = xmlinheritedconvert(data,xmldata,true)
if not xi then
epdt[ek.ni] = "" -- xml.empty(d,k)
else
@@ -443,7 +443,7 @@ settings.currentresource = name
local child = xml.body(xi) -- xml.assign(d,k,xi)
child.__p__ = ekrt
child.__f__ = name -- handy for tracing
-child.cf = name
+ child.cf = name
epdt[ek.ni] = child
local settings = xmldata.settings
local inclusions = settings and settings.inclusions
@@ -591,8 +591,44 @@ function xml.strip(root,pattern,nolines,anywhere) -- strips all leading and trai
stripelement(collected[i],nolines,anywhere)
end
end
+-- return root
end
+-- local function compactelement(e)
+-- local edt = e.dt
+-- if edt then
+-- local t = { }
+-- local m = 0
+-- for e=1,#edt do
+-- local str = edt[e]
+-- if type(str) ~= "string" then
+-- m = m + 1
+-- t[m] = str
+-- elseif str ~= "" and find(str,"%S") then
+-- m = m + 1
+-- t[m] = str
+-- end
+-- end
+-- e.dt = t
+-- end
+-- return e -- convenient
+-- end
+
+local function compactelement(e)
+ local edt = e.dt
+ if edt then
+ for e=1,#edt do
+ local str = edt[e]
+ if type(str) == "string" and not find(str,"%S") then
+ edt[e] = ""
+ end
+ end
+ end
+ return e -- convenient
+end
+
+xml.compactelement = compactelement
+
local function renamespace(root, oldspace, newspace) -- fast variant
local ndt = #root.dt
for i=1,ndt or 0 do
diff --git a/tex/context/base/mkiv/lxml-lpt.lua b/tex/context/base/mkiv/lxml-lpt.lua
index 5bcdfbabc..dc9964d0f 100644
--- a/tex/context/base/mkiv/lxml-lpt.lua
+++ b/tex/context/base/mkiv/lxml-lpt.lua
@@ -1317,6 +1317,8 @@ end
-- return false
-- end
+-- could be a hashed hash
+
expressions.oneof = function(s,...)
for i=1,select("#",...) do
if s == select(i,...) then
diff --git a/tex/context/base/mkiv/lxml-tab.lua b/tex/context/base/mkiv/lxml-tab.lua
index 8f6379f2f..1ef82d74d 100644
--- a/tex/context/base/mkiv/lxml-tab.lua
+++ b/tex/context/base/mkiv/lxml-tab.lua
@@ -1292,13 +1292,26 @@ end
xml.convert = xmlconvert
-function xml.inheritedconvert(data,xmldata) -- xmldata is parent
+function xml.inheritedconvert(data,xmldata,cleanup) -- xmldata is parent
local settings = xmldata.settings
if settings then
settings.parent_root = xmldata -- to be tested
end
-- settings.no_root = true
local xc = xmlconvert(data,settings) -- hm, we might need to locate settings
+ if cleanup then
+ local x = xc.dt
+ if x then
+ x = x[1]
+ if x and x.tg == "@pi@" then
+ local dt = x.dt
+ local pi = dt and dt[1]
+ if type(pi) == "string" and find(pi,"^xml") then
+ remove(dt,1)
+ end
+ end
+ end
+ end
-- xc.settings = nil
-- xc.entities = nil
-- xc.special = nil
diff --git a/tex/context/base/mkiv/mlib-lmp.lua b/tex/context/base/mkiv/mlib-lmp.lua
index f000f4282..cf7862d91 100644
--- a/tex/context/base/mkiv/mlib-lmp.lua
+++ b/tex/context/base/mkiv/mlib-lmp.lua
@@ -171,6 +171,7 @@ if CONTEXTLMTXMODE > 0 then
data = io.loaddata(filename),
remap = true,
colormap = colormap,
+ id = filename,
} )
else
local buffer = metapost.getparameter { "buffer" }
@@ -179,6 +180,7 @@ if CONTEXTLMTXMODE > 0 then
data = buffers.getcontent(buffer),
-- remap = true,
colormap = colormap,
+ id = buffer or "buffer",
} )
else
local code = metapost.getparameter { "code" }
@@ -186,6 +188,7 @@ if CONTEXTLMTXMODE > 0 then
mpdirect ( metapost.svgtomp {
data = code,
colormap = colormap,
+ id = "code",
} )
end
end
diff --git a/tex/context/base/mkiv/mlib-svg.lua b/tex/context/base/mkiv/mlib-svg.lua
index 3d15840a7..9fd1da44e 100644
--- a/tex/context/base/mkiv/mlib-svg.lua
+++ b/tex/context/base/mkiv/mlib-svg.lua
@@ -80,7 +80,7 @@ local rawget, rawset, type, tonumber, tostring, next, setmetatable = rawget, raw
local P, S, R, C, Ct, Cs, Cc, Cp, Cg, Cf, Carg = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Cc, lpeg.Cp, lpeg.Cg, lpeg.Cf, lpeg.Carg
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
-local sqrt = math.sqrt
+local sqrt, abs = math.sqrt, math.abs
local concat, setmetatableindex, sortedhash = table.concat, table.setmetatableindex, table.sortedhash
local gmatch, gsub, find, match, rep = string.gmatch, string.gsub, string.find, string.match, string.rep
local formatters, fullstrip = string.formatters, string.fullstrip
@@ -122,6 +122,7 @@ local trace = false trackers.register("metapost.svg", function(v)
local trace_text = false trackers.register("metapost.svg.text", function(v) trace_text = v end)
local trace_path = false trackers.register("metapost.svg.path", function(v) trace_path = v end)
local trace_result = false trackers.register("metapost.svg.result", function(v) trace_result = v end)
+local trace_colors = false trackers.register("metapost.svg.colors", function(v) trace_colors = v end)
local pathtracer = {
["stroke"] = "darkred",
@@ -428,7 +429,7 @@ end
-- todo: cache colors per image / remapper
-local colorcomponents, withcolor, thecolor do
+local colorcomponents, withcolor, thecolor, usedcolors do
local svgcolors = {
aliceblue = 0xF0F8FF, antiquewhite = 0xFAEBD7, aqua = 0x00FFFF, aquamarine = 0x7FFFD4,
@@ -476,7 +477,7 @@ local colorcomponents, withcolor, thecolor do
local f_rgba = formatters['withcolor svgcolor(%.3N,%.3N,%.3N) withtransparency (1,%.3N)']
local f_graya = formatters['withcolor svggray(%.3N) withtransparency (1,%.3N)']
local f_name = formatters['withcolor "%s"']
- local f_svgcolor = formatters['svgcolor(%.3N,%.3N,%.3N)']
+ local f_svgrgb = formatters['svgcolor(%.3N,%.3N,%.3N)']
local f_svgcmyk = formatters['svgcmyk(%.3N,%.3N,%.3N,%.3N)']
local f_svggray = formatters['svggray(%.3N)']
local f_svgname = formatters['"%s"']
@@ -510,7 +511,7 @@ local colorcomponents, withcolor, thecolor do
* p_separator^0 * p_absolute^0
* p_right
- local colors = attributes.colors
+ local colors = attributes.colors
local colorvalues = colors.values
local colorindex = attributes.list[attributes.private('color')]
local hsvtorgb = colors.hsvtorgb
@@ -559,7 +560,6 @@ local colorcomponents, withcolor, thecolor do
end
end
-
local function registeredcolor(name)
local color = colorindex[name]
if color then
@@ -580,6 +580,9 @@ local colorcomponents, withcolor, thecolor do
-- we can have a fast check for #000000
local function validcolor(color)
+ if usedcolors then
+ usedcolors[color] = usedcolors[color] + 1
+ end
if colormap then
local c = colormap[color]
local t = type(c)
@@ -1920,7 +1923,7 @@ do
--
-- todo: combine more (offset+scale+rotation)
- local function makemarker(where,c,x1,y1,x2,y2,x3,y3)
+ local function makemarker(where,c,x1,y1,x2,y2,x3,y3,parentat)
local at = c.at
local refx = rawget(at,"refX")
local refy = rawget(at,"refY")
@@ -1929,8 +1932,8 @@ do
local view = rawget(at,"viewBox")
local orient = rawget(at,"orient")
-- local ratio = rawget(at,"preserveAspectRatio")
- local units = at["markerUnits"]
- local height = at["markerHeight"]
+ local units = asnumber(at["markerUnits"] or parentat["stroke-width"]) or 1
+
local angx = 0
local angy = 0
local angle = 0
@@ -1938,38 +1941,33 @@ do
if where == "beg" then
if orient == "auto" then -- unchecked
-- no angle
- angx = x2 - x3
- angy = y2 - y3
+ angx = abs(x2 - x3)
+ angy = abs(y2 - y3)
elseif orient == "auto-start-reverse" then -- checked
-- points to start
- angx = x3 - x2
- angy = y3 - y2
+ angx = -abs(x2 - x3)
+ angy = -abs(y2 - y3)
elseif orient then -- unchecked
angle = asnumber_r(orient)
end
elseif where == "end" then
- if orient == "auto" then -- unchecked
- -- no angle ?
- angx = x1 - x2
- angy = y1 - y2
- elseif orient == "auto-start-reverse" then -- unchecked
- -- points to end
- angx = x2 - x1
- angy = y2 - y1
+ -- funny standard .. bug turned feature?
+ if orient == "auto" or orient == "auto-start-reverse" then
+ angx = abs(x1 - x2)
+ angy = abs(y1 - y2)
elseif orient then -- unchecked
angle = asnumber_r(orient)
end
elseif orient then -- unchecked
angle = asnumber_r(orient)
end
-
-- what wins: viewbox or w/h
refx = asnumber_x(refx)
refy = asnumber_y(refy)
- width = width and asnumber_x(width) or 3 -- defaults
- height = height and asnumber_y(height) or 3 -- defaults
+ width = (width and asnumber_x(width) or 3) * units
+ height = (height and asnumber_y(height) or 3) * units
local x = 0
local y = 0
@@ -2058,27 +2056,29 @@ do
end
- local function addmarkers(list,begmarker,midmarker,endmarker)
+ -- do we need to metatable the attributes here?
+
+ local function addmarkers(list,begmarker,midmarker,endmarker,at)
local n = #list
if n > 3 then
if begmarker then
local m = locate(begmarker)
if m then
- makemarker("beg",m,false,false,list[1],list[2],list[3],list[4])
+ makemarker("beg",m,false,false,list[1],list[2],list[3],list[4],at)
end
end
if midmarker then
local m = locate(midmarker)
if m then
for i=3,n-2,2 do
- makemarker("mid",m,list[i-2],list[i-1],list[i],list[i+1],list[i+2],list[i+3])
+ makemarker("mid",m,list[i-2],list[i-1],list[i],list[i+1],list[i+2],list[i+3],at)
end
end
end
if endmarker then
local m = locate(endmarker)
if m then
- makemarker("end",m,list[n-3],list[n-2],list[n-1],list[n],false,false)
+ makemarker("end",m,list[n-3],list[n-2],list[n-1],list[n],false,false,at)
end
end
else
@@ -2148,7 +2148,7 @@ do
r = r + 1 ; result[r] = etransform or ";"
--
if list then
- addmarkers(list,begmarker,midmarker,endmarker)
+ addmarkers(list,begmarker,midmarker,endmarker,at)
end
--
if wrapup then
@@ -2285,7 +2285,6 @@ do
local btransform, etransform = handletransform(at)
local cpath = handleclippath(at)
-
if cpath then
r = r + 1 ; result[r] = s_clip_start
end
@@ -2380,7 +2379,7 @@ do
r = r + 1 ; result[r] = ";"
end
if list then
- addmarkers(list,begmarker,midmarker,endmarker)
+ addmarkers(list,begmarker,midmarker,endmarker,at)
end
r = r + 1 ; result[r] = etransform or ") ;"
end
@@ -2949,6 +2948,7 @@ do
tagstyles = { }
classstyles = { }
colormap = specification.colormap
+ usedcolors = trace_colors and setmetatableindex("number") or false
for s in xmlcollected(c,"style") do -- can also be in a def, so let's play safe
handlestyle(c)
end
@@ -2968,6 +2968,9 @@ do
if trace_result then
report("result graphic:\n %\n t",result)
end
+ if usedcolors and next(usedcolors) then
+ report("graphic %a uses colors: %s",specification.id or "unknown",table.sequenced(usedcolors))
+ end
mps = concat(result," ")
root = false
result = false
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index 279de60e2..e1a37260b 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -179,6 +179,7 @@ return {
"Umathskewedfractionhgap",
"Umathskewedfractionvgap",
"Umathspaceafterscript",
+ "Umathspacingmode",
"Umathstackdenomdown",
"Umathstacknumup",
"Umathstackvgap",
@@ -246,6 +247,7 @@ return {
"crampedscriptstyle",
"crampedtextstyle",
"csstring",
+ "directlua",
"efcode",
"endlocalcontrol",
"etoksapp",
@@ -265,6 +267,7 @@ return {
"gleaders",
"glet",
"glyphdatafield",
+ "glyphdimensionsmode",
"gtoksapp",
"gtokspre",
"hjcode",
@@ -295,7 +298,6 @@ return {
"internalcodesmode",
"lastnamedcs",
"lastnodesubtype",
- "leftghost",
"leftmarginkern",
"letcharcode",
"letfrozen",
@@ -353,7 +355,6 @@ return {
"protrusionboundary",
"pxdimen",
"quitvmode",
- "rightghost",
"rightmarginkern",
"rpcode",
"savecatcodetable",
@@ -540,7 +541,6 @@ return {
"delimitershortfall",
"dimen",
"dimendef",
- "directlua",
"discretionary",
"displayindent",
"displaylimits",
diff --git a/tex/context/base/mkiv/node-fnt.lua b/tex/context/base/mkiv/node-fnt.lua
index 1b245639b..3b8bf0586 100644
--- a/tex/context/base/mkiv/node-fnt.lua
+++ b/tex/context/base/mkiv/node-fnt.lua
@@ -45,13 +45,12 @@ local nuts = nodes.nuts
local getid = nuts.getid
local getsubtype = nuts.getsubtype
-local getdisc = nuts.getdisc
+local getreplace = nuts.getreplace
local getnext = nuts.getnext
local getprev = nuts.getprev
local getboth = nuts.getboth
local getdata = nuts.getdata
local getglyphdata = nuts.getglyphdata
------ getdisc = nuts.getdisc
local setchar = nuts.setchar
local setlink = nuts.setlink
@@ -142,34 +141,11 @@ fonts.hashes.processes = fontprocesses
-- we need to deal with the basemode fonts here and can only run over ranges as we
-- otherwise get luatex craches due to all kind of asserts in the disc/lig builder
+-- there is no gain in merging used (dynamic 0) and dynamics apart from a bit less code
+
local ligaturing = nuts.ligaturing
local kerning = nuts.kerning
--- -- -- this will go away
---
--- local disccodes = nodes.disccodes
--- local explicitdisc_code = disccodes.explicit
--- local automaticdisc_code = disccodes.automatic
--- local expanders = nil
---
--- function fonts.setdiscexpansion(v)
--- if v == nil or v == true then
--- expanders = languages and languages.expanders
--- elseif type(v) == "table" then
--- expanders = v
--- else
--- expanders = false
--- end
--- end
---
--- function fonts.getdiscexpansion()
--- return expanders and true or false
--- end
---
--- fonts.setdiscexpansion(true)
---
--- -- -- till here
-
local function start_trace(head)
run = run + 1
report_fonts()
@@ -193,19 +169,15 @@ local function start_trace(head)
end
end
-local function stop_trace(u,usedfonts,a,attrfonts,b,basefonts,r,redundant,e,expanders)
+local function stop_trace(u,usedfonts,a,attrfonts,b,basefonts,r,redundant)
report_fonts()
report_fonts("statics : %s",u > 0 and concat(keys(usedfonts)," ") or "none")
report_fonts("dynamics: %s",a > 0 and concat(keys(attrfonts)," ") or "none")
report_fonts("built-in: %s",b > 0 and b or "none")
report_fonts("removed : %s",r > 0 and r or "none")
- -- if expanders then
- -- report_fonts("expanded: %s",e > 0 and e or "none")
- -- end
report_fonts()
end
-
do
local usedfonts
@@ -221,7 +193,7 @@ do
local lastproc
local lastnone
- local a, u, b, r, e
+ local a, u, b, r
local function protectnone()
protect_glyphs(firstnone,lastnone)
@@ -307,7 +279,7 @@ do
lastproc = nil
lastnone = nil
- a, u, b, r, e = 0, 0, 0, 0, 0
+ a, u, b, r = 0, 0, 0, 0
if trace_fontrun then
start_trace(head)
@@ -425,7 +397,6 @@ do
end
if force_discrun then
-
-- basefont is not supported in disc only runs ... it would mean a lot of
-- ranges .. we could try to run basemode as a separate processor run but
-- not for now (we can consider it when the new node code is tested
@@ -433,7 +404,7 @@ do
-- we could use first_glyph, only doing replace is good enough because
-- pre and post are normally used for hyphens and these come from fonts
-- that part of the hyphenated word
- local _, _, r = getdisc(d)
+ local r = getreplace(d)
if r then
local prevfont = nil
local prevattr = nil
@@ -465,19 +436,13 @@ do
if firstnone then
protectnone()
end
- -- elseif expanders then
- -- local subtype = getsubtype(d)
- -- if subtype == automaticdisc_code or subtype == explicitdisc_code then
- -- expanders[subtype](d)
- -- e = e + 1
- -- end
end
end
end
if trace_fontrun then
- stop_trace(u,usedfonts,a,attrfonts,b,basefonts,r,redundant,e,expanders)
+ stop_trace(u,usedfonts,a,attrfonts,b,basefonts,r,redundant)
end
-- in context we always have at least 2 processors
diff --git a/tex/context/base/mkiv/pack-com.mkiv b/tex/context/base/mkiv/pack-com.mkiv
index fe622509a..28a3495d4 100644
--- a/tex/context/base/mkiv/pack-com.mkiv
+++ b/tex/context/base/mkiv/pack-com.mkiv
@@ -360,7 +360,7 @@
\to \everydefinecombination
\def\pack_combinations_pickup
- {\dostarttagged\t!combinationpair\empty
+ {\dostarttagged\t!combinationpair\empty % better make this text
\dostarttagged\t!combinationcontent\empty
\assumelongusagecs\pack_combinations_pickup_content_indeed}
diff --git a/tex/context/base/mkiv/pack-rul.mkiv b/tex/context/base/mkiv/pack-rul.mkiv
index 8732c7e6b..ba81a0956 100644
--- a/tex/context/base/mkiv/pack-rul.mkiv
+++ b/tex/context/base/mkiv/pack-rul.mkiv
@@ -1542,7 +1542,7 @@
\d_framed_linewidth
\fi
\ifconditional\c_framed_has_offset
- \advance\d_framed_applied_offset\localoffset
+ \advance\d_framed_applied_offset\localoffset\relax
\fi
\ifconditional\c_framed_has_extra_offset
\pack_framed_apply_extra_offsets % includes \d_framed_applied_offset
diff --git a/tex/context/base/mkiv/pack-rul.mkxl b/tex/context/base/mkiv/pack-rul.mkxl
index 8fd23fbb1..2bd768bd0 100644
--- a/tex/context/base/mkiv/pack-rul.mkxl
+++ b/tex/context/base/mkiv/pack-rul.mkxl
@@ -247,7 +247,7 @@
\s!depth \d_framed_target_dp
\relax}
-\def\pack_framed_filled_box_radius
+\def\ntg-context@ntg.nllled_box_radius
{\edef\p_framed_backgroundradius{\framedparameter\c!backgroundradius}%
\ifzeropt\dimexpr\p_framed_backgroundradius\relax % just in case of .x\bodyfontsize
\pack_framed_filled_box_normal
@@ -1557,7 +1557,7 @@
\d_framed_linewidth
\fi
\ifconditional\c_framed_has_offset
- \advance\d_framed_applied_offset\localoffset
+ \advance\d_framed_applied_offset\localoffset\relax
\fi
\ifconditional\c_framed_has_extra_offset
\pack_framed_apply_extra_offsets % includes \d_framed_applied_offset
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 01dde89ff..0da4c936e 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 105405cc4..f96735f78 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv
index 0dd1fe29c..3e71e0893 100644
--- a/tex/context/base/mkiv/syst-ini.mkiv
+++ b/tex/context/base/mkiv/syst-ini.mkiv
@@ -1174,4 +1174,10 @@
\let\eTeXglueshrinkorder \undefined
\let\eTeXgluestretchorder\undefined
+%D Experiment:
+
+\ifdefined\glyphdimensionsmode \else \newcount\glyphdimensionsmode \fi
+
+\glyphdimensionsmode\plusone
+
\protect \endinput
diff --git a/tex/context/base/mkiv/syst-ini.mkxl b/tex/context/base/mkiv/syst-ini.mkxl
index 9394807c8..3a6deab9a 100644
--- a/tex/context/base/mkiv/syst-ini.mkxl
+++ b/tex/context/base/mkiv/syst-ini.mkxl
@@ -1113,4 +1113,10 @@
\chardef\eTeXversion 2
\def \eTeXrevision {2}
+%D Experiment:
+
+\ifdefined\glyphdimensionsmode \else \newcount\glyphdimensionsmode \fi
+
+\glyphdimensionsmode\plusone
+
\protect \endinput
diff --git a/tex/context/base/mkiv/tabl-ntb.mkiv b/tex/context/base/mkiv/tabl-ntb.mkiv
index 8ff02330a..836ba5129 100644
--- a/tex/context/base/mkiv/tabl-ntb.mkiv
+++ b/tex/context/base/mkiv/tabl-ntb.mkiv
@@ -243,12 +243,18 @@
\tabl_ntb_next_level % go to level 1
+%D This is for the special cases where for instance a table is in a header or footer
+%D line and we have a split table in progress. (See mail to list from Taco.)
+
\installcorenamespace{naturaltable} % was tbl
\installcorenamespace{naturaltablelocal} % was tbltbl
\installdirectcommandhandler \??naturaltable {naturaltable} % \??naturaltable
\installsimpleframedcommandhandler \??naturaltablelocal {naturaltablelocal} \??naturaltablelocal
+\unexpanded\def\bTABLEnested{\tabl_ntb_next_level\bTABLE}
+\unexpanded\def\eTABLEnested{\eTABLE\tabl_ntb_prev_level}
+
\installcorenamespace{naturaltabletal}
\installcorenamespace{naturaltablegal}
\installcorenamespace{naturaltablenob}
diff --git a/tex/context/base/mkiv/tabl-ntb.mkxl b/tex/context/base/mkiv/tabl-ntb.mkxl
index 6b84411b2..adabc3139 100644
--- a/tex/context/base/mkiv/tabl-ntb.mkxl
+++ b/tex/context/base/mkiv/tabl-ntb.mkxl
@@ -247,6 +247,9 @@
\installdirectcommandhandler \??naturaltable {naturaltable} % \??naturaltable
\installsimpleframedcommandhandler \??naturaltablelocal {naturaltablelocal} \??naturaltablelocal
+\unexpanded\def\bTABLEnested{\tabl_ntb_next_level\bTABLE}
+\unexpanded\def\eTABLEnested{\eTABLE\tabl_ntb_prev_level}
+
\installcorenamespace{naturaltabletal}
\installcorenamespace{naturaltablegal}
\installcorenamespace{naturaltablenob}
diff --git a/tex/context/modules/mkiv/m-examn.mkiv b/tex/context/modules/mkiv/m-examn.mkiv
new file mode 100644
index 000000000..3a98e53b1
--- /dev/null
+++ b/tex/context/modules/mkiv/m-examn.mkiv
@@ -0,0 +1,577 @@
+%D \module
+%D [ file=m-examn,
+%D version=2000.01.29,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=Testing and Examination,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This is a pretty old style, written in 2000 so after 20 years it's time to check
+%D if it works with \MKIV. The original version looks mostly the same as below and
+%D runs ok with \MKII. The differences are in not using percent sign triggered
+%D comments in the \JAVASCRIPT\ section (that was dropped), using \type {Yes}
+%D instead of \type {On} as field value (because in those decades the \type {On}
+%D value has proven to be fragile (maybe because of some hard coded \type {Yes}
+%D checking). The macros lost \type {\long}, became \type {\unexpanded} and were
+%D reformatted.
+%D
+%D If there is really demand for this I'll do a more major update. I see no reason
+%D to change the 2000 \MKII\ logic now.
+
+% n number of permitted answers
+% answer (set of) right answer(s) (one or list)
+% weight weight of the answer(s) (one or list)
+% method calculation method, for the moment 1
+
+% hidden = true -> display = display.hidden
+
+% disguise methods, numbers and meaning secret
+% randomizing answers
+% allert will be a properly typeset message
+% all checkfields instead of radio, gives more control
+
+\unprotect
+
+\def\c!answer {answer}
+\def\c!question{question}
+\def\c!weight {weight}
+
+\startJSpreamble {mpc} used now
+
+ var RealTimeMode = false ;
+ var FeedBackMode = false ;
+ var CurrentFeedback = -1 ;
+
+ var MPCnames = new Array() ;
+ var MPCanswers = new Array() ;
+ var MPCnumbers = new Array() ;
+ var MPCweights = new Array() ;
+ var MPCmethods = new Array() ;
+ var MPCerrors = new Array() ;
+
+ function Warning (str) {
+ app.alert("warning: " + str)
+ }
+
+ function FieldYN (name,n) {
+ return this.getField(name + ":" + n + ":yn")
+ }
+
+ function FieldRW (name,n) {
+ return this.getField(name + ":" + n + ":rw")
+ }
+
+ function NOfFields (name) {
+ var nof = 1 ;
+ while (FieldYN(name,nof)) {
+ ++nof
+ }
+ return --nof
+ }
+
+ function SetScore (score,total) {
+ mpcs = this.getField("mpc-score") ;
+ mpct = this.getField("mpc-total") ;
+ mpcp = this.getField("mpc-percent") ;
+ if (RealTimeMode) {
+ var percent = 0 ;
+ if (Number(total) > 0) {
+ percent = Math.round(100.0 * (Number(score) / Number(total)))
+ }
+ if (mpcs) {
+ mpcs.value = score
+ }
+ if (mpct) {
+ mpct.value = total
+ }
+ if (mpcp) {
+ mpcp.value = percent
+ }
+ } else {
+ if (mpcs) {
+ mpcs.value = ""
+ }
+ if (mpct) {
+ mpct.value = ""
+ }
+ if (mpcp) {
+ mpcp.value = ""
+ }
+ }
+ this.dirty = false
+ }
+
+ function CheckMPCmode () {
+ mpcr = this.getField("mpc-realtime") ;
+ if (mpcr) {
+ RealTimeMode = (mpcr.value == "Yes")
+ }
+ CheckScore() ;
+ this.dirty = false
+ }
+
+ function DefineMPC (name, answer, number, weight, method) {
+ SetScore(0,0) ;
+ MPCnames[MPCnames.length] = name ;
+ if (answer=="") {
+ MPCanswers[name] = "0"
+ } else {
+ MPCanswers[name] = answer
+ }
+ if (number=="") {
+ MPCnumbers[name] = "0"
+ } else {
+ MPCnumbers[name] = number
+ }
+ if (weight=="") {
+ MPCweights[name] = "0"
+ } else {
+ MPCweights[name] = weight
+ }
+ if (method=="") {
+ MPCmethods[name] = "0"
+ } else {
+ MPCmethods[name] = method
+ }
+ }
+
+ function CheckScore () {
+ var score = 0 ;
+ var total = 0 ;
+ var ok = false ;
+ for (var i=0;i<MPCnames.length;i++) {
+ var name = MPCnames[i] ;
+ var answer = MPCanswers[name] ;
+ var number = Number(MPCnumbers[name]) ;
+ var weight = MPCweights[name] ;
+ var method = MPCmethods[name] ;
+ var fields = Number(NOfFields(name)) ;
+ var answers = answer.split(",") ;
+ var weights = weight.split(",") ;
+ var sorted = weight.split(",") ;
+ sorted = sorted.sort() ;
+ sorted = sorted.reverse() ;
+ for (var k = 0; k < number; k++) {
+ if (weights.length < answers.length) {
+ total += Number(weight)
+ } else {
+ total += Number(sorted[k])
+ }
+ }
+ for (var j = 1; j <= fields; j++) {
+ if (FeedBackMode) {
+ ok = (! FieldRW(name,j).hidden && (FieldRW(name,j).value == "Yes"))
+ } else {
+ ok = (FieldYN(name,j).value == "Yes")
+ }
+ if (ok) {
+ for (var k = 0; k < answers.length; k++) {
+ if (Number(answers[k]) == j) {
+ if (weights.length < answers.length) {
+ score += Number(weight)
+ } else {
+ score += Number(weights[k])
+ }
+ }
+ }
+ }
+ }
+ }
+ CurrentFeedback = -1 ;
+ SetScore(score,total)
+ }
+
+ function CalculateItems () {
+ CheckScore() ;
+ for (var i = 0;i < MPCnames.length; i++) {
+ var name = MPCnames[i] ;
+ var answer = MPCanswers[name] ;
+ var fields = Number(NOfFields(name)) ;
+ var answers = answer.split(",") ;
+ for (var j = 1; j <= fields; j++) {
+ FieldRW(name,j).hidden = true ;
+ FieldRW(name,j).readonly = true ;
+ FieldRW(name,j).value = "Off" ;
+ FieldYN(name,j).readonly = true ;
+ if (FieldYN(name,j).value=="Off") {
+ for (var k = 0; k < answers.length; k++) {
+ if (Number(answers[k]) == j) {
+ FieldYN(name,j).value = "Yes"
+ }
+ }
+ } else {
+ FieldRW(name,j).hidden = false ;
+ for (var k = 0; k < answers.length; k++) {
+ if (Number(answers[k]) == j) {
+ FieldRW(name,j).value = "Yes"
+ }
+ }
+ }
+ }
+ var SomeW = false ;
+ var SomeRW = false ;
+ for (var j = 1; j <= fields; j++) {
+ if (! FieldRW(name,j).hidden) {
+ SomeRW = true ;
+ if (FieldRW(name,j).value == "Off") {
+ SomeW = true
+ }
+ }
+ }
+ MPCerrors[name] = (SomeW || (! SomeRW)) ;
+ }
+ CurrentFeedback = -1 ;
+ FeedBackMode = true ;
+ this.dirty = false
+ }
+
+ function ResetItems () {
+ for (var i = 0; i < MPCnames.length; i++) {
+ var name = MPCnames[i] ;
+ var fields = Number(NOfFields(name)) ;
+ for (var j = 1; j <= fields; j++) {
+ FieldRW(name,j).hidden = true ;
+ FieldYN(name,j).hidden = false ;
+ FieldYN(name,j).readonly = false ;
+ FieldYN(name,j).value = "Off" ;
+ SetScore(0,0)
+ }
+ }
+ CurrentFeedback = -1 ;
+ FeedBackMode = false ;
+ this.dirty = false
+ }
+
+ function CheckMPCone (name, number) {
+ nofitems = Number(NOfFields(name)) ;
+ for (var i = 1; i <= nofitems; i++) {
+ if (i != Number(number)) {
+ FieldYN(name,i).value = "Off"
+ }
+ }
+ }
+
+ function CheckMPCmore (name, number) {
+ var nofitems = Number(NOfFields(name)) ;
+ var currentnumber = 0 ;
+ for (var i = 1; i <= nofitems; i++) {
+ if (FieldYN(name,i).value == "Yes") {
+ ++currentnumber
+ }
+ }
+ if (currentnumber>Number(MPCnumbers[name])) {
+ Warning("only " + MPCnumbers[name] + " choices permitted") ;
+ var v = FieldYN(name,number) ;
+ if (v.value == "Yes") {
+ v.value = "Off"
+ }
+ }
+ }
+
+ function CheckMPC (name, number) {
+ if (! FeedBackMode) {
+ if (MPCnumbers[name] == 1) {
+ CheckMPCone(name,number)
+ } else {
+ CheckMPCmore(name,number)
+ }
+ if (RealTimeMode) {
+ CheckScore()
+ } else {
+ SetScore(0,0)
+ }
+ } else {
+ SetScore(0,0)
+ }
+ }
+
+ function GoneToFeedback () {
+ var name = MPCnames[CurrentFeedback] ;
+ if (MPCerrors[name]) {
+ console.println("feedback:" + name) ;
+ this.gotoNamedDest("feedback:" + name) ;
+ return true
+ } else {
+ return false
+ }
+ }
+
+ function NextFeedback () {
+ ++CurrentFeedback ;
+ while (CurrentFeedback < MPCnames.length) {
+ if (GoneToFeedback()) {
+ return
+ } else {
+ ++CurrentFeedback
+ }
+ }
+ CurrentFeedback = 0 ;
+ while (CurrentFeedback < MPCnames.length) {
+ if (GoneToFeedback()) {
+ return
+ } else {
+ ++CurrentFeedback
+ }
+ }
+ CurrentFeedback = -1
+ }
+
+ function PreviousFeedback () {
+ --CurrentFeedback ;
+ while (CurrentFeedback >= 0) {
+ if (GoneToFeedback()) {
+ return
+ } else {
+ --CurrentFeedback
+ }
+ }
+ CurrentFeedback = MPCnames.length ;
+ while (CurrentFeedback >= 0) {
+ if (GoneToFeedback()) {
+ return
+ } else {
+ --CurrentFeedback
+ }
+ }
+ CurrentFeedback = MPCnames.length + 1
+ }
+
+\stopJSpreamble
+
+\definecolor[clickMPCcolor][blue]
+\definecolor[rightMPCcolor][green]
+\definecolor[wrongMPCcolor][red]
+
+\definecolor[MPCcolor][clickMPCcolor]
+
+\appendtoks
+ \definesymbol [mpc-y] [\mathematics{\color[clickMPCcolor]{\star}}] % yes
+ \definesymbol [mpc-n] [\hphantom{\symbol[mpc-y]}] % no
+ \definesymbol [mpc-r] [\mathematics{\color[rightMPCcolor]{\star}}] % right
+ \definesymbol [mpc-w] [\mathematics{\color[wrongMPCcolor]{\star}}] % wrong
+\to \everystarttext
+
+\definereference [ResetItems] [JS(ResetItems)]
+\definereference [CalculateItems] [JS(CalculateItems)]
+\definereference [PreviousFeedback] [JS(PreviousFeedback)]
+\definereference [NextFeedback] [JS(NextFeedback)]
+
+\setupfield
+ [mpc-field-yn]
+ [%\c!frame=\v!off,
+ \c!height=.8em,
+ \c!width=.8em,
+ \c!background=\v!color,
+ \c!backgroundcolor=gray]
+
+\setupfield
+ [mpc-field-rw]
+ [%\c!frame=\v!off,
+ \c!height=.8em,
+ \c!width=.8em,
+ \c!background=\v!color,
+ \c!background=gray]
+
+\setupfield
+ [mpc-data]
+ [%\c!frame=\v!off,
+ \c!height=3ex,
+ \c!location=\v!low,
+ \c!align=\v!middle,
+ \c!color=MPCcolor,
+ \c!background=\v!color,
+ \c!background=gray,
+ \c!option=\v!readonly]
+
+\setupfield
+ [mpc-mode]
+ [%\c!frame=\v!off,
+ \c!height=3ex,
+ \c!width=3ex,
+ \c!location=\v!low,
+ \c!color=MPCcolor,
+ \c!background=\v!color,
+ \c!background=gray,
+ \c!clickout=JS(CheckMPCmode)]
+
+\appendtoks
+ \definemainfield[mpc-score] [line] [mpc-data][][]
+ \definemainfield[mpc-total] [line] [mpc-data][][]
+ \definemainfield[mpc-percent] [line] [mpc-data][][]
+ \definemainfield[mpc-realtime][check][mpc-mode][mpc-y,mpc-n][mpc-n]
+\to \everystarttext
+
+\newif\iftraceitems % \traceitemstrue
+
+\unexpanded\def\startMPCitems
+ {\dotripleempty\dostartMPCitems}
+
+\let\stopMPCitems\relax
+\let\startMPCitem\relax
+\let\stopMPCitem \relax
+
+\unexpanded\def\dostartMPCitems[#1][#2][#3]#4\stopMPCitems
+ {\bgroup
+ \getgparameters
+ [mpc:#1:]
+ [\c!answer=1,
+ \c!n=1,
+ \c!weight=1,
+ \c!method=1,
+ #2]%
+ \doglobal\newcounter\MPCitems
+ \unexpanded\def\startMPCitem##1\stopMPCitem
+ {\doglobal\increment\MPCitems
+ \edef\MPCitem{MPC:\MPCitems}%
+ \expandafter\setvalue\expandafter\MPCitem\expandafter
+ {\expandafter\handleMPCitem\expandafter{\MPCitems}{##1}}}
+ #4\relax
+ \unexpanded\def\handleMPCitem##1##2%
+ {\setJSpreamble{mpc:#1}
+ {DefineMPC
+ ("mpc:#1",%
+ "\getvalue{mpc:#1:\c!answer}",%
+ "\getvalue{mpc:#1:\c!n}",%
+ "\getvalue{mpc:#1:\c!weight}",%
+ "\getvalue{mpc:#1:\c!method}");}%
+ \definefield[mpc:#1:##1:rw][check][mpc-field-rw][mpc-r,mpc-w][mpc-r]
+ \definefield[mpc:#1:##1:yn][check][mpc-field-yn][mpc-y,mpc-n][mpc-n]
+ \setupfield[mpc-field-rw][\c!option={\v!readonly,\v!hidden}]
+ \setupfield[mpc-field-yn][\c!clickout=JS(CheckMPC{mpc:#1,##1})]
+ \mar{\iftraceitems{\txx##1}\hskip.5em\fi
+ %\fitfield[mpc:#1:##1:rw]\hskip.25em
+ %\fitfield[mpc:#1:##1:yn]}
+ \field[mpc:#1:##1:rw]\hskip.25em
+ \field[mpc:#1:##1:yn]}
+ ##2\par}%
+ \global\let\MPCdone\MPCitems
+ \global\unexpanded\def\fetchMPCitems
+ {\getrandomnumber\MPCitem{1}{\MPCitems}%
+ \doifdefined{MPC:\MPCitem}
+ {\getvalue{MPC:\MPCitem}
+ \doglobal\decrement\MPCdone
+ \global\letbeundefined{MPC:\MPCitem}}%
+ \ifcase\MPCdone\else
+ \expandafter\fetchMPCitems
+ \fi}
+ \startitemize[#3]
+ \fetchMPCitems
+ \stopitemize
+ \egroup}
+
+% \setupsystem
+% [\c!random=\v!small]
+
+\protect
+
+\continueifinputfile{m-examn.mkiv}
+
+% \nopdfcompression
+
+\setupbodyfont[pagella,10pt]
+
+% \usemodule[m][examn]
+
+\setupinteraction
+ [state=start,
+ color=MPCcolor,
+ menu=on]
+
+\setupinteractionmenu
+ [right]
+ [state=start]
+
+\setupinteractionscreen
+ [option=max]
+
+\setuppapersize
+ [S6][S6]
+
+\setuplayout
+ [topspace=15pt,
+ backspace=40pt,
+ header=0pt,
+ footer=0pt,
+ height=middle,
+ rightmargin=0pt,
+ leftmargin=20pt,
+ leftmargindistance=5pt,
+ rightedge=100pt,
+ rightedgedistance=15pt,
+ width=430pt]
+
+\setupbackgrounds
+ [text][rightedge]
+ [frame=on,
+ frameoffset=5pt,
+ framecolor=MPCcolor]
+
+\startinteractionmenu[right]
+ \startalignment[middle]
+ \dontleavehmode \gotobox{\strut example test} [examplepage] \blank
+ \dontleavehmode \gotobox{\strut next feedback}[NextFeedback] \blank
+ \dontleavehmode \gotobox{\strut prev feedback}[PreviousFeedback] \blank
+ \dontleavehmode \gotobox{\strut submit} [SubmitForm{mailto:pragma@wxs.nl}] \blank
+ \dontleavehmode \gotobox{\strut reset} [ResetItems] \blank
+ \dontleavehmode \gotobox{\strut calculate} [CalculateItems] \blank
+ \vfill
+ score \blank[small] \dontleavehmode \field[mpc-score] \blank
+ max score \blank[small] \dontleavehmode \field[mpc-total] \blank
+ percentage \blank[small] \dontleavehmode \field[mpc-percent] \blank
+ realtime \blank[small] \dontleavehmode \field[mpc-realtime] \blank
+ \kern0pt
+ \stopalignment
+\stopinteractionmenu
+
+\starttext
+
+\title [examplepage] {A simple MPC demo (toggle mode)}
+
+\startMPCitems[mpc-1][answer=3][a,packed]
+
+ \startMPCitem this is alpha \stopMPCitem
+ \startMPCitem and this is beta \stopMPCitem
+ \startMPCitem but how about gamma (ok) \stopMPCitem
+
+\stopMPCitems
+
+\startMPCitems[mpc-5][answer={2,3,4},n=2][n,packed]
+
+ \startMPCitem this is alpha \stopMPCitem
+ \startMPCitem and this is beta (ok, 2 ok's permitted) \stopMPCitem
+ \startMPCitem but how about gamma (ok, 2 ok's permitted) \stopMPCitem
+ \startMPCitem or delta (ok, 2 ok's permitted) \stopMPCitem
+ \startMPCitem or epsilon \stopMPCitem
+
+\stopMPCitems
+
+\startMPCitems[mpc-6][answer={2,3,4},weight={2,1,3},n=2][g,packed]
+
+ \startMPCitem this is alpha \stopMPCitem
+ \startMPCitem and this is beta (ok, 2 ok's permitted, weight is 2) \stopMPCitem
+ \startMPCitem but how about gamma (ok, 2 ok's permitted, weight is 1) \stopMPCitem
+ \startMPCitem or delta (ok, 2 ok's permitted, weight is 3) \stopMPCitem
+ \startMPCitem or epsilon \stopMPCitem
+
+\stopMPCitems
+
+\startMPCitems[mpc-8][answer=1,weight=2][packed]
+
+ \startMPCitem this is alpha (ok, weight is 2) \stopMPCitem
+ \startMPCitem and this is beta \stopMPCitem
+ \startMPCitem but how about gamma \stopMPCitem
+ \startMPCitem or delta \stopMPCitem
+
+\stopMPCitems
+
+\title [feedback:mpc:mpc-1] {Feedback on MPC 1} whatever
+\title [feedback:mpc:mpc-5] {Feedback on MPC 5} whatever
+\title [feedback:mpc:mpc-6] {Feedback on MPC 6} whatever
+\title [feedback:mpc:mpc-8] {Feedback on MPC 8} whatever
+
+\stoptext
diff --git a/tex/context/modules/mkiv/m-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv
index 315cb3bed..058a4cbcd 100644
--- a/tex/context/modules/mkiv/m-scite.mkiv
+++ b/tex/context/modules/mkiv/m-scite.mkiv
@@ -317,7 +317,7 @@ moduledata.scite = scite
\definetyping[MPS] [option=mps]
\definetyping[MP] [option=mp]
\definetyping[PDF] [option=pdf]
-\definetyping[CPP] [option=web]
+\definetyping[CPP] [option=cpp] % Which is kind of like the web one.
\definetyping[WEB] [option=web]
\definetyping[TXT] [option=txt]
\definetyping[BNF] [option=bnf] % I might use this in the metafun manual.
@@ -397,6 +397,14 @@ moduledata.scite = scite
{\scitebuffer[\ifx\currentscitelexer\empty tex\else\currentscitelexer\fi][@scite@]%
\endgroup}
+\definelines
+ [scitelines]
+
+\setuplines
+ [scitelines]
+ [\c!before=,
+ \c!after=]
+
\unexpanded\def\scitefile
{\dosingleargument\module_scite_file}
@@ -410,9 +418,9 @@ moduledata.scite = scite
\dontcomplain
\raggedright
\startcontextcode
- \startlines
+ \startscitelines
\getbuffer[lex]
- \stoplines
+ \stopscitelines
\stopcontextcode
\endgroup}
@@ -432,9 +440,9 @@ moduledata.scite = scite
\module_scite_inherit_typing
\dontcomplain
\raggedright
- \startlines
+ \startscitelines
\getbuffer[lex]
- \stoplines
+ \stopscitelines
\endgroup}
\unexpanded\def\sciteinlinebuffer
@@ -476,14 +484,14 @@ moduledata.scite = scite
\tt
\installscitecommandsdisplay
\dontcomplain
-\buff_verbatim_initialize_typing_one
-\buff_verbatim_set_line_margin
+ \buff_verbatim_initialize_typing_one
+ \buff_verbatim_set_line_margin
\raggedright
- \startlines
+ \startscitelines
\clf_getbuffer{lex}}
\unexpanded\def\stopDisplayScite
- {\stoplines
+ {\stopscitelines
\endgroup}
\unexpanded\def\slxbreak
diff --git a/tex/context/sample/common/cuomo.tex b/tex/context/sample/common/cuomo.tex
new file mode 100644
index 000000000..72da38b77
--- /dev/null
+++ b/tex/context/sample/common/cuomo.tex
@@ -0,0 +1,17 @@
+Yeah, my mother is not expandable. And your mother is not expendable. And our
+brothers and sisters are not expandable. And we're not going to accept a premise
+that human life is disposable. And we're not going to put a dollar figure on
+human life. First order of business is: save lives. Period. Whatever it costs.
+Now, I also don't believe it's an either or. I believe you can have an
+intelligent refined public health strategy. You talk about risk stratification.
+You can have people go to work. You can test people and find out that they are
+resolved from the virus. Let them go back to work. You can let go younger people
+back to work. You can have an economic startup strategy that is consistent with a
+public health strategy. It's smart. It's complicated. It's sophisticated. But
+that's what government is supposed to do, right. That whole concept of developed
+government policy and program. You can do both. But not in a clumsy ham-handed
+way. Right? \quotation {Well, we'll just sacrifice old people, they're old people
+anyway, and the old get left behind.} What is this? Some modern Darwinian theory
+of natural selection? You can't keep up so the band is going to leave you behind.
+We're gonna move on and if you can't keep up you, well then you just fall by the
+wayside of life. God forbid.
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 0d467a244..d6a8b66da 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 2020-03-10 14:44
+-- merge date : 2020-03-26 21:46
do -- begin closure to overcome local limits and interference