summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/modules/mkiv
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-06 21:58:15 +0000
committerKarl Berry <karl@freefriends.org>2021-03-06 21:58:15 +0000
commit974640d66e61e81cb197ad96fdff7b08343e4c5a (patch)
tree2e1f75f32f312b7f24ba82b4590ae230bcd6f399 /Master/texmf-dist/tex/context/modules/mkiv
parentb4fa72e61230aca75f7f6fbf988821f71edfb6b2 (diff)
context
git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/modules/mkiv')
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-catchword.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua28
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-chart.mkvi18
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-educat.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-examn.mkiv577
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-format.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-gnuplot.mkxl97
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-ipsum.mkiv50
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-morse.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-nodechart.lua4
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-ntb-to-xtb.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-oldfun.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-oldnum.mkiv12
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-punk.mkiv5
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv39
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-sql.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-steps.lua2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-steps.mkvi40
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-system-aliasing.mkiv120
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-system-readers.mkxl148
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-tikz.mkiv75
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-timing.mkxl113
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/m-visual.mkiv10
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-article-titlepage.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-fonts-coverage.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-fonts-shapes.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-fonts-tables.lua12
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-inf-01.mkvi38
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-languages-hyphenation.lua25
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-magazine-basic.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-maps.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-module-basic.mkiv45
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-balls.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-bars.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-boring.mkiv143
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-colorful.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-funny.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-fuzzy.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-green.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-organic.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-original.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-split.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-stack.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-stepper.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-weird.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-present-windows.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-references-show.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-syntax.mkiv84
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-system-macros.mkxl311
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-system-tokens.mkxl84
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-system-visual.mkiv94
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-tugboat-columns.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/x-math-svg.lua6
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/x-mathml-basics.mkiv12
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/x-mathml.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/x-setups-basics.mkiv12
59 files changed, 2076 insertions, 254 deletions
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-catchword.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-catchword.mkiv
index 70d713e44c1..86a3a2d55f8 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-catchword.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-catchword.mkiv
@@ -27,7 +27,7 @@ local hlist_code = nodecodes.hlist
local fontkern_code = kerncodes.fontkern
local function set_catchword(t)
- local nextpage = tex.lists.contrib_head
+ local nextpage = tex.lists.contribute_head or tex.lists.contrib_head
if not nextpage then
return
end
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua b/Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua
index 1cdfd9f65d8..df769067a0e 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua
@@ -323,7 +323,7 @@ implement {
implement {
name = "flow_set_text",
- arguments = { "string", "string" },
+ arguments = "2 strings",
actions = function(align,str)
temp.texts[#temp.texts+1] = {
align = align,
@@ -358,7 +358,7 @@ implement {
implement {
name = "flow_set_label",
- arguments = { "string", "string" },
+ arguments = "2 strings",
actions = function(location,text)
temp.labels[#temp.labels+1] = {
location = location,
@@ -369,7 +369,7 @@ implement {
implement {
name = "flow_set_comment",
- arguments = { "string", "string" },
+ arguments = "2 strings",
actions = function(location,text)
local connections = temp.connections
if connections then
@@ -389,7 +389,7 @@ implement {
implement {
name = "flow_set_exit",
- arguments = { "string", "string" },
+ arguments = "2 strings",
actions = function(location,text)
temp.exits[#temp.exits+1] = {
location = location,
@@ -582,7 +582,7 @@ implement {
implement {
name = "flow_set_connection",
- arguments = { "string", "string", "string" },
+ arguments = "3 strings",
actions = function(location,displacement,name)
local dx, dy = lpegmatch(splitter,displacement)
dx = tonumber(dx)
@@ -718,8 +718,8 @@ local function process_connections(g,chart,xoffset,yoffset)
end
end
-local f_texttemplate_t = formatters["\\setvariables[flowcell:text][x=%s,y=%s,n=%i,align={%s},figure={%s},overlay={%s},destination={%s}]"]
-local f_texttemplate_l = formatters["\\doFLOWlabel{%i}{%i}{%i}"]
+local f_texttemplate_t = formatters["\\setvariables[flowcell:text][x=%s,y=%s,n=%i,align={%s},figure={%s},overlay={%s},destination={%s},realx=%s,realy=%s]"]
+local f_texttemplate_l = formatters["\\doFLOWlabel{%i}{%i}{%i}{%i}{%i}"]
local splitter = lpeg.splitat(":")
local charttexts = { } -- permits " etc in mp
@@ -751,6 +751,8 @@ local function process_texts(g,chart,xoffset,yoffset)
local destination = cell.destination or ""
local texts = cell.texts
local noftexts = #texts
+ local realx = cell.realx or x
+ local realy = cell.realy or y
if noftexts > 0 then
for i=1,noftexts do
local text = texts[i]
@@ -758,7 +760,7 @@ local function process_texts(g,chart,xoffset,yoffset)
local align = text.align or ""
local align = validlabellocations[align] or align
charttexts[#charttexts+1] = data
- ctx_tographic(g,'flow_chart_draw_text(%s,%s,textext("%s")) ;',x,y,f_texttemplate_t(x,y,#charttexts,align,figure,overlay,destination))
+ ctx_tographic(g,'flow_chart_draw_text(%s,%s,textext("%s")) ;',x,y,f_texttemplate_t(x,y,#charttexts,align,figure,overlay,destination,realx,realy))
if i == 1 then
figure = ""
overlay = ""
@@ -766,7 +768,7 @@ local function process_texts(g,chart,xoffset,yoffset)
end
end
elseif figure ~= "" or overlay ~= "" or destination ~= "" then
- ctx_tographic(g,'flow_chart_draw_text(%s,%s,textext("%s")) ;',x,y,f_texttemplate_t(x,y,0,"",figure,overlay,destination))
+ ctx_tographic(g,'flow_chart_draw_text(%s,%s,textext("%s")) ;',x,y,f_texttemplate_t(x,y,0,"",figure,overlay,destination,realx,realy))
end
local labels = cell.labels
for i=1,#labels do
@@ -776,7 +778,7 @@ local function process_texts(g,chart,xoffset,yoffset)
local location = validlabellocations[location] or location
if text and text ~= "" then
charttexts[#charttexts+1] = text
- ctx_tographic(g,'flow_chart_draw_label(%s,%s,"%s",textext("%s")) ;',x,y,location,f_texttemplate_l(x,y,#charttexts))
+ ctx_tographic(g,'flow_chart_draw_label(%s,%s,"%s",textext("%s")) ;',x,y,location,f_texttemplate_l(x,y,#charttexts,realx,realy))
end
end
local exits = cell.exits
@@ -792,7 +794,7 @@ local function process_texts(g,chart,xoffset,yoffset)
location == "t" and y == chart.to_y - 1 or
location == "b" and y == chart.from_y + 1 then
charttexts[#charttexts+1] = text
- ctx_tographic(g,'flow_chart_draw_exit(%s,%s,"%s",textext("%s")) ;',x,y,location,f_texttemplate_l(x,y,#charttexts))
+ ctx_tographic(g,'flow_chart_draw_exit(%s,%s,"%s",textext("%s")) ;',x,y,location,f_texttemplate_l(x,y,#charttexts,realx,realy))
end
end
end
@@ -821,7 +823,7 @@ local function process_texts(g,chart,xoffset,yoffset)
end
if text and text ~= "" then
charttexts[#charttexts+1] = text
- ctx_tographic(g,'flow_chart_draw_comment(%s,%s,%s,"%s",%s,textext("%s")) ;',x,y,i,location,length,f_texttemplate_l(x,y,#charttexts))
+ ctx_tographic(g,'flow_chart_draw_comment(%s,%s,%s,"%s",%s,textext("%s")) ;',x,y,i,location,length,f_texttemplate_l(x,y,#charttexts,realx,realy))
end
end
end
@@ -1014,7 +1016,7 @@ local function makechart_indeed(chart)
--
end
--- We need to wrap because of tex.runtoks!
+-- We need to wrap because of tex.runlocal!
local function makechart(chart)
context.hbox()
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-chart.mkvi b/Master/texmf-dist/tex/context/modules/mkiv/m-chart.mkvi
index a9d3dfdd931..4dee9c7ef1f 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-chart.mkvi
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-chart.mkvi
@@ -46,7 +46,7 @@
\let\setupFLOWcharts\setupFLOWchart
\let\setupFLOWlines \setupFLOWline
\let\setupFLOWshapes\setupFLOWshape
-\let\setupFLOWsets \setupFLOWset
+%let\setupFLOWset \setupFLOWsets
\setupFLOWcharts
[\c!width=12\bodyfontsize,
@@ -276,7 +276,7 @@
\let\location \FLOW_location
\let\text \FLOW_text
\let\label \FLOW_label
- \let\comment \FLOW_comment
+ \overloaded\let\comment \FLOW_comment
\let\exit \FLOW_exit
\let\connection \FLOW_connection
\let\include \FLOW_include
@@ -285,7 +285,7 @@
\let\connect \FLOW_connection
\let\locate \FLOW_location
%
- \let\includeFLOWchart\include
+ \overloaded\let\includeFLOWchart\include
\to \everyFLOWchart
\unexpanded\def\FLOW_name #name{\clf_flow_set_name{#name}\ignorespaces}
@@ -322,12 +322,16 @@
[n=0,
x=1,
y=1,
+ realx=1,
+ realy=1,
text=,
align=,
set=\setups{flowcell:text:place}]
-\def\FLOWx{\getvariable{flowcell:text}{x}} % compatibility (for Willi)
-\def\FLOWy{\getvariable{flowcell:text}{y}} % compatibility (for Willi)
+\def\FLOWx {\getvariable{flowcell:text}{x}} % compatibility (for Willi)
+\def\FLOWy {\getvariable{flowcell:text}{y}} % compatibility (for Willi)
+\def\FLOWrealx{\getvariable{flowcell:text}{realx}} % compatibility (for Willi)
+\def\FLOWrealy{\getvariable{flowcell:text}{realy}} % compatibility (for Willi)
\defineoverlay
[flowcell:figure]
@@ -380,10 +384,12 @@
\endgroup
\stopsetups
-\unexpanded\def\doFLOWlabel#1#2#3%
+\unexpanded\def\doFLOWlabel#1#2#3#4#5%
{\begingroup
\def\FLOWx{#1}%
\def\FLOWy{#2}%
+ \def\FLOWrealx{#4}%
+ \def\FLOWrealy{#5}%
\strut
\getFLOWtext{#3}%
\endgroup}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-educat.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-educat.mkiv
index e39738e99a9..215bf31167a 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-educat.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-educat.mkiv
@@ -71,7 +71,7 @@
\vbox{\hsize\wd\scratchbox\thinrule
\ifcase\scratchcounter\else
\setbox\scratchbox=\hbox{\space}%
- \nobreak\hskip\zeropoint \!!minus \wd\scratchbox
+ \nobreak\hskip\zeropoint \s!minus \wd\scratchbox
\vbox{\hsize\wd\scratchbox\thinrule}%
\fi}}%
\processisolatedwords{#2}\processisolatedword
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-examn.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-examn.mkiv
new file mode 100644
index 00000000000..3a98e53b1b3
--- /dev/null
+++ b/Master/texmf-dist/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/Master/texmf-dist/tex/context/modules/mkiv/m-format.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-format.mkiv
index 3a0a5bebd51..083f6ed63fe 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-format.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-format.mkiv
@@ -190,7 +190,7 @@
{\placeformatlinecounter}}}}
{\let\doplaceformatlinecounter\relax}%
\global\setfalse\formatforcedbreak
- \def\\{\break\global\settrue\formatforcedbreak}%
+ \enforced\def\\{\break\global\settrue\formatforcedbreak}%
\hsize\formatwidth
\doglobal\increment\formatlinecounter
\par
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-gnuplot.mkxl b/Master/texmf-dist/tex/context/modules/mkiv/m-gnuplot.mkxl
new file mode 100644
index 00000000000..e844edd1bb3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-gnuplot.mkxl
@@ -0,0 +1,97 @@
+%D \module
+%D [ file=m-gnuplot,
+%D version=2020.02.10,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=Gnuplot,
+%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 variant on the \GNUPLOT\ terminal code. At some point (when there is a
+%D reason) I will make a proper environment that can be used for embedded code.
+
+\permanent\protected\def\includegnuplotsvgfile[#1]%
+ {\hbox\bgroup
+ \ctxlua{metapost.startsvghashing()}%
+ \includesvgfile[#1]%
+ \ctxlua{metapost.stopsvghashing()}%
+ \egroup}
+
+\startluacode
+
+local modificationtime = lfs.modification
+local longtostring = string.longtostring
+local formatters = string.formatters
+local expandfilename = dir.expandname
+local isfile = lfs.isfile
+
+local runner = sandbox.registerrunner {
+ name = "gnuplot to svg",
+ program = "gnuplot",
+ template = longtostring [[
+ -e "set output '%newname%'; set terminal svg"
+ "%oldname%"
+ ]],
+ checkers = {
+ oldname = "readable",
+ newname = "writable",
+ },
+}
+
+figures.programs.gnuplot = {
+ runner = runner,
+}
+
+local function remap(specification)
+ local oldname = specification.fullname
+ if oldname then
+ local newname = file.replacesuffix(oldname,"svg")
+ local oldtime = modificationtime(oldname) or 0
+ local newtime = modificationtime(newname) or 0
+ if newtime == 0 or oldtime > newtime then
+ runner {
+ newname = expandfilename(newname),
+ oldname = expandfilename(oldname),
+ }
+ end
+ if isfile(newname) then
+ local only = file.nameonly(newname)
+ local name = formatters["svg-%s-inclusion"](only)
+ local code = formatters["\\includegnuplotsvgfile[%s]\\resetbuffer[%s]"](newname,name)
+ buffers.assign(name,code)
+ specification.format = "buffer"
+ specification.fullname = name
+ end
+ end
+ return specification
+end
+
+figures.remappers.gp = { svg = remap }
+
+\stopluacode
+
+\continueifinputfile{m-gnuplot.mkxl}
+
+\startluacode
+io.savedata("m-gnuplot-demo.gp", [[
+set format xy "$%g$"
+
+set title 'This is a plot of $y=\\sin(x)$'
+set xlabel 'This is the $x$ axis'
+set ylabel 'This is the $y$ axis'
+
+plot [0:6.28] [0:1] sin(x)
+]])
+\stopluacode
+
+\starttext
+
+ \externalfigure[m-gnuplot-demo.gp][conversion=svg,width=4cm]
+
+ \externalfigure[m-gnuplot-demo.gp][conversion=svg,width=8cm]
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-ipsum.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-ipsum.mkiv
index 7ba78ee2eaf..7b5074a49cf 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-ipsum.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-ipsum.mkiv
@@ -101,6 +101,23 @@ function moduledata.ipsum.direct(settings)
end
end
+interfaces.implement {
+ name = "ipsum",
+ protected = true,
+ actions = moduledata.ipsum.typeset,
+ arguments = { {
+ { "alternative" },
+ { "filename" },
+ { "n" },
+ { "left" },
+ { "right" },
+ { "before" },
+ { "after" },
+ { "inbetween" },
+ { "separator" },
+ } },
+}
+
\stopluacode
\unprotect
@@ -129,26 +146,25 @@ end
\useipsumstyleandcolor\c!style\c!color
% hm, also changes dates
\uselanguageparameter\ipsumparameter
- \ctxlua{moduledata.ipsum.typeset {
- alternative = "\ipsumparameter\c!alternative",
- filename = "\ipsumparameter\c!file",
- n = "\ipsumparameter\c!n",
- left = "\luaescapestring{\ipsumparameter\c!left}",
- right = "\luaescapestring{\ipsumparameter\c!right}",
- before = "\luaescapestring{\ipsumparameter\c!before}",
- after = "\luaescapestring{\ipsumparameter\c!after}",
- inbetween = "\luaescapestring{\ipsumparameter\c!inbetween}",
- }}
+ \clf_ipsum
+ alternative {\ipsumparameter\c!alternative}
+ filename {\ipsumparameter\c!file}
+ n {\ipsumparameter\c!n}
+ left {\ipsumparameter\c!left}
+ right {\ipsumparameter\c!right}
+ before {\ipsumparameter\c!before}
+ after {\ipsumparameter\c!after}
+ inbetween {\ipsumparameter\c!inbetween}
+ \relax
\stopsetups
\def\directipsum#1% only one argument, expanded
- {\ctxlua{moduledata.ipsum.typeset {
- alternative = "\namedipsumparameter{#1}\c!alternative",
- filename = "\namedipsumparameter{#1}\c!file",
- n = "\namedipsumparameter{#1}\c!n",
- separator = "\luaescapestring{\ipsumparameter\c!separator}",
- }}
-}
+ {\clf_ipsum
+ alternative {\namedipsumparameter{#1}\c!alternative}
+ filename {\namedipsumparameter{#1}\c!file}
+ n {\namedipsumparameter{#1}\c!n}
+ separator {\ipsumparameter\c!separator}
+ \relax}
\protect
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-morse.mkvi b/Master/texmf-dist/tex/context/modules/mkiv/m-morse.mkvi
index a2c20dff745..a80b3d56fc1 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-morse.mkvi
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-morse.mkvi
@@ -227,8 +227,8 @@ end
\def\MorseHeight {0.2em}
%def\MorseShort {\dontleavehmode\blackrule[\c!height=\MorseHeight,\c!width=\dimexpr\MorseWidth]}
%def\MorseLong {\dontleavehmode\blackrule[\c!height=\MorseHeight,\c!width=3\dimexpr\MorseWidth]}
-\def\MorseShort {\dontleavehmode\vrule\!!width \dimexpr\MorseWidth\!!height\MorseHeight\!!depth\zeropoint\relax}
-\def\MorseLong {\dontleavehmode\vrule\!!width3\dimexpr\MorseWidth\!!height\MorseHeight\!!depth\zeropoint\relax}
+\def\MorseShort {\dontleavehmode\vrule\s!width \dimexpr\MorseWidth\s!height\MorseHeight\s!depth\zeropoint\relax}
+\def\MorseLong {\dontleavehmode\vrule\s!width3\dimexpr\MorseWidth\s!height\MorseHeight\s!depth\zeropoint\relax}
\def\MorseBetweenCharacters {\kern\MorseWidth}
\def\MorseBetweenWords {\hskip3\dimexpr\MorseWidth\relax}
\def\MorseSpace {\hskip7\dimexpr\MorseWidth\relax}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-nodechart.lua b/Master/texmf-dist/tex/context/modules/mkiv/m-nodechart.lua
index 8273f365a91..98e09f4b518 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-nodechart.lua
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-nodechart.lua
@@ -62,8 +62,8 @@ function formatters.dir(n,comment)
return format("\\doFLOWdirnode{%s}{%s}{%s}",comment,"dir",n.dir)
end
-function formatters.localpar(n,comment)
- return format("\\doFLOWdirnode{%s}{%s}{%s}",comment,"localpar",n.dir)
+function formatters.par(n,comment)
+ return format("\\doFLOWdirnode{%s}{%s}{%s}",comment,"par",n.dir)
end
-- I will make a dedicated set of shapes for this.
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-ntb-to-xtb.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-ntb-to-xtb.mkiv
index 55b4ab25926..d48191ebc3d 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-ntb-to-xtb.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-ntb-to-xtb.mkiv
@@ -1,4 +1,8 @@
-\loadmkvifile{tabl-xnt}
+\ifcase\contextlmtxmode
+ \loadmkvifile{tabl-xnt}
+\else
+ \loadmklxfile{tabl-xnt}
+\fi
\mapTABLEtoxtable
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-oldfun.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-oldfun.mkiv
index 7ec779c41cb..f20d7d8e961 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-oldfun.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-oldfun.mkiv
@@ -648,7 +648,7 @@
\dontcomplain
\setuptolerance[\v!verytolerant]% == \tolerance4500
\hsize#1%
- \def\\{\softbreak}%
+ \enforced\def\\{\softbreak}%
\!!heighta#4%
\!!heightb#2%
\doloop
@@ -690,8 +690,8 @@
\advance\scratchdimen#2\relax
\NormalizeFontWidth
#1%
- {\def\+{\global\settrue\NFSpread\gobbleuntil\relax}%
- \def\\{\gobbleuntil\relax}% newline
+ {\enforced\def\+{\global\settrue\NFSpread\gobbleuntil\relax}%
+ \enforced\def\\{\gobbleuntil\relax}% newline
\setupspacing
#6\relax}%
{\scratchdimen}%
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-oldnum.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-oldnum.mkiv
index a240cdb58c3..5109cca1225 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-oldnum.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-oldnum.mkiv
@@ -109,7 +109,7 @@
{\mbox{\grabdigit#1\relax}} % adding $ $ goes wrong in tabulate
\def\grabdigit
- {\futurelet\next\scandigit}
+ {\futurelet\nexttoken\scandigit}
%D Watch the test for \type {\nextobeyedline}, because the
%D endofline token can be \type {\def'd}, not \type {\let}'d,
@@ -119,15 +119,15 @@
\ifx\normalmathshift\undefined \let\normalmathshift=$ \fi
\unexpanded\def\scandigit
- {\ifx\next\blankspace
+ {\ifx\nexttoken\blankspace
\let\next\handledigits
- \else\ifx\next\nextobeyedline % the indirect one
+ \else\ifx\nexttoken\nextobeyedline % the indirect one
\let\next\handledigits
- \else\ifx\next\bgroup
+ \else\ifx\nexttoken\bgroup
\let\next\handledigits
- \else\ifx\next\egroup
+ \else\ifx\nexttoken\egroup
\let\next\handledigits
- \else\ifx\next\normalmathshift
+ \else\ifx\nexttoken\normalmathshift
\let\next\handledigits
\else
\let\next\collectdigit
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-punk.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-punk.mkiv
index 47f1a0177ff..9eb7411babb 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-punk.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-punk.mkiv
@@ -17,6 +17,11 @@
%D https://www.youtube.com/watch?v=g5c2Htj8Vtw
%D \stoptyping
+\ifcase\contextlmtxmode\else
+ \writestatus{punk}{use metapost library punk instead}
+ \endinput
+\fi
+
\startluacode
local concat = table.concat
local round = math.round
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv
index 315cb3bed8b..659d5f58dfd 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-scite.mkiv
@@ -311,13 +311,16 @@ moduledata.scite = scite
\stopluacode
-\definetyping[TEX] [option=cld]
-\definetyping[LUA] [option=lua]
+%definetyping[TEX] [option=cld]
+\setuptyping [TEX] [option=cld]
+%definetyping[LUA] [option=lua]
+\setuptyping [LUA] [option=lua]
\definetyping[BTX] [option=bibtex]
\definetyping[MPS] [option=mps]
-\definetyping[MP] [option=mp]
+%definetyping[MP] [option=mp]
+\setuptyping [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.
@@ -336,7 +339,7 @@ moduledata.scite = scite
\unexpanded\def\buff_scite_slxb#1%
{% we can have a side float
\advance\hangindent\numexpr#1+2\relax\scitespaceskip
- \begstrut\hskip#1\scitespaceskip
+ \begstrut\hskip#1\scitespaceskip\relax
\ifcase\hangafter
\hangafter\plusone\relax
\fi}
@@ -378,7 +381,7 @@ moduledata.scite = scite
\let\slxT \lettertilde
\let\slxS \fixedspace
-\let\slxS \buff_scite_slxs
+%let\slxS \buff_scite_slxs
\let\slxF \buff_scite_slxf
\def\module_scite_inherit_typing
@@ -397,6 +400,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 +421,9 @@ moduledata.scite = scite
\dontcomplain
\raggedright
\startcontextcode
- \startlines
+ \startscitelines
\getbuffer[lex]
- \stoplines
+ \stopscitelines
\stopcontextcode
\endgroup}
@@ -432,9 +443,9 @@ moduledata.scite = scite
\module_scite_inherit_typing
\dontcomplain
\raggedright
- \startlines
+ \startscitelines
\getbuffer[lex]
- \stoplines
+ \stopscitelines
\endgroup}
\unexpanded\def\sciteinlinebuffer
@@ -476,14 +487,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/Master/texmf-dist/tex/context/modules/mkiv/m-sql.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-sql.mkiv
index ed9dae99a4e..bb62610ea13 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-sql.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-sql.mkiv
@@ -17,8 +17,8 @@
\registerctxluafile{util-sql}{}
\ifcase\contextlmtxmode\else
- \registerctxluafile{libs-imp-mysql}{}
- \registerctxluafile{libs-imp-sqlite}{}
+ \registerctxluafile{libs-imp-mysql}{autosuffix}
+ \registerctxluafile{libs-imp-sqlite}{autosuffix}
\fi
\setupmodule
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-steps.lua b/Master/texmf-dist/tex/context/modules/mkiv/m-steps.lua
index ce84866a4d5..bbc267274ae 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-steps.lua
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-steps.lua
@@ -399,7 +399,7 @@ end
interfaces.implement {
name = "step_start_chart",
- arguments = { "string", "string" },
+ arguments = "2 strings",
actions = step_start_chart,
}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-steps.mkvi b/Master/texmf-dist/tex/context/modules/mkiv/m-steps.mkvi
index 873015fd659..fb2000d40d2 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-steps.mkvi
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-steps.mkvi
@@ -428,12 +428,16 @@
\startxmlsetups xml:step:define
\xmlsetsetup
{#1}
- {stepchart|steptable|stepaligntable|cells|texts|stepcell|cell|text}
+ {stepchart|steptable|stepaligntable|cells|texts|stepcell|cell|text|br}
{xml:step:*}
\stopxmlsetups
\xmlregistersetup{xml:step:define}
+\startxmlsetups xml:step:br
+ \crlf
+\stopxmlsetups
+
\startxmlsetups xml:step:stepchart
\startSTEPchart[\c!category=\xmlatt{#1}{class}]
\xmlflush{#1}
@@ -492,9 +496,17 @@
\stopxmlsetups
\startxmlsetups xml:step:text
- \text
- [\xmlatt{#1}{class}]
- {\xmlflush{#1}}
+ \doifelse {\xmlatt{#1}{option}} {paragraph} {
+ \text
+ [\xmlatt{#1}{class}]
+ {\framed
+ [\c!location=\v!middle,\c!align={\v!lohi,\v!flushleft},\c!offset=0pt,\c!frame=\v!no]
+ {\ignorespaces\xmlflush{#1}\removeunwantedspaces}}
+ } {
+ \text
+ [\xmlatt{#1}{class}]
+ {\xmlflush{#1}}
+ }
\stopxmlsetups
\protect
@@ -519,11 +531,21 @@
\startbuffer
<steptable>
- <cell> some cell </cell>
- <text> some text </text>
- <cell> some cell </cell>
- <text> some text </text>
- <cell> some cell </cell>
+ <cell> some cell A</cell>
+ <text> some text 1</text>
+ <cell> some cell B</cell>
+ <text> some text 2</text>
+ <cell> some cell C</cell>
+</steptable>
+\stopbuffer
+
+\typebuffer \processxmlbuffer
+
+\startbuffer
+<steptable>
+ <cell> some cell A</cell>
+ <text option="paragraph"> some more<br/>text 1</text>
+ <cell> some cell B</cell>
</steptable>
\stopbuffer
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-system-aliasing.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-system-aliasing.mkiv
new file mode 100644
index 00000000000..4661cc503a1
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-system-aliasing.mkiv
@@ -0,0 +1,120 @@
+%D \module
+%D [ file=m-system-aliasing,
+%D version=2020.07.08,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Loading generic stuff,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[system-aliasing]
+
+\startluacode
+ local next = next
+ local find, topattern = string.find, string.topattern
+
+ local aliases = { }
+ local replacer = false
+ local filenames = false
+ local wildcards = false
+ local enabled = false
+
+ local report = logs.reporter("system", "aliasing")
+
+ -- This is not yet perfect as we actually need to quit at a non token.
+
+ interfaces.implement {
+ name = "registeralias",
+ public = true,
+ arguments = { "csname", "csname" },
+ actions = function(old,new)
+ aliases[old] = new
+ replacer = false
+ end
+ }
+
+ interfaces.implement {
+ name = "registeraliasfile",
+ public = true,
+ arguments = "string",
+ actions = function(name)
+ if find(name,"%*") then
+ name = topattern(name)
+ if wildcards then wildcards[name] = true else wildcards = { [name] = true } end
+ else
+ if filenames then filenames[name] = true else filenames = { [name] = true } end
+ end
+ if not enabled then
+ utilities.sequencers.appendaction(
+ resolvers.openers.helpers.textfileactions,
+ "system","resolvers.macros.processgeneric"
+ )
+ utilities.sequencers.enableaction(
+ resolvers.openers.helpers.textfileactions,
+ "resolvers.macros.processgeneric"
+ )
+ enabled = true
+ end
+ end
+ }
+
+ local function found(name)
+ if filenames and filenames[name] then
+ return true
+ end
+ if wildcards then
+ for k, v in next, wildcards do
+ if find(name,k) then
+ return true
+ end
+ end
+ end
+ return false
+ end
+
+ local Cs, lpegmatch = lpeg.Cs, lpeg.match
+
+ local utfchartabletopattern = lpeg.utfchartabletopattern
+ local utf8character = lpeg.patterns.utf8character
+ local escapecharacter = lpeg.P("\\")
+ local terminal = lpeg.S([[`"'~@#$%^&_-+/*=(){}[]<>:;,.!?|\\]])
+ + lpeg.P(-1)
+ local lpegmatch = lpeg.match
+
+ function resolvers.macros.processgeneric(str,name)
+ if found(name) then
+ report("file %a",name)
+ if not replacer then
+ replacer = Cs( (
+ escapecharacter
+ * (utfchartabletopattern(aliases) / aliases)
+ * terminal
+ + utf8character
+ )^0 )
+ end
+ str = lpegmatch(replacer,str) or str
+ end
+ return str
+ end
+
+\stopluacode
+
+\registeralias \protected \normalprotected
+\registeralias \unexpanded \normalunexpanded
+\registeralias \expanded \normalexpanded
+
+%D \starttyping
+%D \registeraliasfile{rubish.tex}
+%D \registeraliasfile{generic/*.tex}
+%D
+%D % e.g. \def\foo{\unexpanded{test}}
+%D
+%D \input rubish.tex
+%D \input generic/foo.tex
+%D \stoptyping
+
+\stopmodule
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-system-readers.mkxl b/Master/texmf-dist/tex/context/modules/mkiv/m-system-readers.mkxl
new file mode 100644
index 00000000000..a077b20a313
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-system-readers.mkxl
@@ -0,0 +1,148 @@
+%D \module
+%D [ file=m-system-readers,
+%D version=2021.02.13,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Reading from files,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[system-readers]
+
+% \unprotect
+%
+% \installcorenamespace {markedlines}
+%
+% \permanent\protected\def\startmarkedlines[#1]%
+% {\edef\scratchstring{#1}%
+% \scratchcounter\numexpr\inputlineno+\plusone\relax
+% \gobbleuntilandfinalize\stopmarkedlines}
+%
+% \permanent\protected\def\stopmarkedlines
+% {\edefcsname\??markedlines\scratchstring\endcsname
+% {{\the\scratchcounter}{\the\numexpr\inputlineno+\minusone\relax}}}
+%
+% \protected\def\firstmarkedline#1%
+% {\numexpr
+% \ifcsname\??markedlines#1\endcsname
+% \normalexpanded{\noexpand\firstoftwoarguments\lastnamedcs}%
+% \else
+% \zerocount
+% \fi
+% \relax}
+%
+% \protected\def\lastmarkedline#1%
+% {\numexpr
+% \ifcsname\??markedlines#1\endcsname
+% \normalexpanded{\noexpand\secondoftwoarguments\lastnamedcs}%
+% \else
+% \zerocount
+% \fi
+% \relax}
+%
+% \protected\def\markedlines#1%
+% {\ifcsname\??markedlines\scratchstring\endcsname\lastnamedcs\else{0}{0}\fi}
+%
+% \protect
+
+\startluacode
+
+ local createtoken = token.create
+ local gobbletoken = token.gobble
+ local integer_value = tokens.values.integer
+
+ local marked = { }
+
+ interfaces.implement {
+ name = "startmarkedlines",
+ public = true,
+ protected = true,
+ arguments = "optional",
+ actions = function(tag)
+ local start = status.readstate.linenumber + 1
+ gobbletoken(createtoken("startmarkedlines"),createtoken("stopmarkedlines"))
+ local state = status.readstate
+ marked[tag] = { state.filename, start, state.linenumber - 1 }
+ end
+ }
+
+
+ interfaces.implement {
+ name = "markedfilename",
+ public = true,
+ -- usage = "value",
+ arguments = "string",
+ actions = function(tag)
+ local m = marked[tag]
+ -- return m and m[1] or ""
+ context(m and m[1] or "")
+ end
+ }
+
+ interfaces.implement {
+ name = "firstmarkedline",
+ public = true,
+ usage = "value",
+ arguments = "string",
+ actions = function(tag)
+ local m = marked[tag]
+ return integer_value, m and m[2] or 0
+ end
+ }
+
+ interfaces.implement {
+ name = "lastmarkedline",
+ public = true,
+ usage = "value",
+ arguments = "string",
+ actions = function(tag)
+ local m = marked[tag]
+ return integer_value, m and m[3] or 0
+ end
+ }
+
+\stopluacode
+
+\continueifinputfile{m-system-readers.mkxl}
+
+\starttext
+
+\startmarkedlines[test]
+SOME LINE 1
+SOME LINE 2
+SOME LINE 3
+SOME LINE 4
+\stopmarkedlines
+
+\startmarkedlines[more]
+SOME MORE 1
+SOME MORE 2
+SOME MORE 3
+SOME MORE 4
+\stopmarkedlines
+
+\begingroup
+ \newlocalread\myreada
+ \immediate\openin\myreada {\markedfilename{test}}
+ \dostepwiserecurse{\lastmarkedline{test}}{\firstmarkedline{test}}{-1}{
+ \readline\myreada line #1 to \scratchstring #1 : \scratchstring \par
+ }
+ \immediate\closein\myreada
+\endgroup
+
+\blank
+
+\begingroup
+ \newlocalread\myreada
+ \immediate\openin\myreada {\markedfilename{more}}
+ \dostepwiserecurse{\firstmarkedline{more}}{\lastmarkedline{more}}{1}{
+ \read \myreada line #1 to \scratchstring #1 : \scratchstring \par
+ }
+ \immediate\closein\myreada
+\endgroup
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-tikz.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-tikz.mkiv
new file mode 100644
index 00000000000..9267f90d49b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-tikz.mkiv
@@ -0,0 +1,75 @@
+%D A fixed variant if the t-tikz module distributed with tikz.
+
+\ifdefined\pdflastxpos \else
+ \unprotect
+ \frozen\overloaded\protected\def\pdflastxpos{\numexpr\clf_lastxpos\relax}
+ \frozen\overloaded\protected\def\pdflastypos{\numexpr\clf_lastypos\relax}
+ \protect
+\fi
+
+
+\pushoverloadmode
+
+ \pushcatcodetable
+
+ \setcatcodetable\texcatcodes
+
+ \catcode`\@=11
+ \catcode`\|=12
+ \catcode`\!=12
+
+ \input t-pgf.tex
+ \input t-pgffor.tex
+ \input tikz.code.tex
+
+ \popcatcodetable
+
+\popoverloadmode
+
+\permanent\protected\def\tikzerrormessage#1#2#3%
+ {\writestatus{#1}{#2}}
+
+\ifcase\contextlmtxmode
+
+ \let\starttikzsettings\relax
+ \let\stoptikzsettings \relax
+
+ \protected\def\starttikzpicture
+ {% \dontleavehmode
+ \begingroup
+ \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
+ \tikzpicture}
+
+ \protected\def\stoptikzpicture
+ {\endtikzpicture
+ \endgroup}
+
+\else
+
+ % for now:
+
+ \overloadmode\zerocount
+
+ % but this will be mandate for settings outside the start .. stop
+
+ \permanent\protected\def\starttikzsettings
+ {\pushoverloadmode}
+
+ \permanent\protected\def\stoptikzsettings
+ {\popoverloadmode}
+
+ \permanent\protected\def\starttikzpicture
+ {\dontleavehmode
+ \hcontainer\bgroup
+ % \pushoverloadmode
+ \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
+ \tikzpicture}
+
+ \permanent\protected\def\stoptikzpicture
+ {\endtikzpicture
+ % \popoverloadmode
+ \egroup}
+
+\fi
+
+\stopmodule
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-timing.mkxl b/Master/texmf-dist/tex/context/modules/mkiv/m-timing.mkxl
new file mode 100644
index 00000000000..3edfd14e235
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-timing.mkxl
@@ -0,0 +1,113 @@
+%D \module
+%D [ file=m-timing,
+%D version=2007.12.23,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Timing,
+%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 Todo: adapt to latest metafun magic.
+
+\ifdefined\ShowNamedUsage \endinput \fi
+
+%D Written at the end of 2007, this module is dedicated to Taco. Reaching this
+%D point in \LUATEX\ was a non trivial effort. By visualizing a bit what happens
+%D when pages come out of \LUATEX, you may get an idea what is involved. It took
+%D much time an dedication to reach this point in the development. Add to that
+%D those daily Skype intense discussion, testing and debugging moments. Time flies
+%D but progress is impressive. The motto of this module could be: what you see
+%D is what you get. An there is much more to come \unknown.
+
+% \usemodule[timing]
+% \setupcolors[state=start]
+% \starttext
+% \dorecurse{200}{\input tufte \par} \ShowUsage{}
+% \stoptext
+
+\definecolor[usage:line] [darkred]
+\definecolor[usage:time] [darkblue]
+\definecolor[usage:frame][darkgray]
+
+\ctxloadluafile{trac-tim.lmt}
+
+\startluacode
+local progress = moduledata.progress
+
+function progress.show(filename,names,other)
+ if not filename or filename == "" then
+ filename = progress.defaultfilename or ""
+ end
+ for n, name in pairs(progress.names(filename)) do
+ if string.find(name,names) and name ~= other and name ~= "variables: lasttime" then
+ context.ShowNamedUsage(filename,name or "",other or "")
+ end
+ end
+end
+\stopluacode
+
+\startnotmode[no-timing]
+ \appendtoks\ctxlua{moduledata.progress.store()}\to\everystarttext
+ \appendtoks\ctxlua{moduledata.progress.store()}\to\everyshipout
+ \ctxlua{luatex.registerstopactions(function() moduledata.progress.save() end)}
+\stopnotmode
+
+\permanent\protected\def\ShowNamedUsage#1#2#3%
+ {\setbox\scratchbox\vbox\bgroup
+ \startMPcode{doublefun}
+ begingroup ; save p, q, b, h, w ;
+ path p, q, b ; numeric h, w ;
+ p := \cldcontext{moduledata.progress.path("#1","#2")} ;
+ % p := p shifted -llcorner p ;
+ if bbwidth(p) > 0 :
+ h := 100 ; w := 2 * h ;
+ w := \the\textwidth-3pt ; % correct for pen
+ p := p xstretched w ;
+ b := boundingbox (llcorner p -- llcorner p shifted (w,h)) ;
+ pickup pencircle scaled 3pt ; linecap := butt ;
+ draw b withcolor \MPcolor{usage:frame} ;
+ draw p withcolor \MPcolor{usage:line} ;
+ if ("#3" <> "") and ("#3" <> "#2") :
+ q := \cldcontext{moduledata.progress.path("#1","#3")} ;
+ % q := q shifted -llcorner q ;
+ if bbwidth(q) > 1 :
+ q := q xstretched w ;
+ pickup pencircle scaled 1.5pt ; linecap := butt ;
+ draw q withcolor \MPcolor{usage:time} ;
+ fi ;
+ fi ;
+ fi ;
+ endgroup ;
+ \stopMPcode
+ \egroup
+ \scratchdimen\wd\scratchbox
+ \ifdim\scratchdimen>\zeropoint
+ \startlinecorrection[blank]
+ \box\scratchbox \endgraf
+ \hbox to \scratchdimen\bgroup
+ \tttf\strut\detokenize{#2}\hss
+ \scratchcounter =\cldcontext{moduledata.progress.set("#1","\detokenize{#2}")}\relax
+ \scratchcounterone =\cldcontext{moduledata.progress.bot("#1","\detokenize{#2}")}\relax
+ \scratchcountertwo =\cldcontext{moduledata.progress.top("#1","\detokenize{#2}")}\relax
+ \scratchcounterthree=\numexpr\scratchcountertwo-\scratchcounterone\relax
+ \ifnum\scratchcounter >\zerocount set:\the\scratchcounter \quad\fi
+ \ifnum\scratchcounterthree>\zerocount inc:\the\scratchcounterthree\quad\fi
+ \ifnum\scratchcounterone >\zerocount min:\the\scratchcounterone \quad\fi
+ \ifnum\scratchcountertwo >\zerocount max:\the\scratchcountertwo \quad\fi
+ pages:\cldcontext{moduledata.progress.pages("#1")}%
+ \egroup
+ \stoplinecorrection
+ \fi}
+
+\permanent\protected\def\LoadUsage #1{\ctxlua{moduledata.progress.convert("#1")}}
+\permanent\protected\def\ShowUsage #1{\ctxlua{moduledata.progress.show("#1",".*", "variables: elapsed")}}
+\permanent\protected\def\ShowMemoryUsage #1{\ctxlua{moduledata.progress.show("#1","memory:.*","variables: elapsed")}}
+\permanent\protected\def\ShowNodeUsage #1{\ctxlua{moduledata.progress.show("#1","nodes:.*", "variables: elapsed")}}
+\permanent\protected\def\ShowFilteredUsage#1#2{\ctxlua{moduledata.progress.show("#1","#2", "variables: elapsed")}}
+\permanent\protected\def\ShowSimpleUsage #1#2{\ctxlua{moduledata.progress.show("#1","#2")}}
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/m-visual.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/m-visual.mkiv
index 6ec0a52b0af..8a49861cdbe 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/m-visual.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/m-visual.mkiv
@@ -56,9 +56,7 @@
\unexpanded\def\fakelines#1#2% min max / 3 10
{\fakeparindent
\scratchdimen\hsize
- \ifindentation
- \advance\scratchdimen -\parindent
- \fi
+ \advance\scratchdimen -\parindent
\fakerule\scratchdimen\break
\getrandomcount\scratchcounter{\ifcase0#1 3\else#1\fi}{\ifcase0#2 10\else#2\fi}%
\dorecurse\scratchcounter{\fakerule\hsize}%
@@ -128,7 +126,7 @@
\unexpanded\def\fakeparindent
{\noindent
- \ifindentation
+ \ifzeropt\parindent\else
\ifx\dofakedroppedcaps\relax
{\fakeparindentcolor
\vrule
@@ -653,10 +651,10 @@
\appendtoks\dontshowwhatsits\to\everystoptext}
\unexpanded\def\immediatewhatsit
- {\bgroup\futurelet\next\doimmediatewhatsit}
+ {\bgroup\futurelet\nexttoken\doimmediatewhatsit}
\unexpanded\def\doimmediatewhatsit
- {\ifx\next\write
+ {\ifx\nexttoken\write
\egroup\immediatewritetrue
\else
\egroup\expandafter\normalimmediate
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-article-titlepage.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-article-titlepage.mkiv
index abfb957c2fa..7579d421fa8 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-article-titlepage.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-article-titlepage.mkiv
@@ -16,7 +16,7 @@
\unprotect
% \startalignment[middle]
-% \let\\=\par
+% \enforced\let\\\par
% \bfb
% \setupinterlinespace
% \documentvariable {subject}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-coverage.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-coverage.mkiv
index 98a5c00a495..2d18708421b 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-coverage.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-coverage.mkiv
@@ -100,7 +100,7 @@
% list = {
% "cambria.ttc(Cambria Math)",
% "xits-math.otf",
- % -- "stixmath-regular.otf",
+ % -- "stixtwomath-regular.otf", -- watch out: the name changes
% "latinmodern-math.otf",
% -- "lucidabrightmathot.otf",
% -- "lucidabrightmathot-demi.otf",
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-shapes.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-shapes.mkiv
index 90b9c1f6496..7dd39c07d0c 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-shapes.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-shapes.mkiv
@@ -106,8 +106,8 @@
% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0xF0299} \stopTEXpage
% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{NameMe.1190} \stopTEXpage
- \startTEXpage[offset=0pt]\ShowGlyphShape{file:stix2math.otf}{20bp}{0x1D44A}\stopTEXpage
- \startTEXpage[offset=0pt]\ShowGlyphShape{file:stix2math.otf}{20bp}{0x1D44C}\stopTEXpage
+ \startTEXpage[offset=0pt]\ShowGlyphShape{file:stixtwomath-regular.otf}{20bp}{0x1D44A}\stopTEXpage
+ \startTEXpage[offset=0pt]\ShowGlyphShape{file:stixtwomath-regular.otf}{20bp}{0x1D44C}\stopTEXpage
% \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{20bp}{0x00066}\stopTEXpage
% \startTEXpage[offset=0pt]\ShowGlyphShape{name:cambria-math}{20bp}{0x1D453}\stopTEXpage
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-tables.lua b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-tables.lua
index d9d7205dec1..8673ef398cc 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-tables.lua
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-tables.lua
@@ -27,6 +27,8 @@ local setlink = nodes.setlink
local hpack = nodes.hpack
local applyvisuals = nodes.applyvisuals
+local lefttoright_code = nodes.dirvalues.lefttoright
+
local handle_positions = fonts.handlers.otf.datasetpositionprocessor
local handle_injections = nodes.injections.handler
@@ -285,17 +287,9 @@ function tabletracers.showpositionings(specification)
if resources then
- local direction = "TLT"
-
+ local direction = lefttoright_code -- not that relevant probably
local sequences = resources.sequences
local marks = resources.marks
-
- if tonumber(direction) == -1 or direction == "TRT" then
- direction = "TRT"
- else
- direction = "TLT"
- end
-
local visuals = "fontkern,glyph,box"
local datasets = fonts.handlers.otf.dataset(tfmdata,fontid,0)
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv
index 5336f602472..6e4b1773f0f 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.mkiv
@@ -103,6 +103,12 @@
% \showfontvariations
% [font=file:sourcecode-regular.otf]
+% \showfontvariations
+% [font=file:sourcecodevariable-roman.otf]
+
+% \showfontvariations
+% [font=file:sourcecodevariable-italic.otf]
+
% \showfontvariations
% [font=file:AmstelvarAlpha-VF.ttf]
@@ -112,4 +118,14 @@
% \showfontvariations
% [font=file:sitka.ttc]
+% For Alan:
+
+% \usemodule[article-basic]
+% \usemodule[fonts-variable]
+% \starttext
+% \showfontvariations[font=file:goldmansansitvf_wght.ttf]
+% \showfontvariations[font=file:goldmansansvf_wght.ttf]
+% \showfontvariations[font=file:goldmansanscdvf_wght.ttf]
+% \stoptext
+
\stoptext
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-inf-01.mkvi b/Master/texmf-dist/tex/context/modules/mkiv/s-inf-01.mkvi
index 67fc45d46fc..7cebfd9bb5f 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-inf-01.mkvi
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-inf-01.mkvi
@@ -31,7 +31,6 @@
local list = { }
local size = { }
local comp = { }
- local used = setmetatableindex("table")
local nope = setmetatableindex("number")
local omit = {
@@ -44,7 +43,7 @@
"colo%-pan.tex", ".*test.*"
}
local types = {
- "tex", "mkii", "mkiv", "mkvi", "mkxl", "mklx", "lua", -- "mpiv"
+ "tex", "mkii", "mkiv", "mkvi", "lua", "mkxl", "mklx", "lmt" -- "mpiv"
}
local patterns = {
"^([a-z][a-z][a-z][a-z])%-[a-z0-9%-]+%.[a-z]+",
@@ -90,7 +89,7 @@
end
local data = io.loaddata(name)
if data then
- if suffix == "lua" then
+ if suffix == "lua" or suffix == "lmt" then
data = gsub(data,"%-%-%[%[.-%]%]%-%-","")
data = gsub(data,"%-%-.-[\n\r]","")
else
@@ -120,15 +119,6 @@
for i=1,#types do
collect(list,types[i],i)
end
- for category in next, list do
- pattern ="{"..category.."%-"
- for suffix, t in next, used do
- local data = io.loaddata(resolvers.find_file("context."..suffix))
- if data and find(data,pattern) then
- t[category] = true
- end
- end
- end
end
local max, what = 0, (what == "size" and size) or list
for k, v in table.sortedpairs(what) do
@@ -141,9 +131,9 @@
function document.context_state_1(what)
local max, what, norm = prepare(what)
- context.starttabulate { "|Tl|T|T|T|T|T|T|T|" }
+ context.starttabulate { "|Tl|T|T|T|T|T|T|T|T|" }
context.NC()
- context(category)
+ context("category")
context.NC()
for i=1,#types do
local n, m = 0, 0
@@ -156,20 +146,13 @@
context.Top(types[i],norm(max),n,m)
context.NC()
end
- context.NC()
+ -- context.NC()
context.NR()
context.HL()
for k, v in table.sortedpairs(what) do
local c = what == size and comp[k] or nope
context.NC()
- context("\\bf %s~%s~~%s~~%s~~%s~~%s",
- (used.mkii[k] and "ii") or "~~",
- (used.mkiv[k] and "iv") or "~~",
- (used.mkvi[k] and "vi") or "~~",
- (used.mkiv[k] and "xl") or "~~",
- (used.mkvi[k] and "lx") or "~~",
- k
- )
+ context(k)
context.NC()
for i=1,#types do
context.Bar(types[i],v[i],c[i],f_norm(norm(v[i])))
@@ -201,13 +184,14 @@
\definecolor[bar:mkxl][middlemagenta]
\definecolor[bar:mklx][middlecyan]
\definecolor[bar:lua] [middlegray]
+\definecolor[bar:lmt] [middleorange]
\newcount\UpCounter
\starttexdefinition Top #what#fraction#total#bigones
\hbox to 7em{\hss#total}%
\enspace
- \hbox {{\bf#what}\ifnum#total=#bigones\else~#bigones\rlap{~+}\fi\hss}%
+ \hbox to 4em{{{\bf#what}\ifnum#total=#bigones\else\ifnum#bigones>0~#bigones\rlap{~+}\fi\fi\hss}}%
\stoptexdefinition
\starttexdefinition Bar #color#size#nobigones#fraction
@@ -215,6 +199,8 @@
\hbox to 7em{\hss\ifcase#nobigones\else\llap{-~}\fi#size}%
\enspace
\blackrule[color=bar:#color,width=#fraction\dimexpr 20em\relax,height=.8\strutht]%
+% \quad
+% \quad
\fi
\stoptexdefinition
@@ -269,9 +255,9 @@
{The size of (core) files used in ConTeXt (- : large data files excluded; + : large data files included; comment and spaces removed)}
{1}{size}
\Show
- {The relative number of files used in ConTeXt (tex, mkii, mkiv, mkvi, mkxl, mklx, lua).}
+ {The relative number of files used in ConTeXt (tex, mkii, mkiv, mkvi, mkxl, mklx, lua, lmt).}
{2}{number}
\Show
- {The relative size of files used in ConTeXt (tex, mkii, mkiv, mkvi, mkxl, mklx, lua).}
+ {The relative size of files used in ConTeXt (tex, mkii, mkiv, mkvi, mkxl, mklx, lua, lmt).}
{2}{size}
\stoptext
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-languages-hyphenation.lua b/Master/texmf-dist/tex/context/modules/mkiv/s-languages-hyphenation.lua
index 65fd1ab1443..2ba265b5354 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-languages-hyphenation.lua
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-languages-hyphenation.lua
@@ -40,8 +40,8 @@ local getdisc = nuts.getdisc
local getattr = nuts.getattr
local getfont = nuts.getfont
local getfield = nuts.getfield
-local getlang = nuts.getlang
-local setlang = nuts.setlang
+local getlanguage = nuts.getlanguage
+local setlanguage = nuts.setlanguage
local setlink = nuts.setlink
local setdisc = nuts.setdisc
local setfield = nuts.setfield
@@ -63,10 +63,12 @@ local states = table.setmetatableindex(function(t,k)
}
end)
+local currentlanguage = language.current or function() return tex.language end
+
interfaces.implement {
name = "storelanguagestate",
actions = function()
- states[tex.language] = {
+ states[currentlanguage()] = {
lefthyphenmin = tex.lefthyphenmin,
righthyphenmin = tex.righthyphenmin,
hyphenationmin = tex.hyphenationmin,
@@ -128,17 +130,6 @@ local function mark(head,marked,w,h,d,how)
end
end
-local function getlanguage(head,l,left,right)
- local t = { }
- for n in nextglyph, tonut(head) do
- t[n] = {
- getlang(n),
- getfield(n,"left"),
- getfield(n,"right"),
- }
- end
-end
-
local langs = { }
local tags = { }
local noflanguages = 0
@@ -151,7 +142,7 @@ function moduledata.languages.hyphenation.showhyphens(head)
-- somehow assigning -1 fails
for n in nextglyph, tonut(head) do
cached[n] = {
- getlang(n),
+ getlanguage(n),
getfield(n,"left"),
getfield(n,"right")
}
@@ -164,7 +155,7 @@ function moduledata.languages.hyphenation.showhyphens(head)
local lmin = s.lefthyphenmin
local rmin = s.righthyphenmin
for n in next, cached do
- setlang(n,l)
+ setlanguage(n,l)
setfield(n,"left",lmin)
setfield(n,"right",rmin)
end
@@ -176,7 +167,7 @@ function moduledata.languages.hyphenation.showhyphens(head)
mark(head,marked[i],1/16,l/2,l/4,"hyphenation:"..(colorbytag and tags[i] or i))
end
for n, d in next, cached do
- setlang(n,d[1])
+ setlanguage(n,d[1])
setfield(n,"left",d[2])
setfield(n,"right",d[3])
end
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-magazine-basic.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-magazine-basic.mkiv
index d45fe6f601a..c5995162a4f 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-magazine-basic.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-magazine-basic.mkiv
@@ -110,8 +110,9 @@
\doifoddpageelse {
\reuseMPgraphic{rightpaper}
} {
- \reuseMPgraphic{leftpaper}}
+ \reuseMPgraphic{leftpaper}
}
+ }
\stopsetups
@@ -459,8 +460,8 @@
\definetyping[xtyping] [style=\ttx]
\definetyping[xxtyping][style=\ttxx]
-\definetyping[ntyping] \setuptyping[ntyping][style=\narrowtt]
-\definetype [ntype] \setuptype [ntype] [style=\narrowtt]
+% \definetyping[ntyping] \setuptyping[ntyping][style=\narrowtt]
+% \definetype [ntype] \setuptype [ntype] [style=\narrowtt]
\setupdocument
[main={\doifelsemode{atpragma}{This Way}{My Way}},
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-maps.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-maps.mkiv
index af646b2e1ee..8775f565e5a 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-maps.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-maps.mkiv
@@ -363,8 +363,8 @@
\def\doarticleheader
{\startbaselinecorrection
\bgroup
- \hsize = 457pt
- \let\\\crlf
+ \hsize= 457pt
+ \enforced\let\\\crlf
\blank[35pt,force]
\switchtobodyfont[24pt]
\startalign[flushleft,verytolerant,extremestretch]
@@ -419,7 +419,8 @@
\def\signArticle
{\doifnothing
{\MapsSkipFooter}
- {\blank[line]\let\\\crlf
+ {\blank[line]%
+ \enforced\let\\\crlf
\noindent\switchtobodyfont[ss,9pt]%
\MapsAuthor
\doifsomething{\MapsAddress}{\\\MapsAddress}%
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-module-basic.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-module-basic.mkiv
index 74621b2a3a8..7024cd91a0f 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-module-basic.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-module-basic.mkiv
@@ -25,8 +25,6 @@
%D him when you run into problems. Bugs in this style can be sent to
%D Hans.
-\showframe
-
\usemodule[abbreviations-words]
\startmodule[modules-basics]
@@ -45,20 +43,24 @@
\let\module\setupdocument
-\definepalet [module:unknown] [localone=black,localtwo=white]
+\definepalet [module:unknown] [locallocalone=darkyellow,localtwo=darkred,localthree=white,localfour=darkgray]
-\definepalet [module:tex] [localone=blue,localtwo=green]
-\definepalet [module:mkii] [localone=blue,localtwo=green]
-\definepalet [module:mkiv] [localone=blue,localtwo=green]
-\definepalet [module:mkvi] [localone=blue,localtwo=green]
+\definepalet [module:tex] [localone=darkblue,localtwo=darkgreen,localthree=white,localfour=darkgray]
+\definepalet [module:mkii] [localone=darkblue,localtwo=darkgreen,localthree=white,localfour=darkgray]
+\definepalet [module:mkiv] [localone=darkblue,localtwo=darkgreen,localthree=white,localfour=darkgray]
+\definepalet [module:mkvi] [localone=darkblue,localtwo=darkgreen,localthree=white,localfour=darkgray]
+\definepalet [module:mkxl] [localone=darkblue,localtwo=darkgreen,localthree=white,localfour=darkgray]
+\definepalet [module:mklx] [localone=darkblue,localtwo=darkgreen,localthree=white,localfour=darkgray]
-\definepalet [module:lua] [localone=red,localtwo=green]
-\definepalet [module:cld] [localone=red,localtwo=green]
+\definepalet [module:lua] [localone=darkred,localtwo=darkgreen,localthree=white,localfour=darkgray]
+\definepalet [module:lmt] [localone=darkred,localtwo=darkgreen,localthree=white,localfour=darkgray]
+\definepalet [module:cld] [localone=darkred,localtwo=darkgreen,localthree=white,localfour=darkgray]
-\definepalet [module:mp] [localone=red,localtwo=blue]
-\definepalet [module:mpii] [localone=red,localtwo=blue]
-\definepalet [module:mpiv] [localone=red,localtwo=blue]
-\definepalet [module:metapost][localone=red,localtwo=blue]
+\definepalet [module:mp] [localone=darkred,localtwo=darkblue,localthree=white,localfour=darkgray]
+\definepalet [module:mpii] [localone=darkred,localtwo=darkblue,localthree=white,localfour=darkgray]
+\definepalet [module:mpiv] [localone=darkred,localtwo=darkblue,localthree=white,localfour=darkgray]
+\definepalet [module:mpxl] [localone=darkred,localtwo=darkblue,localthree=white,localfour=darkgray]
+\definepalet [module:metapost][localone=darkred,localtwo=darkblue,localthree=white,localfour=darkgray]
\setuppalet
[module:unknown]
@@ -67,12 +69,10 @@
StartPage ;
- color local_white ; local_white := .8white ;
- color local_one ; local_one := \MPcolor{localone} randomized (.6,.8) ;
- color local_two ; local_two := \MPcolor{localtwo} randomized (.3,.4) ;
-
- color local_one ; local_one := .75[\MPcolor{localone},white] ;
- color local_two ; local_two := .75[\MPcolor{localtwo},white] ;
+ color local_one ; local_one := .6 * \MPcolor{localone} ;
+ color local_two ; local_two := .6 * \MPcolor{localtwo} ;
+ color local_three ; local_three := \MPcolor{localthree} ;
+ color local_four ; local_four := \MPcolor{localfour} ;
numeric width ; width := bbwidth Page ;
numeric height ; height := bbheight Page ;
@@ -84,12 +84,13 @@
ddy := 0 ; sx := 60u ;
for i=1 upto (4 randomized 2) :
sy := 7u randomized 3u ;
- fill unitsquare xyscaled(sx,sy) shifted (0,ddy) withcolor local_two ;
+ fill unitsquare xyscaled(sx,sy) shifted (0,ddy)
+ withcolor local_two ;
ddy := ddy + sy + 4u ;
endfor ;
) ;
p := p shifted (dx,dy) shifted - center p ;
- fill boundingbox p enlarged 8u withcolor local_white ;
+ fill boundingbox p enlarged 8u withcolor local_four ;
fill boundingbox p enlarged 4u withcolor local_one ;
draw p ;
enddef ;
@@ -111,7 +112,7 @@
draw anchored.urt(textext("\bf\strut\documentvariable{subtitle}") ysized 1.5cm,urcorner Page shifted (-1cm,-10cm)) ;
draw anchored.urt(textext("\bf\strut\documentvariable{author}") ysized 1.5cm,lrcorner Page shifted (-1cm, 5cm)) ;
draw anchored.urt(textext("\bf\strut\currentdate") ysized 1.5cm,lrcorner Page shifted (-1cm, 3cm)) ;
- ) withcolor .25white ;
+ ) withcolor local_three ;
StopPage ;
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-balls.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-balls.mkiv
index 6774b83407f..14b33f30389 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-balls.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-balls.mkiv
@@ -156,7 +156,7 @@
\unexpanded\def\StartTitlePage
{\startstandardmakeup
\setupalign[middle]
- \unexpanded\def\\{\vfil\bfb\setupinterlinespace}
+ \enforced\protected\def\\{\vfil\bfb\setupinterlinespace}
\bfd\setupinterlinespace
\vfil}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-bars.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-bars.mkiv
index 13c09ff3b80..37f18ffca8d 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-bars.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-bars.mkiv
@@ -68,7 +68,7 @@
\setupheadertexts
[Breskens 2012]
- [\getvariable{document}{title}]
+ [\documentvariable{title}]
\setupbackgrounds
[page]
@@ -99,9 +99,9 @@
\startsetups document:setup
- \doifsomething {\getvariable{document}{color}} {
+ \doifsomething {\documentvariable{color}} {
- \definecolor[maincolor][\getvariable{document}{color}]
+ \definecolor[maincolor][\documentvariable{color}]
}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-boring.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-boring.mkiv
new file mode 100644
index 00000000000..334d6216d5d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-boring.mkiv
@@ -0,0 +1,143 @@
+%D \module
+%D [ file=s-present-boring, % s-pre-15,
+%D version=2020.07.10,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment Boring,
+%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 Because I use a mupdf based viewer and acrobat is not always reliable I nowadays
+%D tend to go for simple presentation styles. They mostly serve as a reminder for
+%D myself of what I'm supposed to talk about. Just demoing often makes more sense,
+%D especially at meetings where there is some interaction.
+
+\startmodule[present-boring]
+
+\setupbodyfont
+ [plex]
+
+\setuppapersize
+ [S6]
+
+\setuplayout
+ [backspace=20pt,
+ topspace=20pt,
+ bottomspace=20pt,
+ header=0pt,
+ footer=0pt,
+ bottom=20pt,
+ bottomdistance=30pt,
+ width=middle,
+ height=fit]
+
+\definecolor[maincolor] [darkblue]
+\definecolor[extracolor][darkyellow]
+\definecolor[darkcolor] [darkgray]
+
+\setupbackgrounds
+ [page]
+ [backgroundoffset=10pt,
+ background=color,
+ backgroundcolor=darkcolor]
+
+\setupbackgrounds
+ [text] [text]
+ [backgroundoffset=10pt,
+ background=color,
+ backgroundcolor=maincolor]
+
+\setupbackgrounds
+ [bottom] [text]
+ [backgroundoffset=10pt,
+ background=color,
+ backgroundcolor=extracolor]
+
+\setupcolors
+ [textcolor=white]
+
+\setuphead
+ [chapter]
+ [style=\bfc,
+ after={\blank[line,fixed]}]
+
+\setupwhitespace
+ [halfline]
+
+\setupblank
+ [halfline,fixed]
+
+% \setupblank
+% [fixed]
+
+\setuplinenumbering
+ [typing]
+ [style=\txx,
+ color=middlegray]
+
+\setuptyping
+ [numbering=line,
+ location=left,
+ blank=halfline]
+
+\startsetups document:start
+
+ \startpagemakeup
+ \raggedcenter
+ \vfill
+ \dontleavehmode \scale [
+ width=\textwidth
+ ] {
+ \space
+ {\bf \documentvariable{title}}
+ \space
+ }
+ \vfill
+ \dontleavehmode \scale [
+ width=.8\textwidth
+ ] {
+ \space
+ {\bf \documentvariable{banner}}
+ \space
+ }
+ \vfill
+ \vfill
+ \dontleavehmode \scale [
+ width=\textwidth
+ ] {
+ \qquad
+ \color[darkcolor]{\documentvariable{location}}
+ \qquad
+ }
+ \vfill
+ \stoppagemakeup
+
+ \setupbottomtexts [
+ {
+ \words {
+ \documentvariable{title}
+ \quad\emdash\quad
+ \documentvariable{location}
+ \quad\emdash\quad
+ \getmarking[title]
+ }
+ }
+ ]
+
+\stopsetups
+
+\startsetups document:stop
+ %
+\stopsetups
+
+\stopmodule
+
+\continueifinputfile{s-present-boring.mkiv}
+
+\usemodule[present-common]
+
+\inputpresentationfile{context/2020/context-2020-tokens.tex}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-colorful.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-colorful.mkiv
index ed4b5f7c487..f71a297d778 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-colorful.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-colorful.mkiv
@@ -231,7 +231,7 @@
\bfd\setupinterlinespace
\setupalign[middle]
\vfil
- \let\\=\vfil
+ \enforced\let\\\vfil
\scale
[factor=max]\bgroup
\framed
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-funny.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-funny.mkiv
index 4948766adca..3788f94f037 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-funny.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-funny.mkiv
@@ -190,7 +190,7 @@
\bfd\setupinterlinespace
\setupalign[middle]
\vfil
- \def\\{\vfil\bfb\setupinterlinespace}}
+ \enforced\protected\def\\{\vfil\bfb\setupinterlinespace}}
\unexpanded\def\StopTitlePage
{\vfil\vfil\vfil
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-fuzzy.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-fuzzy.mkiv
index ee029b0e605..312cf1ce73e 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-fuzzy.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-fuzzy.mkiv
@@ -125,7 +125,7 @@
\bfd\setupinterlinespace
\setupalign[middle]
\vfil
- \let\\=\vfil}
+ \enforced\let\\\vfil}
\unexpanded\def\StopTitlePage
{\vfil\vfil\vfil
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-green.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-green.mkiv
index e62257ff383..5a57742576d 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-green.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-green.mkiv
@@ -261,7 +261,7 @@
\bfd\setupinterlinespace
\setupalign[middle]
\vfil
- \let\\=\vfil}
+ \enforced\let\\\vfil}
\unexpanded\def\StopTitlePage
{\vfil\vfil\vfil
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-organic.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-organic.mkiv
index 657b786f229..7994205a1ab 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-organic.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-organic.mkiv
@@ -289,7 +289,7 @@
\unexpanded\def\StartTitlePage
{\startstandardmakeup
\switchtobodyfont[big]
- \def\\{\vfill\bfb\let\\=\par}
+ \enforced\protected\def\\{\vfill\bfb\enforced\let\\\par}%
\bfd\setupinterlinespace\gray
\vskip.5cm\relax}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-original.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-original.mkiv
index 1c5e94c8579..50cd6f9ba65 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-original.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-original.mkiv
@@ -213,7 +213,7 @@
\setupinterlinespace
\setupalign[middle]
\vfil
- \let\\=\vfil}
+ \enforced\let\\\vfil}
\unexpanded\def\StopTitlePage
{\vfil\vfil\vfil
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-split.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-split.mkiv
index 48be7ca8199..186075c58dc 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-split.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-split.mkiv
@@ -154,7 +154,7 @@
\unexpanded\def\StartTitlePage
{\startstandardmakeup
\setupalign[middle]
- \unexpanded\def\\{\vfil\bfb\setupinterlinespace}
+ \enforced\protected\def\\{\vfil\bfb\setupinterlinespace}
\bfd\setupinterlinespace
\vfil}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-stack.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-stack.mkiv
index 4cc75404f2e..cda03ae1257 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-stack.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-stack.mkiv
@@ -98,7 +98,7 @@
\unexpanded\def\TitlePage#1%
{\startstandardmakeup
\setupalign[middle]
- \def\\{\vfil\bfb\setupinterlinespace}
+ \enforced\protected\def\\{\vfil\bfb\setupinterlinespace}
\bfd\setupinterlinespace
\vfil#1\vfil\vfil
\stopstandardmakeup}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-stepper.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-stepper.mkiv
index 3dd8d9dcd42..c2f3c018a51 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-stepper.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-stepper.mkiv
@@ -189,7 +189,7 @@
{\setups[fonts:normalize]
\resetsetups[fonts:normalize]
\startstandardmakeup[headerstate=high]
- \def\\{\def\\{\endgraf\quad\quad}\endgraf\quad\ignorespaces#2}%
+ \enforced\protected\def\\{\enforced\protected\def\\{\endgraf\quad\quad}\endgraf\quad\ignorespaces#2}%
#1\setstrut\setupinterlinespace\vfil#3\vfil\vfil
\stopstandardmakeup}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv
index 566a610a4f9..900d8edc605 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-tiles.mkiv
@@ -259,12 +259,12 @@
\switchtobodyfont[\measure{titlepagefont}]
- \let\\=\crlf
+ \enforced\let\\\crlf
\startalignment[flushleft]
\bf
\setupinterlinespace
- \begstrut\getvariable{document}{title}\endstrut\par
+ \begstrut\documentvariable{title}\endstrut\par
\stopalignment
\vfill
@@ -272,7 +272,7 @@
\startalignment[flushright]
\bf
\setupinterlinespace
- \begstrut\getvariable{document}{subtitle}\endstrut\par
+ \begstrut\documentvariable{subtitle}\endstrut\par
\stopalignment
\stoptopicmakeup
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-weird.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-weird.mkiv
index 27ef7b2c26d..641c3d979c4 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-weird.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-weird.mkiv
@@ -288,7 +288,7 @@
\starttexdefinition TitlePage #1
\begingroup
- \def\\{\vskip1ex\bfc\def\\{\vskip1ex\bfb}}
+ \enforced\protected\def\\{\vskip1ex\bfc\def\\{\vskip1ex\bfb}}
\enablemode[SpreadPage]
\StartPage{#1}
\StopPage
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-present-windows.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-present-windows.mkiv
index 22d6fdba15c..422e238016a 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-present-windows.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-present-windows.mkiv
@@ -320,7 +320,7 @@
align=middle]
\startSampleText[middle]
\bfd\setupinterlinespace
- \def\\{\bfb\setupinterlinespace\vfil\def\\{\vfil}}}
+ \enforced\protected\def\\{\bfb\setupinterlinespace\vfil\enforced\protected\def\\{\vfil}}}
\unexpanded\def\StopTitlePage
{\stopSampleText
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-references-show.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-references-show.mkiv
index 72cccce54f1..a693fbc4417 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-references-show.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-references-show.mkiv
@@ -21,7 +21,7 @@
\enablehiddenbackground % trick
-\edef\hiddenbackgroundlist{\hiddenbackgroundlist,trace-references}
+\appendhiddenbackground{trace-references}
\defineoverlay
[trace-references]
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-syntax.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-syntax.mkiv
index d9492af3e54..658343ac560 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-syntax.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-syntax.mkiv
@@ -42,49 +42,49 @@
\unexpanded\def\StartSyntax
{\startlines
% formatters
- \let\Indent \module_syntax_Indent
- \let\Sugar \module_syntax_Sugar
- \let\Something \module_syntax_Something
- \let\Lbrace \module_syntax_Lbrace
- \let\Rbrace \module_syntax_Rbrace
- \let\Lparent \module_syntax_Lparent
- \let\Rparent \module_syntax_Rparent
- \let\Lbracket \module_syntax_Lbracket
- \let\Rbracket \module_syntax_Rbracket
- \let\Or \module_syntax_Or
- \let\Optional \module_syntax_Optional
- \let\Means \module_syntax_Means
- \let\Tex \module_syntax_Tex
- \let\Literal \module_syntax_Literal
- \let\Syntax \module_syntax_Syntax
- \let\Next \module_syntax_Next
- \let\Whatever \module_syntax_Whatever
- \let\Quote \module_syntax_Quote
- \let\Or \module_syntax_Or
- \let\Means \module_syntax_Means
- \let\FlaggedLiteral \module_syntax_FlaggedLiteral
- \let\FlaggedSomething\module_syntax_FlaggedSomething
+ \enforced\let\Indent \module_syntax_Indent
+ \enforced\let\Sugar \module_syntax_Sugar
+ \enforced\let\Something \module_syntax_Something
+ \enforced\let\Lbrace \module_syntax_Lbrace
+ \enforced\let\Rbrace \module_syntax_Rbrace
+ \enforced\let\Lparent \module_syntax_Lparent
+ \enforced\let\Rparent \module_syntax_Rparent
+ \enforced\let\Lbracket \module_syntax_Lbracket
+ \enforced\let\Rbracket \module_syntax_Rbracket
+ \enforced\let\Or \module_syntax_Or
+ \enforced\let\Optional \module_syntax_Optional
+ \enforced\let\Means \module_syntax_Means
+ \enforced\let\Tex \module_syntax_Tex
+ \enforced\let\Literal \module_syntax_Literal
+ \enforced\let\Syntax \module_syntax_Syntax
+ \enforced\let\Next \module_syntax_Next
+ \enforced\let\Whatever \module_syntax_Whatever
+ \enforced\let\Quote \module_syntax_Quote
+ \enforced\let\Or \module_syntax_Or
+ \enforced\let\Means \module_syntax_Means
+ \enforced\let\FlaggedLiteral \module_syntax_FlaggedLiteral
+ \enforced\let\FlaggedSomething\module_syntax_FlaggedSomething
% shortcuts
- \let\FL \module_syntax_FlaggedLiteral
- \let\FS \module_syntax_FlaggedSomething
- \let\L \module_syntax_Literal
- \let\S \module_syntax_Something
- \let\M \module_syntax_Means
- \let\N \module_syntax_Next
- \let\O \module_syntax_Or
- \let\Q \module_syntax_Quote
- \let\LB \module_syntax_Lbrace
- \let\RB \module_syntax_Rbrace
- \let\LP \module_syntax_Lparent
- \let\RP \module_syntax_Rparent
- \let\LS \module_syntax_Lbracket
- \let\RS \module_syntax_Rbracket
- \let\{ \module_syntax_Lbrace
- \let\} \module_syntax_Rbrace
- \let\( \module_syntax_Lparent
- \let\) \module_syntax_Rparent
- \let\[ \module_syntax_Lbracket
- \let\] \module_syntax_Rbracket
+ \enforced\let\FL \module_syntax_FlaggedLiteral
+ \enforced\let\FS \module_syntax_FlaggedSomething
+ \enforced\let\L \module_syntax_Literal
+ \enforced\let\S \module_syntax_Something
+ \enforced\let\M \module_syntax_Means
+ \enforced\let\N \module_syntax_Next
+ \enforced\let\O \module_syntax_Or
+ \enforced\let\Q \module_syntax_Quote
+ \enforced\let\LB \module_syntax_Lbrace
+ \enforced\let\RB \module_syntax_Rbrace
+ \enforced\let\LP \module_syntax_Lparent
+ \enforced\let\RP \module_syntax_Rparent
+ \enforced\let\LS \module_syntax_Lbracket
+ \enforced\let\RS \module_syntax_Rbracket
+ \enforced\let\{ \module_syntax_Lbrace
+ \enforced\let\} \module_syntax_Rbrace
+ \enforced\let\( \module_syntax_Lparent
+ \enforced\let\) \module_syntax_Rparent
+ \enforced\let\[ \module_syntax_Lbracket
+ \enforced\let\] \module_syntax_Rbracket
% precaution
\catcode`\#\othercatcode}
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-system-macros.mkxl b/Master/texmf-dist/tex/context/modules/mkiv/s-system-macros.mkxl
new file mode 100644
index 00000000000..0f26444037b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-system-macros.mkxl
@@ -0,0 +1,311 @@
+%D \module
+%D [ file=s-system-tokens.mkxl,
+%D version=2020.06.02,
+%D title=\CONTEXT\ Style File,
+%D subtitle=System Tokens Checking,
+%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 file is for Wolfgang and Hans and it's used in the transition from \MKIV\
+%D to the more robust \LMTX.
+
+% todo: \permanent\protected\let\select\directselect : same value (add ref)
+%
+% todo: when mutable, remove immutable, decide on how immutable it really is
+%
+% todo: just for the fun of it we can compare the table generated here to mkiv but it
+% needs the same hash exposure as we use in luametatex so i'll do that after all lmtx
+% macros are checked (maybe i need to backport some more but it has a low priority)
+%
+% todo: do we need something similar for lua functions etc (problem: performance hit)
+%
+% todo: and how about metapost ... i need a mp.hashtokens in order to do that and I also
+% need to think about protection there (tricky as we use an avl hash there)
+%
+% public undefined : SmallCaps scitebuffer sciteinlinebuffer
+% single todos : \ \- \\ \_
+
+\enablemode[texmacros]
+\enablemode[metapostmacros]
+% \enablemode[notmarked]
+\enablemode[everything]
+
+\startmodule[system-macros]
+
+\continueifinputfile{s-system-macros.mkxl}
+
+% \usemodule[article-basic] \setuplayout[tight] \setupbodyfont[7pt,tt]
+\usemodule[article-basic] \setuplayout[tight] \setupbodyfont[5pt,tt]
+
+\setupbackgrounds[page][background=color,backgroundcolor=darkgray] \setupcolors[textcolor=white]
+
+\setuppapersize
+ [A4,landscape]
+ [A4,landscape]
+
+\starttext
+
+\startluacode
+
+ if tex.modes.texmacros then
+
+ local context = context
+ local ctx_NC = context.NC
+ local ctx_NR = context.NR
+ local ctx_bold = context.bold
+ local ctx_verb = context.verbatim
+
+ local find = string.find
+ local gsub = string.gsub
+ local create = token.create
+
+ local crap = "[$>%|%&%#" .. string.char(0xEF) .. "]"
+
+ local basefile = resolvers.findfile("context.mkxl")
+ local swapnames = { }
+
+ local pattern = file.join(file.pathpart(basefile),"/*.mk*")
+ local filenames = dir.glob(pattern)
+ for i=1,#filenames do
+ swapnames[file.basename(filenames[i])] = true
+ end
+
+ local pattern = file.join(file.pathpart(basefile),"/*.l**")
+ local filenames = dir.glob(pattern)
+ for i=1,#filenames do
+ swapnames[file.basename(filenames[i])] = true
+ end
+
+ local hashnames = table.setmetatableindex(function(t,k)
+ local s = file.suffix(k)
+ local v = k
+ if s == "mkiv" then
+ local n = file.replacesuffix(k,"mkxl")
+ if swapnames[n] then
+ v = n
+ end
+ elseif s == "mkvi" then
+ local n = file.replacesuffix(k,"mklx")
+ if swapnames[n] then
+ v = n
+ end
+ elseif s == "lua" then
+ local n = file.replacesuffix(k,"lmt")
+ if swapnames[n] then
+ v = n
+ end
+ end
+ t[k] = v
+ return v
+ end)
+
+ require("mtx-interface")
+
+ local data = scripts.interface.editor("data")
+ local files = data and data.common and data.common.filenames or { }
+ local flagged = 0
+ local total = 0
+ local list = tex.hashtokens()
+ local all = not tex.modes.notmarked
+ local everything = tex.modes.everything
+
+ table.sort(list)
+
+ local function show(visible, check)
+ -- context.starttabulate { "|l|l|l|lj2|l|l|l|l|l|l|l|l|" }
+ context.starttabulate { "|l|l|l|lj2|l|l|l|l|l|l|l|l|" }
+ for i=1,#list do
+ local k = list[i]
+ if check(k) then
+ local v = create(k)
+ local mutable = v.mutable and "mutable"
+ local immutable = v.immutable and "immutable"
+ local frozen = v.frozen and "frozen"
+ local permanent = v.permanent and "permanent"
+ local primitive = v.primitive and "primitive"
+ local instance = v.instance and "instance"
+ local dealtwith = mutable or immutable or mutable or frozen or permanent or primitive -- beware: we can have combinations
+ local whatever = find(k,"^[a-z][a-z][a-z]+_")
+ local cscommand = gsub(v.cmdname or "","_"," ")
+ local undefined = cscommand == "undefined cs"
+ local marked = (dealtwith and "+") or (whatever and "-") or (instance and "!")
+ if everything or ((all or not marked) and not find(k,"^[pvm]_") and not find(k,"^![tT]")) then
+ local parameters = v.parameters
+ local noaligned = v.noaligned and "noaligned"
+ local filename = files[k]
+ local csname = context.escape(k)
+ if undefined then
+ marked = "?"
+ end
+ ctx_NC() if marked then context(marked) end
+ ctx_NC() if primitive then ctx_bold(csname) else
+ ctx_verb(csname) end
+ ctx_NC() if parameters then context(parameters > 0 and parameters or "-") end
+ ctx_NC() if undefined then context.red(false) end
+ context(cscommand)
+ ctx_NC() if primitive then context(primitive) end
+ ctx_NC() if permanent then context(permanent) end
+ ctx_NC() if immutable then context(immutable) end
+ ctx_NC() if frozen then context(frozen) end
+ ctx_NC() if mutable then context(mutable) end
+ ctx_NC() if instance then context(instance) end
+ ctx_NC() if noaligned then context(noaligned) end
+ ctx_NC() if filename then context(hashnames[filename]) end
+ ctx_NC() ctx_NR()
+ end
+ if visible then
+ total = total + 1
+ if dealtwith then
+ flagged = flagged + 1
+ end
+ end
+ end
+ end
+ context.stoptabulate()
+ end
+
+ context.starttitle { title = "Public \\TEX\\ commands" }
+ show(true, function(k) return find(k,"^[a-zA-Z]+$") end)
+ context.stoptitle()
+
+ context.starttitle { title = "Private \\TEX\\ commands" }
+ show(false, function(k) return not find(k,"^[a-zA-Z]+$") and not find(k,crap) end)
+ context.stoptitle()
+
+ tokens.setters.macro("NumberOfVisible", total)
+ tokens.setters.macro("NumberOfFlagged", flagged)
+
+ end
+
+\stopluacode
+
+\startmode[texmacros]
+
+ \page
+
+ \starttabulate[|c|l|]
+ \HL
+ \NC \type {+} \NC mutable, immutable, frozen, permanent, primitive \NC \NR
+ \NC \type {-} \NC protected by obscurity (underscores) \NC \NR
+ \NC \type {!} \NC instance (can be frozen) \NC \NR
+ \NC \type {0-9} \NC the number of arguments (argument grabbing can be delegated) \NC \NR
+ \HL
+ \stoptabulate
+
+ \start \hsize 15cm \veryraggedright
+ Often frozen commands are redefined on demand and they can be overloaded. Mutable
+ doesn't mean that a user can change it without consequences, for instance the
+ \type {\current...} ones. Primitives come with the engine, permanent macros are
+ the core of \CONTEXT. Noaligned macros are special and dealt deep down when
+ scanning for alignment specific primitives.
+ \par \stop
+
+ \starttabulate[||r|]
+ \BC number of visible macros \NC \NumberOfVisible \NC \NR
+ \BC number of flagged macros \NC \NumberOfFlagged \NC \NR
+ \stoptabulate
+
+\stopmode
+
+\page
+
+\startluacode
+
+ if tex.modes.metapostmacros then
+
+ local context = context
+ -- local ctx_NC = context.NC
+ -- local ctx_NR = context.NR
+ -- local ctx_bold = context.bold
+
+ local find = string.find
+ local gsub = string.gsub
+ local create = token.create
+
+ context.starttitle { title = "\\METAFUN\\ commands" }
+
+ metapost.simple("prestine")
+
+ local mptotal = 0
+ local codes = metapost.codes
+ local types = metapost.types
+ local parameters = metapost.knownparameters
+ local procodes = mplib.propertycodes
+ local everything = tex.modes.everything
+
+ context.startcolumns { n = 5, distance = "1em" }
+ context.nohyphens(false)
+ context.obeyspaces(false)
+ local t = metapost.gethashentries("prestine",true) -- prestine:1
+ if t then
+ table.sort(t,function(a,b) return a[3] < b[3] end)
+ mptotal = #t
+ for i=1,mptotal do
+ local ti = t[i]
+ local code = codes[ti[1]]
+ local property = procodes[ti[2]]
+ local name = ti[3]
+ local vtype = ti[4]
+ local vardef = vtype and types[vtype] == "unsuffixedmacro"
+ context.bgroup()
+ -- context("%-15s\\quad",vardef and "(vardef) tag" or code)
+ context("%s %-15s\\quad",parameters[name] and "+" or "\\nbsp",vardef and "(vardef) tag" or code)
+ if property == "primitive" then
+ context.bf(false)
+ context.blue(false)
+ elseif property == "permanent" then
+ context.bf(false)
+ context.lightgreen(false)
+ elseif property == "immutable" then
+ context.bf(false)
+ context.lightcyan(false)
+ elseif property == "mutable" then
+ context.bf(false)
+ context.lightmagenta(false)
+ elseif everything or not find(name,"^%a+_") then
+ -- todo:
+ if vardef then
+ context.bf(false)
+ context.lightred(false)
+ end
+ end
+ context.verbatim(name)
+ context.egroup()
+ context.par()
+ end
+ end
+ context.stopcolumns()
+
+ context.stoptitle()
+
+ tokens.setters.macro("NumberOfMetafun", mptotal)
+
+ end
+\stopluacode
+
+\startmode [metapostmacros]
+
+ \page
+
+ \starttabulate[|c|l|]
+ \HL
+ \NC \type {-3} \NC \bf \lightmagenta mutable \NC \NR
+ \NC \type {1} \NC \bf \blue primitive \NC \NR
+ \NC \type {2} \NC \bf \lightgreen permanent \NC \NR
+ \NC \type {3} \NC \bf \lightcyan immutable \NC \NR
+ \NC \type {+} \NC \bf (also) used as key \NC \NR
+ \HL
+ \stoptabulate
+
+ \starttabulate[||r|]
+ \BC number of metafun entries \NC \NumberOfMetafun \NC \NR
+ \stoptabulate
+
+\stopmode
+
+\stopmodule
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-system-tokens.mkxl b/Master/texmf-dist/tex/context/modules/mkiv/s-system-tokens.mkxl
new file mode 100644
index 00000000000..b83a4f47b6c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-system-tokens.mkxl
@@ -0,0 +1,84 @@
+%D \module
+%D [ file=s-system-tokens.mkxl,
+%D version=2020.06.02,
+%D title=\CONTEXT\ Style File,
+%D subtitle=System Tokens Checking,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[system-tokens]
+
+\registerctxluafile{s-system-tokens}{}
+
+\permanent\protected\def\showsystemtokens{\ctxlua{moduledata.system.tokens.showlist()}} % can be public implementor
+
+\stopmodule
+
+\continueifinputfile{s-system-tokens.mkxl}
+
+\usemodule[article-basic]
+
+\setuppapersize[A4,landscape]
+
+\setuplayout[tight]
+
+\setupbodyfont[8pt]
+
+\starttext
+
+ \showsystemtokens
+
+ Some tokens cannot be created yet because they are more complex but eventually the creator will
+ deal with them. The indices are sometimes the same as internal but in most cases nicely start
+ at zero. When they start at another value, then there is an internal token or state that is not
+ user accessible. You always need to use symbolic constants as the numbers can change.
+
+ The first column is a classifier (which is experimental and categories might change when we feel
+ the need).
+
+ \startcolumns[n=5]
+ \starttabulate[|T||]
+ \NC 0 \NC unused \NC \NR
+ \NC 1 \NC regular \NC \NR
+ \NC 2 \NC character \NC \NR
+ \NC 3 \NC register \NC \NR
+ \NC 4 \NC internal \NC \NR
+ \NC 5 \NC reference \NC \NR
+ \NC 6 \NC data \NC \NR
+ \NC 7 \NC token \NC \NR
+ \NC 8 \NC node \NC \NR
+ \stoptabulate
+ \stopcolumns
+
+ \page
+
+ Here is a typeset table of \type {\startframed} using \type {\luatokentable\startframed}:
+
+ \luatokentable\startframed
+
+ which calls \type {\pack_framed_start_framed} where \type {\luatokentable\pack_framed_start_framed} gives:
+
+
+ \unprotect
+ \luatokentable\pack_framed_start_framed
+ \protect
+
+ So you can guess what generates this:
+
+ \unprotect
+ \luatokentable\pack_framed_start_framed_nop
+ \protect
+
+ And this:
+
+ \unprotect
+ \luatokentable\pack_framed_start_framed_yes
+ \protect
+
+\stoptext
+
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-system-visual.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-system-visual.mkiv
new file mode 100644
index 00000000000..5b5107a2d12
--- /dev/null
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-system-visual.mkiv
@@ -0,0 +1,94 @@
+%D \module
+%D [ file=s-system-visual.mkxl,
+%D version=2020.07.15,
+%D title=\CONTEXT\ Style File,
+%D subtitle=System Visual Debugger Legend,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[system-visual]
+
+\starttexdefinition unexpanded visuallegend
+ \begingroup
+ \switchtobodyfont[10pt]
+ \setuptabulate[before=,after=]
+ \hsize24cm
+ \scale
+ [width=\textwidth]
+ \bgroup
+ \forgetall
+ \startboxedcolumns[n=3,strut=no]
+ \starttabulate[|lT|l|]
+ \NC L__ \NC line box \NC \NR
+ \NC H__ \NC horizontal box \NC \NR
+ \NC _T_ \NC vertical top box \NC \NR
+ \NC __V \NC vertical box \NC \NR
+ \TB
+ \NC VK \NC vertical kern \NC \NR
+ \NC HK \NC horizontal kern \NC \NR
+ \NC MK \NC math kern \NC \NR
+ \NC MK \NC margin kern \NC \NR
+ \NC LK \NC math list kern \NC \NR
+ \TB
+ \NC VP \NC vertical penalty \NC \NR
+ \NC HP \NC horizontal penalty \NC \NR
+ \TB
+ \NC LI \NC line skip \NC \NR
+ \NC BS \NC baseline skip \NC \NR
+ \NC PS \NC par skip \NC \NR
+ \NC DA \NC abovedisplay skip \NC \NR
+ \NC DB \NC belowdisplay skip \NC \NR
+ \NC SA \NC above display short skip \NC \NR
+ \NC SB \NC below display short skip \NC \NR
+ \NC TS \NC top skip \NC \NR
+ \NC ST \NC split top skip \NC \NR
+ \NC AS \NC tab skip \NC \NR
+ \NC LH \NC left hang skip \NC \NR
+ \NC RH \NC right hang skip \NC \NR
+ \NC MS \NC thin mu skip \NC \NR
+ \NC MM \NC med mu skip \NC \NR
+ \NC ML \NC thick mu skip \NC \NR
+ \NC IM \NC inter math skip \NC \NR
+ \NC MT \NC math skip \NC \NR
+ \NC LS \NC left skip \NC \NR
+ \NC RS \NC right skip \NC \NR
+ \NC SP \NC space skip \NC \NR
+ \NC XS \NC x space skip \NC \NR
+ \NC ZS \NC zero space skip \NC \NR
+ \NC PF \NC par fill skip \NC \NR
+ \NC IN \NC indent skip \NC \NR
+ \NC CS \NC correction skip \NC \NR
+ \NC VS \NC vertical user skip \NC \NR
+ \NC HS \NC horizontal user skip \NC \NR
+ \NC IC \NC italic correcection \NC \NR
+ \TB
+ \NC NL \NC leaders \NC \NR
+ \NC CL \NC c leaders \NC \NR
+ \NC XL \NC x leaders \NC \NR
+ \NC GL \NC g leaders \NC \NR
+ \TB
+ \NC M:B \NC math begin \NC \NR
+ \NC M:E \NC math end \NC \NR
+ \NC W:* \NC whatsit \NC \NR
+ \stoptabulate
+ \stopboxedcolumns
+ \egroup
+ \endgroup
+\stoptexdefinition
+
+\stopmodule
+
+\continueifinputfile{s-system-visual.mkiv}
+
+\usemodule[article-basic]
+
+\startTEXpage[width=20cm,offset=5mm]
+
+ \visuallegend
+
+\stopTEXpage
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat-columns.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat-columns.mkiv
index f8cace1e98e..317c5196ff4 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat-columns.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat-columns.mkiv
@@ -320,7 +320,7 @@
\startsetups tugboat:introduction:article
\start
- \unexpanded\def\\{\unskip\space\&\space\ignorespaces}
+ \enforced\protected\def\\{\unskip\space\&\space\ignorespaces}
\hbox{\indent\getvariable{tugboat}{author}}
\par
\stop
@@ -333,14 +333,14 @@
\start
\switchtobodyfont[12pt]
- \def\\{\unskip\space\&\space\ignorespaces}
+ \enforced\protected\def\\{\unskip\space\&\space\ignorespaces}
\getvariable{tugboat}{author}
\par
\stop
\start
\switchtobodyfont[9pt]
- \unexpanded\def\\{\unskip,\space\ignorespaces}
+ \enforced\protected\def\\{\unskip,\space\ignorespaces}
\getvariable{tugboat}{address}
\par
\start
@@ -380,7 +380,7 @@
\hrule height .6pt
\blank[halfline]
\start
- \let\\=\par
+ \enforced\let\\\par
\start
\bf
\getvariable{tugboat}{title}
@@ -393,7 +393,7 @@
\blank[line]
\doiftext {\getbuffer[abstract]} {
- \let\\=\endgraf
+ \enforced\let\\\endgraf
\setups[tugboat:abstract:setup]
\startsubject[title={Abstract}]
\getbuffer[abstract]
@@ -421,7 +421,7 @@
\start
\switchtobodyfont[14.4pt]
- \let\\=\par
+ \enforced\let\\\par
\getvariable{tugboat}{title}
\par
\stop
@@ -430,7 +430,7 @@
\blank[tugmedium]
- \let\\=\par
+ \enforced\let\\\par
\setups[tugboat:abstract:setup]
@@ -458,7 +458,7 @@
\leftskip=\dimexpr\textwidth-\signaturewidth\relax
- \let\\=\par
+ \enforced\let\\\par
\dontleavehmode\llap {
$\diamond$\enspace
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv
index e243dc4879b..14d751fcd53 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-tugboat.mkiv
@@ -393,7 +393,7 @@
% \blank[halfline]
\start
- \def\\{\unskip\space\&\space\ignorespaces}
+ \enforced\protected\def\\{\unskip\space\&\space\ignorespaces}
\hbox{\indent\getvariable{tugboat}{author}}
\par
\stop
@@ -431,7 +431,7 @@
\hrule height .6pt
\blank[halfline]
\start
- \let\\=\par
+ \enforced\let\\\par
{\bf\getvariable{tugboat}{title}}
\par
\blank[halfline]
@@ -441,7 +441,7 @@
\blank[line]
\doiftext {\getbuffer[abstract]} {
- \let\\=\endgraf
+ \enforced\let\\\endgraf
\setups{tugboat:abstract:setup}
\subject{Abstract}
\getbuffer[abstract]
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/x-math-svg.lua b/Master/texmf-dist/tex/context/modules/mkiv/x-math-svg.lua
index 8a628816773..818c7ad8434 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/x-math-svg.lua
+++ b/Master/texmf-dist/tex/context/modules/mkiv/x-math-svg.lua
@@ -35,10 +35,10 @@ local pagedata = { }
local statusname = "x-math-svg-status.lua"
local pdfname = "x-math-svg.pdf"
-local pdftosvg = os.which("mudraw")
+local pdftosvg = os.which("mutool")
local f_make_tex = formatters[ [[context --global kpse:x-math-svg.mkvi --inputfile="%s" --svgstyle="%s" --batch --noconsole --once --purgeall]] ]
-local f_make_svg = formatters[ [[mudraw -o "math-%%d.svg" "%s" 1-9999]] ]
+local f_make_svg = formatters[ [[mutool draw -o "math-%%d.svg" "%s" 1-9999]] ]
----- f_inline = formatters[ [[<div class='math-inline' style='vertical-align:%p'></div>]] ]
local f_inline = formatters[ [[<div class='math-inline'></div>]] ]
@@ -101,7 +101,7 @@ function svgmath.convert(filename,svgstyle)
-- invalid filename
return false, "invalid filename"
elseif not pdftosvg then
- return false, "mudraw is not installed"
+ return false, "mutool is not installed"
end
os.execute(f_make_tex(filename,svgstyle))
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/x-mathml-basics.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/x-mathml-basics.mkiv
index e166995b0c8..bb119f5144f 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/x-mathml-basics.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/x-mathml-basics.mkiv
@@ -6,7 +6,7 @@
% this can become a core helper
-% bwe could do all of them in lua
+% we could do all of them in lua
\startluacode
local find = string.find
@@ -87,11 +87,11 @@ end
}
\stoptexdefinition
-\starttexdefinition mtext #1
- \text {
- #1
- }
-\stoptexdefinition
+% \starttexdefinition mtext #1
+% \text {
+% #1
+% }
+% \stoptexdefinition
% mover
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/x-mathml.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/x-mathml.mkiv
index adc49431407..bd55196f9d3 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/x-mathml.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/x-mathml.mkiv
@@ -1890,8 +1890,6 @@
\fi
\stoptexdefinition
-\newsignal\mmltextsignal % not used
-
\starttexdefinition applymmlsometext #1#2
\applymmlmathbackground {#1} {
\applymmlmathcolor {#1} {
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/x-setups-basics.mkiv b/Master/texmf-dist/tex/context/modules/mkiv/x-setups-basics.mkiv
index 4e960f4287c..67912b8d76f 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/x-setups-basics.mkiv
+++ b/Master/texmf-dist/tex/context/modules/mkiv/x-setups-basics.mkiv
@@ -90,7 +90,9 @@
\pushmacro\setuptext
-\defineframedtext
+\ifcase\contextlmtxmode \else \pushoverloadmode \let\setuptext\setuptext \popoverloadmode \fi
+
+\defineframedtext % todo commands=no
[setuptext]
[\c!width=\hsize,
\c!height=\v!fit,
@@ -492,9 +494,15 @@
\unexpanded\def\basicsetup{\c_cmd_kind\zerocount\cmd_show_setup}
\unexpanded\def\shortsetup{\c_cmd_kind\plusone \cmd_show_setup}
-\unexpanded\def\setup {\c_cmd_kind\plustwo \cmd_show_setup}
+%unexpanded\def\setup {\c_cmd_kind\plustwo \cmd_show_setup}
\unexpanded\def\showsetup {\c_cmd_kind\plustwo \cmd_show_setup}
+\ifcase\contextlmtxmode \else
+ \pushoverloadmode
+ \unexpanded\def\setup{\c_cmd_kind\plustwo\cmd_show_setup}
+ \popoverloadmode
+\fi
+
\unexpanded\def\showsetupinlist#1#2#3%
{%(#1)(#2)(#3)\par
\edef\m_cmd_instance{\secondoftwoarguments#3}%