summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-05-02 17:02:40 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-05-02 17:02:40 +0200
commitd2e1112ef8921f361ac7cf1b49e30923cce6d5f0 (patch)
tree0d909528bec22b69bdd671aa7fe560d5d0104021 /tex
parentf740345a433f2b9736b14f61a98173763e093b6f (diff)
downloadcontext-d2e1112ef8921f361ac7cf1b49e30923cce6d5f0.tar.gz
2022-05-02 15:50:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-fr.mkii3
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/mult-def.lua6
-rw-r--r--tex/context/base/mkiv/mult-fun.lua13
-rw-r--r--tex/context/base/mkiv/mult-low.lua1
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin24636 -> 24641 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin257224 -> 257295 bytes
-rw-r--r--tex/context/base/mkiv/util-prs.lua13
-rw-r--r--tex/context/base/mkiv/util-tbs.lua21
-rw-r--r--tex/context/base/mkxl/anch-pos.lmt14
-rw-r--r--tex/context/base/mkxl/cont-log.mkxl56
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/math-ali.mkxl298
-rw-r--r--tex/context/base/mkxl/math-frc.mkxl2
-rw-r--r--tex/context/base/mkxl/math-ini.mkxl1100
-rw-r--r--tex/context/base/mkxl/math-noa.lmt193
-rw-r--r--tex/context/base/mkxl/math-rad.mklx21
-rw-r--r--tex/context/base/mkxl/math-spa.lmt4
-rw-r--r--tex/context/base/mkxl/mlib-lmp.lmt41
-rw-r--r--tex/context/base/mkxl/node-ini.lmt7
-rw-r--r--tex/context/base/mkxl/node-tsk.lmt10
-rw-r--r--tex/context/base/mkxl/page-lay.mkxl4
-rw-r--r--tex/context/base/mkxl/page-one.mkxl6
-rw-r--r--tex/context/base/mkxl/page-pcl.mkxl5
-rw-r--r--tex/context/base/mkxl/page-pst.mkxl4
-rw-r--r--tex/context/base/mkxl/spac-ver.mkxl138
-rw-r--r--tex/context/base/mkxl/strc-mat.mkxl46
-rw-r--r--tex/context/base/mkxl/supp-box.mkxl25
-rw-r--r--tex/context/base/mkxl/syst-aux.lmt31
-rw-r--r--tex/context/base/mkxl/syst-ini.mkxl4
-rw-r--r--tex/context/base/mkxl/tabl-ntb.mkxl33
-rw-r--r--tex/context/base/mkxl/task-ini.lmt3
-rw-r--r--tex/context/base/mkxl/typo-krn.lmt58
-rw-r--r--tex/context/fonts/mkiv/type-imp-stix.mkiv1
-rw-r--r--tex/context/interface/mkii/keys-fr.xml3
-rw-r--r--tex/context/modules/mkiv/s-fonts-charts.mkiv5
-rw-r--r--tex/context/modules/mkxl/m-json.mkxl40
-rw-r--r--tex/generic/context/luatex/luatex-core.lua7
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
43 files changed, 1208 insertions, 1022 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 527dc57d5..cc51b0c45 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2022.04.20 19:15}
+\newcontextversion{2022.05.02 15:48}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index 9a9b43ee8..88a77e354 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2022.04.20 19:15}
+\edef\contextversion{2022.05.02 15:48}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii
index d79dc0836..1c9591d67 100644
--- a/tex/context/base/mkii/mult-fr.mkii
+++ b/tex/context/base/mkii/mult-fr.mkii
@@ -641,6 +641,7 @@
% definitions for interface constants for language fr
%
\setinterfaceconstant{action}{action}
+\setinterfaceconstant{adaptive}{adaptive}
\setinterfaceconstant{address}{adresse}
\setinterfaceconstant{after}{après}
\setinterfaceconstant{afterhead}{aprèstête}
@@ -1234,6 +1235,8 @@
\setinterfaceconstant{small}{petit}
\setinterfaceconstant{smallcapsfeatures}{fonctionnalitespetitescaps}
\setinterfaceconstant{smallcapsfont}{policepetitescaps}
+\setinterfaceconstant{snap}{snap}
+\setinterfaceconstant{snapstep}{snapstep}
\setinterfaceconstant{solution}{solution}
\setinterfaceconstant{sort}{trier}
\setinterfaceconstant{sorttype}{modetri}
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 094648239..558b0481a 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2022.04.20 19:15}
+\newcontextversion{2022.05.02 15:48}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 1165bfced..fa7ba1e2a 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -49,7 +49,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2022.04.20 19:15}
+\edef\contextversion{2022.05.02 15:48}
%D Kind of special:
diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua
index 0a8b71e30..dee5de585 100644
--- a/tex/context/base/mkiv/mult-def.lua
+++ b/tex/context/base/mkiv/mult-def.lua
@@ -11738,6 +11738,12 @@ return {
["en"]="smallcapsfont",
["fr"]="policepetitescaps",
},
+ ["snap"]={
+ ["en"]="snap",
+ },
+ ["snapstep"]={
+ ["en"]="snapstep",
+ },
["solution"]={
["en"]="solution",
["fr"]="solution",
diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua
index 4ec5bd55e..128e5b51e 100644
--- a/tex/context/base/mkiv/mult-fun.lua
+++ b/tex/context/base/mkiv/mult-fun.lua
@@ -16,7 +16,7 @@ return {
"maxdimensions",
"drawoptionsfactor",
"dq", "sq",
- "crossingscale", "crossingoption",
+ "crossingscale", "crossingoption", "crossingdebug",
"contextlmtxmode", "metafunversion", "minifunversion",
--
-- for the moment we put these here as they need to stand out
@@ -47,6 +47,8 @@ return {
"localanchorbox", "localanchorcell", "localanchorspan",
"anchorbox", "anchorcell", "anchorspan",
"matrixbox", "matrixcell", "matrixspan",
+ --
+ "pensilcolor", "pensilstep",
},
commands = {
"loadfile", "loadimage", "loadmodule",
@@ -95,7 +97,7 @@ return {
"checkedbounds", "checkbounds", "strut", "rule",
"withmask", "bitmapimage",
"colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist",
- "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext",
+ "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "infotext",
"rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext",
"notcached", "keepcached",
"verbatim",
@@ -192,6 +194,7 @@ return {
"positionpath", "positioncurve", "positionxy", "positionparagraph", "positioncolumn",
"positionwhd", "positionpage", "positionregion", "positionbox", "positionx", "positiony",
"positionanchor", "positioninregion", "positionatanchor",
+ "positioncolumnbox", "overlaycolumnbox", "positioncolumnatx",
--
"getposboxes", "getmultipars",
"getpospage", "getposparagraph", "getposcolumn", "getposregion",
@@ -214,7 +217,7 @@ return {
--
"comment", "report", "lua", "lualist", "mp", "MP", "luacall",
--
- "mirrored", "mirroredabout",
+ "mirrored", "mirroredabout", "xslanted", "yslanted",
--
"scriptindex", "newscriptindex",
--
@@ -225,5 +228,9 @@ return {
--
"withtolerance",
--
+ "hatched", "withdashes",
+ "processpath", "pencilled",
+ "sortedintersectiontimes", "intersectionpath", "firstintersectionpath", "secondintersectionpath",
+ "intersectionsfound", "cutbeforefirst", "cutafterfirst", "cutbeforelast", "cutafterlast",
},
}
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index e345195d5..1c5b4be5e 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -209,6 +209,7 @@ return {
--
"nopreslackclassoptioncode", "nopostslackclassoptioncode",
"lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode",
+ "lookaheadforendclassoptioncode", "defaultmathclassoptions",
--
"noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode",
"noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index f6ca25caa..683f2d822 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index bdb717f7d..7bef77ee0 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/util-prs.lua b/tex/context/base/mkiv/util-prs.lua
index 204611dbe..6c2a15adf 100644
--- a/tex/context/base/mkiv/util-prs.lua
+++ b/tex/context/base/mkiv/util-prs.lua
@@ -806,11 +806,20 @@ local pattern = Cf( Ct("") *
( Cg(Cc("day") * cardinal)
* S("-/") * Cg(Cc("month") * cardinal)
* S("-/") * Cg(Cc("year") * p_year)
+ ) +
+ ( Cg(Cc("year") * p_year)
+ * S("-/") * Cg(Cc("month") * cardinal)
+ ) +
+ ( Cg(Cc("month") * cardinal)
+ * S("-/") * Cg(Cc("year") * p_year)
)
)
- * P(" ") * Cg(Cc("hour") * cardinal)
+ * (
+ P(" ") * Cg(Cc("hour") * cardinal)
* P(":") * Cg(Cc("min") * cardinal)
* (P(":") * Cg(Cc("sec") * cardinal))^-1
+ + P(-1) )
+
, rawset)
lpegpatterns.splittime = pattern
@@ -819,6 +828,8 @@ function parsers.totime(str)
return lpegmatch(pattern,str)
end
+-- inspect(parsers.totime("2019-03-05"))
+-- inspect(parsers.totime("2019-03-05 12:12:12"))
-- print(os.time(parsers.totime("2019-03-05 12:12:12")))
-- print(os.time(parsers.totime("2019/03/05 12:12:12")))
-- print(os.time(parsers.totime("05-03-2019 12:12:12")))
diff --git a/tex/context/base/mkiv/util-tbs.lua b/tex/context/base/mkiv/util-tbs.lua
index 140e43a03..339abcfcc 100644
--- a/tex/context/base/mkiv/util-tbs.lua
+++ b/tex/context/base/mkiv/util-tbs.lua
@@ -57,7 +57,7 @@ end
do
- local find, gmatch = string.find, string.gmatch
+ local find, gmatch, formatters = string.find, string.gmatch, string.formatters
local P, C, Ct, Cc, R = lpeg.P, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.R
@@ -72,7 +72,7 @@ do
local specifier = Ct ((entry + (separator + index + test))^1)
- function tablestore.field(namespace,name,default)
+ local function field(namespace,name,default)
local data = loaded[namespace] or current
if data then
-- if find(name,"%[") then
@@ -111,4 +111,21 @@ do
end
end
+
+ function length(namespace,name,default)
+ local data = field(namespace,name)
+ return type(data) == "table" and #data or 0
+ end
+
+ function formatted(namespace,name,fmt)
+ local data = field(namespace,name)
+ if data then
+ return formatters[fmt](data)
+ end
+ end
+
+ tablestore.field = field
+ tablestore.length = length
+ tablestore.formatted = formatted
+
end
diff --git a/tex/context/base/mkxl/anch-pos.lmt b/tex/context/base/mkxl/anch-pos.lmt
index d3b52ad4d..fc668f699 100644
--- a/tex/context/base/mkxl/anch-pos.lmt
+++ b/tex/context/base/mkxl/anch-pos.lmt
@@ -1750,9 +1750,17 @@ local function columnofpos(realpage,xposition)
return 1
end
-jobpositions.overlapping = overlapping
-jobpositions.onsamepage = onsamepage
-jobpositions.columnofpos = columnofpos
+local function getcolumndata(realpage,column)
+ local p = columndata[realpage]
+ if p then
+ return p[column]
+ end
+end
+
+jobpositions.overlapping = overlapping
+jobpositions.onsamepage = onsamepage
+jobpositions.columnofpos = columnofpos
+jobpositions.getcolumndata = getcolumndata
-- interface
diff --git a/tex/context/base/mkxl/cont-log.mkxl b/tex/context/base/mkxl/cont-log.mkxl
index 4df509f60..56cf4053f 100644
--- a/tex/context/base/mkxl/cont-log.mkxl
+++ b/tex/context/base/mkxl/cont-log.mkxl
@@ -204,27 +204,43 @@
\frozen\instance\protected\def\luametaTeX{lua\wordboundary meta\wordboundary\TeX}
\frozen\instance\protected\def\XeTeX {X\lower.5\exheight\hbox{\kern-.15\emwidth\mirror{E}}\kern-.1667\emwidth\TeX}
-% Adapted from a patch by Mojca:
-
-\def\syst_logos_xetex_e
- {\setbox\scratchbox\hbox{E}%
- \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}}
-
-\frozen\instance\protected\def\XeTeX
+% % Adapted from a patch by Mojca:
+%
+% \def\syst_logos_xetex_e
+% {\setbox\scratchbox\hbox{E}%
+% \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}}
+%
+% \frozen\instance\protected\def\XeTeX
+% {X\lower.5\exheight
+% \hbox
+% {\kern-.15\emwidth
+% \iffontchar\font"018E\relax
+% \char"018E%
+% \else
+% \ifx\fontalternative\s!bf \mirror{E}\orelse
+% \ifx\fontalternative\s!it\syst_logos_xetex_e\orelse
+% \ifx\fontalternative\s!sl\syst_logos_xetex_e\orelse
+% \ifx\fontalternative\s!bi\syst_logos_xetex_e\orelse
+% \ifx\fontalternative\s!bs\syst_logos_xetex_e\else
+% \mirror{E}\fi
+% \fi}%
+% \kern-.1667\emwidth\TeX}
+
+% This is good enough for th efew times that we need it:
+
+\def\syst_logos_xe
{X\lower.5\exheight
- \hbox
- {\kern-.15\emwidth
- \iffontchar\font"018E\relax
- \char"018E%
- \else
- \ifx\fontalternative\s!bf \mirror{E}\orelse
- \ifx\fontalternative\s!it\syst_logos_xetex_e\orelse
- \ifx\fontalternative\s!sl\syst_logos_xetex_e\orelse
- \ifx\fontalternative\s!bi\syst_logos_xetex_e\orelse
- \ifx\fontalternative\s!bs\syst_logos_xetex_e\else
- \mirror{E}\fi
- \fi}%
- \kern-.1667\emwidth\TeX}
+ \hbox\bgroup
+ \kern-.15\emwidth
+ \iffontchar\font"018E\relax
+ \char"018E%
+ \else
+ \mirror{E}%
+ \fi
+ \egroup}
+
+\frozen\instance\protected\def\XeTeX {\syst_logos_xe\kern-.1667\emwidth\TeX}
+\frozen\instance\protected\def\XeLaTeX{\syst_logos_xe\LaTeX}
\instance\protected\def\ETEX {\eTeX}
\instance\protected\def\PDFTEX {\pdfTeX}
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index 0f17e11a6..4dc93d0bf 100644
--- a/tex/context/base/mkxl/cont-new.mkxl
+++ b/tex/context/base/mkxl/cont-new.mkxl
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2022.04.20 19:15}
+\newcontextversion{2022.05.02 15:48}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl
index 114ec31ba..009c493a2 100644
--- a/tex/context/base/mkxl/context.mkxl
+++ b/tex/context/base/mkxl/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\immutable\edef\contextformat {\jobname}
-\immutable\edef\contextversion{2022.04.20 19:15}
+\immutable\edef\contextversion{2022.05.02 15:48}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/math-ali.mkxl b/tex/context/base/mkxl/math-ali.mkxl
index 75355736d..d58bd464f 100644
--- a/tex/context/base/mkxl/math-ali.mkxl
+++ b/tex/context/base/mkxl/math-ali.mkxl
@@ -35,6 +35,8 @@
%D Modules may provide additional alignment features. The following kind of plain
%D mechanisms are provided by the core.
+\newtoks\mathdisplayaligntweaks
+
\newtoks\t_math_align_a
\newtoks\t_math_align_b
\newtoks\t_math_align_c
@@ -77,20 +79,6 @@
\tabskip\zeropoint
\everycr\emptytoks}
-% \def\math_math_in_eqalign#1%
-% {\startforceddisplaymath
-% \tabskip\zeropoint
-% \everycr\emptytoks
-% {{}#1{}}% brrr we need to replace {}
-% \stopforceddisplaymath}
-
-% \def\math_text_in_eqalign#1%
-% {\startimath
-% \tabskip\zeropoint
-% \everycr\emptytoks
-% #1%
-% \stopimath}
-
\def\math_math_in_eqalign#1%
{\mathbeginclass\mathordcode
\mathendclass \mathordcode
@@ -109,27 +97,12 @@
#1%
\stopimath}
-% \permanent\protected\def\eqalign#1% why no halign here, probably because of displaywidth
-% {\emptyhbox % why no \dontleavehmode
-% \mskip\thinmuskip
-% \vcenter
-% {\math_openup\displayopenupvalue % was: \openup\jot
-% \mathsurround\zeropoint
-% \ialign{%
-% \strut
-% \hfil
-% \startforceddisplaymath{\aligncontent}\stopforceddisplaymath
-% \aligntab
-% \startforceddisplaymath{{}\aligncontent{}}\stopforceddisplaymath
-% \hfil\crcr
-% #1\crcr}%
-% }%
-% \mskip\thinmuskip}
+\let\math_align_openup\relax % defined later on
\permanent\protected\def\eqalign#1% rather plain, is this used at all ...
{\dontleavehmode
\mskip\thinmuskip\vcenter\bgroup % \vcenter \s!class \mathwrappercode \bgroup
- \math_openup\displayopenupvalue
+ \math_align_openup
\mathsurround\zeropoint % \math_eqalign_set_defaults
\ialign
{\strut
@@ -384,9 +357,6 @@
\pop_macro_NC
\to \everymathalignmentdone
-\let\math_alignment_snap_start\relax
-\let\math_alignment_snap_stop \relax
-
% % experimental:
%
% \def\math_alignment_snap_start
@@ -424,7 +394,8 @@
% % [align={1:left,2:middle,3:right}]
\permanent\tolerant\protected\def\math_alignment_start[#1]#*[#2]%
- {\edef\currentmathalignment{#1}%
+ {\begingroup
+ \edef\currentmathalignment{#1}%
\ifarguments\or\or
\setupmathalignment[#1][#2]% bad! ungrouped
\fi
@@ -446,7 +417,8 @@
\dostoptagged
\dostoptagged
\the\everymathalignmentdone
- \math_alignment_snap_stop}
+ \math_alignment_snap_stop
+ \endgroup}
\installcorenamespace{mathalignment}
\installcorenamespace{mathalignmentvariant}
@@ -469,11 +441,36 @@
[\c!n=2,
\c!m=1,
\c!distance=\emwidth,
+ \c!spaceinbetween=.25\bodyfontsize,
\c!grid=\v!math]
\definemathalignment[align] % default case (this is what amstex users expect)
\definemathalignment[\v!mathalignment] % prefered case (this is cleaner, less clashing)
+% this needs some consideration:
+
+\def\math_align_openup{\math_openup\mathalignmentparameter\c!spaceinbetween\relax}
+
+\let\math_display_align_hack_indeed\relax
+
+\protected\def\math_display_align_hack % I don't like the global, maybe we should push and pop
+ {\glet\math_display_align_hack_indeed\math_display_align_hack_remove_skip
+ \math_align_openup
+ \everycr{\noalign{\math_display_align_hack_indeed}}}
+
+\def\math_display_align_hack_remove_skip
+ {\ifdim\prevdepth>-\thousandpoint
+ \vskip\dimexpr-\lineskiplimit+\normallineskiplimit\relax
+ \fi
+ \glet\math_display_align_hack_indeed\math_display_align_hack_insert_penalty}
+
+\def\math_display_align_hack_insert_penalty
+ {\penalty\interdisplaylinepenalty}
+
+\appendtoks
+ \math_display_align_hack
+\to \mathdisplayaligntweaks
+
% special case.. in case one mistypes ..
\ifdefined \startalignment
@@ -977,21 +974,6 @@
\dostoptagged
\endlocalcontrol}
-% \protected\def\math_matrix_start_cell
-% {\dostarttagged\t!mtablecell\empty
-% \hss
-% \math_left_of_eqalign
-% \startimath
-% \math_matrix_set_style
-% \tabskip\zeropoint
-% \everycr\emptytoks}
-%
-% \protected\def\math_matrix_stop_cell
-% {\stopimath
-% \math_right_of_eqalign
-% \hss
-% \dostoptagged}
-
\protected\def\math_matrix_start_cell
{\dostarttagged\t!mtablecell\empty
\hss
@@ -1016,89 +998,6 @@
% left/both : 2
% right/both : 4
-% \c_math_matrix_anchor_mode3
-
-% this will be replaced
-
-%\permanent\protected\def\setmathmatrixanchoring[#1]%
-% {\c_math_matrix_anchor_mode\zerocount
-% \processaction
-% [#1]
-% [ \v!left=>\bitwiseflip\c_math_matrix_anchor_mode\numexpr\plusone+\plustwo\relax,
-% \v!right=>\bitwiseflip\c_math_matrix_anchor_mode\numexpr\plusone+\plusfour\relax,
-% \v!both=>\bitwiseflip\c_math_matrix_anchor_mode\numexpr\plusone+\plustwo+\plusfour\relax,
-% \v!yes=>\bitwiseflip\c_math_matrix_anchor_mode\numexpr\plusone]}
-%
-%\def\math_matrix_anchor
-% {\ifbitwiseand\c_math_matrix_anchor_mode\plusone
-% \markanchor{matrix}{\numexpr\c_math_eqalign_column+1\relax}\c_math_eqalign_row
-% \fi}
-%
-%\protected\def\math_matrix_distance
-% {\relax
-% \ifdim\d_math_eqalign_distance>\zeropoint
-% \hskip.5\d_math_eqalign_distance
-% \fi
-% \math_matrix_anchor
-% \ifdim\d_math_eqalign_distance>\zeropoint
-% \hskip.5\d_math_eqalign_distance
-% \fi
-% \relax}
-%
-%\protected\def\math_matrix_distance_first
-% {\relax
-% \ifbitwiseand\c_math_matrix_anchor_mode\plusone
-% \math_matrix_anchor
-% \fi
-% \ifdim\d_math_eqalign_distance>\zeropoint
-% \ifbitwiseand\c_math_matrix_anchor_mode\plustwo
-% \hskip.5\d_math_eqalign_distance
-% \fi
-% \fi
-% \relax}
-%
-%\protected\def\math_matrix_distance_last
-% {\relax
-% \ifdim\d_math_eqalign_distance>\zeropoint
-% \ifbitwiseand\c_math_matrix_anchor_mode\plusfour
-% \hskip.5\d_math_eqalign_distance
-% \fi
-% \fi
-% \ifbitwiseand\c_math_matrix_anchor_mode\plusone
-% \math_matrix_anchor
-% \fi
-% \relax}
-%
-% \def\math_matrix_preamble
-% {\math_matrix_strut
-% \math_matrix_distance_first
-% \global\advance\c_math_eqalign_column\plusone
-% \math_matrix_start_cell
-% \aligncontent
-% \math_matrix_stop_cell
-% \aligntab
-% \aligntab
-% \math_matrix_distance
-% \global\advance\c_math_eqalign_column\plusone
-% \math_matrix_start_cell
-% \aligncontent
-% \math_matrix_stop_cell}
-%
-% \permanent\protected\def\math_matrix_NR
-% {\aligntab\omit
-% \math_matrix_distance_last
-% \math_matrix_stop_row
-% \math_matrix_pickup
-% \crcr
-% \math_matrix_start_row}
-%
-% \permanent\protected\def\math_matrix_NC
-% {\ifconditional\c_math_matrix_first
-% \expandafter\math_matrix_NC_yes
-% \else
-% \expandafter\math_matrix_NC_nop
-% \fi}
-
\permanent\protected\def\setmathmatrixanchoring[#1]%
{\c_math_matrix_anchor_mode\zerocount
\processaction
@@ -1213,39 +1112,6 @@
\enforced\let\TB\math_common_TB
\to \everymathmatrix
-% \def\math_matrix_start_processing
-% {\ifmmode
-% \mathatom \s!class \mathwrappedcode
-% \else
-% \dontleavehmode
-% \fi
-% \bgroup
-% \tabskip\zeropoint
-% \math_matrix_pickup
-% \the\everymathmatrix
-% %
-% % \enforced\let\endmath\relax
-% %
-% \setbox\nextbox\vbox\bgroup
-% \math_matrix_start_table
-% \halign \bgroup
-% % preamble
-% \span\math_matrix_preamble
-% % done
-% \crcr
-% \math_matrix_start_row}
-%
-% \def\math_matrix_stop_processing
-% {%\math_matrix_stop_wrapup % optional
-% \math_matrix_stop_row
-% \egroup
-% \math_matrix_stop_table
-% \egroup
-% \mathmatrixleft % experimental hook
-% \math_matrix_finish_nextbox
-% \mathmatrixright % experimental hook
-% \egroup}
-
\def\math_matrix_start_processing
{\ifmmode
\mathatom \s!class \mathwrappedcode
@@ -1696,81 +1562,6 @@
\egroup
\endgroup}
-% %D \macros
-% %D {bordermatrix}
-% %D
-% %D In \PLAIN\ \TEX\ the width of a parenthesis is stored in
-% %D the \DIMENSION\ \type{\mathparentwd}. This value is derived from
-% %D the width of \type{\tenrm B}, so let's take care of it now:
-%
-% \ifdefined\mathparentwd \else \newdimen\mathparentwd \fi
-%
-% \let\normalbordermatrix\bordermatrix % move that code to here instead
-%
-% \protected\def\bordermatrix
-% {\begingroup
-% \setbox\scratchbox\hbox{\mr\char"239C}%
-% \global\mathparentwd\wd\scratchbox
-% \endgroup
-% \normalbordermatrix}
-%
-% \def\bordermatrix
-% {\begingroup
-% \mr
-% \global\mathparentwd\fontcharwd\font"239C\relax
-% \endgroup
-% \normalbordermatrix}
-
-% %D \macros{overset, underset}
-% %D
-% %D The macros \type{\overset} and \type{\underset} are provided by
-% %D \AMS\ packages in \LATEX. These macro allows you to place a symbol
-% %D above or below another symbol, irrespective of whether the other
-% %D symbol is a relation or something else, and without influencing the
-% %D spacing. For most cases there is a better way to do such things
-% %D (declaring a math command with limop option, or using accents), but
-% %D occasionally these macros can be useful, for example:
-% %D
-% %D \startbuffer
-% %D \startformula
-% %D \overset{*}{X} \underset{*}{X}
-% %D \stopformula
-% %D \stopbuffer
-% %D \typebuffer \getbuffer
-% %D
-% %D Use these macros sparingly. Remember, \TEX\ was designed for
-% %D mathematics, so there is usually a proper method for typesetting
-% %D common math notation.
-% %D
-% %D These macros are a cleaner version of \type {\binrel@} and
-% %D \type {\binrel@@} macros in \AMSTEX\ packages.
-%
-% \def\math_binrel_apply#1%
-% {\begingroup
-% \setbox\scratchbox\hbox
-% {\thinmuskip 0mu
-% \medmuskip -1mu
-% \thickmuskip -1mu
-% \setbox\scratchbox\hbox{\normalstartimath#1\mathsurround\zeropoint\normalstopimath}%
-% \kern-\wd\scratchbox
-% \normalstartimath{}#1{}\mathsurround\zeropoint\normalstopimath}%
-% \ifdim\wd\scratchbox<\zeropoint
-% \endgroup
-% \expandafter\mathbin
-% \orelse\ifdim\wd\scratchbox>\zeropoint
-% \endgroup
-% \doubleexpandafter\mathrel
-% \else
-% \endgroup
-% \doubleexpandafter\firstofoneargument
-% \fi}
-%
-% \permanent\protected\def\overset#1#2%
-% {\math_binrel_apply{#2}{\mathop{\kern\zeropoint#2}\limits\normalsuperscript{#1}}}
-%
-% \permanent\protected\def\underset#1#2%
-% {\math_binrel_apply{#2}{\mathop{\kern\zeropoint#2}\limits\normalsubscript {#1}}}
-
%D \macros{overset, underset}
%D
%D The macros \type {\overset} and \type {\underset} are provided by \AMS\ packages
@@ -1799,9 +1590,6 @@
\permanent\protected\def\startinnermath{\expandnamespaceparameter\??mathinnerstart\formulaparameter\c!align\v!normal}
\permanent\protected\def\stopinnermath {\expandnamespaceparameter\??mathinnerstop \formulaparameter\c!align\v!normal}
-\permanent\protected\def\mathinnerstrut
- {\doif{\formulaparameter\c!strut}\v!yes\strut}
-
\permanent\protected\def\defineinnermathhandler#1#2#3%
{\defcsname\??mathinnerstart#1\endcsname{#2}%
\defcsname\??mathinnerstop #1\endcsname{#3}}
@@ -1858,25 +1646,6 @@
% mode: 0=no frame | 1=number inside frame | 2=number outside frame
-% \def\strc_math_flush_aligned
-% {\ifcase\c_strc_math_vertical
-% \ifcase\mathraggedstatus\or\hfill\or\hfill\fi
-% \box\b_strc_math_display
-% \ifcase\mathraggedstatus\or\or\hfill\or\hfill\fi
-% \else
-% \ifconditional\c_strc_math_indent
-% \ifzeropt\d_strc_math_indent\else
-% \hangafter\plusone
-% \hangindent\d_strc_math_indent
-% \fi
-% \fi
-% \edef\p_interlinespace{\formulaparameter\c!interlinespace}%
-% \ifempty\p_interlinespace\else\baselineskip\p_interlinespace\fi
-% \global\d_strc_math_indent\zeropoint
-% \ifcase\mathraggedstatus\or\raggedleft\or\raggedcenter\or\raggedright\fi
-% \unhbox\b_strc_math_display
-% \fi}
-
\protected\def\strc_math_flush_aligned
{\ifcase\c_strc_math_vertical
\ifcase\mathraggedstatus\or\hfill\or\hfill\fi
@@ -2128,7 +1897,6 @@
%\strc_formulas_place_number % not here as we can have inner alignment numbers
\dontcomplain
\setbox\b_strc_math_display\math_hbox\bgroup % \checkeddisplaymath
- \mathinnerstrut
\startforceddisplaymath}
\def\strc_math_flush_number_no
diff --git a/tex/context/base/mkxl/math-frc.mkxl b/tex/context/base/mkxl/math-frc.mkxl
index 4a912aace..2170c8fd1 100644
--- a/tex/context/base/mkxl/math-frc.mkxl
+++ b/tex/context/base/mkxl/math-frc.mkxl
@@ -560,7 +560,7 @@
\c!left="28,
\c!right="29]
-\permanent\protected\def\binom {\csname\inlineordisplaymath id:binom\endcsname}
+\permanent\protected\def\binom{\csname\inlineordisplaymath id:binom\endcsname}
\definemathfraction
[dbinom]
diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl
index 0b3bdf54d..551f3f96a 100644
--- a/tex/context/base/mkxl/math-ini.mkxl
+++ b/tex/context/base/mkxl/math-ini.mkxl
@@ -13,24 +13,6 @@
\writestatus{loading}{ConTeXt Math Macros / Initializations}
-% todo: hpack as we skip math anyway
-
-% a bit tricky way to set ... no (pseudo) registers but math hash values:
-%
-% \normalexpanded{\Umathlimitabovevgap\displaystyle=40\dimexpr\the\Umathlimitabovevgap\displaystyle\relax}
-
-% Todo in luatex maincontrol.w: also accept a number here:
-%
-% case set_math_param_cmd:
-% p = cur_chr;
-% get_token();
-% if (cur_cmd != math_style_cmd) {
-%
-% plus two new math styles: larger/smaller
-%
-% \protected\def\Umathshow#1%
-% {\hbox{\infofont(\string#1:\the#1\textstyle,\the#1\scriptstyle,\the#1\scriptscriptstyle)}}
-
%D This module provides namespaces for math fonts, thereby permitting mixed usage of
%D math fonts. Although not strictly needed, we also provide a family name mapping
%D mechanism as used in the (original) AMS math definition files, but here these
@@ -38,28 +20,22 @@
%D tried to minimize the number of definition commands and use plain \TEX\
%D definitions as fallback. We've tried to follow a couple of conventions from plain
%D and AMS math in order to achieve backward compatinility. We also kept an eye on
-%D future usage of these modules in the perspective of MathML and unicode fonts.
+%D future usage of these modules in the perspective of MathML and unicode fonts. In
+%D the meantime much has been dropped in favour of better alternatives.
%D There is a subtle issue with grouping: the \type {\begingroup} method will not
%D restore a changed mathstyle so best avoid that one. However, there are cases where
-%D we really need to use such grouping.
-
-% Weird, these fail, maybe amp is solved in a later state from char noads (needs a
-% fix in luatex):
-%
-% $\char"26$
-% $\a$
-% $\string&$
+%D we really need to use such grouping. We now have \type {\beginmathgroup} etc.
-% mathop applied to characters centers it vertically
+%D Musical timestamp for the April 2022 math (inline) snapping sub activity: eNerd⁴
+%D Time Capsule 2020 a.k.a. Farewell Party for Normalcy (DSD on the squeezebox with
+%D a proper DAC connected but it can hardly keep up which also counts for me with MS
+%D testing faster than I can provide variants (www.youtube.com/watch?v=xzQCqAJNOSM).
\unprotect
%D We move these definitions into the format:
-% test [[\char948 \cldcontext{utf.char(948)}]]
-% test $[[\char948 \cldcontext{utf.char(948)}]]$
-
\registerctxluafile{math-ini}{autosuffix}
\registerctxluafile{math-dim}{autosuffix}
\registerctxluafile{math-act}{autosuffix}
@@ -204,7 +180,6 @@
+\rightbottomkernclassoptioncode
\relax
-
% obsolete
\setnewconstant\mathboxcode \zerocount
@@ -212,6 +187,9 @@
\setnewconstant\mathalphacode \zerocount
\setnewconstant\mathnothingcode \zerocount
+%D At some point we will drop these in the \LUAMETATEX\ engine becuase we have many
+%D more options there.
+
\pushoverloadmode
\untraced\permanent\protected\def\binoppenalty {\setmathpostpenalty\mathbinarycode}
\untraced\permanent\protected\def\prebinoppenalty{\setmathprepenalty \mathbinarycode}
@@ -219,12 +197,8 @@
\untraced\permanent\protected\def\prerelpenalty {\setmathprepenalty \mathrelationcode}
\popoverloadmode
-% \newcount\binoppenalty
-% \newcount\prebinoppenalty
-% \newcount\relpenalty
-% \newcount\prerelpenalty
-
-% topaccent botaccent .. but do we ever need these so they will be inlined or we need them for all
+%D These verbose commands are obsolete because there are plenty more classes in
+%D \LMTX\ than in \MKIV.
\permanent\protected\def\ordordspacing {\setmathspacing \mathordinarycode \mathordinarycode }
\permanent\protected\def\ordopspacing {\setmathspacing \mathordinarycode \mathoperatorcode }
@@ -382,7 +356,7 @@
\permanent\protected\def\accentmiddlespacing{\setmathspacing \mathaccentcode \mathmiddlecode }
\permanent\protected\def\accentaccentspacing{\setmathspacing \mathaccentcode \mathaccentcode }
-%D In the end Mikael and I prefer for this:
+%D In the end Mikael and I prefer this but we need a high level interface:
% \setmathignore\Umathspacebeforescript\plusone
% \setmathignore\Umathspaceafterscript \plusone
@@ -392,15 +366,29 @@
\mathslackmode \plusone
-\setmathoptions\mathoperatorcode \plusthree
-\setmathoptions\mathbinarycode \plusthree
-\setmathoptions\mathrelationcode \plusthree
-\setmathoptions\mathopencode \plusthree
-\setmathoptions\mathclosecode \plusthree
-\setmathoptions\mathpunctuationcode\plusthree
-\setmathoptions\mathfractioncode \plusthree
+\integerdef\defaultmathclassoptions\numexpr
+ \nopreslackclassoptioncode
+ +\nopostslackclassoptioncode
+ % +\lefttopkernclassoptioncode
+ % +\righttopkernclassoptioncode
+ % +\leftbottomkernclassoptioncode
+ % +\rightbottomkernclassoptioncode
+ % +\lookaheadforendclassoptioncode
+\relax
+
+\setmathoptions\mathbinarycode\numexpr
+ \defaultmathclassoptions
+ +\lookaheadforendclassoptioncode
+\relax
-%D For now \unknown
+\setmathoptions\mathoperatorcode \defaultmathclassoptions
+\setmathoptions\mathrelationcode \defaultmathclassoptions
+\setmathoptions\mathopencode \defaultmathclassoptions
+\setmathoptions\mathclosecode \defaultmathclassoptions
+\setmathoptions\mathpunctuationcode\defaultmathclassoptions
+\setmathoptions\mathfractioncode \defaultmathclassoptions
+
+%D For now \unknown (todo: make it adapt to style but we're in text anyway)
\permanent\protected\def\math_discretionary_plus {\discretionary class \mathbinarycode {$+$}{$+$}{$+$}}
\permanent\protected\def\math_discretionary_minus{\discretionary class \mathbinarycode {$-$}{$-$}{$-$}}
@@ -757,200 +745,403 @@
% \Umathspacingmode\allmathstyles\plusone % always pair driven
-% todo: use fullnames instead shirt ones
+% \startsetups math:spacing:presets
+% \resetmathspacing
+% % \ordordspacing \allmathstyles \zeromuskip
+% \inherited\ordopspacing \allmathstyles \thinmuskip
+% \inherited\ordbinspacing \allsplitstyles \medmuskip
+% \inherited\ordbinspacing \allscriptstyles\tinymuskip
+% \inherited\ordrelspacing \allsplitstyles \thickmuskip
+% \inherited\ordrelspacing \allscriptstyles\tinymuskip
+% % \inherited\ordopenspacing \allmathstyles \zeromuskip
+% \inherited\ordmiddlespacing \allsplitstyles \medmuskip
+% \inherited\ordmiddlespacing \allscriptstyles\tinymuskip
+% % \inherited\ordclosespacing \allmathstyles \zeromuskip
+% % \inherited\ordpunctspacing \allmathstyles \zeromuskip
+% \inherited\ordinnerspacing \allsplitstyles \thinmuskip
+% \inherited\ordinnerspacing \allscriptstyles\tinymuskip
+% \inherited\ordfracspacing \allmathstyles \tinymuskip
+% \inherited\ordradspacing \allmathstyles \tinymuskip
+% \inherited\opordspacing \allmathstyles \thinmuskip
+% \inherited\opopspacing \allmathstyles \thinmuskip
+% % \inherited \opbinspacing \allmathstyles \zeromuskip
+% \inherited\oprelspacing \allsplitstyles \thickmuskip
+% \inherited\oprelspacing \allscriptstyles\tinymuskip
+% % \inherited\opopenspacing \allmathstyles \zeromuskip
+% \inherited\opmiddlespacing \allsplitstyles \medmuskip
+% \inherited\opmiddlespacing \allscriptstyles\tinymuskip
+% % \inherited\opclosespacing \allmathstyles \zeromuskip
+% % \inherited\oppunctspacing \allmathstyles \zeromuskip
+% \inherited\opinnerspacing \allsplitstyles \thinmuskip
+% \inherited\opinnerspacing \allscriptstyles\tinymuskip
+% \inherited\opfracspacing \allmathstyles \thinmuskip
+% \inherited\opradspacing \allmathstyles \thinmuskip
+% \inherited\binordspacing \allsplitstyles \medmuskip
+% \inherited\binordspacing \allscriptstyles\tinymuskip
+% \inherited\binopspacing \allsplitstyles \medmuskip
+% \inherited\binopspacing \allscriptstyles\tinymuskip
+% % \inherited\binbinspacing \allmathstyles \zeromuskip
+% % \inherited\binrelspacing \allmathstyles \zeromuskip
+% \inherited\binopenspacing \allsplitstyles \medmuskip
+% \inherited\binopenspacing \allscriptstyles\tinymuskip
+% \inherited\binmiddlespacing \allsplitstyles \medmuskip
+% \inherited\binmiddlespacing \allscriptstyles\tinymuskip
+% % \inherited\binclosespacing \allmathstyles \zeromuskip
+% % \inherited\binpunctspacing \allmathstyles \zeromuskip
+% \inherited\bininnerspacing \allsplitstyles \medmuskip
+% \inherited\bininnerspacing \allscriptstyles\tinymuskip
+% \inherited\binfracspacing \allsplitstyles \medmuskip
+% \inherited\binfracspacing \allscriptstyles\tinymuskip
+% \inherited\binradspacing \allsplitstyles \medmuskip
+% \inherited\binradspacing \allscriptstyles\tinymuskip
+% \inherited\relordspacing \allsplitstyles \thickmuskip
+% \inherited\relordspacing \allscriptstyles\tinymuskip
+% \inherited\relopspacing \allsplitstyles \thickmuskip
+% \inherited\relopspacing \allscriptstyles\tinymuskip
+% % \inherited\relbinspacing \allmathstyles \zeromuskip
+% % \inherited\relrelspacing \allmathstyles \zeromuskip
+% \inherited\relopenspacing \allsplitstyles \thickmuskip
+% \inherited\relopenspacing \allscriptstyles\tinymuskip
+% \inherited\relmiddlespacing \allsplitstyles \thickmuskip
+% \inherited\relmiddlespacing \allscriptstyles\thinmuskip
+% % \inherited\relclosespacing \allmathstyles \zeromuskip
+% % \inherited\relpunctspacing \allmathstyles \zeromuskip
+% \inherited\relinnerspacing \allsplitstyles \thickmuskip
+% \inherited\relinnerspacing \allscriptstyles\tinymuskip
+% \inherited\relfracspacing \allsplitstyles \thickmuskip
+% \inherited\relfracspacing \allscriptstyles\tinymuskip
+% \inherited\relradspacing \allsplitstyles \thickmuskip
+% \inherited\relradspacing \allscriptstyles\tinymuskip
+% % \inherited\openordspacing \allmathstyles \zeromuskip
+% % \inherited\openopspacing \allmathstyles \zeromuskip
+% % \inherited\openbinspacing \allmathstyles \zeromuskip
+% % \inherited\openrelspacing \allmathstyles \zeromuskip
+% % \inherited\openopenspacing \allmathstyles \zeromuskip
+% % \inherited\openmiddlespacing \allmathstyles \zeromuskip
+% % \inherited\openclosespacing \allmathstyles \zeromuskip
+% % \inherited\openpunctspacing \allmathstyles \zeromuskip
+% % \inherited\openinnerspacing \allmathstyles \zeromuskip
+% \inherited\openfracspacing \allmathstyles \tinymuskip
+% % \inherited\openradspacing \allmathstyles \zeromuskip
+% % \inherited\closeordspacing \allmathstyles \zeromuskip
+% \inherited\closeopspacing \allmathstyles \thinmuskip
+% \inherited\closebinspacing \allsplitstyles \medmuskip
+% \inherited\closebinspacing \allscriptstyles\tinymuskip
+% \inherited\closerelspacing \allsplitstyles \thickmuskip
+% \inherited\closerelspacing \allscriptstyles\tinymuskip
+% % \inherited\closeopenspacing \allmathstyles \zeromuskip
+% % \inherited\closemiddlespacing \allmathstyles \zeromuskip
+% % \inherited\closeclosespacing \allmathstyles \zeromuskip
+% % \inherited\closepunctspacing \allmathstyles \zeromuskip
+% \inherited\closeinnerspacing \allsplitstyles \thinmuskip
+% \inherited\closeinnerspacing \allscriptstyles\tinymuskip
+% \inherited\closefracspacing \allsplitstyles \thinmuskip
+% \inherited\closefracspacing \allscriptstyles\tinymuskip
+% % \inherited\closeradspacing \allmathstyles \zeromuskip
+% \inherited\punctordspacing \allsplitstyles \thinmuskip
+% \inherited\punctordspacing \allscriptstyles\tinymuskip
+% \inherited\punctopspacing \allsplitstyles \thinmuskip
+% \inherited\punctopspacing \allscriptstyles\tinymuskip
+% % \inherited\punctbinspacing \allmathstyles \zeromuskip
+% \inherited\punctrelspacing \allsplitstyles \thinmuskip
+% \inherited\punctrelspacing \allscriptstyles\tinymuskip
+% \inherited\punctopenspacing \allsplitstyles \thinmuskip
+% \inherited\punctopenspacing \allscriptstyles\tinymuskip
+% \inherited\punctmiddlespacing \allsplitstyles \thinmuskip
+% \inherited\punctmiddlespacing \allscriptstyles\tinymuskip
+% \inherited\punctclosespacing \allsplitstyles \thinmuskip
+% \inherited\punctclosespacing \allscriptstyles\tinymuskip
+% \inherited\punctpunctspacing \allsplitstyles \thinmuskip
+% \inherited\punctpunctspacing \allscriptstyles\tinymuskip
+% \inherited\punctinnerspacing \allsplitstyles \thinmuskip
+% \inherited\punctinnerspacing \allscriptstyles\tinymuskip
+% \inherited\punctfracspacing \allsplitstyles \thinmuskip
+% \inherited\punctfracspacing \allscriptstyles\tinymuskip
+% \inherited\punctradspacing \allsplitstyles \thinmuskip
+% \inherited\punctradspacing \allscriptstyles\tinymuskip
+% \inherited\innerordspacing \allsplitstyles \thinmuskip
+% \inherited\innerordspacing \allscriptstyles\tinymuskip
+% \inherited\inneropspacing \allmathstyles \thinmuskip
+% \inherited\innerbinspacing \allsplitstyles \medmuskip
+% \inherited\innerbinspacing \allscriptstyles\tinymuskip
+% \inherited\innerrelspacing \allsplitstyles \thickmuskip
+% \inherited\innerrelspacing \allscriptstyles\tinymuskip
+% \inherited\inneropenspacing \allsplitstyles \thinmuskip
+% \inherited\inneropenspacing \allscriptstyles\tinymuskip
+% \inherited\innermiddlespacing \allsplitstyles \thinmuskip
+% \inherited\innermiddlespacing \allscriptstyles\tinymuskip
+% % \inherited\innerclosespacing \allmathstyles \zeromuskip
+% \inherited\innerpunctspacing \allsplitstyles \thinmuskip
+% \inherited\innerpunctspacing \allscriptstyles\tinymuskip
+% \inherited\innerinnerspacing \allsplitstyles \thinmuskip
+% \inherited\innerinnerspacing \allscriptstyles\tinymuskip
+% \inherited\innerfracspacing \allsplitstyles \thinmuskip
+% \inherited\innerfracspacing \allscriptstyles\tinymuskip
+% \inherited\innerradspacing \allsplitstyles \thinmuskip
+% \inherited\innerradspacing \allscriptstyles\tinymuskip
+% \inherited\fracordspacing \allmathstyles \tinymuskip
+% \inherited\fracopspacing \allmathstyles \thinmuskip
+% \inherited\fracbinspacing \allsplitstyles \medmuskip
+% \inherited\fracbinspacing \allscriptstyles\tinymuskip
+% \inherited\fracrelspacing \allsplitstyles \thickmuskip
+% \inherited\fracrelspacing \allscriptstyles\tinymuskip
+% \inherited\fracopenspacing \allsplitstyles \thinmuskip
+% \inherited\fracopenspacing \allscriptstyles\tinymuskip
+% \inherited\fracmiddlespacing \allsplitstyles \medmuskip
+% \inherited\fracmiddlespacing \allscriptstyles\tinymuskip
+% \inherited\fracclosespacing \allmathstyles \tinymuskip
+% % \inherited\fracpunctspacing \allmathstyles \zeromuskip
+% \inherited\fracinnerspacing \allsplitstyles \thinmuskip
+% \inherited\fracinnerspacing \allscriptstyles\tinymuskip
+% \inherited\fracfracspacing \allsplitstyles \thinmuskip
+% \inherited\fracfracspacing \allscriptstyles\tinymuskip
+% \inherited\fracradspacing \allmathstyles \tinymuskip
+% \inherited\radordspacing \allsplitstyles \tinymuskip
+% \inherited\radopspacing \allmathstyles \thinmuskip
+% \inherited\radbinspacing \allsplitstyles \medmuskip
+% \inherited\radbinspacing \allscriptstyles\tinymuskip
+% \inherited\radrelspacing \allsplitstyles \thickmuskip
+% \inherited\radrelspacing \allscriptstyles\tinymuskip
+% % \inherited\radopenspacing \allmathstyles \zeromuskip
+% % \inherited\radmiddlespacing \allmathstyles \zeromuskip
+% % \inherited\radclosespacing \allmathstyles \zeromuskip
+% % \inherited\radpunctspacing \allmathstyles \zeromuskip
+% \inherited\radinnerspacing \allsplitstyles \thinmuskip
+% \inherited\radinnerspacing \allscriptstyles\tinymuskip
+% \inherited\radfracspacing \allmathstyles \tinymuskip
+% \inherited\radradspacing \allmathstyles \tinymuskip
+% \inherited\middleordspacing \allsplitstyles \medmuskip
+% \inherited\middleordspacing \allscriptstyles\tinymuskip
+% \inherited\middleopspacing \allmathstyles \thinmuskip
+% \inherited\middlebinspacing \allsplitstyles \medmuskip
+% \inherited\middlebinspacing \allscriptstyles\tinymuskip
+% \inherited\middlerelspacing \allsplitstyles \thickmuskip
+% \inherited\middlerelspacing \allscriptstyles\tinymuskip
+% % \inherited\middleopenspacing \allmathstyles \zeromuskip
+% % \inherited\middlemiddlespacing \allmathstyles \zeromuskip
+% % \inherited\middleclosespacing \allmathstyles \zeromuskip
+% % \inherited\middlepunctspacing \allmathstyles \zeromuskip
+% \inherited\middleinnerspacing \allsplitstyles \thinmuskip
+% \inherited\middleinnerspacing \allscriptstyles\tinymuskip
+% \inherited\middlefracspacing \allsplitstyles \medmuskip
+% \inherited\middlefracspacing \allscriptstyles\tinymuskip
+% % \inherited\middleradspacing \allmathstyles \zeromuskip
+% %
+% \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allsplitstyles \thinmuskip
+% \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allscriptstyles \tinymuskip
+% \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allsplitstyles \thinmuskip
+% \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allscriptstyles \tinymuskip
+% \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allsplitstyles \thinmuskip
+% \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allscriptstyles \tinymuskip
+% \inherited\setmathspacing \mathfactorialcode \mathfactorialcode \allmathstyles \zeromuskip
+% %
+% \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \thinmuskip
+% \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \thinmuskip
+% \stopsetups
\startsetups math:spacing:presets
\resetmathspacing
- % \ordordspacing \allmathstyles \zeromuskip
- \inherited\ordopspacing \allmathstyles \thinmuskip
- \inherited\ordbinspacing \allsplitstyles \medmuskip
- \inherited\ordbinspacing \allscriptstyles\tinymuskip
- \inherited\ordrelspacing \allsplitstyles \thickmuskip
- \inherited\ordrelspacing \allscriptstyles\tinymuskip
- % \inherited\ordopenspacing \allmathstyles \zeromuskip
- \inherited\ordmiddlespacing \allsplitstyles \medmuskip
- \inherited\ordmiddlespacing \allscriptstyles\tinymuskip
- % \inherited\ordclosespacing \allmathstyles \zeromuskip
- % \inherited\ordpunctspacing \allmathstyles \zeromuskip
- \inherited\ordinnerspacing \allsplitstyles \thinmuskip
- \inherited\ordinnerspacing \allscriptstyles\tinymuskip
- \inherited\ordfracspacing \allmathstyles \tinymuskip
- \inherited\ordradspacing \allmathstyles \tinymuskip
- \inherited\opordspacing \allmathstyles \thinmuskip
- \inherited\opopspacing \allmathstyles \thinmuskip
- %%\inherited \opbinspacing \allmathstyles \zeromuskip
- \inherited\oprelspacing \allsplitstyles \thickmuskip
- \inherited\oprelspacing \allscriptstyles\tinymuskip
- % \inherited\opopenspacing \allmathstyles \zeromuskip
- \inherited\opmiddlespacing \allsplitstyles \medmuskip
- \inherited\opmiddlespacing \allscriptstyles\tinymuskip
- % \inherited\opclosespacing \allmathstyles \zeromuskip
- % \inherited\oppunctspacing \allmathstyles \zeromuskip
- \inherited\opinnerspacing \allsplitstyles \thinmuskip
- \inherited\opinnerspacing \allscriptstyles\tinymuskip
- \inherited\opfracspacing \allmathstyles \thinmuskip
- \inherited\opradspacing \allmathstyles \thinmuskip
- \inherited\binordspacing \allsplitstyles \medmuskip
- \inherited\binordspacing \allscriptstyles\tinymuskip
- \inherited\binopspacing \allsplitstyles \medmuskip
- \inherited\binopspacing \allscriptstyles\tinymuskip
- %% \inherited\binbinspacing \allmathstyles \zeromuskip
- %% \inherited\binrelspacing \allmathstyles \zeromuskip
- \inherited\binopenspacing \allsplitstyles \medmuskip
- \inherited\binopenspacing \allscriptstyles\tinymuskip
- \inherited\binmiddlespacing \allsplitstyles \medmuskip
- \inherited\binmiddlespacing \allscriptstyles\tinymuskip
- %% \inherited\binclosespacing \allmathstyles \zeromuskip
- %% \inherited\binpunctspacing \allmathstyles \zeromuskip
- \inherited\bininnerspacing \allsplitstyles \medmuskip
- \inherited\bininnerspacing \allscriptstyles\tinymuskip
- \inherited\binfracspacing \allsplitstyles \medmuskip
- \inherited\binfracspacing \allscriptstyles\tinymuskip
- \inherited\binradspacing \allsplitstyles \medmuskip
- \inherited\binradspacing \allscriptstyles\tinymuskip
- \inherited\relordspacing \allsplitstyles \thickmuskip
- \inherited\relordspacing \allscriptstyles\tinymuskip
- \inherited\relopspacing \allsplitstyles \thickmuskip
- \inherited\relopspacing \allscriptstyles\tinymuskip
- %% \inherited\relbinspacing \allmathstyles \zeromuskip
- % \inherited\relrelspacing \allmathstyles \zeromuskip
- \inherited\relopenspacing \allsplitstyles \thickmuskip
- \inherited\relopenspacing \allscriptstyles\tinymuskip
- \inherited\relmiddlespacing \allsplitstyles \thickmuskip
- \inherited\relmiddlespacing \allscriptstyles\thinmuskip
- % \inherited\relclosespacing \allmathstyles \zeromuskip
- % \inherited\relpunctspacing \allmathstyles \zeromuskip
- \inherited\relinnerspacing \allsplitstyles \thickmuskip
- \inherited\relinnerspacing \allscriptstyles\tinymuskip
- \inherited\relfracspacing \allsplitstyles \thickmuskip
- \inherited\relfracspacing \allscriptstyles\tinymuskip
- \inherited\relradspacing \allsplitstyles \thickmuskip
- \inherited\relradspacing \allscriptstyles\tinymuskip
- % \inherited\openordspacing \allmathstyles \zeromuskip
- % \inherited\openopspacing \allmathstyles \zeromuskip
- %% \inherited\openbinspacing \allmathstyles \zeromuskip
- % \inherited\openrelspacing \allmathstyles \zeromuskip
- % \inherited\openopenspacing \allmathstyles \zeromuskip
- % \inherited\openmiddlespacing \allmathstyles \zeromuskip
- % \inherited\openclosespacing \allmathstyles \zeromuskip
- % \inherited\openpunctspacing \allmathstyles \zeromuskip
- % \inherited\openinnerspacing \allmathstyles \zeromuskip
- \inherited\openfracspacing \allmathstyles \tinymuskip
- % \inherited\openradspacing \allmathstyles \zeromuskip
- % \inherited\closeordspacing \allmathstyles \zeromuskip
- \inherited\closeopspacing \allmathstyles \thinmuskip
- \inherited\closebinspacing \allsplitstyles \medmuskip
- \inherited\closebinspacing \allscriptstyles\tinymuskip
- \inherited\closerelspacing \allsplitstyles \thickmuskip
- \inherited\closerelspacing \allscriptstyles\tinymuskip
- % \inherited\closeopenspacing \allmathstyles \zeromuskip
- % \inherited\closemiddlespacing \allmathstyles \zeromuskip
- % \inherited\closeclosespacing \allmathstyles \zeromuskip
- % \inherited\closepunctspacing \allmathstyles \zeromuskip
- \inherited\closeinnerspacing \allsplitstyles \thinmuskip
- \inherited\closeinnerspacing \allscriptstyles\tinymuskip
- \inherited\closefracspacing \allsplitstyles \thinmuskip
- \inherited\closefracspacing \allscriptstyles\tinymuskip
- % \inherited\closeradspacing \allmathstyles \zeromuskip
- \inherited\punctordspacing \allsplitstyles \thinmuskip
- \inherited\punctordspacing \allscriptstyles\tinymuskip
- \inherited\punctopspacing \allsplitstyles \thinmuskip
- \inherited\punctopspacing \allscriptstyles\tinymuskip
- % \inherited\punctbinspacing \allmathstyles \zeromuskip
- \inherited\punctrelspacing \allsplitstyles \thinmuskip
- \inherited\punctrelspacing \allscriptstyles\tinymuskip
- \inherited\punctopenspacing \allsplitstyles \thinmuskip
- \inherited\punctopenspacing \allscriptstyles\tinymuskip
- \inherited\punctmiddlespacing \allsplitstyles \thinmuskip
- \inherited\punctmiddlespacing \allscriptstyles\tinymuskip
- \inherited\punctclosespacing \allsplitstyles \thinmuskip
- \inherited\punctclosespacing \allscriptstyles\tinymuskip
- \inherited\punctpunctspacing \allsplitstyles \thinmuskip
- \inherited\punctpunctspacing \allscriptstyles\tinymuskip
- \inherited\punctinnerspacing \allsplitstyles \thinmuskip
- \inherited\punctinnerspacing \allscriptstyles\tinymuskip
- \inherited\punctfracspacing \allsplitstyles \thinmuskip
- \inherited\punctfracspacing \allscriptstyles\tinymuskip
- \inherited\punctradspacing \allsplitstyles \thinmuskip
- \inherited\punctradspacing \allscriptstyles\tinymuskip
- \inherited\innerordspacing \allsplitstyles \thinmuskip
- \inherited\innerordspacing \allscriptstyles\tinymuskip
- \inherited\inneropspacing \allmathstyles \thinmuskip
- \inherited\innerbinspacing \allsplitstyles \medmuskip
- \inherited\innerbinspacing \allscriptstyles\tinymuskip
- \inherited\innerrelspacing \allsplitstyles \thickmuskip
- \inherited\innerrelspacing \allscriptstyles\tinymuskip
- \inherited\inneropenspacing \allsplitstyles \thinmuskip
- \inherited\inneropenspacing \allscriptstyles\tinymuskip
- \inherited\innermiddlespacing \allsplitstyles \thinmuskip
- \inherited\innermiddlespacing \allscriptstyles\tinymuskip
- % \inherited\innerclosespacing \allmathstyles \zeromuskip
- \inherited\innerpunctspacing \allsplitstyles \thinmuskip
- \inherited\innerpunctspacing \allscriptstyles\tinymuskip
- \inherited\innerinnerspacing \allsplitstyles \thinmuskip
- \inherited\innerinnerspacing \allscriptstyles\tinymuskip
- \inherited\innerfracspacing \allsplitstyles \thinmuskip
- \inherited\innerfracspacing \allscriptstyles\tinymuskip
- \inherited\innerradspacing \allsplitstyles \thinmuskip
- \inherited\innerradspacing \allscriptstyles\tinymuskip
- \inherited\fracordspacing \allmathstyles \tinymuskip
- \inherited\fracopspacing \allmathstyles \thinmuskip
- \inherited\fracbinspacing \allsplitstyles \medmuskip
- \inherited\fracbinspacing \allscriptstyles\tinymuskip
- \inherited\fracrelspacing \allsplitstyles \thickmuskip
- \inherited\fracrelspacing \allscriptstyles\tinymuskip
- \inherited\fracopenspacing \allsplitstyles \thinmuskip
- \inherited\fracopenspacing \allscriptstyles\tinymuskip
- \inherited\fracmiddlespacing \allsplitstyles \medmuskip
- \inherited\fracmiddlespacing \allscriptstyles\tinymuskip
- \inherited\fracclosespacing \allmathstyles \tinymuskip
- % \inherited\fracpunctspacing \allmathstyles \zeromuskip
- \inherited\fracinnerspacing \allsplitstyles \thinmuskip
- \inherited\fracinnerspacing \allscriptstyles\tinymuskip
- \inherited\fracfracspacing \allsplitstyles \thinmuskip
- \inherited\fracfracspacing \allscriptstyles\tinymuskip
- \inherited\fracradspacing \allmathstyles \tinymuskip
- \inherited\radordspacing \allsplitstyles \tinymuskip
- \inherited\radopspacing \allmathstyles \thinmuskip
- \inherited\radbinspacing \allsplitstyles \medmuskip
- \inherited\radbinspacing \allscriptstyles\tinymuskip
- \inherited\radrelspacing \allsplitstyles \thickmuskip
- \inherited\radrelspacing \allscriptstyles\tinymuskip
- % \inherited\radopenspacing \allmathstyles \zeromuskip
- % \inherited\radmiddlespacing \allmathstyles \zeromuskip
- % \inherited\radclosespacing \allmathstyles \zeromuskip
- % \inherited\radpunctspacing \allmathstyles \zeromuskip
- \inherited\radinnerspacing \allsplitstyles \thinmuskip
- \inherited\radinnerspacing \allscriptstyles\tinymuskip
- \inherited\radfracspacing \allmathstyles \tinymuskip
- \inherited\radradspacing \allmathstyles \tinymuskip
- \inherited\middleordspacing \allsplitstyles \medmuskip
- \inherited\middleordspacing \allscriptstyles\tinymuskip
- \inherited\middleopspacing \allmathstyles \thinmuskip
- \inherited\middlebinspacing \allsplitstyles \medmuskip
- \inherited\middlebinspacing \allscriptstyles\tinymuskip
- \inherited\middlerelspacing \allsplitstyles \thickmuskip
- \inherited\middlerelspacing \allscriptstyles\tinymuskip
- % \inherited\middleopenspacing \allmathstyles \zeromuskip
- % \inherited\middlemiddlespacing \allmathstyles \zeromuskip
- % \inherited\middleclosespacing \allmathstyles \zeromuskip
- % \inherited\middlepunctspacing \allmathstyles \zeromuskip
- \inherited\middleinnerspacing \allsplitstyles \thinmuskip
- \inherited\middleinnerspacing \allscriptstyles\tinymuskip
- \inherited\middlefracspacing \allsplitstyles \medmuskip
- \inherited\middlefracspacing \allscriptstyles\tinymuskip
- % \inherited\middleradspacing \allmathstyles \zeromuskip
%
- \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allsplitstyles \thinmuskip
- \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allscriptstyles \tinymuskip
- \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allsplitstyles \thinmuskip
- \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allscriptstyles \tinymuskip
- \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allsplitstyles \thinmuskip
- \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allscriptstyles \tinymuskip
- \inherited\setmathspacing \mathfactorialcode \mathfactorialcode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathordinarycode \mathordinarycode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathordinarycode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathordinarycode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathordinarycode \mathbinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathordinarycode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathordinarycode \mathrelationcode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathordinarycode \mathopencode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathordinarycode \mathmiddlecode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathordinarycode \mathmiddlecode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathordinarycode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathordinarycode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathordinarycode \mathinnercode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathordinarycode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathordinarycode \mathfractioncode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathordinarycode \mathradicalcode \allmathstyles \tinymuskip
+ %
+ \inherited\setmathspacing \mathoperatorcode \mathordinarycode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathoperatorcode \allmathstyles \thinmuskip
+ % \inherited\setmathspacing \mathoperatorcode \mathbinarycode \allmathstyles \ zeromuskip
+ \inherited\setmathspacing \mathoperatorcode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathrelationcode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathoperatorcode \mathopencode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathoperatorcode \mathmiddlecode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathmiddlecode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathoperatorcode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathoperatorcode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathoperatorcode \mathinnercode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathoperatorcode \mathfractioncode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathradicalcode \allmathstyles \thinmuskip
+ %
+ \inherited\setmathspacing \mathbinarycode \mathordinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathordinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathbinarycode \mathoperatorcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathoperatorcode \allscriptstyles \tinymuskip
+ %% \inherited\setmathspacing \mathbinarycode \mathbinarycode \allmathstyles \zeromuskip
+ %% \inherited\setmathspacing \mathbinarycode \mathrelationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathbinarycode \mathopencode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathopencode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathbinarycode \mathmiddlecode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathmiddlecode \allscriptstyles \tinymuskip
+ %% \inherited\setmathspacing \mathbinarycode \mathclosecode \allmathstyles \zeromuskip
+ %% \inherited\setmathspacing \mathbinarycode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathbinarycode \mathinnercode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathbinarycode \mathfractioncode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathfractioncode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathbinarycode \mathradicalcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathradicalcode \allscriptstyles \tinymuskip
+ %
+ \inherited\setmathspacing \mathrelationcode \mathordinarycode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathordinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathrelationcode \mathoperatorcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathoperatorcode \allscriptstyles \tinymuskip
+ %% \inherited\setmathspacing \mathrelationcode \mathbinarycode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathrelationcode \mathrelationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathrelationcode \mathopencode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathopencode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathrelationcode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathmiddlecode \allscriptstyles \thinmuskip
+ % \inherited\setmathspacing \mathrelationcode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathrelationcode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathrelationcode \mathinnercode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathrelationcode \mathfractioncode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathfractioncode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathrelationcode \mathradicalcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathradicalcode \allscriptstyles \tinymuskip
+ %
+ % \inherited\setmathspacing \mathopencode \mathordinarycode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathoperatorcode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathbinarycode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathrelationcode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathopencode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathmiddlecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathpunctuationcode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathinnercode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathopencode \mathfractioncode \allmathstyles \tinymuskip
+ % \inherited\setmathspacing \mathopencode \mathradicalcode \allmathstyles \zeromuskip
%
- \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \thinmuskip
- \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \thinmuskip
+ % \inherited\setmathspacing \mathclosecode \mathordinarycode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathclosecode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathclosecode \mathbinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathclosecode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathclosecode \mathrelationcode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathclosecode \mathopencode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathclosecode \mathmiddlecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathclosecode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathclosecode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathclosecode \mathinnercode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathclosecode \mathfractioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathfractioncode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathclosecode \mathradicalcode \allmathstyles \zeromuskip
+ %
+ \inherited\setmathspacing \mathpunctuationcode \mathordinarycode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathordinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathoperatorcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathoperatorcode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathpunctuationcode \mathbinarycode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathrelationcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathrelationcode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathopencode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathopencode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathmiddlecode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathmiddlecode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathclosecode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathclosecode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathpunctuationcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathpunctuationcode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathinnercode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathfractioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathfractioncode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathradicalcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathradicalcode \allscriptstyles \tinymuskip
+ %
+ \inherited\setmathspacing \mathinnercode \mathordinarycode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathinnercode \mathordinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathinnercode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathinnercode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathinnercode \mathbinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathinnercode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathinnercode \mathrelationcode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathinnercode \mathopencode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathinnercode \mathopencode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathinnercode \mathmiddlecode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathinnercode \mathmiddlecode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathinnercode \mathclosecode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathinnercode \mathpunctuationcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathinnercode \mathpunctuationcode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathinnercode \mathinnercode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathinnercode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathinnercode \mathfractioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathinnercode \mathfractioncode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathinnercode \mathradicalcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathinnercode \mathradicalcode \allscriptstyles \tinymuskip
+ %
+ \inherited\setmathspacing \mathfractioncode \mathordinarycode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathfractioncode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathfractioncode \mathbinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathfractioncode \mathrelationcode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathopencode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfractioncode \mathopencode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathmiddlecode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathfractioncode \mathmiddlecode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathclosecode \allmathstyles \tinymuskip
+ % \inherited\setmathspacing \mathfractioncode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathfractioncode \mathinnercode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfractioncode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathfractioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfractioncode \mathfractioncode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathradicalcode \allmathstyles \tinymuskip
+ %
+ \inherited\setmathspacing \mathradicalcode \mathordinarycode \allsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathradicalcode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathradicalcode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathradicalcode \mathbinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathradicalcode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathradicalcode \mathrelationcode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathradicalcode \mathopencode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathradicalcode \mathmiddlecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathradicalcode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathradicalcode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathradicalcode \mathinnercode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathradicalcode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathradicalcode \mathfractioncode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathradicalcode \mathradicalcode \allmathstyles \tinymuskip
+ %
+ \inherited\setmathspacing \mathmiddlecode \mathordinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathordinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathbinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathrelationcode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathmiddlecode \mathopencode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathmiddlecode \mathmiddlecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathmiddlecode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathmiddlecode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathmiddlecode \mathinnercode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathinnercode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathfractioncode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathfractioncode \allscriptstyles \tinymuskip
+ % \inherited\setmathspacing \mathmiddlecode \mathradicalcode \allmathstyles \zeromuskip
+ %
+ \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allscriptstyles \tinymuskip
+ \inherited\setmathspacing \mathfactorialcode \mathfactorialcode \allmathstyles \zeromuskip
+ %
+ \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \thinmuskip
\stopsetups
\directsetup{math:spacing:default}
@@ -1335,35 +1526,8 @@
\immutable\chardef\c_math_strut"28
-% \protected\def\math_strut_htdp#1%
-% {\s!height\fontcharht#1\c_math_strut
-% \s!depth \fontchardp#1\c_math_strut}
-%
-% now we need this (kind of inefficient):
-
-% \protected\def\math_strut_htdp#1% nasty!
-% {\s!height\dimexpr\mathscale#1\fontcharht#1\c_math_strut/\glyphscale\relax
-% \s!depth \dimexpr\mathscale#1\fontchardp#1\c_math_strut/\glyphscale\relax}
-%
-% this overflows so we use this instead:
-
-% \protected\def\math_strut_htdp#1% nasty!
-% {\s!height\dimexpr(\fontcharht#1\c_math_strut/\glyphscale)*\mathscale#1\relax
-% \s!depth \dimexpr(\fontchardp#1\c_math_strut/\glyphscale)*\mathscale#1\relax}
-%
-% \protected\def\math_strut_normal
-% {\vrule
-% \s!width \zeropoint
-% \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}%
-% \relax}
-%
-% \protected\def\math_strut_visual
-% {\hskip-.01\emwidth
-% \vrule
-% \s!width .02\emwidth
-% \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}%
-% \relax
-% \hskip-.01\emwidth}
+%D For the evolution of these struts see the git repositories and older code in
+%D \MKIV\ and \MKI\ (commented code removed end April 2022).
\let\math_strut_math_style\normalmathstyle
@@ -1415,6 +1579,15 @@
\permanent\protected\def\topstrut{\srule\s!width\zeropoint\s!height\strutht \s!depth\zeropoint\relax}
\permanent\protected\def\botstrut{\srule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp \relax}
+\newdimen\mathstrutht
+\newdimen\mathstrutdp
+
+\appendtoks
+ \mathstrutht\strutht
+ \mathstrutdp\strutdp
+ % \writestatus{!!!!!!}{\the\mathstrutht,\the\mathstrutdp}%
+\to \everymathematics
+
%D We could have a arg variant \unknown\ but not now.
\permanent\protected\def\mathopwithlimits#1#2{\mathop{#1{#2}}\limits}
@@ -1431,18 +1604,6 @@
% \let\normalmathop\mathop % already defined
-% no longer needed as we no longer switch fonts
-%
-% \protected\def\mathop
-% {\normalmathop
-% \bgroup
-% % no: \let\rm\mf
-% \afterassignment\math_op\let\nexttoken=}
-%
-% \def\math_op{\ifx\nexttoken\bgroup\else\nexttoken\egroup\fi}
-
-% this one too: \letvalue{\??mathcodecommand op}\mathop ?
-
\permanent\protected\def\normalmbox
{\normalhbox\bgroup
\usemathematicsstyleandcolor\c!textstyle\c!textcolor % new
@@ -1507,90 +1668,44 @@
% \Umathcode"2063 = \mathghostcode \zerocount "2063 % \invisiblecomma
% \Umathcode"2064 = \mathghostcode \zerocount "2063 % \invisibleplus
-% \protected\def\math_mfunction_styled
-% {%\begingroup
-% \usemathematicscolorparameter\c!functioncolor
-% \edef\p_functionstyle{\mathematicsparameter\c!functionstyle}%
-% \ifempty\p_functionstyle
-% \expandafter\math_mfunction_styled_none
-% \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname
-% \expandafter\math_mfunction_styled_text
-% \else
-% \expandafter\math_mfunction_styled_math
-% \fi}
-%
-% \protected\def\math_mfunction_styled_text#1%
-% {\expandafter$\expandafter\mathoptext\expandafter{\lastnamedcs#1}$%
-% %{\normalexpanded{$\mathoptext{\csname\??alternativestyle\p_functionstyle\endcsname#1}$}%
-% }%\endgroup}
-%
-% \protected\def\math_mfunction_styled_math#1%
-% {\p_functionstyle
-% #1%
-% }%\endgroup}
-%
-% \protected\def\math_mfunction_styled_none#1%
-% {\math_upright
-% #1%
-% }%\endgroup}
-%
-% \permanent\protected\def\mfunction#1%
-% {\mathatom mathfont class \mathfunctioncode \bgroup
-% \math_tags_mfunctiontxt{#1}\c_apply_function
-% \hbox{\math_mfunction_styled{#1}}%
-% \egroup}
-%
-% \permanent\protected\def\mfunctionlabeltext#1%
-% {\mathatom mathfont class \mathfunctioncode \bgroup
-% \math_tags_mfunctionlab{#1}\c_apply_function
-% \hbox{\math_mfunction_styled{\mathlabeltext{#1}}}%
-% \egroup}
-
-% \def\math_function_handle#1#2%
-% {\begingroup
-% \usemathematicscolorparameter\c!functioncolor
-% \edef\p_functionstyle{\mathematicsparameter\c!functionstyle}%
-% \ifempty\p_functionstyle
-% \expandafter\math_upright
-% \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname
-% \expandafter\lastnamedcs
-% \else
-% \expandafter\p_functionstyle
-% \fi
-% \mathatom mathfont class \mathfunctioncode \bgroup
-% \math_tags_mfunctionlab{#2}\c_apply_function % maybe move this before mathatom
-% #1{#2}% how to avoid going ord, we need something text with no spacing at all
-% \egroup
-% \endgroup}
+%D For previous variants of the function styling you can check the git repository
+%D end April 2022.
-\protected\def\math_function_handle#1#2%
- {\mathatom mathfont class \mathfunctioncode \bgroup % textfont
- \math_tags_mfunctionlab{#2}\c_apply_function
- \usemathematicscolorparameter\c!functioncolor
- \edef\p_functionstyle{\mathematicsparameter\c!functionstyle}%
- \ifempty\p_functionstyle
- \expandafter\math_upright
- \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\p_functionstyle
- \fi
- #1{#2}%
- \egroup}
-
-\permanent\protected\def\mfunction {\math_function_handle\firstofoneargument}
-\permanent\protected\def\mfunctionlabeltext{\math_function_handle\mathlabeltext}
-
-\permanent\tolerant\protected\def\definemathfunction[#1]#*[#2]%
- {\frozen\protected\defcsname#1\endcsname{\math_function_handle_label{#1}{#2}}}
-
-\protected\def\math_function_handle_label#1#2% tag settings
+\protected\def\math_function_handle#1#2#3%
{\begingroup
- \getdummyparameters[\c!mathlimits=,#2]%
- \math_function_handle\mathlabeltext{#1}%
- \ifcstok{\dummyparameter\c!mathlimits}\v!yes\limits\fi
+ \getdummyparameters[\c!mathlimits=,#1]%
+ \edef\p_limits{\dummyparameter\c!mathlimits}%
+ \mathatom
+ mathfont
+ class \mathfunctioncode
+ \ifx\p_limits\v!no
+ nolimits
+ \orelse\ifx\p_limits\v!yes
+ limits
+ \orelse\ifx\p_limits\v!auto
+ nolimits
+ limits
+ \fi
+ \bgroup % textfont
+ \math_tags_mfunctionlab{#3}\c_apply_function
+ \usemathematicscolorparameter\c!functioncolor
+ \edef\p_functionstyle{\mathematicsparameter\c!functionstyle}%
+ \ifempty\p_functionstyle
+ \expandafter\math_upright
+ \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname
+ \expandafter\lastnamedcs
+ \else
+ \expandafter\p_functionstyle
+ \fi
+ #2{#3}%
+ \egroup
\endgroup}
+\permanent\tolerant\protected\def\mfunction [#1]{\math_function_handle{#1}\firstofoneargument}
+\permanent\tolerant\protected\def\mfunctionlabeltext[#1]{\math_function_handle{#1}\mathlabeltext}
+
+\permanent\tolerant\protected\def\definemathfunction[#1]#*[#2]%
+ {\frozen\protected\defcsname#1\endcsname{\math_function_handle{#2}\mathlabeltext{#1}}}
\let\math_tags_mfunctiontxt\gobbletwoarguments
\let\math_tags_mfunctionlab\gobbletwoarguments
@@ -1636,25 +1751,6 @@
\enforced\let\apply\math_tags_apply
\to\everymathematics
-% \def\mlimitsfunction #1{\mathlimopcomm{{\mr#1}}
-% \def\mnolimitsfunction#1{\mathnolopcomm{{\mr#1}}
-
-% %D Taco posted this solution as response to a mail by Olivier, so let's integrate
-% %D it here.
-%
-% \def\currentmscaledstyle{rm} % will be plugged into the typeface text=ss option
-%
-% \protected\def\math_function_style_opnolimits #1{\mathop{\mscaledtext{#1}}\nolimits}
-% \protected\def\math_function_style_mfunction #1{\mscaledtext{\math_tags_function{#1}}}
-% \protected\def\math_function_style_mfunctionlabeltext#1{\mscaledtext{\math_tags_functionlabeltext{#1}}}
-%
-% \protected\def\setmathfunctionstyle#1% rm ss tt (can be made faster if needed)
-% {\doifsomething{#1}
-% {\def\currentmscaledstyle{#1}%
-% \let\mathopnolimits \math_function_style_opnolimits
-% \let\mfunction \math_function_style_mfunction
-% \let\mfunctionlabeltext\math_function_style_mfunctionlabeltext}}
-
\mutable\def\currentmscaledstyle{rm} % will be plugged into the typeface text=ss option
\permanent\protected\def\mscaledtext#1%
@@ -1694,8 +1790,8 @@
%D \donknuthmode $x_2$ x_2 \test{$x_2$} \test{x_2}
%D \stoptyping
%D
-%D The result is as expected: the first line typesets ok, while the second
-%D one triggers an error message.
+%D The result is as expected: the first line typesets ok, while the second one
+%D triggers an error message.
\setnewconstant\activemathcharcode "8000
@@ -1713,18 +1809,18 @@
\activatemathcharacter\circumflexasciicode
\activatemathcharacter\underscoreasciicode
-\activatemathcharacter\ampersandasciicode
-
-\permanent\def\normalmathaligntab{&} % \let\normalmathaligntab\aligntab doesn;t work well in a let to & (a def works ok)
+%activatemathcharacter\ampersandasciicode
-\appendtoks
- \edef\p_ampersand{\mathematicsparameter\s!ampersand}%
- \ifx\p_ampersand\v!normal
- \enforced\let\specialmathaligntab\normalmathaligntab
- \else
- \enforced\let\specialmathaligntab\mathampersand
- \fi
-\to \everysetupmathematics
+% \permanent\def\normalmathaligntab{&}
+%
+% \appendtoks
+% \edef\p_ampersand{\mathematicsparameter\s!ampersand}%
+% \ifx\p_ampersand\v!normal
+% \enforced\let\specialmathaligntab\normalmathaligntab
+% \else
+% \enforced\let\specialmathaligntab\mathampersand
+% \fi
+% \to \everysetupmathematics
%D A simplified version of this code is:
%D
@@ -1762,15 +1858,14 @@
%D $A \char"26 B$
%D \stoptyping
%D
-%D fails with: \type{Misplaced alignment tab character &} and here is the
-%D reason.
+%D fails with: \type{Misplaced alignment tab character &} and here is the reason.
%D
-%D When we have a letter or other category a check happens for an active
-%D character and when it has one then it gets expanded and fed back into the
-%D scanner (sort of).
+%D When we have a letter or other category a check happens for an active character
+%D and when it has one then it gets expanded and fed back into the scanner (sort
+%D of).
%D
-%D A \type {\char} is also fed back as raw character and again when it's letter
-%D of other goes through the same process.
+%D A \type {\char} is also fed back as raw character and again when it's letter of
+%D other goes through the same process.
%D
%D This means that we cannot have a definition like:
%D
@@ -1786,153 +1881,42 @@
%D
%D Maybe we need an option to treat chars like chars.
-% \activatemathcharacter\primeasciicode
-
-% not used:
-%
-% \mathcode\spaceasciicode\activemathcharcode
-%
-% not used:
-%
-% \bgroup
-% \catcode\underscoreasciicode\activecatcode
-% \doglobal\appendtoks
-% \mathcode\underscoreasciicode\activemathcharcode
-% \let_\activemathunderscore
-% \to \everymathematics
-% \egroup
-
-% Here follows some plain legacy: primes.
-%
-% The \let\prime\math_prime_indeed might become an obsolete as we have \doubleprime
-% and \tripleprime and collapsing can nicely handle the script then.
-%
-% Collapsing to 0x2033 and 0x2034 happens elsewhere.
-%
-% \switchtobodyfont[modern]
-% \switchtobodyfont[cambria]
-% \switchtobodyfont[xits]
-% \switchtobodyfont[minion]
-% \setupbodyfont[dejavu]
-%
-% \startbuffer
-% \def\SampleLine#1{%
-% \NC#1
-% \NC\switchtobodyfont[#1]$f^2$ % 1
-% \NC\switchtobodyfont[#1]$f\prime^2$ % 2
-% \NC\switchtobodyfont[#1]$f\prime\prime^2$ % 3
-% \NC\switchtobodyfont[#1]$f\prime\prime\prime^2$ % 4
-% \NC\switchtobodyfont[#1]$f{\prime}^2$ % 5
-% \NC\switchtobodyfont[#1]$f{\prime\prime}^2$ % 6
-% \NC\switchtobodyfont[#1]$f{\prime\prime\prime}^2$ % 7
-% \NC\switchtobodyfont[#1]$f'(x)$ % 8
-% \NC\switchtobodyfont[#1]$f''(x)$ % 9
-% \NC\switchtobodyfont[#1]$f'''(x)$ % 10
-% \NC\NR
-% }
-%
-% \starttabulate[|Tl|Tc|Tc|Tc|Tc|Tc|Tc|Tc|Tc|Tc|Tc|]
-% \NC\NC1\NC2\NC3\NC4\NC5\NC6\NC7\NC8\NC9\NC10\NC\NR
-% \SampleLine{modern}
-% \SampleLine{cambria}
-% \SampleLine{xits}
-% \SampleLine{minion}
-% \stoptabulate
-% \stopbuffer
-%
-% \typebuffer \getbuffer
-
-% most math fonts have messed up primes, just test this: $\prime^{\prime^{\prime}}$
-
-{ \catcode\circumflexasciicode\othercatcode \immutable\glet\othercircumflextoken ^ }
-{ \catcode\circumflexasciicode\superscriptcatcode \immutable\glet\superscriptcircumflextoken^ }
+%D The commented prime related code (dating from \MKII\ times has been removed in
+%D April 2022 but it's in the archives. In \LUAMETATEX\ primes are part of the
+%D machinery and additional magic (as in \MKIV) happens elsewhere. There is no
+%D need to remember old stuff because \MKII\ times are long gone.
\ifdefined \prime \else
\Umathchardef\prime "0 "0 "2032
\fi
-% \let\math_prime_indeed_normal\prime
-%
-% \appendtoks
-% \let\math_prime_indeed_normal\prime % gets defined later
-% \let\mathfontprime\prime % for tracing
-% \let\prime\math_prime_indeed % so this is needed
-% \to \everydump
-%
-% \protected\def\math_prime_indeed
-% {\iffontchar\textfont\zerocount"FE325\relax
-% ^\bgroup
-% \expandafter\math_prime_indeed_virtual % virtual mess (using funny signal)
-% \else
-% % \expandafter\math_prime_indeed_normal % gets collapsed
-% \expandafter\math_prime_indeed_crapped % gets collapsed
-% \fi}
-%
-% \def\math_prime_indeed_crapped
-% {{^{\math_prime_indeed_normal}}}
-%
-% % \let\prime\math_prime_indeed
-%
-% \def\math_prime_indeed_virtual
-% {\math_prime_indeed_normal
-% \futurelet\nexttoken\math_prime_indeed_choice}
-%
-% \installcorenamespace{mathprime}
-%
-% \def\math_prime_indeed_choice
-% {\csname\??mathprime
-% \ifx '\nexttoken a\else
-% \ifx \math_prime_indeed_normal\nexttoken a\else
-% \ifx \prime\nexttoken a\else
-% \ifx\superscriptcircumflextoken\nexttoken b\else
-% \ifx\othercircumflextoken \nexttoken b\else
-% c\fi\fi\fi\fi\fi
-% \endcsname}
-%
-% \setvalue{\??mathprime a}#1{\math_prime_indeed_virtual}
-% \setvalue{\??mathprime b}#1#2{#2\egroup}
-% \setvalue{\??mathprime c}{\egroup}
-%
-% \let\activemathprime\math_prime_indeed
-%
-% \bgroup
-%
-% \catcode\primeasciicode\activecatcode
-%
-% \global\everymathematics\expandafter{\the\everymathematics\let'\math_prime_indeed} % todo: do this at the lua end
-%
-% \egroup
-
-% $\char26$ gives an error because it expands to an active character that
-% then becomes an & which is then seen as an alignment character; anyway,
-% even when we switch like this the different meaning only happens when
-% we're in math mode which can be delayed till we're in a cell
+%D We also dropped th eoption to let ampersands be alignment tabs. That has never
+%D been a \CONTEXT\ option anyway.
\bgroup
\catcode\underscoreasciicode\activecatcode
\catcode\circumflexasciicode\activecatcode
- \catcode\ampersandasciicode \activecatcode
+ % \catcode\ampersandasciicode \activecatcode
\aliased\glet\specialmathaligntab\normalmathaligntab
\permanent\protected\gdef\obeymathcatcodes{%
\enforced\let _\normalsubscript
\enforced\let ^\normalsuperscript
- \enforced\def &\specialmathaligntab
+ % \enforced\def &\specialmathaligntab
}
\doglobal\appendtoks
\enforced\let _\normalsubscript
\enforced\let ^\normalsuperscript
- \enforced\let &\specialmathaligntab
+ % \enforced\let &\specialmathaligntab
\to \everymathematics
- % \permanent\protected\gdef\normalmathampersands
- % {\let\specialmathaligntab\mathampersand}
-
\egroup
+%D We keep this, just for the fun of it:
+
\newtoks\everydonknuthmode
\newtoks\everynonknuthmode
@@ -2152,20 +2136,6 @@
\defcsname\??mathgreek\v!normal\endcsname{2}
\defcsname\??mathgreek\v!italic\endcsname{3}
-% \appendtoks
-% \edef\p_sygreek{\mathematicsparameter\s!sygreek}%
-% \edef\p_lcgreek{\mathematicsparameter\s!lcgreek}%
-% \edef\p_ucgreek{\mathematicsparameter\s!ucgreek}%
-% \c_math_greek_attribute"% hex digits
-% \csname\??mathgreek\ifcsname\??mathgreek\p_sygreek\endcsname\p_sygreek\else\v!none\fi\endcsname
-% \csname\??mathgreek\ifcsname\??mathgreek\p_lcgreek\endcsname\p_lcgreek\else\v!none\fi\endcsname
-% \csname\??mathgreek\ifcsname\??mathgreek\p_ucgreek\endcsname\p_ucgreek\else\v!none\fi\endcsname
-% \relax
-% \ifcase\c_math_greek_attribute
-% \c_math_greek_attribute\attributeunsetvalue
-% \fi
-% \to \everyswitchmathematics
-
\appendtoks
\edef\p_sygreek{\mathematicsparameter\s!sygreek}% still needed ?
\edef\p_lcgreek{\mathematicsparameter\s!lcgreek}% still needed ?
@@ -2234,7 +2204,8 @@
%D Math italics (experiment)
%D We need keys but what names to use and because we have hardcoded solution
-%D we can stick to numbers.
+%D we can stick to numbers. At some point this will change because we can now
+%D control in in the engine and goodies per font.
\installcorenamespace{mathitalics}
@@ -3188,23 +3159,6 @@
\let\m_math_text_choice_face\relax
-% if needed we can get rid of the normalize (predo in font code)
-
-% \def\math_text_choice_font#1#2#%
-% {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}%
-% \hbox#2\bgroup
-% \font_basics_switchtobodyfont\m_math_text_choice_face
-% #1%
-% \let\next}
-
-% \def\math_text_choice_word#1#2#%
-% {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}%
-% \hbox#2\bgroup
-% \font_basics_switchtobodyfont\m_math_text_choice_face
-% #1%
-% \nospacing % \normalnospaces\plusone
-% \let\next}
-
%D We accept a low level box specification so that one can make helpers:
%D
%D \startbuffer
@@ -3283,54 +3237,8 @@
\enforced\let\text\mathtext
\to \everymathematics
-%D The next code is derived from plain \TEX. The names will change!
-
\newcount\interdisplaylinepenalty \interdisplaylinepenalty\plushundred
-% Actually, not using an if saves one macro so there is no penalty for splitting up
-% this macro.
-%
-% \newif\ifdt@p
-%
-% \def\displ@y
-% {\global\dt@ptrue
-% \math_openup\displayopenupvalue % was \openup\jot
-% \everycr
-% {\noalign
-% {\ifdt@p
-% \global\dt@pfalse
-% \ifdim\prevdepth>-\thousandpoint
-% \vskip-\lineskiplimit
-% \vskip\normallineskiplimit
-% \fi
-% \else
-% \penalty\interdisplaylinepenalty
-% \fi}}}
-
-\newtoks\mathdisplayaligntweaks
-
-% this can become an option:
-
-\let\math_display_align_hack_indeed\relax
-
-\protected\def\math_display_align_hack % I don't like the global, maybe we should push and pop
- {\glet\math_display_align_hack_indeed\math_display_align_hack_remove_skip
- \math_openup\displayopenupvalue % was \math_openup\jot
- \everycr{\noalign{\math_display_align_hack_indeed}}}
-
-\def\math_display_align_hack_remove_skip
- {\ifdim\prevdepth>-\thousandpoint
- \vskip\dimexpr-\lineskiplimit+\normallineskiplimit\relax
- \fi
- \glet\math_display_align_hack_indeed\math_display_align_hack_insert_penalty}
-
-\def\math_display_align_hack_insert_penalty
- {\penalty\interdisplaylinepenalty}
-
-\appendtoks
- \math_display_align_hack
-\to \mathdisplayaligntweaks
-
%D Text in math:
\permanent\protected\def\mathortext
diff --git a/tex/context/base/mkxl/math-noa.lmt b/tex/context/base/mkxl/math-noa.lmt
index 11621f9bd..d74e212da 100644
--- a/tex/context/base/mkxl/math-noa.lmt
+++ b/tex/context/base/mkxl/math-noa.lmt
@@ -71,6 +71,7 @@ local trace_domains = false registertracker("math.domains", function(v
local trace_families = false registertracker("math.families", function(v) trace_families = v end)
local trace_fences = false registertracker("math.fences", function(v) trace_fences = v end)
local trace_unstacking = false registertracker("math.unstack", function(v) trace_unstacking = v end)
+local trace_snapping = false registertracker("math.snapping", function(v) trace_snapping = v end)
local check_coverage = true registerdirective("math.checkcoverage", function(v) check_coverage = v end)
@@ -89,6 +90,7 @@ local report_domains = logreporter("mathematics","domains")
local report_families = logreporter("mathematics","families")
local report_fences = logreporter("mathematics","fences")
local report_unstacking = logreporter("mathematics","unstack")
+local report_snapping = logreporter("mathematics","snapping")
local a_mathrendering = privateattribute("mathrendering")
local a_exportstatus = privateattribute("exportstatus")
@@ -129,6 +131,7 @@ local getlist = nuts.getlist
local getwidth = nuts.getwidth
local getheight = nuts.getheight
local getdepth = nuts.getdepth
+local getwhd = nuts.getwhd
local getnucleus = nuts.getnucleus
local getsub = nuts.getsub
@@ -142,6 +145,9 @@ local setsup = nuts.setsup
local setsubpre = nuts.setsubpre
local setsuppre = nuts.setsuppre
+local getoffsets = nuts.getoffsets
+local setoffsets = nuts.setoffsets
+
local flushnode = nuts.flush
local copy_node = nuts.copy
local slide_nodes = nuts.slide
@@ -169,6 +175,10 @@ local unsetvalue = attributes.unsetvalue
local implement = interfaces.implement
local v_reset = variables.reset
+local v_small = variables.small
+local v_medium = variables.medium
+local v_big = variables.big
+local v_line = variables.line
local chardata = characters.data
@@ -2173,6 +2183,185 @@ do
end
+
+do
+
+ local traversehlist = nuts.traversers.hlist
+
+ local getshift = nuts.getshift
+ local setwhd = nuts.setwhd
+ local setshift = nuts.setshift
+
+ -- normalizer: can become engine feature (native tex loves shifts)
+
+ local function normalize(h)
+ for n, s in traversehlist, h do
+ if s > 0 then
+ local sh = getshift(n)
+ local ox, oy = getoffsets(n)
+ if sh ~= 0 then
+ local w, h, d = getwhd(n)
+ h = h - sh
+ d = d + sh
+ setshift(n)
+ setwhd(n,w,h > 0 and h or 0,d > 0 and d or 0)
+ setoffsets(n,ox,oy - sh)
+ end
+ end
+ local l = getlist(l)
+ if l then
+ normalize(l)
+ end
+ end
+ end
+
+ function handlers.normalize(h)
+ return normalize(h)
+ end
+
+end
+
+do
+
+ local traversehlist = nuts.traversers.hlist
+
+ local texgetdimen = tex.getdimen
+ local texgetglue = tex.getglue
+ local texgetcount = tex.getcount
+
+ local newrule = nuts.pool.outlinerule
+ local newkern = nuts.pool.kern
+ local setcolor = nodes.tracers.colors.set
+
+ local a_mathsnap = attributes.private("mathsnap")
+
+ function handlers.snap(h,_,_,_,_,level)
+ -- if not level or level == 0 then
+ if texgetcount("mathnestinglevel") == 1 then
+ local trace_color
+ if trace_snapping == "frame" then
+ trace_color = "darkgray"
+ elseif type(trace_snapping) == "string" then
+ trace_color = trace_snapping
+ else
+ trace_color = false
+ end
+ local ht, dp, dd, hs, ds, hd
+ for n, s in traversehlist, h do
+ local step = getattr(n,a_mathsnap)
+ if step then
+ local done = false
+ if not dd then
+ ht = texgetdimen("mathstrutht")
+ dp = texgetdimen("mathstrutdp")
+ hd = ht + dp
+ -- lineskip can be large in alignments
+ -- dd = hd / 12
+ dd = hd / 6
+ if step == 0xFFFF then
+ hs = dd
+ ds = dd
+ else
+ hs = ht/step
+ ds = dp/step
+ end
+ end
+ local w, h, d = getwhd(n)
+ -- snap to line
+ ::height::
+ if h-dd < ht then
+ if trace_snapping == true then
+ report_snapping("adapting ht: old %p, new %p, lineskip %p",h,ht,dd)
+ end
+ done = true
+ setheight(n,ht)
+ goto depth
+ end
+ if h > ht then
+-- while ht < (h-dd) do
+ while ht < h do
+ ht = round(ht + hs)
+ end
+ if h ~= ht then
+ setheight(n,ht)
+ if trace_snapping == true then
+ report_snapping("enlarging ht: old %p, new %p, step %p",h,ht,hs)
+ end
+ done = true
+ end
+ end
+ ::depth::
+ if d-dd < dp then
+ if trace_snapping == true then
+ report_snapping("adapting dp: old %p, new %p, lineskip %p",d,dp,dd)
+ end
+ setdepth(n,dp)
+ done = true
+ goto done
+ end
+ if d > dp then
+-- while dp < (d-dd) do
+ while dp < d do
+ dp = round(dp + ds)
+ end
+ if d ~= dp then
+ setdepth(n,dp)
+ if trace_snapping == true then
+ report_snapping("enlarging dp: old %p, new %p, step %p",d,dp,ds)
+ end
+ done = true
+ end
+ end
+ ::done::
+ if done and trace_color then
+ -- w, h, d = getwhd(n)
+ -- local r = newrule(w,h,d,65536)
+ -- setcolor(r,trace_color)
+ -- setlink(r,newkern(-w),getlist(n))
+ -- setlist(n,r)
+
+ local old = newrule(w,h,d,65536)
+ setcolor(old,"middlegray")
+ w, h, d = getwhd(n)
+ local new = newrule(w,h,d,65536/4)
+ setcolor(new,trace_color)
+ setlink(old,newkern(-w),new,newkern(-w),getlist(n))
+ local ox, oy = getoffsets(n)
+ setoffsets(old,-ox,-oy)
+ setoffsets(new,-ox,-oy)
+ setlist(n,old)
+ end
+ end
+ end
+ end
+ end
+
+ local valid = {
+ [v_reset] = unsetvalue,
+ [v_line] = 0xFFFF,
+ [v_small] = 8,
+ [v_medium] = 4,
+ [v_big] = 2,
+ }
+
+ function mathematics.setsnapping(s)
+ if not enabled then
+ enableaction("math", "noads.handlers.snap")
+ enabled = true
+ end
+ texsetattribute(a_mathsnap,valid[s] or unsetvalue)
+ end
+
+ implement {
+ name = "setmathsnapping",
+ public = true,
+ protected = true,
+ arguments = "argument",
+ actions = mathematics.setsnapping,
+ }
+
+end
+
-- experimental
do
@@ -2387,9 +2576,9 @@ local actions = tasks.actions("math") -- head, style, penalties
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
-function processors.mlisttohlist(head,style,penalties,beginclass,endclass)
+function processors.mlisttohlist(head,style,penalties,beginclass,endclass,level)
starttiming(noads)
- head = actions(head,style,penalties,beginclass,endclass)
+ head = actions(head,style,penalties,beginclass,endclass,level)
stoptiming(noads)
return head
end
diff --git a/tex/context/base/mkxl/math-rad.mklx b/tex/context/base/mkxl/math-rad.mklx
index ddd6a0cbb..e527f23ca 100644
--- a/tex/context/base/mkxl/math-rad.mklx
+++ b/tex/context/base/mkxl/math-rad.mklx
@@ -90,6 +90,8 @@
\setupmathradical
[\c!alternative=\v!normal,
\c!mpoffset=.25\exheight,
+ \c!height=\zeropoint,
+ \c!depth=\zeropoint,
\c!strut=\v!height,
\c!source=\zerocount]
@@ -138,12 +140,31 @@
% style width [options: left middle right]
+%D \starttyping
+%D \definemathradical[esqrt][sqrt][height=\maxdimen,depth=\maxdimen]
+%D \definemathradical[fsqrt][sqrt][height=3ex,depth=2ex]
+%D \definemathradical[ssqrt][sqrt][height=-.5pt,depth=-.5pt]
+%D
+%D \def\TestSqrt#1%
+%D {test $ #1{x} + #1{\sin(x)} $ test\par
+%D test $ #1{x} + #1{\sin(x)} + #1{\frac{1}{x}} $ test\par
+%D test $ #1{x} + #1{x^2} $ test\par
+%D test $\left(#1{x} + #1{x^2} \right)$ test\par}
+%D
+%D \TestSqrt\sqrt \blank % dynamic
+%D \TestSqrt\esqrt\blank % equal
+%D \TestSqrt\fsqrt\blank % fixed
+%D \TestSqrt\ssqrt\blank % squeezed
+%D \stoptyping
+
\def\math_radical_alternative{\csname\??mathradicalalternative\mathradicalparameter\c!alternative\endcsname}
\integerdef\c_radical_unicode "221A
\protected\def\math_radical_common
{\Uroot
+ \s!height\dimexpr\mathradicalparameter\c!height\relax
+ \s!depth \dimexpr\mathradicalparameter\c!depth\relax
\s!source\numexpr\namedboxanchor{\mathradicalparameter\c!source}\relax
\s!style \normalmathstyle
\zerocount \c_radical_unicode}
diff --git a/tex/context/base/mkxl/math-spa.lmt b/tex/context/base/mkxl/math-spa.lmt
index 35684847f..57965c97b 100644
--- a/tex/context/base/mkxl/math-spa.lmt
+++ b/tex/context/base/mkxl/math-spa.lmt
@@ -18,6 +18,7 @@ local tonode = nodes.tonode
local getid = nuts.getid
local getnext = nuts.getnext
local getwidth = nuts.getwidth
+local getdata = nuts.getdata
local setglue = nuts.setglue
local getdimensions = nuts.dimensions
local nextglue = nuts.traversers.glue
@@ -33,11 +34,12 @@ local distance = 0
function noads.handlers.align(h)
if method ~= v_none then
if method == v_auto then
+ --- can be a fast loop
local s = h
while s do
local id = getid(s)
local n = getnext(s)
- if id == boundary_code then -- check some type
+ if id == boundary_code and getdata(s) == 314 then
if n and getid(n) == glue_code then
s = n
n = getnext(s)
diff --git a/tex/context/base/mkxl/mlib-lmp.lmt b/tex/context/base/mkxl/mlib-lmp.lmt
index 61346bc73..a6d17dd2c 100644
--- a/tex/context/base/mkxl/mlib-lmp.lmt
+++ b/tex/context/base/mkxl/mlib-lmp.lmt
@@ -408,9 +408,14 @@ end
do
+ local getcount = tex.getcount
+
local mpprint = mp.print
local mpfprint = mp.fprint
+ local mpscaninteger = mp.scan.integer
+ local mpscannumber = mp.scan.number
+
local jobpositions = job.positions
local getwhd = jobpositions.whd
local getxy = jobpositions.xy
@@ -423,6 +428,14 @@ do
local getcolumn = jobpositions.column
local getmacro = tokens.getters.macro
+ local columnofpos = jobpositions.columnofpos
+ local getcolumndata = jobpositions.getcolumndata
+ -- local overlapping = jobpositions.overlapping
+ -- local onsamepage = jobpositions.onsamepage
+ -- local columnofpos = jobpositions.columnofpos
+
+ -- why not inject path directly
+
registerscript("positionpath", function()
local w, h, d = getwhd(scanstring())
if w then
@@ -450,6 +463,28 @@ do
end
end)
+ registerscript("positioncolumnbox", function()
+ local column = mpscaninteger()
+ local data = getcolumndata(getcount("realpageno"),column)
+ if data then
+ local x, y, w, h, d = data.x, data.y, data.w, data.h, data.d
+ mpfprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",x,y-d,x+w,y-d,x+w,y+h,x,y+h)
+ else
+ mpprint("(0,0)--cycle")
+ end
+ end)
+
+ registerscript("overlaycolumnbox", function()
+ local column = mpscaninteger()
+ local data = getcolumndata(getcount("realpageno"),column)
+ if data then
+ local w, hd = data.w, data.h + data.d
+ mpfprint("((0,0)--(%p,0)--(%p,%p)--(0,%p)--cycle)",w,w,hd,hd)
+ else
+ mpprint("(0,0)--cycle")
+ end
+ end)
+
registerdirect("positionpage", function() return getpage (scanstring()) or 0 end)
registerdirect("positioncolumn", function() return getcolumn (scanstring()) or 0 end)
registerdirect("positionparagraph", function() return getparagraph(scanstring()) or 0 end)
@@ -460,6 +495,12 @@ do
registerdirect("positionx", function() injectpt (getx (scanstring())) end)
registerdirect("positiony", function() injectpt (gety (scanstring())) end)
+ registerdirect("positioncolumnatx", function()
+ local realpage = mpscaninteger()
+ local xposition = mpscannumber()
+ return columnofpos(realpage,xposition)
+ end)
+
end
do
diff --git a/tex/context/base/mkxl/node-ini.lmt b/tex/context/base/mkxl/node-ini.lmt
index 75a97408b..25141b8ab 100644
--- a/tex/context/base/mkxl/node-ini.lmt
+++ b/tex/context/base/mkxl/node-ini.lmt
@@ -236,3 +236,10 @@ nodes.specialskipcodes = {
[gluecodes.indentskip] = true,
[gluecodes.correctionskip] = true,
}
+
+table.setmetatableindex(listcodes,function(t,k)
+ -- fully qualified as yet unknown
+ local v = mathematics.classnames[k - 0x100] or listcodes.unknown
+ t[k] = v
+ return v
+end)
diff --git a/tex/context/base/mkxl/node-tsk.lmt b/tex/context/base/mkxl/node-tsk.lmt
index ed6b3e13b..01b485a55 100644
--- a/tex/context/base/mkxl/node-tsk.lmt
+++ b/tex/context/base/mkxl/node-tsk.lmt
@@ -967,7 +967,7 @@ local tonode = nodes.nuts.tonode
%localize%
-return function(head,style,penalties,beginclass,endclass)
+return function(head,style,penalties,beginclass,endclass,level)
local nuthead = tonut(head)
%actions%
@@ -976,19 +976,19 @@ end
]],
step = [[
- nuthead = tonut((%action%(tonode(nuthead),style,penalties,beginclass,endclass)))
+ nuthead = tonut((%action%(tonode(nuthead),style,penalties,beginclass,endclass,level)))
]],
nut = [[
- nuthead = %action%(nuthead,style,penalties,beginclass,endclass)
+ nuthead = %action%(nuthead,style,penalties,beginclass,endclass,level)
]],
nohead = [[
- %action%(tonode(nuthead),style,penalties,beginclass,endclass)
+ %action%(tonode(nuthead),style,penalties,beginclass,endclass,level)
]],
nonut = [[
- %action%(nuthead,style,penalties,beginclass,endclass)
+ %action%(nuthead,style,penalties,beginclass,endclass,level)
]],
}
diff --git a/tex/context/base/mkxl/page-lay.mkxl b/tex/context/base/mkxl/page-lay.mkxl
index 4527759b3..4c28b4656 100644
--- a/tex/context/base/mkxl/page-lay.mkxl
+++ b/tex/context/base/mkxl/page-lay.mkxl
@@ -66,6 +66,8 @@
\newdimen\totaltextwidth
+\newdimen\textadaptive
+
%D The next series of dimensions are complemented by left and rights ones.
\newdimen\margindistance
@@ -651,6 +653,7 @@
\global\topheight \layoutparameter\c!top
\global\backspace \layoutparameter\c!backspace
\global\topspace \layoutparameter\c!topspace
+ \global\textadaptive \layoutparameter\c!adaptive
\page_layouts_set_dimensions
\synchronizegridsnapping
\usesetupsparameter\layoutparameter % depends on gridsnapping !
@@ -1434,6 +1437,7 @@
\c!lines=0,
\c!paper=, % for foxet
\c!page=, % for foxet
+ \c!adaptive=\zeropoint, % new: experiment
\c!columns=\plusone,
\c!columndistance=\zeropoint]
diff --git a/tex/context/base/mkxl/page-one.mkxl b/tex/context/base/mkxl/page-one.mkxl
index c997557ef..c14173223 100644
--- a/tex/context/base/mkxl/page-one.mkxl
+++ b/tex/context/base/mkxl/page-one.mkxl
@@ -79,6 +79,12 @@
\else
\global\vsize\textheight
\fi
+ %
+ \ifzeropt\textadaptive\else
+ \global\d_page_adapts_delta\textadaptive
+ \global\pageextragoal-\textadaptive
+ \fi
+ %
\global\advance\vsize\d_page_adapts_delta
% alternatively we could set it in builders.buildpage_filter
% \ifdim\pagegoal<\maxdimen .. \fi
diff --git a/tex/context/base/mkxl/page-pcl.mkxl b/tex/context/base/mkxl/page-pcl.mkxl
index b9838e771..4585f1fd5 100644
--- a/tex/context/base/mkxl/page-pcl.mkxl
+++ b/tex/context/base/mkxl/page-pcl.mkxl
@@ -229,6 +229,7 @@
\def\page_col_routine_package_step
{% needs packaging anyway
+ \mofcolumns\recurselevel % added
\getboxfromcache{\s!pagecolumn}{\number\recurselevel}\scratchbox
\page_lines_add_numbers_to_box\scratchbox\recurselevel\c_page_col_n_of_columns\plusone % new
\page_marks_synchronize_column\plusone\c_page_col_n_of_columns\recurselevel\scratchbox
@@ -867,8 +868,8 @@
\enforced\let\stoppagecolumns\page_col_stop_nop}
\protected\def\page_col_stop_yes
- {\column % \page_otr_eject_page
- \page
+ {%\column % \page_otr_eject_page
+ \page % beware for empty pages
\endgroup
% \setupoutputroutine[\s!singlecolumn]%
\page_otr_command_set_vsize
diff --git a/tex/context/base/mkxl/page-pst.mkxl b/tex/context/base/mkxl/page-pst.mkxl
index 026c64d62..16f71e0dc 100644
--- a/tex/context/base/mkxl/page-pst.mkxl
+++ b/tex/context/base/mkxl/page-pst.mkxl
@@ -54,12 +54,12 @@
\mutable\let\currentpostponedpage\empty
-\permanent\protected\setvalue{\e!start\v!postponing}%
+\permanent\protected\defcsname\e!start\v!postponing\endcsname
{\bgroup
\obeylines
\doifelsenextoptional{\egroup\page_postponed_blocks_start}{\egroup\page_postponed_blocks_start[0]}}
-\permanent\protected\setvalue{\e!stop\v!postponing}%
+\permanent\protected\defcsname\e!stop\v!postponing\endcsname
{\clf_registerpostponedblock{\currentpostponedpage}\relax}
\def\page_postponed_blocks_start[#1]%
diff --git a/tex/context/base/mkxl/spac-ver.mkxl b/tex/context/base/mkxl/spac-ver.mkxl
index 12cf8c687..1db2c8b06 100644
--- a/tex/context/base/mkxl/spac-ver.mkxl
+++ b/tex/context/base/mkxl/spac-ver.mkxl
@@ -1076,68 +1076,118 @@
\permanent\protected\def\rightboundary {\protrusionboundary\plustwo}
\permanent\protected\def\signalcharacter{\boundary\plusone\char\zerocount\boundary\plustwo} % not the same as strut signals
-\newsignal\d_spac_struts_signal \setfalse\sigstruts
+%D We no longer need these sigstruts:
+%
+% \newsignal\d_spac_struts_signal \setfalse\sigstruts
+%
+% \permanent\protected\def\begstrut
+% {\relax\ifcase\strutht
+% % \ignorespaces % maybe
+% \else
+% \expandafter\spac_struts_beg
+% \fi}
+%
+% \def\spac_struts_beg
+% {\ifconditional\sigstruts
+% \spac_struts_beg_signal
+% \else
+% \spac_struts_beg_normal
+% \fi
+% \ignorespaces}
+%
+% \def\spac_struts_beg_signal
+% {\noindent\horizontalstrut
+% \penalty\plustenthousand
+% \hskip-\d_spac_struts_signal
+% \hskip\d_spac_struts_signal}
+%
+% \def\spac_struts_beg_normal
+% {\boundary\plusone
+% \strut
+% %\boundary\plusone
+% \penalty\plustenthousand
+% %\boundary\plusone
+% \hskip\zeropoint}
+%
+% \permanent\protected\def\endstrut
+% {\relax\ifhmode
+% \ifcase\strutht
+% % \removeunwantedspaces % maybe
+% \else
+% \spac_struts_end
+% \fi
+% \fi}
+%
+% \def\spac_struts_end
+% {\ifconditional\sigstruts
+% \spac_struts_end_signal
+% \else
+% \spac_struts_end_normal
+% \fi}
+%
+% \def\spac_struts_end_signal
+% {\ifdim\lastskip=\d_spac_struts_signal
+% \unskip
+% \unskip
+% \unpenalty
+% \setbox\scratchbox\lastbox
+% \else
+% \penalty\plustenthousand
+% \hskip\zeropoint
+% \strut
+% \fi}
+%
+% \def\spac_struts_end_normal
+% {\removeunwantedspaces
+% \penalty\plustenthousand
+% %\boundary\plustwo
+% \hskip\zeropoint
+% %\boundary\plustwo
+% \strut
+% \boundary\plustwo}
-\permanent\protected\def\begstrut
- {\relax\ifcase\strutht
- % \ignorespaces % maybe
- \else
- \spac_struts_beg
- \fi}
+%D \starttyping
+%D $ \ifhmode H1\fi x \ifhmode H2\fi $\par
+%D $ \ifmmode M1\fi x \ifmmode M2\fi $\par
+%D $$\ifvmode H1\fi x \ifvmode H2\fi$$\par
+%D $$\ifvmode M1\fi x \ifvmode M2\fi$$\par
+%D \stoptyping
-\def\spac_struts_beg
- {\ifconditional\sigstruts
- \spac_struts_beg_signal
+\permanent\protected\def\begstrut
+ {\ifmmode
+ \strut
\else
- \spac_struts_beg_normal
+ \dontleavehmode
+ \ifcase\struthtdp\else
+ \spac_struts_beg
+ \fi
\fi
\ignorespaces}
-\def\spac_struts_beg_signal
- {\noindent\horizontalstrut
- \penalty\plustenthousand
- \hskip-\d_spac_struts_signal
- \hskip\d_spac_struts_signal}
-
-\def\spac_struts_beg_normal
+\def\spac_struts_beg
{\boundary\plusone
\strut
%\boundary\plusone
\penalty\plustenthousand
%\boundary\plusone
- \hskip\zeropoint}
+ \hskip\zeropoint
+ \ignorespaces}
\permanent\protected\def\endstrut
- {\relax\ifhmode
- \ifcase\strutht
- % \removeunwantedspaces % maybe
- \else
+ {% \ifmmode M\fi
+ % \ifinner I\fi
+ \relax\ifhmode
+ \removeunwantedspaces
+ \ifcase\struthtdp\else
\spac_struts_end
\fi
- \fi}
-
-\def\spac_struts_end
- {\ifconditional\sigstruts
- \spac_struts_end_signal
- \else
- \spac_struts_end_normal
- \fi}
-
-\def\spac_struts_end_signal
- {\ifdim\lastskip=\d_spac_struts_signal
- \unskip
- \unskip
- \unpenalty
- \setbox\scratchbox\lastbox
- \else
- \penalty\plustenthousand
- \hskip\zeropoint
+ \orelse\ifmmode
+ \removeunwantedspaces
\strut
\fi}
-\def\spac_struts_end_normal
- {\removeunwantedspaces
- \penalty\plustenthousand
+\def\spac_struts_end
+ {\penalty\plustenthousand
%\boundary\plustwo
\hskip\zeropoint
%\boundary\plustwo
diff --git a/tex/context/base/mkxl/strc-mat.mkxl b/tex/context/base/mkxl/strc-mat.mkxl
index 28e678e3e..709ef7ac4 100644
--- a/tex/context/base/mkxl/strc-mat.mkxl
+++ b/tex/context/base/mkxl/strc-mat.mkxl
@@ -32,6 +32,8 @@
%\c!margin=,
%\c!align=,
%\c!separator=,
+ \c!snap=\v!no,
+ \c!snapstep=\v!medium,
\c!grid=\v!math,
\c!location=\v!right,
\c!left=(,
@@ -44,7 +46,7 @@
\c!rightmargin=\zeropoint,
\c!indentnext=\v!no,
\c!alternative=\s!default,
- \c!strut=\v!no,
+ \c!strut=\v!yes, % per 2022-04, was \v!no
\c!numberstrut=\v!yes, % \v!no \v!yes \v!always
\c!distance=2\emwidth]
@@ -889,7 +891,8 @@
{\ifmmode
% we can have a more dedicated value, and also maybe store the class so that we can
% pick it up at the engine end (second pass)
- \boundary\plusone
+% \boundary\plusone
+ \boundary314\relax
\fi}
\protected\def\strc_math_break_here
@@ -1010,6 +1013,13 @@
\strc_formulas_forget_display_skips
\the\everybeforedisplayformula
\begincsname\??mathtextalign\formulaparameter\c!textalign\endcsname
+ \ifcstok{\formulaparameter\c!strut}\v!yes
+ \let\strc_formulas_begstrut\begstrut
+ \let\strc_formulas_endstrut\endstrut
+ \else
+ \let\strc_formulas_begstrut\relax
+ \let\strc_formulas_endstrut\relax
+ \fi
\csname\e!start\formulaparameter\c!alternative\v!formula\endcsname}
\protected\def\strc_formulas_start_formula_nested#1%
@@ -1079,6 +1089,9 @@
%D \startformula x \stopformula % now has \noindent (in mkii we messed with baselineskip)
%D \stoptyping
+\let\strc_formulas_begstrut\relax
+\let\strc_formulas_endstrut\relax
+
\permanent\protected\def\startdisplaymath
{\ifhmode
\par
@@ -1099,10 +1112,14 @@
\else
\expandafter\startinnermath
\fi
+ \strc_formulas_begstrut
\begingroup} % less interference with upcoming a \over b
\permanent\protected\def\stopdisplaymath
{\endgroup % less interference with upcoming a \over b
+ \ifhmode
+ \strc_formulas_endstrut
+ \fi
\ifcase\c_strc_formulas_mode
\Ucheckedstopdisplaymath
\or
@@ -1360,8 +1377,19 @@
\def\strc_formulas_place_number_indeed
{\strc_formulas_place_number_in_box}
+% \def\strc_formulas_place_number_in_box
+% {\dostarttagged\t!formulacaption\empty
+% \global\setbox\b_strc_formulas_number\naturalhbox{\strc_formulas_number_indeed}%
+% \dostoptagged}
+
\def\strc_formulas_place_number_in_box
{\dostarttagged\t!formulacaption\empty
+ % this is really needed, otherwise we get spurious numbers probbaly due to some
+ % interference with other local variables .. also keep an eye on eqtest in the
+ % MS tests
+ \glet\strc_formulas_place_number \relax
+ \glet\strc_formulas_place_number_nested\gobbletwoarguments
+ %
\global\setbox\b_strc_formulas_number\naturalhbox{\strc_formulas_number_indeed}%
\dostoptagged}
@@ -1398,6 +1426,20 @@
\permanent\protected\def\setformulalistentry#1%
{\gdef\namedformulaentry{#1}}
+%D New:
+%D
+%D \setupformula[snap=yes,snapstep=medium]
+
+\definesystemattribute[mathsnap][public]
+
+\appendtoks
+ \ifcstok{\formulaparameter\c!snap}\v!yes
+ \setmathsnapping{\formulaparameter\c!snapstep}%
+ \else
+ \setmathsnapping\v!reset
+ \fi
+\to \everysetupformula
+
\protect \endinput
% \abovedisplayshortskip0pt \belowdisplayshortskip0pt \abovedisplayskip0pt \belowdisplayskip0pt \forgetall
diff --git a/tex/context/base/mkxl/supp-box.mkxl b/tex/context/base/mkxl/supp-box.mkxl
index ed4f1da45..21d810671 100644
--- a/tex/context/base/mkxl/supp-box.mkxl
+++ b/tex/context/base/mkxl/supp-box.mkxl
@@ -174,14 +174,29 @@
\permanent\protected\def\smashedhbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
\permanent\protected\def\smashedvbox{\vpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
-%D First we define a helper. We use a \LUATEX\ feature in order to avoid
-%D mathpalettes.
+%D \starttyping
+%D \startTEXpage[offset=1dk,width=4em]
+%D \dontleavehmode \hbox {0} 0\par
+%D \dontleavehmode \vphantom{0} 0\par
+%D \dontleavehmode \hphantom{0} 0\par
+%D $\textstyle \vphantom{0}$ $\textstyle 0$\par
+%D $\scriptstyle \vphantom{0}$ $\scriptstyle 0$\par
+%D $\scriptscriptstyle\vphantom{0}$ $\scriptscriptstyle 0$\par
+%D \stopTEXpage
+%D \stoptyping
-\newcount\c_boxes_math_style
+% \newcount\c_boxes_math_style
+%
+% \protected\def\syst_boxes_math_set_nextbox#1%
+% {\c_boxes_math_style\normalmathstyle
+% \setbox\nextbox\hbox{\normalstartimath\mathsurround\zeropoint\triggermathstyle\c_boxes_math_style{#1}\normalstopimath}}
\protected\def\syst_boxes_math_set_nextbox#1%
- {\c_boxes_math_style\normalmathstyle
- \setbox\nextbox\hbox{\normalstartimath\mathsurround\zeropoint\triggermathstyle\c_boxes_math_style{#1}\normalstopimath}}
+ {\setbox\nextbox\hbox\expandafter\bgroup
+ \expandafter\normalstartimath\expandafter\Ustyle\the\mathstackstyle
+ \mathsurround\zeropoint{#1}%
+ \normalstopimath
+ \egroup}
%D \macros
%D {smash}
diff --git a/tex/context/base/mkxl/syst-aux.lmt b/tex/context/base/mkxl/syst-aux.lmt
index 2d744e309..39ceae376 100644
--- a/tex/context/base/mkxl/syst-aux.lmt
+++ b/tex/context/base/mkxl/syst-aux.lmt
@@ -184,20 +184,21 @@ local option = (
local pattern = (
(
spaces * (
- ( P("spaces") * space / catcodes_s )
- + ( P("nospaces") * space / catcodes_n )
- + ( P("global") * space / function() global = true end)
- + ( P("protected") * space / function() protected = true end)
- + ( P("permanent") * space / function() permanent = true end)
- + ( P("expanded") * space / function() expanded = true end)
- + ( P("tolerant") * space / function() tolerant = true end)
- + ( P("instance") * space / function() instance = true end)
- + ( P("frozen") * space / function() frozen = true end)
- + ( P("mutable") * space / function() mutable = true end)
- + ( P("immutable") * space / function() immutable = true end)
- + ( P("unexpanded") * space / function() protected = true end)
- + ( option * space / function(s) tolerant = true
- optional = s end)
+ ( P("spaces") * space / catcodes_s )
+ + ( P("nospaces") * space / catcodes_n )
+ + ( P("global") * space / function() global = true end)
+ + ( P("protected") * space / function() protected = 1 end)
+ + ( P("semiprotected") * space / function() protected = 2 end)
+ + ( P("permanent") * space / function() permanent = true end)
+ + ( P("expanded") * space / function() expanded = true end)
+ + ( P("tolerant") * space / function() tolerant = true end)
+ + ( P("instance") * space / function() instance = true end)
+ + ( P("frozen") * space / function() frozen = true end)
+ + ( P("mutable") * space / function() mutable = true end)
+ + ( P("immutable") * space / function() immutable = true end)
+ + ( P("unexpanded") * space / function() protected = 1 end)
+ + ( option * space / function(s) tolerant = true
+ optional = s end)
)
)^0
* spaces * ( C((1-S(" #["))^1) )
@@ -229,7 +230,7 @@ local function texdefinition_two()
context (
(tolerant and [[\tolerant]] or "") ..
(frozen and [[\frozen]] or "") ..
- (protected and [[\protected]] or "") ..
+ (protected and (protected == 1 and [[\protected]] or [[\semiprotected]]) or "") ..
(permanent and [[\permanent]] or "") ..
(instance and [[\instance]] or "") ..
(mutable and [[\mutable]] or "") ..
diff --git a/tex/context/base/mkxl/syst-ini.mkxl b/tex/context/base/mkxl/syst-ini.mkxl
index 2bc352cf0..3c327c047 100644
--- a/tex/context/base/mkxl/syst-ini.mkxl
+++ b/tex/context/base/mkxl/syst-ini.mkxl
@@ -827,8 +827,8 @@
\tracingonline \zerocount}
\permanent\protected\def\tracingnone
- {\showboxdepth \maxcount % \plusthree
- \showboxbreadth \plusten % \plusfive
+ {\showboxdepth \plusfive % lessboxtracing
+ \showboxbreadth \plusten
\tracingalignments\zerocount
\tracingmath \zerocount
\tracingassigns \zerocount
diff --git a/tex/context/base/mkxl/tabl-ntb.mkxl b/tex/context/base/mkxl/tabl-ntb.mkxl
index 67fc39a89..644d156e6 100644
--- a/tex/context/base/mkxl/tabl-ntb.mkxl
+++ b/tex/context/base/mkxl/tabl-ntb.mkxl
@@ -431,6 +431,7 @@
\newif\ifautoTBLcheckwidth \autoTBLcheckwidthtrue
\newif\ifappendTBLsetups \appendTBLsetupstrue
\newif\ifenableTBLbreak \enableTBLbreakfalse
+\newif\ifforceTBLpageflow \forceTBLpageflowfalse
\newif\ifmultipleTBLheads \multipleTBLheadsfalse
\newif\iftightTBLrowspan \tightTBLrowspantrue
\newif\iftightTBLcolspan \tightTBLcolspanfalse
@@ -992,15 +993,17 @@
\relax
\enableTBLbreakfalse
\multipleTBLheadsfalse
+ \forceTBLpageflowfalse
\autoTBLspreadfalse
\tightTBLcolspanfalse
\processaction
- [\naturaltablelocalparameter\c!split]
+ [\naturaltablelocalparameter\c!split]%
[ \v!yes=>\enableTBLbreaktrue,
\v!repeat=>\enableTBLbreaktrue\multipleTBLheadstrue,
- \v!auto=>\ifinsidesplitfloat\enableTBLbreaktrue\fi]
+ \v!page=>\enableTBLbreaktrue\forceTBLpageflowtrue,
+ \v!auto=>\ifinsidesplitfloat\enableTBLbreaktrue\fi]%
\processaction
- [\naturaltablelocalparameter\c!header]
+ [\naturaltablelocalparameter\c!header]%
[\v!repeat=>\multipleTBLheadstrue]%
\tabl_ntb_preset_parameters
\processallactionsinset
@@ -1353,18 +1356,15 @@
\protected\def\tabl_ntb_before_page
{\ifx\m_tabl_ntb_same_page\v!before
% \blank[\v!samepage,\v!strong]%
- \unpenalty
\nobreak
\orelse\ifx\m_tabl_ntb_same_page\v!both
% \blank[\v!samepage,\v!strong]%
- \unpenalty
\nobreak
\fi}
\protected\def\tabl_ntb_after_page
{\ifnum\c_tabl_ntb_row>\c_tabl_ntb_n_of_head_lines
\ifnum\tabl_ntb_get_nob\c_tabl_ntb_row=\zerocount
- \unpenalty
\ifx\m_tabl_ntb_same_page\v!after
% \blank[\v!samepage,\v!strong]%
\nobreak
@@ -1726,18 +1726,29 @@
\box\b_tabl_ntb_final
\afterTABLEbox}
+\def\tabl_ntb_split_page
+ {%\postprocessTABLEbox\b_tabl_ntb_final
+ %\tabl_ntb_anchor_process\b_tabl_ntb_final
+ \beforeTABLEbox
+ \registerparoptions % (*) better here (also does a \dontleavehmode)
+ \ifhmode\else\dontleavehmode\fi
+ \tabl_ntb_flush_content
+ \afterTABLEbox}
+
\def\tabl_ntb_split_yes
{\ifinsidesplitfloat
- \donetrue
- \orelse\ifinsidefloat
\donefalse
- \else
+ \orelse\ifinsidefloat
\donetrue
+ \else
+ \donefalse
\fi
\ifdone
- \expandafter\tabl_ntb_split_box
- \else
\expandafter\tabl_ntb_split_nop
+ \orelse\ifforceTBLpageflow
+ \expandafter\tabl_ntb_split_page
+ \else
+ \expandafter\tabl_ntb_split_box
\fi}
\newbox\TABLEsplitbox % public, don't change
diff --git a/tex/context/base/mkxl/task-ini.lmt b/tex/context/base/mkxl/task-ini.lmt
index 3b657414a..8a4d492e0 100644
--- a/tex/context/base/mkxl/task-ini.lmt
+++ b/tex/context/base/mkxl/task-ini.lmt
@@ -121,6 +121,9 @@ appendaction("math", "builders", "typesetters.directions.processmath"
appendaction("math", "builders", "noads.handlers.makeup", nil, "nonut", "disabled" )
appendaction("math", "builders", "noads.handlers.align", nil, "nonut", "enabled" )
+appendaction("math", "finalizers", "noads.handlers.normalize", nil, "nonut", "enabled" )
+appendaction("math", "finalizers", "noads.handlers.snap", nil, "nonut", "disabled" )
+
appendaction("finalizers", "lists", "nodes.handlers.showhyphenation", nil, "nut", "disabled" )
appendaction("finalizers", "lists", "nodes.handlers.visualizehyphenation", nil, "nut", "disabled" )
diff --git a/tex/context/base/mkxl/typo-krn.lmt b/tex/context/base/mkxl/typo-krn.lmt
index bfd50062d..65068d897 100644
--- a/tex/context/base/mkxl/typo-krn.lmt
+++ b/tex/context/base/mkxl/typo-krn.lmt
@@ -220,22 +220,7 @@ end
local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyph
local char, id = isglyph(boundary)
- if id == kern_code then
- if getsubtype(boundary) == fontkern_code then
- local inject = true
- if keeptogether then
- local next = getnext(boundary)
- if not next or (getid(next) == glyph_code and keeptogether(prev,next)) then
- inject = false
- end
- end
- if inject then
- -- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setkern(boundary,getkern(boundary) + quaddata[getfont(prev)]*krn,userkern_code)
- return boundary, true
- end
- end
- elseif char then
+ if char then
if keeptogether and keeptogether(boundary,prev) then
-- keep 'm
else
@@ -249,29 +234,29 @@ local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyp
return kern, true
end
end
- end
- return boundary, ok
-end
-
-local function inject_end(boundary,next,keeptogether,krn,ok)
- local tail = find_node_tail(boundary)
- local char, id = isglyph(tail)
- if id == kern_code then
- if getsubtype(tail) == fontkern_code then
+ elseif id == kern_code then
+ if getsubtype(boundary) == fontkern_code then
local inject = true
if keeptogether then
- local prev = getprev(tail)
- if getid(prev) == glyph_code and keeptogether(prev,two) then
+ local next = getnext(boundary)
+ if not next or (getid(next) == glyph_code and keeptogether(prev,next)) then
inject = false
end
end
if inject then
-- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setkern(tail,getkern(tail) + quaddata[getfont(next)]*krn,userkern_code)
+ setkern(boundary,getkern(boundary) + quaddata[getfont(prev)]*krn,userkern_code)
return boundary, true
end
end
- elseif char then
+ end
+ return boundary, ok
+end
+
+local function inject_end(boundary,next,keeptogether,krn,ok)
+ local tail = find_node_tail(boundary)
+ local char, id = isglyph(tail)
+ if char then
if keeptogether and keeptogether(tail,two) then
-- keep 'm
else
@@ -285,6 +270,21 @@ local function inject_end(boundary,next,keeptogether,krn,ok)
return boundary, true
end
end
+ elseif id == kern_code then
+ if getsubtype(tail) == fontkern_code then
+ local inject = true
+ if keeptogether then
+ local prev = getprev(tail)
+ if getid(prev) == glyph_code and keeptogether(prev,two) then
+ inject = false
+ end
+ end
+ if inject then
+ -- not yet ok, as injected kerns can be overlays (from node-inj.lua)
+ setkern(tail,getkern(tail) + quaddata[getfont(next)]*krn,userkern_code)
+ return boundary, true
+ end
+ end
end
return boundary, ok
end
diff --git a/tex/context/fonts/mkiv/type-imp-stix.mkiv b/tex/context/fonts/mkiv/type-imp-stix.mkiv
index 3104603e1..b76b1d09b 100644
--- a/tex/context/fonts/mkiv/type-imp-stix.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-stix.mkiv
@@ -33,7 +33,6 @@
\definefontfeature[stixtwomath][copymathscripts=yes] % see lfg file
-
\starttypescriptcollection[stix]
% version one
diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml
index 0cc90a6a0..213f129ed 100644
--- a/tex/context/interface/mkii/keys-fr.xml
+++ b/tex/context/interface/mkii/keys-fr.xml
@@ -647,6 +647,7 @@
<cd:constants>
<cd:constant name='action' value='action'/>
+ <cd:constant name='adaptive' value='adaptive'/>
<cd:constant name='address' value='adresse'/>
<cd:constant name='after' value='après'/>
<cd:constant name='afterhead' value='aprèstête'/>
@@ -1240,6 +1241,8 @@
<cd:constant name='small' value='petit'/>
<cd:constant name='smallcapsfeatures' value='fonctionnalitespetitescaps'/>
<cd:constant name='smallcapsfont' value='policepetitescaps'/>
+ <cd:constant name='snap' value='snap'/>
+ <cd:constant name='snapstep' value='snapstep'/>
<cd:constant name='solution' value='solution'/>
<cd:constant name='sort' value='trier'/>
<cd:constant name='sorttype' value='modetri'/>
diff --git a/tex/context/modules/mkiv/s-fonts-charts.mkiv b/tex/context/modules/mkiv/s-fonts-charts.mkiv
index 36fec22f0..b7fcc9f9e 100644
--- a/tex/context/modules/mkiv/s-fonts-charts.mkiv
+++ b/tex/context/modules/mkiv/s-fonts-charts.mkiv
@@ -172,7 +172,10 @@
\starttext
- \showfontchart[filename=texgyredejavu-math.otf,page=yes,option=all]
+% \showfontchart[filename=texgyredejavu-math.otf,page=yes,option=all]
+
+ \showfontchart[filename=danlan.otf] % ,page=yes,option=all]
+ \showfontchart[filename=danlan-bold.otf] % ,page=yes,option=all]
% \showfontchart[filename=aegean,page=yes]
% \showfontchart[filename=veramono.ttf,page=yes]
diff --git a/tex/context/modules/mkxl/m-json.mkxl b/tex/context/modules/mkxl/m-json.mkxl
index b08286b08..46c2f79a7 100644
--- a/tex/context/modules/mkxl/m-json.mkxl
+++ b/tex/context/modules/mkxl/m-json.mkxl
@@ -21,6 +21,7 @@
\startluacode
local tablestore = utilities.tablestore
+ local field = tablestore.field
interfaces.implement {
name = "loadtable",
@@ -32,25 +33,60 @@
interfaces.implement {
name = "tablefield",
- actions = { tablestore.field, context },
+ actions = function(namespace,name)
+ local data = field(namespace,name)
+ if data then
+ context(data)
+ end
+ end,
arguments = "2 arguments",
public = true,
+protected = true,
}
interfaces.implement {
name = "tablefielddefault",
- actions = { tablestore.field, context },
+ actions = function(namespace,name,default)
+ local data = field(namespace,name,default)
+ if data then
+ context(data)
+ end
+ end,
arguments = "3 arguments",
public = true,
}
+ local replace = lpeg.replacer("@","%%")
+ local lpegmatch = lpeg.match
+
+ interfaces.implement {
+ name = "tableformatted",
+ actions = function(namespace,name,fmt)
+ local data = field(namespace,name)
+ if data then
+ context(lpegmatch(replace,fmt),data)
+ end
+ end,
+ arguments = "3 arguments",
+ public = true,
+ }
+
+ interfaces.implement {
+ name = "tablelength",
+ actions = { tablestore.length, context },
+ arguments = "2 arguments",
+ public = true,
+ }
+
utilities.json.field = tablestore.field
utilities.json.loaded = tablestore.loaded
+ utilities.json.length = tablestore.length
\stopluacode
\let\loadjsonfile \loadtable
\let\jsonfield \tablefield
\let\jsonfielddefault \tablefielddefault
+\let\jsonlength \tablelength
\stopmodule
diff --git a/tex/generic/context/luatex/luatex-core.lua b/tex/generic/context/luatex/luatex-core.lua
index 538d8f903..66207339e 100644
--- a/tex/generic/context/luatex/luatex-core.lua
+++ b/tex/generic/context/luatex/luatex-core.lua
@@ -210,6 +210,13 @@ if saferoption == 1 or shellescape ~= 1 then
ffi = nil
+ -- A patch by LS for LaTeX per April 2022 but I'm, not sure if that breaks ConTeXt MKIV. I have
+ -- no time nor motivation to test that right now so we'll see where it breaks. We have different
+ -- loaders anyway and we don't test plain.
+
+ package.loaded .ffi = nil -- Isn't that still nil then?
+ package.preload.ffi = error -- Do errors always go there?
+
end
if md5 then
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 3c0b95c6d..c98ca8c7c 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 2022-04-20 19:15
+-- merge date : 2022-05-02 15:48
do -- begin closure to overcome local limits and interference