diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-04-01 11:01:40 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-04-01 11:01:40 +0200 |
commit | c1224cc330e695938cfcf944f8e9d0c14c15fa8c (patch) | |
tree | 1ab4e67a616e7338f91cded3a0d803d61a185ea3 /tex | |
parent | 6a2738578157926c6ebd64048ddabb7d923b2be5 (diff) | |
download | context-c1224cc330e695938cfcf944f8e9d0c14c15fa8c.tar.gz |
2022-04-01 09:35:00
Diffstat (limited to 'tex')
53 files changed, 1208 insertions, 445 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 4b51600b4..382032446 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.03.24 21:14} +\newcontextversion{2022.04.01 09:33} %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 ac446c2e1..433b62f7e 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.03.24 21:14} +\edef\contextversion{2022.04.01 09:33} %D For those who want to use this: diff --git a/tex/context/base/mkiv/char-def.lua b/tex/context/base/mkiv/char-def.lua index aa6353297..b4f07a529 100644 --- a/tex/context/base/mkiv/char-def.lua +++ b/tex/context/base/mkiv/char-def.lua @@ -63063,34 +63063,42 @@ characters.data={ }, [0x2061]={ category="cf", - comment="maybe: nulloperator", + comment="ordinary", description="FUNCTION APPLICATION", direction="bn", linebreak="al", + mathclass="ghost", + mathname="applyfunction", unicodeslot=0x2061, }, [0x2062]={ category="cf", + comment="binary", description="INVISIBLE TIMES", direction="bn", linebreak="al", + mathclass="ghost", + mathname="invisibletimes", unicodeslot=0x2062, }, [0x2063]={ category="cf", + comment="punctuation", description="INVISIBLE SEPARATOR", direction="bn", linebreak="al", - mathclass="binary", - mathname="invisibletimes", - synonyms={ "invisible comma" }, + mathclass="ghost", + mathname="invisiblecomma", unicodeslot=0x2063, }, [0x2064]={ category="cf", + comment="binary", description="INVISIBLE PLUS", direction="bn", linebreak="al", + mathclass="ghost", + mathname="invisibleplus", unicodeslot=0x2064, }, [0x2066]={ diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 883269f4b..feaee9df4 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.03.24 21:14} +\newcontextversion{2022.04.01 09:33} %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 7f27d0ba5..b5e27e63e 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.03.24 21:14} +\edef\contextversion{2022.04.01 09:33} %D Kind of special: diff --git a/tex/context/base/mkiv/math-act.lua b/tex/context/base/mkiv/math-act.lua index 4e3365d74..80f58020d 100644 --- a/tex/context/base/mkiv/math-act.lua +++ b/tex/context/base/mkiv/math-act.lua @@ -169,7 +169,7 @@ function mathematics.overloadparameters(target,original) report_math("overloading math parameter %a: %S => %S",name,oldvalue,newvalue) end else - report_math("invalid math parameter %a",name) + -- report_math("invalid math parameter %a",name) end mathparameters[name] = newvalue end diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua index f24c66d12..12f8ecfbe 100644 --- a/tex/context/base/mkiv/mult-low.lua +++ b/tex/context/base/mkiv/mult-low.lua @@ -205,6 +205,9 @@ return { "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode", "discardzerotabskipsnormalizecode", "flattenleadersnormalizecode", -- + "nopreslackclassoptioncode", "nopostslackclassoptioncode", + "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode", + -- "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode", "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noitaliccorrectionglyphoptioncode", @@ -462,6 +465,8 @@ return { -- "getfirstcharacter", "doifelsefirstchar", "doiffirstcharelse", -- + "mathclassvalue", + -- "startnointerference", "stopnointerference", -- "twodigits","threedigits", @@ -534,7 +539,7 @@ return { "superprescript", "subprescript", "nosuperprescript", "nosubsprecript", -- "uncramped", "cramped", - "mathstyletrigger", "triggermathstyle", + "mathstyletrigger", "triggermathstyle", "triggeredmathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette", "mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox", "mathtext", "setmathsmalltextbox", "setmathtextbox", diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index b366ea336..5bdea77de 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -166,6 +166,7 @@ return { "Umathskeweddelimitertolerance", "Umathskewedfractionhgap", "Umathskewedfractionvgap", + "Umathsource", "Umathspaceafterscript", "Umathspacebeforescript", "Umathstackdenomdown", @@ -237,6 +238,8 @@ return { "aftergrouped", "aliased", "alignmark", + "alignmentcellsource", + "alignmentwrapsource", "aligntab", "allcrampedstyles", "alldisplaystyles", @@ -466,11 +469,13 @@ return { "mathforwardpenalties", "mathfrac", "mathghost", + "mathleftclass", "mathlimitsmode", "mathmiddle", "mathnolimitsmode", "mathpenaltiesmode", "mathrad", + "mathrightclass", "mathrulesfam", "mathrulesmode", "mathscale", diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 3f451abe0..eb82f9913 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex b642259b7..76485d6f9 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkxl/anch-box.mkxl b/tex/context/base/mkxl/anch-box.mkxl new file mode 100644 index 000000000..570f8862d --- /dev/null +++ b/tex/context/base/mkxl/anch-box.mkxl @@ -0,0 +1,180 @@ +%D \module +%D [ file=anch-box, +%D version=2022.03.25, +%D title=\CONTEXT\ Anchoring Macros, +%D subtitle=Boxes, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Anchoring Macros / Boxes} + +\unprotect + +\startMPpositiongraphic{mypos:boxanchor:arrow}{}% from,to,linecolor,text,alternative,leftedge,rightedge,distance} + anch_box_arrows_draw ; +\stopMPpositiongraphic + +\tolerant\permanent\protected\def\connectboxanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6% + {\begingroup + \defineboxanchor[#5]% + \setboxanchor[#5][#1][#3]\hpack{\xypos{\namespacedboxanchor{#5}}}% + \ifparameter#3\or\setupboxanchorcontent[#1][#3]\fi + \defineboxanchor[#6]% + \setboxanchor[#6][#2][#4]\hpack{\xypos{\namespacedboxanchor{#6}}}% + \ifparameter#4\or\setupboxanchorcontent[#1][#4]\fi + \startpositionoverlay{text-1}% will become configurable region + \setMPpositiongraphic + {\namespacedboxanchor{#5}}% + {\namedboxanchorcontentparameter{#1}\c!mp}% + {from=\namespacedboxanchor{#5},% + to=\namespacedboxanchor{#6},% + distance={\namedboxanchorcontentparameter{#1}\c!distance},% + dashtype={\namedboxanchorcontentparameter{#1}\c!dash},% + alternative={\namedboxanchorcontentparameter{#1}\c!alternative},% + text={\namedboxanchorcontentparameter{#1}\c!text},% + rulethickness={\namedboxanchorcontentparameter{#1}\c!rulethickness},% + linecolor=\namedboxanchorcontentparameter{#1}{\c!rulecolor}}% + \stoppositionoverlay + \endgroup} + +% dedicated or not + +\tolerant\permanent\protected\def\connectmatrixanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6% + {\begingroup + \doifelseinset{#5}{\m_anch_matrix_list}\donetrue\donefalse + \ifdone\else + \defineboxanchor[#5]% + \setboxanchor[#5][#1][#3]\hpack{\xypos{\namespacedboxanchor{#5}}}% + \xdef\m_anch_matrix_list{\m_anch_matrix_list,#5}% + \fi + \ifparameter#3\or\setupboxanchorcontent[#1][#3]\fi + \doifelseinset{#6}{\m_anch_matrix_list}\donetrue\donefalse + \ifdone\else + \defineboxanchor[#6]% + \setboxanchor[#6][#2][#4]\hpack{\xypos{\namespacedboxanchor{#6}}}% + \xdef\m_anch_matrix_list{\m_anch_matrix_list,#6}% + \fi + \ifparameter#4\or\setupboxanchorcontent[#1][#4]\fi + \startpositionoverlay{text-1}% will become configurable region + \setMPpositiongraphic + {\namespacedboxanchor{#5}}% + {\namedboxanchorcontentparameter{#1}\c!mp}% + {from=\namespacedboxanchor{#5},% + to=\namespacedboxanchor{#6},% + distance={\namedboxanchorcontentparameter{#1}\c!distance},% + dashtype={\namedboxanchorcontentparameter{#1}\c!dash},% + alternative={\namedboxanchorcontentparameter{#1}\c!alternative},% + text={\namedboxanchorcontentparameter{#1}\c!text},% + rulethickness={\namedboxanchorcontentparameter{#1}\c!rulethickness},% + linecolor=\namedboxanchorcontentparameter{#1}{\c!rulecolor},% + % matrix specific: + leftedge=\namespacedboxanchor\c!leftedge,% + rightedge=\namespacedboxanchor\c!rightedge}% + \stoppositionoverlay + \endgroup} + +\let\m_anch_matrix_list\empty + +\tolerant\permanent\protected\def\startmatrixanchors + {\glet\m_anch_matrix_list\empty + \defineboxanchor[\v!leftedge]% + \setboxanchor[\v!leftedge][\v!leftedge]\hpack{\xypos{\namespacedboxanchor\v!leftedge}}% + \defineboxanchor[\v!rightedge]% + \setboxanchor[\v!rightedge][\v!rightedge]\hpack{\xypos{\namespacedboxanchor\v!rightedge}}% + \setupmathfence[\c!leftsource=\v!leftedge,\c!rightsource=\v!rightedge]} + +\tolerant\permanent\protected\def\stopmatrixanchors + {\setupmathfence[\c!leftsource=,\c!rightsource=]% + \glet\m_anch_matrix_list\empty} + + +\defineboxanchorcontent + [arrow] + [\c!mp=mypos:boxanchor:arrow, + \c!distance=1.5\exheight, + \c!rulethickness=\linewidth, + \c!rulecolor=textcolor] + +\defineboxanchorcontent + [\v!top] + [arrow] + [\c!corner=\v!height, + \c!location=\v!depth, + \c!yoffset=.25\exheight, + \c!alternative=\v!top] + +\defineboxanchorcontent + [\v!bottom] + [arrow] + [\c!corner=\v!depth, + \c!location=\v!height, + \c!yoffset=-\namedboxanchorcontentparameter{top}\c!yoffset, + \c!alternative=\v!bottom] + +\defineboxanchorcontent + [\v!left] + [arrow] + [\c!corner={\v!middle,\v!left}, + \c!xoffset=-1.25\emwidth, + \c!alternative=\v!left] + +\defineboxanchorcontent + [\v!right] + [arrow] + [\c!corner={\v!middle,\v!right}, + \c!xoffset=-\namedboxanchorcontentparameter{left}\c!xoffset, + \c!alternative=\v!right] + +\defineboxanchorcontent + [\v!leftedge] + [\v!left] + [\c!xoffset=-.25\exheight] + +\defineboxanchorcontent + [\v!rightedge] + [\v!right] + [\c!xoffset=0.25\exheight] % we are centered + +\defineboxanchorcontent[\v!middle:\v!bottom][\v!bottom][\c!alternative=\v!middle,\c!yoffset=-.5\exheight] +\defineboxanchorcontent[\v!middle:\v!top ][\v!top ][\c!alternative=\v!middle,\c!yoffset=.5\exheight] +\defineboxanchorcontent[\v!middle:\v!left ][\v!left ][\c!alternative=\v!middle,\c!xoffset=-.5\exheight] +\defineboxanchorcontent[\v!middle:\v!right ][\v!right ][\c!alternative=\v!middle,\c!xoffset=.5\exheight] + +\defineboxanchorcontent + [\v!left:\v!bottom] + [\v!bottom] + [\c!alternative=\v!middle, + \c!corner={\v!left,\v!depth}, + \c!xoffset=-.25\exheight, + \c!yoffset=-.25\exheight] + +\defineboxanchorcontent + [\v!right:\v!bottom] + [\v!bottom] + [\c!alternative=\v!middle, + \c!corner={\v!right,\v!depth}, + \c!xoffset=.25\exheight, + \c!yoffset=-.25\exheight] + +\defineboxanchorcontent + [\v!left:\v!top] + [\v!top] + [\c!alternative=\v!middle, + \c!corner={\v!left,\v!height}, + \c!xoffset=-.25\exheight, + \c!yoffset=.25\exheight] + +\defineboxanchorcontent + [\v!right:\v!top] + [\v!top] + [\c!alternative=\v!middle, + \c!corner={\v!right,\v!height}, + \c!xoffset=.25\exheight, + \c!yoffset=.25\exheight] + +\protect diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 6f4698847..8f4d6c1cf 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.03.24 21:14} +\newcontextversion{2022.04.01 09:33} %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 6beb0171b..2c1cccae3 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.03.24 21:14} +\immutable\edef\contextversion{2022.04.01 09:33} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error @@ -584,6 +584,8 @@ \loadmkxlfile{meta-blb} \loadmkxlfile{grph-epd} +\loadmkxlfile{anch-box} + \loadmkxlfile{typo-shp} \loadmkxlfile{math-inc} % an experiment diff --git a/tex/context/base/mkxl/font-con.lmt b/tex/context/base/mkxl/font-con.lmt index b36f18dfa..83b97847d 100644 --- a/tex/context/base/mkxl/font-con.lmt +++ b/tex/context/base/mkxl/font-con.lmt @@ -713,7 +713,7 @@ function constructors.scale(tfmdata,specification) local tl = mk.topleft local br = mk.bottomright local bl = mk.bottomleft - chr.mathkern = { -- singular -> should be patched in luatex ! + chr.mathkerns = { topright = tr and mathkerns(tr,vdelta) or nil, topleft = tl and mathkerns(tl,vdelta) or nil, bottomright = br and mathkerns(br,vdelta) or nil, @@ -727,6 +727,22 @@ function constructors.scale(tfmdata,specification) chr.italic = vi*hdelta end end + local vk = character.topleft + if vk and vk ~= 0 then + chr.topleft = vk*hdelta + end + local vk = character.topright + if vk and vk ~= 0 then + chr.topright = vk*hdelta + end + local vk = character.bottomleft + if vk and vk ~= 0 then + chr.bottomleft = vk*hdelta + end + local vk = character.bottomright + if vk and vk ~= 0 then + chr.bottomright = vk*hdelta + end -- local ft = character.options -- if ft then -- chr.options = ft diff --git a/tex/context/base/mkxl/font-imp-tracing.lmt b/tex/context/base/mkxl/font-imp-tracing.lmt index 749a3c964..3de48af6f 100644 --- a/tex/context/base/mkxl/font-imp-tracing.lmt +++ b/tex/context/base/mkxl/font-imp-tracing.lmt @@ -190,9 +190,9 @@ local function initialize(tfmdata,key,value) local blcolor = { "startcolor", "trace:3" } -- b / db local tlcolor = { "startcolor", "trace:4" } -- y / dy for unicode, character in next, characters do - local mathkern = character.mathkern - local italic = character.vitalic or character.italic - if mathkern or (italic and italic ~= 0) then + local mathkerns = character.mathkerns + local italic = character.vitalic or character.italic + if mathkerns or (italic and italic ~= 0) then local width = character.width or 0 local height = character.height or 0 local depth = character.depth or 0 @@ -206,11 +206,11 @@ local function initialize(tfmdata,key,value) count = count + 1 list[count] = pop count = count + 1 list[count] = black end - if mathkern then - local br = mathkern.bottomright - local tr = mathkern.topright - local bl = mathkern.bottomleft - local tl = mathkern.topleft + if mathkerns then + local br = mathkerns.bottomright + local tr = mathkerns.topright + local bl = mathkerns.bottomleft + local tl = mathkerns.topleft if br then local done = false for i=1,#br do diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index 047a5cbc6..19464b522 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -134,35 +134,27 @@ function mathematics.checkaccentbaseheight(target,original) end end -function mathematics.checkprivateparameters(target,original) - local mathparameters = target.mathparameters - if mathparameters then - local parameters = target.parameters - local properties = target.properties - if parameters then - local size = parameters.size - if size then --- if not mathparameters.FractionDelimiterSize then --- mathparameters.FractionDelimiterSize = 1.01 * size --- end --- if not mathparameters.FractionDelimiterDisplayStyleSize then --- mathparameters.FractionDelimiterDisplayStyleSize = 2.40 * size --- end --- if not mathparameters.PrimeSuperscriptSpace then --- mathparameters.PrimeSuperscriptSpace = size / 20 --- end - elseif properties then - report_math("invalid parameters in font %a",properties.fullname or "?") - else - report_math("invalid parameters in font") - end - elseif properties then - report_math("no parameters in font %a",properties.fullname or "?") - else - report_math("no parameters and properties in font") - end - end -end +-- function mathematics.checkprivateparameters(target,original) +-- local mathparameters = target.mathparameters +-- if mathparameters then +-- local parameters = target.parameters +-- local properties = target.properties +-- if parameters then +-- local size = parameters.size +-- if size then +-- -- gone +-- elseif properties then +-- report_math("invalid parameters in font %a",properties.fullname or "?") +-- else +-- report_math("invalid parameters in font") +-- end +-- elseif properties then +-- report_math("no parameters in font %a",properties.fullname or "?") +-- else +-- report_math("no parameters and properties in font") +-- end +-- end +-- end function mathematics.overloadparameters(target,original) local mathparameters = target.mathparameters @@ -692,6 +684,33 @@ end do + -- musical timestamp: March 2022, Antonio Sanches (Bad Hombre), live performance in NL + + function mathtweaks.kerns(target,original,parameters) + local kerns = parameters.list + if kerns then + local characters = target.characters + local function kernone(unicode,data) + local chardata = characters[unicode] + local height = chardata.height or 0 + local depth = chardata.depth or 0 + local width = chardata.width or 0 + local k = data.topleft ; if k and k ~= 0 then chardata.topleft = k * width end + local k = data.topright ; if k and k ~= 0 then chardata.topright = k * width end + local k = data.bottomleft ; if k and k ~= 0 then chardata.bottomleft = k * width end + local k = data.bottomright ; if k and k ~= 0 then chardata.bottomright = k * width end + end + for unicode, data in next, kerns do + kernone(unicode,data) -- withscriptcode(tfmdata,unicode,data,kernone) + -- also smaller + end + end + end + +end + +do + -- local list = { -- [0x203E] = { factor = .4 }, -- overbar -- [0x203E] = { factor = .7 }, -- underbar @@ -1042,6 +1061,29 @@ end do + local list = { 0x2061, 0x2062, 0x2063, 0x2064 } + + function mathtweaks.wipecues(target,original,parameters) + local characters = target.characters + local tobewiped = parameters.list or list + for i=1,#tobewiped do + local unicode = tobewiped[i] + characters[unicode] = { + width = 0, + height = 0, + depth = 0, + unicode = unicode, + } + if trace_tweaking then + report_tweak("character %U has been wiped",unicode) + end + end + end + +end + +do + -- For Ton, who needs the high minus and plus for calculator signs in Dutch -- school math books. @@ -1213,7 +1255,7 @@ end sequencers.appendaction("mathparameters","system","mathematics.overloadparameters") sequencers.appendaction("mathparameters","system","mathematics.scaleparameters") sequencers.appendaction("mathparameters","system","mathematics.checkaccentbaseheight") -- should go in lfg instead -sequencers.appendaction("mathparameters","system","mathematics.checkprivateparameters") -- after scaling ! +----------.appendaction("mathparameters","system","mathematics.checkprivateparameters") -- after scaling ! sequencers.appendaction("beforecopyingcharacters","system","mathematics.tweakbeforecopyingfont") sequencers.appendaction("aftercopyingcharacters", "system","mathematics.tweakaftercopyingfont") diff --git a/tex/context/base/mkxl/math-ali.mkxl b/tex/context/base/mkxl/math-ali.mkxl index 7329fed96..cc3e363db 100644 --- a/tex/context/base/mkxl/math-ali.mkxl +++ b/tex/context/base/mkxl/math-ali.mkxl @@ -823,8 +823,10 @@ \fi \push_macro_c_math_cases_nc \mathatom \s!class \mathwrappedcode \bgroup + \scratchdimen\mathcasesparameter\c!leftmargin\relax + \ifzeropt\scratchdimen\else\kern\scratchdimen\fi \mathcasesparameter\c!left - %\startmathfenced[\mathcasesparameter\c!somekey]% + \math_fenced_start_wrap{\mathcasesparameter\c!fences}% \mathatom \s!class \mathconstructcode \bgroup \vcenter\bgroup \enforced\let\MC\math_cases_NC @@ -857,8 +859,10 @@ \egroup \egroup \egroup - %\stopmathfenced - \mathcasesparameter\c!right + \math_fenced_stop_wrap + \mathcasesparameter\c!right\relax + \scratchdimen\mathcasesparameter\c!rightmargin\relax + \ifzeropt\scratchdimen\else\kern\scratchdimen\fi \egroup \pop_macro_c_math_cases_nc \endgroup} @@ -873,13 +877,15 @@ \setupmathcases % [cases] - [\c!left={\startmathfenced[cases]}, - \c!right=\stopmathfenced] + [\c!leftmargin=\zeropoint, + \c!rightmargin=\zeropoint, + \c!left=, + \c!right=, + \c!fences=cases] \definemathcases [sesac] - [\c!left={\startmathfenced[sesac]}, - \c!right=\stopmathfenced] + [\c!fences=sesac] %D \startbuffer %D \placeformula \startformula \startcases @@ -934,9 +940,12 @@ \setupmathmatrix [\c!distance=\emwidth, + \c!fences=, \c!left=, \c!right=, \c!align=\v!middle, + \c!leftmargin=\zeropoint, + \c!rightmargin=\zeropoint, \c!rulecolor=, \c!rulethickness=\linewidth] @@ -968,13 +977,27 @@ \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 \math_left_of_eqalign \startimath \math_matrix_set_style - \tabskip\zeropoint \everycr\emptytoks} \protected\def\math_matrix_stop_cell @@ -995,73 +1018,140 @@ % \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 - [#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]} + [#1]% + [\v!both=>\c_math_matrix_anchor_mode\plusone,% + \v!yes=>\c_math_matrix_anchor_mode\plusone]} \def\math_matrix_anchor - {\ifbitwiseand\c_math_matrix_anchor_mode\plusone + {\ifcase\c_math_matrix_anchor_mode\else \markanchor{matrix}{\numexpr\c_math_eqalign_column+1\relax}\c_math_eqalign_row \fi} -\protected\def\math_matrix_distance +\protected\def\math_matrix_anchor_first {\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 + \ifcase\c_math_matrix_anchor_mode\else \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} + % \ifdim\d_math_eqalign_distance>\zeropoint + % \ifbitwiseand\c_math_matrix_anchor_mode\plustwo + % \hskip.5\d_math_eqalign_distance + % \fi + % \fi + \fi} -\protected\def\math_matrix_distance_last +\protected\def\math_matrix_anchor_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 + \ifcase\c_math_matrix_anchor_mode\else + % \ifdim\d_math_eqalign_distance>\zeropoint + % \ifbitwiseand\c_math_matrix_anchor_mode\plusfour + % \hskip.5\d_math_eqalign_distance + % \fi + % \fi \math_matrix_anchor - \fi - \relax} + \fi} \def\math_matrix_preamble {\math_matrix_strut - \math_matrix_distance_first + \math_matrix_anchor_first \global\advance\c_math_eqalign_column\plusone \math_matrix_start_cell \aligncontent \math_matrix_stop_cell \aligntab \aligntab - \math_matrix_distance + \math_matrix_anchor + \aligncontent + \aligntab \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_anchor_last \math_matrix_stop_row \math_matrix_pickup \crcr @@ -1076,7 +1166,9 @@ \permanent\protected\def\math_matrix_pickup{\global\settrue \c_math_matrix_first} \permanent\protected\def\math_matrix_NC_yes{\global\setfalse\c_math_matrix_first} -\permanent\protected\def\math_matrix_NC_nop{\aligntab} % avoids lookahead +%permanent\protected\def\math_matrix_NC_nop{\aligntab} % avoids lookahead +\permanent\protected\def\math_matrix_NC_nop{\aligntab\aligntab} % avoids lookahead + \def\math_matrix_check_rule_step#1% {\doifelsenumber{#1} @@ -1121,6 +1213,39 @@ \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 @@ -1128,7 +1253,7 @@ \dontleavehmode \fi \bgroup - \tabskip\zeropoint + \tabskip.5\d_math_eqalign_distance \math_matrix_pickup \the\everymathmatrix % @@ -1223,9 +1348,15 @@ \begincsname\??mathmatrixalignlocation\mathmatrixparameter\c!location\endcsname\hbox\bgroup \normalstartimath \Ustyle\scratchcounter - \mathmatrixparameter\c!left + \scratchdimen\mathmatrixparameter\c!leftmargin\relax + \ifzeropt\scratchdimen\else\kern\scratchdimen\fi + \mathmatrixparameter\c!left\relax + \math_fenced_start_wrap{\mathmatrixparameter\c!fences}% \mathatom \s!class \mathconstructcode {\vcenter{\box\nextbox}}% \was \vcenter - \mathmatrixparameter\c!right + \math_fenced_stop_wrap + \mathmatrixparameter\c!right\relax + \scratchdimen\mathmatrixparameter\c!rightmargin\relax + \ifzeropt\scratchdimen\else\kern\scratchdimen\fi \normalstopimath \egroup} @@ -1420,29 +1551,28 @@ \definemathmatrix [matrix:brackets] - [\c!left={\startmathfenced[bracket]}, - \c!right=\stopmathfenced, + [\c!fences=bracket, \c!align=\v!middle] \definemathmatrix [matrix:parentheses] - [\c!left={\startmathfenced[parenthesis]}, - \c!right=\stopmathfenced, + [\c!fences=parenthesis, \c!align=\v!middle] \definemathmatrix [matrix:bars] - [\c!left={\startmathfenced[bar]}, - \c!right=\stopmathfenced, + [\c!fences=bar, \c!align=\v!middle] \definemathmatrix [matrix:braces] - [\c!left={\startmathfenced[brace]}, - \c!right=\stopmathfenced, + [\c!fences=brace, \c!align=\v!middle] -\definemathmatrix[thematrix][matrix:parentheses][\c!simplecommand=thematrix] +\definemathmatrix + [thematrix] + [matrix:parentheses] + [\c!simplecommand=thematrix] %D \startbuffer %D \startformula @@ -1464,6 +1594,30 @@ %D %D \typebuffer \getbuffer +%D Mikael needed this matrix in one of his advanced math courses that ran begin april 2022 +%D where new concepts were introduced: + +% \definemathfence +% [tekcarb] +% [\c!left="005D,\c!right="005B] + +\definemathmatrix + [xıɹʇɐɯ] + [\c!fences=tekcarb] + +%D Fortunately we were read for it: +%D +%D \startbuffer +%D \startformula +%D \startxıɹʇɐɯ +%D \NC a_1 \NC b_1 \NC c_1 \NR +%D \NC a_2 \NC b_2 \NC c_2 \NR +%D \stopxıɹʇɐɯ +%D \stopformula +%D \stopbuffer +%D +%D \typebuffer \getbuffer + %D \macros %D {startintertext} %D @@ -1567,61 +1721,77 @@ % \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 -%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 The macros \type {\overset} and \type {\underset} are provided by \AMS\ packages +%D in \LATEX. These macro allows you to place a symbol above or below another +%D symbol, irrespective of whether the other symbol is a relation or something else, +%D and without influencing the spacing. Because in \LUAMETATEX\ we're less limited, +%D we have rather simple definitions compared to \MKIV. One cna also do: %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}}} +%D \starttyping +%D $b\limits^a$ +%D $<\limits^a$ +%D \stoptyping -\permanent\protected\def\underset#1#2% - {\math_binrel_apply{#2}{\mathop{\kern\zeropoint#2}\limits\normalsubscript {#1}}} +\permanent\protected\def\overset #1#2{#2\limits\normalsuperscript{#1}} +\permanent\protected\def\underset#1#2{#2\limits\normalsubscript {#1}} %D The following code comes from \type {math-str.mkiv}. %D -%D Here we implement a basic math alignment mechanism. Numbers are also handled. The macros -%D \type {\startinnermath} and \type {\stopinnermath} can be overloaded in specialized -%D modules. +%D Here we implement a basic math alignment mechanism. Numbers are also handled. The +%D macros \type {\startinnermath} and \type {\stopinnermath} can be overloaded in +%D specialized modules. \installcorenamespace{mathinnerstart} \installcorenamespace{mathinnerstop} @@ -2166,6 +2336,10 @@ \setupmathsimplealign [\c!distance=\v!math, + \c!leftmargin=\zeropoint, + \c!rightmargin=\zeropoint, + \c!left=, + \c!right=, \c!align=\v!all:\v!middle, \c!textdistance=.25\emwidth] @@ -2187,9 +2361,17 @@ \ifarguments\or\or \setupcurrentmathsimplealign[#2]% \fi + \edef\p_strut{\mathsimplealignparameter\c!strut}% + \ifx\p_strut\v!yes + \enforced\let\math_align_strut\strut + \else + \enforced\let\math_align_strut\relax + \fi \mathatom \s!class \mathwrappedcode \bgroup - \mathsimplealignparameter\c!left - %\startmathfenced[\mathsimplealignparameter\c!somekey]% + \scratchdimen\mathsimplealignparameter\c!leftmargin\relax + \ifzeropt\scratchdimen\else\kern\scratchdimen\fi + \mathsimplealignparameter\c!left\relax + \math_fenced_start_wrap{\mathsimplealignparameter\c!fences}% \mathatom \s!class \mathconstructcode \bgroup \vcenter\bgroup \enforced\let\MC\math_simplealign_NC @@ -2211,6 +2393,7 @@ \global\advance\c_math_eqalign_column\plusone \math_left_of_eqalign % \hfil \ignorespaces + \math_align_strut \startimath \aligncontent \stopimath @@ -2226,6 +2409,7 @@ \kern\m_simplealign_distance \fi \ignorespaces + \math_align_strut \startimath \aligncontent \stopimath @@ -2238,8 +2422,10 @@ \egroup \egroup \egroup - %\stopmathfenced - \mathsimplealignparameter\c!right + \math_fenced_stop_wrap + \mathsimplealignparameter\c!right\relax + \scratchdimen\mathsimplealignparameter\c!rightmargin\relax + \ifzeropt\scratchdimen\else\kern\scratchdimen\fi \setbox\scratchbox\hbox{\mathsimplealignparameter\c!text}% \ifvoid\scratchbox\else \hskip\mathsimplealignparameter\c!textdistance diff --git a/tex/context/base/mkxl/math-def.mkxl b/tex/context/base/mkxl/math-def.mkxl index 53165a30c..6c434f995 100644 --- a/tex/context/base/mkxl/math-def.mkxl +++ b/tex/context/base/mkxl/math-def.mkxl @@ -28,50 +28,50 @@ %D The \mfunction macro is an alternative for \hbox with a controlable font switch. -\definemathcommand [arccos] [nolop] {\mfunctionlabeltext{arccos}} -\definemathcommand [arcsin] [nolop] {\mfunctionlabeltext{arcsin}} -\definemathcommand [arctan] [nolop] {\mfunctionlabeltext{arctan}} -\definemathcommand [arccosh] [nolop] {\mfunctionlabeltext{arccosh}} -\definemathcommand [arcsinh] [nolop] {\mfunctionlabeltext{arcsinh}} -\definemathcommand [arctanh] [nolop] {\mfunctionlabeltext{arctanh}} -\definemathcommand [acos] [nolop] {\mfunctionlabeltext{acos}} -\definemathcommand [asin] [nolop] {\mfunctionlabeltext{asin}} -\definemathcommand [atan] [nolop] {\mfunctionlabeltext{atan}} -\definemathcommand [arg] [nolop] {\mfunctionlabeltext{arg}} -\definemathcommand [cosh] [nolop] {\mfunctionlabeltext{cosh}} -\definemathcommand [cos] [nolop] {\mfunctionlabeltext{cos}} -\definemathcommand [coth] [nolop] {\mfunctionlabeltext{coth}} -\definemathcommand [cot] [nolop] {\mfunctionlabeltext{cot}} -\definemathcommand [csc] [nolop] {\mfunctionlabeltext{csc}} -\definemathcommand [deg] [nolop] {\mfunctionlabeltext{deg}} -\definemathcommand [det] [limop] {\mfunctionlabeltext{det}} -\definemathcommand [dim] [nolop] {\mfunctionlabeltext{dim}} -\definemathcommand [exp] [nolop] {\mfunctionlabeltext{exp}} -\definemathcommand [gcd] [limop] {\mfunctionlabeltext{gcd}} -\definemathcommand [hom] [nolop] {\mfunctionlabeltext{hom}} -\definemathcommand [inf] [limop] {\mfunctionlabeltext{inf}} -\definemathcommand [injlim] [limop] {\mfunctionlabeltext{injlim}} -\definemathcommand [ker] [nolop] {\mfunctionlabeltext{ker}} -\definemathcommand [lg] [nolop] {\mfunctionlabeltext{lg}} -\definemathcommand [liminf] [limop] {\mfunctionlabeltext{liminf}} -\definemathcommand [limsup] [limop] {\mfunctionlabeltext{limsup}} -\definemathcommand [lim] [limop] {\mfunctionlabeltext{lim}} -\definemathcommand [ln] [nolop] {\mfunctionlabeltext{ln}} -\definemathcommand [log] [nolop] {\mfunctionlabeltext{log}} -\definemathcommand [median] [limop] {\mfunctionlabeltext{median}} -\definemathcommand [max] [limop] {\mfunctionlabeltext{max}} -\definemathcommand [min] [limop] {\mfunctionlabeltext{min}} -\definemathcommand [mod] [limop] {\mfunctionlabeltext{mod}} -%definemathcommand [div] [limop] {\mfunctionlabeltext{div}} % overloads \div symbol -\definemathcommand [projlim] [limop] {\mfunctionlabeltext{projlim}} -\definemathcommand [Pr] [limop] {\mfunctionlabeltext{Pr}} -\definemathcommand [sec] [nolop] {\mfunctionlabeltext{sec}} -\definemathcommand [sinh] [nolop] {\mfunctionlabeltext{sinh}} -\definemathcommand [sin] [nolop] {\mfunctionlabeltext{sin}} -\definemathcommand [sup] [limop] {\mfunctionlabeltext{sup}} -\definemathcommand [tanh] [nolop] {\mfunctionlabeltext{tanh}} -\definemathcommand [tan] [nolop] {\mfunctionlabeltext{tan}} -\definemathcommand [diff] {\mfunctionlabeltext{diff}} +\definemathfunction [arccos] +\definemathfunction [arcsin] +\definemathfunction [arctan] +\definemathfunction [arccosh] +\definemathfunction [arcsinh] +\definemathfunction [arctanh] +\definemathfunction [acos] +\definemathfunction [asin] +\definemathfunction [atan] +\definemathfunction [arg] +\definemathfunction [cosh] +\definemathfunction [cos] +\definemathfunction [coth] +\definemathfunction [cot] +\definemathfunction [csc] +\definemathfunction [deg] +\definemathfunction [det] [\c!mathlimits=\v!yes] +\definemathfunction [dim] +\definemathfunction [exp] +\definemathfunction [gcd] [\c!mathlimits=\v!yes] +\definemathfunction [hom] +\definemathfunction [inf] [\c!mathlimits=\v!yes] +\definemathfunction [injlim] [\c!mathlimits=\v!yes] +\definemathfunction [ker] +\definemathfunction [lg] +\definemathfunction [liminf] [\c!mathlimits=\v!yes] +\definemathfunction [limsup] [\c!mathlimits=\v!yes] +\definemathfunction [lim] [\c!mathlimits=\v!yes] +\definemathfunction [ln] +\definemathfunction [log] +\definemathfunction [median] [\c!mathlimits=\v!yes] +\definemathfunction [max] [\c!mathlimits=\v!yes] +\definemathfunction [min] [\c!mathlimits=\v!yes] +\definemathfunction [mod] [\c!mathlimits=\v!yes] +%definemathfunction [div] [\c!mathlimits=\v!yes] +\definemathfunction [projlim] [\c!mathlimits=\v!yes] +\definemathfunction [Pr] [\c!mathlimits=\v!yes] +\definemathfunction [sec] +\definemathfunction [sinh] +\definemathfunction [sin] +\definemathfunction [sup] [\c!mathlimits=\v!yes] +\definemathfunction [tanh] +\definemathfunction [tan] +\definemathfunction [diff] \aliased\let\normalmatharg\arg % todo: maybe automatically @@ -138,28 +138,28 @@ \pushoverloadmode -\definemathcommand [colonsep] {\mkern-1.2mu} -\definemathcommand [doublecolonsep] {\mkern-0.9mu} - -\definemathcommand [centercolon] [rel] {\mathstylevcenteredhbox\colon} -\definemathcommand [colonminus] [rel] {\centercolon\colonsep\mathrel{-}} -%definemathcommand [minuscolon] [rel] {\mathrel{-}\colonsep\centercolon} % native char -%definemathcommand [colonequals] [rel] {\centercolon\colonsep=} % native char -%definemathcommand [equalscolon] [rel] {=\centercolon\colonsep} % native char -\definemathcommand [colonapprox] [rel] {\centercolon\colonsep\approx} -\definemathcommand [approxcolon] [rel] {\approx\centercolon\colonsep} -\definemathcommand [colonsim] [rel] {\centercolon\colonsep\sim} -\definemathcommand [simcolon] [rel] {\sim\centercolon\colonsep} - -\definemathcommand [coloncolon] [rel] {\centercolon\doublecolonsep\centercolon} -\definemathcommand [coloncolonminus] [rel] {\coloncolon\colonsep\mathrel{-}} -\definemathcommand [minuscoloncolon] [rel] {\mathrel{-}\colonsep\coloncolon} -\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=} % native char -\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep} -\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx} -\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep} -\definemathcommand [coloncolonsim] [rel] {\coloncolon\colonsep\sim} -\definemathcommand [simcoloncolon] [rel] {\sim\coloncolon\colonsep} +\definemathcommand [colonsep] {\mkern-1.2mu} +\definemathcommand [doublecolonsep] {\mkern-0.9mu} + +\definemathcommand [centercolon] [\s!relation] {\mathstylevcenteredhbox\colon} +\definemathcommand [colonminus] [\s!relation] {\centercolon\colonsep\mathrel{-}} +%definemathcommand [minuscolon] [\s!relation] {\mathrel{-}\colonsep\centercolon} % native char +%definemathcommand [colonequals] [\s!relation] {\centercolon\colonsep=} % native char +%definemathcommand [equalscolon] [\s!relation] {=\centercolon\colonsep} % native char +\definemathcommand [colonapprox] [\s!relation] {\centercolon\colonsep\approx} +\definemathcommand [approxcolon] [\s!relation] {\approx\centercolon\colonsep} +\definemathcommand [colonsim] [\s!relation] {\centercolon\colonsep\sim} +\definemathcommand [simcolon] [\s!relation] {\sim\centercolon\colonsep} + +\definemathcommand [coloncolon] [\s!relation] {\centercolon\doublecolonsep\centercolon} +\definemathcommand [coloncolonminus] [\s!relation] {\coloncolon\colonsep\mathrel{-}} +\definemathcommand [minuscoloncolon] [\s!relation] {\mathrel{-}\colonsep\coloncolon} +\definemathcommand [coloncolonequals] [\s!relation] {\coloncolon\colonsep=} % native char +\definemathcommand [equalscoloncolon] [\s!relation] {=\coloncolon\colonsep} +\definemathcommand [coloncolonapprox] [\s!relation] {\coloncolon\colonsep\approx} +\definemathcommand [approxcoloncolon] [\s!relation] {\approx\coloncolon\colonsep} +\definemathcommand [coloncolonsim] [\s!relation] {\coloncolon\colonsep\sim} +\definemathcommand [simcoloncolon] [\s!relation] {\sim\coloncolon\colonsep} \popoverloadmode diff --git a/tex/context/base/mkxl/math-fen.mkxl b/tex/context/base/mkxl/math-fen.mkxl index bd51abe20..e1a648ba4 100644 --- a/tex/context/base/mkxl/math-fen.mkxl +++ b/tex/context/base/mkxl/math-fen.mkxl @@ -330,10 +330,24 @@ {\math_fenced_fenced_stop\currentmathfence \endgroup} +\def\math_fenced_start_wrap#1% + {\begingroup + \edef\m_math_fenced_wrap{#1}% + \ifempty\m_math_fenced_wrap \else + \math_fenced_fenced_start\m_math_fenced_wrap + \fi} + +\def\math_fenced_stop_wrap + {\ifempty\m_math_fenced_wrap \else + \math_fenced_fenced_stop\m_math_fenced_wrap + \fi + \endgroup} + % cases are defined in math-ali: -\definemathfence [cases] [\c!left="007B,\c!right=\v!none] -\definemathfence [sesac] [\c!left=\v!none,\c!right="007D] +\definemathfence [cases] [\c!left="007B,\c!right=\v!none] +\definemathfence [sesac] [\c!left=\v!none,\c!right="007D] +\definemathfence [tekcarb] [\c!left="005D,\c!right="005B] % used for xıɹʇɐɯ %D This is new: %D @@ -790,18 +804,18 @@ \definemathcommand [bigg] {\choosemathbig3} \definemathcommand [Bigg] {\choosemathbig4} -\definemathcommand [bigl] [open] [one] {\big} -\definemathcommand [bigm] [rel] [one] {\big} -\definemathcommand [bigr] [close] [one] {\big} -\definemathcommand [Bigl] [open] [one] {\Big} -\definemathcommand [Bigm] [rel] [one] {\Big} -\definemathcommand [Bigr] [close] [one] {\Big} -\definemathcommand [biggl] [open] [one] {\bigg} -\definemathcommand [biggm] [rel] [one] {\bigg} -\definemathcommand [biggr] [close] [one] {\bigg} -\definemathcommand [Biggl] [open] [one] {\Bigg} -\definemathcommand [Biggm] [rel] [one] {\Bigg} -\definemathcommand [Biggr] [close] [one] {\Bigg} +\definemathcommand [bigl] [\s!open] [one] {\big} +\definemathcommand [bigm] [\s!relation] [one] {\big} +\definemathcommand [bigr] [\s!close] [one] {\big} +\definemathcommand [Bigl] [\s!open] [one] {\Big} +\definemathcommand [Bigm] [\s!relation] [one] {\Big} +\definemathcommand [Bigr] [\s!close] [one] {\Big} +\definemathcommand [biggl] [\s!open] [one] {\bigg} +\definemathcommand [biggm] [\s!relation] [one] {\bigg} +\definemathcommand [biggr] [\s!close] [one] {\bigg} +\definemathcommand [Biggl] [\s!open] [one] {\Bigg} +\definemathcommand [Biggm] [\s!relation] [one] {\Bigg} +\definemathcommand [Biggr] [\s!close] [one] {\Bigg} % \definemathfence [integral] [\c!left="222B] % diff --git a/tex/context/base/mkxl/math-frc.mkxl b/tex/context/base/mkxl/math-frc.mkxl index 6e41ee71e..ab43299e0 100644 --- a/tex/context/base/mkxl/math-frc.mkxl +++ b/tex/context/base/mkxl/math-frc.mkxl @@ -18,11 +18,8 @@ %D I need to check it all again as there was a bug in luatex with dimensions that could %D resulted in side effects that made me mess with spacing. -\permanent\protected\def\topstrut{\vrule\s!width\zeropoint\s!height\strutht\s!depth\zeropoint\relax} -\permanent\protected\def\botstrut{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp\relax} - -% \permanent\protected\def\mathtopstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\ht\scratchbox\s!depth\zeropoint\relax} -% \permanent\protected\def\mathbotstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\dp\scratchbox\relax} +\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} %D This module is reimplemented in \MKIV\ style. diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl index fceedb21e..b278ba1e8 100644 --- a/tex/context/base/mkxl/math-ini.mkxl +++ b/tex/context/base/mkxl/math-ini.mkxl @@ -14,10 +14,6 @@ \writestatus{loading}{ConTeXt Math Macros / Initializations} % todo: hpack as we skip math anyway -% -% todo: 0x2061 : function application -% todo: 0x2062 : invisible times -% todo: 0x2063 : invisible comma % a bit tricky way to set ... no (pseudo) registers but math hash values: % @@ -191,13 +187,25 @@ \copymathspacing \mathexponentialcode \mathordinarycode \copymathspacing \mathfunctioncode \mathordinarycode \copymathspacing \mathdigitcode \mathordinarycode - +\copymathspacing \mathfunctioncode \mathoperatorcode \copymathspacing \mathconstructcode \mathinnercode \copymathspacing \mathwrappedcode \mathfractioncode \setnewconstant\mathlimopcode \plusone \setnewconstant\mathnolopcode \plusone +% \m{m^2/x__3} + +\setmathoptions\mathdivisioncode\numexpr + \nopreslackclassoptioncode + +\nopostslackclassoptioncode + +\lefttopkernclassoptioncode + % +\righttopkernclassoptioncode + % +\leftbottomkernclassoptioncode + +\rightbottomkernclassoptioncode +\relax + + % obsolete \setnewconstant\mathboxcode \zerocount @@ -1043,12 +1051,12 @@ \permanent\protected\def\math_fraktur {\setmathalphabet \s!fraktur \setmathfontstylealternate\s!fraktur} \permanent\protected\def\math_blackboard {\setmathalphabet \s!blackboard\setmathfontstylealternate\s!blackboard} -\permanent\protected\def\mathupright {\mathgroupedcommandcs\math_upright} -\permanent\protected\def\mathitalic {\mathgroupedcommandcs\math_italic} -\permanent\protected\def\mathscript {\mathgroupedcommandcs\math_script} +\permanent\protected\def\mathupright {\mathgroupedcommandcs\math_upright } +\permanent\protected\def\mathitalic {\mathgroupedcommandcs\math_italic } +\permanent\protected\def\mathscript {\mathgroupedcommandcs\math_script } \permanent\protected\def\mathcalligraphic{\mathgroupedcommandcs\math_calligraphic} -\permanent\protected\def\mathfraktur {\mathgroupedcommandcs\math_fraktur} -\permanent\protected\def\mathblackboard {\mathgroupedcommandcs\math_blackboard} +\permanent\protected\def\mathfraktur {\mathgroupedcommandcs\math_fraktur } +\permanent\protected\def\mathblackboard {\mathgroupedcommandcs\math_blackboard } \permanent\protected\def\math_rm{\setmathattribute\s!rm\s!tf\setmathfontstylealternate\s!tf} \permanent\protected\def\math_ss{\setmathattribute\s!ss\s!tf\setmathfontstylealternate\s!tf} @@ -1062,17 +1070,17 @@ \permanent\protected\def\math_bs{\setmathfontstyle\s!bi\setmathfontstylealternate\s!bi} % no sl \permanent\protected\def\math_bi{\setmathfontstyle\s!bi\setmathfontstylealternate\s!bi} -\permanent\protected\def\mathrm{\mathgroupedcommandcs\math_rm\relax} -\permanent\protected\def\mathss{\mathgroupedcommandcs\math_ss\relax} -\permanent\protected\def\mathtt{\mathgroupedcommandcs\math_tt\relax} +\permanent\protected\def\mathrm{\mathgroupedcommandcs\math_rm} % \relax not needed +\permanent\protected\def\mathss{\mathgroupedcommandcs\math_ss} +\permanent\protected\def\mathtt{\mathgroupedcommandcs\math_tt} -\permanent\protected\def\mathtf{\mathgroupedcommandcs\math_tf\relax} -\permanent\protected\def\mathsl{\mathgroupedcommandcs\math_sl\relax} -\permanent\protected\def\mathit{\mathgroupedcommandcs\math_it\relax} +\permanent\protected\def\mathtf{\mathgroupedcommandcs\math_tf} +\permanent\protected\def\mathsl{\mathgroupedcommandcs\math_sl} +\permanent\protected\def\mathit{\mathgroupedcommandcs\math_it} -\permanent\protected\def\mathbf{\mathgroupedcommandcs\math_bf\relax} -\permanent\protected\def\mathbs{\mathgroupedcommandcs\math_bs\relax} -\permanent\protected\def\mathbi{\mathgroupedcommandcs\math_bi\relax} +\permanent\protected\def\mathbf{\mathgroupedcommandcs\math_bf} +\permanent\protected\def\mathbs{\mathgroupedcommandcs\math_bs} +\permanent\protected\def\mathbi{\mathgroupedcommandcs\math_bi} \aliased\let\math_default\math_italic \aliased\let\mathdefault \math_italic @@ -1108,10 +1116,10 @@ \permanent\protected\def\fraktur {\ifmmode\expandafter\mathfraktur \fi} \permanent\protected\def\gothic {\ifmmode\expandafter\mathfraktur \fi} -\permanent\protected\def\mathcal {\mathgroupedcommandcs\math_calligraphic\relax} % for AMS compatibility -\permanent\protected\def\mathscr {\mathgroupedcommandcs\math_script \relax} % for AMS compatibility -\permanent\protected\def\mathfrak{\mathgroupedcommandcs\math_fraktur \relax} % for AMS compatibility -\permanent\protected\def\mathbb {\mathgroupedcommandcs\math_blackboard \relax} % for AMS compatibility +\aliased\let\mathcal \mathcalligraphic % for AMS compatibility +\aliased\let\mathscr \mathscript % for AMS compatibility +\aliased\let\mathfrak\mathfraktur % for AMS compatibility +\aliased\let\mathbb \mathblackboard % for AMS compatibility \ifdefined\normaltf \else \permanent\let\normaltf\tf \fi \permanent\protected\def\tf{\ifmmode\expandafter\mathtf\else\expandafter\normaltf\fi} \ifdefined\normalbf \else \permanent\let\normalbf\bf \fi \permanent\protected\def\bf{\ifmmode\expandafter\mathbf\else\expandafter\normalbf\fi} @@ -1204,8 +1212,6 @@ %D Not used that much: -\installcorenamespace{mathcodecommand} - \permanent\protected\def\mathlimop#1{\normalmathop{#1}} %no \limits \permanent\protected\def\mathbox #1{\dontleavehmode\hbox\Ustartmath\mathsurround\zeropoint#1\Ustopmath} \permanent\protected\def\mathnolop#1{\normalmathop{#1}\nolimits} @@ -1216,30 +1222,68 @@ \aliased\let\mathnothing\firstofoneunexpanded \aliased\let\mathalpha \firstofoneunexpanded -% todo 'frac' and 'rad' +% \installcorenamespace {mathclasses} +% +% \letcsname\??mathclasses ord\endcsname\normalmathord +% \letcsname\??mathclasses op\endcsname\normalmathop +% \letcsname\??mathclasses rel\endcsname\normalmathrel +% \letcsname\??mathclasses bin\endcsname\normalmathbin +% \letcsname\??mathclasses punct\endcsname\normalmathpunct +% +% \letcsname\??mathclasses \endcsname\normalmathord +% \letcsname\??mathclasses inner\endcsname\normalmathinner +% \letcsname\??mathclasses open\endcsname\normalmathopen +% \letcsname\??mathclasses close\endcsname\normalmathclose +% \letcsname\??mathclasses ordinary\endcsname\normalmathord +% \letcsname\??mathclasses operator\endcsname\normalmathop +% \letcsname\??mathclasses relation\endcsname\normalmathrel +% \letcsname\??mathclasses binary\endcsname\normalmathbin +% \letcsname\??mathclasses punctuation\endcsname\normalmathpunct +% \letcsname\??mathclasses fraction\endcsname\normalmathfrac +% \letcsname\??mathclasses radical\endcsname\normalmathrad + +%D We need only a subset because many classes are sort of special. -% why not \aliased ? +\installcorenamespace{mathcodecommand} -\letcsname\??mathcodecommand ord\endcsname\mathord -\letcsname\??mathcodecommand op\endcsname\mathop -\letcsname\??mathcodecommand bin\endcsname\mathbin -\letcsname\??mathcodecommand rel\endcsname\mathrel -\letcsname\??mathcodecommand open\endcsname\mathopen -\letcsname\??mathcodecommand close\endcsname\mathclose -\letcsname\??mathcodecommand punct\endcsname\mathpunct -\letcsname\??mathcodecommand inner\endcsname\mathinner % hm -%letcsname\??mathcodecommand fraction\endcsname\mathnothing -%letcsname\??mathcodecommand radical\endcsname\mathnothing -%letcsname\??mathcodecommand middle\endcsname\mathnothing -\letcsname\??mathcodecommand limop\endcsname\mathlimop -\letcsname\??mathcodecommand nolop\endcsname\mathnolop +% short: -% obsolete +\aliased\letcsname\??mathcodecommand ord\endcsname\mathord +\aliased\letcsname\??mathcodecommand op\endcsname\mathop +\aliased\letcsname\??mathcodecommand rel\endcsname\mathrel +\aliased\letcsname\??mathcodecommand bin\endcsname\mathbin +\aliased\letcsname\??mathcodecommand punct\endcsname\mathpunct -\letcsname\??mathcodecommand box\endcsname\mathbox -%letcsname\??mathcodecommand choice\endcsname\mathnothing -\letcsname\??mathcodecommand alpha\endcsname\mathalpha % hm -\letcsname\??mathcodecommand nothing\endcsname\mathnothing +% official: + +\aliased\letcsname\??mathcodecommand \endcsname\normalmathord +\aliased\letcsname\??mathcodecommand inner\endcsname\normalmathinner +\aliased\letcsname\??mathcodecommand open\endcsname\normalmathopen +\aliased\letcsname\??mathcodecommand close\endcsname\normalmathclose +\aliased\letcsname\??mathcodecommand ordinary\endcsname\normalmathord +\aliased\letcsname\??mathcodecommand operator\endcsname\normalmathop +\aliased\letcsname\??mathcodecommand relation\endcsname\normalmathrel +\aliased\letcsname\??mathcodecommand binary\endcsname\normalmathbin +\aliased\letcsname\??mathcodecommand punctuation\endcsname\normalmathpunct +\aliased\letcsname\??mathcodecommand fraction\endcsname\normalmathfrac +\aliased\letcsname\??mathcodecommand radical\endcsname\normalmathrad + +% special: + +\aliased\letcsname\??mathcodecommand limop\endcsname\mathlimop +\aliased\letcsname\??mathcodecommand nolop\endcsname\mathnolop + +% obsolete: + +\aliased\letcsname\??mathcodecommand box\endcsname\mathbox +%aliased\letcsname\??mathcodecommand choice\endcsname\mathnothing +\aliased\letcsname\??mathcodecommand alpha\endcsname\mathalpha % hm +\aliased\letcsname\??mathcodecommand nothing\endcsname\mathnothing + +% usage: + +\def\math_class_by_parameter #1{\normalexpanded{\noexpand\math_class_by_parameter_indeed{#1\c!mathclass}}} +\def\math_class_by_parameter_indeed#1{\csname\??mathcodecommand\ifcsname\??mathcodecommand#1\endcsname#1\fi\endcsname} \permanent \def\mathcodenumber #1{\the\csname math#1code\endcsname} \permanent\protected\def\mathcodecommand#1{\csname\??mathcodecommand#1\endcsname} @@ -1285,9 +1329,9 @@ %D Let's define a few comands here: -%definemathcommand [mathstrut] {\vphantom{(}} -%definemathcommand [joinrel] {\mathrel{\mkern-3mu}} -\definemathcommand [joinrel] [rel] {\mkern-3mu} +%definemathcommand [mathstrut] {\vphantom{(}} +%definemathcommand [joinrel] {\mathrel{\mkern-3mu}} +\definemathcommand [joinrel] [\s!relation] {\mkern-3mu} \immutable\chardef\c_math_strut"28 @@ -1452,6 +1496,14 @@ \c!functionstyle=, % rm ss etc i.e. known alternatives, otherwise math \c!functioncolor=] +% in char-def: +% +% +% \Umathcode"2061 = \mathghostcode \zerocount "2061 % \applyfunction +% \Umathcode"2062 = \mathghostcode \zerocount "2062 % \invisibletimes +% \Umathcode"2063 = \mathghostcode \zerocount "2063 % \invisiblecomma +% \Umathcode"2064 = \mathghostcode \zerocount "2063 % \invisibleplus + % \protected\def\math_mfunction_styled % {%\begingroup % \usemathematicscolorparameter\c!functioncolor @@ -1491,26 +1543,52 @@ % \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 +% \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} + +\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 - \endgroup} + \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\defcsname#1\endcsname{\math_function_handle_label{#1}{#2}}} + +\protected\def\math_function_handle_label#1#2% tag settings + {\begingroup + \getdummyparameters[\c!mathlimits=,#2]% + \math_function_handle\mathlabeltext{#1}% + \ifcstok{\dummyparameter\c!mathlimits}\v!yes\limits\fi + \endgroup} + + \let\math_tags_mfunctiontxt\gobbletwoarguments \let\math_tags_mfunctionlab\gobbletwoarguments @@ -2498,6 +2576,8 @@ %permanent\def\mathstyletrigger#1{\numexpr#1\relax} \permanent\let\mathstyletrigger \firstofoneargument +\def\triggeredmathstyle#1{\Ustyle\numexpr\number#1\relax} % expandable + \permanent\def\triggeredmathstyleparameter#1% to bypass the relax {\ifcase\numexpr\normalmathstyle\relax #1\displaystyle \or % 0 @@ -2688,32 +2768,38 @@ % to be tested: {#1} but it could have side effects -% \protected\def\mathstylehbox#1% sensitive for: a \over b => {a\over b} or \frac{a}{b} -% {\normalexpanded{\hbox\bgroup -% \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup} - \permanent\protected\def\mathstylehbox#1#% sensitive for: a \over b => {a\over b} or \frac{a}{b} {\math_style_hbox{#1}} \protected\def\math_style_hbox#1#2% sensitive for: a \over b => {a\over b} or \frac{a}{b} {\normalexpanded{\hbox#1\bgroup - \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#2\stopimath\egroup} + \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#2\stopimath\egroup} + +% adaptive variant: +% +% \protected\def\math_style_hbox#1#2% sensitive for: a \over b => {a\over b} or \frac{a}{b} +% {\normalexpanded{\setbox\scratchbox\hbox#1\bgroup +% \mathbeginclass\lastrightclass +% \startimath\Ustyle\the\mathstyle\relax}% +% \mathsurround\zeropoint#2\stopimath\egroup +% \box\scratchbox +% \mathrightclass\lastrightclass } \permanent\protected\def\mathstylevbox#1% {\normalexpanded{\vbox\bgroup - \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup} + \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup} \permanent\protected\def\mathstylevcenter#1% {\normalexpanded{\vcenter\bgroup - \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup} + \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup} \permanent\protected\def\mathstylevcenteredhbox#1% {\normalexpanded{\vcenter\bgroup\hbox\bgroup - \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup} + \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup} \permanent\protected\def\mathstylevcenteredvbox#1% {\normalexpanded{\vcenter\bgroup\vbox\bgroup - \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup} + \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup} \permanent\protected\def\setmathsmalltextbox#1#2#% {\normalizebodyfontsize\m_math_text_choice_face{\mathsmallstyleface\normalmathstyle}% @@ -3286,7 +3372,7 @@ \permanent\protected\def\smallmathsymbol#1% {\mathematics{\mathbin{\normalexpanded{\raise.15\exheight\hbox{\normalstartimath - \triggermathstyle{\the\numexpr\normalmathstyle+2\relax}#1% + \triggeredmathstyle{\the\numexpr\normalmathstyle+2\relax}#1% \normalstopimath}}}}} % this should be a primitive: @@ -3773,8 +3859,6 @@ \permanent\protected\def\setupmathspacing[#1]% {\begincsname\??mathspacing#1\endcsname} -\installcorenamespace {mathclasses} - % \defcsname\??mathspacing +\endcsname % {\expandedloop\zerocount\plusseven\plusone % {\Umathxscale @@ -3796,31 +3880,6 @@ % can become a lua call that globally defined it, then we can have % partials -% todo: fences and stackers should be done the same: number or -% name - -\letcsname\??mathclasses \endcsname\normalmathord -\letcsname\??mathclasses ord\endcsname\normalmathord -\letcsname\??mathclasses ordinary\endcsname\normalmathord -\letcsname\??mathclasses op\endcsname\normalmathop -\letcsname\??mathclasses operator\endcsname\normalmathop -\letcsname\??mathclasses rel\endcsname\normalmathrel -\letcsname\??mathclasses relation\endcsname\normalmathrel -\letcsname\??mathclasses bin\endcsname\normalmathbin -\letcsname\??mathclasses binary\endcsname\normalmathbin -\letcsname\??mathclasses punct\endcsname\normalmathbin -\letcsname\??mathclasses punctuation\endcsname\normalmathbin -\letcsname\??mathclasses frac\endcsname\normalmathfrac -\letcsname\??mathclasses fraction\endcsname\normalmathfrac -\letcsname\??mathclasses rad\endcsname\normalmathrad -\letcsname\??mathclasses radical\endcsname\normalmathrad - -\def\math_class_by_parameter#1% - {\normalexpanded{\noexpand\math_class_by_parameter_indeed{#1\c!mathclass}}} - -\def\math_class_by_parameter_indeed#1% - {\csname\??mathclasses\ifcsname\??mathclasses#1\endcsname#1\fi\endcsname} - %D For now we define this here: \ifdefined\d \let\text_d\d \else \let\text_d\firstofoneargument \fi diff --git a/tex/context/base/mkxl/math-noa.lmt b/tex/context/base/mkxl/math-noa.lmt index 02f425542..11621f9bd 100644 --- a/tex/context/base/mkxl/math-noa.lmt +++ b/tex/context/base/mkxl/math-noa.lmt @@ -2121,7 +2121,7 @@ do name = "setmathvariant", public = true, protected = true, - arguments = "string", + arguments = "argument", actions = mathematics.setvariant, } diff --git a/tex/context/base/mkxl/math-pln.mkxl b/tex/context/base/mkxl/math-pln.mkxl index 354f33a5f..ec64b7e4d 100644 --- a/tex/context/base/mkxl/math-pln.mkxl +++ b/tex/context/base/mkxl/math-pln.mkxl @@ -50,20 +50,20 @@ \permanent\protected\def\buildrel#1\over#2% {\mathrel{\mathop{\kern\zeropoint#2}\limits^{#1}}} -\permanent\protected\def\bmod - {\nonscript - \mskip-\medmuskip - \mkern5mu - \mfunction{mod}% - \penalty900 - \mkern5mu - \nonscript - \mskip-\medmuskip} - -\permanent\protected\def\pmod#1% - {\allowbreak - \mkern18mu - (\mfunction{mod}\mskip\medmuskip#1)} + \permanent\protected\def\bmod + {\nonscript + \mskip-\medmuskip + \mkern5mu + \mfunction{mod}% + \penalty900 + \mkern5mu + \nonscript + \mskip-\medmuskip} + + \permanent\protected\def\pmod#1% + {\allowbreak + \mkern18mu + (\mfunction{mod}\mskip\medmuskip#1)} \permanent\protected\def\cases#1% {\left\{% diff --git a/tex/context/base/mkxl/math-stc.mklx b/tex/context/base/mkxl/math-stc.mklx index 970e1352d..86c6b6499 100644 --- a/tex/context/base/mkxl/math-stc.mklx +++ b/tex/context/base/mkxl/math-stc.mklx @@ -177,7 +177,7 @@ [%c!alternative=\v!text, % text | mathematics \c!left=, \c!right=, - \c!mathclass=\s!rel, + \c!mathclass=\s!relation, \c!alternative=\v!normal, \c!voffset=.25\mathexheight, % maybe less \c!hoffset=\zeropoint, @@ -968,7 +968,7 @@ \definemathstackers [\v!vfenced] [\v!both] - [\c!mathclass=\s!ord, + [\c!mathclass=\s!ordinary, \c!mathlimits=\v!yes] % these are needed for mathml: @@ -1371,7 +1371,7 @@ \fi \endgroup} -\definemathstackers [\v!wide] [\c!moffset=\thickmuskip,\c!mathclass=\s!rel] +\definemathstackers [\v!wide] [\c!moffset=\thickmuskip,\c!mathclass=\s!relation] \definemathunstacked [\v!wide] [And] ["0026] % \mathrel{\;&\;} \definemathunstacked [\v!wide] [impliedby] ["27F8] % \mathrel{\;\Longleftarrow\;} diff --git a/tex/context/base/mkxl/math-toy.mkxl b/tex/context/base/mkxl/math-toy.mkxl index 510872e3b..34ea6f38c 100644 --- a/tex/context/base/mkxl/math-toy.mkxl +++ b/tex/context/base/mkxl/math-toy.mkxl @@ -20,16 +20,16 @@ %D \starttyping %D \enabletrackers[math.toysymbol] %D -%D \definemathtoysymbol[Plus] [bin][+] -%D \definemathtoysymbol[Minus][bin][-] -%D \definemathtoysymbol[Equal][rel][=] +%D \definemathtoysymbol[Plus] [binary] [+] +%D \definemathtoysymbol[Minus][binary] [-] +%D \definemathtoysymbol[Equal][relation][=] %D %D $\dorecurse{199}{x_{#1} \ifodd#1\relax\Plus\else\Minus\fi} x_{200} \Equal n$ \blank %D \stoptyping \permanent\tolerant\protected\def\definemathtoysymbol[#1]#*[#2]#*[#3]% {\ifarguments\or\or\or - \setuevalue{#1}{\math_toy_define_symbol_indeed{\mathcodechecked{#2}}{#3}}% + \protected\instance\edefcsname#1\endcsname{\math_toy_define_symbol_indeed{\mathcodechecked{#2}}{#3}}% \fi} \protected\def\math_toy_define_symbol_traced#1#2% diff --git a/tex/context/base/mkxl/mlib-lua.lmt b/tex/context/base/mkxl/mlib-lua.lmt index 005a57a72..19423e7b1 100644 --- a/tex/context/base/mkxl/mlib-lua.lmt +++ b/tex/context/base/mkxl/mlib-lua.lmt @@ -127,7 +127,37 @@ local function same(p,n) return false end -function inject.path(p,close,connector) +-- function inject.path(p,close,connector) +-- local closed = false +-- local curled = false +-- local n = #p +-- print("spec",p,close,connector) +-- if close == nil then +-- closed = (p.close or p.cycle or p.closed) and true or false +-- else +-- closed = close +-- end +-- if connector then +-- if connector == "auto" then +-- connector = #p[1] > 2 +-- end +-- if connector == false or connector == "--" then +-- curled = true +-- -- elseif connector == true or connector == ".." then +-- -- if close and not same(p,n) then +-- -- p[n+1] = p[1] +-- -- end +-- end +-- elseif p.curled then +-- curled = true +-- end +-- if trace then reporti("path") end +-- inspect(p) +-- print(p,closed,curled) +-- return injectpath(currentmpx,p,closed,curled) +-- end + +function inject.path(p,connector,close) local closed = false local curled = false local n = #p @@ -142,10 +172,6 @@ function inject.path(p,close,connector) end if connector == false or connector == "--" then curled = true - -- elseif connector == true or connector == ".." then - -- if close and not same(p,n) then - -- p[n+1] = p[1] - -- end end elseif p.curled then curled = true diff --git a/tex/context/base/mkxl/mlib-scn.lmt b/tex/context/base/mkxl/mlib-scn.lmt index eb34d2b2e..dca2a7aa9 100644 --- a/tex/context/base/mkxl/mlib-scn.lmt +++ b/tex/context/base/mkxl/mlib-scn.lmt @@ -641,7 +641,8 @@ local function getparameterpath() if type(close) == "boolean" then n = n - 1 else - close = false + -- close = false + close = nil end local connector = list[n] if type(connector) == "string" and validconnectors[connector] then diff --git a/tex/context/base/mkxl/mult-sys.mkxl b/tex/context/base/mkxl/mult-sys.mkxl index 9ac124808..caae5b365 100644 --- a/tex/context/base/mkxl/mult-sys.mkxl +++ b/tex/context/base/mkxl/mult-sys.mkxl @@ -160,6 +160,7 @@ \definesystemconstant {leftclass} \definesystemconstant {rightclass} \definesystemconstant {clone} +\definesystemconstant {close} \definesystemconstant {cmyk} \definesystemconstant {cm} \definesystemconstant {code} @@ -308,8 +309,10 @@ \definesystemconstant {nowidth} \definesystemconstant {numbering} \definesystemconstant {number} +\definesystemconstant {open} +\definesystemconstant {operator} \definesystemconstant {options} -\definesystemconstant {ord} +\definesystemconstant {ordinary} \definesystemconstant {orientation} \definesystemconstant {otr} \definesystemconstant {pagefloat} @@ -326,7 +329,7 @@ \definesystemconstant {register} \definesystemconstant {Regular} \definesystemconstant {regular} -\definesystemconstant {rel} +\definesystemconstant {relation} \definesystemconstant {reset} \definesystemconstant {reverse} \definesystemconstant {rgb} diff --git a/tex/context/base/mkxl/pack-box.mkxl b/tex/context/base/mkxl/pack-box.mkxl index bc73a80d7..8c83f8308 100644 --- a/tex/context/base/mkxl/pack-box.mkxl +++ b/tex/context/base/mkxl/pack-box.mkxl @@ -1304,6 +1304,9 @@ \permanent\protected\def\mathboxanchored#1#2{#2\Umathsource\namedboxanchor{#1}\relax} +\permanent\protected\def\mathrowanchored #1{\alignmentwrapsource\namedboxanchor{#1}\relax} +\permanent\protected\def\mathcellanchored#1{\alignmentcellsource\namedboxanchor{#1}\relax} + % to be used as: % % \scratchcounter\registeredboxanchor diff --git a/tex/context/base/mkxl/strc-itm.mklx b/tex/context/base/mkxl/strc-itm.mklx index 13b750ce3..96e98e769 100644 --- a/tex/context/base/mkxl/strc-itm.mklx +++ b/tex/context/base/mkxl/strc-itm.mklx @@ -1044,7 +1044,7 @@ \ifconditional\c_strc_itemgroups_text \removeunwantedspaces \space - \ignorespaces + \ignorepars % \ignorespaces \else \par \fi @@ -1238,18 +1238,19 @@ {\settrue\c_strc_itemgroups_head \dotagsetitem\s!head% % weird place \dostarttagged\t!itemhead\empty - \useitemgroupstyleandcolor\c!headstyle\c!headcolor\ignorespaces} + \useitemgroupstyleandcolor\c!headstyle\c!headcolor + \ignorepars} % \ignorespaces \protected\def\strc_itemgroups_stop_head_indeed {\removeunwantedspaces \dostoptagged \ifconditional\c_strc_itemgroups_inline_head \space - \ignorespaces + \ignorepars % \ignorespaces \else \ifconditional\c_strc_itemgroups_text \space - \ignorespaces + \ignorepars % \ignorespaces \else \par \fi @@ -1261,7 +1262,7 @@ \protected\def\strc_itemgroups_head_body_indeed {\dostarttagged\t!itembody\empty \noindentation - \ignorespaces} + \ignorepars} % \ignorespaces % Simple commands. @@ -1274,7 +1275,7 @@ %\advance\c_strc_itemgroups_n_of_items\plusone \setbox\b_strc_itemgroups\emptyhbox \strc_itemgroups_check_for_repeated - \ignorespaces} + \ignorepars} % \ignorespaces \protected\def\strc_itemgroups_start_button[#destination]% {\edef\m_strc_itemgroups_destination{#destination}% @@ -1349,6 +1350,7 @@ \letcsname\??itemgroupstart\v!its \endcsname\strc_itemgroups_start_items \letcsname\??itemgroupstart\v!mar \endcsname\strc_itemgroups_start_margin \letcsname\??itemgroupstart\v!txt \endcsname\strc_itemgroups_start_text +\letcsname\??itemgroupstart\v!no \endcsname\strc_itemgroups_start_no_item \def\strc_itemgroups_optimize_breaks {\ifcase\c_strc_itemgroups_column_depth @@ -1552,7 +1554,7 @@ \ifconditional\c_strc_itemgroups_indented_first \hskip\parindent \fi - \ignorespaces} + \ignorepars} % \ignorespaces \def\strc_itemgroups_start_item_nop {\let\currentitemreference\empty @@ -1562,7 +1564,7 @@ {\useitemgroupstyleandcolor\c!style\c!color \strc_itemgroups_used_symbol}% \strc_itemgroups_check_for_repeated - \ignorespaces} + \ignorepars} % \ignorespaces \setvalue{\??itemgroupdistance\v!none}% {\let\m_strc_itemgroups_text_distance\zeropoint} @@ -1596,7 +1598,7 @@ % \ignorespaces} \protected\def\strc_itemgroups_default_command - {\ignorespaces} + {\ignorepars} % \ignorespaces %D Special case: @@ -1818,7 +1820,7 @@ % \setbox\scratchbox\hbox{\settrialtypesetting#text}% % \setbox\scratchbox\hbox\ifdim\wd\scratchbox<1em to 1.5\else spread 1\fi em{#text\hfil}% % \normalexpanded{\box\scratchbox\endgroup\hangindent\the\wd\scratchbox}% -% \ignorespaces} +% \ignorepars} % \ignorespaces %D End of plugin. @@ -1846,7 +1848,7 @@ \ht\b_strc_itemgroups\strutheight \dp\b_strc_itemgroups\strutdepth \box\b_strc_itemgroups - \ignorespaces} + \ignorepars} % \ignorespaces %D Done again. diff --git a/tex/context/base/mkxl/supp-box.mkxl b/tex/context/base/mkxl/supp-box.mkxl index fe96505a0..deb2699d7 100644 --- a/tex/context/base/mkxl/supp-box.mkxl +++ b/tex/context/base/mkxl/supp-box.mkxl @@ -675,20 +675,32 @@ \def\syst_boxes_do_tlap{\vpack to \zeropoint{\vss\box\nextbox}\endgroup} \def\syst_boxes_do_blap{\vpack to \zeropoint{\box\nextbox\vss}\endgroup} -\def\syst_boxes_rlap {\begingroup\dowithnextboxcs\syst_boxes_do_rlap\hbox} -\def\syst_boxes_llap {\begingroup\dowithnextboxcs\syst_boxes_do_llap\hbox} -\def\syst_boxes_clap {\begingroup\dowithnextboxcs\syst_boxes_do_clap\hbox} -\def\syst_boxes_math_clap{\mathpalette\syst_boxes_do_math_clap} -\def\syst_boxes_math_llap{\mathpalette\syst_boxes_do_math_llap} -\def\syst_boxes_math_rlap{\mathpalette\syst_boxes_do_math_rlap} +\protected\def\syst_boxes_rlap{\begingroup\dowithnextboxcs\syst_boxes_do_rlap\hbox} +\protected\def\syst_boxes_llap{\begingroup\dowithnextboxcs\syst_boxes_do_llap\hbox} +\protected\def\syst_boxes_clap{\begingroup\dowithnextboxcs\syst_boxes_do_clap\hbox} -\def\syst_boxes_do_math_clap#1#2{\syst_boxes_clap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}} -\def\syst_boxes_do_math_llap#1#2{\syst_boxes_llap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}} -\def\syst_boxes_do_math_rlap#1#2{\syst_boxes_rlap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}} +% \def\syst_boxes_do_math_clap#1#2{\syst_boxes_clap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}} +% \def\syst_boxes_do_math_llap#1#2{\syst_boxes_llap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}} +% \def\syst_boxes_do_math_rlap#1#2{\syst_boxes_rlap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}} +% +% \def\syst_boxes_math_clap{\mathpalette\syst_boxes_do_math_clap} +% \def\syst_boxes_math_llap{\mathpalette\syst_boxes_do_math_llap} +% \def\syst_boxes_math_rlap{\mathpalette\syst_boxes_do_math_rlap} + +\def\syst_boxes_math_xlap#1#2% + {\normalexpanded{#1\bgroup\normalstartimath\Ustyle\the\mathstyle}% + %{\expandafter#1\expandafter\bgroup\expandafter\normalstartimath\expandafter\Ustyle\the\mathstyle + \mathsurround\zeropoint#2% + \normalstopimath\egroup} + +\def\syst_boxes_math_clap{\syst_boxes_math_xlap\syst_boxes_clap} +\def\syst_boxes_math_llap{\syst_boxes_math_xlap\syst_boxes_llap} +\def\syst_boxes_math_rlap{\syst_boxes_math_xlap\syst_boxes_rlap} \permanent\protected\def\rlap{\mathortext\syst_boxes_math_rlap\syst_boxes_rlap} \permanent\protected\def\llap{\mathortext\syst_boxes_math_llap\syst_boxes_llap} \permanent\protected\def\clap{\mathortext\syst_boxes_math_clap\syst_boxes_clap} + \permanent\protected\def\tlap{\begingroup\dowithnextboxcs\syst_boxes_do_tlap\vbox} \permanent\protected\def\blap{\begingroup\dowithnextboxcs\syst_boxes_do_blap\vbox} diff --git a/tex/context/base/mkxl/tabl-tab.mkxl b/tex/context/base/mkxl/tabl-tab.mkxl index d9aa5e7fa..01e665d02 100644 --- a/tex/context/base/mkxl/tabl-tab.mkxl +++ b/tex/context/base/mkxl/tabl-tab.mkxl @@ -756,7 +756,7 @@ \!taDimenB=#2\relax \let\!TsSpaceFactor\empty \ifmmode - \expandafter\mathpalette + \expandafter\mathpalette % (*) the only place where still use this \expandafter\!TsEnlargeMath \else \expandafter\!TsEnlargeOther @@ -1040,7 +1040,7 @@ \def\tabl_table_Smash {\relax \ifmmode - \expandafter\mathpalette + \expandafter\mathpalette % (*) \expandafter\!thDoMathVCS \else \expandafter\!thDoVCS @@ -1079,7 +1079,7 @@ \fi \!taDimenA\!thSign\!taDimenA\relax \ifmmode - \expandafter\mathpalette + \expandafter\mathpalette % (*) \expandafter\!thDoMathRaise \else \expandafter\!thDoSimpleRaise diff --git a/tex/context/base/mkxl/tabl-tbl.mkxl b/tex/context/base/mkxl/tabl-tbl.mkxl index 959ef4617..cd3d3d02d 100644 --- a/tex/context/base/mkxl/tabl-tbl.mkxl +++ b/tex/context/base/mkxl/tabl-tbl.mkxl @@ -1598,7 +1598,7 @@ \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_columns\relax \expandafter\NR \else - \expandafter\ignorespaces % interferes with the more tricky hooks + \expandafter\ignorepars % \ignorespaces % interferes with the more tricky hooks \fi} \protected\def\tabl_tabulate_set_quick#1% see \startlegend \startgiven (for the moment still public) @@ -1955,7 +1955,20 @@ \enforced\let\AR\NR \to \t_tabl_tabulate_initializers_first -\permanent\protected\def\tabl_tabulate_NR_common#1#2% +% \permanent\protected\def\tabl_tabulate_NR_common#1#2% +% {\global\advance\c_tabl_tabulate_noflines\plusone +% \global\setfalse\c_tabl_tabulate_firstflushed +% \global\setfalse\c_tabl_tabulate_equal +% \global\c_tabl_tabulate_column\zerocount +% \ifconditional#1\relax +% \tabl_tabulate_break_state_reset +% \fi +% \tabl_tabulate_pheight_reset +% \unskip\unskip\crcr\tabl_tabulate_flush_collected +% % can we omit the next one in the first run? probably +% \noalign{\the\t_tabl_tabulate_every_after_row#2}} + +\permanent\protected\def\tabl_tabulate_NR_common#1#2#.#3% #. gobbles pars and spaces {\global\advance\c_tabl_tabulate_noflines\plusone \global\setfalse\c_tabl_tabulate_firstflushed \global\setfalse\c_tabl_tabulate_equal @@ -1966,7 +1979,7 @@ \tabl_tabulate_pheight_reset \unskip\unskip\crcr\tabl_tabulate_flush_collected % can we omit the next one in the first run? probably - \noalign{\the\t_tabl_tabulate_every_after_row#2}} + \noalign{\the\t_tabl_tabulate_every_after_row#2}#3} \def\tabl_tabulate_check_penalties {\ifconditional\c_tabl_tabulate_tolerant_break\else @@ -2020,8 +2033,8 @@ \ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi % \begstrut % interferes with pre-\pars % evt: \appendtoks\begstrut\to\everypar - \ignorespaces \let\tabl_tabulate_eskip\tabl_tabulate_eskip_second + \expandafter\ignorepars % \ignorespaces \else % successive lines \let\tabl_tabulate_eskip\empty @@ -2054,7 +2067,7 @@ \ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi % \begstrut % interferes with pre-\pars % evt: \appendtoks\begstrut\to\everypar - \ignorespaces} + \ignorepars} % \ignorespaces \protected\def\tabl_tabulate_eskip_second_split_nop % vertical strut added august 2003 {\par\verticalstrut @@ -2902,7 +2915,7 @@ \ifcase\c_tabl_tabulate_column\or \tabl_register_row_background{#1}% \fi - \ignorespaces} + \ignorepars} % \ignorespaces \pushoverloadmode @@ -2913,7 +2926,7 @@ \ifcase\c_tabl_tabulate_column\or \tabl_register_row_background\m_table_current_row_background_default \fi - \ignorespaces} + \ignorepars} % \ignorespaces \popoverloadmode @@ -2923,7 +2936,7 @@ \tabl_register_row_background{#1}% \fi \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor - \ignorespaces} + \ignorepars} % \ignorespaces \permanent\protected\def\tabl_tabulate_DB_first {\tabl_tabulate_column_normal\plusone\zerocount\relax @@ -2932,21 +2945,21 @@ \fi \enforced\let\fontstyle\globalfontstyle \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor - \ignorespaces} + \ignorepars} % \ignorespaces \permanent\protected\def\tabl_tabulate_NF_first[#1]% {\tabl_tabulate_column_normal\zerocount\zerocount\relax \ifcase\c_tabl_tabulate_column\or \tabl_register_row_background_filler{#1}% \fi - \ignorespaces} + \ignorepars} % \ignorespaces \permanent\protected\def\tabl_tabulate_NP_first {\tabl_tabulate_column_normal\zerocount\zerocount\relax \ifcase\c_tabl_tabulate_column\or \tabl_register_row_background_filler\m_table_current_row_background_default_filler \fi - \ignorespaces} + \ignorepars} % \ignorespaces \permanent\protected\def\tabl_tabulate_FB_first[#1]% {\tabl_tabulate_column_normal\plusone\zerocount\relax @@ -2954,7 +2967,7 @@ \tabl_register_row_background_filler{#1}% \fi \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor - \ignorespaces} + \ignorepars} % \ignorespaces \permanent\protected\def\tabl_tabulate_PB_first {\tabl_tabulate_column_normal\plusone\zerocount\relax @@ -2963,7 +2976,7 @@ \fi \enforced\let\fontstyle\globalfontstyle \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor - \ignorespaces} + \ignorepars} % \ignorespaces \pushoverloadmode @@ -2999,7 +3012,7 @@ \iftrialtypesetting\orelse\ifcase\c_tabl_tabulate_column\or \tabl_tabulate_A_first \fi - \ignorespaces} + \ignorepars} % \ignorespaces \permanent\protected\def\tabl_tabulate_BA_first {\tabl_tabulate_column_normal\plusone\zerocount\relax @@ -3007,7 +3020,7 @@ \tabl_tabulate_A_first \fi \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor - \ignorespaces} + \ignorepars} % \ignorespaces \appendtoks \enforced\let\NL\tabl_tabulate_NL_first % NC with Line @@ -3065,7 +3078,7 @@ {\NC\loopcs{#1}\tabl_tabulate_span \gdef\tabl_tabulate_kooh{\begincsname\??tabulatespana#2\endcsname}% \begincsname\??tabulatespanb#2\endcsname - \ignorespaces} + \ignorepars} % \ignorespaces \appendtoks \enforced\let\NS\tabl_tabulate_NS diff --git a/tex/context/base/mkxl/toks-aux.lmt b/tex/context/base/mkxl/toks-aux.lmt index f1bac2093..e1d3fabf4 100644 --- a/tex/context/base/mkxl/toks-aux.lmt +++ b/tex/context/base/mkxl/toks-aux.lmt @@ -176,21 +176,22 @@ local function getthem(getter,post) return utilities.storage.allocate(table.swapped(codes,codes)) end -tex.discoptioncodes = getthem(tex.getdiscoptionvalues, "discoptioncode") -tex.flagcodes = getthem(tex.getflagvalues, "flagcode" ) -tex.frozenparcodes = getthem(tex.getfrozenparvalues, "frozenparcode") -tex.glyphoptioncodes = getthem(tex.getglyphoptionvalues, "glyphoptioncode") -tex.groupcodes = getthem(tex.getgroupvalues, "groupcode") -tex.hyphenationcodes = getthem(tex.gethyphenationvalues, "hyphenationcode") -tex.mathcontrolcodes = getthem(tex.getmathcontrolvalues, "mathcontrolcode") ----.mathflattencodes = getthem(tex.getmathflattenvalues, "mathflattencode") -tex.noadoptioncodes = getthem(tex.getnoadoptionvalues, "") -- only at lua end -tex.normalizecodes = getthem(tex.getnormalizevalues, "normalizecode") -tex.automigrationcodes = getthem(tex.getautomigrationvalues, "automigrationcode") -- only at lua end -tex.parcontextcodes = getthem(tex.getparcontextvalues, "parcontextcode") -tex.textcontrolcodes = getthem(tex.gettextcontrolvalues, "") -- only at lua end -tex.listanchorcodes = getthem(tex.getlistanchorvalues, "listanchorcode") -tex.listsigncodes = getthem(tex.getlistsignvalues, "listsigncode") +tex.discoptioncodes = getthem(tex.getdiscoptionvalues, "discoptioncode") +tex.flagcodes = getthem(tex.getflagvalues, "flagcode" ) +tex.frozenparcodes = getthem(tex.getfrozenparvalues, "frozenparcode") +tex.glyphoptioncodes = getthem(tex.getglyphoptionvalues, "glyphoptioncode") +tex.groupcodes = getthem(tex.getgroupvalues, "groupcode") +tex.hyphenationcodes = getthem(tex.gethyphenationvalues, "hyphenationcode") +tex.mathcontrolcodes = getthem(tex.getmathcontrolvalues, "mathcontrolcode") +---.mathflattencodes = getthem(tex.getmathflattenvalues, "mathflattencode") +tex.noadoptioncodes = getthem(tex.getnoadoptionvalues, "") -- only at lua end +tex.normalizecodes = getthem(tex.getnormalizevalues, "normalizecode") +tex.automigrationcodes = getthem(tex.getautomigrationvalues, "automigrationcode") -- only at lua end +tex.parcontextcodes = getthem(tex.getparcontextvalues, "parcontextcode") +tex.textcontrolcodes = getthem(tex.gettextcontrolvalues, "") -- only at lua end +tex.listanchorcodes = getthem(tex.getlistanchorvalues, "listanchorcode") +tex.listsigncodes = getthem(tex.getlistsignvalues, "listsigncode") +tex.classoptioncodes = getthem(tex.getmathclassoptionvalues, "classoptioncode") function tex.stringtocodesbitmap(str,codes) local bitmap = 0 diff --git a/tex/context/base/mkxl/trac-vis.lmt b/tex/context/base/mkxl/trac-vis.lmt index 57583bf3c..be30ce34b 100644 --- a/tex/context/base/mkxl/trac-vis.lmt +++ b/tex/context/base/mkxl/trac-vis.lmt @@ -1230,7 +1230,7 @@ local ruledstrut do setattr(current,a_layer,l_strut) head, current = insertnodeafter(head,current,new_kern(-strut_size)) end - return head, getnext(current) + return head, current end end diff --git a/tex/context/fonts/mkiv/asana-math.lfg b/tex/context/fonts/mkiv/asana-math.lfg index 0e8beb9e3..6177cb831 100644 --- a/tex/context/fonts/mkiv/asana-math.lfg +++ b/tex/context/fonts/mkiv/asana-math.lfg @@ -77,6 +77,17 @@ return { } }, -- { + -- tweak = "kerns", + -- list = { + -- [0x2F] = { + -- topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + -- bottomright = -0.2, + -- }, + -- }, + -- }, + -- { -- tweak = "fixprimes", -- factor = 0.85, -- scale = 0.65, diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg index af1df417d..1e96c7a6b 100644 --- a/tex/context/fonts/mkiv/bonum-math.lfg +++ b/tex/context/fonts/mkiv/bonum-math.lfg @@ -152,6 +152,17 @@ return { }, }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.15, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.15, + }, + }, + }, + { tweak = "fixprimes", -- scale = 0.8, -- smaller = true, diff --git a/tex/context/fonts/mkiv/cambria-math.lfg b/tex/context/fonts/mkiv/cambria-math.lfg index 4fe564cea..f73bc3ab7 100644 --- a/tex/context/fonts/mkiv/cambria-math.lfg +++ b/tex/context/fonts/mkiv/cambria-math.lfg @@ -94,6 +94,17 @@ return { }, }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, + { tweak = "fixprimes", scale = 0.9, -- smaller = true, @@ -122,6 +133,9 @@ return { { tweak = "addrules", }, + { + tweak = "wipecues", + }, }, }, bigslots = { diff --git a/tex/context/fonts/mkiv/concrete-math.lfg b/tex/context/fonts/mkiv/concrete-math.lfg index ecd910eb0..59ea0f2ea 100644 --- a/tex/context/fonts/mkiv/concrete-math.lfg +++ b/tex/context/fonts/mkiv/concrete-math.lfg @@ -17,6 +17,17 @@ return { -- tweak = "fixprimes", -- factor = 0.9, -- }, + { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, }, }, bigslots = { diff --git a/tex/context/fonts/mkiv/dejavu-math.lfg b/tex/context/fonts/mkiv/dejavu-math.lfg index 3c262fab5..01eaefd80 100644 --- a/tex/context/fonts/mkiv/dejavu-math.lfg +++ b/tex/context/fonts/mkiv/dejavu-math.lfg @@ -38,6 +38,17 @@ return { } }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, + { tweak = "fixprimes", -- scale = 0.9, -- smaller = true, @@ -55,6 +66,9 @@ return { { tweak = "addrules", }, + { + tweak = "wipecues", + }, }, }, alternates = { diff --git a/tex/context/fonts/mkiv/erewhon-math.lfg b/tex/context/fonts/mkiv/erewhon-math.lfg index d5b576f76..0924f7f13 100644 --- a/tex/context/fonts/mkiv/erewhon-math.lfg +++ b/tex/context/fonts/mkiv/erewhon-math.lfg @@ -16,6 +16,17 @@ return { tweaks = { aftercopying = { { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.15, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.15, + }, + }, + }, + { tweak = "fixprimes", factor = 0.9, scale = 0.9, diff --git a/tex/context/fonts/mkiv/garamond-math.lfg b/tex/context/fonts/mkiv/garamond-math.lfg index b002cc942..4c5eb5ba6 100644 --- a/tex/context/fonts/mkiv/garamond-math.lfg +++ b/tex/context/fonts/mkiv/garamond-math.lfg @@ -94,6 +94,17 @@ return { }, }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, + { tweak = "fixprimes", scale = 0.9, -- smaller = true, diff --git a/tex/context/fonts/mkiv/kpfonts-math.lfg b/tex/context/fonts/mkiv/kpfonts-math.lfg index 695a6af32..490b7b297 100644 --- a/tex/context/fonts/mkiv/kpfonts-math.lfg +++ b/tex/context/fonts/mkiv/kpfonts-math.lfg @@ -23,6 +23,17 @@ return { -- whatever }, }, + { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, -- { -- tweak = "fixprimes", -- factor = 0.85, -- accent base height diff --git a/tex/context/fonts/mkiv/libertinus-math.lfg b/tex/context/fonts/mkiv/libertinus-math.lfg index 3930ce8e2..2d683cc3c 100644 --- a/tex/context/fonts/mkiv/libertinus-math.lfg +++ b/tex/context/fonts/mkiv/libertinus-math.lfg @@ -61,6 +61,17 @@ return { }, }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.15, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.15, + }, + }, + }, + { tweak = "fixprimes", scale = 0.9, -- smaller = true, diff --git a/tex/context/fonts/mkiv/lm.lfg b/tex/context/fonts/mkiv/lm.lfg index 58db0e3a4..44ea14571 100644 --- a/tex/context/fonts/mkiv/lm.lfg +++ b/tex/context/fonts/mkiv/lm.lfg @@ -90,6 +90,17 @@ return { }, }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, + { tweak = "fixprimes", factor = 1.05, -- smaller = true, diff --git a/tex/context/fonts/mkiv/lucida-opentype-math.lfg b/tex/context/fonts/mkiv/lucida-opentype-math.lfg index 6dc6eef2a..72f4ca9e6 100644 --- a/tex/context/fonts/mkiv/lucida-opentype-math.lfg +++ b/tex/context/fonts/mkiv/lucida-opentype-math.lfg @@ -37,7 +37,7 @@ return { NoLimitSupFactor = 0, NoLimitSubFactor = 900, FractionRuleThickness = 55, - -- AccentBaseHeight = 650, + -- AccentBaseHeight = 650, AccentBaseDepth = 150, }, tweaks = { @@ -46,13 +46,13 @@ return { tweak = "version", expected = "Version 1.802", }, - { - tweak = "substitutes", - list = { - [0x2264] = "ss03", - [0x2265] = "ss03", - } - }, + -- { + -- tweak = "substitutes", + -- list = { + -- [0x2264] = "ss03", + -- [0x2265] = "ss03", + -- } + -- }, -- \definefontfeature[mathlucida][copymathscripts=yes] -- \definefontfeature[mathlucida][copymathscripts=yes,ss04=yes] -- 0xFEOO should be chancery style, if present @@ -79,12 +79,28 @@ return { ["0x23DD.parts.1"] = { xoffset = -0.075, depth = .8, yoffset = 0.2 }, ["0x23DD.parts.2"] = { depth = .8, yoffset = 0.2 }, ["0x23DD.parts.3"] = { xoffset = 0.075, depth = .8, yoffset = 0.2 }, + -- The < and > are slightly too small. We scale them by 867/795 + ["0x003C"] = { scale = 1.09057, width = 1.09057, height = 1.09057}, + ["0x003E"] = { scale = 1.09057, width = 1.09057, height = 1.09057}, + -- The = is too big if in ss03. We scale it by 795/867 (not working like this) + -- ["0x003D.ss03"] = { scale = 0.916955, width = 0.916955, height = 0.916955}, -- these are done later using the AccentBase* parameters -- [0x23DC] = { height = .2, yoffset = -0.8 }, -- [0x23DD] = { depth = .6, yoffset = 0.4 }, }, }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, + { tweak = "fixprimes", factor = 0.8, -- accent base height -- smaller = true, -- replace multiples diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg index db2f30a0a..d1e77e9bf 100644 --- a/tex/context/fonts/mkiv/pagella-math.lfg +++ b/tex/context/fonts/mkiv/pagella-math.lfg @@ -111,7 +111,19 @@ return { [0x1D712] = { 0.1, 1.2, 0.1 }, -- \chi [0x1D713] = { -0.05, 0.95, 0.1 }, -- \psi [0x1D71D] = { 0, 1, 0, 0.7 }, -- \varpi - }, + }, + }, + { + tweak = "kerns", + list = { + -- ["*:0x2F"] = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, }, { tweak = "fixprimes", diff --git a/tex/context/fonts/mkiv/schola-math.lfg b/tex/context/fonts/mkiv/schola-math.lfg index 33efb6892..cea6b501c 100644 --- a/tex/context/fonts/mkiv/schola-math.lfg +++ b/tex/context/fonts/mkiv/schola-math.lfg @@ -36,6 +36,17 @@ return { } }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, + { tweak = "fixprimes", scale = 0.85, -- smaller = true, diff --git a/tex/context/fonts/mkiv/stix-two-math.lfg b/tex/context/fonts/mkiv/stix-two-math.lfg index 6943e86ad..351c6a8ee 100644 --- a/tex/context/fonts/mkiv/stix-two-math.lfg +++ b/tex/context/fonts/mkiv/stix-two-math.lfg @@ -32,6 +32,17 @@ return { tweak = "version", expected = "Version 2.12 b168", }, + { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, -- 0xFEOO should be chancery style, if present { tweak = "variants", diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg index 2ad93c30b..45eaa0505 100644 --- a/tex/context/fonts/mkiv/termes-math.lfg +++ b/tex/context/fonts/mkiv/termes-math.lfg @@ -57,6 +57,17 @@ return { }, }, { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.2, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.2, + }, + }, + }, + { tweak = "fixprimes", scale = 0.85, -- smaller = true, diff --git a/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv b/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv index 00b9cb964..1c9788a98 100644 --- a/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv +++ b/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv @@ -49,8 +49,8 @@ \starttypescript [\s!math][newcomputermodern] [\s!name] % \loadfontgoodies[newcomputermodern-math] ,\s!goodies=newcomputermodern-math - \definefontsynonym[\s!MathRoman] [\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=newcomputermodern-math] - \definefontsynonym[\s!MathRomanBold][\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,newcomputermodern-math-bold,mathextra}\s!goodies=newcomputermodern-math] + \definefontsynonym[\s!MathRoman] [\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=lm] + \definefontsynonym[\s!MathRomanBold][\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,newcomputermodern-math-bold,mathextra}\s!goodies=lm] \stoptypescript \starttypescript [\s!serif] [newcomputermodern-book] [\s!name] diff --git a/tex/context/fonts/mkiv/xits-math.lfg b/tex/context/fonts/mkiv/xits-math.lfg index 6c4ac8b66..dfb0e54bb 100644 --- a/tex/context/fonts/mkiv/xits-math.lfg +++ b/tex/context/fonts/mkiv/xits-math.lfg @@ -21,6 +21,17 @@ return { tweak = "version", expected = "Version 1.302", }, + { + tweak = "kerns", + list = { + [0x2F] = { + topleft = -0.1, + -- bottomleft = 0, + -- topright = 0, + bottomright = -0.1, + }, + }, + }, -- 0xFEOO should be chancery style, if present { tweak = "variants", diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index ab4f8a66d..966b918c1 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-03-24 21:14 +-- merge date : 2022-04-01 09:33 do -- begin closure to overcome local limits and interference |