summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2023-01-15 14:50:04 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2023-01-15 14:50:04 +0100
commit0caec226a633182402b349c3ac5b3bf9e0bc76c2 (patch)
tree30524574e0b41eb771f5f9af8cadc60354652aa3
parent659b8f28e591006b6d0669c05d809d6ccf60cec0 (diff)
downloadcontext-0caec226a633182402b349c3ac5b3bf9e0bc76c2.tar.gz
2023-01-15 13:55:00
-rw-r--r--context/data/scite/context/lexers/data/scite-context-data-context.lua4
-rw-r--r--context/data/scite/context/lexers/data/scite-context-data-tex.lua4
-rw-r--r--context/data/scite/context/scite-context-data-context.properties185
-rw-r--r--context/data/scite/context/scite-context-data-tex.properties253
-rw-r--r--doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex12
-rw-r--r--doc/context/sources/general/manuals/math/math-notdone.tex23
-rw-r--r--doc/context/sources/general/manuals/musings/musings-speed.tex687
-rw-r--r--doc/context/sources/general/manuals/musings/musings.tex1
-rw-r--r--source/luametatex/source/lua/lmtinterface.c4
-rw-r--r--source/luametatex/source/lua/lmtinterface.h4
-rw-r--r--source/luametatex/source/lua/lmtnodelib.c21
-rw-r--r--source/luametatex/source/luametatex.h2
-rw-r--r--source/luametatex/source/luarest/lmtstrlibext.c69
-rw-r--r--source/luametatex/source/tex/texadjust.c321
-rw-r--r--source/luametatex/source/tex/texadjust.h49
-rw-r--r--source/luametatex/source/tex/texalign.c8
-rw-r--r--source/luametatex/source/tex/texbuildpage.c286
-rw-r--r--source/luametatex/source/tex/texcommands.c34
-rw-r--r--source/luametatex/source/tex/texcommands.h16
-rw-r--r--source/luametatex/source/tex/texconditional.c23
-rw-r--r--source/luametatex/source/tex/texconditional.h6
-rw-r--r--source/luametatex/source/tex/texdumpdata.h2
-rw-r--r--source/luametatex/source/tex/texequivalents.c13
-rw-r--r--source/luametatex/source/tex/texequivalents.h5
-rw-r--r--source/luametatex/source/tex/texexpand.c4
-rw-r--r--source/luametatex/source/tex/texlinebreak.c19
-rw-r--r--source/luametatex/source/tex/texlinebreak.h3
-rw-r--r--source/luametatex/source/tex/texmainbody.c17
-rw-r--r--source/luametatex/source/tex/texmaincontrol.c389
-rw-r--r--source/luametatex/source/tex/texmaincontrol.h2
-rw-r--r--source/luametatex/source/tex/texmath.c444
-rw-r--r--source/luametatex/source/tex/texmlist.c3
-rw-r--r--source/luametatex/source/tex/texnesting.c9
-rw-r--r--source/luametatex/source/tex/texnesting.h1
-rw-r--r--source/luametatex/source/tex/texnodes.h5
-rw-r--r--source/luametatex/source/tex/texpackaging.c236
-rw-r--r--source/luametatex/source/tex/texpackaging.h4
-rw-r--r--source/luametatex/source/tex/texrules.c4
-rw-r--r--source/luametatex/source/tex/texscanning.c86
-rw-r--r--source/luametatex/source/tex/textextcodes.c18
-rw-r--r--tex/context/base/mkii/anch-pos.mkii4
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-en.mkii3
-rw-r--r--tex/context/base/mkii/mult-fr.mkii2
-rw-r--r--tex/context/base/mkii/mult-nl.mkii3
-rw-r--r--tex/context/base/mkiv/anch-pos.lua2
-rw-r--r--tex/context/base/mkiv/anch-pos.mkiv4
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/export-example.css378
-rw-r--r--tex/context/base/mkiv/math-ini.mkiv16
-rw-r--r--tex/context/base/mkiv/mult-def.lua6
-rw-r--r--tex/context/base/mkiv/mult-low.lua98
-rw-r--r--tex/context/base/mkiv/mult-prm.lua11
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin24606 -> 24557 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin264792 -> 265035 bytes
-rw-r--r--tex/context/base/mkxl/anch-pos.lmt2
-rw-r--r--tex/context/base/mkxl/anch-pos.mkxl4
-rw-r--r--tex/context/base/mkxl/back-exp-imp-mth.lmt58
-rw-r--r--tex/context/base/mkxl/back-exp.lmt35
-rw-r--r--tex/context/base/mkxl/back-exp.mkxl1
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/core-uti.lmt76
-rw-r--r--tex/context/base/mkxl/font-ini.mklx3
-rw-r--r--tex/context/base/mkxl/font-mat.mklx20
-rw-r--r--tex/context/base/mkxl/lang-ini.mkxl2
-rw-r--r--tex/context/base/mkxl/lpdf-grp.lmt41
-rw-r--r--tex/context/base/mkxl/math-act.lmt18
-rw-r--r--tex/context/base/mkxl/math-dld.mklx107
-rw-r--r--tex/context/base/mkxl/math-fen.mkxl12
-rw-r--r--tex/context/base/mkxl/math-frc.mkxl144
-rw-r--r--tex/context/base/mkxl/math-ini.lmt98
-rw-r--r--tex/context/base/mkxl/math-ini.mkxl453
-rw-r--r--tex/context/base/mkxl/math-lop.mkxl33
-rw-r--r--tex/context/base/mkxl/math-spa.lmt7
-rw-r--r--tex/context/base/mkxl/math-stc.mklx12
-rw-r--r--tex/context/base/mkxl/math-tag.lmt83
-rw-r--r--tex/context/base/mkxl/mult-sys.mkxl2
-rw-r--r--tex/context/base/mkxl/node-ali.lmt68
-rw-r--r--tex/context/base/mkxl/node-mig.lmt1
-rw-r--r--tex/context/base/mkxl/page-brk.mkxl13
-rw-r--r--tex/context/base/mkxl/spac-ali.mkxl3
-rw-r--r--tex/context/base/mkxl/spac-prf.mklx54
-rw-r--r--tex/context/base/mkxl/strc-lst.lmt1512
-rw-r--r--tex/context/base/mkxl/strc-lst.mklx51
-rw-r--r--tex/context/base/mkxl/strc-mat.mkxl26
-rw-r--r--tex/context/base/mkxl/strc-ref.lmt13
-rw-r--r--tex/context/base/mkxl/syst-ini.mkxl23
-rw-r--r--tex/context/base/mkxl/tabl-tsp.mkxl4
-rw-r--r--tex/context/fonts/mkiv/bonum-math.lfg12
-rw-r--r--tex/context/fonts/mkiv/ebgaramond-math.lfg6
-rw-r--r--tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv31
-rw-r--r--tex/context/interface/mkii/keys-en.xml3
-rw-r--r--tex/context/interface/mkii/keys-fr.xml2
-rw-r--r--tex/context/interface/mkii/keys-nl.xml3
-rw-r--r--tex/context/modules/mkiv/s-fonts-tables.mkiv3
-rw-r--r--tex/context/modules/mkxl/m-oldmath.mkxl3
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
100 files changed, 4807 insertions, 2052 deletions
diff --git a/context/data/scite/context/lexers/data/scite-context-data-context.lua b/context/data/scite/context/lexers/data/scite-context-data-context.lua
index 8e390a3f3..35e35ddad 100644
--- a/context/data/scite/context/lexers/data/scite-context-data-context.lua
+++ b/context/data/scite/context/lexers/data/scite-context-data-context.lua
@@ -1,4 +1,4 @@
return {
- ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "pluseleven", "plustwelve", "plussixteen", "plusfifty", "plushundred", "plusonehundred", "plustwohundred", "plusfivehundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone", "maxiterator", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxcount", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "centeringskip", "stretchingskip", "shrinkingskip", "centeringfillskip", "stretchingfillskip", "shrinkingfillskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "binaryshiftedten", "binaryshiftedtwenty", "binaryshiftedthirty", "thickermuskip", "directionlefttoright", "directionrighttoleft", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "prerollrun", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "texenginefunctionality", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "contextformat", "contextversion", "contextlmtxmode", "contextmark", "mksuffix", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "statuswrite", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "ctdcatcodes", "rlncatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "commaasciicode", "spaceasciicode", "periodasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "leftparentasciicode", "rightparentasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode", "hsizefrozenparcode", "skipfrozenparcode", "hangfrozenparcode", "indentfrozenparcode", "parfillfrozenparcode", "adjustfrozenparcode", "protrudefrozenparcode", "tolerancefrozenparcode", "stretchfrozenparcode", "loosenessfrozenparcode", "lastlinefrozenparcode", "linepenaltyfrozenparcode", "clubpenaltyfrozenparcode", "widowpenaltyfrozenparcode", "displaypenaltyfrozenparcode", "brokenpenaltyfrozenparcode", "demeritsfrozenparcode", "shapefrozenparcode", "linefrozenparcode", "hyphenationfrozenparcode", "shapingpenaltyfrozenparcode", "orphanpenaltyfrozenparcode", "allfrozenparcode", "mathpenaltyfrozenparcode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vadjustgroupcode", "vcentergroupcode", "mathabovegroupcode", "mathchoicegroupcode", "alsosimplegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "localboxgroupcode", "splitoffgroupcode", "splitkeepgroupcode", "preamblegroupcode", "alignsetgroupcode", "finrowgroupcode", "discretionarygroupcode", "markautomigrationcode", "insertautomigrationcode", "adjustautomigrationcode", "preautomigrationcode", "postautomigrationcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "overrulemathcontrolcode", "underrulemathcontrolcode", "radicalrulemathcontrolcode", "fractionrulemathcontrolcode", "accentskewhalfmathcontrolcode", "accentskewapplymathcontrolcode", "applyordinarykernpairmathcontrolcode", "applyverticalitalickernmathcontrolcode", "applyordinaryitalickernmathcontrolcode", "applycharitalickernmathcontrolcode", "reboxcharitalickernmathcontrolcode", "applyboxeditalickernmathcontrolcode", "staircasekernmathcontrolcode", "applytextitalickernmathcontrolcode", "applyscriptitalickernmathcontrolcode", "checkspaceitalickernmathcontrolcode", "checktextitalickernmathcontrolcode", "analyzescriptnucleuscharmathcontrolcode", "analyzescriptnucleuslistmathcontrolcode", "analyzescriptnucleusboxmathcontrolcode", "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode", "extendaccentsmathcontrolcode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noleftkerningglyphoptioncode", "noleftligaturingglyphoptioncode", "norightkerningglyphoptioncode", "norightligaturingglyphoptioncode", "noitaliccorrectionglyphoptioncode", "islargeoperatorglyphoptioncode", "hasitalicshapeglyphoptioncode", "normalparcontextcode", "vmodeparcontextcode", "vboxparcontextcode", "vtopparcontextcode", "vcenterparcontextcode", "vadjustparcontextcode", "insertparcontextcode", "outputparcontextcode", "alignparcontextcode", "noalignparcontextcode", "spanparcontextcode", "resetparcontextcode", "leftoriginlistanchorcode", "leftheightlistanchorcode", "leftdepthlistanchorcode", "rightoriginlistanchorcode", "rightheightlistanchorcode", "rightdepthlistanchorcode", "centeroriginlistanchorcode", "centerheightlistanchorcode", "centerdepthlistanchorcode", "halfwaytotallistanchorcode", "halfwayheightlistanchorcode", "halfwaydepthlistanchorcode", "halfwayleftlistanchorcode", "halfwayrightlistanchorcode", "negatexlistsigncode", "negateylistsigncode", "negatelistsigncode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "mathexheight", "mathemwidth", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathaxisheight", "muquad", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifelsemode", "doifmodeelse", "doifnotmode", "startmodeset", "stopmodeset", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifelseallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument", "doifelsedocumentvariable", "doifdocumentvariableelse", "doifdocumentvariable", "doifnotdocumentvariable", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule", "setupmodule", "currentmoduleparameter", "moduleparameter", "everystarttext", "everystoptext", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "definemode", "globalenablemode", "globaldisablemode", "globalpreventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordinarycode", "mathordcode", "mathoperatorcode", "mathopcode", "mathbinarycode", "mathbincode", "mathrelationcode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctuationcode", "mathpunctcode", "mathovercode", "mathundercode", "mathinnercode", "mathradicalcode", "mathfractioncode", "mathmiddlecode", "mathaccentcode", "mathfencedcode", "mathghostcode", "mathvariablecode", "mathactivecode", "mathvcentercode", "mathconstructcode", "mathwrappedcode", "mathbegincode", "mathendcode", "mathexplicitcode", "mathdivisioncode", "mathfactorialcode", "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode", "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode", "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode", "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", "mathnumbergroupcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "luastringsep", "!!bs", "!!es", "lefttorightmark", "righttoleftmark", "lrm", "rlm", "bidilre", "bidirle", "bidipop", "bidilro", "bidirlo", "breakablethinspace", "nobreakspace", "nonbreakablespace", "narrownobreakspace", "zerowidthnobreakspace", "ideographicspace", "ideographichalffillspace", "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "enquad", "emquad", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj", "optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace", "Ux", "eUx", "Umathaccents", "parfillleftskip", "parfillrightskip", "startlmtxmode", "stoplmtxmode", "startmkivmode", "stopmkivmode", "wildcardsymbol", "normalhyphenationcode", "automatichyphenationcode", "explicithyphenationcode", "syllablehyphenationcode", "uppercasehyphenationcode", "collapsehyphenationcode", "compoundhyphenationcode", "strictstarthyphenationcode", "strictendhyphenationcode", "automaticpenaltyhyphenationcode", "explicitpenaltyhyphenationcode", "permitgluehyphenationcode", "permitallhyphenationcode", "permitmathreplacehyphenationcode", "forcecheckhyphenationcode", "lazyligatureshyphenationcode", "forcehandlerhyphenationcode", "feedbackcompoundhyphenationcode", "ignoreboundshyphenationcode", "partialhyphenationcode", "completehyphenationcode", "normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode", "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode", "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode", "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode", "nopreslackclassoptioncode", "nopostslackclassoptioncode", "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode", "lookaheadforendclassoptioncode", "noitaliccorrectionclassoptioncode", "defaultmathclassoptions", "checkligatureclassoptioncode", "checkitaliccorrectionclassoptioncode", "checkkernpairclassoptioncode", "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode", "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode", "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", "removeitaliccorrectionclassoptioncode", "operatoritaliccorrectionclassoptioncode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode", "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noitaliccorrectionglyphoptioncode", "nokerningcode", "noligaturingcode", "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode", "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode", "ordmathflattencode", "binmathflattencode", "relmathflattencode", "punctmathflattencode", "innermathflattencode", "normalworddiscoptioncode", "preworddiscoptioncode", "postworddiscoptioncode", "continueifinputfile", "continuewhenlmtxmode", "continuewhenmkivmode" },
- ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "startcontextdefinitioncode", "stopcontextdefinitioncode", "texdefinition", "doifelsesetups", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "fastsetup", "copysetups", "resetsetups", "doifelsecommandhandler", "doifcommandhandlerelse", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "globalsetmode", "globalresetmode", "globalsetsystemmode", "globalresetsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "newinteger", "newdimension", "newgluespec", "newmugluespec", "aliasinteger", "aliasdimension", "then", "begcsname", "autorule", "strippedcsname", "checkedstrippedcsname", "nofarguments", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthargumenttrue", "sixthargumentfalse", "sixthargumenttrue", "seventhargumentfalse", "seventhargumenttrue", "vkern", "hkern", "vpenalty", "hpenalty", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "untraceddonothing", "dontcomplain", "moreboxtracing", "lessboxtracing", "noboxtracing", "forgetall", "donetrue", "donefalse", "foundtrue", "foundfalse", "inlineordisplaymath", "indisplaymath", "forcedisplaymath", "startforceddisplaymath", "stopforceddisplaymath", "startpickupmath", "stoppickupmath", "reqno", "forceinlinemath", "mathortext", "thebox", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "hsplit", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilll", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "normalhfilllneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilll", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "normalvfilllneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruleddbox", "ruledvcenter", "ruledmbox", "ruledhpack", "ruledvpack", "ruledtpack", "ruleddpack", "ruledvsplit", "ruledtsplit", "ruleddsplit", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "filledhboxb", "filledhboxr", "filledhboxg", "filledhboxc", "filledhboxm", "filledhboxy", "filledhboxk", "scratchstring", "scratchstringone", "scratchstringtwo", "tempstring", "scratchcounter", "globalscratchcounter", "privatescratchcounter", "scratchdimen", "globalscratchdimen", "privatescratchdimen", "scratchskip", "globalscratchskip", "privatescratchskip", "scratchmuskip", "globalscratchmuskip", "privatescratchmuskip", "scratchtoks", "globalscratchtoks", "privatescratchtoks", "scratchbox", "globalscratchbox", "privatescratchbox", "scratchmacro", "scratchmacroone", "scratchmacrotwo", "scratchconditiontrue", "scratchconditionfalse", "ifscratchcondition", "scratchconditiononetrue", "scratchconditiononefalse", "ifscratchconditionone", "scratchconditiontwotrue", "scratchconditiontwofalse", "ifscratchconditiontwo", "globalscratchcounterone", "globalscratchcountertwo", "globalscratchcounterthree", "groupedcommand", "groupedcommandcs", "triggergroupedcommand", "triggergroupedcommandcs", "simplegroupedcommand", "simplegroupedcommandcs", "pickupgroupedcommand", "pickupgroupedcommandcs", "mathgroupedcommandcs", "usedbaselineskip", "usedlineskip", "usedlineskiplimit", "availablehsize", "localhsize", "setlocalhsize", "distributedhsize", "hsizefraction", "next", "nexttoken", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "flushnextbox", "boxisempty", "boxtostring", "contentostring", "prerolltostring", "givenwidth", "givenheight", "givendepth", "scangivendimensions", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchtotal", "scratchitalic", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchcounterfour", "scratchcounterfive", "scratchcountersix", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchdimenfour", "scratchdimenfive", "scratchdimensix", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchskipfour", "scratchskipfive", "scratchskipsix", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchmuskipfour", "scratchmuskipfive", "scratchmuskipsix", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchtoksfour", "scratchtoksfive", "scratchtokssix", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchboxfour", "scratchboxfive", "scratchboxsix", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchunicode", "scratchmin", "scratchmax", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "firstinset", "doifinset", "doifnotinset", "doifelseinset", "doifinsetelse", "doifelsenextchar", "doifnextcharelse", "doifelsenextcharcs", "doifnextcharcselse", "doifelsenextoptional", "doifnextoptionalelse", "doifelsenextoptionalcs", "doifnextoptionalcselse", "doifelsefastoptionalcheck", "doiffastoptionalcheckelse", "doifelsefastoptionalcheckcs", "doiffastoptionalcheckcselse", "doifelsenextbgroup", "doifnextbgroupelse", "doifelsenextbgroupcs", "doifnextbgroupcselse", "doifelsenextparenthesis", "doifnextparenthesiselse", "doifelseundefined", "doifundefinedelse", "doifelsedefined", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifnothingelse", "doifelsesomething", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifvaluenothingelse", "doifelsedimension", "doifdimensionelse", "doifelsenumber", "doifnumberelse", "doifnumber", "doifnotnumber", "doifelsecommon", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifelseinstring", "doifinstringelse", "doifelseassignment", "doifassignmentelse", "docheckassignment", "doifelseassignmentcs", "doifassignmentelsecs", "validassignment", "novalidassignment", "doiftext", "doifelsetext", "doiftextelse", "doifnottext", "quitcondition", "truecondition", "falsecondition", "tracingall", "tracingnone", "loggingall", "tracingcatcodes", "showluatokens", "aliasmacro", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "emspace", "charspace", "nbsp", "crlf", "obeyspaces", "obeylines", "obeytabs", "obeypages", "obeyedspace", "obeyedline", "obeyedtab", "obeyedpage", "normalspace", "naturalspace", "controlspace", "normalspaces", "ignoretabs", "ignorelines", "ignorepages", "ignoreeofs", "setcontrolspaces", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "removepunctuation", "ignoreparskip", "forcestrutdepth", "onlynonbreakablespace", "wait", "writestatus", "define", "defineexpandable", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "freezemeasure", "measure", "measured", "directmeasure", "setquantity", "setequantity", "setgquantity", "setxquantity", "definequantity", "freezequantity", "quantity", "quantitied", "directquantity", "installcorenamespace", "getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "setexpandeddummyparameter", "resetdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "firstoftwounexpanded", "secondoftwounexpanded", "firstofthreeunexpanded", "secondofthreeunexpanded", "thirdofthreeunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "fastloopindex", "fastloopfinal", "dowith", "doloopovermatch", "doloopovermatched", "doloopoverlist", "newconstant", "setnewconstant", "setconstant", "setconstantvalue", "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "setconditional", "newmacro", "setnewmacro", "newfraction", "newsignal", "newboundary", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "permitspacesbetweengroups", "dontpermitspacesbetweengroups", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "onlypdfobjectcompression", "nopdfobjectcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doifelsefirstchar", "doiffirstcharelse", "mathclassvalue", "startnointerference", "stopnointerference", "twodigits", "threedigits", "leftorright", "offinterlineskip", "oninterlineskip", "nointerlineskip", "strut", "halfstrut", "quarterstrut", "depthstrut", "halflinestrut", "noheightstrut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "strutgap", "begstrut", "endstrut", "lineheight", "leftboundary", "rightboundary", "signalcharacter", "aligncontentleft", "aligncontentmiddle", "aligncontentright", "shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox", "ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing", "ordopenspacing", "ordclosespacing", "ordpunctspacing", "ordinnerspacing", "ordfracspacing", "ordradspacing", "ordmiddlespacing", "ordaccentspacing", "opordspacing", "opopspacing", "opbinspacing", "oprelspacing", "opopenspacing", "opclosespacing", "oppunctspacing", "opinnerspacing", "opfracspacing", "opradspacing", "opmiddlespacing", "opaccentspacing", "binordspacing", "binopspacing", "binbinspacing", "binrelspacing", "binopenspacing", "binclosespacing", "binpunctspacing", "bininnerspacing", "binfracspacing", "binradspacing", "binmiddlespacing", "binaccentspacing", "relordspacing", "relopspacing", "relbinspacing", "relrelspacing", "relopenspacing", "relclosespacing", "relpunctspacing", "relinnerspacing", "relfracspacing", "relradspacing", "relmiddlespacing", "relaccentspacing", "openordspacing", "openopspacing", "openbinspacing", "openrelspacing", "openopenspacing", "openclosespacing", "openpunctspacing", "openinnerspacing", "openfracspacing", "openradspacing", "openmiddlespacing", "openaccentspacing", "closeordspacing", "closeopspacing", "closebinspacing", "closerelspacing", "closeopenspacing", "closeclosespacing", "closepunctspacing", "closeinnerspacing", "closefracspacing", "closeradspacing", "closemiddlespacing", "closeaccentspacing", "punctordspacing", "punctopspacing", "punctbinspacing", "punctrelspacing", "punctopenspacing", "punctclosespacing", "punctpunctspacing", "punctinnerspacing", "punctfracspacing", "punctradspacing", "punctmiddlespacing", "punctaccentspacing", "innerordspacing", "inneropspacing", "innerbinspacing", "innerrelspacing", "inneropenspacing", "innerclosespacing", "innerpunctspacing", "innerinnerspacing", "innerfracspacing", "innerradspacing", "innermiddlespacing", "inneraccentspacing", "fracordspacing", "fracopspacing", "fracbinspacing", "fracrelspacing", "fracopenspacing", "fracclosespacing", "fracpunctspacing", "fracinnerspacing", "fracfracspacing", "fracradspacing", "fracmiddlespacing", "fracaccentspacing", "radordspacing", "radopspacing", "radbinspacing", "radrelspacing", "radopenspacing", "radclosespacing", "radpunctspacing", "radinnerspacing", "radfracspacing", "radradspacing", "radmiddlespacing", "radaccentspacing", "middleordspacing", "middleopspacing", "middlebinspacing", "middlerelspacing", "middleopenspacing", "middleclosespacing", "middlepunctspacing", "middleinnerspacing", "middlefracspacing", "middleradspacing", "middlemiddlespacing", "middleaccentspacing", "accentordspacing", "accentopspacing", "accentbinspacing", "accentrelspacing", "accentopenspacing", "accentclosespacing", "accentpunctspacing", "accentinnerspacing", "accentfracspacing", "accentradspacing", "accentmiddlespacing", "accentaccentspacing", "normalreqno", "startimath", "stopimath", "normalstartimath", "normalstopimath", "startdmath", "stopdmath", "normalstartdmath", "normalstopdmath", "normalsuperscript", "normalsubscript", "normalnosuperscript", "normalnosubscript", "normalprimescript", "superscript", "subscript", "nosuperscript", "nosubscript", "primescript", "superprescript", "subprescript", "nosuperprescript", "nosubsprecript", "uncramped", "cramped", "mathstyletrigger", "triggermathstyle", "triggeredmathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette", "mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox", "mathtext", "setmathsmalltextbox", "setmathtextbox", "pushmathstyle", "popmathstyle", "triggerdisplaystyle", "triggertextstyle", "triggerscriptstyle", "triggerscriptscriptstyle", "triggeruncrampedstyle", "triggercrampedstyle", "triggersmallstyle", "triggeruncrampedsmallstyle", "triggercrampedsmallstyle", "triggerbigstyle", "triggeruncrampedbigstyle", "triggercrampedbigstyle", "luaexpr", "expelsedoif", "expdoif", "expdoifnot", "expdoifelsecommon", "expdoifcommonelse", "expdoifelseinset", "expdoifinsetelse", "ctxdirectlua", "ctxlatelua", "ctxsprint", "ctxwrite", "ctxcommand", "ctxdirectcommand", "ctxlatecommand", "ctxreport", "ctxlua", "luacode", "lateluacode", "directluacode", "registerctxluafile", "ctxloadluafile", "luaversion", "luamajorversion", "luaminorversion", "ctxluacode", "luaconditional", "luaexpanded", "ctxluamatch", "startluaparameterset", "stopluaparameterset", "luaparameterset", "definenamedlua", "obeylualines", "obeyluatokens", "startluacode", "stopluacode", "startlua", "stoplua", "startctxfunction", "stopctxfunction", "ctxfunction", "startctxfunctiondefinition", "stopctxfunctiondefinition", "installctxfunction", "installprotectedctxfunction", "installprotectedctxscanner", "installctxscanner", "resetctxscanner", "cldprocessfile", "cldloadfile", "cldloadviafile", "cldcontext", "cldcommand", "carryoverpar", "freezeparagraphproperties", "defrostparagraphproperties", "setparagraphfreezing", "forgetparagraphfreezing", "updateparagraphproperties", "updateparagraphpenalties", "updateparagraphdemerits", "updateparagraphshapes", "updateparagraphlines", "lastlinewidth", "assumelongusagecs", "Umathbottomaccent", "Umathtopaccent", "Umathbotaccent", "righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop", "rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop", "autodirhbox", "autodirvbox", "autodirvtop", "leftorrighthbox", "leftorrightvbox", "leftorrightvtop", "lefttoright", "righttoleft", "checkedlefttoright", "checkedrighttoleft", "synchronizelayoutdirection", "synchronizedisplaydirection", "synchronizeinlinedirection", "dirlre", "dirrle", "dirlro", "dirrlo", "rtltext", "ltrtext", "lesshyphens", "morehyphens", "nohyphens", "dohyphens", "dohyphencollapsing", "nohyphencollapsing", "compounddiscretionary", "Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath", "break", "nobreak", "allowbreak", "goodbreak", "nospace", "nospacing", "dospacing", "naturalhbox", "naturalvbox", "naturalvtop", "naturalhpack", "naturalvpack", "naturaltpack", "reversehbox", "reversevbox", "reversevtop", "reversehpack", "reversevpack", "reversetpack", "hcontainer", "vcontainer", "tcontainer", "frule", "compoundhyphenpenalty", "start", "stop", "unsupportedcs", "openout", "closeout", "write", "openin", "closein", "read", "readline", "readfromterminal", "boxlines", "boxline", "setboxline", "copyboxline", "boxlinewd", "boxlineht", "boxlinedp", "boxlinenw", "boxlinenh", "boxlinend", "boxlinels", "boxliners", "boxlinelh", "boxlinerh", "boxlinelp", "boxlinerp", "boxlinein", "boxrangewd", "boxrangeht", "boxrangedp", "bitwiseset", "bitwiseand", "bitwiseor", "bitwisexor", "bitwisenot", "bitwisenil", "ifbitwiseand", "bitwise", "bitwiseshift", "bitwiseflip", "textdir", "linedir", "pardir", "boxdir", "prelistbox", "postlistbox", "prelistcopy", "postlistcopy", "setprelistbox", "setpostlistbox", "noligaturing", "nokerning", "noexpansion", "noprotrusion", "noleftkerning", "noleftligaturing", "norightkerning", "norightligaturing", "noitaliccorrection", "futureletnexttoken", "defbackslashbreak", "letbackslashbreak", "pushoverloadmode", "popoverloadmode", "pushrunstate", "poprunstate", "suggestedalias", "showboxhere", "discoptioncodestring", "flagcodestring", "frozenparcodestring", "glyphoptioncodestring", "groupcodestring", "hyphenationcodestring", "mathcontrolcodestring", "mathflattencodestring", "normalizecodestring", "parcontextcodestring", "newlocalcount", "newlocaldimen", "newlocalskip", "newlocalmuskip", "newlocaltoks", "newlocalbox", "newlocalwrite", "newlocalread", "setnewlocalcount", "setnewlocaldimen", "setnewlocalskip", "setnewlocalmuskip", "setnewlocaltoks", "setnewlocalbox", "ifexpression" },
+ ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "pluseleven", "plustwelve", "plussixteen", "plusfifty", "plushundred", "plusonehundred", "plustwohundred", "plusfivehundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone", "maxiterator", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxcount", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "centeringskip", "stretchingskip", "shrinkingskip", "centeringfillskip", "stretchingfillskip", "shrinkingfillskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "binaryshiftedten", "binaryshiftedtwenty", "binaryshiftedthirty", "thickermuskip", "directionlefttoright", "directionrighttoleft", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "prerollrun", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "texenginefunctionality", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "contextformat", "contextversion", "contextlmtxmode", "contextmark", "mksuffix", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "statuswrite", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "ctdcatcodes", "rlncatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "commaasciicode", "spaceasciicode", "periodasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "leftparentasciicode", "rightparentasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode", "hsizefrozenparcode", "skipfrozenparcode", "hangfrozenparcode", "indentfrozenparcode", "parfillfrozenparcode", "adjustfrozenparcode", "protrudefrozenparcode", "tolerancefrozenparcode", "stretchfrozenparcode", "loosenessfrozenparcode", "lastlinefrozenparcode", "linepenaltyfrozenparcode", "clubpenaltyfrozenparcode", "widowpenaltyfrozenparcode", "displaypenaltyfrozenparcode", "brokenpenaltyfrozenparcode", "demeritsfrozenparcode", "shapefrozenparcode", "linefrozenparcode", "hyphenationfrozenparcode", "shapingpenaltyfrozenparcode", "orphanpenaltyfrozenparcode", "allfrozenparcode", "mathpenaltyfrozenparcode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vadjustgroupcode", "vcentergroupcode", "mathabovegroupcode", "mathchoicegroupcode", "alsosimplegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "localboxgroupcode", "splitoffgroupcode", "splitkeepgroupcode", "preamblegroupcode", "alignsetgroupcode", "finrowgroupcode", "discretionarygroupcode", "markautomigrationcode", "insertautomigrationcode", "adjustautomigrationcode", "preautomigrationcode", "postautomigrationcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "overrulemathcontrolcode", "underrulemathcontrolcode", "radicalrulemathcontrolcode", "fractionrulemathcontrolcode", "accentskewhalfmathcontrolcode", "accentskewapplymathcontrolcode", "applyordinarykernpairmathcontrolcode", "applyverticalitalickernmathcontrolcode", "applyordinaryitalickernmathcontrolcode", "applycharitalickernmathcontrolcode", "reboxcharitalickernmathcontrolcode", "applyboxeditalickernmathcontrolcode", "staircasekernmathcontrolcode", "applytextitalickernmathcontrolcode", "applyscriptitalickernmathcontrolcode", "checkspaceitalickernmathcontrolcode", "checktextitalickernmathcontrolcode", "analyzescriptnucleuscharmathcontrolcode", "analyzescriptnucleuslistmathcontrolcode", "analyzescriptnucleusboxmathcontrolcode", "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode", "extendaccentsmathcontrolcode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noleftkerningglyphoptioncode", "noleftligaturingglyphoptioncode", "norightkerningglyphoptioncode", "norightligaturingglyphoptioncode", "noitaliccorrectionglyphoptioncode", "islargeoperatorglyphoptioncode", "hasitalicshapeglyphoptioncode", "normalparcontextcode", "vmodeparcontextcode", "vboxparcontextcode", "vtopparcontextcode", "vcenterparcontextcode", "vadjustparcontextcode", "insertparcontextcode", "outputparcontextcode", "alignparcontextcode", "noalignparcontextcode", "spanparcontextcode", "resetparcontextcode", "leftoriginlistanchorcode", "leftheightlistanchorcode", "leftdepthlistanchorcode", "rightoriginlistanchorcode", "rightheightlistanchorcode", "rightdepthlistanchorcode", "centeroriginlistanchorcode", "centerheightlistanchorcode", "centerdepthlistanchorcode", "halfwaytotallistanchorcode", "halfwayheightlistanchorcode", "halfwaydepthlistanchorcode", "halfwayleftlistanchorcode", "halfwayrightlistanchorcode", "negatexlistsigncode", "negateylistsigncode", "negatelistsigncode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "mathexheight", "mathemwidth", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathaxisheight", "muquad", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifelsemode", "doifmodeelse", "doifnotmode", "startmodeset", "stopmodeset", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifelseallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument", "doifelsedocumentvariable", "doifdocumentvariableelse", "doifdocumentvariable", "doifnotdocumentvariable", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule", "setupmodule", "currentmoduleparameter", "moduleparameter", "everystarttext", "everystoptext", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "definemode", "globalenablemode", "globaldisablemode", "globalpreventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordinarycode", "mathordcode", "mathoperatorcode", "mathopcode", "mathbinarycode", "mathbincode", "mathrelationcode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctuationcode", "mathpunctcode", "mathovercode", "mathundercode", "mathinnercode", "mathradicalcode", "mathfractioncode", "mathmiddlecode", "mathaccentcode", "mathfencedcode", "mathghostcode", "mathvariablecode", "mathactivecode", "mathvcentercode", "mathconstructcode", "mathwrappedcode", "mathbegincode", "mathendcode", "mathexplicitcode", "mathdivisioncode", "mathfactorialcode", "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode", "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode", "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode", "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", "mathnumbergroupcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "luastringsep", "!!bs", "!!es", "lefttorightmark", "righttoleftmark", "lrm", "rlm", "bidilre", "bidirle", "bidipop", "bidilro", "bidirlo", "breakablethinspace", "nobreakspace", "nonbreakablespace", "narrownobreakspace", "zerowidthnobreakspace", "ideographicspace", "ideographichalffillspace", "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "enquad", "emquad", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj", "optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace", "Ux", "eUx", "parfillleftskip", "parfillrightskip", "startlmtxmode", "stoplmtxmode", "startmkivmode", "stopmkivmode", "wildcardsymbol", "normalhyphenationcode", "automatichyphenationcode", "explicithyphenationcode", "syllablehyphenationcode", "uppercasehyphenationcode", "collapsehyphenationcode", "compoundhyphenationcode", "strictstarthyphenationcode", "strictendhyphenationcode", "automaticpenaltyhyphenationcode", "explicitpenaltyhyphenationcode", "permitgluehyphenationcode", "permitallhyphenationcode", "permitmathreplacehyphenationcode", "forcecheckhyphenationcode", "lazyligatureshyphenationcode", "forcehandlerhyphenationcode", "feedbackcompoundhyphenationcode", "ignoreboundshyphenationcode", "partialhyphenationcode", "completehyphenationcode", "normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode", "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode", "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode", "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode", "nopreslackclassoptioncode", "nopostslackclassoptioncode", "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode", "lookaheadforendclassoptioncode", "noitaliccorrectionclassoptioncode", "defaultmathclassoptions", "checkligatureclassoptioncode", "checkitaliccorrectionclassoptioncode", "checkkernpairclassoptioncode", "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode", "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode", "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", "removeitaliccorrectionclassoptioncode", "operatoritaliccorrectionclassoptioncode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode", "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noitaliccorrectionglyphoptioncode", "nokerningcode", "noligaturingcode", "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode", "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode", "ordmathflattencode", "binmathflattencode", "relmathflattencode", "punctmathflattencode", "innermathflattencode", "normalworddiscoptioncode", "preworddiscoptioncode", "postworddiscoptioncode", "continueifinputfile", "continuewhenlmtxmode", "continuewhenmkivmode" },
+ ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "startcontextdefinitioncode", "stopcontextdefinitioncode", "texdefinition", "doifelsesetups", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "fastsetup", "copysetups", "resetsetups", "doifelsecommandhandler", "doifcommandhandlerelse", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "globalsetmode", "globalresetmode", "globalsetsystemmode", "globalresetsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "newinteger", "newdimension", "newgluespec", "newmugluespec", "aliasinteger", "aliasdimension", "then", "begcsname", "autorule", "strippedcsname", "checkedstrippedcsname", "nofarguments", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthargumenttrue", "sixthargumentfalse", "sixthargumenttrue", "seventhargumentfalse", "seventhargumenttrue", "vkern", "hkern", "vpenalty", "hpenalty", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "untraceddonothing", "dontcomplain", "moreboxtracing", "lessboxtracing", "noboxtracing", "forgetall", "donetrue", "donefalse", "foundtrue", "foundfalse", "inlineordisplaymath", "indisplaymath", "forcedisplaymath", "startforceddisplaymath", "stopforceddisplaymath", "startpickupmath", "stoppickupmath", "reqno", "forceinlinemath", "mathortext", "thebox", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "hsplit", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilll", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "normalhfilllneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilll", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "normalvfilllneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruleddbox", "ruledvcenter", "ruledmbox", "ruledhpack", "ruledvpack", "ruledtpack", "ruleddpack", "ruledvsplit", "ruledtsplit", "ruleddsplit", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "filledhboxb", "filledhboxr", "filledhboxg", "filledhboxc", "filledhboxm", "filledhboxy", "filledhboxk", "scratchstring", "scratchstringone", "scratchstringtwo", "tempstring", "scratchcounter", "globalscratchcounter", "privatescratchcounter", "scratchdimen", "globalscratchdimen", "privatescratchdimen", "scratchskip", "globalscratchskip", "privatescratchskip", "scratchmuskip", "globalscratchmuskip", "privatescratchmuskip", "scratchtoks", "globalscratchtoks", "privatescratchtoks", "scratchbox", "globalscratchbox", "privatescratchbox", "scratchmacro", "scratchmacroone", "scratchmacrotwo", "scratchconditiontrue", "scratchconditionfalse", "ifscratchcondition", "scratchconditiononetrue", "scratchconditiononefalse", "ifscratchconditionone", "scratchconditiontwotrue", "scratchconditiontwofalse", "ifscratchconditiontwo", "globalscratchcounterone", "globalscratchcountertwo", "globalscratchcounterthree", "groupedcommand", "groupedcommandcs", "triggergroupedcommand", "triggergroupedcommandcs", "simplegroupedcommand", "simplegroupedcommandcs", "pickupgroupedcommand", "pickupgroupedcommandcs", "mathgroupedcommandcs", "usedbaselineskip", "usedlineskip", "usedlineskiplimit", "availablehsize", "localhsize", "setlocalhsize", "distributedhsize", "hsizefraction", "next", "nexttoken", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "flushnextbox", "boxisempty", "boxtostring", "contentostring", "prerolltostring", "givenwidth", "givenheight", "givendepth", "scangivendimensions", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchtotal", "scratchitalic", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchcounterfour", "scratchcounterfive", "scratchcountersix", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchdimenfour", "scratchdimenfive", "scratchdimensix", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchskipfour", "scratchskipfive", "scratchskipsix", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchmuskipfour", "scratchmuskipfive", "scratchmuskipsix", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchtoksfour", "scratchtoksfive", "scratchtokssix", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchboxfour", "scratchboxfive", "scratchboxsix", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchunicode", "scratchmin", "scratchmax", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "firstinset", "doifinset", "doifnotinset", "doifelseinset", "doifinsetelse", "doifelsenextchar", "doifnextcharelse", "doifelsenextcharcs", "doifnextcharcselse", "doifelsenextoptional", "doifnextoptionalelse", "doifelsenextoptionalcs", "doifnextoptionalcselse", "doifelsefastoptionalcheck", "doiffastoptionalcheckelse", "doifelsefastoptionalcheckcs", "doiffastoptionalcheckcselse", "doifelsenextbgroup", "doifnextbgroupelse", "doifelsenextbgroupcs", "doifnextbgroupcselse", "doifelsenextparenthesis", "doifnextparenthesiselse", "doifelseundefined", "doifundefinedelse", "doifelsedefined", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifnothingelse", "doifelsesomething", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifvaluenothingelse", "doifelsedimension", "doifdimensionelse", "doifelsenumber", "doifnumberelse", "doifnumber", "doifnotnumber", "doifelsecommon", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifelseinstring", "doifinstringelse", "doifelseassignment", "doifassignmentelse", "docheckassignment", "doifelseassignmentcs", "doifassignmentelsecs", "validassignment", "novalidassignment", "doiftext", "doifelsetext", "doiftextelse", "doifnottext", "quitcondition", "truecondition", "falsecondition", "tracingall", "tracingnone", "loggingall", "tracingcatcodes", "showluatokens", "aliasmacro", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "emspace", "charspace", "nbsp", "crlf", "obeyspaces", "obeylines", "obeytabs", "obeypages", "obeyedspace", "obeyedline", "obeyedtab", "obeyedpage", "normalspace", "naturalspace", "controlspace", "normalspaces", "ignoretabs", "ignorelines", "ignorepages", "ignoreeofs", "setcontrolspaces", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "removepunctuation", "ignoreparskip", "forcestrutdepth", "onlynonbreakablespace", "wait", "writestatus", "define", "defineexpandable", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "freezemeasure", "measure", "measured", "directmeasure", "setquantity", "setequantity", "setgquantity", "setxquantity", "definequantity", "freezequantity", "quantity", "quantitied", "directquantity", "installcorenamespace", "getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "setexpandeddummyparameter", "resetdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "firstoftwounexpanded", "secondoftwounexpanded", "firstofthreeunexpanded", "secondofthreeunexpanded", "thirdofthreeunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "fastloopindex", "fastloopfinal", "dowith", "doloopovermatch", "doloopovermatched", "doloopoverlist", "newconstant", "setnewconstant", "setconstant", "setconstantvalue", "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "setconditional", "newmacro", "setnewmacro", "newfraction", "newsignal", "newboundary", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "permitspacesbetweengroups", "dontpermitspacesbetweengroups", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "onlypdfobjectcompression", "nopdfobjectcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doifelsefirstchar", "doiffirstcharelse", "mathclassvalue", "startnointerference", "stopnointerference", "twodigits", "threedigits", "leftorright", "offinterlineskip", "oninterlineskip", "nointerlineskip", "strut", "halfstrut", "quarterstrut", "depthstrut", "halflinestrut", "noheightstrut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "strutgap", "begstrut", "endstrut", "lineheight", "leftboundary", "rightboundary", "signalcharacter", "aligncontentleft", "aligncontentmiddle", "aligncontentright", "shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox", "normalreqno", "startimath", "stopimath", "normalstartimath", "normalstopimath", "startdmath", "stopdmath", "normalstartdmath", "normalstopdmath", "normalsuperscript", "normalsubscript", "normalnosuperscript", "normalnosubscript", "normalprimescript", "superscript", "subscript", "nosuperscript", "nosubscript", "primescript", "superprescript", "subprescript", "nosuperprescript", "nosubsprecript", "uncramped", "cramped", "mathstyletrigger", "triggermathstyle", "triggeredmathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette", "mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox", "mathtext", "setmathsmalltextbox", "setmathtextbox", "pushmathstyle", "popmathstyle", "triggerdisplaystyle", "triggertextstyle", "triggerscriptstyle", "triggerscriptscriptstyle", "triggeruncrampedstyle", "triggercrampedstyle", "triggersmallstyle", "triggeruncrampedsmallstyle", "triggercrampedsmallstyle", "triggerbigstyle", "triggeruncrampedbigstyle", "triggercrampedbigstyle", "luaexpr", "expelsedoif", "expdoif", "expdoifnot", "expdoifelsecommon", "expdoifcommonelse", "expdoifelseinset", "expdoifinsetelse", "ctxdirectlua", "ctxlatelua", "ctxsprint", "ctxwrite", "ctxcommand", "ctxdirectcommand", "ctxlatecommand", "ctxreport", "ctxlua", "luacode", "lateluacode", "directluacode", "registerctxluafile", "ctxloadluafile", "luaversion", "luamajorversion", "luaminorversion", "ctxluacode", "luaconditional", "luaexpanded", "ctxluamatch", "startluaparameterset", "stopluaparameterset", "luaparameterset", "definenamedlua", "obeylualines", "obeyluatokens", "startluacode", "stopluacode", "startlua", "stoplua", "startctxfunction", "stopctxfunction", "ctxfunction", "startctxfunctiondefinition", "stopctxfunctiondefinition", "installctxfunction", "installprotectedctxfunction", "installprotectedctxscanner", "installctxscanner", "resetctxscanner", "cldprocessfile", "cldloadfile", "cldloadviafile", "cldcontext", "cldcommand", "carryoverpar", "freezeparagraphproperties", "defrostparagraphproperties", "setparagraphfreezing", "forgetparagraphfreezing", "updateparagraphproperties", "updateparagraphpenalties", "updateparagraphdemerits", "updateparagraphshapes", "updateparagraphlines", "lastlinewidth", "assumelongusagecs", "righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop", "rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop", "autodirhbox", "autodirvbox", "autodirvtop", "leftorrighthbox", "leftorrightvbox", "leftorrightvtop", "lefttoright", "righttoleft", "checkedlefttoright", "checkedrighttoleft", "synchronizelayoutdirection", "synchronizedisplaydirection", "synchronizeinlinedirection", "dirlre", "dirrle", "dirlro", "dirrlo", "rtltext", "ltrtext", "lesshyphens", "morehyphens", "nohyphens", "dohyphens", "dohyphencollapsing", "nohyphencollapsing", "compounddiscretionary", "Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath", "break", "nobreak", "allowbreak", "goodbreak", "nospace", "nospacing", "dospacing", "naturalhbox", "naturalvbox", "naturalvtop", "naturalhpack", "naturalvpack", "naturaltpack", "reversehbox", "reversevbox", "reversevtop", "reversehpack", "reversevpack", "reversetpack", "hcontainer", "vcontainer", "tcontainer", "frule", "compoundhyphenpenalty", "start", "stop", "unsupportedcs", "openout", "closeout", "write", "openin", "closein", "read", "readline", "readfromterminal", "boxlines", "boxline", "setboxline", "copyboxline", "boxlinewd", "boxlineht", "boxlinedp", "boxlinenw", "boxlinenh", "boxlinend", "boxlinels", "boxliners", "boxlinelh", "boxlinerh", "boxlinelp", "boxlinerp", "boxlinein", "boxrangewd", "boxrangeht", "boxrangedp", "bitwiseset", "bitwiseand", "bitwiseor", "bitwisexor", "bitwisenot", "bitwisenil", "ifbitwiseand", "bitwise", "bitwiseshift", "bitwiseflip", "textdir", "linedir", "pardir", "boxdir", "prelistbox", "postlistbox", "prelistcopy", "postlistcopy", "setprelistbox", "setpostlistbox", "noligaturing", "nokerning", "noexpansion", "noprotrusion", "noleftkerning", "noleftligaturing", "norightkerning", "norightligaturing", "noitaliccorrection", "futureletnexttoken", "defbackslashbreak", "letbackslashbreak", "pushoverloadmode", "popoverloadmode", "pushrunstate", "poprunstate", "suggestedalias", "showboxhere", "discoptioncodestring", "flagcodestring", "frozenparcodestring", "glyphoptioncodestring", "groupcodestring", "hyphenationcodestring", "mathcontrolcodestring", "mathflattencodestring", "normalizecodestring", "parcontextcodestring", "newlocalcount", "newlocaldimen", "newlocalskip", "newlocalmuskip", "newlocaltoks", "newlocalbox", "newlocalwrite", "newlocalread", "setnewlocalcount", "setnewlocaldimen", "setnewlocalskip", "setnewlocalmuskip", "setnewlocaltoks", "setnewlocalbox", "ifexpression" },
} \ No newline at end of file
diff --git a/context/data/scite/context/lexers/data/scite-context-data-tex.lua b/context/data/scite/context/lexers/data/scite-context-data-tex.lua
index 69796d04d..304124df5 100644
--- a/context/data/scite/context/lexers/data/scite-context-data-tex.lua
+++ b/context/data/scite/context/lexers/data/scite-context-data-tex.lua
@@ -1,9 +1,9 @@
return {
["aleph"]={ "Alephminorversion", "Alephrevision", "Alephversion" },
["etex"]={ "botmarks", "clubpenalties", "currentgrouplevel", "currentgrouptype", "currentifbranch", "currentiflevel", "currentiftype", "detokenize", "dimexpr", "displaywidowpenalties", "everyeof", "firstmarks", "fontchardp", "fontcharht", "fontcharic", "fontcharwd", "glueexpr", "glueshrink", "glueshrinkorder", "gluestretch", "gluestretchorder", "gluetomu", "ifcsname", "ifdefined", "iffontchar", "interactionmode", "interlinepenalties", "lastlinefit", "lastnodetype", "marks", "muexpr", "mutoglue", "numexpr", "pagediscards", "parshapedimen", "parshapeindent", "parshapelength", "predisplaydirection", "protected", "savinghyphcodes", "savingvdiscards", "scantokens", "showgroups", "showifs", "showtokens", "splitbotmarks", "splitdiscards", "splitfirstmarks", "topmarks", "tracingassigns", "tracinggroups", "tracingifs", "tracingnesting", "unexpanded", "unless", "widowpenalties" },
- ["luatex"]={ "Uabove", "Uabovewithdelims", "Uatop", "Uatopwithdelims", "Uchar", "Udelcode", "Udelimited", "Udelimiter", "Udelimiterover", "Udelimiterunder", "Uhextensible", "Uleft", "Umathaccent", "Umathaccentbasedepth", "Umathaccentbaseheight", "Umathaccentbottomovershoot", "Umathaccentbottomshiftdown", "Umathaccentextendmargin", "Umathaccentsuperscriptdrop", "Umathaccentsuperscriptpercent", "Umathaccenttopovershoot", "Umathaccenttopshiftup", "Umathaccentvariant", "Umathadapttoleft", "Umathadapttoright", "Umathaxis", "Umathbottomaccentvariant", "Umathchar", "Umathcharclass", "Umathchardef", "Umathcharfam", "Umathcharslot", "Umathclass", "Umathcode", "Umathconnectoroverlapmin", "Umathdegreevariant", "Umathdelimiterovervariant", "Umathdelimiterpercent", "Umathdelimitershortfall", "Umathdelimiterundervariant", "Umathdenominatorvariant", "Umathdict", "Umathdictdef", "Umathdiscretionary", "Umathextrasubpreshift", "Umathextrasubprespace", "Umathextrasubshift", "Umathextrasubspace", "Umathextrasuppreshift", "Umathextrasupprespace", "Umathextrasupshift", "Umathextrasupspace", "Umathflattenedaccentbasedepth", "Umathflattenedaccentbaseheight", "Umathflattenedaccentbottomshiftdown", "Umathflattenedaccenttopshiftup", "Umathfractiondelsize", "Umathfractiondenomdown", "Umathfractiondenomvgap", "Umathfractionnumup", "Umathfractionnumvgap", "Umathfractionrule", "Umathfractionvariant", "Umathhextensiblevariant", "Umathlimitabovebgap", "Umathlimitabovekern", "Umathlimitabovevgap", "Umathlimitbelowbgap", "Umathlimitbelowkern", "Umathlimitbelowvgap", "Umathlimits", "Umathnoaxis", "Umathnolimits", "Umathnolimitsubfactor", "Umathnolimitsupfactor", "Umathnumeratorvariant", "Umathopenupdepth", "Umathopenupheight", "Umathoperatorsize", "Umathoverbarkern", "Umathoverbarrule", "Umathoverbarvgap", "Umathoverdelimiterbgap", "Umathoverdelimitervariant", "Umathoverdelimitervgap", "Umathoverlayaccentvariant", "Umathoverlinevariant", "Umathphantom", "Umathpresubshiftdistance", "Umathpresupshiftdistance", "Umathprimeraise", "Umathprimeraisecomposed", "Umathprimeshiftdrop", "Umathprimeshiftup", "Umathprimespaceafter", "Umathprimevariant", "Umathprimewidth", "Umathquad", "Umathradicaldegreeafter", "Umathradicaldegreebefore", "Umathradicaldegreeraise", "Umathradicalextensibleafter", "Umathradicalextensiblebefore", "Umathradicalkern", "Umathradicalrule", "Umathradicalvariant", "Umathradicalvgap", "Umathruledepth", "Umathruleheight", "Umathskeweddelimitertolerance", "Umathskewedfractionhgap", "Umathskewedfractionvgap", "Umathsource", "Umathspaceafterscript", "Umathspacebeforescript", "Umathstackdenomdown", "Umathstacknumup", "Umathstackvariant", "Umathstackvgap", "Umathsubscriptvariant", "Umathsubshiftdistance", "Umathsubshiftdown", "Umathsubshiftdrop", "Umathsubsupshiftdown", "Umathsubsupvgap", "Umathsubtopmax", "Umathsupbottommin", "Umathsuperscriptvariant", "Umathsupshiftdistance", "Umathsupshiftdrop", "Umathsupshiftup", "Umathsupsubbottommax", "Umathtopaccentvariant", "Umathunderbarkern", "Umathunderbarrule", "Umathunderbarvgap", "Umathunderdelimiterbgap", "Umathunderdelimitervariant", "Umathunderdelimitervgap", "Umathunderlinevariant", "Umathuseaxis", "Umathvextensiblevariant", "Umathvoid", "Umathxscale", "Umathyscale", "Umiddle", "Unosubprescript", "Unosubscript", "Unosuperprescript", "Unosuperscript", "Uoperator", "Uover", "Uoverdelimiter", "Uoverwithdelims", "Uprimescript", "Uradical", "Uright", "Uroot", "Urooted", "Ushiftedsubprescript", "Ushiftedsubscript", "Ushiftedsuperprescript", "Ushiftedsuperscript", "Uskewed", "Uskewedwithdelims", "Ustack", "Ustartdisplaymath", "Ustartmath", "Ustartmathmode", "Ustopdisplaymath", "Ustopmath", "Ustopmathmode", "Ustretched", "Ustretchedwithdelims", "Ustyle", "Usubprescript", "Usubscript", "Usuperprescript", "Usuperscript", "Uunderdelimiter", "Uvextensible", "adjustspacing", "adjustspacingshrink", "adjustspacingstep", "adjustspacingstretch", "afterassigned", "aftergrouped", "aliased", "aligncontent", "alignmark", "alignmentcellsource", "alignmentwrapsource", "aligntab", "allcrampedstyles", "alldisplaystyles", "allmainstyles", "allmathstyles", "allscriptscriptstyles", "allscriptstyles", "allsplitstyles", "alltextstyles", "alluncrampedstyles", "allunsplitstyles", "amcode", "atendofgroup", "atendofgrouped", "attribute", "attributedef", "automaticdiscretionary", "automatichyphenpenalty", "automigrationmode", "autoparagraphmode", "begincsname", "beginlocalcontrol", "beginmathgroup", "beginsimplegroup", "boundary", "boxadapt", "boxanchor", "boxanchors", "boxattribute", "boxdirection", "boxfreeze", "boxgeometry", "boxorientation", "boxrepack", "boxshift", "boxsource", "boxtarget", "boxtotal", "boxxmove", "boxxoffset", "boxymove", "boxyoffset", "catcodetable", "cdef", "cdefcsname", "cfcode", "clearmarks", "constant", "copymathatomrule", "copymathparent", "copymathspacing", "crampeddisplaystyle", "crampedscriptscriptstyle", "crampedscriptstyle", "crampedtextstyle", "csactive", "csstring", "currentloopiterator", "currentloopnesting", "currentmarks", "dbox", "defcsname", "detokenized", "dimensiondef", "dimexpression", "directlua", "dpack", "edefcsname", "efcode", "endlocalcontrol", "endmathgroup", "endsimplegroup", "enforced", "etoks", "etoksapp", "etokspre", "everybeforepar", "everymathatom", "everytab", "exceptionpenalty", "expand", "expandactive", "expandafterpars", "expandafterspaces", "expandcstoken", "expanded", "expandedafter", "expandedloop", "expandtoken", "explicitdiscretionary", "explicithyphenpenalty", "firstvalidlanguage", "flushmarks", "fontcharta", "fontid", "fontmathcontrol", "fontspecdef", "fontspecid", "fontspecifiedname", "fontspecifiedsize", "fontspecscale", "fontspecxscale", "fontspecyscale", "fonttextcontrol", "formatname", "frozen", "futurecsname", "futuredef", "futureexpand", "futureexpandis", "futureexpandisap", "gdefcsname", "gleaders", "glet", "gletcsname", "glettonothing", "gluespecdef", "glyph", "glyphdatafield", "glyphoptions", "glyphscale", "glyphscriptfield", "glyphscriptscale", "glyphscriptscriptscale", "glyphstatefield", "glyphtextscale", "glyphxoffset", "glyphxscale", "glyphxscaled", "glyphyoffset", "glyphyscale", "glyphyscaled", "gtoksapp", "gtokspre", "hccode", "hjcode", "hmcode", "holdingmigrations", "hpack", "hyphenationmin", "hyphenationmode", "ifabsdim", "ifabsnum", "ifarguments", "ifboolean", "ifchkdim", "ifchknum", "ifcmpdim", "ifcmpnum", "ifcondition", "ifcstok", "ifdimexpression", "ifdimval", "ifempty", "ifflags", "ifhaschar", "ifhastok", "ifhastoks", "ifhasxtoks", "ifincsname", "ifinsert", "ifmathparameter", "ifmathstyle", "ifnumexpression", "ifnumval", "ifparameter", "ifparameters", "ifrelax", "iftok", "ifzerodim", "ifzeronum", "ignorearguments", "ignoredepthcriterium", "ignorepars", "immediate", "immutable", "indexofcharacter", "indexofregister", "inherited", "initcatcodetable", "insertbox", "insertcopy", "insertdepth", "insertdistance", "insertheight", "insertheights", "insertlimit", "insertmaxdepth", "insertmode", "insertmultiplier", "insertpenalty", "insertprogress", "insertstorage", "insertstoring", "insertunbox", "insertuncopy", "insertwidth", "instance", "integerdef", "lastarguments", "lastatomclass", "lastboundary", "lastchkdim", "lastchknum", "lastleftclass", "lastloopiterator", "lastnamedcs", "lastnodesubtype", "lastpageextra", "lastparcontext", "lastrightclass", "leftmarginkern", "letcharcode", "letcsname", "letfrozen", "letmathatomrule", "letmathparent", "letmathspacing", "letprotected", "lettonothing", "linebreakcriterium", "linedirection", "localbrokenpenalty", "localcontrol", "localcontrolled", "localcontrolledloop", "localinterlinepenalty", "localleftbox", "localleftboxbox", "localmiddlebox", "localmiddleboxbox", "localrightbox", "localrightboxbox", "lpcode", "luabytecode", "luabytecodecall", "luacopyinputnodes", "luadef", "luaescapestring", "luafunction", "luafunctioncall", "luatexbanner", "luatexrevision", "luatexversion", "mathaccent", "mathatom", "mathatomglue", "mathatomskip", "mathbackwardpenalties", "mathbeginclass", "mathcheckfencesmode", "mathdictgroup", "mathdictproperties", "mathdirection", "mathdisplaymode", "mathdisplayskipmode", "mathdoublescriptmode", "mathendclass", "matheqnogapstep", "mathfenced", "mathfontcontrol", "mathforwardpenalties", "mathfrac", "mathghost", "mathgluemode", "mathgroupingmode", "mathleftclass", "mathlimitsmode", "mathmainstyle", "mathmiddle", "mathnolimitsmode", "mathpenaltiesmode", "mathrad", "mathrightclass", "mathrulesfam", "mathrulesmode", "mathscale", "mathscriptsmode", "mathslackmode", "mathspacingmode", "mathstackstyle", "mathstyle", "mathstylefontid", "mathsurroundmode", "mathsurroundskip", "maththreshold", "meaningasis", "meaningfull", "meaningless", "mugluespecdef", "mutable", "noaligned", "noatomruling", "noboundary", "nohrule", "norelax", "normalizelinemode", "normalizeparmode", "nospaces", "novrule", "numericscale", "numexpression", "orelse", "orphanpenalties", "orphanpenalty", "orunless", "outputbox", "overloaded", "overloadmode", "overshoot", "pageboundary", "pageextragoal", "pagevsize", "parametercount", "parametermark", "parattribute", "pardirection", "permanent", "pettymuskip", "postexhyphenchar", "posthyphenchar", "postinlinepenalty", "prebinoppenalty", "predisplaygapfactor", "preexhyphenchar", "prehyphenchar", "preinlinepenalty", "prerelpenalty", "protrudechars", "protrusionboundary", "pxdimen", "quitloop", "quitvmode", "resetmathspacing", "retokenized", "rightmarginkern", "rpcode", "savecatcodetable", "scaledemwidth", "scaledexheight", "scaledextraspace", "scaledfontdimen", "scaledinterwordshrink", "scaledinterwordspace", "scaledinterwordstretch", "scaledmathstyle", "scaledslantperpoint", "scantextokens", "semiexpand", "semiexpanded", "semiprotected", "setdefaultmathcodes", "setfontid", "setmathatomrule", "setmathdisplaypostpenalty", "setmathdisplayprepenalty", "setmathignore", "setmathoptions", "setmathpostpenalty", "setmathprepenalty", "setmathspacing", "shapingpenaltiesmode", "shapingpenalty", "snapshotpar", "srule", "supmarkmode", "swapcsvalues", "tabsize", "textdirection", "thewithoutunit", "tinymuskip", "todimension", "tohexadecimal", "tointeger", "tokenized", "toksapp", "tokspre", "tolerant", "tomathstyle", "toscaled", "tosparsedimension", "tosparsescaled", "tpack", "tracingadjusts", "tracingalignments", "tracingexpressions", "tracingfonts", "tracingfullboxes", "tracinghyphenation", "tracinginserts", "tracinglevels", "tracinglists", "tracingmarks", "tracingmath", "tracingnodes", "tracingpenalties", "uleaders", "undent", "unexpandedloop", "unhpack", "unletfrozen", "unletprotected", "untraced", "unvpack", "variablefam", "vpack", "wordboundary", "wrapuppar", "xdefcsname", "xtoks", "xtoksapp", "xtokspre" },
+ ["luatex"]={ "Uabove", "Uabovewithdelims", "Uatop", "Uatopwithdelims", "Uchar", "Udelcode", "Udelimited", "Udelimiter", "Udelimiterover", "Udelimiterunder", "Uhextensible", "Uleft", "Umathaccent", "Umathaccentbasedepth", "Umathaccentbaseheight", "Umathaccentbottomovershoot", "Umathaccentbottomshiftdown", "Umathaccentextendmargin", "Umathaccentsuperscriptdrop", "Umathaccentsuperscriptpercent", "Umathaccenttopovershoot", "Umathaccenttopshiftup", "Umathaccentvariant", "Umathadapttoleft", "Umathadapttoright", "Umathaxis", "Umathbottomaccentvariant", "Umathchar", "Umathcharclass", "Umathchardef", "Umathcharfam", "Umathcharslot", "Umathclass", "Umathcode", "Umathconnectoroverlapmin", "Umathdegreevariant", "Umathdelimiterovervariant", "Umathdelimiterpercent", "Umathdelimitershortfall", "Umathdelimiterundervariant", "Umathdenominatorvariant", "Umathdict", "Umathdictdef", "Umathdiscretionary", "Umathextrasubpreshift", "Umathextrasubprespace", "Umathextrasubshift", "Umathextrasubspace", "Umathextrasuppreshift", "Umathextrasupprespace", "Umathextrasupshift", "Umathextrasupspace", "Umathflattenedaccentbasedepth", "Umathflattenedaccentbaseheight", "Umathflattenedaccentbottomshiftdown", "Umathflattenedaccenttopshiftup", "Umathfractiondelsize", "Umathfractiondenomdown", "Umathfractiondenomvgap", "Umathfractionnumup", "Umathfractionnumvgap", "Umathfractionrule", "Umathfractionvariant", "Umathhextensiblevariant", "Umathlimitabovebgap", "Umathlimitabovekern", "Umathlimitabovevgap", "Umathlimitbelowbgap", "Umathlimitbelowkern", "Umathlimitbelowvgap", "Umathlimits", "Umathnoaxis", "Umathnolimits", "Umathnolimitsubfactor", "Umathnolimitsupfactor", "Umathnumeratorvariant", "Umathopenupdepth", "Umathopenupheight", "Umathoperatorsize", "Umathoverbarkern", "Umathoverbarrule", "Umathoverbarvgap", "Umathoverdelimiterbgap", "Umathoverdelimitervariant", "Umathoverdelimitervgap", "Umathoverlayaccentvariant", "Umathoverlinevariant", "Umathphantom", "Umathpresubshiftdistance", "Umathpresupshiftdistance", "Umathprimeraise", "Umathprimeraisecomposed", "Umathprimeshiftdrop", "Umathprimeshiftup", "Umathprimespaceafter", "Umathprimevariant", "Umathprimewidth", "Umathquad", "Umathradicaldegreeafter", "Umathradicaldegreebefore", "Umathradicaldegreeraise", "Umathradicalextensibleafter", "Umathradicalextensiblebefore", "Umathradicalkern", "Umathradicalrule", "Umathradicalvariant", "Umathradicalvgap", "Umathruledepth", "Umathruleheight", "Umathskeweddelimitertolerance", "Umathskewedfractionhgap", "Umathskewedfractionvgap", "Umathsource", "Umathspaceafterscript", "Umathspacebeforescript", "Umathstackdenomdown", "Umathstacknumup", "Umathstackvariant", "Umathstackvgap", "Umathsubscriptvariant", "Umathsubshiftdistance", "Umathsubshiftdown", "Umathsubshiftdrop", "Umathsubsupshiftdown", "Umathsubsupvgap", "Umathsubtopmax", "Umathsupbottommin", "Umathsuperscriptvariant", "Umathsupshiftdistance", "Umathsupshiftdrop", "Umathsupshiftup", "Umathsupsubbottommax", "Umathtopaccentvariant", "Umathunderbarkern", "Umathunderbarrule", "Umathunderbarvgap", "Umathunderdelimiterbgap", "Umathunderdelimitervariant", "Umathunderdelimitervgap", "Umathunderlinevariant", "Umathuseaxis", "Umathvextensiblevariant", "Umathvoid", "Umathxscale", "Umathyscale", "Umiddle", "Unosubprescript", "Unosubscript", "Unosuperprescript", "Unosuperscript", "Uoperator", "Uover", "Uoverdelimiter", "Uoverwithdelims", "Uprimescript", "Uradical", "Uright", "Uroot", "Urooted", "Ushiftedsubprescript", "Ushiftedsubscript", "Ushiftedsuperprescript", "Ushiftedsuperscript", "Uskewed", "Uskewedwithdelims", "Ustack", "Ustartdisplaymath", "Ustartmath", "Ustartmathmode", "Ustopdisplaymath", "Ustopmath", "Ustopmathmode", "Ustretched", "Ustretchedwithdelims", "Ustyle", "Usubprescript", "Usubscript", "Usuperprescript", "Usuperscript", "Uunderdelimiter", "Uvextensible", "adjustspacing", "adjustspacingshrink", "adjustspacingstep", "adjustspacingstretch", "afterassigned", "aftergrouped", "aliased", "aligncontent", "alignmark", "alignmentcellsource", "alignmentwrapsource", "aligntab", "allcrampedstyles", "alldisplaystyles", "allmainstyles", "allmathstyles", "allscriptscriptstyles", "allscriptstyles", "allsplitstyles", "alltextstyles", "alluncrampedstyles", "allunsplitstyles", "amcode", "atendofgroup", "atendofgrouped", "attribute", "attributedef", "automaticdiscretionary", "automatichyphenpenalty", "automigrationmode", "autoparagraphmode", "begincsname", "beginlocalcontrol", "beginmathgroup", "beginsimplegroup", "boundary", "boxadapt", "boxanchor", "boxanchors", "boxattribute", "boxdirection", "boxfreeze", "boxgeometry", "boxorientation", "boxrepack", "boxshift", "boxsource", "boxtarget", "boxtotal", "boxvadjust", "boxxmove", "boxxoffset", "boxymove", "boxyoffset", "catcodetable", "cdef", "cdefcsname", "cfcode", "clearmarks", "constant", "copymathatomrule", "copymathparent", "copymathspacing", "crampeddisplaystyle", "crampedscriptscriptstyle", "crampedscriptstyle", "crampedtextstyle", "csactive", "csstring", "currentloopiterator", "currentloopnesting", "currentmarks", "dbox", "defcsname", "detokenized", "dimensiondef", "dimexpression", "directlua", "dpack", "dsplit", "edefcsname", "efcode", "endlocalcontrol", "endmathgroup", "endsimplegroup", "enforced", "etoks", "etoksapp", "etokspre", "everybeforepar", "everymathatom", "everytab", "exceptionpenalty", "expand", "expandactive", "expandafterpars", "expandafterspaces", "expandcstoken", "expanded", "expandedafter", "expandedloop", "expandtoken", "explicitdiscretionary", "explicithyphenpenalty", "firstvalidlanguage", "flushmarks", "fontcharta", "fontid", "fontmathcontrol", "fontspecdef", "fontspecid", "fontspecifiedname", "fontspecifiedsize", "fontspecscale", "fontspecxscale", "fontspecyscale", "fonttextcontrol", "formatname", "frozen", "futurecsname", "futuredef", "futureexpand", "futureexpandis", "futureexpandisap", "gdefcsname", "gleaders", "glet", "gletcsname", "glettonothing", "gluespecdef", "glyph", "glyphdatafield", "glyphoptions", "glyphscale", "glyphscriptfield", "glyphscriptscale", "glyphscriptscriptscale", "glyphstatefield", "glyphtextscale", "glyphxoffset", "glyphxscale", "glyphxscaled", "glyphyoffset", "glyphyscale", "glyphyscaled", "gtoksapp", "gtokspre", "hccode", "hjcode", "hmcode", "holdingmigrations", "hpack", "hyphenationmin", "hyphenationmode", "ifabsdim", "ifabsnum", "ifarguments", "ifboolean", "ifchkdim", "ifchkdimension", "ifchknum", "ifchknumber", "ifcmpdim", "ifcmpnum", "ifcondition", "ifcstok", "ifdimexpression", "ifdimval", "ifempty", "ifflags", "ifhaschar", "ifhastok", "ifhastoks", "ifhasxtoks", "ifincsname", "ifinsert", "ifmathparameter", "ifmathstyle", "ifnumexpression", "ifnumval", "ifparameter", "ifparameters", "ifrelax", "iftok", "ifzerodim", "ifzeronum", "ignorearguments", "ignoredepthcriterium", "ignorepars", "immediate", "immutable", "indexofcharacter", "indexofregister", "inherited", "initcatcodetable", "insertbox", "insertcopy", "insertdepth", "insertdistance", "insertheight", "insertheights", "insertlimit", "insertmaxdepth", "insertmode", "insertmultiplier", "insertpenalty", "insertprogress", "insertstorage", "insertstoring", "insertunbox", "insertuncopy", "insertwidth", "instance", "integerdef", "lastarguments", "lastatomclass", "lastboundary", "lastchkdim", "lastchknum", "lastleftclass", "lastloopiterator", "lastnamedcs", "lastnodesubtype", "lastpageextra", "lastparcontext", "lastrightclass", "leftmarginkern", "letcharcode", "letcsname", "letfrozen", "letmathatomrule", "letmathparent", "letmathspacing", "letprotected", "lettonothing", "linebreakcriterium", "linedirection", "localbrokenpenalty", "localcontrol", "localcontrolled", "localcontrolledloop", "localinterlinepenalty", "localleftbox", "localleftboxbox", "localmiddlebox", "localmiddleboxbox", "localrightbox", "localrightboxbox", "lpcode", "luabytecode", "luabytecodecall", "luacopyinputnodes", "luadef", "luaescapestring", "luafunction", "luafunctioncall", "luatexbanner", "luatexrevision", "luatexversion", "mathaccent", "mathatom", "mathatomglue", "mathatomskip", "mathbackwardpenalties", "mathbeginclass", "mathcheckfencesmode", "mathdictgroup", "mathdictproperties", "mathdirection", "mathdisplaymode", "mathdisplayskipmode", "mathdoublescriptmode", "mathendclass", "matheqnogapstep", "mathfenced", "mathfontcontrol", "mathforwardpenalties", "mathfraction", "mathghost", "mathgluemode", "mathgroupingmode", "mathleftclass", "mathlimitsmode", "mathmainstyle", "mathmiddle", "mathnolimitsmode", "mathpenaltiesmode", "mathradical", "mathrightclass", "mathrulesfam", "mathrulesmode", "mathscale", "mathscriptsmode", "mathslackmode", "mathspacingmode", "mathstackstyle", "mathstyle", "mathstylefontid", "mathsurroundmode", "mathsurroundskip", "maththreshold", "meaningasis", "meaningfull", "meaningless", "mugluespecdef", "mutable", "noaligned", "noatomruling", "noboundary", "nohrule", "norelax", "normalizelinemode", "normalizeparmode", "nospaces", "novrule", "numericscale", "numexpression", "orelse", "orphanpenalties", "orphanpenalty", "orunless", "outputbox", "overloaded", "overloadmode", "overshoot", "pageboundary", "pageextragoal", "pagevsize", "parametercount", "parametermark", "parattribute", "pardirection", "permanent", "pettymuskip", "postexhyphenchar", "posthyphenchar", "postinlinepenalty", "prebinoppenalty", "predisplaygapfactor", "preexhyphenchar", "prehyphenchar", "preinlinepenalty", "prerelpenalty", "protrudechars", "protrusionboundary", "pxdimen", "quitloop", "quitvmode", "resetmathspacing", "retokenized", "rightmarginkern", "rpcode", "savecatcodetable", "scaledemwidth", "scaledexheight", "scaledextraspace", "scaledfontdimen", "scaledinterwordshrink", "scaledinterwordspace", "scaledinterwordstretch", "scaledmathstyle", "scaledslantperpoint", "scantextokens", "semiexpand", "semiexpanded", "semiprotected", "setdefaultmathcodes", "setfontid", "setmathatomrule", "setmathdisplaypostpenalty", "setmathdisplayprepenalty", "setmathignore", "setmathoptions", "setmathpostpenalty", "setmathprepenalty", "setmathspacing", "shapingpenaltiesmode", "shapingpenalty", "snapshotpar", "srule", "supmarkmode", "swapcsvalues", "tabsize", "textdirection", "thewithoutunit", "tinymuskip", "todimension", "tohexadecimal", "tointeger", "tokenized", "toksapp", "tokspre", "tolerant", "tomathstyle", "toscaled", "tosparsedimension", "tosparsescaled", "tpack", "tracingadjusts", "tracingalignments", "tracingexpressions", "tracingfonts", "tracingfullboxes", "tracinghyphenation", "tracinginserts", "tracinglevels", "tracinglists", "tracingmarks", "tracingmath", "tracingnodes", "tracingpenalties", "tsplit", "uleaders", "undent", "unexpandedloop", "unhpack", "unletfrozen", "unletprotected", "untraced", "unvpack", "variablefam", "vpack", "wordboundary", "wrapuppar", "xdefcsname", "xtoks", "xtoksapp", "xtokspre" },
["omega"]={ "Omegaminorversion", "Omegarevision", "Omegaversion" },
["pdftex"]={ "ifpdfabsdim", "ifpdfabsnum", "ifpdfprimitive", "pdfadjustspacing", "pdfannot", "pdfcatalog", "pdfcolorstack", "pdfcolorstackinit", "pdfcompresslevel", "pdfcopyfont", "pdfcreationdate", "pdfdecimaldigits", "pdfdest", "pdfdestmargin", "pdfdraftmode", "pdfeachlinedepth", "pdfeachlineheight", "pdfendlink", "pdfendthread", "pdffirstlineheight", "pdffontattr", "pdffontexpand", "pdffontname", "pdffontobjnum", "pdffontsize", "pdfgamma", "pdfgentounicode", "pdfglyphtounicode", "pdfhorigin", "pdfignoreddimen", "pdfignoreunknownimages", "pdfimageaddfilename", "pdfimageapplygamma", "pdfimagegamma", "pdfimagehicolor", "pdfimageresolution", "pdfincludechars", "pdfinclusioncopyfonts", "pdfinclusionerrorlevel", "pdfinfo", "pdfinfoomitdate", "pdfinsertht", "pdflastannot", "pdflastlinedepth", "pdflastlink", "pdflastobj", "pdflastxform", "pdflastximage", "pdflastximagepages", "pdflastxpos", "pdflastypos", "pdflinkmargin", "pdfliteral", "pdfmajorversion", "pdfmapfile", "pdfmapline", "pdfminorversion", "pdfnames", "pdfnoligatures", "pdfnormaldeviate", "pdfobj", "pdfobjcompresslevel", "pdfomitcharset", "pdfomitcidset", "pdfomitinfodict", "pdfoutline", "pdfoutput", "pdfpageattr", "pdfpagebox", "pdfpageheight", "pdfpageref", "pdfpageresources", "pdfpagesattr", "pdfpagewidth", "pdfpkfixeddpi", "pdfpkmode", "pdfpkresolution", "pdfprimitive", "pdfprotrudechars", "pdfpxdimen", "pdfrandomseed", "pdfrecompress", "pdfrefobj", "pdfrefxform", "pdfrefximage", "pdfreplacefont", "pdfrestore", "pdfretval", "pdfsave", "pdfsavepos", "pdfsetmatrix", "pdfsetrandomseed", "pdfstartlink", "pdfstartthread", "pdfsuppressoptionalinfo", "pdfsuppressptexinfo", "pdftexbanner", "pdftexrevision", "pdftexversion", "pdfthread", "pdfthreadmargin", "pdftracingfonts", "pdftrailer", "pdftrailerid", "pdfuniformdeviate", "pdfuniqueresname", "pdfvorigin", "pdfxform", "pdfxformattr", "pdfxformmargin", "pdfxformname", "pdfxformresources", "pdfximage" },
- ["tex"]={ " ", "-", "/", "above", "abovedisplayshortskip", "abovedisplayskip", "abovewithdelims", "accent", "adjdemerits", "advance", "advanceby", "afterassignment", "aftergroup", "atop", "atopwithdelims", "badness", "baselineskip", "batchmode", "begingroup", "belowdisplayshortskip", "belowdisplayskip", "binoppenalty", "botmark", "box", "boxmaxdepth", "brokenpenalty", "catcode", "char", "chardef", "cleaders", "clubpenalty", "copy", "count", "countdef", "cr", "crcr", "csname", "day", "deadcycles", "def", "defaulthyphenchar", "defaultskewchar", "delcode", "delimiter", "delimiterfactor", "delimitershortfall", "dimen", "dimendef", "discretionary", "displayindent", "displaylimits", "displaystyle", "displaywidowpenalty", "displaywidth", "divide", "divideby", "doublehyphendemerits", "dp", "dsplit", "dump", "edef", "else", "emergencystretch", "end", "endcsname", "endgroup", "endinput", "endlinechar", "eqno", "errhelp", "errmessage", "errorcontextlines", "errorstopmode", "escapechar", "everycr", "everydisplay", "everyhbox", "everyjob", "everymath", "everypar", "everyvbox", "exhyphenchar", "exhyphenpenalty", "expandafter", "fam", "fi", "finalhyphendemerits", "firstmark", "floatingpenalty", "font", "fontdimen", "fontname", "futurelet", "gdef", "global", "globaldefs", "halign", "hangafter", "hangindent", "hbadness", "hbox", "hfil", "hfill", "hfilneg", "hfuzz", "holdinginserts", "hrule", "hsize", "hskip", "hss", "ht", "hyphenation", "hyphenchar", "hyphenpenalty", "if", "ifcase", "ifcat", "ifdim", "iffalse", "ifhbox", "ifhmode", "ifinner", "ifmmode", "ifnum", "ifodd", "iftrue", "ifvbox", "ifvmode", "ifvoid", "ifx", "ignorespaces", "indent", "input", "inputlineno", "insert", "insertpenalties", "interlinepenalty", "jobname", "kern", "language", "lastbox", "lastkern", "lastpenalty", "lastskip", "lccode", "leaders", "left", "lefthyphenmin", "leftskip", "leqno", "let", "limits", "linepenalty", "lineskip", "lineskiplimit", "long", "looseness", "lower", "lowercase", "mark", "mathbin", "mathchar", "mathchardef", "mathchoice", "mathclose", "mathcode", "mathinner", "mathop", "mathopen", "mathord", "mathpunct", "mathrel", "mathsurround", "maxdeadcycles", "maxdepth", "meaning", "medmuskip", "message", "middle", "mkern", "month", "moveleft", "moveright", "mskip", "multiply", "multiplyby", "muskip", "muskipdef", "newlinechar", "noalign", "noexpand", "noindent", "nolimits", "nonscript", "nonstopmode", "nulldelimiterspace", "nullfont", "number", "omit", "or", "outer", "output", "outputpenalty", "over", "overfullrule", "overline", "overwithdelims", "pagedepth", "pagefilllstretch", "pagefillstretch", "pagefilstretch", "pagegoal", "pageshrink", "pagestretch", "pagetotal", "par", "parfillleftskip", "parfillskip", "parindent", "parinitleftskip", "parinitrightskip", "parshape", "parskip", "patterns", "pausing", "penalty", "postdisplaypenalty", "predisplaypenalty", "predisplaysize", "pretolerance", "prevdepth", "prevgraf", "radical", "raise", "relax", "relpenalty", "right", "righthyphenmin", "rightskip", "romannumeral", "scriptfont", "scriptscriptfont", "scriptscriptstyle", "scriptspace", "scriptstyle", "scrollmode", "setbox", "setlanguage", "sfcode", "shipout", "show", "showbox", "showboxbreadth", "showboxdepth", "showlists", "shownodedetails", "showthe", "skewchar", "skip", "skipdef", "spacefactor", "spaceskip", "span", "splitbotmark", "splitfirstmark", "splitmaxdepth", "splittopskip", "string", "tabskip", "textfont", "textstyle", "the", "thickmuskip", "thinmuskip", "time", "toks", "toksdef", "tolerance", "topmark", "topskip", "tracingcommands", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingpages", "tracingparagraphs", "tracingrestores", "tracingstats", "tsplit", "uccode", "uchyph", "unboundary", "underline", "unhbox", "unhcopy", "unkern", "unpenalty", "unskip", "unvbox", "unvcopy", "uppercase", "vadjust", "valign", "vbadness", "vbox", "vcenter", "vfil", "vfill", "vfilneg", "vfuzz", "vrule", "vsize", "vskip", "vsplit", "vss", "vtop", "wd", "widowpenalty", "xdef", "xleaders", "xspaceskip", "year" },
+ ["tex"]={ " ", "-", "/", "above", "abovedisplayshortskip", "abovedisplayskip", "abovewithdelims", "accent", "adjdemerits", "advance", "advanceby", "afterassignment", "aftergroup", "atop", "atopwithdelims", "badness", "baselineskip", "batchmode", "begingroup", "belowdisplayshortskip", "belowdisplayskip", "binoppenalty", "botmark", "box", "boxmaxdepth", "brokenpenalty", "catcode", "char", "chardef", "cleaders", "clubpenalty", "copy", "count", "countdef", "cr", "crcr", "csname", "day", "deadcycles", "def", "defaulthyphenchar", "defaultskewchar", "delcode", "delimiter", "delimiterfactor", "delimitershortfall", "dimen", "dimendef", "discretionary", "displayindent", "displaylimits", "displaystyle", "displaywidowpenalty", "displaywidth", "divide", "divideby", "doublehyphendemerits", "dp", "dump", "edef", "else", "emergencystretch", "end", "endcsname", "endgroup", "endinput", "endlinechar", "eqno", "errhelp", "errmessage", "errorcontextlines", "errorstopmode", "escapechar", "everycr", "everydisplay", "everyhbox", "everyjob", "everymath", "everypar", "everyvbox", "exhyphenchar", "exhyphenpenalty", "expandafter", "fam", "fi", "finalhyphendemerits", "firstmark", "floatingpenalty", "font", "fontdimen", "fontname", "futurelet", "gdef", "global", "globaldefs", "halign", "hangafter", "hangindent", "hbadness", "hbox", "hfil", "hfill", "hfilneg", "hfuzz", "holdinginserts", "hrule", "hsize", "hskip", "hss", "ht", "hyphenation", "hyphenchar", "hyphenpenalty", "if", "ifcase", "ifcat", "ifdim", "iffalse", "ifhbox", "ifhmode", "ifinner", "ifmmode", "ifnum", "ifodd", "iftrue", "ifvbox", "ifvmode", "ifvoid", "ifx", "ignorespaces", "indent", "input", "inputlineno", "insert", "insertpenalties", "interlinepenalty", "jobname", "kern", "language", "lastbox", "lastkern", "lastpenalty", "lastskip", "lccode", "leaders", "left", "lefthyphenmin", "leftskip", "leqno", "let", "limits", "linepenalty", "lineskip", "lineskiplimit", "long", "looseness", "lower", "lowercase", "mark", "mathbin", "mathchar", "mathchardef", "mathchoice", "mathclose", "mathcode", "mathinner", "mathop", "mathopen", "mathord", "mathpunct", "mathrel", "mathsurround", "maxdeadcycles", "maxdepth", "meaning", "medmuskip", "message", "middle", "mkern", "month", "moveleft", "moveright", "mskip", "multiply", "multiplyby", "muskip", "muskipdef", "newlinechar", "noalign", "noexpand", "noindent", "nolimits", "nonscript", "nonstopmode", "nulldelimiterspace", "nullfont", "number", "omit", "or", "outer", "output", "outputpenalty", "over", "overfullrule", "overline", "overwithdelims", "pagedepth", "pagefilllstretch", "pagefillstretch", "pagefilstretch", "pagegoal", "pageshrink", "pagestretch", "pagetotal", "par", "parfillleftskip", "parfillskip", "parindent", "parinitleftskip", "parinitrightskip", "parshape", "parskip", "patterns", "pausing", "penalty", "postdisplaypenalty", "predisplaypenalty", "predisplaysize", "pretolerance", "prevdepth", "prevgraf", "radical", "raise", "relax", "relpenalty", "right", "righthyphenmin", "rightskip", "romannumeral", "scriptfont", "scriptscriptfont", "scriptscriptstyle", "scriptspace", "scriptstyle", "scrollmode", "setbox", "setlanguage", "sfcode", "shipout", "show", "showbox", "showboxbreadth", "showboxdepth", "showlists", "shownodedetails", "showthe", "skewchar", "skip", "skipdef", "spacefactor", "spaceskip", "span", "splitbotmark", "splitfirstmark", "splitmaxdepth", "splittopskip", "string", "tabskip", "textfont", "textstyle", "the", "thickmuskip", "thinmuskip", "time", "toks", "toksdef", "tolerance", "topmark", "topskip", "tracingcommands", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingpages", "tracingparagraphs", "tracingrestores", "tracingstats", "uccode", "uchyph", "unboundary", "underline", "unhbox", "unhcopy", "unkern", "unpenalty", "unskip", "unvbox", "unvcopy", "uppercase", "vadjust", "valign", "vbadness", "vbox", "vcenter", "vfil", "vfill", "vfilneg", "vfuzz", "vrule", "vsize", "vskip", "vsplit", "vss", "vtop", "wd", "widowpenalty", "xdef", "xleaders", "xspaceskip", "year" },
["xetex"]={ "XeTeXversion" },
} \ No newline at end of file
diff --git a/context/data/scite/context/scite-context-data-context.properties b/context/data/scite/context/scite-context-data-context.properties
index 9a97114e6..4885c8785 100644
--- a/context/data/scite/context/scite-context-data-context.properties
+++ b/context/data/scite/context/scite-context-data-context.properties
@@ -98,27 +98,27 @@ zerowidthnobreakspace ideographicspace ideographichalffillspace twoperemspace th
fourperemspace fiveperemspace sixperemspace figurespace punctuationspace \
hairspace enquad emquad zerowidthspace zerowidthnonjoiner \
zerowidthjoiner zwnj zwj optionalspace asciispacechar \
-softhyphen autoinsertedspace Ux eUx Umathaccents \
-parfillleftskip parfillrightskip startlmtxmode stoplmtxmode startmkivmode \
-stopmkivmode wildcardsymbol normalhyphenationcode automatichyphenationcode explicithyphenationcode \
-syllablehyphenationcode uppercasehyphenationcode collapsehyphenationcode compoundhyphenationcode strictstarthyphenationcode \
-strictendhyphenationcode automaticpenaltyhyphenationcode explicitpenaltyhyphenationcode permitgluehyphenationcode permitallhyphenationcode \
-permitmathreplacehyphenationcode forcecheckhyphenationcode lazyligatureshyphenationcode forcehandlerhyphenationcode feedbackcompoundhyphenationcode \
-ignoreboundshyphenationcode partialhyphenationcode completehyphenationcode normalizelinenormalizecode parindentskipnormalizecode \
-swaphangindentnormalizecode swapparsshapenormalizecode breakafterdirnormalizecode removemarginkernsnormalizecode clipwidthnormalizecode \
-flattendiscretionariesnormalizecode discardzerotabskipsnormalizecode flattenhleadersnormalizecode normalizeparnormalizeparcode flattenvleadersnormalizeparcode \
-nopreslackclassoptioncode nopostslackclassoptioncode lefttopkernclassoptioncode righttopkernclassoptioncode leftbottomkernclassoptioncode \
-rightbottomkernclassoptioncode lookaheadforendclassoptioncode noitaliccorrectionclassoptioncode defaultmathclassoptions checkligatureclassoptioncode \
-checkitaliccorrectionclassoptioncode checkkernpairclassoptioncode flattenclassoptioncode omitpenaltyclassoptioncode unpackclassoptioncode \
-raiseprimeclassoptioncode carryoverlefttopkernclassoptioncode carryoverleftbottomkernclassoptioncode carryoverrighttopkernclassoptioncode carryoverrightbottomkernclassoptioncode \
-preferdelimiterdimensionsclassoptioncode autoinjectclassoptioncode removeitaliccorrectionclassoptioncode operatoritaliccorrectionclassoptioncode noligaturingglyphoptioncode \
-nokerningglyphoptioncode noleftligatureglyphoptioncode noleftkernglyphoptioncode norightligatureglyphoptioncode norightkernglyphoptioncode \
-noexpansionglyphoptioncode noprotrusionglyphoptioncode noitaliccorrectionglyphoptioncode nokerningcode noligaturingcode \
-frozenflagcode tolerantflagcode protectedflagcode primitiveflagcode permanentflagcode \
-noalignedflagcode immutableflagcode mutableflagcode globalflagcode overloadedflagcode \
-immediateflagcode conditionalflagcode valueflagcode instanceflagcode ordmathflattencode \
-binmathflattencode relmathflattencode punctmathflattencode innermathflattencode normalworddiscoptioncode \
-preworddiscoptioncode postworddiscoptioncode continueifinputfile continuewhenlmtxmode continuewhenmkivmode
+softhyphen autoinsertedspace Ux eUx parfillleftskip \
+parfillrightskip startlmtxmode stoplmtxmode startmkivmode stopmkivmode \
+wildcardsymbol normalhyphenationcode automatichyphenationcode explicithyphenationcode syllablehyphenationcode \
+uppercasehyphenationcode collapsehyphenationcode compoundhyphenationcode strictstarthyphenationcode strictendhyphenationcode \
+automaticpenaltyhyphenationcode explicitpenaltyhyphenationcode permitgluehyphenationcode permitallhyphenationcode permitmathreplacehyphenationcode \
+forcecheckhyphenationcode lazyligatureshyphenationcode forcehandlerhyphenationcode feedbackcompoundhyphenationcode ignoreboundshyphenationcode \
+partialhyphenationcode completehyphenationcode normalizelinenormalizecode parindentskipnormalizecode swaphangindentnormalizecode \
+swapparsshapenormalizecode breakafterdirnormalizecode removemarginkernsnormalizecode clipwidthnormalizecode flattendiscretionariesnormalizecode \
+discardzerotabskipsnormalizecode flattenhleadersnormalizecode normalizeparnormalizeparcode flattenvleadersnormalizeparcode nopreslackclassoptioncode \
+nopostslackclassoptioncode lefttopkernclassoptioncode righttopkernclassoptioncode leftbottomkernclassoptioncode rightbottomkernclassoptioncode \
+lookaheadforendclassoptioncode noitaliccorrectionclassoptioncode defaultmathclassoptions checkligatureclassoptioncode checkitaliccorrectionclassoptioncode \
+checkkernpairclassoptioncode flattenclassoptioncode omitpenaltyclassoptioncode unpackclassoptioncode raiseprimeclassoptioncode \
+carryoverlefttopkernclassoptioncode carryoverleftbottomkernclassoptioncode carryoverrighttopkernclassoptioncode carryoverrightbottomkernclassoptioncode preferdelimiterdimensionsclassoptioncode \
+autoinjectclassoptioncode removeitaliccorrectionclassoptioncode operatoritaliccorrectionclassoptioncode noligaturingglyphoptioncode nokerningglyphoptioncode \
+noleftligatureglyphoptioncode noleftkernglyphoptioncode norightligatureglyphoptioncode norightkernglyphoptioncode noexpansionglyphoptioncode \
+noprotrusionglyphoptioncode noitaliccorrectionglyphoptioncode nokerningcode noligaturingcode frozenflagcode \
+tolerantflagcode protectedflagcode primitiveflagcode permanentflagcode noalignedflagcode \
+immutableflagcode mutableflagcode globalflagcode overloadedflagcode immediateflagcode \
+conditionalflagcode valueflagcode instanceflagcode ordmathflattencode binmathflattencode \
+relmathflattencode punctmathflattencode innermathflattencode normalworddiscoptioncode preworddiscoptioncode \
+postworddiscoptioncode continueifinputfile continuewhenlmtxmode continuewhenmkivmode
keywordclass.context.helpers=\
startsetups stopsetups startxmlsetups stopxmlsetups \
@@ -256,90 +256,61 @@ noheightstrut setstrut strutbox strutht strutdp \
strutwd struthtdp strutgap begstrut endstrut \
lineheight leftboundary rightboundary signalcharacter aligncontentleft \
aligncontentmiddle aligncontentright shiftbox vpackbox hpackbox \
-vpackedbox hpackedbox ordordspacing ordopspacing ordbinspacing \
-ordrelspacing ordopenspacing ordclosespacing ordpunctspacing ordinnerspacing \
-ordfracspacing ordradspacing ordmiddlespacing ordaccentspacing opordspacing \
-opopspacing opbinspacing oprelspacing opopenspacing opclosespacing \
-oppunctspacing opinnerspacing opfracspacing opradspacing opmiddlespacing \
-opaccentspacing binordspacing binopspacing binbinspacing binrelspacing \
-binopenspacing binclosespacing binpunctspacing bininnerspacing binfracspacing \
-binradspacing binmiddlespacing binaccentspacing relordspacing relopspacing \
-relbinspacing relrelspacing relopenspacing relclosespacing relpunctspacing \
-relinnerspacing relfracspacing relradspacing relmiddlespacing relaccentspacing \
-openordspacing openopspacing openbinspacing openrelspacing openopenspacing \
-openclosespacing openpunctspacing openinnerspacing openfracspacing openradspacing \
-openmiddlespacing openaccentspacing closeordspacing closeopspacing closebinspacing \
-closerelspacing closeopenspacing closeclosespacing closepunctspacing closeinnerspacing \
-closefracspacing closeradspacing closemiddlespacing closeaccentspacing punctordspacing \
-punctopspacing punctbinspacing punctrelspacing punctopenspacing punctclosespacing \
-punctpunctspacing punctinnerspacing punctfracspacing punctradspacing punctmiddlespacing \
-punctaccentspacing innerordspacing inneropspacing innerbinspacing innerrelspacing \
-inneropenspacing innerclosespacing innerpunctspacing innerinnerspacing innerfracspacing \
-innerradspacing innermiddlespacing inneraccentspacing fracordspacing fracopspacing \
-fracbinspacing fracrelspacing fracopenspacing fracclosespacing fracpunctspacing \
-fracinnerspacing fracfracspacing fracradspacing fracmiddlespacing fracaccentspacing \
-radordspacing radopspacing radbinspacing radrelspacing radopenspacing \
-radclosespacing radpunctspacing radinnerspacing radfracspacing radradspacing \
-radmiddlespacing radaccentspacing middleordspacing middleopspacing middlebinspacing \
-middlerelspacing middleopenspacing middleclosespacing middlepunctspacing middleinnerspacing \
-middlefracspacing middleradspacing middlemiddlespacing middleaccentspacing accentordspacing \
-accentopspacing accentbinspacing accentrelspacing accentopenspacing accentclosespacing \
-accentpunctspacing accentinnerspacing accentfracspacing accentradspacing accentmiddlespacing \
-accentaccentspacing normalreqno startimath stopimath normalstartimath \
-normalstopimath startdmath stopdmath normalstartdmath normalstopdmath \
-normalsuperscript normalsubscript normalnosuperscript normalnosubscript normalprimescript \
-superscript subscript nosuperscript nosubscript primescript \
-superprescript subprescript nosuperprescript nosubsprecript uncramped \
-cramped mathstyletrigger triggermathstyle triggeredmathstyle mathstylefont \
-mathsmallstylefont mathstyleface mathsmallstyleface mathstylecommand mathpalette \
-mathstylehbox mathstylevbox mathstylevcenter mathstylevcenteredhbox mathstylevcenteredvbox \
-mathtext setmathsmalltextbox setmathtextbox pushmathstyle popmathstyle \
-triggerdisplaystyle triggertextstyle triggerscriptstyle triggerscriptscriptstyle triggeruncrampedstyle \
-triggercrampedstyle triggersmallstyle triggeruncrampedsmallstyle triggercrampedsmallstyle triggerbigstyle \
-triggeruncrampedbigstyle triggercrampedbigstyle luaexpr expelsedoif expdoif \
-expdoifnot expdoifelsecommon expdoifcommonelse expdoifelseinset expdoifinsetelse \
-ctxdirectlua ctxlatelua ctxsprint ctxwrite ctxcommand \
-ctxdirectcommand ctxlatecommand ctxreport ctxlua luacode \
-lateluacode directluacode registerctxluafile ctxloadluafile luaversion \
-luamajorversion luaminorversion ctxluacode luaconditional luaexpanded \
-ctxluamatch startluaparameterset stopluaparameterset luaparameterset definenamedlua \
-obeylualines obeyluatokens startluacode stopluacode startlua \
-stoplua startctxfunction stopctxfunction ctxfunction startctxfunctiondefinition \
-stopctxfunctiondefinition installctxfunction installprotectedctxfunction installprotectedctxscanner installctxscanner \
-resetctxscanner cldprocessfile cldloadfile cldloadviafile cldcontext \
-cldcommand carryoverpar freezeparagraphproperties defrostparagraphproperties setparagraphfreezing \
-forgetparagraphfreezing updateparagraphproperties updateparagraphpenalties updateparagraphdemerits updateparagraphshapes \
-updateparagraphlines lastlinewidth assumelongusagecs Umathbottomaccent Umathtopaccent \
-Umathbotaccent righttolefthbox lefttorighthbox righttoleftvbox lefttorightvbox \
-righttoleftvtop lefttorightvtop rtlhbox ltrhbox rtlvbox \
-ltrvbox rtlvtop ltrvtop autodirhbox autodirvbox \
-autodirvtop leftorrighthbox leftorrightvbox leftorrightvtop lefttoright \
-righttoleft checkedlefttoright checkedrighttoleft synchronizelayoutdirection synchronizedisplaydirection \
-synchronizeinlinedirection dirlre dirrle dirlro dirrlo \
-rtltext ltrtext lesshyphens morehyphens nohyphens \
-dohyphens dohyphencollapsing nohyphencollapsing compounddiscretionary Ucheckedstartdisplaymath \
-Ucheckedstopdisplaymath break nobreak allowbreak goodbreak \
-nospace nospacing dospacing naturalhbox naturalvbox \
-naturalvtop naturalhpack naturalvpack naturaltpack reversehbox \
-reversevbox reversevtop reversehpack reversevpack reversetpack \
-hcontainer vcontainer tcontainer frule compoundhyphenpenalty \
-start stop unsupportedcs openout closeout \
-write openin closein read readline \
-readfromterminal boxlines boxline setboxline copyboxline \
-boxlinewd boxlineht boxlinedp boxlinenw boxlinenh \
-boxlinend boxlinels boxliners boxlinelh boxlinerh \
-boxlinelp boxlinerp boxlinein boxrangewd boxrangeht \
-boxrangedp bitwiseset bitwiseand bitwiseor bitwisexor \
-bitwisenot bitwisenil ifbitwiseand bitwise bitwiseshift \
-bitwiseflip textdir linedir pardir boxdir \
-prelistbox postlistbox prelistcopy postlistcopy setprelistbox \
-setpostlistbox noligaturing nokerning noexpansion noprotrusion \
-noleftkerning noleftligaturing norightkerning norightligaturing noitaliccorrection \
-futureletnexttoken defbackslashbreak letbackslashbreak pushoverloadmode popoverloadmode \
-pushrunstate poprunstate suggestedalias showboxhere discoptioncodestring \
-flagcodestring frozenparcodestring glyphoptioncodestring groupcodestring hyphenationcodestring \
-mathcontrolcodestring mathflattencodestring normalizecodestring parcontextcodestring newlocalcount \
-newlocaldimen newlocalskip newlocalmuskip newlocaltoks newlocalbox \
-newlocalwrite newlocalread setnewlocalcount setnewlocaldimen setnewlocalskip \
-setnewlocalmuskip setnewlocaltoks setnewlocalbox ifexpression
+vpackedbox hpackedbox normalreqno startimath stopimath \
+normalstartimath normalstopimath startdmath stopdmath normalstartdmath \
+normalstopdmath normalsuperscript normalsubscript normalnosuperscript normalnosubscript \
+normalprimescript superscript subscript nosuperscript nosubscript \
+primescript superprescript subprescript nosuperprescript nosubsprecript \
+uncramped cramped mathstyletrigger triggermathstyle triggeredmathstyle \
+mathstylefont mathsmallstylefont mathstyleface mathsmallstyleface mathstylecommand \
+mathpalette mathstylehbox mathstylevbox mathstylevcenter mathstylevcenteredhbox \
+mathstylevcenteredvbox mathtext setmathsmalltextbox setmathtextbox pushmathstyle \
+popmathstyle triggerdisplaystyle triggertextstyle triggerscriptstyle triggerscriptscriptstyle \
+triggeruncrampedstyle triggercrampedstyle triggersmallstyle triggeruncrampedsmallstyle triggercrampedsmallstyle \
+triggerbigstyle triggeruncrampedbigstyle triggercrampedbigstyle luaexpr expelsedoif \
+expdoif expdoifnot expdoifelsecommon expdoifcommonelse expdoifelseinset \
+expdoifinsetelse ctxdirectlua ctxlatelua ctxsprint ctxwrite \
+ctxcommand ctxdirectcommand ctxlatecommand ctxreport ctxlua \
+luacode lateluacode directluacode registerctxluafile ctxloadluafile \
+luaversion luamajorversion luaminorversion ctxluacode luaconditional \
+luaexpanded ctxluamatch startluaparameterset stopluaparameterset luaparameterset \
+definenamedlua obeylualines obeyluatokens startluacode stopluacode \
+startlua stoplua startctxfunction stopctxfunction ctxfunction \
+startctxfunctiondefinition stopctxfunctiondefinition installctxfunction installprotectedctxfunction installprotectedctxscanner \
+installctxscanner resetctxscanner cldprocessfile cldloadfile cldloadviafile \
+cldcontext cldcommand carryoverpar freezeparagraphproperties defrostparagraphproperties \
+setparagraphfreezing forgetparagraphfreezing updateparagraphproperties updateparagraphpenalties updateparagraphdemerits \
+updateparagraphshapes updateparagraphlines lastlinewidth assumelongusagecs righttolefthbox \
+lefttorighthbox righttoleftvbox lefttorightvbox righttoleftvtop lefttorightvtop \
+rtlhbox ltrhbox rtlvbox ltrvbox rtlvtop \
+ltrvtop autodirhbox autodirvbox autodirvtop leftorrighthbox \
+leftorrightvbox leftorrightvtop lefttoright righttoleft checkedlefttoright \
+checkedrighttoleft synchronizelayoutdirection synchronizedisplaydirection synchronizeinlinedirection dirlre \
+dirrle dirlro dirrlo rtltext ltrtext \
+lesshyphens morehyphens nohyphens dohyphens dohyphencollapsing \
+nohyphencollapsing compounddiscretionary Ucheckedstartdisplaymath Ucheckedstopdisplaymath break \
+nobreak allowbreak goodbreak nospace nospacing \
+dospacing naturalhbox naturalvbox naturalvtop naturalhpack \
+naturalvpack naturaltpack reversehbox reversevbox reversevtop \
+reversehpack reversevpack reversetpack hcontainer vcontainer \
+tcontainer frule compoundhyphenpenalty start stop \
+unsupportedcs openout closeout write openin \
+closein read readline readfromterminal boxlines \
+boxline setboxline copyboxline boxlinewd boxlineht \
+boxlinedp boxlinenw boxlinenh boxlinend boxlinels \
+boxliners boxlinelh boxlinerh boxlinelp boxlinerp \
+boxlinein boxrangewd boxrangeht boxrangedp bitwiseset \
+bitwiseand bitwiseor bitwisexor bitwisenot bitwisenil \
+ifbitwiseand bitwise bitwiseshift bitwiseflip textdir \
+linedir pardir boxdir prelistbox postlistbox \
+prelistcopy postlistcopy setprelistbox setpostlistbox noligaturing \
+nokerning noexpansion noprotrusion noleftkerning noleftligaturing \
+norightkerning norightligaturing noitaliccorrection futureletnexttoken defbackslashbreak \
+letbackslashbreak pushoverloadmode popoverloadmode pushrunstate poprunstate \
+suggestedalias showboxhere discoptioncodestring flagcodestring frozenparcodestring \
+glyphoptioncodestring groupcodestring hyphenationcodestring mathcontrolcodestring mathflattencodestring \
+normalizecodestring parcontextcodestring newlocalcount newlocaldimen newlocalskip \
+newlocalmuskip newlocaltoks newlocalbox newlocalwrite newlocalread \
+setnewlocalcount setnewlocaldimen setnewlocalskip setnewlocalmuskip setnewlocaltoks \
+setnewlocalbox ifexpression
diff --git a/context/data/scite/context/scite-context-data-tex.properties b/context/data/scite/context/scite-context-data-tex.properties
index 2a2ccfc53..6db151de8 100644
--- a/context/data/scite/context/scite-context-data-tex.properties
+++ b/context/data/scite/context/scite-context-data-tex.properties
@@ -62,78 +62,79 @@ automatichyphenpenalty automigrationmode autoparagraphmode begincsname beginloca
beginmathgroup beginsimplegroup boundary boxadapt boxanchor \
boxanchors boxattribute boxdirection boxfreeze boxgeometry \
boxorientation boxrepack boxshift boxsource boxtarget \
-boxtotal boxxmove boxxoffset boxymove boxyoffset \
-catcodetable cdef cdefcsname cfcode clearmarks \
-constant copymathatomrule copymathparent copymathspacing crampeddisplaystyle \
-crampedscriptscriptstyle crampedscriptstyle crampedtextstyle csactive csstring \
-currentloopiterator currentloopnesting currentmarks dbox defcsname \
-detokenized dimensiondef dimexpression directlua dpack \
-edefcsname efcode endlocalcontrol endmathgroup endsimplegroup \
-enforced etoks etoksapp etokspre everybeforepar \
-everymathatom everytab exceptionpenalty expand expandactive \
-expandafterpars expandafterspaces expandcstoken expanded expandedafter \
-expandedloop expandtoken explicitdiscretionary explicithyphenpenalty firstvalidlanguage \
-flushmarks fontcharta fontid fontmathcontrol fontspecdef \
-fontspecid fontspecifiedname fontspecifiedsize fontspecscale fontspecxscale \
-fontspecyscale fonttextcontrol formatname frozen futurecsname \
-futuredef futureexpand futureexpandis futureexpandisap gdefcsname \
-gleaders glet gletcsname glettonothing gluespecdef \
-glyph glyphdatafield glyphoptions glyphscale glyphscriptfield \
-glyphscriptscale glyphscriptscriptscale glyphstatefield glyphtextscale glyphxoffset \
-glyphxscale glyphxscaled glyphyoffset glyphyscale glyphyscaled \
-gtoksapp gtokspre hccode hjcode hmcode \
-holdingmigrations hpack hyphenationmin hyphenationmode ifabsdim \
-ifabsnum ifarguments ifboolean ifchkdim ifchknum \
-ifcmpdim ifcmpnum ifcondition ifcstok ifdimexpression \
-ifdimval ifempty ifflags ifhaschar ifhastok \
-ifhastoks ifhasxtoks ifincsname ifinsert ifmathparameter \
-ifmathstyle ifnumexpression ifnumval ifparameter ifparameters \
-ifrelax iftok ifzerodim ifzeronum ignorearguments \
-ignoredepthcriterium ignorepars immediate immutable indexofcharacter \
-indexofregister inherited initcatcodetable insertbox insertcopy \
-insertdepth insertdistance insertheight insertheights insertlimit \
-insertmaxdepth insertmode insertmultiplier insertpenalty insertprogress \
-insertstorage insertstoring insertunbox insertuncopy insertwidth \
-instance integerdef lastarguments lastatomclass lastboundary \
-lastchkdim lastchknum lastleftclass lastloopiterator lastnamedcs \
-lastnodesubtype lastpageextra lastparcontext lastrightclass leftmarginkern \
-letcharcode letcsname letfrozen letmathatomrule letmathparent \
-letmathspacing letprotected lettonothing linebreakcriterium linedirection \
-localbrokenpenalty localcontrol localcontrolled localcontrolledloop localinterlinepenalty \
-localleftbox localleftboxbox localmiddlebox localmiddleboxbox localrightbox \
-localrightboxbox lpcode luabytecode luabytecodecall luacopyinputnodes \
-luadef luaescapestring luafunction luafunctioncall luatexbanner \
-luatexrevision luatexversion mathaccent mathatom mathatomglue \
-mathatomskip mathbackwardpenalties mathbeginclass mathcheckfencesmode mathdictgroup \
-mathdictproperties mathdirection mathdisplaymode mathdisplayskipmode mathdoublescriptmode \
-mathendclass matheqnogapstep mathfenced mathfontcontrol mathforwardpenalties \
-mathfrac mathghost mathgluemode mathgroupingmode mathleftclass \
-mathlimitsmode mathmainstyle mathmiddle mathnolimitsmode mathpenaltiesmode \
-mathrad mathrightclass mathrulesfam mathrulesmode mathscale \
-mathscriptsmode mathslackmode mathspacingmode mathstackstyle mathstyle \
-mathstylefontid mathsurroundmode mathsurroundskip maththreshold meaningasis \
-meaningfull meaningless mugluespecdef mutable noaligned \
-noatomruling noboundary nohrule norelax normalizelinemode \
-normalizeparmode nospaces novrule numericscale numexpression \
-orelse orphanpenalties orphanpenalty orunless outputbox \
-overloaded overloadmode overshoot pageboundary pageextragoal \
-pagevsize parametercount parametermark parattribute pardirection \
-permanent pettymuskip postexhyphenchar posthyphenchar postinlinepenalty \
-prebinoppenalty predisplaygapfactor preexhyphenchar prehyphenchar preinlinepenalty \
-prerelpenalty protrudechars protrusionboundary pxdimen quitloop \
-quitvmode resetmathspacing retokenized rightmarginkern rpcode \
-savecatcodetable scaledemwidth scaledexheight scaledextraspace scaledfontdimen \
-scaledinterwordshrink scaledinterwordspace scaledinterwordstretch scaledmathstyle scaledslantperpoint \
-scantextokens semiexpand semiexpanded semiprotected setdefaultmathcodes \
-setfontid setmathatomrule setmathdisplaypostpenalty setmathdisplayprepenalty setmathignore \
-setmathoptions setmathpostpenalty setmathprepenalty setmathspacing shapingpenaltiesmode \
-shapingpenalty snapshotpar srule supmarkmode swapcsvalues \
-tabsize textdirection thewithoutunit tinymuskip todimension \
-tohexadecimal tointeger tokenized toksapp tokspre \
-tolerant tomathstyle toscaled tosparsedimension tosparsescaled \
-tpack tracingadjusts tracingalignments tracingexpressions tracingfonts \
-tracingfullboxes tracinghyphenation tracinginserts tracinglevels tracinglists \
-tracingmarks tracingmath tracingnodes tracingpenalties uleaders \
+boxtotal boxvadjust boxxmove boxxoffset boxymove \
+boxyoffset catcodetable cdef cdefcsname cfcode \
+clearmarks constant copymathatomrule copymathparent copymathspacing \
+crampeddisplaystyle crampedscriptscriptstyle crampedscriptstyle crampedtextstyle csactive \
+csstring currentloopiterator currentloopnesting currentmarks dbox \
+defcsname detokenized dimensiondef dimexpression directlua \
+dpack dsplit edefcsname efcode endlocalcontrol \
+endmathgroup endsimplegroup enforced etoks etoksapp \
+etokspre everybeforepar everymathatom everytab exceptionpenalty \
+expand expandactive expandafterpars expandafterspaces expandcstoken \
+expanded expandedafter expandedloop expandtoken explicitdiscretionary \
+explicithyphenpenalty firstvalidlanguage flushmarks fontcharta fontid \
+fontmathcontrol fontspecdef fontspecid fontspecifiedname fontspecifiedsize \
+fontspecscale fontspecxscale fontspecyscale fonttextcontrol formatname \
+frozen futurecsname futuredef futureexpand futureexpandis \
+futureexpandisap gdefcsname gleaders glet gletcsname \
+glettonothing gluespecdef glyph glyphdatafield glyphoptions \
+glyphscale glyphscriptfield glyphscriptscale glyphscriptscriptscale glyphstatefield \
+glyphtextscale glyphxoffset glyphxscale glyphxscaled glyphyoffset \
+glyphyscale glyphyscaled gtoksapp gtokspre hccode \
+hjcode hmcode holdingmigrations hpack hyphenationmin \
+hyphenationmode ifabsdim ifabsnum ifarguments ifboolean \
+ifchkdim ifchkdimension ifchknum ifchknumber ifcmpdim \
+ifcmpnum ifcondition ifcstok ifdimexpression ifdimval \
+ifempty ifflags ifhaschar ifhastok ifhastoks \
+ifhasxtoks ifincsname ifinsert ifmathparameter ifmathstyle \
+ifnumexpression ifnumval ifparameter ifparameters ifrelax \
+iftok ifzerodim ifzeronum ignorearguments ignoredepthcriterium \
+ignorepars immediate immutable indexofcharacter indexofregister \
+inherited initcatcodetable insertbox insertcopy insertdepth \
+insertdistance insertheight insertheights insertlimit insertmaxdepth \
+insertmode insertmultiplier insertpenalty insertprogress insertstorage \
+insertstoring insertunbox insertuncopy insertwidth instance \
+integerdef lastarguments lastatomclass lastboundary lastchkdim \
+lastchknum lastleftclass lastloopiterator lastnamedcs lastnodesubtype \
+lastpageextra lastparcontext lastrightclass leftmarginkern letcharcode \
+letcsname letfrozen letmathatomrule letmathparent letmathspacing \
+letprotected lettonothing linebreakcriterium linedirection localbrokenpenalty \
+localcontrol localcontrolled localcontrolledloop localinterlinepenalty localleftbox \
+localleftboxbox localmiddlebox localmiddleboxbox localrightbox localrightboxbox \
+lpcode luabytecode luabytecodecall luacopyinputnodes luadef \
+luaescapestring luafunction luafunctioncall luatexbanner luatexrevision \
+luatexversion mathaccent mathatom mathatomglue mathatomskip \
+mathbackwardpenalties mathbeginclass mathcheckfencesmode mathdictgroup mathdictproperties \
+mathdirection mathdisplaymode mathdisplayskipmode mathdoublescriptmode mathendclass \
+matheqnogapstep mathfenced mathfontcontrol mathforwardpenalties mathfraction \
+mathghost mathgluemode mathgroupingmode mathleftclass mathlimitsmode \
+mathmainstyle mathmiddle mathnolimitsmode mathpenaltiesmode mathradical \
+mathrightclass mathrulesfam mathrulesmode mathscale mathscriptsmode \
+mathslackmode mathspacingmode mathstackstyle mathstyle mathstylefontid \
+mathsurroundmode mathsurroundskip maththreshold meaningasis meaningfull \
+meaningless mugluespecdef mutable noaligned noatomruling \
+noboundary nohrule norelax normalizelinemode normalizeparmode \
+nospaces novrule numericscale numexpression orelse \
+orphanpenalties orphanpenalty orunless outputbox overloaded \
+overloadmode overshoot pageboundary pageextragoal pagevsize \
+parametercount parametermark parattribute pardirection permanent \
+pettymuskip postexhyphenchar posthyphenchar postinlinepenalty prebinoppenalty \
+predisplaygapfactor preexhyphenchar prehyphenchar preinlinepenalty prerelpenalty \
+protrudechars protrusionboundary pxdimen quitloop quitvmode \
+resetmathspacing retokenized rightmarginkern rpcode savecatcodetable \
+scaledemwidth scaledexheight scaledextraspace scaledfontdimen scaledinterwordshrink \
+scaledinterwordspace scaledinterwordstretch scaledmathstyle scaledslantperpoint scantextokens \
+semiexpand semiexpanded semiprotected setdefaultmathcodes setfontid \
+setmathatomrule setmathdisplaypostpenalty setmathdisplayprepenalty setmathignore setmathoptions \
+setmathpostpenalty setmathprepenalty setmathspacing shapingpenaltiesmode shapingpenalty \
+snapshotpar srule supmarkmode swapcsvalues tabsize \
+textdirection thewithoutunit tinymuskip todimension tohexadecimal \
+tointeger tokenized toksapp tokspre tolerant \
+tomathstyle toscaled tosparsedimension tosparsescaled tpack \
+tracingadjusts tracingalignments tracingexpressions tracingfonts tracingfullboxes \
+tracinghyphenation tracinginserts tracinglevels tracinglists tracingmarks \
+tracingmath tracingnodes tracingpenalties tsplit uleaders \
undent unexpandedloop unhpack unletfrozen unletprotected \
untraced unvpack variablefam vpack wordboundary \
wrapuppar xdefcsname xtoks xtoksapp xtokspre
@@ -178,60 +179,60 @@ cr crcr csname day deadcycles \
def defaulthyphenchar defaultskewchar delcode delimiter \
delimiterfactor delimitershortfall dimen dimendef discretionary \
displayindent displaylimits displaystyle displaywidowpenalty displaywidth \
-divide divideby doublehyphendemerits dp dsplit \
-dump edef else emergencystretch end \
-endcsname endgroup endinput endlinechar eqno \
-errhelp errmessage errorcontextlines errorstopmode escapechar \
-everycr everydisplay everyhbox everyjob everymath \
-everypar everyvbox exhyphenchar exhyphenpenalty expandafter \
-fam fi finalhyphendemerits firstmark floatingpenalty \
-font fontdimen fontname futurelet gdef \
-global globaldefs halign hangafter hangindent \
-hbadness hbox hfil hfill hfilneg \
-hfuzz holdinginserts hrule hsize hskip \
-hss ht hyphenation hyphenchar hyphenpenalty \
-if ifcase ifcat ifdim iffalse \
-ifhbox ifhmode ifinner ifmmode ifnum \
-ifodd iftrue ifvbox ifvmode ifvoid \
-ifx ignorespaces indent input inputlineno \
-insert insertpenalties interlinepenalty jobname kern \
-language lastbox lastkern lastpenalty lastskip \
-lccode leaders left lefthyphenmin leftskip \
-leqno let limits linepenalty lineskip \
-lineskiplimit long looseness lower lowercase \
-mark mathbin mathchar mathchardef mathchoice \
-mathclose mathcode mathinner mathop mathopen \
-mathord mathpunct mathrel mathsurround maxdeadcycles \
-maxdepth meaning medmuskip message middle \
-mkern month moveleft moveright mskip \
-multiply multiplyby muskip muskipdef newlinechar \
-noalign noexpand noindent nolimits nonscript \
-nonstopmode nulldelimiterspace nullfont number omit \
-or outer output outputpenalty over \
-overfullrule overline overwithdelims pagedepth pagefilllstretch \
-pagefillstretch pagefilstretch pagegoal pageshrink pagestretch \
-pagetotal par parfillleftskip parfillskip parindent \
-parinitleftskip parinitrightskip parshape parskip patterns \
-pausing penalty postdisplaypenalty predisplaypenalty predisplaysize \
-pretolerance prevdepth prevgraf radical raise \
-relax relpenalty right righthyphenmin rightskip \
-romannumeral scriptfont scriptscriptfont scriptscriptstyle scriptspace \
-scriptstyle scrollmode setbox setlanguage sfcode \
-shipout show showbox showboxbreadth showboxdepth \
-showlists shownodedetails showthe skewchar skip \
-skipdef spacefactor spaceskip span splitbotmark \
-splitfirstmark splitmaxdepth splittopskip string tabskip \
-textfont textstyle the thickmuskip thinmuskip \
-time toks toksdef tolerance topmark \
-topskip tracingcommands tracinglostchars tracingmacros tracingonline \
-tracingoutput tracingpages tracingparagraphs tracingrestores tracingstats \
-tsplit uccode uchyph unboundary underline \
-unhbox unhcopy unkern unpenalty unskip \
-unvbox unvcopy uppercase vadjust valign \
-vbadness vbox vcenter vfil vfill \
-vfilneg vfuzz vrule vsize vskip \
-vsplit vss vtop wd widowpenalty \
-xdef xleaders xspaceskip year
+divide divideby doublehyphendemerits dp dump \
+edef else emergencystretch end endcsname \
+endgroup endinput endlinechar eqno errhelp \
+errmessage errorcontextlines errorstopmode escapechar everycr \
+everydisplay everyhbox everyjob everymath everypar \
+everyvbox exhyphenchar exhyphenpenalty expandafter fam \
+fi finalhyphendemerits firstmark floatingpenalty font \
+fontdimen fontname futurelet gdef global \
+globaldefs halign hangafter hangindent hbadness \
+hbox hfil hfill hfilneg hfuzz \
+holdinginserts hrule hsize hskip hss \
+ht hyphenation hyphenchar hyphenpenalty if \
+ifcase ifcat ifdim iffalse ifhbox \
+ifhmode ifinner ifmmode ifnum ifodd \
+iftrue ifvbox ifvmode ifvoid ifx \
+ignorespaces indent input inputlineno insert \
+insertpenalties interlinepenalty jobname kern language \
+lastbox lastkern lastpenalty lastskip lccode \
+leaders left lefthyphenmin leftskip leqno \
+let limits linepenalty lineskip lineskiplimit \
+long looseness lower lowercase mark \
+mathbin mathchar mathchardef mathchoice mathclose \
+mathcode mathinner mathop mathopen mathord \
+mathpunct mathrel mathsurround maxdeadcycles maxdepth \
+meaning medmuskip message middle mkern \
+month moveleft moveright mskip multiply \
+multiplyby muskip muskipdef newlinechar noalign \
+noexpand noindent nolimits nonscript nonstopmode \
+nulldelimiterspace nullfont number omit or \
+outer output outputpenalty over overfullrule \
+overline overwithdelims pagedepth pagefilllstretch pagefillstretch \
+pagefilstretch pagegoal pageshrink pagestretch pagetotal \
+par parfillleftskip parfillskip parindent parinitleftskip \
+parinitrightskip parshape parskip patterns pausing \
+penalty postdisplaypenalty predisplaypenalty predisplaysize pretolerance \
+prevdepth prevgraf radical raise relax \
+relpenalty right righthyphenmin rightskip romannumeral \
+scriptfont scriptscriptfont scriptscriptstyle scriptspace scriptstyle \
+scrollmode setbox setlanguage sfcode shipout \
+show showbox showboxbreadth showboxdepth showlists \
+shownodedetails showthe skewchar skip skipdef \
+spacefactor spaceskip span splitbotmark splitfirstmark \
+splitmaxdepth splittopskip string tabskip textfont \
+textstyle the thickmuskip thinmuskip time \
+toks toksdef tolerance topmark topskip \
+tracingcommands tracinglostchars tracingmacros tracingonline tracingoutput \
+tracingpages tracingparagraphs tracingrestores tracingstats uccode \
+uchyph unboundary underline unhbox unhcopy \
+unkern unpenalty unskip unvbox unvcopy \
+uppercase vadjust valign vbadness vbox \
+vcenter vfil vfill vfilneg vfuzz \
+vrule vsize vskip vsplit vss \
+vtop wd widowpenalty xdef xleaders \
+xspaceskip year
keywordclass.tex.xetex=\
XeTeXversion
diff --git a/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex b/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex
index 550e06819..e2e34bd20 100644
--- a/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex
+++ b/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex
@@ -897,3 +897,15 @@ that users will find reasons to abuse this effect.
%
% test \par \box0 \par \box2 \par test
+
+\setbox0\vbox
+{
+ \setbox \scratchbox \hbox{XXX}
+ \boxvadjust\scratchbox pre {BBB}
+ \boxvadjust\scratchbox post {AAA}
+% \dontleavehmode % needed
+ \box\scratchbox
+% \unhbox\scratchbox
+}
+
+111111\par \box0 \par 222222\par
diff --git a/doc/context/sources/general/manuals/math/math-notdone.tex b/doc/context/sources/general/manuals/math/math-notdone.tex
index 757cebbe2..9cb5c8027 100644
--- a/doc/context/sources/general/manuals/math/math-notdone.tex
+++ b/doc/context/sources/general/manuals/math/math-notdone.tex
@@ -9,7 +9,7 @@
\startchapter[title=Why we don't do this]
The \TEX\ engine has two math modes: inline and display. What exactly happens
-before we do that depends on what mode we are in.
+before we enter math depends on what mode we are in.
\startitemize
\startitem
@@ -25,7 +25,7 @@ before we do that depends on what mode we are in.
indentation and everything that \type {\everypar} likes to inject. Inline
math then stays inline but display math starts out with flushing the
current paragraph and that happens to be the state, indentation and
- everything else injected at the beginning. Often nothing is sees, just
+ everything else injected at the beginning. Often nothing is seen, just
an empty line sits there.
\stopitem
\startitem
@@ -35,7 +35,7 @@ before we do that depends on what mode we are in.
\stopitemize
Especially the second case is tricky. The \quote {empty} line is placed with
-proper \type {\parskip}, \type {\parindent} and whatever. That can end up with a
+proper \typ {\parskip}, \typ {\parindent} and whatever. That can end up with a
lot of supposedly whitespace of which is not really clear (for the user) what
comes from where: interline space, whitespace, line height, display spacing, etc.
To that you can add that empty lines are special themselves: in \MKII\ we relax
@@ -43,8 +43,8 @@ To that you can add that empty lines are special themselves: in \MKII\ we relax
\LUAMETATEX\ has no checks at all. \footnote {The same can be told about \type
{\outer}.}
-Before We show some examples of this we have to make clear that \CONTEXT\ users
-don't do this have to worry about all this. We don't follow the (Plain and
+Before we show some examples of this we have to make clear that \CONTEXT\ users
+don't have to worry about all this. We don't follow the (Plain and
\LATEX) \AMS\ policy of \quotation {no empty lines before display math} and
\quotation {no empty lines in display math}. We don't even use the display skip
parameters and we do compensate for these empty line issues. The basics haven't
@@ -112,9 +112,9 @@ make sure that we operate in regular \TEX\ mode, the way other macro packages do
First we show what we get with \typ {\mathdisplayskipmode 1}. This makes the
engine behave like other engines. We don't show what we get with \typ
-{\mathdisplayskipmode 2} where zero skips are ignored but we don't have these
-here. Last we show what we get with \typ {\mathdisplayskipmode 3}. In this
-example the math specific skips are completely ignored.
+{\mathdisplayskipmode 2} where zero skips are ignored but we don't have these.
+Last we show what we get with \typ {\mathdisplayskipmode 3}. Here the math
+specific skips are completely ignored.
In both shown cases you will notice that the \type {\parskip} and \type
{\baselineskip} interfere which in turn demonstrates why in \CONTEXT\ we always
@@ -134,6 +134,13 @@ macro packages will use it no time will be wasted on this.
{\mathdisplayskipmode 1 \getbuffer}
{\mathdisplayskipmode 3 \getbuffer}
+
+% \mathdisplaymode 0
+% before \par $$ \vadjust {\bf post 1} \vadjust {\bf post 2} x_2 \vadjust pre {\bf pre} $$ \par after \blank[3*line]
+% before \par $$ \vadjust {\bf post 1} \vadjust {\bf post 2} x_2 \vadjust pre {\bf pre} $$ \par after \blank[3*line]
+% before \par $ \vadjust {\bf post 1} \vadjust {\bf post 2} x_3 \vadjust pre {\bf pre} $ \par after \blank[3*line]
+% before \par $\displaystyle \vadjust {\bf post 1} \vadjust {\bf post 2} x_3 \vadjust pre {\bf pre} $ \par after \blank[3*line]
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/musings/musings-speed.tex b/doc/context/sources/general/manuals/musings/musings-speed.tex
new file mode 100644
index 000000000..ecf6d220b
--- /dev/null
+++ b/doc/context/sources/general/manuals/musings/musings-speed.tex
@@ -0,0 +1,687 @@
+% language=us runpath=texruns:manuals/musings
+
+% musical timestamp: listening to FLUX (jazz trio) in Januari 2023
+
+\startcomponent musings-speed
+
+\environment musings-style
+
+\startchapter[title={Speeding up \TEX}]
+
+\startsection[title={Introduction}]
+
+Recently a couple of cordless phones that I use gave up as soon as I used them
+for a minute or so. The first time that happened I figured that after all these
+years the batteries had gone bad and after some testing I decided to replace
+them. I got some of these high end batteries that discharge slowly and store a
+lot of power. Within a year they were dead too. Then I went for the more regular
+and cheaper ones, again with a lot of capacity. And yes, these also gave up, that
+is: only in the phones that were hardly used. The batteries lasted longer in
+phones that were discharged by usage daily.
+
+When I went out for new batteries I was asked if I needed them for cordless
+phones and, surprise, was given special ones that actually stored less but were
+guaranteed to work for at least 6 years. The package explicitly mentioned use in
+cordless phones. So here performance doesn't come with the most high end ones,
+based on specifications that impress.
+
+This is also true for computers that are used to process \TEX\ documents. More
+cores amount to much accumulated processing power but for a single core \TEX\
+process, a few fast cores are more relevant than plenty slower ones that run in
+parallel. More memory helps but compared to other processes \TEX\ actually
+doesn't use that much memory. And disk speed matters but less so when the
+operating system caches files. What does play a role are cpu caches because \TEX\
+is very memory intense and processing is not concentrated in a few functions. But
+a large cache shared among many (busy) cores makes for a less impressive
+performance.
+
+So what matters really? In the next sections we will explore a few points of
+view. It's not some advertisement for a specific engine, but much more about
+putting it into perspective (as one can run into ridiculous arguments on the
+web). It is not only the hardware and software that matters but also how one uses
+it.
+
+\stopsection
+
+\startsection[title=The engine]
+
+There are various ways to compare engines and each has its own characteristics.
+The \PDFTEX\ engine is closest to the original. It directly produces the output
+which can give it an edge. It is eight bit and therefore uses small fonts and
+internally all that is related to fonts and characters is also small. This means
+that there is little overhead in typesetting a paragraph: hyphenation, ligature
+building and kerning are interwoven and perform well.
+
+The \XETEX\ engine supports wide fonts and \UNICODE\ and therefore can be seen as
+32 bit. I never looked into the code so I can't tell how far that goes but
+performance is definitely less than \PDFTEX. The rendering of text is delegated
+to a library (there were some changes in that along its development) which is
+less efficient than the built in \PDFTEX\ route. But it is also more powerful.
+
+The \LUATEX\ engine is mostly 32 bit and delegates non standard font handling to
+\LUA\ which comes with a performance penalty but also adds a lot of flexibility.
+Also, the fact that one can call out to \LUA\ in many places makes that one can
+not really blame the engine for performance hits. The fact that hyphenation,
+ligature building and kerning is split comes at a small price too. We have larger
+nodes so compared to \PDFTEX\ more memory is used and accessed. Some mechanisms
+are actually more efficient, like font expansion and protrusion.
+
+The \LUAMETATEX\ engine lacks a font loader (but it does have the traditional
+renderer on board) and it has no backend. So even more is delegated to \LUA,
+which in turn makes this the slowest of the lot. And, again more data travels
+with nodes. In some modes of operation much more calculations take place.
+However, because it has an enriched macro processor, additional primitives, and
+plenty deep down \quote {improvements} it can perform better than \LUATEX\ (and
+even \LUAJITTEX, the \LUATEX\ version with a faster but limited \LUA\ virtual
+machine). And as with \LUATEX, there are usage patterns that make it faster than
+\PDFTEX.
+
+So, in general the order of performance is \PDFTEX, \XETEX, \LUAJITTEX\ (kind of
+obsolete), \LUATEX, \LUAMETATEX. But then, how come that \CONTEXT\ users never
+complain about performance? The reasons is simple: performance is quite okay and
+as it is relative to what one does, a user will accept a drop in performance when
+more has to be done. When we moved on from \LUATEX\ to \LUAMETATEX\ there
+definitely was a drop in performance, simply because of the \LUA\ backend.
+Because upgrading happened in small (but continuous) steps, right from the start
+the new engine was good enough to be used in production which is why most users
+switched to \LMTX\ as soon as became clear that this is where the progress is
+made.
+
+There were no real complaints about the upto 15\percent\ initial performance drop
+which indicates that for most users it doesn't matter that much. As the engine
+evolved we could gain some back and now \LUAMETATEX\ ends up between \PDFTEX\ and
+\LUATEX\ and in many modern scenarios even comes out first. The fact that in the
+meantime we can be much faster than \LUATEX\ did get noticed (when asked).
+However, as development takes years updating a machine in the meantime puts
+discussions about performance in a different (causality) perspective anyway.
+
+\stopsection
+
+\startsection[title=The coding]
+
+Performance can increase when native engine features are used instead of complex
+macros that have to work around limitations. It can also decrease when new
+features are used that add complex functionality. And when an engine extends
+existing functionality that is likely to come at a price. So where \LUAMETATEX\
+provides a more rich programming environment, it also had a more complex par
+builder, page builder, insert, mark and adjust handling, plenty of extra
+character, rule and box features and all of that definitely adds some overhead.
+Quite often a gain in simplicity (nicer and more efficient macros) compensate the
+more complex features. That is because on the average the engine doesn't do that
+much (tens of thousands of the same) complex macro expansion and also doesn't
+demand that much complex low level typesetting. A gain here is often compensated
+by a loss there. This is one reason why during the years \LUAMETATEX\ could
+sustain a decent performance. Personally I don't accept a drop in performance
+easily which is why in practice most mechanism, even when extended, probably
+perform better but I'm not going to prove that observation.
+
+One important reason why \CONTEXT\ \LMTX\ with \LUAMETATEX\ is faster than its
+ancestors is that we got rid of some intermediate programming layers. Most users
+have never seen the auxiliary macros or implementation details but plenty were
+used in \MKII\ and \MKIV. Of course we kept them because often they are nicer
+than many lines of primitive code, but only a few (and less in the future) are
+used in the core. Examples are multi step macros (that pick up arguments) that
+became single step and complex if tests that became inline native tests. Because
+\CONTEXT\ always had a high level of abstraction consistency of the interface
+also makes that we don't need many helpers. When some features (like for instance
+box manipulation) got extended one could expect a performance hit due to more
+extensive optional keyword scanning in the engine but that was compensated by
+improved scanners. The same is true for scanning numbers and dimensions. So, more
+functionality doesn't always come at a price.
+
+To summarize this: although the engine went a bit more \quote {cisc} than \type
+{risc} the macro package went more \quote {risc}. It reminds me a bit of the end
+of the previous century when there was much talk of fourth generation languages,
+something on top of the normal languages. In the end it were scripting languages
+that became the fashion while traditional languages like \CCODE\ remained
+relatively stable and unchanged for implementing them (and more). A similar
+observation can be made for \CONTEXT\ itself. Whenever some new feature gets
+added to an existing mechanism I try to not cripple performance and thanks to the
+way \CONTEXT\ is set up it works out okay.
+
+Let's look at an example. In \MKII\ we can compare two \quote {strings} with the
+macro \type {doifelse}. Its definition is as follows:
+
+\starttyping
+\long\def\doifelse#1#2%
+ {\let\donottest\dontprocesstest
+ \edef\!!stringa{#1}%
+ \edef\!!stringb{#2}%
+ \let\donottest\doprocesstest
+ \ifx\!!stringa\!!stringb
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+\stoptyping
+
+This macro takes two arguments that gets expanded inside two helpers that we
+then compare with a primitive \type {\ifx}. Depending on the outcome we
+expand one of the two following arguments but first we get rid of the interfering
+\type {\else} and \type {\fi}. The pushing and popping of \type {\donottest} takes
+care of protection of unwanted expansion in an \type {\edef}. Many functional macros
+are what we call protected: then expand in two steps depending on the embedded
+\type {\donottest} macro. Think of (simplified):
+
+\starttyping
+\def\realfoo{something is done here}
+\def\usedfoo{\donottest\realfoo}
+\stoptyping
+
+Normally \type {\donottest} is doing nothing so \type {\realfoo} gets expanded
+but there are cases where we (for instance) \type {\let} it be \type {\string}
+which then serializes the macro. This is something that happens when writing to
+the multi pass data file. It can also be used for overloading, for instance in
+the backend or when converting something. This protection against expansion has
+always been a \CONTEXT\ feature, which in turn made it pretty robust in multi
+pass scenarios, but it definitely came with performance penalty.
+
+When \PDFTEX\ got the \ETEX\ extensions we could use the \type {\protected}
+prefix to replace this trickery. That means that \MKII\ will use a different
+definition of \type {\doifelse} when that primitive is known:
+
+\starttyping
+\long\def\doifelse#1#2%
+ {\edef\!!stringa{#1}%
+ \edef\!!stringb{#2}%
+ \ifx\!!stringa\!!stringb
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+\stoptyping
+
+This works okay because we now do this:
+
+\starttyping
+\protected\def\usedfoo{something is done here}
+\stoptyping
+
+The \type {\doifelse} helper itself is not protected in \MKII\ (non \ETEX\ mode)
+It would be a performance hit. I won't bore the reader with the tricks needed to
+do the opposite, that is: expand a protected macro. It is seldom needed anyway.
+
+The \MKIV\ definition used with \LUATEX\ is not much different, only the \type
+{\long} prefix is missing. That one is needed when one wants \type {#1} and|/|or
+\type {#2} to be tolerant with respect to embedded \type {\par} equivalents. In
+\LUAMETATEX\ we can disable that check and in \CONTEXT\ all macros are thereby
+\type {\long}. Users won't notice because in \CONTEXT\ most macros were always
+defined the long way; we also suppress \type {\outer} errors.
+
+\starttyping
+\protected\def\doifelse#1#2%
+ {\edef\m_syst_string_one{#1}%
+ \edef\m_syst_string_two{#2}%
+ \ifx\m_syst_string_one\m_syst_string_two
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+\stoptyping
+
+Implementation wise a macro, once scanned and stored, carries the long property
+in its command code so that has overhead. However because \LUATEX\ is compatible
+we cannot make all normal macros long by default when \type {\suppresslongerror}
+is used. Therefore checking for an argument running into a \type {\par} is still
+checked but the message is suppressed based on the setting of the mentioned
+parameter. Performance wise, not using \type {\long} comes a the cost of checking
+a parameter which means an additional memory access and comparison. Unless we
+otherwise gain something in the engine it comes at a cost. In \LUAMETATEX\ the
+\type {\long} and \type {\outer} prefixes are ignored. Even better, protected
+macros are also implemented a bit more efficiently.
+
+In the end the definition of \type {\doifelse} in \LMTX\ looks a bit different:
+
+\starttyping
+\permanent\protected\def\doifelse#1#2%
+ {\iftok{#1}{#2}%
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+\stoptyping
+
+The \typ {\permanent} prefix flags this macro as such. Depending on the value of
+\typ {\overloadmode} a redefinition is permitted, comes with a warning or
+results in a fatal error. Of course this comes at a price when we define macros
+or values of quantities but this is rather well compensated by all kind of
+improvements in handling macros: defining, expansion, saving and restoring, etc.
+
+More interesting is the use of \type {\iftok} here. It saves us defining two
+helper macros. Of course the content still needs to be expanded before comparison
+but we no longer have various macro management overhead. In scenarios where we
+don't need to jump over the \type {\else} or \type {\fi} we can use this test in
+place which saves passing two arguments and grabbing one argument later on.
+Actually, grabbing is also different, compare:
+
+\starttyping
+ \def\firstoftwoarguments #1#2{#1} % MkII and MkIV
+\permanent\def\firstoftwoarguments #1#-{#1} % MkXL aka LMTX
+
+ \def\secondoftwoarguments#1#2{#1} % MkII and MkIV
+\permanent\def\secondoftwoarguments#-#1{#1} % MkXL aka LMTX
+\stoptyping
+
+In the case of \LUAMETATEX\ the \type {#-} makes that we don't even bother to
+store the argument as it is ignored. Where \type {#0} does the same it also
+increments the argument counter which is why here even the second arguments has
+number ~1. Now, if this more efficient? Sure, but how often does it really
+happen? The engine still needs to scan (which comes at a cost) but we save on
+temporary token list storage. Because \TEX\ is so fast already, measuring only
+shows differences when one has many (and here a real lot) iterations. However,
+all these small bits add up which is what we've seen in 2022 in \CONTEXT: it is
+the reason why we are now faster than \MKIV\ with \LUATEX, even with more
+functionality in the engine.
+
+I can probably write hundreds of pages in explaining what was added, changed,
+made more flexible and what side effects it had|/|has on performance but I bet no
+one is really interested in that. In fact, the previous exploration is just a
+side effect of a question that triggered it, so maybe future questions will
+trigger more explanations. It anyhow demonstrates what I meant when I said that
+\LUAMETATEX\ is meant to be leaner and meaner. Of course the code base and binary
+is smaller but that also gets compensated by more functionality. It also means
+that we can make the \CONTEXT\ code base nicer because for me a good looking
+source (which of course is subjective) is pretty important.
+
+\stopsection
+
+\startsection[title=Compatibility]
+
+There are non \CONTEXT\ users who seem to love to stress that successive versions
+of \CONTEXT\ are incompatible. Other claims are that it is developed in a
+commercial setting. While it is true that there are changes and it is also true
+that \CONTEXT\ is used in commercial settings, it is not that different from
+other open source projects. The majority of the code is written without
+compensation and it is offered without advertisements or request for support. It
+is true that when we can render better, it will be done. But the user interfaces
+only change when there is a reason and there are few cases where some
+functionality became obsolete, think of input and font encodings. Most such
+changes directly relate to the engine: in \PDFTEX\ and \MKII\ we emulate \UTF-8\
+wile in \LUATEX\ is comes natively. In \PDFTEX\ eight bit (\TYPEONE) fonts are
+used while \LUATEX\ adds support for \OPENTYPE. Other macro packages support that
+by additional packages while \CONTEXT\ has it integrated. That is why the system
+evolves over time.
+
+Just a users adapt to (yearly) operating system interfaces, mobile phones, all
+kinds of hardware, cars, clothing, media and so on, the \CONTEXT\ users have no
+problem adapting to an evolving \TEX\ ecosystem. I guess claims about changes
+(being a disadvantage) can only point to a lack of development elsewhere. The
+main reason for mentioning this is that when \CONTEXT\ users move on to newer
+engines, the older ones are seldom used. So, few users compare a \LMTX\ run with
+one using \PDFTEX\ or \LUATEX. They naturally expect \LUAMETATEX\ to perform well
+and maybe even to perform better over time. They just don't complain. And unless
+one hacks (overloads) system macros compatibility is not really an issue. What
+can be an issue is that updates and adaptations to a newer engine come with bugs
+but those are solved.
+
+So, the fact that we compare incompatible engines with likely different low level
+macro implementations of otherwise stable features of a macro package makes
+comparison hard. For instance, maybe there are speedups possible in frozen \MKII,
+although it is unlikely, which makes that it might even perform better than
+reported. In a similar fashion, the fact that \OPENTYPE\ is more demanding for
+sure makes that \LUATEX\ rendering is slower than \PDFTEX. It anyhow makes a
+discussion about performance within and between macro packages even more
+ridiculous. Just don't buy those claims and|/|or ask on the \CONTEXT\ mailing
+list for clarification.
+
+\stopsection
+
+\startsection[title=The job]
+
+So, say that we now have an efficient and powerful engine and a matching macro
+package. Does that make all jobs faster? For sure, the ones that I use as
+benchmark run much smoother. The 360 page \LUAMETATEX\ manual runs in less than
+8.4 seconds on a Dell Precision laptop with (mobile) Intel(R) Xeon(R) CPU
+E3-1505M v6 @ 3.00GHz, 2TB fast Samsung pro SSD, and 48 GB of memory, running
+Windows 10. The \METAFUN\ manual with many more pages and thousands of \METAPOST\
+graphics needs a bit more than 12 seconds. So you don't hear me complain. This
+chapter takes 7.5 seconds plus 0.5 is for the runner, not enough time to get
+coffee.
+
+Nowadays I tend to measure performance in terms of pages per second, because in
+the end that is what users experience. For me more important are the gains for my
+colleague who processes documents of 400 pages from hundreds of small \XML\ files
+with multiple graphics per page. Given different output variants a lot of
+processing takes place, so there a gain from 20 pages per second to 25 pages per
+second is welcome. Anyway, here are a few measurements of a {\em simple} test suite
+per January 7, 2023. We use this as test text:
+
+\starttyping
+\def\Knuth{%%
+Thus, I came to the conclusion that the designer of a new system
+must not only be the implementer and first large||scale user; the
+designer should also write the first user manual.
+\par
+The separation of any of these four components would have hurt
+\TeX\ significantly. If I had not participated fully in all these
+activities, literally hundreds of improvements would never have
+been made, because I would never have thought of them or perceived
+why they were important.
+\par
+But a system cannot be successful if it is too strongly influenced
+by a single person. Once the initial design is complete and fairly
+robust, the real test begins as people with many different
+viewpoints undertake their own experiments.
+}
+\stoptyping
+
+Now keep in mind that these are simple examples. On more complex documents the
+\LUAMETATEX\ engine with \LMTX\ is relatively faster: think \XML, plenty
+\METAPOST, complex tables, advanced math, dozens of fonts in combination with the
+new compact font mode.
+
+The tests themselves are simple: we switch fonts (because fonts bring overhead),
+we add some color (because we use different methods), we process some graphics
+(to show what embedding \METAPOST\ brings), we do some tables (because that can
+be stressful). Each sample is run 50, 500 or 1000 times, and each set is run a
+couple of times so that we compensate for caching and fluctuating system load.
+The tests are more about signaling a trend than about absolute numbers. For
+what it's worth, I used a \LUA\ script to run the samples.
+
+When you run an experiment that measures performance, keep in mind that
+performance not only depends on the engine, but also on for instance logging.
+When I run the \CONTEXT\ test suite it takes 1250 seconds if the console takes
+the full screen on a 2560 by 1600 display and 30 seconds more on a 3840 by 2160
+display and it even depends on how large the font is set. On the 1920 by 1200
+monitor I get to 1230. Of course these times change when we add more to the test
+suite so it's always a momentary measurement.
+
+Similar differences can be observed when running in an editor. A good test is
+making a \CONTEXT\ format: 2.2 seconds goes down to below 1.8 when the output is
+piped to a file. On a decent 2023 desktop those times are probably half but I
+don't have one at hand.
+
+\startsubsubject[title={sample 1, number of runs: 2}]
+
+\starttyping
+\starttext
+ \dorecurse {%s} {
+ \Knuth
+ \par
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.63 \NC 0.83 \NC 1.07 \NC \NR
+\BC luatex \NC 0.95 \NC 1.86 \NC 2.94 \NC \NR
+\BC luametatex \NC 0.61 \NC 1.49 \NC 2.48 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 2, number of runs: 2}]
+
+\starttyping
+\starttext
+ \dorecurse {%s} {
+ \tf \Knuth \bf \Knuth
+ \it \Knuth \bs \Knuth
+ \par
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.70 \NC 1.73 \NC 2.80 \NC \NR
+\BC luatex \NC 1.37 \NC 5.37 \NC 9.92 \NC \NR
+\BC luametatex \NC 1.04 \NC 5.06 \NC 9.73 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 3, number of runs: 2}]
+
+\starttyping
+\starttext
+ \dorecurse {%s} {
+ \tf \Knuth \it knuth \bf \Knuth \bs knuth
+ \it \Knuth \tf knuth \bs \Knuth \bf knuth
+ \par
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.71 \NC 1.81 \NC 2.98 \NC \NR
+\BC luatex \NC 1.41 \NC 5.84 \NC 10.77 \NC \NR
+\BC luametatex \NC 1.05 \NC 5.71 \NC 10.60 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 4, number of runs: 2}]
+
+\starttyping
+\setupcolors[state=start]
+\starttext
+ \dorecurse {%s} {
+ {\red \tf \Knuth \green \it knuth}
+ {\red \bf \Knuth \green \bs knuth}
+ {\red \it \Knuth \green \tf knuth}
+ {\red \bs \Knuth \green \bf knuth}
+ \par
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.73 \NC 1.91 \NC 3.64 \NC \NR
+\BC luatex \NC 1.39 \NC 5.82 \NC 12.58 \NC \NR
+\BC luametatex \NC 1.07 \NC 5.57 \NC 11.85 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 5, number of runs: 2}]
+
+\starttyping
+\starttext
+ \dorecurse {%s} {
+ \null \page
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.62 \NC 1.12 \NC 1.68 \NC \NR
+\BC luatex \NC 0.90 \NC 1.39 \NC 1.98 \NC \NR
+\BC luametatex \NC 0.58 \NC 0.99 \NC 1.46 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 6, number of runs: 2}]
+
+\starttyping
+\starttext
+ \dorecurse {%s} {
+ %% nothing
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.55 \NC 0.54 \NC 0.56 \NC \NR
+\BC luatex \NC 0.79 \NC 0.81 \NC 0.82 \NC \NR
+\BC luametatex \NC 0.54 \NC 0.52 \NC 0.53 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 7, number of runs: 2}]
+
+\starttyping
+\starttext
+ \dontleavehmode
+ \dorecurse {%s} {
+ \framed[width=1cm,height=1cm,offset=2mm]{x}
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.58 \NC 0.65 \NC 0.71 \NC \NR
+\BC luatex \NC 0.84 \NC 0.96 \NC 1.08 \NC \NR
+\BC luametatex \NC 0.54 \NC 0.62 \NC 0.72 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 8, number of runs: 2}]
+
+\starttyping
+\starttext
+ \dontleavehmode
+ \dorecurse {%s} {
+ \framed
+ [width=1cm,height=1cm,offset=2mm,
+ foregroundstyle=bold,foregroundcolor=red,
+ background=color,backgroundcolor=green]
+ {x}
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.59 \NC 0.70 \NC 0.83 \NC \NR
+\BC luatex \NC 0.87 \NC 1.00 \NC 1.17 \NC \NR
+\BC luametatex \NC 0.55 \NC 0.66 \NC 0.78 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 9, number of runs: 2}]
+
+\starttyping
+\starttext
+ \ifdefined\permanent\else\def\BC{\NC\bf}\fi
+ \dontleavehmode
+ \dorecurse {%s} {
+ \starttabulate[|||||]
+ \NC test \BC test \NC test \NC test \NC \NR
+ \NC test \BC test \NC test \NC test \NC \NR
+ \NC test \BC test \NC test \NC test \NC \NR
+ \NC test \BC test \NC test \NC test \NC \NR
+ \stoptabulate
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 0.62 \NC 1.15 \NC 1.71 \NC \NR
+\BC luatex \NC 0.94 \NC 1.84 \NC 2.86 \NC \NR
+\BC luametatex \NC 0.60 \NC 1.19 \NC 1.88 \NC \NR
+\HL
+\stoptabulate
+
+\stopsubsubject
+
+\startsubsubject[title={sample 10, number of runs: 2}]
+
+\starttyping
+\starttext
+ \dontleavehmode
+ \dorecurse {%s} {
+ \startMPcode
+ fill fullcircle scaled 1cm withcolor red ;
+ fill fullsquare scaled 1cm withcolor green ;
+ \stopMPcode
+ \space
+ }
+\stoptext
+\stoptyping
+
+\starttabulate[||r|r|r|]
+\HL
+\BC engine \BC 50 \BC 500 \BC 1000 \NC \NR
+\HL
+\BC pdftex \NC 5.73 \NC 50.98 \NC 102.10 \NC \NR
+\BC luatex \NC 0.93 \NC 1.07 \NC 1.30 \NC \NR
+\BC luametatex \NC 0.57 \NC 0.71 \NC 0.86 \NC \NR
+\HL
+\stoptabulate
+
+\stopsection
+
+\startsection[title=Final words]
+
+Whenever I run into (or get send) remarks of (especially non \CONTEXT) users
+suggesting that \LUATEX\ is much slower than \PDFTEX\ or that \LUAMETATEX\ seems
+much faster than \LUATEX, one really has to keep in mind that this is not always
+true. Among the questions to be asked are \quotation {What engine do you use?},
+\quotation {Which macro package do you use?}, \quotation {How well is your style
+set up?}, \quotation {How complex is the document?}, \quotation {Is your own
+additional code efficient?}, \quotation {Do you use engine and macro package
+features the right way?} and of course \quotation {What do you compare with?},
+\quotation {What do you expect and why?}, \quotation {Do you actually know what
+goes on deep down?}. An embarrassing one can be \quotation {Do you have an idea
+what is involved in fulfilling your request given that we use a flexible adaptive
+macro language?}. Much probably these questions not get answered properly.
+
+Another thing to make clear is that when someone claims for instance that
+\CONTEXT\ \LMTX\ is fast because of \LUAMETATEX, or that \LUAMETATEX\ is much
+faster than \LUATEX, a healthy suspicion should kick in: does that someone really
+knows what happens and matters? The previous numbers do show differences for
+simple cases but we're often not talking of differences that can be used as an
+excuse for insufficient coding. In the end it is all about the experience: does
+performance feel in tune with expectations. Which is not to say that I will make
+\CONTEXT\ and \LUAMETATEX\ faster because after all there are usage scenarios
+where one has to process tens of thousands of documents with a reasonable amount
+of time, on regular infrastructure, and of course with as little as possible
+energy consumption.
+
+If \PDFTEX\ suits your purpose, there is no need to move to \LUATEX. As with
+rechargeable batteries in cordless phones a higher capacity can make things
+worse. If \LUATEX\ fits the bill, don't dream about using \LUAMETATEX\ instead
+because it will half runtime because the adaptations needed in the macro package
+(like adding a backend) might actually slow it down. Moores law doesn't apply to
+\TEX\ engines and macro packages and you might get disappointed. Accept that the
+choice you made for a macro package can come with a price.
+
+Quite often it is rather easy to debunk complaints and claims which makes one
+wonder why claims about perceived or potential are made at all. But then, I'm
+accustomed to weird remarks and conclusions about \CONTEXT\ as a macro package,
+or for that matter \LUATEX\ (as it originates in the \CONTEXT\ community) even by
+people who should know better. Hopefully the above invites to being more careful.
+
+\stopsection
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/musings/musings.tex b/doc/context/sources/general/manuals/musings/musings.tex
index 143dfe456..3e3b35ea0 100644
--- a/doc/context/sources/general/manuals/musings/musings.tex
+++ b/doc/context/sources/general/manuals/musings/musings.tex
@@ -27,6 +27,7 @@
% \component musings-treasures
% \component musings-whytex-again
\component musings-dontusetex
+ % \component musings-speed
\stopbodymatter
\stopproduct
diff --git a/source/luametatex/source/lua/lmtinterface.c b/source/luametatex/source/lua/lmtinterface.c
index 641c22f8f..9156f0aaf 100644
--- a/source/luametatex/source/lua/lmtinterface.c
+++ b/source/luametatex/source/lua/lmtinterface.c
@@ -106,7 +106,9 @@ void lmt_initialize_interface(void)
set_group_code_value(also_simple_group, alsosimple);
set_group_code_value(semi_simple_group, semisimple);
set_group_code_value(math_simple_group, mathsimple);
- set_group_code_value(math_shift_group, mathshift);
+ set_group_code_value(math_inline_group, mathinline);
+ set_group_code_value(math_display_group, mathdisplay);
+ set_group_code_value(math_number_group, mathnumber);
set_group_code_value(math_fence_group, mathfence);
set_group_code_value(local_box_group, localbox);
set_group_code_value(split_off_group, splitoff);
diff --git a/source/luametatex/source/lua/lmtinterface.h b/source/luametatex/source/lua/lmtinterface.h
index 40cfbad29..f5fd10900 100644
--- a/source/luametatex/source/lua/lmtinterface.h
+++ b/source/luametatex/source/lua/lmtinterface.h
@@ -918,7 +918,9 @@ make_lua_key(L, mathpostpenalty);\
make_lua_key(L, mathprepenalty);\
make_lua_key(L, mathradical);\
make_lua_key(L, mathshapekern);\
-make_lua_key(L, mathshift);\
+make_lua_key(L, mathinline);\
+make_lua_key(L, mathdisplay);\
+make_lua_key(L, mathnumber);\
make_lua_key(L, mathsimple);\
make_lua_key(L, mathskip);\
make_lua_key(L, mathspec);\
diff --git a/source/luametatex/source/lua/lmtnodelib.c b/source/luametatex/source/lua/lmtnodelib.c
index 5ad42124d..116860f85 100644
--- a/source/luametatex/source/lua/lmtnodelib.c
+++ b/source/luametatex/source/lua/lmtnodelib.c
@@ -1048,14 +1048,19 @@ static int nodelib_direct_getnucleus(lua_State *L)
case accent_noad:
case radical_noad:
nodelib_push_direct_or_nil(L, noad_nucleus(n));
- break;
- default:
- lua_pushnil(L);
- break;
+ if (lua_toboolean(L, 2)) {
+ nodelib_push_direct_or_nil(L, noad_prime(n));
+ nodelib_push_direct_or_nil(L, noad_supscr(n));
+ nodelib_push_direct_or_nil(L, noad_subscr(n));
+ nodelib_push_direct_or_nil(L, noad_supprescr(n));
+ nodelib_push_direct_or_nil(L, noad_subprescr(n));
+ return 6;
+ } else {
+ return 1;
+ }
}
- } else {
- lua_pushnil(L);
- }
+ }
+ lua_pushnil(L);
return 1;
}
@@ -8780,7 +8785,7 @@ static int nodelib_direct_effectiveglue(lua_State *L)
if (n) {
switch (node_type(n)) {
case glue_node:
- nodelib_direct_effect_done(L, glue_amount(n), glue_stretch(n), glue_shrink(n),glue_stretch_order(n), glue_shrink_order(n));
+ nodelib_direct_effect_done(L, glue_amount(n), glue_stretch(n), glue_shrink(n), glue_stretch_order(n), glue_shrink_order(n));
break;
case math_node:
if (math_surround(n)) {
diff --git a/source/luametatex/source/luametatex.h b/source/luametatex/source/luametatex.h
index ccabddaf4..93abb0814 100644
--- a/source/luametatex/source/luametatex.h
+++ b/source/luametatex/source/luametatex.h
@@ -89,7 +89,7 @@
# define luametatex_version 210
# define luametatex_revision 05
# define luametatex_version_string "2.10.05"
-# define luametatex_development_id 20230101
+# define luametatex_development_id 20230112
# define luametatex_name_camelcase "LuaMetaTeX"
# define luametatex_name_lowercase "luametatex"
diff --git a/source/luametatex/source/luarest/lmtstrlibext.c b/source/luametatex/source/luarest/lmtstrlibext.c
index ffc687ff4..31dc53c86 100644
--- a/source/luametatex/source/luarest/lmtstrlibext.c
+++ b/source/luametatex/source/luarest/lmtstrlibext.c
@@ -777,6 +777,74 @@ static int strlib_pack_rows_columns(lua_State* L)
return 1;
}
+/*tex
+ This converts a hex string to characters. Spacing is ignored and invalid characters result in
+ a false result. EMpty strings are okay.
+*/
+
+static int strlib_hextocharacters(lua_State *L)
+{
+ size_t ls = 0;
+ const char *s = lua_tolstring(L, 1, &ls);
+ if (ls > 0) {
+ luaL_Buffer b;
+ luaL_buffinitsize(L, &b, ls/2);
+ while (1) {
+ unsigned char first = *s++;
+ switch (first) {
+ case ' ': case '\n': case '\r': case '\t':
+ continue;
+ case '\0':
+ goto DONE;
+ default:
+ {
+ unsigned char second = *s++;
+ switch (second) {
+ case ' ': case '\n': case '\r': case '\t':
+ continue;
+ case '\0':
+ goto BAD;
+ default:
+ {
+ unsigned char chr;
+ if (first >= '0' && first <= '9') {
+ chr = 16 * (first - '0');
+ } else if (first>= 'A' && first <= 'F') {
+ chr = 16 * (first - 'A' + 10);
+ } else if (first >= 'a' && first <= 'f') {
+ chr = 16 * (first - 'a' + 10);
+ } else {
+ goto BAD;
+ }
+ if (second >= '0' && second <= '9') {
+ chr += second - '0';
+ } else if (second >= 'A' && second <= 'F') {
+ chr += second - 'A' + 10;
+ } else if (first >= 'a' && second <= 'f') {
+ chr += second - 'a' + 10;
+ } else {
+ goto BAD;
+ }
+ luaL_addchar(&b, chr);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+ DONE:
+ luaL_pushresult(&b);
+ return 1;
+ BAD:
+ lua_pushboolean(L, 0);
+ return 1;
+ } else {
+ lua_pushliteral(L, "");
+ return 1;
+ }
+}
+
static const luaL_Reg strlib_function_list[] = {
{ "characters", strlib_characters },
{ "characterpairs", strlib_characterpairs },
@@ -797,6 +865,7 @@ static const luaL_Reg strlib_function_list[] = {
/* { "toutf16", strlib_format_toutf16 }, */ /* untested */
{ "toutf32", strlib_format_toutf32 },
{ "packrowscolumns", strlib_pack_rows_columns },
+ { "hextocharacters", strlib_hextocharacters },
{ NULL, NULL },
};
diff --git a/source/luametatex/source/tex/texadjust.c b/source/luametatex/source/tex/texadjust.c
index f57853caf..11d2da6ad 100644
--- a/source/luametatex/source/tex/texadjust.c
+++ b/source/luametatex/source/tex/texadjust.c
@@ -4,26 +4,35 @@
# include "luametatex.h"
-static void tex_scan_adjust_keys(halfword *options, halfword *code, halfword *index, scaled *depthbefore, scaled *depthafter, halfword *attrlist)
+typedef struct adjust_properties {
+ halfword options;
+ halfword code;
+ halfword index;
+ scaled depthbefore;
+ scaled depthafter;
+ halfword attrlist;
+} adjust_properties;
+
+static void tex_scan_adjust_keys(adjust_properties *properties)
{
- *code = post_adjust_code;
- *options = adjust_option_none;
- *index = 0;
- *depthbefore = 0;
- *depthafter = 0;
- *attrlist = null;
+ properties->code = post_adjust_code;
+ properties->options = adjust_option_none;
+ properties->index = 0;
+ properties->depthbefore = 0;
+ properties->depthafter = 0;
+ properties->attrlist = null;
while (1) {
switch (tex_scan_character("abdipABDIP", 0, 1, 0)) {
case 'p': case 'P':
switch (tex_scan_character("roRO", 0, 0, 0)) {
case 'r': case 'R':
if (tex_scan_mandate_keyword("pre", 2)) {
- *code = pre_adjust_code;
+ properties->code = pre_adjust_code;
}
break;
case 'o': case 'O':
if (tex_scan_mandate_keyword("post", 2)) {
- *code = post_adjust_code;
+ properties->code = post_adjust_code;
}
break;
default:
@@ -35,12 +44,12 @@ static void tex_scan_adjust_keys(halfword *options, halfword *code, halfword *in
switch (tex_scan_character("aeAE", 0, 0, 0)) {
case 'a': case 'A':
if (tex_scan_mandate_keyword("baseline", 2)) {
- *options |= adjust_option_baseline;
+ properties->options |= adjust_option_baseline;
}
break;
case 'e': case 'E':
if (tex_scan_mandate_keyword("before", 2)) {
- *options |= adjust_option_before;
+ properties->options |= adjust_option_before;
}
break;
default:
@@ -50,9 +59,9 @@ static void tex_scan_adjust_keys(halfword *options, halfword *code, halfword *in
break;
case 'i': case 'I':
if (tex_scan_mandate_keyword("index", 1)) {
- *index = tex_scan_int(0, NULL);
- if (! tex_valid_adjust_index(*index)) {
- *index = 0; /* for now no error */
+ properties->index = tex_scan_int(0, NULL);
+ if (! tex_valid_adjust_index(properties->index)) {
+ properties->index = 0; /* for now no error */
}
}
break;
@@ -60,7 +69,7 @@ static void tex_scan_adjust_keys(halfword *options, halfword *code, halfword *in
switch (tex_scan_character("ftFT", 0, 0, 0)) {
case 'f': case 'F':
if (tex_scan_mandate_keyword("after", 2)) {
- *options &= ~(adjust_option_before | *options);
+ properties->options &= ~(adjust_option_before | properties->options);
}
break;
case 't': case 'T':
@@ -68,10 +77,10 @@ static void tex_scan_adjust_keys(halfword *options, halfword *code, halfword *in
halfword i = tex_scan_attribute_register_number();
halfword v = tex_scan_int(1, NULL);
if (eq_value(register_attribute_location(i)) != v) {
- if (*attrlist) {
- *attrlist = tex_patch_attribute_list(*attrlist, i, v);
+ if (properties->attrlist) {
+ properties->attrlist = tex_patch_attribute_list(properties->attrlist, i, v);
} else {
- *attrlist = tex_copy_attribute_list_set(tex_current_attribute_list(), i, v);
+ properties->attrlist = tex_copy_attribute_list_set(tex_current_attribute_list(), i, v);
}
}
}
@@ -86,24 +95,24 @@ static void tex_scan_adjust_keys(halfword *options, halfword *code, halfword *in
switch (tex_scan_character("abclABCL", 0, 1, 0)) { /* so a space is permitted */
case 'a': case 'A':
if (tex_scan_mandate_keyword("after", 1)) {
- *options |= adjust_option_depth_after;
- *depthafter = tex_scan_dimen(0, 0, 0, 0, NULL);
+ properties->options |= adjust_option_depth_after;
+ properties->depthafter = tex_scan_dimen(0, 0, 0, 0, NULL);
}
break;
case 'b': case 'B':
if (tex_scan_mandate_keyword("before", 1)) {
- *options |= adjust_option_depth_before;
- *depthbefore = tex_scan_dimen(0, 0, 0, 0, NULL);
+ properties->options |= adjust_option_depth_before;
+ properties->depthbefore = tex_scan_dimen(0, 0, 0, 0, NULL);
}
break;
case 'c': case 'C':
if (tex_scan_mandate_keyword("check", 1)) {
- *options |= adjust_option_depth_check;
+ properties->options |= adjust_option_depth_check;
}
break;
case 'l': case 'L':
if (tex_scan_mandate_keyword("last", 1)) {
- *options |= adjust_option_depth_last;
+ properties->options |= adjust_option_depth_last;
}
break;
default:
@@ -125,21 +134,17 @@ int tex_valid_adjust_index(halfword n)
return n >= 0;
}
-void tex_run_vadjust(void)
+void tex_set_vadjust(halfword target)
{
- halfword code = post_adjust_code;
- halfword options = adjust_option_none;
- halfword index = 0;
- scaled depthbefore = 0;
- scaled depthafter = 0;
- halfword attrlist = null;
- tex_scan_adjust_keys(&options, &code, &index, &depthbefore, &depthafter, &attrlist);
- tex_set_saved_record(saved_adjust_item_location, adjust_location_save_type, 0, code);
- tex_set_saved_record(saved_adjust_item_options, adjust_options_save_type, 0, options);
- tex_set_saved_record(saved_adjust_item_index, adjust_index_save_type, 0, index);
- tex_set_saved_record(saved_adjust_item_attr_list, adjust_attr_list_save_type, 0, attrlist);
- tex_set_saved_record(saved_adjust_item_depth_before, adjust_depth_before_save_type, 0, depthbefore);
- tex_set_saved_record(saved_adjust_item_depth_after, adjust_depth_after_save_type, 0, depthafter);
+ adjust_properties properties;
+ tex_scan_adjust_keys(&properties);
+ tex_set_saved_record(saved_adjust_item_location, adjust_location_save_type, 0, properties.code);
+ tex_set_saved_record(saved_adjust_item_options, adjust_options_save_type, 0, properties.options);
+ tex_set_saved_record(saved_adjust_item_index, adjust_index_save_type, 0, properties.index);
+ tex_set_saved_record(saved_adjust_item_attr_list, adjust_attr_list_save_type, 0, properties.attrlist);
+ tex_set_saved_record(saved_adjust_item_depth_before, adjust_depth_before_save_type, 0, properties.depthbefore);
+ tex_set_saved_record(saved_adjust_item_depth_after, adjust_depth_after_save_type, 0, properties.depthafter);
+ tex_set_saved_record(saved_adjust_item_target, adjust_target_save_type, 0, target);
lmt_save_state.save_stack_data.ptr += saved_adjust_n_of_items;
tex_new_save_level(vadjust_group);
tex_scan_left_brace();
@@ -149,29 +154,37 @@ void tex_run_vadjust(void)
cur_list.prev_depth = ignore_depth_criterium_par;
}
+void tex_run_vadjust(void)
+{
+ tex_set_vadjust(-1);
+}
+
void tex_finish_vadjust_group(void)
{
if (! tex_wrapped_up_paragraph(vadjust_par_context)) {
- halfword box, topskip, adjust; /*tex for short-term use */
+ halfword box, adjust, target; /*tex for short-term use */
tex_end_paragraph(vadjust_group, vadjust_par_context);
- topskip = tex_new_glue_node(split_top_skip_par, top_skip_code); /* cheat */
tex_unsave();
lmt_save_state.save_stack_data.ptr -= saved_adjust_n_of_items;
box = tex_vpack(node_next(cur_list.head), 0, packing_additional, max_dimen, direction_unknown, holding_none_option);
tex_pop_nest();
adjust = tex_new_node(adjust_node, (quarterword) saved_value(saved_adjust_item_location));
- tex_tail_append(adjust);
+ target = saved_value(saved_adjust_item_target);
adjust_list(adjust) = box_list(box);
adjust_options(adjust) = (halfword) saved_value(saved_adjust_item_options);
adjust_index(adjust) = (halfword) saved_value(saved_adjust_item_index);
adjust_depth_before(adjust) = (halfword) saved_value(saved_adjust_item_depth_before);
adjust_depth_after(adjust) = (halfword) saved_value(saved_adjust_item_depth_after);
tex_attach_attribute_list_attribute(adjust, (halfword) saved_value(saved_adjust_item_attr_list));
- tex_flush_node(topskip);
+ if (target < 1) {
+ tex_tail_append(adjust);
+ } else {
+ tex_adjust_attach(target, adjust);
+ }
box_list(box) = null;
tex_flush_node(box);
/* we never do the callback ... maybe move it outside */
- if (lmt_nest_state.nest_data.ptr == 0) {
+ if (target < 0 && lmt_nest_state.nest_data.ptr == 0) {
if (! lmt_page_builder_state.output_active) {
lmt_page_filter_callback(vadjust_page_context, 0);
}
@@ -182,7 +195,7 @@ void tex_finish_vadjust_group(void)
/*tex Append or prepend vadjust nodes. Here head is a temp node! */
-halfword tex_append_adjust_list(halfword head, halfword tail, halfword adjust)
+halfword tex_append_adjust_list(halfword head, halfword tail, halfword adjust, const char *detail)
{
while (adjust && node_type(adjust) == adjust_node) {
halfword next = node_next(adjust);
@@ -193,7 +206,7 @@ halfword tex_append_adjust_list(halfword head, halfword tail, halfword adjust)
}
if (tracing_adjusts_par > 1) {
tex_begin_diagnostic();
- tex_print_format("[adjust: index %i, location %s, append]", adjust_index(adjust), tex_aux_subtype_str(adjust));
+ tex_print_format("[adjust: index %i, location %s, append, %s]", adjust_index(adjust), tex_aux_subtype_str(adjust), detail);
tex_print_node_list(adjust_list(adjust), "adjust",show_box_depth_par, show_box_breadth_par);
tex_end_diagnostic();
}
@@ -203,7 +216,7 @@ halfword tex_append_adjust_list(halfword head, halfword tail, halfword adjust)
return tail;
}
-halfword tex_prepend_adjust_list(halfword head, halfword tail, halfword adjust)
+halfword tex_prepend_adjust_list(halfword head, halfword tail, halfword adjust, const char *detail)
{
while (adjust && node_type(adjust) == adjust_node) {
halfword next = node_next(adjust);
@@ -216,7 +229,7 @@ halfword tex_prepend_adjust_list(halfword head, halfword tail, halfword adjust)
}
if (tracing_adjusts_par > 1) {
tex_begin_diagnostic();
- tex_print_format("[adjust: index %i, location %s, prepend]", adjust_index(adjust), tex_aux_subtype_str(adjust));
+ tex_print_format("[adjust: index %i, location %s, prepend, %s]", adjust_index(adjust), tex_aux_subtype_str(adjust), detail);
tex_print_node_list(adjust_list(adjust), "adjust", show_box_depth_par, show_box_breadth_par);
tex_end_diagnostic();
}
@@ -227,84 +240,86 @@ halfword tex_prepend_adjust_list(halfword head, halfword tail, halfword adjust)
void tex_inject_adjust_list(halfword adjust, int obeyoptions, halfword nextnode, const line_break_properties *properties)
{
- adjust = node_next(adjust);
- if (adjust) {
- while (adjust && node_type(adjust) == adjust_node) {
- halfword list = adjust_list(adjust);
- halfword next = node_next(adjust);
- if (list) {
- halfword prevnode = cur_list.tail;
- if (tracing_adjusts_par > 1) {
- tex_begin_diagnostic();
- tex_print_format("[adjust: index %i, location %s, inject]", adjust_index(adjust), tex_aux_subtype_str(adjust));
- tex_print_node_list(adjust_list(adjust), "adjust", show_box_depth_par, show_box_breadth_par);
- tex_end_diagnostic();
- }
- if (obeyoptions && has_adjust_option(adjust, adjust_option_baseline)) {
- /*tex
- Here we attach data to a line. On the todo is to prepend and append to
- the lines (nicer when we number lines).
- */
- if (node_type(list) == hlist_node || node_type(list) == vlist_node) {
- if (nextnode) {
- /*tex
- This is the |pre| case where |nextnode| is the line to be appended
- after the adjust box |list|.
- */
- if (node_type(nextnode) == hlist_node || node_type(nextnode) == vlist_node) {
- if (box_height(nextnode) > box_height(list)) {
- box_height(list) = box_height(nextnode);
- }
- if (box_depth(list) > box_depth(nextnode)) {
- box_depth(nextnode) = box_depth(list);
- }
- /* not ok yet */
- box_y_offset(nextnode) += box_height(nextnode);
- tex_check_box_geometry(nextnode);
- /* till here */
- box_height(nextnode) = 0;
- box_depth(list) = 0;
+ if (adjust && node_type(adjust) == temp_node) {
+ adjust = node_next(adjust);
+ }
+ while (adjust && node_type(adjust) == adjust_node) {
+ halfword next = node_next(adjust);
+ halfword list = adjust_list(adjust);
+ if (tracing_adjusts_par > 1) {
+ tex_begin_diagnostic();
+ tex_print_format("[adjust: index %i, location %s, inject]", adjust_index(adjust), tex_aux_subtype_str(adjust));
+ tex_print_node_list(adjust_list(adjust), "adjust", show_box_depth_par, show_box_breadth_par);
+ tex_end_diagnostic();
+ }
+ if (list) {
+ if (obeyoptions && has_adjust_option(adjust, adjust_option_baseline)) {
+ /*tex
+ Here we attach data to a line. On the todo is to prepend and append to
+ the lines (nicer when we number lines).
+ */
+ if (node_type(list) == hlist_node || node_type(list) == vlist_node) {
+ if (nextnode) {
+ /*tex
+ This is the |pre| case where |nextnode| is the line to be appended
+ after the adjust box |list|.
+ */
+ if (node_type(nextnode) == hlist_node || node_type(nextnode) == vlist_node) {
+ if (box_height(nextnode) > box_height(list)) {
+ box_height(list) = box_height(nextnode);
}
- } else {
- /*tex
- Here we have the |post| case where the line will end up before the
- adjusted content.
- */
- if (node_type(prevnode) == hlist_node || node_type(prevnode) == vlist_node) {
- if (box_height(prevnode) < box_height(list)) {
- box_height(prevnode) = box_height(list);
- }
- if (box_depth(list) < box_depth(prevnode)) {
- box_depth(list) = box_depth(prevnode);
- }
- box_height(list) = 0;
- box_depth(prevnode) = 0;
+ if (box_depth(list) > box_depth(nextnode)) {
+ box_depth(nextnode) = box_depth(list);
+ }
+ /* not ok yet */
+ box_y_offset(nextnode) += box_height(nextnode);
+ tex_check_box_geometry(nextnode);
+ /* till here */
+ box_height(nextnode) = 0;
+ box_depth(list) = 0;
+ }
+ } else {
+ /*tex
+ Here we have the |post| case where the line will end up before the
+ adjusted content.
+ */
+ halfword prevnode = cur_list.tail;
+ if (node_type(prevnode) == hlist_node || node_type(prevnode) == vlist_node) {
+ if (box_height(prevnode) < box_height(list)) {
+ box_height(prevnode) = box_height(list);
+ }
+ if (box_depth(list) < box_depth(prevnode)) {
+ box_depth(list) = box_depth(prevnode);
}
+ box_height(list) = 0;
+ box_depth(prevnode) = 0;
}
}
}
- if (obeyoptions && has_adjust_option(adjust, adjust_option_depth_before)) {
- cur_list.prev_depth = adjust_depth_before(adjust);
- }
- if (obeyoptions && has_adjust_option(adjust, adjust_option_depth_check)) {
- tex_append_to_vlist(list, -1, properties);
- } else {
- tex_couple_nodes(prevnode, list);
- }
- if (obeyoptions && has_adjust_option(adjust, adjust_option_depth_after)) {
- cur_list.prev_depth = adjust_depth_after(adjust);
- } else if (obeyoptions && has_adjust_option(adjust, adjust_option_depth_last)) {
- cur_list.prev_depth = box_depth(list);
- }
- cur_list.tail = tex_tail_of_node_list(cur_list.tail);
- if (! lmt_page_builder_state.output_active) {
- lmt_append_line_filter_callback(post_adjust_append_line_context, adjust_index(adjust));
- }
+ }
+ if (obeyoptions && has_adjust_option(adjust, adjust_option_depth_before)) {
+ cur_list.prev_depth = adjust_depth_before(adjust);
+ }
+ if (obeyoptions && has_adjust_option(adjust, adjust_option_depth_check)) {
+ tex_append_to_vlist(list, -1, properties);
+ } else {
+ tex_tail_append_list(list);
+ // tex_couple_nodes(prevnode, list);
+ // cur_list.tail = tex_tail_of_node_list(list);
+ }
+ if (obeyoptions && has_adjust_option(adjust, adjust_option_depth_after)) {
+ cur_list.prev_depth = adjust_depth_after(adjust);
+ } else if (obeyoptions && has_adjust_option(adjust, adjust_option_depth_last)) {
+ cur_list.prev_depth = box_depth(list);
+ }
+// cur_list.tail = tex_tail_of_node_list(cur_list.tail);
+ if (! lmt_page_builder_state.output_active) {
+ lmt_append_line_filter_callback(post_adjust_append_line_context, adjust_index(adjust));
}
adjust_list(adjust) = null;
- tex_flush_node(adjust);
- adjust = next;
}
+ tex_flush_node(adjust);
+ adjust = next;
}
}
@@ -313,6 +328,12 @@ void tex_adjust_attach(halfword box, halfword adjust)
if (adjust_list(adjust)) {
node_prev(adjust) = null;
node_next(adjust) = null;
+ if (tracing_adjusts_par > 1) {
+ tex_begin_diagnostic();
+ tex_print_format("[adjust: index %i, location %s, attach]", adjust_index(adjust), tex_aux_subtype_str(adjust));
+ tex_print_node_list(adjust_list(adjust), "attach",show_box_depth_par, show_box_breadth_par);
+ tex_end_diagnostic();
+ }
switch (node_subtype(adjust)) {
case pre_adjust_code:
if (! box_pre_adjusted(box)) {
@@ -356,9 +377,9 @@ void tex_adjust_passon(halfword box, halfword adjust)
case pre_adjust_code:
if (lmt_packaging_state.pre_adjust_tail) {
if (lmt_packaging_state.pre_adjust_tail != pre_adjust_head && has_adjust_option(adjust, adjust_option_before)) {
- lmt_packaging_state.pre_adjust_tail = tex_prepend_adjust_list(pre_adjust_head, lmt_packaging_state.pre_adjust_tail, adjust);
+ lmt_packaging_state.pre_adjust_tail = tex_prepend_adjust_list(pre_adjust_head, lmt_packaging_state.pre_adjust_tail, adjust, "passon");
} else {
- lmt_packaging_state.pre_adjust_tail = tex_append_adjust_list(pre_adjust_head, lmt_packaging_state.pre_adjust_tail, adjust);
+ lmt_packaging_state.pre_adjust_tail = tex_append_adjust_list(pre_adjust_head, lmt_packaging_state.pre_adjust_tail, adjust, "passon");
}
} else {
tex_normal_error("vadjust pre", "invalid list");
@@ -367,9 +388,9 @@ void tex_adjust_passon(halfword box, halfword adjust)
case post_adjust_code:
if (lmt_packaging_state.post_adjust_tail) {
if (lmt_packaging_state.post_adjust_tail != post_adjust_head && has_adjust_option(adjust, adjust_option_before)) {
- lmt_packaging_state.post_adjust_tail = tex_prepend_adjust_list(post_adjust_head, lmt_packaging_state.post_adjust_tail, adjust);
+ lmt_packaging_state.post_adjust_tail = tex_prepend_adjust_list(post_adjust_head, lmt_packaging_state.post_adjust_tail, adjust, "passon");
} else {
- lmt_packaging_state.post_adjust_tail = tex_append_adjust_list(post_adjust_head, lmt_packaging_state.post_adjust_tail, adjust);
+ lmt_packaging_state.post_adjust_tail = tex_append_adjust_list(post_adjust_head, lmt_packaging_state.post_adjust_tail, adjust, "passon");
}
} else {
tex_normal_error("vadjust post", "invalid list");
@@ -384,6 +405,64 @@ void tex_adjust_passon(halfword box, halfword adjust)
}
}
+static void tex_aux_show_flush_adjust(halfword adjust, const char *what, const char *detail)
+{
+ if (tracing_adjusts_par > 1) {
+ tex_begin_diagnostic();
+ tex_print_format("[adjust: index %i, location %s, flush, %s]", adjust_index(adjust), tex_aux_subtype_str(adjust), detail);
+ tex_print_node_list(adjust_list(adjust), what, show_box_depth_par, show_box_breadth_par);
+ tex_end_diagnostic();
+ }
+}
+
+halfword tex_flush_adjust_append(halfword adjust, halfword tail)
+{
+ while (adjust) {
+ halfword p = adjust;
+ halfword h = adjust_list(adjust);
+ if (h) {
+ int ishmode = is_h_mode(cur_list.mode);
+ tex_aux_show_flush_adjust(p, "append", ishmode ? "repack" : "direct");
+ if (ishmode) {
+ halfword n = tex_new_node(adjust_node, post_adjust_code);
+ // tex_attach_attribute_list_copy(n, post_adjusted);
+ adjust_list(n) = h;
+ h = n;
+ }
+ tex_try_couple_nodes(tail, h);
+ tail = tex_tail_of_node_list(h);
+ adjust_list(p) = null;
+ }
+ adjust = node_next(p);
+ tex_flush_node(p);
+ }
+ return tail;
+}
+
+halfword tex_flush_adjust_prepend(halfword adjust, halfword tail)
+{
+ while (adjust) {
+ halfword p = adjust;
+ halfword h = adjust_list(adjust);
+ if (h) {
+ int ishmode = is_h_mode(cur_list.mode);
+ tex_aux_show_flush_adjust(p, "prepend", ishmode ? "repack" : "direct");
+ if (ishmode) {
+ halfword n = tex_new_node(adjust_node, pre_adjust_code);
+ // tex_attach_attribute_list_copy(n, pre_adjusted);
+ adjust_list(n) = h;
+ h = n;
+ }
+ tex_try_couple_nodes(tail, h);
+ tail = tex_tail_of_node_list(h);
+ adjust_list(p) = null;
+ }
+ adjust = node_next(p);
+ tex_flush_node(p);
+ }
+ return tail;
+}
+
void tex_initialize_adjust(void)
{
}
diff --git a/source/luametatex/source/tex/texadjust.h b/source/luametatex/source/tex/texadjust.h
index 19c116f26..ea1c88f43 100644
--- a/source/luametatex/source/tex/texadjust.h
+++ b/source/luametatex/source/tex/texadjust.h
@@ -8,29 +8,34 @@
# define LMT_ADJUST_H
typedef enum saved_adjust_items {
- saved_adjust_item_location = 0,
- saved_adjust_item_options = 1,
- saved_adjust_item_index = 2,
- saved_adjust_item_attr_list = 3,
- saved_adjust_item_depth_before = 4,
- saved_adjust_item_depth_after = 5,
- saved_adjust_n_of_items = 6,
+ saved_adjust_item_location,
+ saved_adjust_item_options,
+ saved_adjust_item_index,
+ saved_adjust_item_attr_list,
+ saved_adjust_item_depth_before,
+ saved_adjust_item_depth_after,
+ saved_adjust_item_target,
+ saved_adjust_n_of_items,
} saved_adjust_items;
-extern void tex_initialize_adjust (void);
-extern void tex_cleanup_adjust (void);
-
-extern void tex_run_vadjust (void);
-extern void tex_finish_vadjust_group (void);
-
-extern int tex_valid_adjust_index (halfword n);
-
-extern void tex_inject_adjust_list (halfword list, int obeyoptions, halfword nextnode, const line_break_properties *properties);
-
-extern void tex_adjust_passon (halfword box, halfword adjust);
-extern void tex_adjust_attach (halfword box, halfword adjust);
-
-extern halfword tex_prepend_adjust_list (halfword head, halfword tail, halfword adjust);
-extern halfword tex_append_adjust_list (halfword head, halfword tail, halfword adjust);
+extern void tex_initialize_adjust (void);
+extern void tex_cleanup_adjust (void);
+
+extern void tex_run_vadjust (void);
+extern void tex_set_vadjust (halfword target);
+extern void tex_finish_vadjust_group (void);
+
+extern int tex_valid_adjust_index (halfword n);
+
+extern void tex_inject_adjust_list (halfword list, int obeyoptions, halfword nextnode, const line_break_properties *properties);
+
+extern void tex_adjust_passon (halfword box, halfword adjust);
+extern void tex_adjust_attach (halfword box, halfword adjust);
+
+extern halfword tex_prepend_adjust_list (halfword head, halfword tail, halfword adjust, const char *detail);
+extern halfword tex_append_adjust_list (halfword head, halfword tail, halfword adjust, const char *detail);
+
+extern halfword tex_flush_adjust_append (halfword adjust, halfword tail);
+extern halfword tex_flush_adjust_prepend (halfword adjust, halfword tail);
# endif \ No newline at end of file
diff --git a/source/luametatex/source/tex/texalign.c b/source/luametatex/source/tex/texalign.c
index c8e4ed9dc..4ea4879c2 100644
--- a/source/luametatex/source/tex/texalign.c
+++ b/source/luametatex/source/tex/texalign.c
@@ -1066,7 +1066,7 @@ static void tex_aux_initialize_span(halfword p)
{
tex_push_nest();
if (cur_list.mode == restricted_hmode) {
- cur_list.space_factor = 1000;
+ cur_list.space_factor = default_space_factor;
} else {
cur_list.prev_depth = ignore_depth_criterium_par;
tex_normal_paragraph(span_par_context);
@@ -1421,7 +1421,7 @@ static void tex_aux_finish_row(void)
row = tex_filtered_vpack(node_next(cur_list.head), 0, packing_additional, max_depth_par, finish_row_group, direction_unknown, 0, null, 0, 0);
tex_pop_nest();
tex_tail_append(row);
- cur_list.space_factor = 1000;
+ cur_list.space_factor = default_space_factor;
}
/*tex
Currently this one can be overloaded by the one set on the row via the noalign trickery
@@ -1769,11 +1769,11 @@ static void tex_aux_finish_align(void)
halfword preptr;
halfword colptr;
if (cur_list.mode == internal_vmode) {
- /* tex_aux_change_list_type(rowptr, hlist_node); */ /* too much */
+ /* tex_aux_change_list_type(rowptr, hlist_node); */ /* too much, needs checking */
node_type(rowptr) = hlist_node;
box_width(rowptr) = box_width(preroll);
} else {
- /* tex_aux_change_list_type(rowptr, vlist_node); */ /* too much */
+ /* tex_aux_change_list_type(rowptr, vlist_node); */ /* too much, needs checking */
node_type(rowptr) = vlist_node;
box_height(rowptr) = box_height(preroll);
}
diff --git a/source/luametatex/source/tex/texbuildpage.c b/source/luametatex/source/tex/texbuildpage.c
index 947ef1776..be75042eb 100644
--- a/source/luametatex/source/tex/texbuildpage.c
+++ b/source/luametatex/source/tex/texbuildpage.c
@@ -337,14 +337,32 @@ static halfword tex_aux_page_badness(scaled goal)
}
}
+static halfword tex_aux_insert_topskip(halfword height, int contribution)
+{
+ if (lmt_page_builder_state.contents != contribute_nothing) {
+ lmt_page_builder_state.contents = contribution;
+ } else {
+ tex_aux_freeze_page_specs(contribution);
+ }
+ {
+ halfword glue = tex_new_param_glue_node(top_skip_code, top_skip_glue);
+ if (glue_amount(glue) > height) {
+ glue_amount(glue) -= height;
+ } else {
+ glue_amount(glue) = 0;
+ }
+ return glue;
+ }
+}
+
void tex_build_page(void)
{
if (node_next(contribute_head) && ! lmt_page_builder_state.output_active) {
/*tex The (upcoming) penalty to be added to the badness: */
- int pi = 0;
+ int penalty = 0;
do {
- halfword p = node_next(contribute_head);
- halfword last_type = node_type(p);
+ halfword current = node_next(contribute_head);
+ halfword type = node_type(current);
/*tex Update the values of |last_glue|, |last_penalty|, and |last_kern|. */
if (lmt_page_builder_state.last_glue != max_halfword) {
tex_flush_node(lmt_page_builder_state.last_glue);
@@ -353,21 +371,21 @@ void tex_build_page(void)
lmt_page_builder_state.last_penalty = 0;
lmt_page_builder_state.last_kern = 0;
lmt_page_builder_state.last_boundary = 0;
- lmt_page_builder_state.last_node_type = last_type;
- lmt_page_builder_state.last_node_subtype = node_subtype(p);
+ lmt_page_builder_state.last_node_type = type;
+ lmt_page_builder_state.last_node_subtype = node_subtype(current);
lmt_page_builder_state.last_extra_used = 0;
- switch (last_type) {
+ switch (type) {
case glue_node:
- lmt_page_builder_state.last_glue = tex_new_glue_node(p, node_subtype(p));
+ lmt_page_builder_state.last_glue = tex_new_glue_node(current, node_subtype(current));
break;
case penalty_node:
- lmt_page_builder_state.last_penalty = penalty_amount(p);
+ lmt_page_builder_state.last_penalty = penalty_amount(current);
break;
case kern_node:
- lmt_page_builder_state.last_kern = kern_amount(p);
+ lmt_page_builder_state.last_kern = kern_amount(current);
break;
case boundary_node:
- lmt_page_builder_state.last_boundary = boundary_data(p);
+ lmt_page_builder_state.last_boundary = boundary_data(current);
break;
}
/*tex
@@ -392,102 +410,96 @@ void tex_build_page(void)
the contribution list will not be contributed until we know its successor.
*/
- switch (last_type) {
+ switch (type) {
case hlist_node:
case vlist_node:
- if (auto_migrating_mode_permitted(auto_migration_mode_par, auto_migrate_post)) {
- halfword h = box_post_migrated(p);
- if (h) {
- halfword t = tex_tail_of_node_list(h);
- if (node_next(p)) {
- tex_couple_nodes(t, node_next(p));
- } else {
- contribute_tail = t;
+ {
+ if (auto_migrating_mode_permitted(auto_migration_mode_par, auto_migrate_post)) {
+ halfword head = box_post_migrated(current);
+ if (head) {
+ halfword tail = tex_tail_of_node_list(head);
+ if (tracing_adjusts_par > 1) {
+ tex_begin_diagnostic();
+ tex_print_format("[adjust: post, mvl]");
+ tex_print_node_list(head,"post",show_box_depth_par, show_box_breadth_par);
+ tex_end_diagnostic();
+ }
+ if (node_next(current)) {
+ tex_couple_nodes(tail, node_next(current));
+ } else {
+ contribute_tail = tail;
+ }
+ tex_couple_nodes(current, head);
+ box_post_migrated(current) = null;
}
- tex_couple_nodes(p, h);
- box_post_migrated(p) = null;
}
- }
- if (auto_migrating_mode_permitted(auto_migration_mode_par, auto_migrate_pre)) {
- halfword h = box_pre_migrated(p);
- if (h) {
- halfword t = tex_tail_of_node_list(h);
- tex_couple_nodes(t, p);
- tex_couple_nodes(contribute_head, h);
- box_pre_migrated(p) = null;
- continue;
- }
- }
- /* common with rule */
- if (lmt_page_builder_state.contents < contribute_box) { // nothing or insert
- /*tex
- Initialize the current page, insert the |\topskip| glue ahead of |p|,
- and |goto continue|.
- */
- halfword q;
- if (lmt_page_builder_state.contents != contribute_nothing) {
- lmt_page_builder_state.contents = contribute_box;
- } else {
- tex_aux_freeze_page_specs(contribute_box);
+ if (auto_migrating_mode_permitted(auto_migration_mode_par, auto_migrate_pre)) {
+ halfword head = box_pre_migrated(current);
+ if (head) {
+ halfword tail = tex_tail_of_node_list(head);
+ if (tracing_adjusts_par > 1) {
+ tex_begin_diagnostic();
+ tex_print_format("[adjust: pre, mvl]");
+ tex_print_node_list(head,"pre",show_box_depth_par, show_box_breadth_par);
+ tex_end_diagnostic();
+ }
+ tex_couple_nodes(tail, current);
+ tex_couple_nodes(contribute_head, current);
+ // if (contribute_head == contribute_tail) {
+ // contribute_tail = tail;
+ // }
+ box_pre_migrated(current) = null;
+ continue;
+ }
}
- q = tex_new_param_glue_node(top_skip_code, top_skip_glue);
- if (glue_amount(q) > box_height(p)) {
- glue_amount(q) -= box_height(p);
+ if (lmt_page_builder_state.contents < contribute_box) {
+ /*tex
+ Initialize the current page, insert the |\topskip| glue ahead of |p|,
+ and |goto continue|.
+ */
+ halfword gluenode = tex_aux_insert_topskip(box_height(current), contribute_box);
+ tex_couple_nodes(gluenode, current);
+ tex_couple_nodes(contribute_head, gluenode);
+ continue;
} else {
- glue_amount(q) = 0;
+ /*tex Move a box to the current page, then |goto contribute|. */
+ page_total += page_depth + box_height(current);
+ page_depth = box_depth(current);
+ goto CONTRIBUTE;
}
- tex_couple_nodes(q, p);
- tex_couple_nodes(contribute_head, q);
- continue;
- } else {
- /*tex Move a box to the current page, then |goto contribute|. */
- page_total += page_depth + box_height(p);
- page_depth = box_depth(p);
- goto CONTRIBUTE;
}
case rule_node:
/* common with box */
if (lmt_page_builder_state.contents < contribute_box) {
- halfword q;
- if (lmt_page_builder_state.contents != contribute_nothing) {
- lmt_page_builder_state.contents = contribute_rule;
- } else {
- tex_aux_freeze_page_specs(contribute_rule);
- }
- q = tex_new_param_glue_node(top_skip_code, top_skip_glue);
- if (glue_amount(q) > rule_height(p)) {
- glue_amount(q) -= rule_height(p);
- } else {
- glue_amount(q) = 0;
- }
- tex_couple_nodes(q, p);
- tex_couple_nodes(contribute_head, q);
+ halfword gluenode = tex_aux_insert_topskip(rule_height(current), contribute_rule);
+ tex_couple_nodes(gluenode, current);
+ tex_couple_nodes(contribute_head, gluenode);
continue;
} else {
- page_total += page_depth + rule_height(p);
- page_depth = rule_depth(p);
+ page_total += page_depth + rule_height(current);
+ page_depth = rule_depth(current);
goto CONTRIBUTE;
}
case boundary_node:
if (lmt_page_builder_state.contents < contribute_box) {
goto DISCARD;
- } else if (node_subtype(p) == page_boundary) {
+ } else if (node_subtype(current) == page_boundary) {
/*tex
We just triggered the pagebuilder for which we needed a contribution. We fake
a zero penalty so that all gets processed. The main rationale is that we get
a better indication of what we do. Of course a callback can remove this node
so that it is never seen. Triggering from the callback is not doable.
*/
- halfword n = tex_new_node(penalty_node, user_penalty_subtype);
+ halfword penaltynode = tex_new_node(penalty_node, user_penalty_subtype);
/* todo: copy attributes */
tex_page_boundary_message("processed as penalty", 0);
- tex_try_couple_nodes(node_prev(p), n);
- tex_try_couple_nodes(n, node_next(p));
- tex_flush_node(p);
- penalty_amount(n) = boundary_data(p);
- p = n;
- node_next(contribute_head) = p;
- pi = 0;
+ tex_try_couple_nodes(node_prev(current), penaltynode);
+ tex_try_couple_nodes(penaltynode, node_next(current));
+ tex_flush_node(current);
+ penalty_amount(penaltynode) = boundary_data(current);
+ current = penaltynode;
+ node_next(contribute_head) = current;
+ penalty = 0;
break;
} else {
goto DISCARD;
@@ -498,7 +510,7 @@ void tex_build_page(void)
if (lmt_page_builder_state.contents < contribute_box) {
goto DISCARD;
} else if (precedes_break(lmt_page_builder_state.page_tail)) {
- pi = 0;
+ penalty = 0;
break;
} else {
goto UPDATEHEIGHTS;
@@ -506,10 +518,10 @@ void tex_build_page(void)
case kern_node:
if (lmt_page_builder_state.contents < contribute_box) {
goto DISCARD;
- } else if (! node_next(p)) {
+ } else if (! node_next(current)) {
return;
- } else if (node_type(node_next(p)) == glue_node) {
- pi = 0;
+ } else if (node_type(node_next(current)) == glue_node) {
+ penalty = 0;
break;
} else {
goto UPDATEHEIGHTS;
@@ -518,7 +530,7 @@ void tex_build_page(void)
if (lmt_page_builder_state.contents < contribute_box) {
goto DISCARD;
} else {
- pi = penalty_amount(p);
+ penalty = penalty_amount(current);
break;
}
case mark_node:
@@ -529,7 +541,7 @@ void tex_build_page(void)
Append an insertion to the current page and |goto contribute|. The insertion
number (index) is registered in the subtype (not any more for a while).
*/
- halfword index = insert_index(p); /* initially 65K */
+ halfword index = insert_index(current); /* initially 65K */
halfword location = page_insert_head;
halfword multiplier = tex_get_insert_multiplier(index);
halfword content = tex_get_insert_content(index);
@@ -568,13 +580,13 @@ void tex_build_page(void)
general).
*/
- halfword q = tex_new_node(split_node, normal_split_subtype);
+ halfword splitnode = tex_new_node(split_node, normal_split_subtype);
scaled advance = 0;
halfword distance = lmt_get_insert_distance(index, slot); /*tex Callback: we get a copy! */
- split_insert_index(q) = index;
- tex_try_couple_nodes(q, node_next(location));
- tex_couple_nodes(location, q);
- location = q;
+ split_insert_index(splitnode) = index;
+ tex_try_couple_nodes(splitnode, node_next(location));
+ tex_couple_nodes(location, splitnode);
+ location = splitnode;
if (! tex_aux_valid_insert_content(content)) {
content = tex_aux_delete_box_content(content);
tex_set_insert_content(index, content);
@@ -612,19 +624,19 @@ void tex_build_page(void)
}
/*tex I really need to check this logic with the original \LUATEX\ code. */
if (node_type(location) == split_node && node_subtype(location) == insert_split_subtype) {
- lmt_page_builder_state.insert_penalties += insert_float_cost(p);
+ lmt_page_builder_state.insert_penalties += insert_float_cost(current);
} else {
scaled delta = page_goal - page_total - page_depth + page_shrink;
- scaled needed = insert_total_height(p);
- split_last_insert(location) = p;
+ scaled needed = insert_total_height(current);
+ split_last_insert(location) = current;
/*tex This much room is left if we shrink the maximum. */
if (multiplier != 1000) {
/*tex This much room is needed. */
needed = tex_x_over_n(needed, 1000) * multiplier;
}
- if ((needed <= 0 || needed <= delta) && (insert_total_height(p) + box_height(location) <= limit)) {
- update_page_goal(index, insert_total_height(p), needed);
- box_height(location) += insert_total_height(p);
+ if ((needed <= 0 || needed <= delta) && (insert_total_height(current) + box_height(location) <= limit)) {
+ update_page_goal(index, insert_total_height(current), needed);
+ box_height(location) += insert_total_height(current);
} else {
/*tex
@@ -645,7 +657,7 @@ void tex_build_page(void)
*/
scaled height;
- halfword brk, penalty;
+ halfword breaknode, penalty;
if (multiplier <= 0) {
height = max_dimen;
} else {
@@ -657,9 +669,9 @@ void tex_build_page(void)
if (height > limit - box_height(location)) {
height = limit - box_height(location);
}
- brk = tex_vert_break(insert_list(p), height, insert_max_depth(p));
+ breaknode = tex_vert_break(insert_list(current), height, insert_max_depth(current));
box_height(location) += lmt_packaging_state.best_height_plus_depth;
- penalty = brk ? (node_type(brk) == penalty_node ? penalty_amount(brk) : 0) : eject_penalty;
+ penalty = breaknode ? (node_type(breaknode) == penalty_node ? penalty_amount(breaknode) : 0) : eject_penalty;
if (tracing_pages_par > 0) {
tex_aux_display_insertion_split_cost(index, height, penalty);
}
@@ -668,15 +680,15 @@ void tex_build_page(void)
}
update_page_goal(index, lmt_packaging_state.best_height_plus_depth, lmt_packaging_state.best_height_plus_depth);
node_subtype(location) = insert_split_subtype;
- split_broken(location) = brk;
- split_broken_insert(location) = p;
+ split_broken(location) = breaknode;
+ split_broken_insert(location) = current;
lmt_page_builder_state.insert_penalties += penalty;
}
}
goto CONTRIBUTE;
}
default:
- tex_formatted_error("pagebuilder", "invalid node of type %d in vertical mode", node_type(p));
+ tex_formatted_error("pagebuilder", "invalid node of type %d in vertical mode", node_type(current));
break;
}
/*tex
@@ -684,7 +696,7 @@ void tex_build_page(void)
prepare for output, and either fire up the users output routine and |return| or
ship out the page and |goto done|.
*/
- if (pi < infinite_penalty) {
+ if (penalty < infinite_penalty) {
/*tex
Compute the badness, |b|, of the current page, using |awful_bad| if the box is
too full. The |c| variable holds the costs.
@@ -714,10 +726,10 @@ void tex_build_page(void)
}
if (badness >= awful_bad) {
criterium = badness;
- } else if (pi <= eject_penalty) {
- criterium = pi;
+ } else if (penalty <= eject_penalty) {
+ criterium = penalty;
} else if (badness < infinite_bad) {
- criterium = badness + pi + lmt_page_builder_state.insert_penalties;
+ criterium = badness + penalty + lmt_page_builder_state.insert_penalties;
} else {
criterium = deplorable;
}
@@ -726,24 +738,24 @@ void tex_build_page(void)
}
{
int moveon = criterium <= lmt_page_builder_state.least_cost;
- int fireup = criterium == awful_bad || pi <= eject_penalty;
+ int fireup = criterium == awful_bad || penalty <= eject_penalty;
if (tracing_pages_par > 0) {
- tex_aux_display_page_break_cost(badness, pi, criterium, moveon, fireup);
+ tex_aux_display_page_break_cost(badness, penalty, criterium, moveon, fireup);
}
if (moveon) {
- halfword r = node_next(page_insert_head);
- lmt_page_builder_state.best_break = p;
+ halfword insert = node_next(page_insert_head);
+ lmt_page_builder_state.best_break = current;
lmt_page_builder_state.best_size = page_goal;
lmt_page_builder_state.insert_penalties = 0;
lmt_page_builder_state.least_cost = criterium;
- while (r != page_insert_head) {
- split_best_insert(r) = split_last_insert(r);
- r = node_next(r);
+ while (insert != page_insert_head) {
+ split_best_insert(insert) = split_last_insert(insert);
+ insert = node_next(insert);
}
}
if (fireup) {
/*tex Output the current page at the best place. */
- tex_aux_fire_up(p);
+ tex_aux_fire_up(current);
if (lmt_page_builder_state.output_active) {
/*tex User's output routine will act. */
return;
@@ -759,19 +771,19 @@ void tex_build_page(void)
Go here to record glue in the |active_height| table. Update the current page
measurements with respect to the glue or kern specified by node~|p|.
*/
- switch(node_type(p)) {
+ switch(node_type(current)) {
case kern_node:
- page_total += page_depth + kern_amount(p);
+ page_total += page_depth + kern_amount(current);
page_depth = 0;
goto APPEND;
case glue_node:
- if (glue_stretch_order(p) > 1) {
- page_stretch_1(glue_stretch_order(p)) += glue_stretch(p);
+ if (glue_stretch_order(current) > 1) {
+ page_stretch_1(glue_stretch_order(current)) += glue_stretch(current);
} else {
- page_stretch_2(glue_stretch_order(p)) += glue_stretch(p);
+ page_stretch_2(glue_stretch_order(current)) += glue_stretch(current);
}
- page_shrink += glue_shrink(p);
- if (glue_shrink_order(p) != normal_glue_order && glue_shrink(p)) {
+ page_shrink += glue_shrink(current);
+ if (glue_shrink_order(current) != normal_glue_order && glue_shrink(current)) {
tex_handle_error(
normal_error_type,
"Infinite glue shrinkage found on current page",
@@ -779,10 +791,10 @@ void tex_build_page(void)
"'\\vss' or '\\vskip 0pt minus 1fil'. Such glue doesn't belong there; but you can\n"
"safely proceed, since the offensive shrinkability has been made finite."
);
- tex_reset_glue_to_zero(p);
- glue_shrink_order(p) = normal_glue_order;
+ tex_reset_glue_to_zero(current);
+ glue_shrink_order(current) = normal_glue_order;
}
- page_total += page_depth + glue_amount(p);
+ page_total += page_depth + glue_amount(current);
page_depth = 0;
goto APPEND;
}
@@ -796,25 +808,25 @@ void tex_build_page(void)
page_depth = lmt_page_builder_state.max_depth;
}
APPEND:
- /*tex Link node |p| into the current page and |goto done|. We assume a positive depth. */
- tex_couple_nodes(lmt_page_builder_state.page_tail, p);
- lmt_page_builder_state.page_tail = p;
- tex_try_couple_nodes(contribute_head, node_next(p));
- node_next(p) = null;
- continue;
+ /*tex Link node |p| into the current page and |goto done|. We assume a positive depth. */
+ tex_couple_nodes(lmt_page_builder_state.page_tail, current);
+ lmt_page_builder_state.page_tail = current;
+ tex_try_couple_nodes(contribute_head, node_next(current));
+ node_next(current) = null;
+ continue; // or: break;
DISCARD:
/*tex Recycle node |p|. */
- tex_try_couple_nodes(contribute_head, node_next(p));
- node_next(p) = null;
+ tex_try_couple_nodes(contribute_head, node_next(current));
+ node_next(current) = null;
if (saving_vdiscards_par > 0) {
if (lmt_packaging_state.page_discards_head) {
- tex_couple_nodes(lmt_packaging_state.page_discards_tail, p);
+ tex_couple_nodes(lmt_packaging_state.page_discards_tail, current);
} else {
- lmt_packaging_state.page_discards_head = p;
+ lmt_packaging_state.page_discards_head = current;
}
- lmt_packaging_state.page_discards_tail = p;
+ lmt_packaging_state.page_discards_tail = current;
} else {
- tex_flush_node_list(p);
+ tex_flush_node_list(current);
}
} while (node_next(contribute_head));
/*tex Make the contribution list empty by setting its tail to |contribute_head|. */
diff --git a/source/luametatex/source/tex/texcommands.c b/source/luametatex/source/tex/texcommands.c
index 5c8328d52..03bcc34d1 100644
--- a/source/luametatex/source/tex/texcommands.c
+++ b/source/luametatex/source/tex/texcommands.c
@@ -559,6 +559,7 @@ void tex_initialize_commands(void)
tex_primitive(luatex_command, "boxrepack", set_box_property_cmd, box_repack_code, 0);
tex_primitive(luatex_command, "boxfreeze", set_box_property_cmd, box_freeze_code, 0);
tex_primitive(luatex_command, "boxattribute", set_box_property_cmd, box_attribute_code, 0);
+ tex_primitive(luatex_command, "boxvadjust", set_box_property_cmd, box_vadjust_code, 0);
tex_primitive(tex_command, "lastpenalty", some_item_cmd, lastpenalty_code, 0);
tex_primitive(tex_command, "lastkern", some_item_cmd, lastkern_code, 0);
@@ -707,7 +708,9 @@ void tex_initialize_commands(void)
tex_primitive(luatex_command, "ifzeronum", if_test_cmd, if_zero_int_code, 0);
tex_primitive(luatex_command, "ifzerodim", if_test_cmd, if_zero_dim_code, 0);
tex_primitive(luatex_command, "ifchknum", if_test_cmd, if_chk_int_code, 0);
+ tex_primitive(luatex_command, "ifchknumber", if_test_cmd, if_chk_integer_code, 0);
tex_primitive(luatex_command, "ifchkdim", if_test_cmd, if_chk_dim_code, 0);
+ tex_primitive(luatex_command, "ifchkdimension", if_test_cmd, if_chk_dimension_code, 0);
tex_primitive(luatex_command, "ifcmpnum", if_test_cmd, if_cmp_int_code, 0);
tex_primitive(luatex_command, "ifcmpdim", if_test_cmd, if_cmp_dim_code, 0);
tex_primitive(luatex_command, "ifnumval", if_test_cmd, if_val_int_code, 0);
@@ -896,6 +899,8 @@ void tex_initialize_commands(void)
tex_primitive(luatex_command, "localrightboxbox", make_box_cmd, local_right_box_box_code, 0);
tex_primitive(luatex_command, "localmiddleboxbox", make_box_cmd, local_middle_box_box_code, 0);
+ /*tex Begin compatibility. */
+
tex_primitive(tex_command, "mathord", math_component_cmd, math_component_ordinary_code, 0);
tex_primitive(tex_command, "mathop", math_component_cmd, math_component_operator_code, 0);
tex_primitive(tex_command, "mathbin", math_component_cmd, math_component_binary_code, 0);
@@ -904,13 +909,26 @@ void tex_initialize_commands(void)
tex_primitive(tex_command, "mathclose", math_component_cmd, math_component_close_code, 0);
tex_primitive(tex_command, "mathpunct", math_component_cmd, math_component_punctuation_code, 0);
tex_primitive(tex_command, "mathinner", math_component_cmd, math_component_inner_code, 0);
- tex_primitive(luatex_command, "mathfrac", math_component_cmd, math_component_fraction_code, 0);
- tex_primitive(luatex_command, "mathrad", math_component_cmd, math_component_radical_code, 0);
+ tex_primitive(tex_command, "underline", math_component_cmd, math_component_under_code, 0);
+ tex_primitive(tex_command, "overline", math_component_cmd, math_component_over_code, 0);
+
+ /*tex End compatibility. */
+
+ tex_primitive(luatex_command, "mathordinary", math_component_cmd, math_component_ordinary_code, 0);
+ tex_primitive(luatex_command, "mathoperator", math_component_cmd, math_component_operator_code, 0);
+ tex_primitive(luatex_command, "mathbinary", math_component_cmd, math_component_binary_code, 0);
+ tex_primitive(luatex_command, "mathrelation", math_component_cmd, math_component_relation_code, 0);
+ tex_primitive(luatex_command, "mathopen", math_component_cmd, math_component_open_code, 0);
+ tex_primitive(luatex_command, "mathclose", math_component_cmd, math_component_close_code, 0);
+ tex_primitive(luatex_command, "mathpunct", math_component_cmd, math_component_punctuation_code, 0);
+ tex_primitive(luatex_command, "mathinner", math_component_cmd, math_component_inner_code, 0);
+ tex_primitive(luatex_command, "mathfraction", math_component_cmd, math_component_fraction_code, 0);
+ tex_primitive(luatex_command, "mathradical", math_component_cmd, math_component_radical_code, 0);
tex_primitive(luatex_command, "mathmiddle", math_component_cmd, math_component_middle_code, 0);
tex_primitive(luatex_command, "mathaccent", math_component_cmd, math_component_accent_code, 0);
tex_primitive(luatex_command, "mathfenced", math_component_cmd, math_component_fenced_code, 0);
- tex_primitive(tex_command, "underline", math_component_cmd, math_component_under_code, 0);
- tex_primitive(tex_command, "overline", math_component_cmd, math_component_over_code, 0);
+ tex_primitive(luatex_command, "mathunderline", math_component_cmd, math_component_under_code, 0);
+ tex_primitive(luatex_command, "mathoverline", math_component_cmd, math_component_over_code, 0);
tex_primitive(luatex_command, "mathghost", math_component_cmd, math_component_ghost_code, 0);
tex_primitive(luatex_command, "mathatom", math_component_cmd, math_component_atom_code, 0);
@@ -929,8 +947,6 @@ void tex_initialize_commands(void)
tex_primitive(luatex_command, "crampedtextstyle", math_style_cmd, cramped_text_style, 0);
tex_primitive(luatex_command, "crampedscriptstyle", math_style_cmd, cramped_script_style, 0);
tex_primitive(luatex_command, "crampedscriptscriptstyle", math_style_cmd, cramped_script_script_style, 0);
- tex_primitive(luatex_command, "Ustyle", math_style_cmd, yet_unset_math_style, 0);
- tex_primitive(luatex_command, "scaledmathstyle", math_style_cmd, scaled_math_style, 0);
tex_primitive(luatex_command, "alldisplaystyles", math_style_cmd, all_display_styles, 0);
tex_primitive(luatex_command, "alltextstyles", math_style_cmd, all_text_styles, 0);
tex_primitive(luatex_command, "allscriptstyles", math_style_cmd, all_script_styles, 0);
@@ -941,6 +957,8 @@ void tex_initialize_commands(void)
tex_primitive(luatex_command, "allunsplitstyles", math_style_cmd, all_unsplit_styles, 0);
tex_primitive(luatex_command, "alluncrampedstyles", math_style_cmd, all_uncramped_styles, 0);
tex_primitive(luatex_command, "allcrampedstyles", math_style_cmd, all_cramped_styles, 0);
+ tex_primitive(luatex_command, "Ustyle", math_style_cmd, yet_unset_math_style, 0);
+ tex_primitive(luatex_command, "scaledmathstyle", math_style_cmd, scaled_math_style, 0);
tex_primitive(tex_command, "message", message_cmd, message_code, 0);
tex_primitive(tex_command, "errmessage", message_cmd, error_message_code, 0);
@@ -1036,8 +1054,8 @@ void tex_initialize_commands(void)
tex_primitive(tex_command, "unvcopy", un_vbox_cmd, copy_code, 0);
tex_primitive(luatex_command, "unvpack", un_vbox_cmd, unpack_code, 0);
- tex_primitive(etex_command, "pagediscards", un_vbox_cmd, last_box_code, 0);
- tex_primitive(etex_command, "splitdiscards", un_vbox_cmd, vsplit_code, 0);
+ tex_primitive(etex_command, "pagediscards", un_vbox_cmd, page_discards_code, 0);
+ tex_primitive(etex_command, "splitdiscards", un_vbox_cmd, split_discards_code, 0);
tex_primitive(luatex_command, "insertunbox", un_vbox_cmd, insert_box_code, 0);
tex_primitive(luatex_command, "insertuncopy", un_vbox_cmd, insert_copy_code, 0);
diff --git a/source/luametatex/source/tex/texcommands.h b/source/luametatex/source/tex/texcommands.h
index 6495c93f0..57dc30f4f 100644
--- a/source/luametatex/source/tex/texcommands.h
+++ b/source/luametatex/source/tex/texcommands.h
@@ -621,9 +621,10 @@ typedef enum box_property_codes {
box_freeze_code,
/* we actually need set_box_int_cmd, or set_box_property */
box_attribute_code,
+ box_vadjust_code,
} box_property_codes;
-# define last_box_property_code box_attribute_code
+# define last_box_property_code box_vadjust_code
typedef enum hyphenation_codes {
hyphenation_code,
@@ -1075,11 +1076,7 @@ typedef enum math_styles {
cramped_script_style, /*tex |\crampedscriptstyle| */
script_script_style, /*tex |\scriptscriptstyle| */
cramped_script_script_style, /*tex |\crampedscriptscriptstyle| */
- /* hidden */
- yet_unset_math_style,
- former_choice_math_style,
- scaled_math_style,
- /* even more hidden */ /*tex These can be used to emulate the defaults. */
+ /* hidden */ /*tex These can be used to emulate the defaults. */
all_display_styles,
all_text_styles,
all_script_styles,
@@ -1090,13 +1087,18 @@ typedef enum math_styles {
all_unsplit_styles,
all_uncramped_styles,
all_cramped_styles,
+ /* hidden */
+ yet_unset_math_style,
+ scaled_math_style,
+ former_choice_math_style,
} math_styles;
# define first_math_style display_style
-# define last_math_style all_cramped_styles
+# define last_math_style former_choice_math_style
# define is_valid_math_style(n) (n >= display_style && n <= cramped_script_script_style)
# define are_valid_math_styles(n) (n >= all_display_styles && n <= all_cramped_styles)
+# define visible_math_styles(n) (n >= display_style && n <= all_cramped_styles)
inline static halfword tex_math_style_to_size(halfword s)
{
diff --git a/source/luametatex/source/tex/texconditional.c b/source/luametatex/source/tex/texconditional.c
index 9cbdeed2b..22176f8b6 100644
--- a/source/luametatex/source/tex/texconditional.c
+++ b/source/luametatex/source/tex/texconditional.c
@@ -487,6 +487,21 @@ inline static halfword tex_aux_scan_comparison(int code)
}
}
+inline static void tex_aux_check_strict(int *result)
+{
+ tex_get_x_token();
+ switch (cur_cmd) {
+ case relax_cmd:
+ case spacer_cmd:
+ case if_test_cmd:
+ break;
+ default:
+ *result = 2;
+ break;
+ }
+ tex_back_input(cur_tok);
+}
+
void tex_conditional_if(halfword code, int unless)
{
/*tex The result or case value. */
@@ -731,11 +746,15 @@ void tex_conditional_if(halfword code, int unless)
result = 0;
goto RESULT;
case if_chk_int_code:
+ case if_chk_integer_code:
{
lmt_error_state.intercept = 1; /* maybe ++ and -- so that we can nest */
lmt_error_state.last_intercept = 0;
lmt_condition_state.chk_num = tex_scan_int(0, NULL); /* value is ignored */
result = lmt_error_state.last_intercept ? 2 : 1;
+ if (result == 1 && code == if_chk_integer_code) {
+ tex_aux_check_strict(&result);
+ }
lmt_error_state.intercept = 0;
lmt_error_state.last_intercept = 0;
goto CASE;
@@ -758,11 +777,15 @@ void tex_conditional_if(halfword code, int unless)
goto CASE;
}
case if_chk_dim_code:
+ case if_chk_dimension_code:
{
lmt_error_state.intercept = 1;
lmt_error_state.last_intercept = 0;
lmt_condition_state.chk_dim = tex_scan_dimen(0, 0, 0, 0, NULL); /* value is ignored */
result = lmt_error_state.last_intercept ? 2 : 1;
+ if (result == 1 && code == if_chk_dimension_code) {
+ tex_aux_check_strict(&result);
+ }
lmt_error_state.intercept = 0;
lmt_error_state.last_intercept = 0;
goto CASE;
diff --git a/source/luametatex/source/tex/texconditional.h b/source/luametatex/source/tex/texconditional.h
index 47157556c..36f86f6a5 100644
--- a/source/luametatex/source/tex/texconditional.h
+++ b/source/luametatex/source/tex/texconditional.h
@@ -72,10 +72,12 @@ typedef enum if_test_codes {
if_true_code, /*tex |\iftrue| */
if_false_code, /*tex |\iffalse| */
if_chk_int_code, /*tex |\ifchknum| */
- if_val_int_code, /*tex |\ifcmpnum| */
+ if_chk_integer_code, /*tex |\ifchknumber| */
+ if_val_int_code, /*tex |\ifnumval| */
if_cmp_int_code, /*tex |\ifcmpnum| */
if_chk_dim_code, /*tex |\ifchkdim| */
- if_val_dim_code, /*tex |\ifchkdim| */
+ if_chk_dimension_code, /*tex |\ifchkdimension| */
+ if_val_dim_code, /*tex |\ifdimval| */
if_cmp_dim_code, /*tex |\ifcmpdim| */
if_case_code, /*tex |\ifcase| */
if_def_code, /*tex |\ifdefined| */
diff --git a/source/luametatex/source/tex/texdumpdata.h b/source/luametatex/source/tex/texdumpdata.h
index a386ca3ba..87d987421 100644
--- a/source/luametatex/source/tex/texdumpdata.h
+++ b/source/luametatex/source/tex/texdumpdata.h
@@ -55,7 +55,7 @@
*/
-# define luametatex_format_fingerprint 682
+# define luametatex_format_fingerprint 684
/* These end up in the string pool. */
diff --git a/source/luametatex/source/tex/texequivalents.c b/source/luametatex/source/tex/texequivalents.c
index e61db3826..56d14a54f 100644
--- a/source/luametatex/source/tex/texequivalents.c
+++ b/source/luametatex/source/tex/texequivalents.c
@@ -664,14 +664,13 @@ void tex_show_save_groups(void)
// ++pointer;
// tex_print_str_esc("beginmathgroup");
// goto FOUND2;
- case math_shift_group:
- if (mode == mmode) {
- tex_print_char('$');
- } else if (lmt_nest_state.nest[pointer].mode == mmode) {
- tex_print_cmd_chr(equation_number_cmd, tex_aux_save_value(saved_equation_number_item_location));
- goto FOUND2;
- }
+ case math_inline_group:
tex_print_char('$');
+ case math_display_group:
+ tex_print_char('$');
+ goto FOUND2;
+ case math_number_group:
+ tex_print_cmd_chr(equation_number_cmd, tex_aux_save_value(saved_equation_number_item_location));
goto FOUND2;
case math_fence_group:
/* kind of ugly ... maybe also save that one */ /* todo: operator */
diff --git a/source/luametatex/source/tex/texequivalents.h b/source/luametatex/source/tex/texequivalents.h
index 4a18c4d87..d64c78807 100644
--- a/source/luametatex/source/tex/texequivalents.h
+++ b/source/luametatex/source/tex/texequivalents.h
@@ -930,6 +930,7 @@ typedef enum save_types {
adjust_attr_list_save_type,
adjust_depth_before_save_type,
adjust_depth_after_save_type,
+ adjust_target_save_type,
} save_types;
/*tex Nota bena: |equiv_value| is the same as |equiv| but sometimes we use that name instead. */
@@ -988,8 +989,10 @@ typedef enum tex_group_codes {
also_simple_group, /*tex code for |\begingroup|\unknown|\egroup| */
semi_simple_group, /*tex code for |\begingroup|\unknown|\endgroup| */
math_simple_group, /*tex code for |\beginmathgroup|\unknown|\endmathgroup| */
- math_shift_group, /*tex code for |$|\unknown\|$| */
math_fence_group, /*tex code for fences |\left|\unknown|\right| */
+ math_inline_group,
+ math_display_group,
+ math_number_group,
local_box_group, /*tex code for |\localleftbox|\unknown|localrightbox| */
split_off_group, /*tex box code for the top part of a |\vsplit| */
split_keep_group, /*tex box code for the bottom part of a |\vsplit| */
diff --git a/source/luametatex/source/tex/texexpand.c b/source/luametatex/source/tex/texexpand.c
index feb20c8d9..6cf887bea 100644
--- a/source/luametatex/source/tex/texexpand.c
+++ b/source/luametatex/source/tex/texexpand.c
@@ -419,7 +419,9 @@ void tex_expand_current_token(void)
case the_cmd:
{
halfword h = tex_the_toks(cur_chr, NULL);
- tex_begin_inserted_list(h);
+ if (h) {
+ tex_begin_inserted_list(h);
+ }
break;
}
case lua_call_cmd:
diff --git a/source/luametatex/source/tex/texlinebreak.c b/source/luametatex/source/tex/texlinebreak.c
index 52e7f25d3..af60f1c40 100644
--- a/source/luametatex/source/tex/texlinebreak.c
+++ b/source/luametatex/source/tex/texlinebreak.c
@@ -3546,3 +3546,22 @@ static void tex_aux_post_line_break(const line_break_properties *properties, hal
cur_list.direction_stack = lmt_linebreak_state.dir_ptr;
lmt_linebreak_state.dir_ptr = null;
}
+
+halfword tex_wipe_margin_kerns(halfword head)
+{
+ /*tex We assume that head is a temp node or at least can be skipped (for now). */
+ halfword tail = head;
+ while (1) {
+ halfword next = node_next(tail);
+ if (next) {
+ if (node_type(next) == kern_node && (node_subtype(next) == left_margin_kern_subtype || node_subtype(next) == right_margin_kern_subtype)) {
+ tex_try_couple_nodes(tail, node_next(next));
+ tex_flush_node(next);
+ } else {
+ tail = next;
+ }
+ } else {
+ return tail;
+ }
+ }
+} \ No newline at end of file
diff --git a/source/luametatex/source/tex/texlinebreak.h b/source/luametatex/source/tex/texlinebreak.h
index 27c8607e0..789101999 100644
--- a/source/luametatex/source/tex/texlinebreak.h
+++ b/source/luametatex/source/tex/texlinebreak.h
@@ -142,6 +142,9 @@ extern void tex_do_line_break (
line_break_properties *properties
);
+extern halfword tex_wipe_margin_kerns(
+ halfword head
+);
/*tex
diff --git a/source/luametatex/source/tex/texmainbody.c b/source/luametatex/source/tex/texmainbody.c
index 4dd9c37a0..707882a6b 100644
--- a/source/luametatex/source/tex/texmainbody.c
+++ b/source/luametatex/source/tex/texmainbody.c
@@ -385,14 +385,15 @@ void tex_main_body(void)
lmt_error_state.history = spotless;
- {
- int dump = tex_main_control();
- if (dump && lmt_main_state.run_state != initializing_state) {
- /*tex Maybe we need to issue a warning here. For now we just ignore it. */
- dump = 0;
- }
- final_cleanup(dump);
- }
+ // {
+ // int dump = tex_main_control();
+ // if (dump && lmt_main_state.run_state != initializing_state) {
+ // /*tex Maybe we need to issue a warning here. For now we just ignore it. */
+ // dump = 0;
+ // }
+ // final_cleanup(dump);
+ // }
+ final_cleanup(tex_main_control());
tex_close_files_and_terminate(0);
diff --git a/source/luametatex/source/tex/texmaincontrol.c b/source/luametatex/source/tex/texmaincontrol.c
index 8b9250444..c15704129 100644
--- a/source/luametatex/source/tex/texmaincontrol.c
+++ b/source/luametatex/source/tex/texmaincontrol.c
@@ -64,6 +64,9 @@ main_control_state_info lmt_main_control_state = {
.quit_loop = 0,
};
+inline static void tex_aux_big_switch (int mode, int cmd);
+static void tex_run_prefixed_command (void);
+
/*tex
These two helpers, of which the second one is still experimental, actually belong in another
file so then might be moved. Watch how the first one has the |unsave| call!
@@ -150,16 +153,16 @@ static void tex_aux_out_of_range_error(halfword val, halfword max)
static void tex_aux_adjust_space_factor(halfword chr)
{
halfword s = tex_get_sf_code(chr);
- if (s == 1000) {
- cur_list.space_factor = 1000;
- } else if (s < 1000) {
+ if (s == default_space_factor) {
+ cur_list.space_factor = default_space_factor;
+ } else if (s < default_space_factor) {
if (s > 0) {
cur_list.space_factor = s;
} else {
/* s <= 0 */
}
- } else if (cur_list.space_factor < 1000) {
- cur_list.space_factor = 1000;
+ } else if (cur_list.space_factor < default_space_factor) {
+ cur_list.space_factor = default_space_factor;
} else {
cur_list.space_factor = s;
}
@@ -412,7 +415,7 @@ static void tex_aux_run_space(void) {
*/
{
halfword p;
- if (cur_mode == hmode && cur_cmd == spacer_cmd && cur_list.space_factor != 1000) {
+ if (cur_mode == hmode && cur_cmd == spacer_cmd && cur_list.space_factor != default_space_factor) {
if ((cur_list.space_factor >= 2000) && (! tex_glue_is_zero(xspace_skip_par))) {
p = tex_get_scaled_parameter_glue(xspace_skip_code, xspace_skip_glue);
} else {
@@ -796,7 +799,7 @@ static void tex_aux_scan_local_box(int code) {
tex_scan_left_brace();
tex_push_nest();
cur_list.mode = restricted_hmode;
- cur_list.space_factor = 1000;
+ cur_list.space_factor = default_space_factor;
}
static void tex_aux_finish_local_box(void)
@@ -1294,12 +1297,14 @@ static void tex_aux_run_paragraph_end_hmode(void) {
/* */
static void tex_aux_run_halign_mmode(void) {
- if (tex_in_privileged_mode()) {
- if (cur_group == math_shift_group) {
+ switch (cur_group) {
+ case math_inline_group:
+ case math_display_group:
tex_run_alignment_initialize();
- } else {
+ break;
+ default:
tex_off_save();
- }
+ break;
}
}
@@ -1534,7 +1539,33 @@ static void tex_aux_run_lua_function_call(void)
*/
-inline static void tex_aux_big_switch (int mode, int cmd);
+//int tex_main_control(void)
+//{
+// lmt_main_control_state.control_state = goto_next_state;
+// if (every_job_par) {
+// tex_begin_token_list(every_job_par, every_job_text);
+// }
+// while (1) {
+// if (lmt_main_control_state.control_state == goto_skip_token_state) {
+// lmt_main_control_state.control_state = goto_next_state;
+// } else {
+// tex_get_x_token();
+// }
+// /*tex
+// Give diagnostic information, if requested When a new token has just been fetched at
+// |big_switch|, we have an ideal place to monitor \TEX's activity.
+// */
+// if (tracing_commands_par > 0) {
+// tex_show_cmd_chr(cur_cmd, cur_chr);
+// }
+// /*tex Run the command: */
+// tex_aux_big_switch(cur_mode, cur_cmd);
+// if (lmt_main_control_state.control_state == goto_return_state) {
+// return cur_chr == dump_code;
+// }
+// }
+// return 0; /* unreachable */
+//}
int tex_main_control(void)
{
@@ -1543,10 +1574,15 @@ int tex_main_control(void)
tex_begin_token_list(every_job_par, every_job_text);
}
while (1) {
- if (lmt_main_control_state.control_state == goto_skip_token_state) {
- lmt_main_control_state.control_state = goto_next_state;
- } else {
- tex_get_x_token();
+ switch (lmt_main_control_state.control_state) {
+ case goto_next_state:
+ tex_get_x_token();
+ break;
+ case goto_skip_token_state:
+ lmt_main_control_state.control_state = goto_next_state;
+ break;
+ case goto_return_state:
+ return lmt_main_state.run_state == initializing_state && cur_chr == dump_code;
}
/*tex
Give diagnostic information, if requested When a new token has just been fetched at
@@ -1557,9 +1593,6 @@ int tex_main_control(void)
}
/*tex Run the command: */
tex_aux_big_switch(cur_mode, cur_cmd);
- if (lmt_main_control_state.control_state == goto_return_state) {
- return cur_chr == dump_code;
- }
}
return 0; /* unreachable */
}
@@ -2008,18 +2041,6 @@ static const int glue_filler_codes[] = {
static void tex_aux_run_glue(void)
{
switch (cur_chr) {
- // case fil_code:
- // tex_tail_append(tex_new_glue_node(fil_glue, user_skip_glue));
- // break;
- // case fill_code:
- // tex_tail_append(tex_new_glue_node(fill_glue, user_skip_glue));
- // break;
- // case filll_code: /*tex aka |ss_code| */
- // tex_tail_append(tex_new_glue_node(filll_glue, user_skip_glue));
- // break;
- // case fil_neg_code:
- // tex_tail_append(tex_new_glue_node(fil_neg_glue, user_skip_glue));
- // break;
case fil_code:
case fill_code:
case filll_code:
@@ -2109,7 +2130,9 @@ void tex_off_save(void)
);
break;
}
- case math_shift_group:
+ case math_inline_group:
+ case math_display_group:
+ case math_number_group:
{
set_token_info(h, math_shift_token + '$');
tex_handle_error(
@@ -2278,8 +2301,8 @@ static void tex_aux_run_discretionary(void)
static void tex_aux_finish_discretionary(void)
{
- halfword p, q, d; /* for link manipulation */
- int n = 0; /* length of discretionary list */
+ halfword current, next;
+ int length = 0;
tex_unsave();
/*tex
Prune the current list, if necessary, until it contains only |char_node|, |kern_node|,
@@ -2287,10 +2310,10 @@ static void tex_aux_finish_discretionary(void)
set |q| to the lists tail. During this loop, |p = node_next(q)| and there are |n| items
preceding |p|.
*/
- q = cur_list.head;
- p = node_next(q);
- while (p) {
- switch (node_type(p)) {
+ current = cur_list.head;
+ next = node_next(current);
+ while (next) {
+ switch (node_type(next)) {
case glyph_node:
case hlist_node:
case vlist_node:
@@ -2299,13 +2322,13 @@ static void tex_aux_finish_discretionary(void)
break;
case glue_node:
if (hyphenation_permitted(hyphenation_mode_par, permit_glue_hyphenation_mode)) {
- if (glue_stretch_order(p)) {
- glue_stretch(p) = 0;
- glue_stretch_order(p) = 0;
+ if (glue_stretch_order(next)) {
+ glue_stretch(next) = 0;
+ glue_stretch_order(next) = 0;
}
- if (glue_shrink_order(p)) {
- glue_shrink(p) = 0;
- glue_shrink_order(p) = 0;
+ if (glue_shrink_order(next)) {
+ glue_shrink(next) = 0;
+ glue_shrink_order(next) = 0;
}
break;
} else {
@@ -2323,32 +2346,32 @@ static void tex_aux_finish_discretionary(void)
tex_begin_diagnostic();
tex_print_str("The following discretionary sublist has been deleted:");
tex_print_levels();
- tex_show_box(p);
+ tex_show_box(next);
tex_end_diagnostic();
- tex_flush_node_list(p);
- node_next(q) = null;
+ tex_flush_node_list(next);
+ node_next(current) = null;
goto DONE;
}
}
- node_prev(p) = q;
- q = p;
- p = node_next(q);
- ++n;
+ node_prev(next) = current;
+ current = next;
+ next = node_next(current);
+ ++length;
}
DONE:
- p = node_next(cur_list.head);
+ next = node_next(cur_list.head);
tex_pop_nest();
- d = cur_list.tail;
if (saved_type(saved_discretionary_item_component - saved_discretionary_n_of_items) == discretionary_count_save_type) {
+ halfword discnode = cur_list.tail;
switch (saved_value(saved_discretionary_item_component - saved_discretionary_n_of_items)) {
case 0:
- if (n > 0) {
- tex_set_disc_field(d, pre_break_code, p);
+ if (length > 0) {
+ tex_set_disc_field(discnode, pre_break_code, next);
}
break;
case 1:
- if (n > 0) {
- tex_set_disc_field(d, post_break_code, p);
+ if (length > 0) {
+ tex_set_disc_field(discnode, post_break_code, next);
}
break;
case 2:
@@ -2356,7 +2379,7 @@ static void tex_aux_finish_discretionary(void)
Attach list |p| to the current list, and record its length; then finish up and
|return|.
*/
- if (n > 0) {
+ if (length > 0) {
if (cur_mode == mmode && ! hyphenation_permitted(hyphenation_mode_par, permit_math_replace_hyphenation_mode)) {
tex_handle_error(
normal_error_type,
@@ -2364,29 +2387,29 @@ static void tex_aux_finish_discretionary(void)
"Sorry: The third part of a discretionary break must be empty, in math formulas. I\n"
"had to delete your third part."
);
- tex_flush_node_list(p);
+ tex_flush_node_list(next);
} else {
- tex_set_disc_field(d, no_break_code, p);
+ tex_set_disc_field(discnode, no_break_code, next);
}
}
if (! hyphenation_permitted(hyphenation_mode_par, normal_hyphenation_mode)) {
- halfword n = disc_no_break_head(d);
+ halfword replace = disc_no_break_head(discnode);
cur_list.tail = node_prev(cur_list.tail);
node_next(cur_list.tail) = null;
- if (n) {
- tex_tail_append(n);
- cur_list.tail = disc_no_break_tail(d);
- tex_set_disc_field(d, no_break_code, null);
- tex_set_discpart(d, n, disc_no_break_tail(d), glyph_discpart_replace);
+ if (replace) {
+ tex_tail_append(replace);
+ cur_list.tail = disc_no_break_tail(discnode);
+ tex_set_disc_field(discnode, no_break_code, null);
+ tex_set_discpart(discnode, replace, disc_no_break_tail(discnode), glyph_discpart_replace);
}
- tex_flush_node(d);
- } else if (cur_mode == mmode && disc_class(d) != unset_disc_class) {
- halfword n = null;
- cur_list.tail = node_prev(d);
- node_prev(d) = null;
- node_next(d) = null;
- n = tex_math_make_disc(d);
- tex_tail_append(n);
+ tex_flush_node(discnode);
+ } else if (cur_mode == mmode && disc_class(discnode) != unset_disc_class) {
+ halfword noad = null;
+ cur_list.tail = node_prev(discnode);
+ node_prev(discnode ) = null;
+ node_next(discnode ) = null;
+ noad = tex_math_make_disc(discnode);
+ tex_tail_append(noad);
}
/*tex There are no other cases. */
lmt_save_state.save_stack_data.ptr -= saved_discretionary_n_of_items;
@@ -2419,7 +2442,7 @@ static void tex_aux_finish_discretionary(void)
static void tex_aux_extra_right_brace_error(void)
{
- const char * helpinfo =
+ const char *helpinfo =
"I've deleted a group-closing symbol because it seems to be spurious, as in\n"
"'$x}$'. But perhaps the } is legitimate and you forgot something else, as in\n"
"'\\hbox{$x}'.";
@@ -2439,7 +2462,9 @@ static void tex_aux_extra_right_brace_error(void)
helpinfo
);
break;
- case math_shift_group:
+ case math_inline_group:
+ case math_display_group:
+ case math_number_group:
tex_handle_error(
normal_error_type,
"Extra }, or forgotten $",
@@ -2585,7 +2610,9 @@ static void tex_aux_run_right_brace(void)
tex_aux_run_end_group();
break;
case semi_simple_group:
- case math_shift_group:
+ case math_inline_group:
+ case math_display_group:
+ case math_number_group:
case math_fence_group: /*tex See above, let's see when we are supposed to end up here. */
tex_aux_extra_right_brace_error();
break;
@@ -4121,7 +4148,7 @@ static void tex_aux_set_box_property(void)
break;
case box_attribute_code:
{
- halfword att = tex_scan_box_register_number();
+ halfword att = tex_scan_attribute_register_number();
halfword val = tex_scan_int(1, NULL);
if (b) {
if (val == unused_attribute_value) {
@@ -4132,6 +4159,13 @@ static void tex_aux_set_box_property(void)
}
}
break;
+ case box_vadjust_code:
+ if (b) {
+ tex_set_vadjust(b);
+ } else {
+ tex_run_vadjust(); /* maybe error */
+ }
+ break;
default:
break;
}
@@ -5426,7 +5460,7 @@ static void tex_aux_set_constant_register(halfword cmd, halfword cs, halfword fl
tex_define(flags, cs, (singleword) cmd, v);
}
-void tex_run_prefixed_command(void)
+static void tex_run_prefixed_command(void)
{
/*tex accumulated prefix codes so far */
int flags = 0;
@@ -6047,7 +6081,7 @@ static void tex_aux_run_message(void)
*/
-static void tex_aux_run_shift_case(void)
+static void tex_aux_run_case_shift(void)
{
int upper = cur_chr == upper_case_code;
halfword l = tex_scan_toks_normal(0, NULL);
@@ -6271,189 +6305,6 @@ static void tex_aux_run_show_whatever(void)
*/
-# if 0
-
-# define register_runner(A,B,C,D) \
- case A: \
- switch (mode) { \
- case vmode: B(); break; \
- case hmode: C(); break; \
- case mmode: D(); break; \
- } \
- break
-
-# define register_simple(A,B) \
- case A: B(); break
-
-# define register_asmath(A,B,C) \
- case A: if (mode == mmode) { C(); } else { B(); } break
-
-inline static void tex_aux_big_switch(int mode, int cmd)
-{
-
- switch (cmd) {
- /*tex These have the same handler for each mode: */
-
- register_simple(arithmic_cmd, tex_run_prefixed_command);
- register_simple(register_attribute_cmd, tex_run_prefixed_command);
- register_simple(internal_attribute_cmd, tex_run_prefixed_command);
- register_simple(register_dimen_cmd, tex_run_prefixed_command);
- register_simple(internal_dimen_cmd, tex_run_prefixed_command);
- register_simple(set_font_property_cmd, tex_run_prefixed_command);
- register_simple(register_glue_cmd, tex_run_prefixed_command);
- register_simple(internal_glue_cmd, tex_run_prefixed_command);
- register_simple(register_int_cmd, tex_run_prefixed_command);
- register_simple(internal_int_cmd, tex_run_prefixed_command);
- register_simple(register_mu_glue_cmd, tex_run_prefixed_command);
- register_simple(internal_mu_glue_cmd, tex_run_prefixed_command);
- register_simple(register_toks_cmd, tex_run_prefixed_command);
- register_simple(internal_toks_cmd, tex_run_prefixed_command);
- register_simple(define_char_code_cmd, tex_run_prefixed_command);
- register_simple(def_cmd, tex_run_prefixed_command);
- register_simple(define_family_cmd, tex_run_prefixed_command);
- register_simple(define_font_cmd, tex_run_prefixed_command);
- register_simple(hyphenation_cmd, tex_run_prefixed_command);
- register_simple(let_cmd, tex_run_prefixed_command);
- register_simple(prefix_cmd, tex_run_prefixed_command);
- register_simple(register_cmd, tex_run_prefixed_command);
- register_simple(set_auxiliary_cmd, tex_run_prefixed_command);
- register_simple(set_box_cmd, tex_run_prefixed_command);
- register_simple(set_box_property_cmd, tex_run_prefixed_command);
- register_simple(set_font_cmd, tex_run_prefixed_command);
- register_simple(set_interaction_cmd, tex_run_prefixed_command);
- register_simple(set_math_parameter_cmd, tex_run_prefixed_command);
- register_simple(set_page_property_cmd, tex_run_prefixed_command);
- register_simple(set_specification_cmd, tex_run_prefixed_command);
- register_simple(shorthand_def_cmd, tex_run_prefixed_command);
- register_simple(lua_value_cmd, tex_run_prefixed_command);
- register_simple(integer_cmd, tex_run_prefixed_command);
- register_simple(dimension_cmd, tex_run_prefixed_command);
- register_simple(gluespec_cmd, tex_run_prefixed_command);
- register_simple(mugluespec_cmd, tex_run_prefixed_command);
-
- register_simple(fontspec_cmd, tex_run_font_spec);
-
- // register_simple(some_item_cmd, tex_aux_run_illegal_case);
- register_simple(some_item_cmd, tex_run_prefixed_command);
- register_simple(iterator_value_cmd, tex_aux_run_illegal_case);
- register_simple(parameter_cmd, tex_aux_run_illegal_case);
-
- register_simple(after_something_cmd, tex_aux_run_after_something);
- register_simple(begin_group_cmd, tex_aux_run_begin_group);
- register_simple(penalty_cmd, tex_aux_run_penalty);
- register_simple(case_shift_cmd, tex_aux_run_shift_case);
- register_simple(catcode_table_cmd, tex_aux_run_catcode_table);
- register_simple(combine_toks_cmd, tex_run_prefixed_command);
- // register_simple(combine_toks_cmd, tex_run_combine_the_toks);
- register_simple(end_cs_name_cmd, tex_aux_run_cs_error);
- register_simple(end_group_cmd, tex_aux_run_end_group);
- register_simple(end_local_cmd, tex_aux_run_end_local);
- register_simple(ignore_something_cmd, tex_aux_run_ignore_something);
- register_simple(insert_cmd, tex_run_insert);
- register_simple(kern_cmd, tex_aux_run_kern);
- register_simple(leader_cmd, tex_aux_run_leader);
- register_simple(legacy_cmd, tex_aux_run_legacy);
- register_simple(local_box_cmd, tex_aux_run_local_box);
- register_simple(lua_protected_call_cmd, tex_aux_run_lua_protected_call);
- register_simple(lua_function_call_cmd, tex_aux_run_lua_function_call);
- register_simple(make_box_cmd, tex_aux_run_make_box);
- register_simple(set_mark_cmd, tex_run_mark);
- register_simple(message_cmd, tex_aux_run_message);
- register_simple(node_cmd, tex_aux_run_node);
- register_simple(relax_cmd, tex_aux_run_relax);
- register_simple(remove_item_cmd, tex_aux_run_remove_item);
- register_simple(right_brace_cmd, tex_aux_run_right_brace);
- register_simple(vcenter_cmd, tex_run_vcenter);
- register_simple(xray_cmd, tex_aux_run_show_whatever);
-
- register_simple(alignment_cmd, tex_run_alignment_error);
- register_simple(end_template_cmd, tex_run_alignment_end_template);
- register_simple(alignment_tab_cmd, tex_run_alignment_error);
-
- /*tex These have different handlers but a common h/v mode: */
-
- register_asmath(math_fraction_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_fraction);
- register_asmath(delimiter_number_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_delimiter_number);
- register_asmath(math_fence_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_fence);
- register_asmath(math_modifier_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_modifier);
- register_asmath(math_accent_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_accent);
- register_asmath(math_choice_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_choice);
- register_asmath(math_component_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_math_component);
- register_asmath(math_style_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_style);
- register_asmath(mkern_cmd, tex_aux_run_insert_dollar_sign, tex_aux_run_mkern);
- register_asmath(mskip_cmd, tex_aux_run_insert_dollar_sign, tex_aux_run_mglue);
- register_asmath(math_radical_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_radical);
- register_asmath(subscript_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_script);
- register_asmath(superscript_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_script);
- register_asmath(math_script_cmd, tex_aux_run_insert_dollar_sign, tex_run_math_script);
-
- register_asmath(equation_number_cmd, tex_aux_run_illegal_case, tex_run_math_equation_number);
-
- register_asmath(left_brace_cmd, tex_aux_run_left_brace, tex_run_math_left_brace);
-
- /*tex These have different handlers: */
-
- register_runner(italic_correction_cmd, tex_aux_run_illegal_case, tex_aux_run_text_italic_correction, tex_run_math_italic_correction);
- register_runner(math_char_number_cmd, tex_aux_run_math_non_math, tex_run_text_math_char_number, tex_run_math_math_char_number);
- register_runner(mathspec_cmd, tex_aux_run_math_non_math, tex_run_text_math_spec, tex_run_math_math_spec);
- register_runner(vadjust_cmd, tex_aux_run_illegal_case, tex_run_vadjust, tex_run_vadjust);
-
- register_runner(char_given_cmd, tex_aux_run_new_paragraph, tex_aux_run_text_letter, tex_run_math_letter);
- register_runner(other_char_cmd, tex_aux_run_new_paragraph, tex_aux_run_text_letter, tex_run_math_letter);
- register_runner(letter_cmd, tex_aux_run_new_paragraph, tex_aux_run_text_letter, tex_run_math_letter);
-
- register_runner(accent_cmd, tex_aux_run_new_paragraph, tex_aux_run_text_accent, tex_run_math_accent);
- register_runner(boundary_cmd, tex_aux_run_par_boundary, tex_aux_run_text_boundary, tex_aux_run_math_boundary);
- register_runner(char_number_cmd, tex_aux_run_new_paragraph, tex_aux_run_text_char_number, tex_run_math_char_number);
- register_runner(discretionary_cmd, tex_aux_run_new_paragraph, tex_aux_run_discretionary, tex_aux_run_discretionary);
- register_runner(explicit_space_cmd, tex_aux_run_new_paragraph, tex_aux_run_space, tex_aux_run_space);
- register_runner(math_shift_cmd, tex_aux_run_new_paragraph, tex_run_math_initialize, tex_run_math_shift);
- register_runner(math_shift_cs_cmd, tex_aux_run_new_paragraph, tex_run_math_initialize, tex_run_math_shift);
-
- register_runner(end_paragraph_cmd, tex_aux_run_paragraph_end_vmode, tex_aux_run_paragraph_end_hmode, tex_aux_run_relax);
- register_runner(spacer_cmd, tex_aux_run_relax, tex_aux_run_space, tex_aux_run_math_space);
- register_runner(begin_paragraph_cmd, tex_aux_run_begin_paragraph_vmode, tex_aux_run_begin_paragraph_hmode, tex_aux_run_begin_paragraph_mmode);
- register_runner(end_job_cmd, tex_aux_run_end_job, tex_aux_run_head_for_vmode, tex_aux_run_insert_dollar_sign);
-
- /*tex
- These can share a handler if we move the mode test (we then also have 5 command codes
- less) but it becomes less pretty for rules and so. When in the wrong more, a mode change
- is enforced and the token is pushed back and ready for a new inspection.
- */
-
- register_runner(hmove_cmd, tex_aux_run_move, tex_aux_run_illegal_case, tex_aux_run_illegal_case);
- register_runner(vmove_cmd, tex_aux_run_illegal_case, tex_aux_run_move, tex_aux_run_move);
-
- register_runner(hskip_cmd, tex_aux_run_new_paragraph, tex_aux_run_glue, tex_aux_run_glue);
- register_runner(vskip_cmd, tex_aux_run_glue, tex_aux_run_head_for_vmode, tex_aux_run_insert_dollar_sign);
-
- register_runner(un_hbox_cmd, tex_aux_run_new_paragraph, tex_run_unpackage, tex_run_unpackage);
- register_runner(un_vbox_cmd, tex_run_unpackage, tex_aux_run_head_for_vmode, tex_aux_run_insert_dollar_sign);
-
- register_runner(halign_cmd, tex_run_alignment_initialize, tex_aux_run_head_for_vmode, tex_aux_run_halign_mmode);
- register_runner(valign_cmd, tex_aux_run_new_paragraph, tex_run_alignment_initialize, tex_aux_run_insert_dollar_sign);
-
- register_runner(hrule_cmd, tex_aux_run_hrule, tex_aux_run_head_for_vmode, tex_aux_run_insert_dollar_sign);
- register_runner(vrule_cmd, tex_aux_run_new_paragraph, tex_aux_run_vrule, tex_aux_run_mrule);
-
- /* Just in case: */
-
- register_runner(ignore_cmd, tex_aux_run_relax, tex_aux_run_relax, tex_aux_run_relax);
-
- register_runner(active_char_cmd, tex_aux_run_active, tex_aux_run_active, tex_aux_run_active);
-
- /*tex The next is unlikely to happen but compilers like the check. */
-
- default:
- /* printf("cmd code %i", cmd); */
- tex_confusion("unknown cmd code");
- break;
- }
-
-}
-
-# else
-
inline static void tex_aux_big_switch(int mode, int cmd)
{
@@ -6503,7 +6354,7 @@ inline static void tex_aux_big_switch(int mode, int cmd)
case after_something_cmd: tex_aux_run_after_something(); break;
case begin_group_cmd: tex_aux_run_begin_group(); break;
case penalty_cmd: tex_aux_run_penalty(); break;
- case case_shift_cmd: tex_aux_run_shift_case(); break;
+ case case_shift_cmd: tex_aux_run_case_shift(); break;
case catcode_table_cmd: tex_aux_run_catcode_table(); break;
case end_cs_name_cmd: tex_aux_run_cs_error(); break;
case end_group_cmd: tex_aux_run_end_group(); break;
@@ -6616,19 +6467,13 @@ inline static void tex_aux_big_switch(int mode, int cmd)
}
break;
case math_shift_cmd:
+ case math_shift_cs_cmd:
switch (mode) {
case vmode: tex_aux_run_new_paragraph(); break;
case hmode: tex_run_math_initialize(); break;
case mmode: tex_run_math_shift(); break;
}
break;
- case math_shift_cs_cmd:
- switch (mode) {
- case vmode: tex_aux_run_new_paragraph(); break;
- case hmode: tex_run_math_initialize(); break;
- case mmode: tex_run_math_shift(); break;
- }
- break;
case end_paragraph_cmd:
switch (mode) {
case vmode: tex_aux_run_paragraph_end_vmode(); break;
@@ -6713,8 +6558,6 @@ inline static void tex_aux_big_switch(int mode, int cmd)
}
-# endif
-
/*tex
Some preset values no longer make sense, like family 1 for some math symbols but we keep them
for compatibility reasons. All settings are moved to the relevant modules.
diff --git a/source/luametatex/source/tex/texmaincontrol.h b/source/luametatex/source/tex/texmaincontrol.h
index 5b72a3d43..d46eddc5c 100644
--- a/source/luametatex/source/tex/texmaincontrol.h
+++ b/source/luametatex/source/tex/texmaincontrol.h
@@ -64,8 +64,6 @@ extern void tex_page_boundary_message (const char *s, halfword bou
extern void tex_inject_text_or_line_dir (int d, int check_glue);
-extern void tex_run_prefixed_command (void);
-
extern void tex_handle_assignments (void); /*tex Used in math. */
extern void tex_assign_internal_int_value (int a, halfword p, int val);
diff --git a/source/luametatex/source/tex/texmath.c b/source/luametatex/source/tex/texmath.c
index d2c0ff413..a9f1a3ed9 100644
--- a/source/luametatex/source/tex/texmath.c
+++ b/source/luametatex/source/tex/texmath.c
@@ -1235,7 +1235,7 @@ static void tex_aux_push_math(quarterword group, int style)
static void tex_aux_enter_inline_math(int style)
{
- tex_aux_push_math(math_shift_group, style);
+ tex_aux_push_math(math_inline_group, style);
update_tex_family(0, unused_math_family);
if (every_math_par) {
tex_begin_token_list(every_math_par, every_math_text);
@@ -1294,14 +1294,12 @@ void tex_run_math_initialize(void)
*/
void tex_run_math_equation_number(void) {
- if (tex_in_privileged_mode()) {
- if (cur_group == math_shift_group) {
- tex_set_saved_record(saved_equation_number_item_location, equation_number_location_save_type, 0, cur_chr);
- lmt_save_state.save_stack_data.ptr += saved_equation_number_n_of_items;
- tex_aux_enter_inline_math(text_style);
- } else {
- tex_off_save();
- }
+ if (cur_group == math_display_group) {
+ tex_set_saved_record(saved_equation_number_item_location, equation_number_location_save_type, 0, cur_chr);
+ lmt_save_state.save_stack_data.ptr += saved_equation_number_n_of_items;
+ tex_aux_enter_inline_math(text_style);
+ } else {
+ tex_off_save();
}
}
@@ -1367,8 +1365,9 @@ static int tex_aux_pre_math_par_direction(void)
static void tex_aux_enter_display_math(halfword cmd)
{
if (math_display_mode_par) {
- tex_aux_push_math(math_shift_group, display_style);
+ tex_aux_push_math(math_inline_group, display_style);
cur_list.math_mode = cmd;
+ cur_list.mode = inline_mmode; /* new */
update_tex_family(0, unused_math_family);
if (every_display_par) {
tex_begin_token_list(every_display_par, every_display_text);
@@ -1386,10 +1385,8 @@ static void tex_aux_enter_display_math(halfword cmd)
if (cur_list.head == cur_list.tail || (node_next(cur_list.head) == cur_list.tail && node_type(cur_list.tail) == par_node && ! node_next(cur_list.tail))) {
if (node_next(cur_list.head) == cur_list.tail) {
/*tex
-
|resume_after_display| inserts a |par_node|, but if there is another display
immediately following, we have to get rid of that node.
-
*/
tex_flush_node(cur_list.tail);
/* cur_list.tail = cur_list.head; */ /* probably needed */
@@ -1397,16 +1394,14 @@ static void tex_aux_enter_display_math(halfword cmd)
tex_pop_nest();
size = - max_dimen;
} else {
- tex_line_break(1, math_shift_group);
+ tex_line_break(1, math_display_group);
// size = tex_actual_box_width(lmt_linebreak_state.just_box, tex_x_over_n(tex_get_font_em_width(cur_font_par), 1000) * math_pre_display_gap_factor_par);
size = tex_actual_box_width(lmt_linebreak_state.just_box, scaledround((tex_get_font_em_width(cur_font_par) / 1000.0) * math_pre_display_gap_factor_par));
}
/*tex
-
Now we are in vertical mode, working on the list that will contain the display. A displayed
equation is considered to be three lines long, so we calculate the length and offset of line
number |prev_graf + 2|.
-
*/
if (par_shape_par) {
/*tex scope of paragraph shape specification */
@@ -1430,7 +1425,7 @@ static void tex_aux_enter_display_math(halfword cmd)
width = hsize_par;
indent = 0;
}
- tex_aux_push_math(math_shift_group, display_style);
+ tex_aux_push_math(math_display_group, display_style);
cur_list.mode = mmode;
update_tex_family(0, unused_math_family);
update_tex_pre_display_size(size);
@@ -4068,7 +4063,9 @@ void tex_run_math_fence(void)
switch (cur_group) {
case math_fence_group:
break;
- case math_shift_group:
+ case math_inline_group:
+ case math_display_group:
+ case math_number_group:
tex_aux_scan_delimiter(null, no_mathcode, unset_noad_class);
if (st == middle_fence_side) {
tex_handle_error(
@@ -4246,24 +4243,27 @@ static void tex_aux_check_inline_math_end(void)
static void tex_aux_resume_after_display(void)
{
- if (cur_group == math_shift_group) {
- tex_aux_unsave_math();
- cur_list.prev_graf += 3;
- tex_push_nest();
- cur_list.mode = hmode;
- cur_list.space_factor = 1000;
- /*tex This needs to be intercepted in the display math start! Todo! */
- tex_tail_append(tex_new_par_node(penalty_par_subtype));
- tex_get_x_token();
- if (cur_cmd != spacer_cmd) {
- tex_back_input(cur_tok);
- }
- if (lmt_nest_state.nest_data.ptr == 1) {
- lmt_page_filter_callback(after_display_page_context, 0);
- tex_build_page();
- }
- } else {
- tex_confusion("finishing display math");
+ switch (cur_group) {
+ case math_display_group:
+ tex_aux_unsave_math();
+ cur_list.prev_graf += 3;
+ tex_push_nest();
+ cur_list.mode = hmode;
+ cur_list.space_factor = default_space_factor;
+ /*tex This needs to be intercepted in the display math start! Todo! */
+ tex_tail_append(tex_new_par_node(penalty_par_subtype));
+ tex_get_x_token();
+ if (cur_cmd != spacer_cmd) {
+ tex_back_input(cur_tok);
+ }
+ if (lmt_nest_state.nest_data.ptr == 1) {
+ lmt_page_filter_callback(after_display_page_context, 0);
+ tex_build_page();
+ }
+ break;
+ default:
+ tex_confusion("finishing display math");
+ break;
}
}
@@ -4328,10 +4328,6 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor
quarterword glue_above, glue_below;
/*tex glue parameter subtypes for before and after */
quarterword subtype_above, subtype_below;
- /*tex tail of adjustment lists */
- halfword post_adjust_tail, pre_adjust_tail;
- /*tex tail of migration lists */
- halfword post_migrate_tail, pre_migrate_tail;
/*tex for equation numbers */
scaled eqno_width;
/*tex true if the math and surrounding (par) dirs are different */
@@ -4350,15 +4346,6 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor
attach_current_attribute_list(equation_box);
equation = box_list(equation_box);
/* */
- post_adjust_tail = lmt_packaging_state.post_adjust_tail;
- pre_adjust_tail = lmt_packaging_state.pre_adjust_tail;
- post_migrate_tail = lmt_packaging_state.post_migrate_tail;
- pre_migrate_tail = lmt_packaging_state.pre_migrate_tail;
- lmt_packaging_state.post_adjust_tail = null;
- lmt_packaging_state.pre_adjust_tail = null;
- lmt_packaging_state.post_migrate_tail = null;
- lmt_packaging_state.pre_migrate_tail = null;
- /* */
equation_width = box_width(equation_box);
line_width = display_width_par;
indent = display_indent_par;
@@ -4518,7 +4505,19 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor
} else {
box_shift_amount(equation_box) = indent + displacement;
}
- /*tex check for prev: */
+ /* */
+ if (pre_adjust_head != lmt_packaging_state.pre_adjust_tail) {
+ tex_inject_adjust_list(pre_adjust_head, 1, lmt_linebreak_state.just_box, NULL);
+ }
+ lmt_packaging_state.pre_adjust_tail = null;
+ /* Pre-migrate content (callback). */
+ if (pre_migrate_head != lmt_packaging_state.pre_migrate_tail) {
+ tex_append_list(pre_migrate_head, lmt_packaging_state.pre_migrate_tail);
+ // if (! lmt_page_builder_state.output_active) {
+ // lmt_append_line_filter_callback(pre_migrate_append_line_context, 0);
+ // }
+ }
+ /* */
tex_append_to_vlist(equation_box, lua_key_index(equation), NULL); /* eqbox has the formula */
if (eqnumber && number_width == 0 && ! atleft) {
tex_tail_append(tex_new_penalty_node(infinite_penalty, equation_number_penalty_subtype));
@@ -4529,28 +4528,21 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor
tex_append_to_vlist(eqnumber, lua_key_index(equation_number), NULL);
glue_below = 0; /* shouldn't this be an option */
}
- /*tex Migrating material comes after equation number: is this ok? */
- if (post_migrate_tail != post_migrate_head) {
- node_next(cur_list.tail) = node_next(post_migrate_head);
- node_prev(lmt_packaging_state.post_migrate_tail) = node_prev(cur_list.tail);
- cur_list.tail = post_migrate_tail;
- }
- if (post_adjust_tail != post_adjust_head) {
- node_next(cur_list.tail) = node_next(post_adjust_head);
- node_prev(lmt_packaging_state.post_adjust_tail) = node_prev(cur_list.tail);
- cur_list.tail = post_adjust_tail;
- }
- /*tex A weird place: is this ok? */
- if (pre_adjust_tail != pre_adjust_head) {
- node_next(cur_list.tail) = node_next(pre_adjust_head);
- node_prev(lmt_packaging_state.pre_adjust_tail) = node_prev(cur_list.tail);
- cur_list.tail = pre_adjust_tail;
+ /* */
+ if (post_migrate_head != lmt_packaging_state.post_migrate_tail) {
+ tex_append_list(post_migrate_head, lmt_packaging_state.post_migrate_tail);
+ // if (! lmt_page_builder_state.output_active) {
+ // lmt_append_line_filter_callback(post_migrate_append_line_context, 0);
+ // }
}
- if (pre_migrate_tail != pre_migrate_head) {
- node_next(cur_list.tail) = node_next(pre_migrate_head);
- node_prev(lmt_packaging_state.pre_migrate_tail) = node_prev(cur_list.tail);
- cur_list.tail = pre_migrate_tail;
+ lmt_packaging_state.post_migrate_tail = null;
+ if (lmt_packaging_state.post_adjust_tail) {
+ if (post_adjust_head != lmt_packaging_state.post_adjust_tail) {
+ tex_inject_adjust_list(post_adjust_head, 1, null, NULL);
+ }
+ lmt_packaging_state.post_adjust_tail = null;
}
+ /* */
tex_tail_append(tex_new_penalty_node(post_display_penalty_par, after_display_penalty_subtype));
tex_aux_inject_display_skip(glue_below, subtype_below);
tex_aux_resume_after_display();
@@ -4570,166 +4562,174 @@ static void tex_aux_finish_displayed_math(int atleft, halfword eqnumber, halfwor
void tex_run_math_shift(void)
{
- if (cur_group == math_shift_group) {
- /*tex box containing equation number */
- halfword eqnumber = null;
- /*tex Use |\leqno| instead of |\eqno|, we default to right. */
- int atleft = 0;
- /*tex |mmode| or |-mmode| */
- int mode = cur_list.mode;
- int mathmode = cur_list.math_mode;
- /*tex this pops the nest, the formula */
- halfword p = tex_aux_finish_math_list(null);
- int mathleft = cur_list.math_begin;
- int mathright = cur_list.math_end;
- if (cur_cmd == math_shift_cs_cmd) {
- switch (cur_chr) {
- case begin_inline_math_code:
- case begin_display_math_code:
- case begin_math_mode_code:
- tex_you_cant_error(NULL);
- break;
- }
- }
- if (cur_list.mode == -mode) { // todo: symbolic
- /*tex end of equation number */
- AGAIN:
- switch (cur_cmd) {
- case math_shift_cmd:
- tex_aux_check_second_math_shift();
- break;
- case end_paragraph_cmd:
- tex_get_x_token();
- goto AGAIN;
- default:
- tex_aux_check_display_math_end();
- break;
- }
- tex_run_mlist_to_hlist(p, 0, text_style, unset_noad_class, unset_noad_class);
- eqnumber = tex_hpack(node_next(temp_head), 0, packing_additional, direction_unknown, holding_none_option);
- attach_current_attribute_list(eqnumber);
- tex_aux_unsave_math();
- /*tex now |cur_group = math_shift_group| */
- lmt_save_state.save_stack_data.ptr -= saved_equation_number_n_of_items;
- if (saved_type(saved_equation_number_item_location) == equation_number_location_save_type) {
- atleft = saved_value(saved_equation_number_item_location) == left_location_code;
- mode = cur_list.mode;
- p = tex_aux_finish_math_list(null);
- } else {
- tex_confusion("after math");
- }
- }
- if (mode < 0) { // mode == inline_mmode
- /*tex
-
- The |unsave| is done after everything else here; hence an appearance of |\mathsurround|
- inside of |$...$| affects the spacing at these particular |$|'s. This is consistent
- with the conventions of |$$ ... $$|, since |\abovedisplayskip| inside a display affects
- the space above that display.
-
- */
- halfword math = tex_new_node(math_node, begin_inline_math);
- if (mathmode) {
- switch (cur_cmd) {
- case math_shift_cs_cmd:
- if (cur_chr != end_display_math_code && cur_chr != end_math_mode_code) {
- tex_aux_check_second_math_shift();
- }
- break;
- case math_shift_cmd:
- tex_aux_check_second_math_shift();
- break;
+ switch (cur_group) {
+ case math_inline_group:
+ case math_display_group:
+ case math_number_group:
+ {
+ /*tex box containing equation number */
+ halfword eqnumber = null;
+ /*tex Use |\leqno| instead of |\eqno|, we default to right. */
+ int atleft = 0;
+ /*tex |mmode| or |-mmode| */
+ int mode = cur_list.mode;
+ int mathmode = cur_list.math_mode;
+ /*tex this pops the nest, the formula */
+ halfword p = tex_aux_finish_math_list(null);
+ int mathleft = cur_list.math_begin;
+ int mathright = cur_list.math_end;
+ if (cur_cmd == math_shift_cs_cmd) {
+ switch (cur_chr) {
+ case begin_inline_math_code:
+ case begin_display_math_code:
+ case begin_math_mode_code:
+ tex_you_cant_error(NULL);
+ break;
+ }
}
- } else if (cur_cmd == math_shift_cs_cmd) {
- tex_aux_check_inline_math_end();
- }
- tex_tail_append(math);
- math_penalty(math) = pre_inline_penalty_par;
- /*tex begin mathskip code */
- switch (math_skip_mode_par) {
- case math_skip_surround_when_zero:
- if (! tex_glue_is_zero(math_skip_par)) {
- tex_copy_glue_values(math, math_skip_par);
- } else {
- math_surround(math) = math_surround_par;
+ if (cur_list.mode == -mode) { // todo: symbolic
+ /*tex end of equation number */
+ AGAIN:
+ switch (cur_cmd) {
+ case math_shift_cmd:
+ tex_aux_check_second_math_shift();
+ break;
+ case end_paragraph_cmd:
+ tex_get_x_token();
+ goto AGAIN;
+ default:
+ tex_aux_check_display_math_end();
+ break;
}
- break ;
- case math_skip_always_left:
- case math_skip_always_both:
- case math_skip_only_when_skip:
- tex_copy_glue_values(math, math_skip_par);
- break ;
- case math_skip_always_right:
- case math_skip_ignore:
- break ;
- case math_skip_always_surround:
- default:
- math_surround(math) = math_surround_par;
- break;
- }
- /*tex end mathskip code */
- if (cur_list.math_dir) {
- tex_tail_append(tex_new_dir(normal_dir_subtype, math_direction_par));
- }
- tex_run_mlist_to_hlist(p, cur_list.mode > nomode, is_valid_math_style(cur_list.math_main_style) ? cur_list.math_main_style : text_style, cur_list.math_begin, cur_list.math_end);
- tex_try_couple_nodes(cur_list.tail, node_next(temp_head));
- cur_list.tail = tex_tail_of_node_list(cur_list.tail);
- if (cur_list.math_dir) {
- tex_tail_append(tex_new_dir(cancel_dir_subtype, math_direction_par));
- }
- cur_list.math_dir = 0;
- math = tex_new_node(math_node, end_inline_math);
- tex_tail_append(math);
- math_penalty(math) = post_inline_penalty_par;
- /*tex begin mathskip code */
- switch (math_skip_mode_par) {
- case math_skip_surround_when_zero :
- if (! tex_glue_is_zero(math_skip_par)) {
- tex_copy_glue_values(math, math_skip_par);
- math_surround(math) = 0;
+ tex_run_mlist_to_hlist(p, 0, text_style, unset_noad_class, unset_noad_class);
+ eqnumber = tex_hpack(node_next(temp_head), 0, packing_additional, direction_unknown, holding_none_option);
+ attach_current_attribute_list(eqnumber);
+ tex_aux_unsave_math();
+ /*tex now |cur_group = math_shift_group| */
+ lmt_save_state.save_stack_data.ptr -= saved_equation_number_n_of_items;
+ if (saved_type(saved_equation_number_item_location) == equation_number_location_save_type) {
+ atleft = saved_value(saved_equation_number_item_location) == left_location_code;
+ mode = cur_list.mode;
+ p = tex_aux_finish_math_list(null);
} else {
- math_surround(math) = math_surround_par;
+ tex_confusion("after math");
}
- break;
- case math_skip_always_right:
- case math_skip_always_both:
- case math_skip_only_when_skip:
- tex_copy_glue_values(math, math_skip_par);
- break;
- case math_skip_always_left:
- case math_skip_ignore:
- break;
- case math_skip_always_surround:
- default:
- math_surround(math) = math_surround_par;
- break;
- }
- /*tex end mathskip code */
- cur_list.space_factor = 1000;
- mathleft = cur_list.math_begin;
- mathright = cur_list.math_end;
- tex_aux_unsave_math();
- } else {
- if (! eqnumber) {
- if (cur_cmd == math_shift_cmd) {
- tex_aux_check_second_math_shift();
+ }
+ if (mode == inline_mmode) {
+ // if (mode < 0) {
+ /*tex
+
+ The |unsave| is done after everything else here; hence an appearance of |\mathsurround|
+ inside of |$...$| affects the spacing at these particular |$|'s. This is consistent
+ with the conventions of |$$ ... $$|, since |\abovedisplayskip| inside a display affects
+ the space above that display.
+
+ */
+ halfword math = tex_new_node(math_node, begin_inline_math);
+ if (mathmode) {
+ switch (cur_cmd) {
+ case math_shift_cs_cmd:
+ if (cur_chr != end_display_math_code && cur_chr != end_math_mode_code) {
+ tex_aux_check_second_math_shift();
+ }
+ break;
+ case math_shift_cmd:
+ tex_aux_check_second_math_shift();
+ break;
+ }
+ } else if (cur_cmd == math_shift_cs_cmd) {
+ tex_aux_check_inline_math_end();
+ }
+ tex_tail_append(math);
+ math_penalty(math) = pre_inline_penalty_par;
+ /*tex begin mathskip code */
+ switch (math_skip_mode_par) {
+ case math_skip_surround_when_zero:
+ if (! tex_glue_is_zero(math_skip_par)) {
+ tex_copy_glue_values(math, math_skip_par);
+ } else {
+ math_surround(math) = math_surround_par;
+ }
+ break ;
+ case math_skip_always_left:
+ case math_skip_always_both:
+ case math_skip_only_when_skip:
+ tex_copy_glue_values(math, math_skip_par);
+ break ;
+ case math_skip_always_right:
+ case math_skip_ignore:
+ break ;
+ case math_skip_always_surround:
+ default:
+ math_surround(math) = math_surround_par;
+ break;
+ }
+ /*tex end mathskip code */
+ if (cur_list.math_dir) {
+ tex_tail_append(tex_new_dir(normal_dir_subtype, math_direction_par));
+ }
+ tex_run_mlist_to_hlist(p, cur_list.mode > nomode, is_valid_math_style(cur_list.math_main_style) ? cur_list.math_main_style : text_style, cur_list.math_begin, cur_list.math_end);
+ tex_try_couple_nodes(cur_list.tail, node_next(temp_head));
+ cur_list.tail = tex_tail_of_node_list(cur_list.tail);
+ if (cur_list.math_dir) {
+ tex_tail_append(tex_new_dir(cancel_dir_subtype, math_direction_par));
+ }
+ cur_list.math_dir = 0;
+ math = tex_new_node(math_node, end_inline_math);
+ tex_tail_append(math);
+ math_penalty(math) = post_inline_penalty_par;
+ /*tex begin mathskip code */
+ switch (math_skip_mode_par) {
+ case math_skip_surround_when_zero :
+ if (! tex_glue_is_zero(math_skip_par)) {
+ tex_copy_glue_values(math, math_skip_par);
+ math_surround(math) = 0;
+ } else {
+ math_surround(math) = math_surround_par;
+ }
+ break;
+ case math_skip_always_right:
+ case math_skip_always_both:
+ case math_skip_only_when_skip:
+ tex_copy_glue_values(math, math_skip_par);
+ break;
+ case math_skip_always_left:
+ case math_skip_ignore:
+ break;
+ case math_skip_always_surround:
+ default:
+ math_surround(math) = math_surround_par;
+ break;
+ }
+ /*tex end mathskip code */
+ cur_list.space_factor = default_space_factor;
+ mathleft = cur_list.math_begin;
+ mathright = cur_list.math_end;
+ tex_aux_unsave_math();
} else {
- tex_aux_check_display_math_end();
+ if (! eqnumber) {
+ if (cur_cmd == math_shift_cmd) {
+ tex_aux_check_second_math_shift();
+ } else {
+ tex_aux_check_display_math_end();
+ }
+ }
+ tex_run_mlist_to_hlist(p, 0, display_style, cur_list.math_begin, cur_list.math_end);
+ mathleft = cur_list.math_begin;
+ mathright = cur_list.math_end;
+ tex_aux_finish_displayed_math(atleft, eqnumber, node_next(temp_head));
}
+ /* local */
+ update_tex_math_left_class(mathleft);
+ update_tex_math_right_class(mathright);
+ /* global */
+ lmt_math_state.last_left = mathleft;
+ lmt_math_state.last_right = mathright;
}
- tex_run_mlist_to_hlist(p, 0, display_style, cur_list.math_begin, cur_list.math_end);
- mathleft = cur_list.math_begin;
- mathright = cur_list.math_end;
- tex_aux_finish_displayed_math(atleft, eqnumber, node_next(temp_head));
- }
- /* local */
- update_tex_math_left_class(mathleft);
- update_tex_math_right_class(mathright);
- /* global */
- lmt_math_state.last_left = mathleft;
- lmt_math_state.last_right = mathright;
- } else {
- tex_off_save();
+ break;
+ default:
+ tex_off_save();
+ break;
}
}
diff --git a/source/luametatex/source/tex/texmlist.c b/source/luametatex/source/tex/texmlist.c
index b9453875e..79ab490e7 100644
--- a/source/luametatex/source/tex/texmlist.c
+++ b/source/luametatex/source/tex/texmlist.c
@@ -6574,12 +6574,13 @@ static void tex_mlist_to_hlist_preroll_dimensions(mliststate *state)
state->max_depth = siz.dp;
}
}
- DONE_WITH_NODE:
+// DONE_WITH_NODE:
if ((node_type(current) == simple_noad) && noad_new_hlist(current)) {
if (has_noad_option_phantom(current) || has_noad_option_void(current)) {
noad_new_hlist(current) = tex_aux_make_list_phantom(noad_new_hlist(current), has_noad_option_void(current), get_attribute_list(current));
}
}
+ DONE_WITH_NODE:
current = node_next(current);
}
}
diff --git a/source/luametatex/source/tex/texnesting.c b/source/luametatex/source/tex/texnesting.c
index 81d716958..87ca7715a 100644
--- a/source/luametatex/source/tex/texnesting.c
+++ b/source/luametatex/source/tex/texnesting.c
@@ -225,7 +225,7 @@ void tex_initialize_nesting(void)
cur_list.prev_graf = 0;
cur_list.mode_line = 0;
cur_list.prev_depth = ignore_depth; /*tex |ignore_depth_criterium_par| is not yet available! */
- cur_list.space_factor = 1000;
+ cur_list.space_factor = default_space_factor;
cur_list.incomplete_noad = null;
cur_list.direction_stack = null;
cur_list.math_dir = 0;
@@ -408,3 +408,10 @@ void tex_tail_append(halfword p)
node_prev(p) = cur_list.tail;
cur_list.tail = p;
}
+
+void tex_tail_append_list(halfword p)
+{
+ node_next(cur_list.tail) = p;
+ node_prev(p) = cur_list.tail;
+ cur_list.tail = tex_tail_of_node_list(p);
+}
diff --git a/source/luametatex/source/tex/texnesting.h b/source/luametatex/source/tex/texnesting.h
index 1f87dbb22..5f98a44c3 100644
--- a/source/luametatex/source/tex/texnesting.h
+++ b/source/luametatex/source/tex/texnesting.h
@@ -49,6 +49,7 @@ extern void tex_initialize_nesting (void);
extern void tex_push_nest (void);
extern void tex_pop_nest (void);
extern void tex_tail_append (halfword p);
+extern void tex_tail_append_list (halfword p);
extern halfword tex_pop_tail (void);
extern const char *tex_string_mode (int m);
extern void tex_show_activities (void);
diff --git a/source/luametatex/source/tex/texnodes.h b/source/luametatex/source/tex/texnodes.h
index 3c9d54452..093978c4e 100644
--- a/source/luametatex/source/tex/texnodes.h
+++ b/source/luametatex/source/tex/texnodes.h
@@ -641,11 +641,6 @@ typedef enum kern_subtypes {
# define kern_amount(a) vlink(a,2) /*tex aka |width = vlink(a,2)| */
# define kern_expansion(a) vinfo(a,2) /*tex expansion factor (hz) */
-inline static int tex_is_margin_kern(halfword n)
-{
- return (n && node_type(n) == kern_node && (node_subtype(n) == left_margin_kern_subtype || node_subtype(n) == right_margin_kern_subtype));
-}
-
/*tex
Disc nodes are complicated: they have three embedded nesting nodes to which the |pre_break|,
diff --git a/source/luametatex/source/tex/texpackaging.c b/source/luametatex/source/tex/texpackaging.c
index 1eb9cc694..c4af153fc 100644
--- a/source/luametatex/source/tex/texpackaging.c
+++ b/source/luametatex/source/tex/texpackaging.c
@@ -741,13 +741,18 @@ inline static halfword tex_aux_used_order(halfword *total)
*/
+/*tex
+ For now we have this here but maybe it makes sense to move the adjust migration to the adjust
+ module (tracing and such). It's a bit fyzzy code anyway.
+*/
+
inline static void tex_aux_promote_pre_migrated(halfword r, halfword p)
{
- halfword pm = box_pre_migrated(p);
halfword pa = box_pre_adjusted(p);
+ halfword pm = box_pre_migrated(p);
if (pa) {
if (lmt_packaging_state.pre_adjust_tail) {
- lmt_packaging_state.pre_adjust_tail = tex_append_adjust_list(pre_adjust_head, lmt_packaging_state.pre_adjust_tail, pa);
+ lmt_packaging_state.pre_adjust_tail = tex_append_adjust_list(pre_adjust_head, lmt_packaging_state.pre_adjust_tail, pa, "promote");
} else if (box_pre_adjusted(r)) {
tex_couple_nodes(box_pre_adjusted(r), pa);
} else {
@@ -773,11 +778,11 @@ inline static void tex_aux_promote_pre_migrated(halfword r, halfword p)
inline static void tex_aux_promote_post_migrated(halfword r, halfword p)
{
- halfword pm = box_post_migrated(p);
halfword pa = box_post_adjusted(p);
+ halfword pm = box_post_migrated(p);
if (pa) {
if (lmt_packaging_state.post_adjust_tail) {
- lmt_packaging_state.post_adjust_tail = tex_append_adjust_list(post_adjust_head, lmt_packaging_state.post_adjust_tail, pa);
+ lmt_packaging_state.post_adjust_tail = tex_append_adjust_list(post_adjust_head, lmt_packaging_state.post_adjust_tail, pa, "promote");
} else if (box_post_adjusted(r)) {
tex_couple_nodes(box_post_adjusted(r), pa);
} else {
@@ -2526,32 +2531,34 @@ void tex_package(singleword nature)
tex_box_end(context, boxnode, shift, mainclass, slot);
}
+static int local_box_mapping[] = {
+ [local_left_box_box_code ] = local_left_box_code,
+ [local_right_box_box_code ] = local_right_box_code,
+ [local_middle_box_box_code] = local_middle_box_code
+};
+
void tex_run_unpackage(void)
{
int code = cur_chr; /*tex should we copy? */
- halfword head = cur_list.tail;
- halfword tail = cur_list.tail;
switch (code) {
case box_code:
case copy_code:
case unpack_code:
{
- halfword n = tex_scan_box_register_number();
- halfword b = box_register(n);
- if (! b) {
- return;
- } else {
+ halfword index = tex_scan_box_register_number();
+ halfword box = box_register(index);
+ if (box) {
int bad = 0;
switch (cur_list.mode) {
case vmode:
case internal_vmode:
- if (node_type(b) != vlist_node) {
+ if (node_type(box) != vlist_node) {
bad = 1;
}
break;
case hmode:
case restricted_hmode:
- if (node_type(b) != hlist_node) {
+ if (node_type(box) != hlist_node) {
bad = 1;
}
break;
@@ -2567,151 +2574,122 @@ void tex_run_unpackage(void)
"Sorry, Pandora. (You sneaky devil.) I refuse to unbox an \\hbox in vertical mode\n"
"or vice versa. And I can't open any boxes in math mode."
);
- return;
} else {
/*tex Todo: check head, not needed, always a temp. */
- /*tex Via variables for varmem assignment. */
- halfword list = box_list(b);
- halfword pre_migrated = code == unpack_code ? null : box_pre_migrated(b);
- halfword post_migrated = code == unpack_code ? null : box_post_migrated(b);
- // halfword pre_adjusted = code == (unpack_code || is_h_mode(cur_list.mode)) ? null : box_pre_adjusted(b);
- // halfword post_adjusted = code == (unpack_code || is_h_mode(cur_list.mode)) ? null : box_post_adjusted(b);
- // halfword pre_adjusted = code == unpack_code ? null : box_pre_adjusted(b);
- // halfword post_adjusted = code == unpack_code ? null : box_post_adjusted(b);
- halfword pre_adjusted = box_pre_adjusted(b);
- halfword post_adjusted = box_post_adjusted(b);
+ /*tex We go via variables because we do varmem assignments. Probably not needed */
+ halfword tail = cur_list.tail;
+ halfword list = box_list(box);
+ halfword pre_migrated = code == unpack_code ? null : box_pre_migrated(box);
+ halfword post_migrated = code == unpack_code ? null : box_post_migrated(box);
+ /* probably overkill as we inject vadjust again, maybe it should be an option, 'bind' or so */
+ // halfword pre_adjusted = box_pre_adjusted(box);
+ // halfword post_adjusted = box_post_adjusted(box);
+ halfword pre_adjusted = code == unpack_code ? null : box_pre_adjusted(box);
+ halfword post_adjusted = code == unpack_code ? null : box_post_adjusted(box);
+ // halfword pre_adjusted = code == (unpack_code || is_h_mode(cur_list.mode)) ? null : box_pre_adjusted(box);
+ // halfword post_adjusted = code == (unpack_code || is_h_mode(cur_list.mode)) ? null : box_post_adjusted(box);
+ int prunekerns = list && node_type(box) == hlist_node && normalize_line_mode_permitted(normalize_line_mode_par, remove_margin_kerns_mode);
+ /*tex
+ This topskip move is an ugly catch for wrong usage: when messing with
+ vboxes the migrated material can end up outside the unvboxed (pagebody)
+ content which is not what one wants. The way to prevent is to force
+ hmode when unboxing. It makes no sense to complicate this mechanism
+ even more by soem fragile hackery. Best just create what gets asked
+ and remember that thsi was decided. We need to copy the list earlier
+ when we do this!
+ */
+ /*
+ if (list) {
+ if (code == copy_code) {
+ list = tex_copy_node_list(list, null);
+ } else {
+ box_list(box) = null;
+ }
+ }
+ {
+ int movetopskip = list && (pre_adjusted || pre_migrated) && node_type(list) == glue_node && node_subtype(list) == top_skip_glue;
+ if (movetopskip) {
+ halfword topskip = list;
+ list = node_next(list);
+ node_prev(topskip) = null;
+ node_next(topskip) = null;
+ tex_try_couple_nodes(tail, topskip);
+ tail = topskip;
+ if (list) {
+ node_prev(list) = null;
+ }
+ if (pre_adjusted && tracing_adjusts_par > 1) {
+ tex_begin_diagnostic();
+ tex_print_format("[adjust: topskip moved]");
+ tex_end_diagnostic();
+ }
+ }
+ }
+ */
if (pre_adjusted) {
if (code == copy_code) {
pre_adjusted = tex_copy_node_list(pre_adjusted, null);
} else {
- box_pre_adjusted(b) = null;
- }
- while (pre_adjusted) {
- halfword p = pre_adjusted;
- halfword h = adjust_list(pre_adjusted);
- if (h) {
- if (is_h_mode(cur_list.mode)) {
- halfword n = tex_new_node(adjust_node, pre_adjust_code);
- adjust_list(n) = h;
- h = n;
- }
- if (! head) {
- head = h;
- }
- tex_try_couple_nodes(tail, h);
- tail = tex_tail_of_node_list(h);
- adjust_list(pre_adjusted) = null;
- }
- pre_adjusted = node_next(pre_adjusted);
- tex_flush_node(p);
+ box_pre_adjusted(box) = null;
}
+ tail = tex_flush_adjust_prepend(pre_adjusted, tail);
}
if (pre_migrated) {
if (code == copy_code) {
pre_migrated = tex_copy_node_list(pre_migrated, null);
} else {
- box_pre_migrated(b) = null;
+ box_pre_migrated(box) = null;
}
tex_try_couple_nodes(tail, pre_migrated);
tail = tex_tail_of_node_list(pre_migrated);
- if (! head) {
- head = pre_migrated;
- }
}
if (list) {
if (code == copy_code) {
list = tex_copy_node_list(list, null);
} else {
- box_list(b) = null;
- }
+ box_list(box) = null;
+ }
tex_try_couple_nodes(tail, list);
tail = tex_tail_of_node_list(list);
- if (! head) {
- head = list;
- }
}
if (post_migrated) {
if (code == copy_code) {
post_migrated = tex_copy_node_list(post_migrated, null);
} else {
- box_post_migrated(b) = null;
+ box_post_migrated(box) = null;
}
tex_try_couple_nodes(tail, post_migrated);
tail = tex_tail_of_node_list(post_migrated);
- if (! head) {
- head = post_migrated;
- }
}
if (post_adjusted) {
if (code == copy_code) {
post_adjusted = tex_copy_node_list(post_adjusted, null);
} else {
- box_post_adjusted(b) = null;
- }
- while (post_adjusted) {
- halfword p = post_adjusted;
- halfword h = adjust_list(post_adjusted);
- if (h) {
- if (is_h_mode(cur_list.mode)) {
- halfword n = tex_new_node(adjust_node, post_adjust_code);
- adjust_list(n) = h;
- h = n;
- }
- if (! head) {
- head = h;
- }
- tex_try_couple_nodes(tail, h);
- tail = tex_tail_of_node_list(h);
- adjust_list(post_adjusted) = null;
- }
- post_adjusted = node_next(post_adjusted);
- tex_flush_node(p);
+ box_post_adjusted(box) = null;
}
+ tail = tex_flush_adjust_append(post_adjusted, tail);
}
if (code != copy_code) {
- box_register(n) = null;
- tex_flush_node(b);
+ box_register(index) = null;
+ tex_flush_node(box);
}
- if (! head) {
- tail = null;
- } else if (node_type(b) == hlist_node && normalize_line_mode_permitted(normalize_line_mode_par, remove_margin_kerns_mode)) {
- /* only here head is used ... */
- tail = head;
- while (1) {
- halfword next = node_next(tail);
- if (next) {
- if (tex_is_margin_kern(next)) {
- tex_try_couple_nodes(tail, node_next(next));
- tex_flush_node(next);
- } else {
- tail = next;
- }
- } else {
- break;
- }
- }
- } else {
- tail = tex_tail_of_node_list(tail);
- }
- cur_list.tail = tail;
+ cur_list.tail = prunekerns ? tex_wipe_margin_kerns(cur_list.head) : tex_tail_of_node_list(tail);
}
- break;
}
+ break;
}
- case last_box_code:
+ case page_discards_code:
{
- tex_try_couple_nodes(tail, lmt_packaging_state.page_discards_head);
+ tex_try_couple_nodes(cur_list.tail, lmt_packaging_state.page_discards_head);
+ cur_list.tail = tex_tail_of_node_list(cur_list.tail);
lmt_packaging_state.page_discards_head = null;
- cur_list.tail = tex_tail_of_node_list(tail);
break;
}
- case tsplit_code:
- case vsplit_code:
- case dsplit_code:
+ case split_discards_code:
{
- tex_try_couple_nodes(tail, lmt_packaging_state.split_discards_head);
+ tex_try_couple_nodes(cur_list.tail, lmt_packaging_state.split_discards_head);
+ cur_list.tail = tex_tail_of_node_list(cur_list.tail);
lmt_packaging_state.split_discards_head = null;
- cur_list.tail = tex_tail_of_node_list(tail);
break;
}
case insert_box_code:
@@ -2741,7 +2719,7 @@ void tex_run_unpackage(void)
if (boxnode) {
halfword list = box_list(boxnode);
if (list) {
- tex_try_couple_nodes(tail, list);
+ tex_try_couple_nodes(cur_list.tail, list);
cur_list.tail = tex_tail_of_node_list(list);
box_list(boxnode) = null;
}
@@ -2755,21 +2733,11 @@ void tex_run_unpackage(void)
break;
}
case local_left_box_box_code:
- {
- tex_try_couple_nodes(tail, tex_get_local_boxes(local_left_box_code));
- cur_list.tail = tex_tail_of_node_list(tail);
- break;
- }
case local_right_box_box_code:
- {
- tex_try_couple_nodes(tail, tex_get_local_boxes(local_right_box_code));
- cur_list.tail = tex_tail_of_node_list(tail);
- break;
- }
case local_middle_box_box_code:
{
- tex_try_couple_nodes(tail, tex_get_local_boxes(local_middle_box_code));
- cur_list.tail = tex_tail_of_node_list(tail);
+ tex_try_couple_nodes(cur_list.tail, tex_get_local_boxes(local_box_mapping[code]));
+ cur_list.tail = tex_tail_of_node_list(cur_list.tail);
break;
}
default:
@@ -2778,7 +2746,6 @@ void tex_run_unpackage(void)
break;
}
}
- /* margin stuff was here */
}
/*tex
@@ -2839,28 +2806,23 @@ void tex_append_to_vlist(halfword b, int location, const line_break_properties *
case vlist_node:
case rule_node:
{
- halfword p = tex_aux_depth_correction(result, properties);
- tex_couple_nodes(cur_list.tail, p);
- cur_list.tail = p;
+ halfword glue = tex_aux_depth_correction(result, properties);
+ tex_tail_append(glue);
break;
}
}
}
- while (result) {
- tex_couple_nodes(cur_list.tail, result);
- cur_list.tail = result;
- result = node_next(result);
+ if (result) {
+ tex_tail_append_list(result);
}
return;
}
}
if (cur_list.prev_depth > ignore_depth_criterium_par) {
- halfword p = tex_aux_depth_correction(b, properties);
- tex_couple_nodes(cur_list.tail, p);
- cur_list.tail = p;
+ halfword glue = tex_aux_depth_correction(b, properties);
+ tex_tail_append(glue);
}
- tex_couple_nodes(cur_list.tail, b);
- cur_list.tail = b;
+ tex_tail_append(b);
cur_list.prev_depth = box_depth(b);
}
@@ -3470,7 +3432,7 @@ void tex_begin_box(int boxcontext, scaled shift, halfword slot)
tex_begin_token_list(every_vbox_par, every_vbox_text);
}
} else {
- cur_list.space_factor = 1000;
+ cur_list.space_factor = default_space_factor;
if (every_hbox_par) {
tex_begin_token_list(every_hbox_par, every_hbox_text);
}
diff --git a/source/luametatex/source/tex/texpackaging.h b/source/luametatex/source/tex/texpackaging.h
index dea884d0f..cba29f61f 100644
--- a/source/luametatex/source/tex/texpackaging.h
+++ b/source/luametatex/source/tex/texpackaging.h
@@ -39,7 +39,9 @@ typedef enum box_codes {
insert_copy_code,
local_left_box_box_code,
local_right_box_box_code,
- local_middle_box_box_code
+ local_middle_box_box_code,
+ page_discards_code,
+ split_discards_code,
} box_codes;
// typedef enum saved_spec_items {
diff --git a/source/luametatex/source/tex/texrules.c b/source/luametatex/source/tex/texrules.c
index 1d272f89e..b3d069ad3 100644
--- a/source/luametatex/source/tex/texrules.c
+++ b/source/luametatex/source/tex/texrules.c
@@ -19,8 +19,6 @@ halfword tex_aux_scan_rule_spec(rule_types t, halfword s)
if (s == strut_rule_code) {
rule_width(rule) = 0;
node_subtype(rule) = strut_rule_subtype;
- rule_height(rule) = null_flag;
- rule_depth(rule) = null_flag;
} else {
rule_width(rule) = default_rule;
}
@@ -135,7 +133,7 @@ halfword tex_aux_scan_rule_spec(rule_types t, halfword s)
void tex_aux_run_vrule(void)
{
tex_tail_append(tex_aux_scan_rule_spec(v_rule_type, cur_chr));
- cur_list.space_factor = 1000;
+ cur_list.space_factor = default_space_factor;
}
void tex_aux_run_hrule(void)
diff --git a/source/luametatex/source/tex/texscanning.c b/source/luametatex/source/tex/texscanning.c
index 845b6fa55..08d5cdaa0 100644
--- a/source/luametatex/source/tex/texscanning.c
+++ b/source/luametatex/source/tex/texscanning.c
@@ -38,13 +38,13 @@ void tex_scan_left_brace(void)
while(1) {
tex_get_x_token();
switch (cur_cmd) {
+ case left_brace_cmd:
+ /* we found one */
+ return;
case spacer_cmd:
case relax_cmd:
/* stay in while */
break;
- case left_brace_cmd:
- /* we found one */
- return;
default:
/* we recover */
tex_handle_error(
@@ -1084,6 +1084,26 @@ static void tex_aux_set_cur_val_by_define_char_cmd(int chr)
switches.
*/
+static halfword tex_aux_scan_math_style_number(halfword code)
+{
+ switch (code) {
+ case yet_unset_math_style:
+ return tex_scan_math_style_identifier(0, 0);
+ case scaled_math_style:
+ return cur_list.math_scale;
+ case former_choice_math_style:
+ return 0;
+ default:
+ return code;
+ }
+}
+
+static void tex_aux_set_cur_val_by_math_style_cmd(halfword code)
+{
+ cur_val = tex_aux_scan_math_style_number(code);
+ cur_val_level = int_val_level;
+}
+
void tex_scan_something_simple(halfword cmd, halfword chr)
{
int succeeded = 1;
@@ -1151,8 +1171,7 @@ void tex_scan_something_simple(halfword cmd, halfword chr)
break;
}
case math_style_cmd:
- cur_val = (chr == yet_unset_math_style) ? tex_scan_math_style_identifier(0, 0) : chr;
- cur_val_level = int_val_level;
+ tex_aux_set_cur_val_by_math_style_cmd(chr);
break;
case set_auxiliary_cmd:
tex_aux_set_cur_val_by_auxiliary_cmd(chr);
@@ -1165,6 +1184,7 @@ void tex_scan_something_simple(halfword cmd, halfword chr)
break;
/* end of tex_aux_short_scan_something_internal */
default:
+ /* weird message, this library */
tex_handle_error(
normal_error_type,
"You can't use '%C' as tex library index",
@@ -1201,21 +1221,21 @@ static void tex_aux_missing_number_error(void)
/* todo: get rid of cur_val */
-static int tex_aux_valid_tok_level(halfword level)
-{
- if (level == tok_val_level) {
- return 1;
- } else {
- if (lmt_error_state.intercept) {
- lmt_error_state.last_intercept = 1 ;
- } else {
- tex_aux_missing_number_error();
- }
- cur_val = 0;
- cur_val_level = dimen_val_level; /* why dimen */
- return 0;
- }
-}
+// static int tex_aux_valid_tok_level(halfword level)
+// {
+// if (level == tok_val_level) {
+// return 1;
+// } else {
+// if (lmt_error_state.intercept) {
+// lmt_error_state.last_intercept = 1 ;
+// } else {
+// tex_aux_missing_number_error();
+// }
+// cur_val = 0;
+// cur_val_level = dimen_val_level; /* why dimen */
+// return 0;
+// }
+// }
static int tex_aux_scan_hyph_data_number(halfword code, halfword *target)
{
@@ -1307,8 +1327,7 @@ static halfword tex_aux_scan_something_internal(halfword cmd, halfword chr, int
cur_val_level = int_val_level;
break;
case math_style_cmd:
- cur_val = (chr == yet_unset_math_style) ? tex_scan_math_style_identifier(0, 0) : chr;
- cur_val_level = int_val_level;
+ tex_aux_set_cur_val_by_math_style_cmd(chr);
break;
case set_auxiliary_cmd:
tex_aux_set_cur_val_by_auxiliary_cmd(chr);
@@ -1324,7 +1343,8 @@ static halfword tex_aux_scan_something_internal(halfword cmd, halfword chr, int
break;
/* end of tex_aux_short_scan_something_internal */
case define_font_cmd:
- if (tex_aux_valid_tok_level(level)) {
+ // if (tex_aux_valid_tok_level(level)) {
+ if (level == tok_val_level) { /* Is this test still needed? */
cur_val = cur_font_par;
cur_val_level = font_val_level;
return cur_val;
@@ -1332,7 +1352,8 @@ static halfword tex_aux_scan_something_internal(halfword cmd, halfword chr, int
break;
}
case set_font_cmd:
- if (tex_aux_valid_tok_level(level)) {
+ // if (tex_aux_valid_tok_level(level)) {
+ if (level == tok_val_level) { /* Is this test still needed? */
cur_val = cur_chr;
cur_val_level = font_val_level;
return cur_val;
@@ -1958,8 +1979,8 @@ halfword tex_scan_int(int optional_equal, int *radix)
lmt_error_state.last_intercept = 1 ;
tex_back_input(cur_tok);
} else {
- result = '0'; /*tex Why not just 0. */
tex_aux_improper_constant_error();
+ return 0;
}
} else {
/*tex Scan an optional space. */
@@ -1971,19 +1992,18 @@ halfword tex_scan_int(int optional_equal, int *radix)
} else if (cur_cmd >= min_internal_cmd && cur_cmd <= max_internal_cmd) {
result = tex_aux_scan_something_internal(cur_cmd, cur_chr, int_val_level, 0, 0);
if (cur_val_level != int_val_level) {
- result = 0;
tex_aux_scan_int_no_number();
+ return 0;
}
} else if (cur_cmd == math_style_cmd) {
- /* A pity that we need to check this way in |scan_int|. */
- result = (cur_chr == yet_unset_math_style) ? tex_scan_math_style_identifier(0, 0) : cur_chr;
+ result = tex_aux_scan_math_style_number(cur_chr);
} else if (cur_cmd == hyphenation_cmd) {
/* A pity that we need to check this way in |scan_int|. */
if (tex_aux_scan_hyph_data_number(cur_chr, &cur_chr)) {
result = cur_chr;
} else {
- result = 0;
tex_aux_scan_int_no_number();
+ return 0;
}
} else {
/*tex has an error message been issued? */
@@ -4870,23 +4890,23 @@ static halfword tex_scan_bit_int(int *radix)
}
}
if (result > max_character_code) {
- result = '0'; /*tex Why not just 0. */
tex_aux_improper_constant_error();
+ return 0;
}
} else if (cur_cmd >= min_internal_cmd && cur_cmd <= max_internal_cmd) {
result = tex_aux_scan_something_internal(cur_cmd, cur_chr, int_val_level, 0, 0);
if (cur_val_level != int_val_level) {
- result = 0;
tex_aux_missing_number_error();
+ return 0;
}
} else if (cur_cmd == math_style_cmd) {
- result = (cur_chr == yet_unset_math_style) ? tex_scan_math_style_identifier(0, 0) : cur_chr;
+ result = tex_aux_scan_math_style_number(cur_chr);
} else if (cur_cmd == hyphenation_cmd) {
if (tex_aux_scan_hyph_data_number(cur_chr, &cur_chr)) {
result = cur_chr;
} else {
- result = 0;
tex_aux_missing_number_error();
+ return 0;
}
} else {
int vacuous = 1;
diff --git a/source/luametatex/source/tex/textextcodes.c b/source/luametatex/source/tex/textextcodes.c
index 2fef9857f..e76329685 100644
--- a/source/luametatex/source/tex/textextcodes.c
+++ b/source/luametatex/source/tex/textextcodes.c
@@ -54,10 +54,13 @@ void tex_set_cat_code(int h, int n, halfword v, int gl)
{
sa_tree_item item = { .uint_value = CATCODEDEFAULTS };
sa_tree tree = lmt_catcode_state.catcode_heads[h];
- if (h > lmt_catcode_state.catcode_max) {
- lmt_catcode_state.catcode_max = h;
- }
+// if (h > lmt_catcode_state.catcode_max) {
+// lmt_catcode_state.catcode_max = h;
+// }
if (! tree) {
+if (h > lmt_catcode_state.catcode_max) {
+ lmt_catcode_state.catcode_max = h;
+}
tree = sa_new_tree(CATCODESTACK, 1, item);
lmt_catcode_state.catcode_heads[h] = tree;
}
@@ -68,10 +71,13 @@ halfword tex_get_cat_code(int h, int n)
{
sa_tree_item item = { .uint_value = CATCODEDEFAULTS };
sa_tree tree = lmt_catcode_state.catcode_heads[h];
- if (h > lmt_catcode_state.catcode_max) {
- lmt_catcode_state.catcode_max = h;
- }
+// if (h > lmt_catcode_state.catcode_max) {
+// lmt_catcode_state.catcode_max = h;
+// }
if (! tree) {
+if (h > lmt_catcode_state.catcode_max) {
+ lmt_catcode_state.catcode_max = h;
+}
tree = sa_new_tree(CATCODESTACK, 1, item);
lmt_catcode_state.catcode_heads[h] = tree;
}
diff --git a/tex/context/base/mkii/anch-pos.mkii b/tex/context/base/mkii/anch-pos.mkii
index b86cee5cc..bd6906d1c 100644
--- a/tex/context/base/mkii/anch-pos.mkii
+++ b/tex/context/base/mkii/anch-pos.mkii
@@ -847,10 +847,10 @@
%D provide a simple test on positione being on the same page.
%D
%D \starttyping
-%D \doifpositionsonsamepageelse{point a}{point b}
+%D \doifpositionsonsamepageelse{point a,point b}
%D {action when on same page}
%D {action when not on same page}
-%D \doifpositionsonthispageelse{point a}{point b}
+%D \doifpositionsonthispageelse{point a,point b}
%D {action when on this page}
%D {action when not on this page}
%D \stoptyping
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 7a8df6ecd..be7fd9234 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{2023.01.05 17:43}
+\newcontextversion{2023.01.15 13:53}
%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 5d3930dec..407cde6ad 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{2023.01.05 17:43}
+\edef\contextversion{2023.01.15 13:53}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-en.mkii b/tex/context/base/mkii/mult-en.mkii
index 9ac93c22d..e6c9225e0 100644
--- a/tex/context/base/mkii/mult-en.mkii
+++ b/tex/context/base/mkii/mult-en.mkii
@@ -591,6 +591,7 @@
\setinterfacevariable{temporary}{temporary}
\setinterfacevariable{test}{test}
\setinterfacevariable{text}{text}
+\setinterfacevariable{textdisplay}{textdisplay}
\setinterfacevariable{textnote}{textnote}
\setinterfacevariable{three}{three}
\setinterfacevariable{thursday}{thursday}
@@ -718,6 +719,7 @@
\setinterfaceconstant{bookmark}{bookmark}
\setinterfaceconstant{bottom}{bottom}
\setinterfaceconstant{bottomafter}{bottomafter}
+\setinterfaceconstant{bottomalign}{bottomalign}
\setinterfaceconstant{bottombefore}{bottombefore}
\setinterfaceconstant{bottomcolor}{bottomcolor}
\setinterfaceconstant{bottomcommand}{bottomcommand}
@@ -1332,6 +1334,7 @@
\setinterfaceconstant{toffset}{toffset}
\setinterfaceconstant{tolerance}{tolerance}
\setinterfaceconstant{top}{top}
+\setinterfaceconstant{topalign}{topalign}
\setinterfaceconstant{topcolor}{topcolor}
\setinterfaceconstant{topcommand}{topcommand}
\setinterfaceconstant{topdistance}{topdistance}
diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii
index aa5c33391..71e6d8978 100644
--- a/tex/context/base/mkii/mult-fr.mkii
+++ b/tex/context/base/mkii/mult-fr.mkii
@@ -719,6 +719,7 @@
\setinterfaceconstant{bookmark}{marquepage}
\setinterfaceconstant{bottom}{bas}
\setinterfaceconstant{bottomafter}{basaprès}
+\setinterfaceconstant{bottomalign}{bottomalign}
\setinterfaceconstant{bottombefore}{basavant}
\setinterfaceconstant{bottomcolor}{bottomcolor}
\setinterfaceconstant{bottomcommand}{commandebas}
@@ -1333,6 +1334,7 @@
\setinterfaceconstant{toffset}{decalaget}
\setinterfaceconstant{tolerance}{tolerance}
\setinterfaceconstant{top}{haut}
+\setinterfaceconstant{topalign}{topalign}
\setinterfaceconstant{topcolor}{topcolor}
\setinterfaceconstant{topcommand}{commandehaut}
\setinterfaceconstant{topdistance}{distancehaut}
diff --git a/tex/context/base/mkii/mult-nl.mkii b/tex/context/base/mkii/mult-nl.mkii
index ca90b7129..0446f2084 100644
--- a/tex/context/base/mkii/mult-nl.mkii
+++ b/tex/context/base/mkii/mult-nl.mkii
@@ -591,6 +591,7 @@
\setinterfacevariable{temporary}{voorlopig}
\setinterfacevariable{test}{test}
\setinterfacevariable{text}{tekst}
+\setinterfacevariable{textdisplay}{textdisplay}
\setinterfacevariable{textnote}{tekstnoot}
\setinterfacevariable{three}{drie}
\setinterfacevariable{thursday}{donderdag}
@@ -718,6 +719,7 @@
\setinterfaceconstant{bookmark}{bookmark}
\setinterfaceconstant{bottom}{onder}
\setinterfaceconstant{bottomafter}{bottomafter}
+\setinterfaceconstant{bottomalign}{bottomalign}
\setinterfaceconstant{bottombefore}{bottombefore}
\setinterfaceconstant{bottomcolor}{onderkleur}
\setinterfaceconstant{bottomcommand}{ondercommando}
@@ -1332,6 +1334,7 @@
\setinterfaceconstant{toffset}{toffset}
\setinterfaceconstant{tolerance}{tolerantie}
\setinterfaceconstant{top}{boven}
+\setinterfaceconstant{topalign}{topalign}
\setinterfaceconstant{topcolor}{bovenkleur}
\setinterfaceconstant{topcommand}{bovencommando}
\setinterfaceconstant{topdistance}{bovenafstand}
diff --git a/tex/context/base/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua
index 93ba661a7..77f55964f 100644
--- a/tex/context/base/mkiv/anch-pos.lua
+++ b/tex/context/base/mkiv/anch-pos.lua
@@ -986,7 +986,7 @@ local function overlapping(one,two,overlappingmargin) -- hm, strings so this is
end
local function onsamepage(list,page)
- for id in gmatch(list,"(, )") do
+ for id in gmatch(list,"([^,%s]+)") do
local jpi = collected[id]
if jpi then
local p = jpi.p
diff --git a/tex/context/base/mkiv/anch-pos.mkiv b/tex/context/base/mkiv/anch-pos.mkiv
index 772c89504..ce67caa98 100644
--- a/tex/context/base/mkiv/anch-pos.mkiv
+++ b/tex/context/base/mkiv/anch-pos.mkiv
@@ -477,10 +477,10 @@
%D positions being on the same page.
%D
%D \starttyping
-%D \doifpositionsonsamepageelse{point a}{point b}
+%D \doifpositionsonsamepageelse{point a,point b}
%D {action when on same page}
%D {action when not on same page}
-%D \doifpositionsonthispageelse{point a}{point b}
+%D \doifpositionsonthispageelse{point a,point b}
%D {action when on this page}
%D {action when not on this page}
%D \stoptyping
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index a05a08583..05a4a397c 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{2023.01.05 17:43}
+\newcontextversion{2023.01.15 13:53}
%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 e9ae230e4..a48bbf9cd 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{2023.01.05 17:43}
+\edef\contextversion{2023.01.15 13:53}
%D Kind of special:
diff --git a/tex/context/base/mkiv/export-example.css b/tex/context/base/mkiv/export-example.css
index 7cfd7f291..45af82c34 100644
--- a/tex/context/base/mkiv/export-example.css
+++ b/tex/context/base/mkiv/export-example.css
@@ -19,14 +19,14 @@
\definefloat[myfloata]
\definefloat[myfloatb][myfloatbs][figure]
- context|div.float.myfloata { } float[detail='myfloata'] { }
- context|div.float.myfloatb { } float[detail='myfloatb'] { }
- context|div.float.figure { } float[detail='figure'] { }
- context|div.float.figure.myfloatb { } float[chain~='figure'][detail='myfloata'] { }
- context|div.myfloata { } *[detail='myfloata'] { }
- context|div.myfloatb { } *[detail='myfloatb'] { }
- context|div.figure { } *[chain~='figure'] { }
- context|div.figure.myfloatb { } *[chain~='figure'][detail='myfloatb'] { }
+ div.float.myfloata { } float[detail='myfloata'] { }
+ div.float.myfloatb { } float[detail='myfloatb'] { }
+ div.float.figure { } float[detail='figure'] { }
+ div.float.figure.myfloatb { } float[chain~='figure'][detail='myfloata'] { }
+ div.myfloata { } *[detail='myfloata'] { }
+ div.myfloatb { } *[detail='myfloatb'] { }
+ div.figure { } *[chain~='figure'] { }
+ div.figure.myfloatb { } *[chain~='figure'][detail='myfloatb'] { }
Inheritance when using div seems to be stronger so we need to take more precautions.
@@ -39,34 +39,34 @@
/* extradata: display */
ignore,
-context|div.ignore {
+div.ignore {
display : none ;
}
ignore,
-context|div.private {
+div.private {
display : none ;
}
xmetadata,
-context|div.xmetadata {
+div.xmetadata {
display : none ;
}
xmetavariable,
-context|div.xmetavariable {
+div.xmetavariable {
display : none ;
}
extradata,
-context|div.extradata {
+div.extradata {
display : none ;
}
/* document : display */
document:before,
-context|div.document:before {
+div.document:before {
content : attr(title) ;
font-size : 44pt ;
font-weight : bold ;
@@ -74,7 +74,7 @@ context|div.document:before {
}
document,
-context|div.document {
+div.document {
font-family : "DejaVu Serif", "Lucida Bright", serif ;
font-size : 12pt ;
/* line-height : 14.4pt; */
@@ -88,26 +88,26 @@ context|div.document {
}
document>metadata,
-context|div.document context|div.metadata {
+div.document div.metadata {
font-family : "DejaVu Sans Mono", "Lucida Console", monospace ;
margin-bottom : 3ex ;
}
/*
document>metadata>metavariable[name="X"]:before,
- context|div.document context|div.metadata context|div.metavariable.metaname-X:before {
+ div.document div.metadata div.metavariable.metaname-X:before {
content : "X\00A0\00A0\00A0:\00A0" ;
}
*/
document>metadata,
-context|div.document context|div.metadata {
+div.document div.metadata {
display : flex ;
flex-flow : column ;
}
document>metadata>metavariable:before,
-context|div.document context|div.metadata context|div.metavariable:before {
+div.document div.metadata div.metavariable:before {
display : inline ;
content : attr(label);
width : 8em ;
@@ -116,7 +116,7 @@ context|div.document context|div.metadata context|div.metavariable:before {
}
document>metadata>metavariable[name="title"],
-context|div.document context|div.metadata context|div.metavariable.metaname-title {
+div.document div.metadata div.metavariable.metaname-title {
order : -1 ;
display : block ;
width : 50em ;
@@ -129,7 +129,7 @@ context|div.document context|div.metadata context|div.metavariable.metaname-titl
}
document>metadata>metavariable[name="title"]:before,
-context|div.document context|div.metadata context|div.metavariable.metaname-title:before {
+div.document div.metadata div.metavariable.metaname-title:before {
content : none ;
}
@@ -138,8 +138,8 @@ context|div.document context|div.metadata context|div.metavariable.metaname-titl
paragraph,
p,
-context|div.paragraph,
-context|div.p {
+div.paragraph,
+div.p {
display : block ;
margin-top : 0.5em ;
margin-bottom : 0.5em ;
@@ -148,7 +148,7 @@ context|div.p {
/* break : display */
break,
-context|div.break {
+div.break {
display : block ;
margin-bottom : 0.5em ;
}
@@ -157,16 +157,16 @@ context|div.break {
/* highlight : inline */
construct,
-context|div.construct {
+div.construct {
}
construct[detail="important"],
-context|div.construct.important {
+div.construct.important {
font-weight : bold ;
}
highlight,
-context|div.highlight { /* todo: style and color */
+div.highlight { /* todo: style and color */
display : inline ;
}
@@ -176,12 +176,12 @@ context|div.highlight { /* todo: style and color */
/* sectioncontent : display */
section,
-context|div.section {
+div.section {
display : block ;
}
sectioncaption,
-context|div.sectioncaption {
+div.sectioncaption {
display : block ;
text-align : left ;
page-break-after : avoid ;
@@ -190,18 +190,18 @@ context|div.sectioncaption {
}
sectioncontent,
-context|div.sectioncontent {
+div.sectioncontent {
display : block ;
}
sectionnumber,
-context|div.sectionnumber {
+div.sectionnumber {
display : inline ;
margin-right : 1em ;
}
sectionnumber,
-context|div.sectiontitle {
+div.sectiontitle {
display : inline ;
}
@@ -211,29 +211,29 @@ context|div.sectiontitle {
section[detail="chapter"]>sectioncaption,
section[detail="title"]>sectioncaption,
-context|div.level-2.chapter context|div.sectioncaption ,
-context|div.level-2.title context|div.sectioncaption {
+div.level-2.chapter div.sectioncaption ,
+div.level-2.title div.sectioncaption {
font-size : 2em ;
font-weight : bold ;
}
section[detail="chapter"],
section[detail="title"],
-context|div.level-2.chapter,
-context|div.level-2.title {
+div.level-2.chapter,
+div.level-2.title {
page-break-before : always ;
margin-top : 4ex ;
}
section[detail="chapter"]>sectioncaption>sectionnumber,
-context|div.level-2.chapter context|div.sectioncaption context|div.sectionnumber {
+div.level-2.chapter div.sectioncaption div.sectionnumber {
/* nothing */
}
section[detail="chapter"]>sectioncaption>sectiontitle,
section[detail="title"]>sectioncaption>sectiontitle,
-context|div.level-2.chapter context|div.sectioncaption context|div.sectiontitle,
-context|div.level-2.title context|div.sectioncaption context|div.sectiontitle {
+div.level-2.chapter div.sectioncaption div.sectiontitle,
+div.level-2.title div.sectioncaption div.sectiontitle {
/* nothing */
}
@@ -241,28 +241,28 @@ context|div.level-2.title context|div.sectioncaption context|div.sectiontitle {
section[detail="section"]>sectioncaption,
section[detail="subject"]>sectioncaption,
-context|div.level-3.section context|div.sectioncaption,
-context|div.level-3.subject context|div.sectioncaption {
+div.level-3.section div.sectioncaption,
+div.level-3.subject div.sectioncaption {
font-size : 1.75em ;
font-weight : bold ;
}
section[detail="section"],
section[detail="subject"],
-context|div.level-3.section,
-context|div.level-3.subject {
+div.level-3.section,
+div.level-3.subject {
/* nothing */
}
section[detail="section"]>sectioncaption>sectionnumber,
-context|div.level-3.section context|div.sectioncaption context|div.sectionnumber {
+div.level-3.section div.sectioncaption div.sectionnumber {
/* nothing */
}
section[detail="section"]>sectioncaption>sectiontitle,
section[detail="subject"]>sectioncaption>sectiontitle,
-context|div.level-3.section context|div.sectioncaption context|div.sectiontitle,
-context|div.level-3.subject context|div.sectioncaption context|div.sectiontitle {
+div.level-3.section div.sectioncaption div.sectiontitle,
+div.level-3.subject div.sectioncaption div.sectiontitle {
/* nothing */
}
@@ -270,28 +270,28 @@ context|div.level-3.subject context|div.sectioncaption context|div.sectiontitle
section[detail="subsection"]>sectioncaption,
section[detail="subsubject"]>sectioncaption,
-context|div.level-4.subsection context|div.sectioncaption,
-context|div.level-4.subsubject context|div.sectioncaption {
+div.level-4.subsection div.sectioncaption,
+div.level-4.subsubject div.sectioncaption {
font-size : 1.5em ;
font-weight : bold ;
}
section[detail="subsection"],
section[detail="subsubject"],
-context|div.level-4.subsection,
-context|div.level-4.subsubject {
+div.level-4.subsection,
+div.level-4.subsubject {
/* nothing */
}
section[detail="subsection"]>sectioncaption>sectionnumber,
-context|div.level-4.subsection context|div.sectioncaption context|div.sectionnumber {
+div.level-4.subsection div.sectioncaption div.sectionnumber {
/* nothing */
}
section[detail="subsection"]>sectioncaption>sectiontitle,
section[detail="subsubject"]>sectioncaption>sectiontitle,
-context|div.level-4.subsection context|div.sectioncaption context|div.sectiontitle,
-context|div.level-4.subsubject context|div.sectioncaption context|div.sectiontitle {
+div.level-4.subsection div.sectioncaption div.sectiontitle,
+div.level-4.subsubject div.sectioncaption div.sectiontitle {
/* nothing */
}
@@ -299,28 +299,28 @@ context|div.level-4.subsubject context|div.sectioncaption context|div.sectiontit
section[detail="subsubsection"]>sectioncaption,
section[detail="subsubsubject"]>sectioncaption,
-context|div.level-5.subsubsection context|div.sectioncaption,
-context|div.level-5.subsubsubject context|div.sectioncaption {
+div.level-5.subsubsection div.sectioncaption,
+div.level-5.subsubsubject div.sectioncaption {
font-size : 1.25em ;
font-weight : bold ;
}
section[detail="subsubsection"],
section[detail="subsubsubject"],
-context|div.level-5.subsubsection,
-context|div.level-5.subsubsubject {
+div.level-5.subsubsection,
+div.level-5.subsubsubject {
/* nothing */
}
section[detail="subsubsection"]>sectioncaption>sectionnumber,
-context|div.level-5.subsubsection context|div.sectioncaption context|div.sectionnumber {
+div.level-5.subsubsection div.sectioncaption div.sectionnumber {
/* nothing */
}
section[detail="subsubsection"]>sectioncaption>sectiontitle,
section[detail="subsubsubject"]>sectioncaption>sectiontitle,
-context|div.level-5.subsubsection context|div.sectioncaption context|div.sectiontitle,
-context|div.level-5.subsubsubject context|div.sectioncaption context|div.sectiontitle {
+div.level-5.subsubsection div.sectioncaption div.sectiontitle,
+div.level-5.subsubsubject div.sectioncaption div.sectiontitle {
/* nothing */
}
@@ -328,14 +328,14 @@ context|div.level-5.subsubsubject context|div.sectioncaption context|div.section
section[detail="summary"],
section[detail="subsummary"],
-context|div.section.summary,
-context|div.section.subsummary {
+div.section.summary,
+div.section.subsummary {
margin-top : 1em ;
margin-bottom : 1em ;
}
section[detail="summary"]>sectioncaption>sectiontitle,
-context|div.section.summary context|div.sectioncaption context|div.sectiontitle {
+div.section.summary div.sectioncaption div.sectiontitle {
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -347,7 +347,7 @@ context|div.section.summary context|div.sectioncaption context|div.sectiontitle
}
section[detail="subsummary"]>sectioncaption>sectiontitle,
-context|div.section.subsummary context|div.sectioncaption context|div.sectiontitle {
+div.section.subsummary div.sectioncaption div.sectiontitle {
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -377,27 +377,27 @@ context|div.section.subsummary context|div.sectioncaption context|div.sectiontit
}
itemgroup,
-context|div.itemgroup {
+div.itemgroup {
display : block ;
margin-bottom : 0.5em ;
margin-top : 0.5em ;
}
-itemgroup[symbol="1"], context|div.itemgroup.symbol-1 { list-style-type : disc ; }
-itemgroup[symbol="2"], context|div.itemgroup.symbol-2 { list-style-type : square ; }
-itemgroup[symbol="3"], context|div.itemgroup.symbol-3 { list-style-type : square ; }
-itemgroup[symbol="4"], context|div.itemgroup.symbol-4 { list-style-type : square ; }
-itemgroup[symbol="5"], context|div.itemgroup.symbol-5 { list-style-type : circ ; }
-itemgroup[symbol="a"], context|div.itemgroup.symbol-a { list-style-type : lower-alpha ; }
-itemgroup[symbol="A"], context|div.itemgroup.symbol-A { list-style-type : alpha ; }
-itemgroup[symbol="r"], context|div.itemgroup.symbol-r { list-style-type : lower-roman ; }
-itemgroup[symbol="R"], context|div.itemgroup.symbol-R { list-style-type : upper-roman ; }
-itemgroup[symbol="n"], context|div.itemgroup.symbol-n { list-style-type : decimal ; }
-itemgroup[symbol="g"], context|div.itemgroup.symbol-g { list-style-type : lower-greek ; }
-itemgroup[symbol="G"], context|div.itemgroup.symbol-G { list-style-type : upper-greek ; }
+itemgroup[symbol="1"], div.itemgroup.symbol-1 { list-style-type : disc ; }
+itemgroup[symbol="2"], div.itemgroup.symbol-2 { list-style-type : square ; }
+itemgroup[symbol="3"], div.itemgroup.symbol-3 { list-style-type : square ; }
+itemgroup[symbol="4"], div.itemgroup.symbol-4 { list-style-type : square ; }
+itemgroup[symbol="5"], div.itemgroup.symbol-5 { list-style-type : circ ; }
+itemgroup[symbol="a"], div.itemgroup.symbol-a { list-style-type : lower-alpha ; }
+itemgroup[symbol="A"], div.itemgroup.symbol-A { list-style-type : alpha ; }
+itemgroup[symbol="r"], div.itemgroup.symbol-r { list-style-type : lower-roman ; }
+itemgroup[symbol="R"], div.itemgroup.symbol-R { list-style-type : upper-roman ; }
+itemgroup[symbol="n"], div.itemgroup.symbol-n { list-style-type : decimal ; }
+itemgroup[symbol="g"], div.itemgroup.symbol-g { list-style-type : lower-greek ; }
+itemgroup[symbol="G"], div.itemgroup.symbol-G { list-style-type : upper-greek ; }
item,
-context|div.item {
+div.item {
display : list-item ;
margin-left : 1em ;
margin-bottom : 0.5em ;
@@ -405,12 +405,12 @@ context|div.item {
}
itemtag,
-context|div.itemtag {
+div.itemtag {
display: none ;
}
itemcontent,
-context|div.itemcontent {
+div.itemcontent {
}
/* description : display */
@@ -419,14 +419,14 @@ context|div.itemcontent {
/* descriptionsymbol : inline */
description,
-context|div.description {
+div.description {
display : block ;
margin-bottom : 1em ;
margin-top : 1em ;
}
descriptiontag,
-context|div.descriptiontag {
+div.descriptiontag {
display : inline ;
float : left ;
clear : left ;
@@ -436,11 +436,11 @@ context|div.descriptiontag {
}
descriptioncontent,
-context|div.descriptioncontent {
+div.descriptioncontent {
}
descriptionsymbol,
-context|div.descriptionsymbol {
+div.descriptionsymbol {
display : inline ;
}
@@ -450,7 +450,7 @@ context|div.descriptionsymbol {
/* verbatim : inline */
verbatimblock,
-context|div.verbatimblock {
+div.verbatimblock {
background-color : rgb(50%,50%,100%) ;
display : block ;
padding : 1em ;
@@ -460,19 +460,19 @@ context|div.verbatimblock {
}
verbatimlines+verbatimlines,
-context|div.verbatimlines+context|div.verbatimlines {
+div.verbatimlines+div.verbatimlines {
display : block ;
margin-top : 1em ;
}
verbatimline,
-context|div.verbatimline {
+div.verbatimline {
display : block ;
white-space : pre-wrap ;
}
verbatim,
-context|div.verbatim {
+div.verbatim {
display : inline ;
white-space : pre-wrap ;
color : rgb(60%,60%,0%) ;
@@ -484,26 +484,26 @@ context|div.verbatim {
/* linenumber : inline */
lines,
-context|div.lines {
+div.lines {
display : block ;
margin-bottom : 1em ;
margin-top : 1em ;
}
lines+lines,
-context|div.lines+context|div.lines {
+div.lines+div.lines {
display : block ;
margin-top : 1em ;
}
line,
-context|div.line {
+div.line {
display : block ;
white-space : pre-wrap ;
}
linenumber,
-context|div.linenumber {
+div.linenumber {
display : inline-block ;
margin-right : 1em ;
width : 3em ;
@@ -516,8 +516,8 @@ context|div.linenumber {
sorting,
synonym,
-context|div.sorting,
-context|div.synonym {
+div.sorting,
+div.synonym {
display : inline ;
font-variant : small-caps ;
}
@@ -533,17 +533,17 @@ context|div.synonym {
/* registerpagerange : mixed */
register,
-context|div.register {
+div.register {
display: none ;
}
registerlocation,
-context|div.registerlocation {
+div.registerlocation {
display: inline ;
}
registerlocation:after,
-context|div.registerlocation:after {
+div.registerlocation:after {
content : "\25B6\00A0\00A0" ;
color : rgb(40%,40%,40%) ;
font-size : x-small ;
@@ -559,38 +559,38 @@ context|div.registerlocation:after {
/* we have a few bonus mappings here */
table,
-context|div.table {
+div.table {
display : table ;
}
tablerow, tr
-context|div.tablerow, context|div.tr {
+div.tablerow, div.tr {
display : table-row ;
}
tablecell[align="middle"], td[align="middle"],
-context|div.tablecell.align-middle {
+div.tablecell.align-middle {
display : table-cell ;
text-align : center ;
padding : .1em ;
}
tablecell[align="flushleft"], td[align="flushleft"],
-context|div.tablecell.align-flushleft {
+div.tablecell.align-flushleft {
display : table-cell ;
text-align : left ;
padding : .1em ;
}
tablecell[align="flushright"], td[align="flushright"],
-context|div.tablecell.align-flushright {
+div.tablecell.align-flushright {
display : table-cell ;
text-align : right ;
padding : .1em ;
}
tablecell, td
-context|div.tablecell, context|div.td {
+div.tablecell, div.td {
display : table-cell ;
text-align : left ;
padding : .1em ;
@@ -616,7 +616,7 @@ div.tbody, div.tablebody {
/* tabulatecell : mixed */
tabulate,
-context|div.tabulate {
+div.tabulate {
display : table ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -624,50 +624,50 @@ context|div.tabulate {
}
floatcontent>tabulate,
-context|div.floatcontent context|div.tabulate {
+div.floatcontent div.tabulate {
margin-left : 0em ;
}
tabulaterow,
-context|div.tabulaterow {
+div.tabulaterow {
display : table-row ;
}
tabulatecell[align="middle"],
-context|div.tabulatecell.align-middle {
+div.tabulatecell.align-middle {
display : table-cell ;
text-align : center ;
padding-right : 1em ;
}
tabulatecell[align="flushleft"],
-context|div.tabulatecell.align-flushleft {
+div.tabulatecell.align-flushleft {
display : table-cell ;
text-align : left ;
padding-right : 1em ;
}
tabulatecell[align="flushright"],
-context|div.tabulatecell.align-flushright {
+div.tabulatecell.align-flushright {
display : table-cell ;
text-align : right ;
padding-right : 1em ;
}
tabulatecell,
-context|div.tabulatecell {
+div.tabulatecell {
display : table-cell ;
text-align : left ;
padding-right : 1em ;
}
tabulatecell[kind="strong"],
-context|div.tabulatecell.kind-strong {
+div.tabulatecell.kind-strong {
font-weight : bold ;
}
tabulatecell[kind="equals"]:before,
-context|div.tabulatecell.kind-equals:before {
+div.tabulatecell.kind-equals:before {
display : inline-block ;
clear : left ;
margin-left : -.6em ;
@@ -688,26 +688,26 @@ context|div.tabulatecell.kind-equals:before {
/* combinationcaption : mixed */
combination,
-context|div.combination {
+div.combination {
display : table ;
margin-top : 0em ;
margin-bottom : 0em ;
}
combinationpair, combinationtext,
-context|div.combinationpair, context|div.combinationtext {
+div.combinationpair, div.combinationtext {
display : table-cell ;
padding-right : 1em ;
}
combinationcontent,
-context|div.combinationcontent {
+div.combinationcontent {
display : table-row ;
text-align : center ;
}
combinationcaption,
-context|div.combinationcaption {
+div.combinationcaption {
display : table-row ;
padding-top : 1ex ;
text-align : center ;
@@ -722,13 +722,13 @@ context|div.combinationcaption {
/* listtext : inline */
list,
-context|div.list {
+div.list {
display : block ;
text-align : left ;
}
listitem[detail="chapter"],
-context|div.listitem.chapter {
+div.listitem.chapter {
display : block ;
margin-top : 1em ;
margin-left : 5em ;
@@ -736,32 +736,32 @@ context|div.listitem.chapter {
}
listitem[detail="section"],
-context|div.listitem.section {
+div.listitem.section {
display : block ;
margin-left : 5em ;
}
listitem[detail="subsection"],
-context|div.listitem.subsection {
+div.listitem.subsection {
display : block ;
margin-left : 5em ;
}
/*
listitem[detail="subsection"],
-context|div.listitem.subsection {
+div.listitem.subsection {
display : inline-block ;
margin-left : -5em ;
}
listitem[detail="subsection"]>listtag,
-context|div.listitem.subsection context|div.listtag {
+div.listitem.subsection div.listtag {
margin-right : 1em ;
}
*/
listitem[detail="chapter"]>listtag,
-context|div.listitem.chapter > context|div.listtag {
+div.listitem.chapter > div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -769,7 +769,7 @@ context|div.listitem.chapter > context|div.listtag {
}
listitem[detail="section"]>listtag,
-context|div.listitem.section > context|div.listtag {
+div.listitem.section > div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -777,7 +777,7 @@ context|div.listitem.section > context|div.listtag {
}
listitem[detail="subsection"]>listtag,
-context|div.listitem.subsection > context|div.listtag {
+div.listitem.subsection > div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -785,22 +785,22 @@ context|div.listitem.subsection > context|div.listtag {
}
listcontent,
-context|div.listcontent {
+div.listcontent {
display : inline ;
}
listdata,
-context|div.listdata {
+div.listdata {
display : inline ;
}
listpage,
-context|div.listpage {
+div.listpage {
display : none ;
}
listtext,
-context|div.listtext {
+div.listtext {
display : inline ;
}
@@ -816,75 +816,75 @@ context|div.listtext {
delimited[detail="quotation"]:before,
delimitedblock[detail="quotation"]:before,
-context|div.delimited.quotation:before,
-context|div.delimitedblock.quotation:before {
+div.delimited.quotation:before,
+div.delimitedblock.quotation:before {
/* content : "\201C" ; */
font-style : italic ;
}
delimited[detail="quotation"]:after,
delimitedblock[detail="quotation"]:after,
-context|div.delimited.quotation:after,
-context|div.delimitedblock.quotation:after {
+div.delimited.quotation:after,
+div.delimitedblock.quotation:after {
/* content : "\201D" ; */
font-style : italic ;
}
delimited[detail="quote"]:before,
delimitedblock[detail="quote"]:before,
-context|div.delimited.quote:before,
-context|div.delimitedblock.quote:before {
+div.delimited.quote:before,
+div.delimitedblock.quote:before {
/* content : "\2018" ; */
font-style : italic ;
}
delimited[detail="quote"]:after,
delimitedblock[detail="quote"]:after,
-context|div.delimited.quote:after,
-context|div.delimitedblock.quote:after {
+div.delimited.quote:after,
+div.delimitedblock.quote:after {
/* content : "\2019" ; */
font-style : italic ;
}
delimited,
-context|div.delimited {
+div.delimited {
display : inline
}
delimitedcontent,
-context|div.delimitedcontent {
+div.delimitedcontent {
display : inline
}
delimitedsymbol,
-context|div.delimitedsymbol {
+div.delimitedsymbol {
display : inline
}
delimitedblock,
-context|div.delimitedblock {
+div.delimitedblock {
display : block
}
subsentence:before,
subsentence:after,
-context|div.subsentence:before,
-context|div.subsentence:after {
+div.subsentence:before,
+div.subsentence:after {
content : "\2014" ;
}
subsentence,
-context|div.subsentence {
+div.subsentence {
display : inline
}
subsentencecontent,
-context|div.subsentencecontent {
+div.subsentencecontent {
display : inline
}
subsentencesymbol,
-context|div.subsentencesymbol {
+div.subsentencesymbol {
display : inline
}
@@ -899,7 +899,7 @@ context|div.subsentencesymbol {
/* floatcontent : mixed */
float,
-context|div.float {
+div.float {
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -907,33 +907,33 @@ context|div.float {
}
floatcaption,
-context|div.floatcaption {
+div.floatcaption {
display : block ;
margin-top : 0.5em ;
color : rgb(60%,60%,0%) ;
}
floatlabel,
-context|div.floatlabel {
+div.floatlabel {
display : inline-block ;
font-weight : bold ;
margin-right : 0.25em ;
}
floatnumber,
-context|div.floatnumber {
+div.floatnumber {
display : inline ;
font-weight : bold ;
margin-right : 0.25em ;
}
floattext,
-context|div.floattext {
+div.floattext {
display : inline ;
}
floatcontent,
-context|div.floatcontent {
+div.floatcontent {
}
/* image : mixed */
@@ -948,13 +948,13 @@ context|div.floatcontent {
} */
mpgraphic:before,
-context|div.mpgraphic:before {
+div.mpgraphic:before {
/* does not work with empty element */
content : "[runtime metapost graphic]" ;
}
mpgraphic,
-context|div.mpgraphic {
+div.mpgraphic {
display : inline ;
}
@@ -967,15 +967,16 @@ context|div.mpgraphic {
/* formulacontent : display */
formula,
-context|div.formula {
- display : block ;
+div.formula {
+ xdisplay : block ;
+ display : table ;
margin-top : 1em ;
margin-bottom : 1em ;
margin-left : 2.5em ;
}
subformula,
-context|div.subformula { /* todo */
+div.subformula { /* todo */
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -983,7 +984,7 @@ context|div.subformula { /* todo */
}
formulaset,
-context|div.formulaset { /* todo */
+div.formulaset { /* todo */
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -991,32 +992,37 @@ context|div.formulaset { /* todo */
}
formulacaption,
-context|div.formulacaption { /* todo */
- display : block ;
- margin-top : 0.5em ;
- color : rgb(60%,60%,0%) ;
+div.formulacaption { /* todo */
+ xdisplay : block ;
+ display : table-cell ;
+ margin-top : 0.5em ;
+ padding-left : 2em ;
+ color : rgb(60%,60%,0%) ;
}
formulalabel,
-context|div.formulalabel {
+div.formulalabel {
display : inline ;
font-weight : bold ;
margin-right : .25em ;
}
formulanumber,
-context|div.formulanumber {
+div.formulanumber {
display : inline ;
font-weight : bold ;
+ margin-left : 0em ;
}
formulacontent,
-context|div.formulacontent {
- display : block ;
+div.formulacontent {
+ xdisplay : block ;
+ display : table-cell ;
+ margin-left : 0em ;
}
link,
-context|div.link {
+div.link {
display : inline ;
}
@@ -1024,7 +1030,7 @@ context|div.link {
/* margintext : inline */
margintext,
-context|div.margintext {
+div.margintext {
display : block ;
font-weight : bold ;
margin-top : 1em ;
@@ -1032,7 +1038,7 @@ context|div.margintext {
}
margintext:before,
-context|div.margintext:before {
+div.margintext:before {
content : "\25B6\00A0\00A0" ;
color : rgb(40%,40%,40%) ;
}
@@ -1060,12 +1066,12 @@ context|div.margintext:before {
/* mtr : display */
/* mtd : display */
-context|div.math-inline {
+div.math-inline {
display : inline ;
vertical-align : 0 ; /* this will be set directly */
}
-context|div.math-display {
+div.math-display {
display : block ;
margin : 1ex 0ex 1em 3em ;
}
@@ -1074,12 +1080,12 @@ context|div.math-display {
/* pubfld : inline */
publication,
-context|div.publication {
+div.publication {
display : inline ;
}
pubfld[detail="title"],
-context|div.pubfld.title {
+div.pubfld.title {
display : inline ;
font-weight : italic ;
}
@@ -1089,17 +1095,17 @@ context|div.pubfld.title {
/* number : inline */
quantity,
-context|div.quantity {
+div.quantity {
display : inline-block ;
}
quantity>unit,
-context|div.quantity>context|div.unit {
+div.quantity>div.unit {
display : inline ;
}
quantity>number,
-context|div.quantity>context|div.number {
+div.quantity>div.number {
display : inline ;
}
@@ -1108,34 +1114,34 @@ context|div.quantity>context|div.number {
/* subsup : inline */
sup,
-context|div.sup {
+div.sup {
display : inline-block ;
font-size : xx-small ;
vertical-align : super ;
}
sub,
-context|div.sub {
+div.sub {
display : inline-block ;
font-size : xx-small ;
vertical-align : sub ;
}
subsup>sup,
-context|div.subsup>context|div.sup {
+div.subsup>div.sup {
display : inline ;
vertical-align : top ;
}
subsup>sub,
-context|div.subsup>context|div.sub {
+div.subsup>div.sub {
display : inline ;
vertical-align : bottom ;
}
/* links */
-context|div[href]:hover {
+div[href]:hover {
color : rgb(50%,0%,0%) ;
background-color : rgb(85%,85%,85%) ;
}
@@ -1143,12 +1149,12 @@ context|div[href]:hover {
/* setups */
setup,
-context|div.setup {
+div.setup {
display : block ;
}
comment,
-context|div.comment {
+div.comment {
background-color : rgb(50%,75%,100%) ;
display : block ;
padding : 1em ;
@@ -1160,18 +1166,18 @@ context|div.comment {
/* blocks */
block,
-context|div.block {
+div.block {
display : block ;
}
/* special */
c,
-context|div.c {
+div.c {
display : inline ;
}
warning,
-context|div.warning {
+div.warning {
display : none ;
}
diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv
index ca6cccf73..a955e9284 100644
--- a/tex/context/base/mkiv/math-ini.mkiv
+++ b/tex/context/base/mkiv/math-ini.mkiv
@@ -340,14 +340,14 @@
% For the moment this way:
-\appendtoks
- \setmathprepenalty \mathbinarycode \defaultdisplayprepenalty
- % \setmathpostpenalty\mathbinarycode \zerocount
- \setmathprepenalty \mathrelationcode \defaultdisplayprepenalty
- % \setmathpostpenalty\mathrelationcode \zerocount
- \setmathpostpenalty\mathtextpunctuationcode\defaultdisplayprepenalty
- % \setmathprepenalty \mathtextpunctuationcode\zerocount
-\to \everybeforedisplayformula
+% \appendtoks
+% \setmathprepenalty \mathbinarycode \defaultdisplayprepenalty
+% % \setmathpostpenalty\mathbinarycode \zerocount
+% \setmathprepenalty \mathrelationcode \defaultdisplayprepenalty
+% % \setmathpostpenalty\mathrelationcode \zerocount
+% \setmathpostpenalty\mathtextpunctuationcode\defaultdisplayprepenalty
+% % \setmathprepenalty \mathtextpunctuationcode\zerocount
+% \to \everybeforedisplayformula
% we need to control these otherwise:
%
diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua
index 87e325c41..f73d41e93 100644
--- a/tex/context/base/mkiv/mult-def.lua
+++ b/tex/context/base/mkiv/mult-def.lua
@@ -7408,6 +7408,12 @@ return {
["en"]="alignbottom",
["fr"]="alignerbas",
},
+ ["topalign"]={
+ ["en"]="topalign",
+ },
+ ["bottomalign"]={
+ ["en"]="bottomalign",
+ },
["aligncharacter"]={
["cs"]="aligncharacter",
["de"]="aligncharacter",
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index 3a78c719d..ffd71ea41 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -191,7 +191,7 @@ return {
"zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj",
"optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace",
--
- "Ux", "eUx", "Umathaccents",
+ "Ux", "eUx",
--
"parfillleftskip", "parfillrightskip",
--
@@ -501,53 +501,53 @@ return {
--
"shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox",
--
- "ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing",
- "ordopenspacing", "ordclosespacing", "ordpunctspacing", "ordinnerspacing",
- "ordfracspacing", "ordradspacing", "ordmiddlespacing", "ordaccentspacing",
- --
- "opordspacing", "opopspacing", "opbinspacing", "oprelspacing",
- "opopenspacing", "opclosespacing", "oppunctspacing", "opinnerspacing",
- "opfracspacing", "opradspacing", "opmiddlespacing", "opaccentspacing",
- --
- "binordspacing", "binopspacing", "binbinspacing", "binrelspacing",
- "binopenspacing", "binclosespacing", "binpunctspacing", "bininnerspacing",
- "binfracspacing", "binradspacing", "binmiddlespacing", "binaccentspacing",
- --
- "relordspacing", "relopspacing", "relbinspacing", "relrelspacing",
- "relopenspacing", "relclosespacing", "relpunctspacing", "relinnerspacing",
- "relfracspacing", "relradspacing", "relmiddlespacing", "relaccentspacing",
- --
- "openordspacing", "openopspacing", "openbinspacing", "openrelspacing",
- "openopenspacing", "openclosespacing", "openpunctspacing", "openinnerspacing",
- "openfracspacing", "openradspacing", "openmiddlespacing", "openaccentspacing",
- --
- "closeordspacing", "closeopspacing", "closebinspacing", "closerelspacing",
- "closeopenspacing", "closeclosespacing", "closepunctspacing", "closeinnerspacing",
- "closefracspacing", "closeradspacing", "closemiddlespacing", "closeaccentspacing",
- --
- "punctordspacing", "punctopspacing", "punctbinspacing", "punctrelspacing",
- "punctopenspacing", "punctclosespacing", "punctpunctspacing", "punctinnerspacing",
- "punctfracspacing", "punctradspacing", "punctmiddlespacing", "punctaccentspacing",
- --
- "innerordspacing", "inneropspacing", "innerbinspacing", "innerrelspacing",
- "inneropenspacing", "innerclosespacing", "innerpunctspacing", "innerinnerspacing",
- "innerfracspacing", "innerradspacing", "innermiddlespacing", "inneraccentspacing",
- --
- "fracordspacing", "fracopspacing", "fracbinspacing", "fracrelspacing",
- "fracopenspacing", "fracclosespacing", "fracpunctspacing", "fracinnerspacing",
- "fracfracspacing", "fracradspacing", "fracmiddlespacing", "fracaccentspacing",
- --
- "radordspacing", "radopspacing", "radbinspacing", "radrelspacing",
- "radopenspacing", "radclosespacing", "radpunctspacing", "radinnerspacing",
- "radfracspacing", "radradspacing", "radmiddlespacing", "radaccentspacing",
- --
- "middleordspacing", "middleopspacing", "middlebinspacing", "middlerelspacing",
- "middleopenspacing", "middleclosespacing", "middlepunctspacing", "middleinnerspacing",
- "middlefracspacing", "middleradspacing", "middlemiddlespacing", "middleaccentspacing",
- --
- "accentordspacing", "accentopspacing", "accentbinspacing", "accentrelspacing",
- "accentopenspacing", "accentclosespacing", "accentpunctspacing", "accentinnerspacing",
- "accentfracspacing", "accentradspacing", "accentmiddlespacing", "accentaccentspacing",
+ -- "ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing",
+ -- "ordopenspacing", "ordclosespacing", "ordpunctspacing", "ordinnerspacing",
+ -- "ordfracspacing", "ordradspacing", "ordmiddlespacing", "ordaccentspacing",
+ -- --
+ -- "opordspacing", "opopspacing", "opbinspacing", "oprelspacing",
+ -- "opopenspacing", "opclosespacing", "oppunctspacing", "opinnerspacing",
+ -- "opfracspacing", "opradspacing", "opmiddlespacing", "opaccentspacing",
+ -- --
+ -- "binordspacing", "binopspacing", "binbinspacing", "binrelspacing",
+ -- "binopenspacing", "binclosespacing", "binpunctspacing", "bininnerspacing",
+ -- "binfracspacing", "binradspacing", "binmiddlespacing", "binaccentspacing",
+ -- --
+ -- "relordspacing", "relopspacing", "relbinspacing", "relrelspacing",
+ -- "relopenspacing", "relclosespacing", "relpunctspacing", "relinnerspacing",
+ -- "relfracspacing", "relradspacing", "relmiddlespacing", "relaccentspacing",
+ -- --
+ -- "openordspacing", "openopspacing", "openbinspacing", "openrelspacing",
+ -- "openopenspacing", "openclosespacing", "openpunctspacing", "openinnerspacing",
+ -- "openfracspacing", "openradspacing", "openmiddlespacing", "openaccentspacing",
+ -- --
+ -- "closeordspacing", "closeopspacing", "closebinspacing", "closerelspacing",
+ -- "closeopenspacing", "closeclosespacing", "closepunctspacing", "closeinnerspacing",
+ -- "closefracspacing", "closeradspacing", "closemiddlespacing", "closeaccentspacing",
+ -- --
+ -- "punctordspacing", "punctopspacing", "punctbinspacing", "punctrelspacing",
+ -- "punctopenspacing", "punctclosespacing", "punctpunctspacing", "punctinnerspacing",
+ -- "punctfracspacing", "punctradspacing", "punctmiddlespacing", "punctaccentspacing",
+ -- --
+ -- "innerordspacing", "inneropspacing", "innerbinspacing", "innerrelspacing",
+ -- "inneropenspacing", "innerclosespacing", "innerpunctspacing", "innerinnerspacing",
+ -- "innerfracspacing", "innerradspacing", "innermiddlespacing", "inneraccentspacing",
+ -- --
+ -- "fracordspacing", "fracopspacing", "fracbinspacing", "fracrelspacing",
+ -- "fracopenspacing", "fracclosespacing", "fracpunctspacing", "fracinnerspacing",
+ -- "fracfracspacing", "fracradspacing", "fracmiddlespacing", "fracaccentspacing",
+ -- --
+ -- "radordspacing", "radopspacing", "radbinspacing", "radrelspacing",
+ -- "radopenspacing", "radclosespacing", "radpunctspacing", "radinnerspacing",
+ -- "radfracspacing", "radradspacing", "radmiddlespacing", "radaccentspacing",
+ -- --
+ -- "middleordspacing", "middleopspacing", "middlebinspacing", "middlerelspacing",
+ -- "middleopenspacing", "middleclosespacing", "middlepunctspacing", "middleinnerspacing",
+ -- "middlefracspacing", "middleradspacing", "middlemiddlespacing", "middleaccentspacing",
+ -- --
+ -- "accentordspacing", "accentopspacing", "accentbinspacing", "accentrelspacing",
+ -- "accentopenspacing", "accentclosespacing", "accentpunctspacing", "accentinnerspacing",
+ -- "accentfracspacing", "accentradspacing", "accentmiddlespacing", "accentaccentspacing",
--
"normalreqno",
--
@@ -597,8 +597,6 @@ return {
--
"assumelongusagecs",
--
- "Umathbottomaccent", "Umathtopaccent", "Umathbotaccent",
- --
"righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop",
"rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop",
"autodirhbox", "autodirvbox", "autodirvtop",
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index c3f5c3f1a..410d67a69 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -293,6 +293,7 @@ return {
"boxsource",
"boxtarget",
"boxtotal",
+ "boxvadjust",
"boxxmove",
"boxxoffset",
"boxymove",
@@ -322,6 +323,7 @@ return {
"dimexpression",
"directlua",
"dpack",
+ "dsplit",
"edefcsname",
"efcode",
"endlocalcontrol",
@@ -401,7 +403,9 @@ return {
"ifarguments",
"ifboolean",
"ifchkdim",
+ "ifchkdimension",
"ifchknum",
+ "ifchknumber",
"ifcmpdim",
"ifcmpnum",
"ifcondition",
@@ -517,7 +521,7 @@ return {
"mathfenced",
"mathfontcontrol",
"mathforwardpenalties",
- "mathfrac",
+ "mathfraction",
"mathghost",
"mathgluemode",
"mathgroupingmode",
@@ -527,7 +531,7 @@ return {
"mathmiddle",
"mathnolimitsmode",
"mathpenaltiesmode",
- "mathrad",
+ "mathradical",
"mathrightclass",
"mathrulesfam",
"mathrulesmode",
@@ -651,6 +655,7 @@ return {
"tracingmath",
"tracingnodes",
"tracingpenalties",
+ "tsplit",
"uleaders",
"undent",
"unexpandedloop",
@@ -847,7 +852,6 @@ return {
"divideby",
"doublehyphendemerits",
"dp",
- "dsplit",
"dump",
"edef",
"else",
@@ -1078,7 +1082,6 @@ return {
"tracingparagraphs",
"tracingrestores",
"tracingstats",
- "tsplit",
"uccode",
"uchyph",
"unboundary",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 0b5d11035..d1ff492f2 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index ee5dbae6e..a28499680 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkxl/anch-pos.lmt b/tex/context/base/mkxl/anch-pos.lmt
index 6488a2fd7..79a0da097 100644
--- a/tex/context/base/mkxl/anch-pos.lmt
+++ b/tex/context/base/mkxl/anch-pos.lmt
@@ -1727,7 +1727,7 @@ local function overlapping(one,two,overlappingmargin) -- hm, strings so this is
end
local function onsamepage(list,page)
- for id in gmatch(list,"(, )") do
+ for id in gmatch(list,"([^,%s]+)") do
local jpi = collected[id]
if jpi then
local p = jpi.p
diff --git a/tex/context/base/mkxl/anch-pos.mkxl b/tex/context/base/mkxl/anch-pos.mkxl
index ecb2091c6..a1e0cc354 100644
--- a/tex/context/base/mkxl/anch-pos.mkxl
+++ b/tex/context/base/mkxl/anch-pos.mkxl
@@ -508,10 +508,10 @@
%D positions being on the same page.
%D
%D \starttyping
-%D \doifpositionsonsamepageelse{point a}{point b}
+%D \doifpositionsonsamepageelse{point a,point b}
%D {action when on same page}
%D {action when not on same page}
-%D \doifpositionsonthispageelse{point a}{point b}
+%D \doifpositionsonthispageelse{point a,point b}
%D {action when on this page}
%D {action when not on this page}
%D \stoptyping
diff --git a/tex/context/base/mkxl/back-exp-imp-mth.lmt b/tex/context/base/mkxl/back-exp-imp-mth.lmt
index a70ea8511..5f1554e65 100644
--- a/tex/context/base/mkxl/back-exp-imp-mth.lmt
+++ b/tex/context/base/mkxl/back-exp-imp-mth.lmt
@@ -167,7 +167,16 @@ do
if data then
local ndata = #data
local roottg = root.tg
- if roottg == "msubsup" then
+ if roottg == "mo" then
+ local s = specifications[root.fulltag]
+ local c = s.class
+ if c == "open" or c == "close" or c == "middle" then
+ root.attributes = {
+ maxsize = 1
+ }
+ end
+
+ elseif roottg == "msubsup" then
-- kind of tricky: we have a diufferent order in display mode
local nucleus, superscript, subscript
if ndata > 3 then
@@ -211,25 +220,33 @@ do
-- end
elseif roottg == "mfenced" then
local s = specifications[root.fulltag]
- local l, m, r = s.left, s.middle, s.right
- if l then
- l = utfchar(l)
- end
- if m then
- local t = { }
- for i=1,#m do
- t[i] = utfchar(m[i])
+ local o = s.operator
+ if o then
+ root.skip = "comment"
+ -- root.content = utfchar(o) -- use embedded for now
+ else
+ local l = s.left
+ local m = s.middle
+ local r = s.right
+ if l then
+ l = utfchar(l)
end
- m = concat(t)
- end
- if r then
- r = utfchar(r)
+ if m then
+ local t = { }
+ for i=1,#m do
+ t[i] = utfchar(m[i])
+ end
+ m = concat(t)
+ end
+ if r then
+ r = utfchar(r)
+ end
+ root.attributes = {
+ open = l,
+ separators = m,
+ close = r,
+ }
end
- root.attributes = {
- open = l,
- separators = m,
- close = r,
- }
end
if ndata == 0 then
root.skip = "comment" -- get rid of weird artefacts
@@ -628,8 +645,9 @@ do
local specification = specifications[di.fulltag]
local mode = specification and specification.mode == "display" and "block" or "inline"
di.attributes = {
- ["display"] = mode,
- ["xmlns:m"] = mathmlns,
+ ["display"] = mode,
+ ["xmlns:m"] = mathmlns,
+ ["xmlns:math"] = mathmlns,
}
-- can be option if needed:
if mode == "inline" then
diff --git a/tex/context/base/mkxl/back-exp.lmt b/tex/context/base/mkxl/back-exp.lmt
index 766f30169..622aae435 100644
--- a/tex/context/base/mkxl/back-exp.lmt
+++ b/tex/context/base/mkxl/back-exp.lmt
@@ -44,6 +44,7 @@ local formatters = string.formatters
local todimen = number.todimen
local replacetemplate = utilities.templates.replace
local settings_to_array = utilities.parsers.settings_to_array
+local settings_to_hash = utilities.parsers.settings_to_hash
local addsuffix, joinfile, nameonly, basename, filesuffix = file.addsuffix, file.join, file.nameonly, file.basename, file.suffix
@@ -1957,7 +1958,18 @@ local cssheadlink = [[
<link type="text/css" rel="stylesheet" href="%filename%" />
]]
- local function allusedstylesheets(cssfiles,files,path)
+-- great, these suggested valuess attributes
+
+local mathmlheadscript = [[
+<script
+ type="text/javascript"
+ id="MathJax-script"
+ async="async"
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js">
+</script>
+]]
+
+ local function allusedstylesheets(cssfiles,files,path,extra)
local done = { }
local result = { }
local extras = { }
@@ -1976,6 +1988,9 @@ local cssheadlink = [[
done[cssfile] = true
end
end
+ if extra then
+ extras[#extras+1] = extra
+ end
return concat(result), concat(extras)
end
@@ -2278,11 +2293,16 @@ local htmltemplate <const> = [[
if not c.special then
local tg = c.tg
local ns = c.ns
+ local at = c.at
if ns == "m" then
- if false then -- yes or no
+ -- should happen elsewhere
+ -- if false then -- yes or no
c.ns = ""
- c.at["xmlns:m"] = nil
- end
+ at["xmlns:m"] = nil
+ if tg == "math" then
+ at["xmlns"] = mathmlns
+ end
+ -- end
-- elseif tg == "a" then
-- c.ns = ""
else
@@ -2296,7 +2316,6 @@ local htmltemplate <const> = [[
comment = c.dt
end
end
- local at = c.at
local class = nil
local label = nil
if tg == "document" then
@@ -2630,7 +2649,10 @@ local htmltemplate <const> = [[
end
end
- local x_styles, h_styles = allusedstylesheets(cssfiles,files,"styles")
+
+ local script = settings_to_hash(finetuning.option or "").mathjax and mathmlheadscript or nil
+
+ local x_styles, h_styles = allusedstylesheets(cssfiles,files,"styles",script)
local attach = backends.nodeinjections.attachfile
@@ -2807,6 +2829,7 @@ implement {
{ "svgstyle" },
{ "cssfile" },
{ "file" },
+ { "option" },
{ "export" },
}
}
diff --git a/tex/context/base/mkxl/back-exp.mkxl b/tex/context/base/mkxl/back-exp.mkxl
index ff0602aee..cafbb938f 100644
--- a/tex/context/base/mkxl/back-exp.mkxl
+++ b/tex/context/base/mkxl/back-exp.mkxl
@@ -327,6 +327,7 @@
svgstyle {\exportparameter\c!svgstyle}%
cssfile {\exportparameter\c!cssfile}%
file {\exportparameter\c!file}%
+ option {\exportparameter\c!option}%
export {\backendparameter\c!export}%
\relax}
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index c6fec2f2e..26913598c 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{2023.01.05 17:43}
+\newcontextversion{2023.01.15 13:53}
%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 b84e3b86d..38c897e6d 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{2023.01.05 17:43}
+\immutable\edef\contextversion{2023.01.15 13:53}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/core-uti.lmt b/tex/context/base/mkxl/core-uti.lmt
index d533de5f3..8ce0cca4a 100644
--- a/tex/context/base/mkxl/core-uti.lmt
+++ b/tex/context/base/mkxl/core-uti.lmt
@@ -18,8 +18,8 @@ saves much runtime but at the cost of more memory usage.</p>
--ldx]]--
local math = math
+local next, type, tostring, tonumber, setmetatable, load = next, type, tostring, tonumber, setmetatable, load
local format, match = string.format, string.match
-local next, type, tostring, tonumber, setmetatable = next, type, tostring, tonumber, setmetatable
local concat = table.concat
local definetable = utilities.tables.definetable
@@ -280,10 +280,12 @@ job.pack = true
directives.register("job.pack",function(v) job.pack = v end)
-local _save_, _load_, _others_ = { }, { }, { } -- registers timing
+local savedfiles = { }
+local loadedfiles = { } -- for now only timers
+local otherfiles = { } -- for now only timers
function job.save(filename) -- we could return a table but it can get pretty large
- statistics.starttiming(_save_)
+ statistics.starttiming(savedfiles)
local f = io.open(filename,'w')
if f then
f:write("local utilitydata = { }\n\n")
@@ -318,7 +320,7 @@ function job.save(filename) -- we could return a table but it can get pretty lar
f:write("return utilitydata")
f:close()
end
- statistics.stoptiming(_save_)
+ statistics.stoptiming(savedfiles)
end
local function load(filename)
@@ -350,11 +352,11 @@ local function load(filename)
end
function job.load(filename)
- statistics.starttiming(_load_)
+ statistics.starttiming(loadedfiles)
local utilitydata = load(filename)
if utilitydata then
local jobpacker = utilitydata.job.packed
-unpacknumberdata(jobpacker.index)
+ unpacknumberdata(jobpacker.index)
for i=1,#savelist do
local list = savelist[i]
local target = list[1]
@@ -376,29 +378,43 @@ unpacknumberdata(jobpacker.index)
initializer(utilitydata and accesstable(list[1],utilitydata) or nil)
end
end
- statistics.stoptiming(_load_)
+ statistics.stoptiming(loadedfiles)
end
-function job.loadother(filename)
- statistics.starttiming(_load_)
- _others_[#_others_+1] = file.nameonly(filename)
- local utilitydata = load(filename)
- if utilitydata then
- local jobpacker = utilitydata.job.packed
- local unpacked = { }
- for l=1,#savelist do
- local list = savelist[l]
- local target = list[1]
- local result = accesstable(target,utilitydata)
- local done = packers.unpack(result,jobpacker,true)
- if done then
- migratetable(target,result,unpacked)
+local othercache = { }
+
+function job.loadother(filename,cache)
+ local unpacked = false
+ statistics.starttiming(loadedfiles)
+ filename = file.addsuffix(filename,"tuc")
+ if cache then
+ unpacked = othercache[filename]
+ end
+ if not unpacked then
+ -- so we can register the same name twice(in loading order)
+ otherfiles[#otherfiles+1] = file.nameonly(filename)
+ local utilitydata = load(filename)
+ if utilitydata then
+ local jobpacker = utilitydata.job.packed
+ unpacknumberdata(jobpacker.index)
+ unpacked = { }
+ for l=1,#savelist do
+ local list = savelist[l]
+ local target = list[1]
+ local result = accesstable(target,utilitydata)
+ local done = packers.unpack(result,jobpacker,true)
+ if done then
+ migratetable(target,result,unpacked)
+ end
+ end
+ unpacked.job.packed = nil -- nicer in inspecting
+ if cache then
+ cache[filename] = unpacked
end
end
- unpacked.job.packed = nil -- nicer in inspecting
- return unpacked
end
- statistics.stoptiming(_load_)
+ statistics.stoptiming(loadedfiles)
+ return unpacked
end
statistics.register("startup time", function()
@@ -407,16 +423,16 @@ end)
statistics.register("jobdata time",function()
if enabled then
- if #_others_ > 0 then
- return format("%s seconds saving, %s seconds loading, other files: %s",statistics.elapsedtime(_save_),statistics.elapsedtime(_load_),concat(_others_," "))
+ if #otherfiles > 0 then
+ return format("%s seconds saving, %s seconds loading, other files: %s",statistics.elapsedtime(savedfiles),statistics.elapsedtime(loadedfiles),concat(otherfiles," "))
else
- return format("%s seconds saving, %s seconds loading",statistics.elapsedtime(_save_),statistics.elapsedtime(_load_))
+ return format("%s seconds saving, %s seconds loading",statistics.elapsedtime(savedfiles),statistics.elapsedtime(loadedfiles))
end
else
- if #_others_ > 0 then
- return format("nothing saved, %s seconds loading, other files: %s",statistics.elapsedtime(_load_),concat(_others_," "))
+ if #otherfiles > 0 then
+ return format("nothing saved, %s seconds loading, other files: %s",statistics.elapsedtime(loadedfiles),concat(otherfiles," "))
else
- return format("nothing saved, %s seconds loading",statistics.elapsedtime(_load_))
+ return format("nothing saved, %s seconds loading",statistics.elapsedtime(loadedfiles))
end
end
end)
diff --git a/tex/context/base/mkxl/font-ini.mklx b/tex/context/base/mkxl/font-ini.mklx
index 6647bd061..6efae2ae1 100644
--- a/tex/context/base/mkxl/font-ini.mklx
+++ b/tex/context/base/mkxl/font-ini.mklx
@@ -1175,7 +1175,8 @@
% \def\v_font_identifier_class{\??fontinstanceclass\fontclass-\lastfontidentifier-\fontstyle-\fontsize} % no \fontface
\def\font_basics_define_font_without_parameters#identifier#2%
- {\c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly
+ {\relax % intercept lookahead, in case we scan for a number
+ \c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly
\edef\lastfontidentifier{#identifier}%
\let\v_font_size_relative\v_font_rscale_default
\let\v_font_size_absolute\fontbody
diff --git a/tex/context/base/mkxl/font-mat.mklx b/tex/context/base/mkxl/font-mat.mklx
index 11917efe6..33a9f3623 100644
--- a/tex/context/base/mkxl/font-mat.mklx
+++ b/tex/context/base/mkxl/font-mat.mklx
@@ -512,7 +512,25 @@
\permanent\protected\def\mx {\ifmmode\scaledmathstyle\dimexpression\plusthousand*(\xtextface /\textface)\relax\fi}
\permanent\protected\def\mxx{\ifmmode\scaledmathstyle\dimexpression\plusthousand*(\xxtextface/\textface)\relax\fi}
-\permanent\protected\def\setmscale#1{\ifmmode\scaledmathstyle\numericscale#1\relax\fi}
+% permanent\protected\def\setmscale#1{\ifmmode\scaledmathstyle\numericscale#1\relax\fi}
+
+\installcorenamespace{mscaled}
+
+\mutable\def\mathscalefactor{0.7} % 1/sqrt(2} = 0.70710678118655
+
+\newinteger\c_math_m_scaled \c_math_m_scaled\plusthousand
+
+\permanent\protected\def\setmscale#1%
+ {\ifmmode
+ \iftok{#1}{-}%
+ \c_math_m_scaled\numexpr(\numericscale\mathscalefactor)*\c_math_m_scaled/\plusthousand\relax
+ \orelse\iftok{#1}{=}%
+ \c_math_m_scaled\plusthousand
+ \else
+ \c_math_m_scaled\numericscale#1\relax
+ \fi
+ \scaledmathstyle\c_math_m_scaled
+ \fi}
%D This is nasty, as the engine only stores the last set family parameters (per style) which
%D in our case can be bold.
diff --git a/tex/context/base/mkxl/lang-ini.mkxl b/tex/context/base/mkxl/lang-ini.mkxl
index 93b991e44..1f4b741c2 100644
--- a/tex/context/base/mkxl/lang-ini.mkxl
+++ b/tex/context/base/mkxl/lang-ini.mkxl
@@ -210,7 +210,7 @@
\fi}
\def\lang_basics_install_indeed#1#2%
- {\ifcstok{\specificlanguageparameter{#1}\c!command}\v!no\orelse\ifcsname#1\endcsname\else
+ {\ifcstok{\specificlanguageparameter{#1}\c!define}\v!no\orelse\ifcsname#1\endcsname\else
\frozen\instance\protected\defcsname#1\endcsname{\lang_basics_set_current[#2]}%
\fi}
diff --git a/tex/context/base/mkxl/lpdf-grp.lmt b/tex/context/base/mkxl/lpdf-grp.lmt
index 48853ab83..585d11459 100644
--- a/tex/context/base/mkxl/lpdf-grp.lmt
+++ b/tex/context/base/mkxl/lpdf-grp.lmt
@@ -177,10 +177,12 @@ do
return wrapimage(image)
end
- local zlibcompress = xzip.compress
- local lpegmatch = lpeg.match
- local compresslevel = 3
- local pattern = lpeg.Cs((lpeg.patterns.space/"" + lpeg.patterns.hextobyte)^0)
+ -- local lpegmatch = lpeg.match
+ -- local pattern = lpeg.Cs((lpeg.patterns.space/"" + lpeg.patterns.hextobyte)^0)
+
+ local zlibcompress = xzip.compress
+ local hextocharacters = string.hextocharacters
+ local compresslevel = 3
methods.png = function(t)
-- encoding is ascii hex, no checking here
@@ -190,20 +192,36 @@ do
if xresolution == 0 or yresolution == 0 or data == "" then
return -- fatal error
end
+ data = hextocharacters(data)
+ if not data then
+ return
+ end
local colorspace = t.colorspace
local colordepth = 8
local colors = 1
+-- if colorspace ~= "rgb" and colorspace ~= "gray" then
+-- -- not that efficient but ok
+-- local d = gsub(t.data,"[^0-9a-f]","")
+-- local b = round(#d / (xresolution * yresolution))
+-- if b == 2 then
+-- colorspace = "gray"
+-- colors = 1
+-- elseif b == 6 then
+-- colorspace = "rgb"
+-- colors = 3
+-- elseif b == 8 then
+-- return -- for now, todo: convert
+-- end
+-- end
if colorspace ~= "rgb" and colorspace ~= "gray" then
- -- not that efficient but ok
- local d = gsub(t.data,"[^0-9a-f]","")
- local b = round(#d / (xresolution * yresolution))
- if b == 2 then
+ local b = round(#data / (xresolution * yresolution))
+ if b == 1 then
colorspace = "gray"
colors = 1
- elseif b == 6 then
+ elseif b == 3 then
colorspace = "rgb"
colors = 3
- elseif b == 8 then
+ elseif b == 4 then
return -- for now, todo: convert
end
end
@@ -221,7 +239,8 @@ do
elseif height == 0 then
height = width * yresolution / xresolution
end
- data = zlibcompress(lpegmatch(pattern,data),compresslevel)
+ -- data = zlibcompress(lpegmatch(pattern,data),compresslevel)
+ data = zlibcompress(data,compresslevel)
local xobject = pdfdictionary {
Type = pdfconstant("XObject"),
Subtype = pdfconstant("Image"),
diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt
index 62645ba54..adfb5712c 100644
--- a/tex/context/base/mkxl/math-act.lmt
+++ b/tex/context/base/mkxl/math-act.lmt
@@ -2742,9 +2742,21 @@ do
local nps = fonts.helpers.newprivateslot
local list = {
- { 0x0302, nps("delimited right hat"), nps("delimited ghost hat") },
- { 0x0303, nps("delimited right tilde"), nps("delimited ghost tilde") },
- { 0x030C, nps("delimited right check"), nps("delimited ghost check") },
+ -- { 0x0300, nps("delimited right grave"), nps("delimited ghost grave") },
+ { 0x0308, nps("delimited right ddot"), nps("delimited ghost ddot") },
+ { 0x0304, nps("delimited right bar"), nps("delimited ghost bar") },
+ -- { 0x0301, nps("delimited right acute"), nps("delimited ghost acute") },
+ { 0x0302, nps("delimited right hat"), nps("delimited ghost hat") },
+ { 0x030C, nps("delimited right check"), nps("delimited ghost check") },
+ { 0x0306, nps("delimited right breve"), nps("delimited ghost breve") },
+ { 0x0307, nps("delimited right dot"), nps("delimited ghost dot") },
+ { 0x030A, nps("delimited right ring"), nps("delimited ghost ring") },
+ { 0x0303, nps("delimited right tilde"), nps("delimited ghost tilde") },
+ { 0x20DB, nps("delimited right dddot"), nps("delimited ghost dddot") },
+ { 0x2020, nps("delimited right dagger"), nps("delimited ghost dagger") },
+ { 0x2021, nps("delimited right ddagger"), nps("delimited ghost ddagger") },
+ { 0x2217, nps("delimited right ast"), nps("delimited ghost ast") },
+ { 0x22C6, nps("delimited right star"), nps("delimited ghost star") },
}
function mathtweaks.addfourier(target,original,parameters)
diff --git a/tex/context/base/mkxl/math-dld.mklx b/tex/context/base/mkxl/math-dld.mklx
index 33849e723..66100e0ac 100644
--- a/tex/context/base/mkxl/math-dld.mklx
+++ b/tex/context/base/mkxl/math-dld.mklx
@@ -43,7 +43,9 @@
\c!rightmargin=\zeropoint]
\appendtoks
- \frozen\protected\instance\edefcsname\currentmathdelimited\endcsname{\math_delimited_handle{\currentmathdelimited}}
+ \ifcstok{\mathdelimitedparameter\c!rightmargin}\v!no\else
+ \frozen\protected\instance\edefcsname\currentmathdelimited\endcsname{\math_delimited_handle{\currentmathdelimited}}
+ \fi
\to \everydefinemathdelimited
\mutable\lettonothing\currentmathdelimited
@@ -86,11 +88,108 @@
{\popcolor#body}%
\fi}
-\integerdef\delimitedrighthatuc \privatecharactercode{delimited right hat}
-\integerdef\delimitedrighttildeuc \privatecharactercode{delimited right tilde}
-\integerdef\delimitedrightcheckuc \privatecharactercode{delimited right check}
+
+%integerdef\delimitedrightgraveuc \privatecharactercode{delimited right grave}
+\integerdef\delimitedrightddotuc \privatecharactercode{delimited right ddot}
+\integerdef\delimitedrightbaruc \privatecharactercode{delimited right bar}
+%integerdef\delimitedrightacuteuc \privatecharactercode{delimited right acute}
+\integerdef\delimitedrighthatuc \privatecharactercode{delimited right hat}
+\integerdef\delimitedrightcheckuc \privatecharactercode{delimited right check}
+\integerdef\delimitedrightbreveuc \privatecharactercode{delimited right breve}
+\integerdef\delimitedrightdotuc \privatecharactercode{delimited right dot}
+\integerdef\delimitedrightringuc \privatecharactercode{delimited right ring}
+\integerdef\delimitedrighttildeuc \privatecharactercode{delimited right tilde}
+\integerdef\delimitedrightdddotuc \privatecharactercode{delimited right dddot}
+\integerdef\delimitedrightdaggeruc \privatecharactercode{delimited right dagger}
+\integerdef\delimitedrightddaggeruc \privatecharactercode{delimited right ddagger}
+\integerdef\delimitedrightastuc \privatecharactercode{delimited right ast}
+\integerdef\delimitedrightstaruc \privatecharactercode{delimited right star}
+
+% \integerdef\delimitedrighthatuc \p rivatecharactercode{delimited right hat}
+% \integerdef\delimitedrighttildeuc \privatecharactercode{delimited right tilde}
+% \integerdef\delimitedrightcheckuc \privatecharactercode{delimited right check}
% todo: some more .. are the offsets okay?
+% breve and acute does not make sense
+
+\definemathdelimited
+ [marked]
+ [\c!command=\v!no,
+ \c!topoffset=.2\exheight]
+
+\definemathdelimited
+ [ddotmarked]
+ [marked]
+ [\c!right=\delimitedrightddotuc]
+
+\definemathdelimited
+ [barmarked]
+ [marked]
+ [\c!right=\delimitedrightbaruc]
+
+\definemathdelimited
+ [hatmarked]
+ [marked]
+ [\c!right=\delimitedrighthatuc]
+
+\definemathdelimited
+ [checkmarked]
+ [marked]
+ [\c!right=\delimitedrightcheckuc]
+
+\definemathdelimited
+ [brevemarked]
+ [marked]
+ [\c!right=\delimitedrightbreveuc]
+
+\definemathdelimited
+ [dotmarked]
+ [marked]
+ [\c!right=\delimitedrightdotuc]
+
+\definemathdelimited
+ [ringmarked]
+ [marked]
+ [\c!right=\delimitedrightringuc]
+
+\definemathdelimited
+ [tildemarked]
+ [marked]
+ [\c!right=\delimitedrighttildeuc]
+
+\definemathdelimited
+ [dddotmarked]
+ [marked]
+ [\c!right=\delimitedrightdddotuc]
+
+% The following ones are
+% not really belonging here,
+% but convenient
+
+\definemathdelimited
+ [daggermarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightdaggeruc]
+
+\definemathdelimited
+ [ddaggermarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightddaggeruc]
+
+\definemathdelimited
+ [astmarked]
+ [\c!size=1,
+ \c!right=\delimitedrightastuc]
+
+\definemathdelimited
+ [starmarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightstaruc]
+
+% More contextual
\definemathdelimited
[fourier]
diff --git a/tex/context/base/mkxl/math-fen.mkxl b/tex/context/base/mkxl/math-fen.mkxl
index 806581b34..1656f4b4a 100644
--- a/tex/context/base/mkxl/math-fen.mkxl
+++ b/tex/context/base/mkxl/math-fen.mkxl
@@ -154,7 +154,7 @@
\newinteger \c_math_fence_check
\protected\def\math_fenced_common#1#2#3#4% \Uwhatever class symbol source
- {\c_math_fenced_class\mathfenceparameter#2\relax
+ {\c_math_fenced_class\math_class_by_parameter\mathfenceparameter#2%
\math_fenced_check_size_mismatch % we need to catch an unbalanced \F as we are sequential
\ifconditional\c_math_fenced_sized
\orelse\ifconditional\c_math_fenced_level_mode
@@ -184,9 +184,9 @@
\Uvextensible
\else
#1% \Uleft \Umiddle \Uleft
- \ifx#1\Umiddle
- nooverflow %
- \fi
+ \ifx#1\Umiddle
+ nooverflow %
+ \fi
\fi
\orelse\ifx\p_factor\v!auto
\ifconditional\c_math_fenced_level_mode
@@ -213,7 +213,7 @@
\orelse\ifempty\p_mathclass
\c_math_fenced_class
\else
- \p_mathclass
+ \mathcodechecked\p_mathclass
\fi
\s!source
\numexpr\namedboxanchor{\mathfenceparameter#4}\relax
@@ -339,7 +339,7 @@
% \definemathfence [tupdownarrows] [text] [\c!left="2191,\c!right="2193]
\protected\def\math_fenced_horizontal_common#1#2#3#4% \Uwhatever class symbol source
- {\c_math_fenced_class\mathfenceparameter#2\relax
+ {\c_math_fenced_class\math_class_by_parameter\mathfenceparameter#2\relax
\edef\p_fence{#3}%
#1% \Uleft \Umiddle \Uleft
\usedcolorparameterattributes{\mathfenceparameter\c!color}%
diff --git a/tex/context/base/mkxl/math-frc.mkxl b/tex/context/base/mkxl/math-frc.mkxl
index 05e3957c7..f1a4de236 100644
--- a/tex/context/base/mkxl/math-frc.mkxl
+++ b/tex/context/base/mkxl/math-frc.mkxl
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% todo : mathclass=\mathnothingcode, % todo also accept string
+
\writestatus{loading}{ConTeXt Math Macros / Fractions}
\unprotect
@@ -189,10 +191,6 @@
\let\math_fraction_margin_kern\relax
-%D Because the fraction nodes uses the superscript and subscript for numerator and
-%D denomerator so we wrap in a \type {\mathfrac}. Because with \type {\over} one
-%D normally wraps the lot it goes unnoticed there.
-%D
%D \starttyping
%D $\Uover{2}{3} ^4$ % double script error but no longer because we use the prescripts
%D ${\over{2}{3}}^4$ % no issue anyway because we wrap in {} (goes unnoticed)
@@ -210,7 +208,7 @@
%
\edef\p_math_fraction_fences{\mathfractionparameter\c!fences}%
%
- \mathatom \s!class \mathfractionparameter\c!mathclass\bgroup
+ \math_atom_by_parameter\mathfractionparameter\bgroup
\ifempty\p_math_fraction_fences \else
\math_fenced_fenced_start\p_math_fraction_fences
\fi
@@ -326,22 +324,36 @@
\else
\dimexpr\p_thickness\relax
\fi
- \s!class \numexpr\mathfractionparameter\c!mathclass\relax
+ \s!class \math_class_by_parameter\mathfractionparameter\c!mathclass
\s!vfactor \numexpr\mathfractionparameter\c!vfactor\relax
\s!source \number\namedboxanchor{\mathfractionparameter\c!source}}
+\installcorenamespace{mathalignsimple}
+
+\defcsname\??mathalignsimple\v!right \endcsname#1{#1\hfill}
+\defcsname\??mathalignsimple\v!flushleft \endcsname#1{#1\hfill}
+\defcsname\??mathalignsimple\v!left \endcsname#1{\hfill#1}
+\defcsname\??mathalignsimple\v!flushright\endcsname#1{\hfill#1}
+\defcsname\??mathalignsimple\v!middle \endcsname#1{\hfill#1\hfill}
+
+\protected\def\math_frac_aligned_top{\begincsname\??mathalignsimple\mathfractionparameter\c!topalign \endcsname}
+\protected\def\math_frac_aligned_bot{\begincsname\??mathalignsimple\mathfractionparameter\c!bottomalign\endcsname}
+
+% \protected\def\math_frac_aligned_top{\begincsname\??mathalignsimple\mathfractionparameter\c!align\endcsname}
+% \protected\def\math_frac_aligned_bot{\begincsname\??mathalignsimple\mathfractionparameter\c!align\endcsname}
+
\protected\defcsname\??mathfractionalternative\v!inner\endcsname#1#2%
{%\beginmathgroup
\math_frac_command_u
{\dousecolorparameter{\mathfractionparameter\c!topcolor}%
\math_fraction_margin_kern
\usemathstyleparameter\mathfractionparameter\c!mathnumeratorstyle
- \m_fractions_strut_top#1%
+ \m_fractions_strut_top\math_frac_aligned_top{#1}%
\math_fraction_margin_kern}%
{\dousecolorparameter{\mathfractionparameter\c!bottomcolor}%
\math_fraction_margin_kern
\usemathstyleparameter\mathfractionparameter\c!mathdenominatorstyle
- \m_fractions_strut_bot#2%
+ \m_fractions_strut_bot\math_frac_aligned_bot{#2}%
\math_fraction_margin_kern}%
%\endmathgroup
\math_frac_wrapup}
@@ -352,11 +364,11 @@
\math_frac_command_u
{\dousecolorparameter{\mathfractionparameter\c!topcolor}%
\math_fraction_margin_kern
- \m_fractions_strut_top#1%
+ \m_fractions_strut_top\math_frac_aligned_top{#1}%
\math_fraction_margin_kern}%
{\dousecolorparameter{\mathfractionparameter\c!bottomcolor}%
\math_fraction_margin_kern
- \m_fractions_strut_bot#2%
+ \m_fractions_strut_bot\math_frac_aligned_bot{#2}%
\math_fraction_margin_kern}%
\endmathgroup
\math_frac_wrapup}
@@ -368,12 +380,12 @@
{\dousecolorparameter{\mathfractionparameter\c!topcolor}%
\math_fraction_margin_kern
\usemathstyleparameter\mathfractionparameter\c!mathnumeratorstyle
- \m_fractions_strut_top#1%
+ \m_fractions_strut_top\math_frac_aligned_top{#1}%
\math_fraction_margin_kern}%
{\dousecolorparameter{\mathfractionparameter\c!bottomcolor}%
\math_fraction_margin_kern
\usemathstyleparameter\mathfractionparameter\c!mathdenominatorstyle
- \m_fractions_strut_bot#2%
+ \m_fractions_strut_bot\math_frac_aligned_bot{#2}%
\math_fraction_margin_kern}%
\endmathgroup
\math_frac_wrapup}
@@ -506,7 +518,7 @@
\definemathfraction[d:frac] [\c!alternative=\v!inner,\c!mathstyle=\s!cramped]
\definemathfraction[d:tfrac][\c!alternative=\v!inner,\c!mathstyle={\s!cramped,\s!script}]
-\definemathfraction[d:sfrac][\c!alternative=\v!both,\c!mathstyle={\s!cramped,\s!scriptscript}]
+\definemathfraction[d:sfrac][\c!alternative=\v!inner,\c!mathstyle={\s!cramped,\s!scriptscript}]
\definemathfraction[d:dfrac][\c!alternative=\v!both,\c!mathstyle=\s!display]
%D \protected\def\ShowMathFractions#1#2%
@@ -525,32 +537,36 @@
%D \ShowMathFractions{1}{b}\par
%D \blank
+% % There is no real need to support ams styling so this is now obsolete:
+
\permanent\protected\def\frac {\csname\inlineordisplaymath id:frac\endcsname}
\permanent\protected\def\tfrac{\csname\inlineordisplaymath id:tfrac\endcsname}
\permanent\protected\def\sfrac{\csname\inlineordisplaymath id:sfrac\endcsname}
\permanent\protected\def\dfrac{\csname\inlineordisplaymath id:dfrac\endcsname}
-\definemathfraction[ams] [\c!strut=\v!no,\c!alternative=\v!outer]
-\definemathfraction[i:ams:frac][ams][\c!mathstyle={\s!cramped,\s!text}]
-\definemathfraction[d:ams:frac][ams][\c!mathstyle={\s!cramped,\s!display}]
-
-\permanent\protected\def\ctxfrac{\csname\inlineordisplaymath id:frac\endcsname}
-\permanent\protected\def\amsfrac{\csname\inlineordisplaymath id:ams:frac\endcsname}
-
-\appendtoks
- \doifelse{\mathematicsparameter\c!fractions}{ams}%
- {\enforced\let\frac\amsfrac}%
- {\enforced\let\frac\ctxfrac}%
-\to \everysetupmathematics
+% \definemathfraction[ams] [\c!strut=\v!no,\c!alternative=\v!outer]
+% \definemathfraction[i:ams:frac][ams][\c!mathstyle={\s!cramped,\s!text}]
+% \definemathfraction[d:ams:frac][ams][\c!mathstyle={\s!cramped,\s!display}]
+%
+% \permanent\protected\def\ctxfrac{\csname\inlineordisplaymath id:frac\endcsname}
+% \permanent\protected\def\amsfrac{\csname\inlineordisplaymath id:ams:frac\endcsname}
+%
+% \appendtoks
+% \doifelse{\mathematicsparameter\c!fractions}{ams}%
+% {\enforced\let\frac\amsfrac}%
+% {\enforced\let\frac\ctxfrac}%
+% \to \everysetupmathematics
+% % Also gone:
+%
% \definemathfraction[ddfrac][\c!mathstyle=\s!display]
% \definemathfraction[ttfrac][\c!mathstyle=\s!text]
% \definemathfraction[ssfrac][\c!mathstyle=\s!script]
-
+%
% \protected\def\binom #1#2{{\Ustack {{#1}\normalabovewithdelims()\zeropoint{#2}}}}
% \protected\def\dbinom#1#2{{\displaystyle{{#1}\normalabovewithdelims()\zeropoint{#2}}}}
% \protected\def\tbinom#1#2{{\textstyle {{#1}\normalabovewithdelims()\zeropoint{#2}}}}
-
+%
% \definemathfraction
% [binom]
% [\c!alternative=\v!outer,
@@ -622,21 +638,37 @@
%D
%D \getbuffer
-\permanent\protected\def\cfrac
- {\doifelsenextoptionalcs\math_cfrac_yes\math_cfrac_nop}
+% % we forget about this ams one ... no one uses it anyway
+%
+% \permanent\protected\def\cfrac
+% {\doifelsenextoptionalcs\math_cfrac_yes\math_cfrac_nop}
+%
+% \def\math_cfrac_nop {\math_cfrac_indeed[cc]}
+% \def\math_cfrac_yes[#1]{\math_cfrac_indeed[#1cc]}
+%
+% \def\math_cfrac_indeed[#1#2#3]#4#5%
+% {{\displaystyle
+% \frac
+% {\strut
+% \ifx r#1\hfill\fi#4\ifx l#1\hfill\fi}%
+% {\ifx r#2\hfill\fi#5\ifx l#2\hfill\fi}%
+% \ifzeropt\nulldelimiterspace\else
+% \kern-\nulldelimiterspace
+% \fi}}
+%
+% instead we predefine one:
-\def\math_cfrac_nop {\math_cfrac_indeed[cc]}
-\def\math_cfrac_yes[#1]{\math_cfrac_indeed[#1cc]}
+\definemathfraction
+ [cfrac]
+ [\c!mathstyle=\v!text]
-\def\math_cfrac_indeed[#1#2#3]#4#5%
- {{\displaystyle
- \frac
- {\strut
- \ifx r#1\hfill\fi#4\ifx l#1\hfill\fi}%
- {\ifx r#2\hfill\fi#5\ifx l#2\hfill\fi}%
- \ifzeropt\nulldelimiterspace\else
- \kern-\nulldelimiterspace
- \fi}}
+% so users can do this:
+%
+% \setupmathfraction
+% [cfrac]
+% [topalign=flushright]
+%
+% or define an child instance that presets it.
%D \macros
%D {splitfrac, splitdfrac}
@@ -660,14 +692,32 @@
%D \stopbuffer
%D
%D \typebuffer \getbuffer
-%D
-%D These macros are based on Michael J.~Downes posting on comp.text.tex on 2001/12/06
-%D but adapted a bit.
-%D
-%D Does anyone actually use this kind of stuff?
-\permanent\protected\def\splitfrac #1#2{{\textstyle {{\textstyle#1\quad\hfill}\normalabove\zeropoint{\textstyle\hfill\quad\mathstrut#2}}}}
-\permanent\protected\def\splitdfrac#1#2{{\displaystyle{{ #1\quad\hfill}\normalabove\zeropoint{ \hfill\quad\mathstrut#2}}}}
+\defcsname\??mathalignsimple\v!split:\v!flushleft\endcsname#1%
+ {#1%
+ \ifchkdim\mathfractionparameter\c!distance\or\hskip\lastchkdim\fi
+ \hfill}
+
+\defcsname\??mathalignsimple\v!split:\v!flushright\endcsname#1%
+ {\hfill
+ \ifchkdim\mathfractionparameter\c!distance\or\hskip\lastchkdim\fi
+ \mathatom \s!class \mathordcode \s!unroll {}% prevents +/- seen as sign, unroll prevents empty box
+ #1}
+
+\definemathfraction
+ [splitfrac]
+ [\c!mathnumeratorstyle=\v!text,
+ \c!mathdenominatorstyle=\v!text,
+ \c!topalign=\v!split:\v!flushleft,
+ \c!bottomalign=\v!split:\v!flushright,
+ \c!distance=\emwidth,
+ \c!rule=\v!no]
+
+\definemathfraction
+ [splitdfrac]
+ [splitfrac]
+ [\c!mathnumeratorstyle=\v!display,
+ \c!mathdenominatorstyle=\v!display]
%D More fracking (for Alan):
diff --git a/tex/context/base/mkxl/math-ini.lmt b/tex/context/base/mkxl/math-ini.lmt
index 81138b2e2..fb98ce35b 100644
--- a/tex/context/base/mkxl/math-ini.lmt
+++ b/tex/context/base/mkxl/math-ini.lmt
@@ -529,66 +529,66 @@ do
return mset, dset
end
- local function report(class,engine,family,unicode,name)
+ local function report(class,family,unicode,name)
local nametype = type(name)
if nametype == "string" then
- report_math("class %a, engine %a, family %a, char %C, name %a",class,engine,family,unicode,name)
+ report_math("class %a, family %a, char %C, name %a",class,family,unicode,name)
elseif nametype == "number" then
- report_math("class %a, engine %a, family %a, char %C, number %U",class,engine,family,unicode,name)
+ report_math("class %a, family %a, char %C, number %U",class,family,unicode,name)
else
- report_math("class %a, engine %a, family %a, char %C",class,engine,family,unicode)
+ report_math("class %a, family %a, char %C",class,family,unicode)
end
end
- local f_accent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
- local f_fixedtopaccent = formatters[ [[\defUmathfixedtopaccent \%s{%X}{%X}{%X}]] ]
- local f_fixedbottomaccent = formatters[ [[\defUmathfixedbottomaccent \%s{%X}{%X}{%X}]] ]
- local f_topaccent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
- local f_bottomaccent = formatters[ [[\defUmathbottomaccent \%s{%X}{%X}{%X}]] ]
- local f_over = formatters[ [[\defUdelimiterover \%s{%X}{%X}{%X}]] ]
- local f_under = formatters[ [[\defUdelimiterunder\%s{%X}{%X}{%X}]] ]
- local f_fence = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
- local f_delimiter = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
- local f_radical = formatters[ [[\defUradical \%s{%X}{%X}]] ]
- local f_root = formatters[ [[\defUroot \%s{%X}{%X}]] ]
- local f_char = formatters[ [[\defUmathchar \%s{%X}{%X}{%X}]] ]
+ -- local f_accent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
+ -- local f_fixedtopaccent = formatters[ [[\defUmathfixedtopaccent \%s{%X}{%X}{%X}]] ]
+ -- local f_fixedbottomaccent = formatters[ [[\defUmathfixedbottomaccent \%s{%X}{%X}{%X}]] ]
+ -- local f_topaccent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
+ -- local f_bottomaccent = formatters[ [[\defUmathbottomaccent \%s{%X}{%X}{%X}]] ]
+ -- local f_over = formatters[ [[\defUdelimiterover \%s{%X}{%X}{%X}]] ]
+ -- local f_under = formatters[ [[\defUdelimiterunder\%s{%X}{%X}{%X}]] ]
+ -- local f_fence = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
+ -- local f_delimiter = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
+ -- local f_radical = formatters[ [[\defUradical \%s{%X}{%X}]] ]
+ -- local f_root = formatters[ [[\defUroot \%s{%X}{%X}]] ]
+ -- local f_char = formatters[ [[\defUmathchar \%s{%X}{%X}{%X}]] ]
local texmathchardef = tex.mathchardef
- local setmathsymbol = function(name,class,engine,family,slot,stretch,group) -- hex is nicer for tracing
+ local setmathsymbol = function(name,class,family,slot,stretch,group) -- hex is nicer for tracing
if class == accent_class then
- ctx_sprint(f_topaccent(name,0,family,slot))
+ -- ctx_sprint(f_accent(name,0,family,slot))
elseif class == topaccent_class then
- -- only widegrave widehat widetilde : still needed?
- ctx_sprint((stretch and f_topaccent or f_fixedtopaccent)(name,0,family,slot))
+ -- ctx_sprint((stretch and f_topaccent or f_fixedtopaccent)(name,0,family,slot))
elseif class == bottomaccent_class then
- ctx_sprint((stretch and f_bottomaccent or f_fixedbottomaccent)(name,0,family,slot))
- elseif class == over_class then
- ctx_sprint(f_over(name,0,family,slot))
- elseif class == under_class then
- ctx_sprint(f_under(name,0,family,slot))
+ -- ctx_sprint((stretch and f_bottomaccent or f_fixedbottomaccent)(name,0,family,slot))
+ elseif class == over_class then -- only in mkiv
+ -- ctx_sprint(f_over(name,0,family,slot))
+ elseif class == under_class then -- only in mkiv
+ -- ctx_sprint(f_under(name,0,family,slot))
elseif class == open_class or class == close_class or class == middle_class then
- setdelcode("global",slot,family,slot,0,0)
- ctx_sprint(f_fence(name,engine,family,slot))
- elseif class == delimiter_class then
- setdelcode("global",slot,family,slot,0,0)
- ctx_sprint(f_delimiter(name,0,family,slot))
- elseif class == radical_class then
- ctx_sprint(f_radical(name,family,slot))
- elseif class == root_class then
- ctx_sprint(f_root(name,family,slot))
+ setdelcode("global",slot,family,slot,0,0) -- can go
+ -- ctx_sprint(f_fence(name,class,family,slot))
+ -- ctx_sprint(f_char(name,class,family,slot))
+ texmathchardef(name,class,family,slot,"permanent")
+ elseif class == delimiter_class then -- open close or middle (bars)
+ setdelcode("global",slot,family,slot,0,0) -- can go
+ -- ctx_sprint(f_delimiter(name,0,family,slot))
+ -- ctx_sprint(f_char(name,0,family,slot))
+ texmathchardef(name,0,family,slot,"permanent")
+ elseif class == radical_class then -- only in mkiv
+ -- ctx_sprint(f_radical(name,family,slot))
+ elseif class == root_class then -- only in mkiv
+ -- ctx_sprint(f_root(name,family,slot))
elseif texmathchardef then
if group then
group = groupnames[group] or 0
if group ~= 0 then
- texmathchardef(name,engine,family,slot,"permanent",0x1,group,slot)
+ texmathchardef(name,class,family,slot,"permanent",0x1,group,slot)
return
end
end
- texmathchardef(name,engine,family,slot,"permanent")
- else
- -- beware, open/close and other specials should not end up here
- ctx_sprint(f_char(name,engine,family,slot))
+ texmathchardef(name,class,family,slot,"permanent")
end
end
@@ -620,7 +620,7 @@ do
if class then
local engine = toengineclass(class)
if trace_defining then
- report(class,engine,family,unicode,symbol)
+ report(engine,family,unicode,symbol)
end
mset, dset = setmathcharacter(engine,family,unicode,symbol,mset,dset,group)
end
@@ -652,7 +652,7 @@ do
class = classes[class] or ordinary_class
local engine = toengineclass(class)
if trace_defining then
- report(class,engine,family,unicode)
+ report(engine,family,unicode)
end
mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group)
done = true
@@ -673,13 +673,13 @@ do
local engine = toengineclass(class)
if name then
if trace_defining then
- report(class,engine,family,unicode,name)
+ report(engine,family,unicode,name)
end
- setmathsymbol(name,class,engine,family,unicode,stretch,group)
+ setmathsymbol(name,engine,family,unicode,stretch,group)
else
name = (class == classes.ordinary or class == classes.digit) and character.adobename -- bad
if name and trace_defining then
- report(class,engine,family,unicode,name)
+ report(engine,family,unicode,name)
end
end
if not done then
@@ -698,7 +698,7 @@ do
local engine = toengineclass(class)
if name == false then
if trace_defining then
- report(class,engine,family,unicode,name)
+ report(engine,family,unicode,name)
end
mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group)
else
@@ -707,12 +707,12 @@ do
-- end
if name then
if trace_defining then
- report(class,engine,family,unicode,name)
+ report(engine,family,unicode,name)
end
- setmathsymbol(name,class,engine,family,unicode,stretch,group)
+ setmathsymbol(name,engine,family,unicode,stretch,group)
else
if trace_defining then
- report(class,engine,family,unicode,character.adobename)
+ report(engine,family,unicode,character.adobename)
end
end
mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group)
@@ -720,7 +720,7 @@ do
elseif class ~= ordinary_class then
local engine = toengineclass(class)
if trace_defining then
- report(class,engine,family,unicode,character.adobename)
+ report(engine,family,unicode,character.adobename)
end
mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group)
end
diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl
index b007a64d1..dfa8a18ef 100644
--- a/tex/context/base/mkxl/math-ini.mkxl
+++ b/tex/context/base/mkxl/math-ini.mkxl
@@ -55,6 +55,30 @@
\newdimension\mathstrutdp
\newinteger \mathnestinglevel
+% For now:
+
+%protected\def\Umathaccent_top {\Umathaccent top }
+%protected\def\Umathaccent_bottom {\Umathaccent bottom }
+%protected\def\Umathaccent_top_fixed {\Umathaccent top fixed }
+%protected\def\Umathaccent_bottom_fixed{\Umathaccent bottom fixed }
+
+%permanent\protected\def\defUmathfixedtopaccent #1#2#3#4{\global\immutable\protected\def#1{\Umathaccent_top_fixed "#2 "#3 "#4 }}
+%permanent\protected\def\defUmathfixedbottomaccent#1#2#3#4{\global\immutable\protected\def#1{\Umathaccent_bottom_fixed "#2 "#3 "#4 }}
+%permanent\protected\def\defUmathtopaccent #1#2#3#4{\global\immutable\protected\def#1{\Umathaccent_top "#2 "#3 "#4 }}
+%permanent\protected\def\defUmathbottomaccent #1#2#3#4{\global\immutable\protected\def#1{\Umathaccent_bottom "#2 "#3 "#4 }}
+
+%permanent\protected\def\defUmathchar #1#2#3#4{\global\immutable\Umathchardef #1 "#2 "#3 "#4 }
+%permanent\protected\def\defUdelimiter #1#2#3#4{\global\immutable\protected\def#1{\Udelimiter "#2 "#3 "#4 }}
+%permanent\protected\def\defUdelimiter #1#2#3#4{\global\immutable\Umathchardef #1 "#2 "#3 "#4 }
+
+%permanent\protected\def\defUradical #1#2#3{\global\immutable\protected\def#1{\Uradical "#2 "#3 }}
+%permanent\protected\def\defUroot #1#2#3{\global\immutable\protected\def#1{\Uroot "#2 "#3 }}
+
+%permanent\protected\def\defUdelimiterover #1#2#3#4{\global\immutable\protected\def#1{\Udelimiterover "#2 "#3 }} % radicals
+%permanent\protected\def\defUdelimiterunder #1#2#3#4{\global\immutable\protected\def#1{\Udelimiterunder "#2 "#3 }} % radicals
+
+% So:
+
\registerctxluafile{math-ini}{autosuffix}
\registerctxluafile{math-dim}{autosuffix}
%registerctxluafile{math-act}{autosuffix}
@@ -295,164 +319,164 @@
\untraced\permanent\protected\def\prerelpenalty {\setmathprepenalty \mathrelationcode}
\popoverloadmode
-%D These verbose commands are obsolete because there are plenty more classes in
-%D \LMTX\ than in \MKIV.
-
-\permanent\protected\def\ordordspacing {\setmathspacing \mathordinarycode \mathordinarycode }
-\permanent\protected\def\ordopspacing {\setmathspacing \mathordinarycode \mathoperatorcode }
-\permanent\protected\def\ordbinspacing {\setmathspacing \mathordinarycode \mathbinarycode }
-\permanent\protected\def\ordrelspacing {\setmathspacing \mathordinarycode \mathrelationcode }
-\permanent\protected\def\ordopenspacing {\setmathspacing \mathordinarycode \mathopencode }
-\permanent\protected\def\ordclosespacing {\setmathspacing \mathordinarycode \mathclosecode }
-\permanent\protected\def\ordpunctspacing {\setmathspacing \mathordinarycode \mathpunctuationcode}
-%permanent\protected\def\ordinnerspacing {\setmathspacing \mathordinarycode \mathinnercode }
-%permanent\protected\def\ordfracspacing {\setmathspacing \mathordinarycode \mathfractioncode }
-%permanent\protected\def\ordradspacing {\setmathspacing \mathordinarycode \mathradicalcode }
-\permanent\protected\def\ordmiddlespacing {\setmathspacing \mathordinarycode \mathmiddlecode }
-%permanent\protected\def\ordaccentspacing {\setmathspacing \mathordinarycode \mathaccentcode }
-
-\permanent\protected\def\opordspacing {\setmathspacing \mathoperatorcode \mathordinarycode }
-\permanent\protected\def\opopspacing {\setmathspacing \mathoperatorcode \mathoperatorcode }
-\permanent\protected\def\opbinspacing {\setmathspacing \mathoperatorcode \mathbinarycode }
-\permanent\protected\def\oprelspacing {\setmathspacing \mathoperatorcode \mathrelationcode }
-\permanent\protected\def\opopenspacing {\setmathspacing \mathoperatorcode \mathopencode }
-\permanent\protected\def\opclosespacing {\setmathspacing \mathoperatorcode \mathclosecode }
-\permanent\protected\def\oppunctspacing {\setmathspacing \mathoperatorcode \mathpunctuationcode}
-%permanent\protected\def\opinnerspacing {\setmathspacing \mathoperatorcode \mathinnercode }
-%permanent\protected\def\opfracspacing {\setmathspacing \mathoperatorcode \mathfractioncode }
-%permanent\protected\def\opradspacing {\setmathspacing \mathoperatorcode \mathradicalcode }
-\permanent\protected\def\opmiddlespacing {\setmathspacing \mathoperatorcode \mathmiddlecode }
-%permanent\protected\def\opaccentspacing {\setmathspacing \mathoperatorcode \mathaccentcode }
-
-\permanent\protected\def\binordspacing {\setmathspacing \mathbinarycode \mathordinarycode }
-\permanent\protected\def\binopspacing {\setmathspacing \mathbinarycode \mathoperatorcode }
-\permanent\protected\def\binbinspacing {\setmathspacing \mathbinarycode \mathbinarycode }
-\permanent\protected\def\binrelspacing {\setmathspacing \mathbinarycode \mathrelationcode }
-\permanent\protected\def\binopenspacing {\setmathspacing \mathbinarycode \mathopencode }
-\permanent\protected\def\binclosespacing {\setmathspacing \mathbinarycode \mathclosecode }
-\permanent\protected\def\binpunctspacing {\setmathspacing \mathbinarycode \mathpunctuationcode}
-%permanent\protected\def\bininnerspacing {\setmathspacing \mathbinarycode \mathinnercode }
-%permanent\protected\def\binfracspacing {\setmathspacing \mathbinarycode \mathfractioncode }
-%permanent\protected\def\binradspacing {\setmathspacing \mathbinarycode \mathradicalcode }
-\permanent\protected\def\binmiddlespacing {\setmathspacing \mathbinarycode \mathmiddlecode }
-%permanent\protected\def\binaccentspacing {\setmathspacing \mathbinarycode \mathaccentcode }
-
-\permanent\protected\def\relordspacing {\setmathspacing \mathrelationcode \mathordinarycode }
-\permanent\protected\def\relopspacing {\setmathspacing \mathrelationcode \mathoperatorcode }
-\permanent\protected\def\relbinspacing {\setmathspacing \mathrelationcode \mathbinarycode }
-\permanent\protected\def\relrelspacing {\setmathspacing \mathrelationcode \mathrelationcode }
-\permanent\protected\def\relopenspacing {\setmathspacing \mathrelationcode \mathopencode }
-\permanent\protected\def\relclosespacing {\setmathspacing \mathrelationcode \mathclosecode }
-\permanent\protected\def\relpunctspacing {\setmathspacing \mathrelationcode \mathpunctuationcode}
-%permanent\protected\def\relinnerspacing {\setmathspacing \mathrelationcode \mathinnercode }
-%permanent\protected\def\relfracspacing {\setmathspacing \mathrelationcode \mathfractioncode }
-%permanent\protected\def\relradspacing {\setmathspacing \mathrelationcode \mathradicalcode }
-\permanent\protected\def\relmiddlespacing {\setmathspacing \mathrelationcode \mathmiddlecode }
-%permanent\protected\def\relaccentspacing {\setmathspacing \mathrelationcode \mathaccentcode }
-
-\permanent\protected\def\openordspacing {\setmathspacing \mathopencode \mathordinarycode }
-\permanent\protected\def\openopspacing {\setmathspacing \mathopencode \mathoperatorcode }
-\permanent\protected\def\openbinspacing {\setmathspacing \mathopencode \mathbinarycode }
-\permanent\protected\def\openrelspacing {\setmathspacing \mathopencode \mathrelationcode }
-\permanent\protected\def\openopenspacing {\setmathspacing \mathopencode \mathopencode }
-\permanent\protected\def\openclosespacing {\setmathspacing \mathopencode \mathclosecode }
-\permanent\protected\def\openpunctspacing {\setmathspacing \mathopencode \mathpunctuationcode}
-%permanent\protected\def\openinnerspacing {\setmathspacing \mathopencode \mathinnercode }
-%permanent\protected\def\openfracspacing {\setmathspacing \mathopencode \mathfractioncode }
-%permanent\protected\def\openradspacing {\setmathspacing \mathopencode \mathradicalcode }
-\permanent\protected\def\openmiddlespacing {\setmathspacing \mathopencode \mathmiddlecode }
-%permanent\protected\def\openaccentspacing {\setmathspacing \mathopencode \mathaccentcode }
-
-\permanent\protected\def\closeordspacing {\setmathspacing \mathclosecode \mathordinarycode }
-\permanent\protected\def\closeopspacing {\setmathspacing \mathclosecode \mathoperatorcode }
-\permanent\protected\def\closebinspacing {\setmathspacing \mathclosecode \mathbinarycode }
-\permanent\protected\def\closerelspacing {\setmathspacing \mathclosecode \mathrelationcode }
-\permanent\protected\def\closeopenspacing {\setmathspacing \mathclosecode \mathopencode }
-\permanent\protected\def\closeclosespacing {\setmathspacing \mathclosecode \mathclosecode }
-\permanent\protected\def\closepunctspacing {\setmathspacing \mathclosecode \mathpunctuationcode}
-%permanent\protected\def\closeinnerspacing {\setmathspacing \mathclosecode \mathinnercode }
-%permanent\protected\def\closefracspacing {\setmathspacing \mathclosecode \mathfractioncode }
-%permanent\protected\def\closeradspacing {\setmathspacing \mathclosecode \mathradicalcode }
-\permanent\protected\def\closemiddlespacing {\setmathspacing \mathclosecode \mathmiddlecode }
-%permanent\protected\def\closeaccentspacing {\setmathspacing \mathclosecode \mathaccentcode }
-
-\permanent\protected\def\punctordspacing {\setmathspacing \mathpunctuationcode \mathordinarycode }
-\permanent\protected\def\punctopspacing {\setmathspacing \mathpunctuationcode \mathoperatorcode }
-\permanent\protected\def\punctbinspacing {\setmathspacing \mathpunctuationcode \mathbinarycode }
-\permanent\protected\def\punctrelspacing {\setmathspacing \mathpunctuationcode \mathrelationcode }
-\permanent\protected\def\punctopenspacing {\setmathspacing \mathpunctuationcode \mathopencode }
-\permanent\protected\def\punctclosespacing {\setmathspacing \mathpunctuationcode \mathclosecode }
-\permanent\protected\def\punctpunctspacing {\setmathspacing \mathpunctuationcode \mathpunctuationcode}
-%permanent\protected\def\punctinnerspacing {\setmathspacing \mathpunctuationcode \mathinnercode }
-%permanent\protected\def\punctfracspacing {\setmathspacing \mathpunctuationcode \mathfractioncode }
-%permanent\protected\def\punctradspacing {\setmathspacing \mathpunctuationcode \mathradicalcode }
-\permanent\protected\def\punctmiddlespacing {\setmathspacing \mathpunctuationcode \mathmiddlecode }
-%permanent\protected\def\punctaccentspacing {\setmathspacing \mathpunctuationcode \mathaccentcode }
-
-%permanent\protected\def\innerordspacing {\setmathspacing \mathinnercode \mathordinarycode }
-%permanent\protected\def\inneropspacing {\setmathspacing \mathinnercode \mathoperatorcode }
-%permanent\protected\def\innerbinspacing {\setmathspacing \mathinnercode \mathbinarycode }
-%permanent\protected\def\innerrelspacing {\setmathspacing \mathinnercode \mathrelationcode }
-%permanent\protected\def\inneropenspacing {\setmathspacing \mathinnercode \mathopencode }
-%permanent\protected\def\innerclosespacing {\setmathspacing \mathinnercode \mathclosecode }
-%permanent\protected\def\innerpunctspacing {\setmathspacing \mathinnercode \mathpunctuationcode}
-%permanent\protected\def\innerinnerspacing {\setmathspacing \mathinnercode \mathinnercode }
-%permanent\protected\def\innerfracspacing {\setmathspacing \mathinnercode \mathfractioncode }
-%permanent\protected\def\innerradspacing {\setmathspacing \mathinnercode \mathradicalcode }
-%permanent\protected\def\innermiddlespacing {\setmathspacing \mathinnercode \mathmiddlecode }
-%permanent\protected\def\inneraccentspacing {\setmathspacing \mathinnercode \mathaccentcode }
-
-\permanent\protected\def\fracordspacing {\setmathspacing \mathfractioncode \mathordinarycode }
-\permanent\protected\def\fracopspacing {\setmathspacing \mathfractioncode \mathoperatorcode }
-\permanent\protected\def\fracbinspacing {\setmathspacing \mathfractioncode \mathbinarycode }
-\permanent\protected\def\fracrelspacing {\setmathspacing \mathfractioncode \mathrelationcode }
-\permanent\protected\def\fracopenspacing {\setmathspacing \mathfractioncode \mathopencode }
-\permanent\protected\def\fracclosespacing {\setmathspacing \mathfractioncode \mathclosecode }
-\permanent\protected\def\fracpunctspacing {\setmathspacing \mathfractioncode \mathpunctuationcode}
-%permanent\protected\def\fracinnerspacing {\setmathspacing \mathfractioncode \mathinnercode }
-%permanent\protected\def\fracfracspacing {\setmathspacing \mathfractioncode \mathfractioncode }
-%permanent\protected\def\fracradspacing {\setmathspacing \mathfractioncode \mathradicalcode }
-\permanent\protected\def\fracmiddlespacing {\setmathspacing \mathfractioncode \mathmiddlecode }
-%permanent\protected\def\fracaccentspacing {\setmathspacing \mathfractioncode \mathaccentcode }
-
-\permanent\protected\def\radordspacing {\setmathspacing \mathradicalcode \mathordinarycode }
-\permanent\protected\def\radopspacing {\setmathspacing \mathradicalcode \mathoperatorcode }
-\permanent\protected\def\radbinspacing {\setmathspacing \mathradicalcode \mathbinarycode }
-\permanent\protected\def\radrelspacing {\setmathspacing \mathradicalcode \mathrelationcode }
-\permanent\protected\def\radopenspacing {\setmathspacing \mathradicalcode \mathopencode }
-\permanent\protected\def\radclosespacing {\setmathspacing \mathradicalcode \mathclosecode }
-\permanent\protected\def\radpunctspacing {\setmathspacing \mathradicalcode \mathpunctuationcode}
-%permanent\protected\def\radinnerspacing {\setmathspacing \mathradicalcode \mathinnercode }
-%permanent\protected\def\radfracspacing {\setmathspacing \mathradicalcode \mathfractioncode }
-%permanent\protected\def\radradspacing {\setmathspacing \mathradicalcode \mathradicalcode }
-\permanent\protected\def\radmiddlespacing {\setmathspacing \mathradicalcode \mathmiddlecode }
-%permanent\protected\def\radaccentspacing {\setmathspacing \mathradicalcode \mathaccentcode }
-
-\permanent\protected\def\middleordspacing {\setmathspacing \mathmiddlecode \mathordinarycode }
-\permanent\protected\def\middleopspacing {\setmathspacing \mathmiddlecode \mathoperatorcode }
-\permanent\protected\def\middlebinspacing {\setmathspacing \mathmiddlecode \mathbinarycode }
-\permanent\protected\def\middlerelspacing {\setmathspacing \mathmiddlecode \mathrelationcode }
-\permanent\protected\def\middleopenspacing {\setmathspacing \mathmiddlecode \mathopencode }
-\permanent\protected\def\middleclosespacing {\setmathspacing \mathmiddlecode \mathclosecode }
-\permanent\protected\def\middlepunctspacing {\setmathspacing \mathmiddlecode \mathpunctuationcode}
-%permanent\protected\def\middleinnerspacing {\setmathspacing \mathmiddlecode \mathinnercode }
-%permanent\protected\def\middlefracspacing {\setmathspacing \mathmiddlecode \mathfractioncode }
-%permanent\protected\def\middleradspacing {\setmathspacing \mathmiddlecode \mathradicalcode }
-\permanent\protected\def\middlemiddlespacing{\setmathspacing \mathmiddlecode \mathmiddlecode }
-%permanent\protected\def\middleaccentspacing{\setmathspacing \mathmiddlecode \mathaccentcode }
-
-\permanent\protected\def\accentordspacing {\setmathspacing \mathaccentcode \mathordinarycode }
-\permanent\protected\def\accentopspacing {\setmathspacing \mathaccentcode \mathoperatorcode }
-\permanent\protected\def\accentbinspacing {\setmathspacing \mathaccentcode \mathbinarycode }
-\permanent\protected\def\accentrelspacing {\setmathspacing \mathaccentcode \mathrelationcode }
-\permanent\protected\def\accentopenspacing {\setmathspacing \mathaccentcode \mathopencode }
-\permanent\protected\def\accentclosespacing {\setmathspacing \mathaccentcode \mathclosecode }
-\permanent\protected\def\accentpunctspacing {\setmathspacing \mathaccentcode \mathpunctuationcode}
-%permanent\protected\def\accentinnerspacing {\setmathspacing \mathaccentcode \mathinnercode }
-%permanent\protected\def\accentfracspacing {\setmathspacing \mathaccentcode \mathfractioncode }
-%permanent\protected\def\accentradspacing {\setmathspacing \mathaccentcode \mathradicalcode }
-\permanent\protected\def\accentmiddlespacing{\setmathspacing \mathaccentcode \mathmiddlecode }
-%permanent\protected\def\accentaccentspacing{\setmathspacing \mathaccentcode \mathaccentcode }
+% %D These verbose commands are obsolete because there are plenty more classes in
+% %D \LMTX\ than in \MKIV.
+%
+% \permanent\protected\def\ordordspacing {\setmathspacing \mathordinarycode \mathordinarycode }
+% \permanent\protected\def\ordopspacing {\setmathspacing \mathordinarycode \mathoperatorcode }
+% \permanent\protected\def\ordbinspacing {\setmathspacing \mathordinarycode \mathbinarycode }
+% \permanent\protected\def\ordrelspacing {\setmathspacing \mathordinarycode \mathrelationcode }
+% \permanent\protected\def\ordopenspacing {\setmathspacing \mathordinarycode \mathopencode }
+% \permanent\protected\def\ordclosespacing {\setmathspacing \mathordinarycode \mathclosecode }
+% \permanent\protected\def\ordpunctspacing {\setmathspacing \mathordinarycode \mathpunctuationcode}
+% %permanent\protected\def\ordinnerspacing {\setmathspacing \mathordinarycode \mathinnercode }
+% %permanent\protected\def\ordfractionspacing {\setmathspacing \mathordinarycode \mathfractioncode }
+% %permanent\protected\def\ordradicalspacing {\setmathspacing \mathordinarycode \mathradicalcode }
+% \permanent\protected\def\ordmiddlespacing {\setmathspacing \mathordinarycode \mathmiddlecode }
+% %permanent\protected\def\ordaccentspacing {\setmathspacing \mathordinarycode \mathaccentcode }
+%
+% \permanent\protected\def\opordspacing {\setmathspacing \mathoperatorcode \mathordinarycode }
+% \permanent\protected\def\opopspacing {\setmathspacing \mathoperatorcode \mathoperatorcode }
+% \permanent\protected\def\opbinspacing {\setmathspacing \mathoperatorcode \mathbinarycode }
+% \permanent\protected\def\oprelspacing {\setmathspacing \mathoperatorcode \mathrelationcode }
+% \permanent\protected\def\opopenspacing {\setmathspacing \mathoperatorcode \mathopencode }
+% \permanent\protected\def\opclosespacing {\setmathspacing \mathoperatorcode \mathclosecode }
+% \permanent\protected\def\oppunctspacing {\setmathspacing \mathoperatorcode \mathpunctuationcode}
+% %permanent\protected\def\opinnerspacing {\setmathspacing \mathoperatorcode \mathinnercode }
+% %permanent\protected\def\opfractionspacing {\setmathspacing \mathoperatorcode \mathfractioncode }
+% %permanent\protected\def\opradicalspacing {\setmathspacing \mathoperatorcode \mathradicalcode }
+% \permanent\protected\def\opmiddlespacing {\setmathspacing \mathoperatorcode \mathmiddlecode }
+% %permanent\protected\def\opaccentspacing {\setmathspacing \mathoperatorcode \mathaccentcode }
+%
+% \permanent\protected\def\binordspacing {\setmathspacing \mathbinarycode \mathordinarycode }
+% \permanent\protected\def\binopspacing {\setmathspacing \mathbinarycode \mathoperatorcode }
+% \permanent\protected\def\binbinspacing {\setmathspacing \mathbinarycode \mathbinarycode }
+% \permanent\protected\def\binrelspacing {\setmathspacing \mathbinarycode \mathrelationcode }
+% \permanent\protected\def\binopenspacing {\setmathspacing \mathbinarycode \mathopencode }
+% \permanent\protected\def\binclosespacing {\setmathspacing \mathbinarycode \mathclosecode }
+% \permanent\protected\def\binpunctspacing {\setmathspacing \mathbinarycode \mathpunctuationcode}
+% %permanent\protected\def\bininnerspacing {\setmathspacing \mathbinarycode \mathinnercode }
+% %permanent\protected\def\binfractionspacing {\setmathspacing \mathbinarycode \mathfractioncode }
+% %permanent\protected\def\binradicalspacing {\setmathspacing \mathbinarycode \mathradicalcode }
+% \permanent\protected\def\binmiddlespacing {\setmathspacing \mathbinarycode \mathmiddlecode }
+% %permanent\protected\def\binaccentspacing {\setmathspacing \mathbinarycode \mathaccentcode }
+%
+% \permanent\protected\def\relordspacing {\setmathspacing \mathrelationcode \mathordinarycode }
+% \permanent\protected\def\relopspacing {\setmathspacing \mathrelationcode \mathoperatorcode }
+% \permanent\protected\def\relbinspacing {\setmathspacing \mathrelationcode \mathbinarycode }
+% \permanent\protected\def\relrelspacing {\setmathspacing \mathrelationcode \mathrelationcode }
+% \permanent\protected\def\relopenspacing {\setmathspacing \mathrelationcode \mathopencode }
+% \permanent\protected\def\relclosespacing {\setmathspacing \mathrelationcode \mathclosecode }
+% \permanent\protected\def\relpunctspacing {\setmathspacing \mathrelationcode \mathpunctuationcode}
+% %permanent\protected\def\relinnerspacing {\setmathspacing \mathrelationcode \mathinnercode }
+% %permanent\protected\def\relfractionspacing {\setmathspacing \mathrelationcode \mathfractioncode }
+% %permanent\protected\def\relradicalspacing {\setmathspacing \mathrelationcode \mathradicalcode }
+% \permanent\protected\def\relmiddlespacing {\setmathspacing \mathrelationcode \mathmiddlecode }
+% %permanent\protected\def\relaccentspacing {\setmathspacing \mathrelationcode \mathaccentcode }
+%
+% \permanent\protected\def\openordspacing {\setmathspacing \mathopencode \mathordinarycode }
+% \permanent\protected\def\openopspacing {\setmathspacing \mathopencode \mathoperatorcode }
+% \permanent\protected\def\openbinspacing {\setmathspacing \mathopencode \mathbinarycode }
+% \permanent\protected\def\openrelspacing {\setmathspacing \mathopencode \mathrelationcode }
+% \permanent\protected\def\openopenspacing {\setmathspacing \mathopencode \mathopencode }
+% \permanent\protected\def\openclosespacing {\setmathspacing \mathopencode \mathclosecode }
+% \permanent\protected\def\openpunctspacing {\setmathspacing \mathopencode \mathpunctuationcode}
+% %permanent\protected\def\openinnerspacing {\setmathspacing \mathopencode \mathinnercode }
+% %permanent\protected\def\openfractionspacing {\setmathspacing \mathopencode \mathfractioncode }
+% %permanent\protected\def\openradicalspacing {\setmathspacing \mathopencode \mathradicalcode }
+% \permanent\protected\def\openmiddlespacing {\setmathspacing \mathopencode \mathmiddlecode }
+% %permanent\protected\def\openaccentspacing {\setmathspacing \mathopencode \mathaccentcode }
+%
+% \permanent\protected\def\closeordspacing {\setmathspacing \mathclosecode \mathordinarycode }
+% \permanent\protected\def\closeopspacing {\setmathspacing \mathclosecode \mathoperatorcode }
+% \permanent\protected\def\closebinspacing {\setmathspacing \mathclosecode \mathbinarycode }
+% \permanent\protected\def\closerelspacing {\setmathspacing \mathclosecode \mathrelationcode }
+% \permanent\protected\def\closeopenspacing {\setmathspacing \mathclosecode \mathopencode }
+% \permanent\protected\def\closeclosespacing {\setmathspacing \mathclosecode \mathclosecode }
+% \permanent\protected\def\closepunctspacing {\setmathspacing \mathclosecode \mathpunctuationcode}
+% %permanent\protected\def\closeinnerspacing {\setmathspacing \mathclosecode \mathinnercode }
+% %permanent\protected\def\closefractionspacing {\setmathspacing \mathclosecode \mathfractioncode }
+% %permanent\protected\def\closeradicalspacing {\setmathspacing \mathclosecode \mathradicalcode }
+% \permanent\protected\def\closemiddlespacing {\setmathspacing \mathclosecode \mathmiddlecode }
+% %permanent\protected\def\closeaccentspacing {\setmathspacing \mathclosecode \mathaccentcode }
+%
+% \permanent\protected\def\punctordspacing {\setmathspacing \mathpunctuationcode \mathordinarycode }
+% \permanent\protected\def\punctopspacing {\setmathspacing \mathpunctuationcode \mathoperatorcode }
+% \permanent\protected\def\punctbinspacing {\setmathspacing \mathpunctuationcode \mathbinarycode }
+% \permanent\protected\def\punctrelspacing {\setmathspacing \mathpunctuationcode \mathrelationcode }
+% \permanent\protected\def\punctopenspacing {\setmathspacing \mathpunctuationcode \mathopencode }
+% \permanent\protected\def\punctclosespacing {\setmathspacing \mathpunctuationcode \mathclosecode }
+% \permanent\protected\def\punctpunctspacing {\setmathspacing \mathpunctuationcode \mathpunctuationcode}
+% %permanent\protected\def\punctinnerspacing {\setmathspacing \mathpunctuationcode \mathinnercode }
+% %permanent\protected\def\punctfractionspacing {\setmathspacing \mathpunctuationcode \mathfractioncode }
+% %permanent\protected\def\punctradicalspacing {\setmathspacing \mathpunctuationcode \mathradicalcode }
+% \permanent\protected\def\punctmiddlespacing {\setmathspacing \mathpunctuationcode \mathmiddlecode }
+% %permanent\protected\def\punctaccentspacing {\setmathspacing \mathpunctuationcode \mathaccentcode }
+%
+% %permanent\protected\def\innerordspacing {\setmathspacing \mathinnercode \mathordinarycode }
+% %permanent\protected\def\inneropspacing {\setmathspacing \mathinnercode \mathoperatorcode }
+% %permanent\protected\def\innerbinspacing {\setmathspacing \mathinnercode \mathbinarycode }
+% %permanent\protected\def\innerrelspacing {\setmathspacing \mathinnercode \mathrelationcode }
+% %permanent\protected\def\inneropenspacing {\setmathspacing \mathinnercode \mathopencode }
+% %permanent\protected\def\innerclosespacing {\setmathspacing \mathinnercode \mathclosecode }
+% %permanent\protected\def\innerpunctspacing {\setmathspacing \mathinnercode \mathpunctuationcode}
+% %permanent\protected\def\innerinnerspacing {\setmathspacing \mathinnercode \mathinnercode }
+% %permanent\protected\def\innerfractionspacing {\setmathspacing \mathinnercode \mathfractioncode }
+% %permanent\protected\def\innerradicalspacing {\setmathspacing \mathinnercode \mathradicalcode }
+% %permanent\protected\def\innermiddlespacing {\setmathspacing \mathinnercode \mathmiddlecode }
+% %permanent\protected\def\inneraccentspacing {\setmathspacing \mathinnercode \mathaccentcode }
+%
+% \permanent\protected\def\fractionordspacing {\setmathspacing \mathfractioncode \mathordinarycode }
+% \permanent\protected\def\fractionopspacing {\setmathspacing \mathfractioncode \mathoperatorcode }
+% \permanent\protected\def\fractionbinspacing {\setmathspacing \mathfractioncode \mathbinarycode }
+% \permanent\protected\def\fractionrelspacing {\setmathspacing \mathfractioncode \mathrelationcode }
+% \permanent\protected\def\fractionopenspacing {\setmathspacing \mathfractioncode \mathopencode }
+% \permanent\protected\def\fractionclosespacing {\setmathspacing \mathfractioncode \mathclosecode }
+% \permanent\protected\def\fractionpunctspacing {\setmathspacing \mathfractioncode \mathpunctuationcode}
+% %permanent\protected\def\fractioninnerspacing {\setmathspacing \mathfractioncode \mathinnercode }
+% %permanent\protected\def\fractionfractionspacing{\setmathspacing \mathfractioncode \mathfractioncode }
+% %permanent\protected\def\fractionradicalspacing {\setmathspacing \mathfractioncode \mathradicalcode }
+% \permanent\protected\def\fractionmiddlespacing {\setmathspacing \mathfractioncode \mathmiddlecode }
+% %permanent\protected\def\fractionaccentspacing {\setmathspacing \mathfractioncode \mathaccentcode }
+%
+% \permanent\protected\def\radicalordspacing {\setmathspacing \mathradicalcode \mathordinarycode }
+% \permanent\protected\def\radicalopspacing {\setmathspacing \mathradicalcode \mathoperatorcode }
+% \permanent\protected\def\radicalbinspacing {\setmathspacing \mathradicalcode \mathbinarycode }
+% \permanent\protected\def\radicalrelspacing {\setmathspacing \mathradicalcode \mathrelationcode }
+% \permanent\protected\def\radicalopenspacing {\setmathspacing \mathradicalcode \mathopencode }
+% \permanent\protected\def\radicalclosespacing {\setmathspacing \mathradicalcode \mathclosecode }
+% \permanent\protected\def\radicalpunctspacing {\setmathspacing \mathradicalcode \mathpunctuationcode}
+% %permanent\protected\def\radicalinnerspacing {\setmathspacing \mathradicalcode \mathinnercode }
+% %permanent\protected\def\radicalfractionspacing {\setmathspacing \mathradicalcode \mathfractioncode }
+% %permanent\protected\def\radicalradicalspacing {\setmathspacing \mathradicalcode \mathradicalcode }
+% \permanent\protected\def\radicalmiddlespacing {\setmathspacing \mathradicalcode \mathmiddlecode }
+% %permanent\protected\def\radicalaccentspacing {\setmathspacing \mathradicalcode \mathaccentcode }
+%
+% \permanent\protected\def\middleordspacing {\setmathspacing \mathmiddlecode \mathordinarycode }
+% \permanent\protected\def\middleopspacing {\setmathspacing \mathmiddlecode \mathoperatorcode }
+% \permanent\protected\def\middlebinspacing {\setmathspacing \mathmiddlecode \mathbinarycode }
+% \permanent\protected\def\middlerelspacing {\setmathspacing \mathmiddlecode \mathrelationcode }
+% \permanent\protected\def\middleopenspacing {\setmathspacing \mathmiddlecode \mathopencode }
+% \permanent\protected\def\middleclosespacing {\setmathspacing \mathmiddlecode \mathclosecode }
+% \permanent\protected\def\middlepunctspacing {\setmathspacing \mathmiddlecode \mathpunctuationcode}
+% %permanent\protected\def\middleinnerspacing {\setmathspacing \mathmiddlecode \mathinnercode }
+% %permanent\protected\def\middlefractionspacing {\setmathspacing \mathmiddlecode \mathfractioncode }
+% %permanent\protected\def\middleradicalspacing {\setmathspacing \mathmiddlecode \mathradicalcode }
+% \permanent\protected\def\middlemiddlespacing {\setmathspacing \mathmiddlecode \mathmiddlecode }
+% %permanent\protected\def\middleaccentspacing {\setmathspacing \mathmiddlecode \mathaccentcode }
+%
+% \permanent\protected\def\accentordspacing {\setmathspacing \mathaccentcode \mathordinarycode }
+% \permanent\protected\def\accentopspacing {\setmathspacing \mathaccentcode \mathoperatorcode }
+% \permanent\protected\def\accentbinspacing {\setmathspacing \mathaccentcode \mathbinarycode }
+% \permanent\protected\def\accentrelspacing {\setmathspacing \mathaccentcode \mathrelationcode }
+% \permanent\protected\def\accentopenspacing {\setmathspacing \mathaccentcode \mathopencode }
+% \permanent\protected\def\accentclosespacing {\setmathspacing \mathaccentcode \mathclosecode }
+% \permanent\protected\def\accentpunctspacing {\setmathspacing \mathaccentcode \mathpunctuationcode}
+% %permanent\protected\def\accentinnerspacing {\setmathspacing \mathaccentcode \mathinnercode }
+% %permanent\protected\def\accentfractionspacing {\setmathspacing \mathaccentcode \mathfractioncode }
+% %permanent\protected\def\accentradicalspacing {\setmathspacing \mathaccentcode \mathradicalcode }
+% \permanent\protected\def\accentmiddlespacing {\setmathspacing \mathaccentcode \mathmiddlecode }
+% %permanent\protected\def\accentaccentspacing {\setmathspacing \mathaccentcode \mathaccentcode }
%D In the end Mikael and I prefer this but we need a high level interface:
@@ -473,7 +497,7 @@
%D $ 1 \color[red]{+} 2$\par
%D \mathgroupingmode0
%D $ 1 {\red +} 2$\par
-%D $ 1 \mathbin{\red +} 2$\par
+%D $ 1 \mathbinary{\red +} 2$\par
%D $ 1 \color[red]{+} 2$\par
%D \stopTEXpage
%D \stoptyping
@@ -730,14 +754,6 @@
\advanceby\mathnestinglevel\plusone
\to \everymathematics
-%D A few compatibility helpers:
-
-\permanent\def\Umathbottomaccent{\Umathaccent \s!bottom }
-\permanent\def\Umathtopaccent {\Umathaccent \s!top }
-\permanent\def\Umathaccents {\Umathaccent \s!both } % strange highlighting
-
-\aliased\let\Umathbotaccent\Umathbottomaccent
-
%D The attributes that we will use (todo: pack some into one but uglier code):
\definesystemattribute[mathalphabet] [public]
@@ -1699,76 +1715,39 @@
% \permanent\protected\def\mathlimop#1{\mathatom \mathoperatorcode options "C0000 {#1}} % auto "40000 + "80000
% \permanent\protected\def\mathnolop#1{\mathatom \mathoperatorcode options "80000 {#1}}
-\aliased\let\mathnothing\firstofoneunexpanded
-\aliased\let\mathalpha \firstofoneunexpanded
+% \aliased\let\mathnothing\firstofoneunexpanded
+% \aliased\let\mathalpha \firstofoneunexpanded
+
+\ifdefined\mathop \else \aliased\let\mathop \normalmathoperator \aliased\let\normalmathop \normalmathoperator \fi
+\ifdefined\mathord \else \aliased\let\mathord \normalmathordinary \aliased\let\normalmathord \normalmathordinary \fi
+\ifdefined\mathbin \else \aliased\let\mathbin \normalmathbinary \aliased\let\normalmathbin \normalmathbinary \fi
+\ifdefined\mathrel \else \aliased\let\mathrel \normalmathrelation \aliased\let\normalmathrel \normalmathrelation \fi
+\ifdefined\mathpunct \else \aliased\let\mathpunct\normalmathpunctuation \aliased\let\normalmathpunct\normalmathpunctuation \fi
+\ifdefined\underline \else \aliased\let\underline\normalmathunderline \aliased\let\normalunderline\normalmathunderline \fi
+\ifdefined\overline \else \aliased\let\overline \normalmathoverline \aliased\let\normaloverline \normalmathoverline \fi
+
+\permanent\def\mathcodechecked#1%
+ {\numexpr
+ \iftok{#1}\emptytoks
+ \mathordinarycode
+ \orelse\ifchknum#1\or
+ \lastchknum
+ \orelse\ifchknum\begincsname math#1code\endcsname\or % maybe some day a hash for this
+ \lastchknum
+ \else
+ \mathordinarycode
+ \fi
+ \relax}
-% \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 ellipsis\endcsname\normalmathellipsis
-% \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.
-
-\installcorenamespace{mathcodecommand}
-
-% short:
-
-\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
-
-% 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}
-\permanent \def\mathcodechecked#1{\ifcsname math#1code\endcsname\lastnamedcs\else#1\fi}
+\permanent\def\mathcodenumber#1%
+ {\the\mathcodechecked{#1}}
+
+\permanent\protected\def\mathcodecommand#1%
+ {\mathatom \s!class \mathcodechecked{#1}}
+
+\def\math_class_by_parameter #1#2{\normalexpanded{\noexpand\mathcodechecked{#1#2}}}
+\def\math_atom_by_parameter #1{\normalexpanded{\noexpand\math_atom_by_parameter_indeed{#1\c!mathclass}}}
+\def\math_atom_by_parameter_indeed#1{\mathatom \s!class \mathcodechecked{#1}}
% \startlines
% $\mathopnolimits{\rm d}x$
@@ -1799,7 +1778,7 @@
\orelse\ifparameter#2\or
\frozen\protected\defcsname\??mathcommand#1\endcsname{\mathcodecommand{#2}{#4}}%
\else
- \frozen\protected\defcsname\??mathcommand#1\endcsname{\mathcodecommand{nothing}{#4}}%
+ \frozen\protected\defcsname\??mathcommand#1\endcsname{#4}%
\fi
\ifparameter#1\or % safeguard
\letcsname#1\expandafter\endcsname\csname\??mathcommand#1\endcsname
diff --git a/tex/context/base/mkxl/math-lop.mkxl b/tex/context/base/mkxl/math-lop.mkxl
index 327d663e8..d4dbfa448 100644
--- a/tex/context/base/mkxl/math-lop.mkxl
+++ b/tex/context/base/mkxl/math-lop.mkxl
@@ -136,7 +136,27 @@
\definemathoperator [ointc] [integrals] [\c!left="2232] % CLOCKWISE CONTOUR INTEGRAL
\definemathoperator [aointc] [integrals] [\c!left="2233] % ANTI CLOCKWISE CONTOUR INTEGRAL
-\definemathoperator [sum] [summations] [\c!left="2211] % N-ARY SUMMATION
+\definemathoperator [sumint] [integrals] [\c!left="2A0B] % Integral with sum
+\definemathoperator [barint] [integrals] [\c!left="2A0D] % Integral with bar
+\definemathoperator [doublebarint] [integrals] [\c!left="2A0E] % Integral with double bar
+\definemathoperator [slashint] [integrals] [\c!left="2A0F] % Integral with slash
+\definemathoperator [aodownintc] [integrals] [\c!left="2A11]
+\definemathoperator [rectangularpoleintc] [integrals] [\c!left="2A12]
+\definemathoperator [semicirclepoleintc] [integrals] [\c!left="2A13]
+\definemathoperator [circlepoleoutsideintc] [integrals] [\c!left="2A14]
+\definemathoperator [circlepoleinsideintc] [integrals] [\c!left="2A15]
+\definemathoperator [squareintc] [integrals] [\c!left="2A16]
+\definemathoperator [hookleftarrowint] [integrals] [\c!left="2A17]
+\definemathoperator [timesint] [integrals] [\c!left="2A18]
+\definemathoperator [capint] [integrals] [\c!left="2A19]
+\definemathoperator [cupint] [integrals] [\c!left="2A1A]
+\definemathoperator [upperint] [integrals] [\c!left="2A1B]
+\definemathoperator [lowerint] [integrals] [\c!left="2A1C]
+
+\definemathoperator [sum] [summations] [\c!left="2211] % N-ARY SUMMATION
+\definemathoperator [blackboardsum] [summations] [\c!left="2140] % blackboard summation
+\definemathoperator [modtwosum] [summations] [\c!left="2A0A] % modulo two summation
+
\definemathoperator [prod] [products] [\c!left="220F] % N-ARY PRODUCT
\definemathoperator [coprod] [products] [\c!left="2210] % N-ARY COPRODUCT
@@ -156,4 +176,15 @@
\definemathoperator [bigsqcup] [operators] [\c!left="2A06] % N-ARY SQUARE UNION OPERATOR
\definemathoperator [bigtimes] [operators] [\c!left="2A09] % N-ARY TIMES OPERATOR
+\definemathoperator [leftouterjoin] [operators] [\c!left="27D5] % left outer join
+\definemathoperator [rightouterjoin] [operators] [\c!left="27D6] % right outer join
+\definemathoperator [fullouterjoin] [operators] [\c!left="27D7] % full outer join
+\definemathoperator [bigbottom] [operators] [\c!left="27D8] % big bottom
+\definemathoperator [bigtop] [operators] [\c!left="27D9] % big top
+\definemathoperator [bigsolidus] [operators] [\c!left="29F8] % big solidus
+\definemathoperator [bigreversesolidus] [operators] [\c!left="29F9] % big reverse solidus
+\definemathoperator [bigdoublewedge] [operators] [\c!left="2A07] % big double wedge
+\definemathoperator [bigdoublevee] [operators] [\c!left="2A08] % big double vee
+
+
\protect \endinput
diff --git a/tex/context/base/mkxl/math-spa.lmt b/tex/context/base/mkxl/math-spa.lmt
index d26a3f6f8..5fa1a3742 100644
--- a/tex/context/base/mkxl/math-spa.lmt
+++ b/tex/context/base/mkxl/math-spa.lmt
@@ -34,6 +34,7 @@ local getdepth = nuts.getdepth
local getheight = nuts.getheight
local getlist = nuts.getlist
local setglue = nuts.setglue
+local setwhd = nuts.setwhd
local getdimensions = nuts.dimensions
local getnormalizedline = node.direct.getnormalizedline
local getbox = nuts.getbox
@@ -159,7 +160,10 @@ end
stages[3] = stages[2]
stages[4] = function(specification,stage)
- nuts.openup(specification,getlist(getbox(specification.box)))
+ local box = getbox(specification.box)
+ nuts.openup(specification,getlist(box))
+ local w, h, d = getdimensions(getlist(box),true) -- vertical
+ setwhd(box,w,h,d)
end
interfaces.implement {
@@ -174,6 +178,7 @@ interfaces.implement {
{ "inbetween", "dimension" },
{ "height", "dimension" },
{ "depth", "dimension" },
+ { "splitmethod" },
}
},
actions = function(specification)
diff --git a/tex/context/base/mkxl/math-stc.mklx b/tex/context/base/mkxl/math-stc.mklx
index 96ed80a89..e1c4fc90a 100644
--- a/tex/context/base/mkxl/math-stc.mklx
+++ b/tex/context/base/mkxl/math-stc.mklx
@@ -331,7 +331,7 @@
\edef\currentmathstackers{#category}%
\mathstackersparameter\c!left\relax
\dostarttagged\t!mstacker\currentmathstackers
- \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
+ \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\p_offset {\mathstackersparameter\c!offset}%
\edef\p_location {\mathstackersparameter\c!location}%
\edef\p_strut {\mathstackersparameter\c!strut}%
@@ -563,7 +563,7 @@
\fi
\mathstackersparameter\c!left\relax
\dostarttagged\t!mstacker\currentmathstackers
- \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
+ \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\m_math_stackers_text_middle {#text}%
%
\edef\p_offset {\mathstackersparameter\c!offset}%
@@ -750,7 +750,7 @@
{\math_stackers_start_group{#category}%
\mathstackersparameter\c!left\relax
\dostarttagged\t!mstacker\currentmathstackers
- \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
+ \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\currentmathstackers{#category}%
%
\edef\p_offset {\mathstackersparameter\c!offset}%
@@ -1020,8 +1020,8 @@
% \setupbodyfont[xits] \getbuffer
% \setupbodyfont[cambria] \getbuffer
-\immutable\protected\def\normaldoublebrace {\Umathaccents \zerocount \zerocount "23DE \zerocount \zerocount "23DF }
-\immutable\protected\def\normaldoubleparent{\Umathaccents \zerocount \zerocount "23DC \zerocount \zerocount "23DD }
+\immutable\protected\def\normaldoublebrace {\Umathaccent \s!both \zerocount \zerocount "23DE \zerocount \zerocount "23DF }
+\immutable\protected\def\normaldoubleparent{\Umathaccent \s!both \zerocount \zerocount "23DC \zerocount \zerocount "23DD }
% let's keep this
@@ -1291,7 +1291,7 @@
\ifempty\p_moffset \else
\mskip\p_moffset\relax
\fi
- \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
+ \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\usemathstackerscolorparameter\c!color
\Umathchar\zerocount\zerocount#codepoint}%
\ifempty\p_moffset \else
diff --git a/tex/context/base/mkxl/math-tag.lmt b/tex/context/base/mkxl/math-tag.lmt
index 2eb9327cf..128b85249 100644
--- a/tex/context/base/mkxl/math-tag.lmt
+++ b/tex/context/base/mkxl/math-tag.lmt
@@ -47,8 +47,6 @@ local getbottom = nuts.getbottom
local getchoice = nuts.getchoice
local getnucleus = nuts.getnucleus
-local getsub = nuts.getsub
-local getsup = nuts.getsup
local setattributes = nuts.setattributes
@@ -76,9 +74,10 @@ local fixedtopaccent_code = accentcodes.fixedtop
local fixedbottomaccent_code = accentcodes.fixedbottom
local fixedbothaccent_code = accentcodes.fixedboth
-local leftfence_code = fencecodes.left
-local middlefence_code = fencecodes.middle
-local rightfence_code = fencecodes.right
+local leftfence_code = fencecodes.left
+local middlefence_code = fencecodes.middle
+local rightfence_code = fencecodes.right
+local operatorfence_code = fencecodes.operator
local kerncodes = nodes.kerncodes
@@ -119,19 +118,31 @@ local report_tags = logs.reporter("structure","tags")
local process
+local function processnucleus(nucleus,prime)
+ if prime then
+ -- This should work wasn't it that browser handling of primes have an issue with
+ -- "big semi raised text" vs "small supposedly superscripted". So let's play safe
+ -- and use a superscript. Even then we get somewhat different positioning for the
+ -- same primed character in q sqrt and (e.g.) a sequential integral.
+ -- start_tagged("mrow", { prime = true })
+ start_tagged("msup", { prime = true })
+ process(nucleus)
+ process(prime)
+ stop_tagged()
+ else
+ process(nucleus)
+ end
+end
+
local function processsubsup(start)
-- At some point we might need to add an attribute signaling the
-- super- and subscripts because TeX and MathML use a different
-- order. The mrows are needed to keep mn's separated.
- local nucleus = getnucleus(start)
- local sup = getsup(start)
- local sub = getsub(start)
+ local nucleus, prime, sup, sub, presup, presub = getnucleus(start,true)
if sub then
if sup then
setattr(start,a_tagged,start_tagged("msubsup"))
- -- start_tagged("mrow")
- process(nucleus)
- -- stop_tagged()
+ processnucleus(nucleus,prime)
start_tagged("mrow", { subscript = true })
process(sub)
stop_tagged()
@@ -141,9 +152,7 @@ local function processsubsup(start)
stop_tagged()
else
setattr(start,a_tagged,start_tagged("msub"))
- -- start_tagged("mrow")
- process(nucleus)
- -- stop_tagged()
+ processnucleus(nucleus,prime)
start_tagged("mrow")
process(sub)
stop_tagged()
@@ -151,15 +160,13 @@ local function processsubsup(start)
end
elseif sup then
setattr(start,a_tagged,start_tagged("msup"))
- -- start_tagged("mrow")
- process(nucleus)
- -- stop_tagged()
+ processnucleus(nucleus,prime)
start_tagged("mrow")
process(sup)
stop_tagged()
stop_tagged()
else
- process(nucleus)
+ processnucleus(nucleus,prime)
end
end
@@ -216,6 +223,10 @@ end
-- only focus on structure and let the engine deal with the details. Another reason
-- to update this is that we can add some tracing (lmtx only).
+-- This has been working ok for quite but in 2023 it's tiem to have a look at it
+-- again and see to what extend we need to adapt to new features. Around the time
+-- PG's Panopticom was put on youtube.
+
process = function(start) -- we cannot use the processor as we have no finalizers (yet)
local mtexttag = nil
for start, id, subtype in nextnode, start do -- current
@@ -234,11 +245,12 @@ process = function(start) -- we cannot use the processor as we have no finalizer
if id == mathchar_code then
local char = getchar(start)
local code = getmathcodes(char)
+ local ch = chardata[char]
+ local mc = ch and ch.mathclass
local tag
+ local properties= { class = mc }
-- todo: we have way more now
if code == ordinary_mathcode then
- local ch = chardata[char]
- local mc = ch and ch.mathclass
if mc == "number" then
tag = "mn"
elseif mc == "variable" or not mc then -- variable is default
@@ -249,12 +261,19 @@ process = function(start) -- we cannot use the processor as we have no finalizer
else
tag = "mo"
end
+-- if mc == "open" or nc == "close" or mc == "middle" then
+-- properties = { maxsize = 1 }
+-- end
local a = getattr(start,a_mathcategory)
if a then
- setattr(start,a_tagged,start_tagged(tag,{ mathcategory = a }))
- else
- setattr(start,a_tagged,start_tagged(tag)) -- todo: a_mathcategory
+ -- todo / redo
+ if properties then
+ properties.mathcategory = a
+ else
+ properties = { mathcategory = a }
+ end
end
+ setattr(start,a_tagged,start_tagged(tag,properties))
stop_tagged()
-- showtag(start,id,false)
break -- okay?
@@ -470,7 +489,6 @@ process = function(start) -- we cannot use the processor as we have no finalizer
elseif id == fence_code then
local delimiter = getdelimiter(start)
if subtype == leftfence_code then
- -- left
local properties = { }
insert(fencesstack,properties)
setattr(start,a_tagged,start_tagged("mfenced",properties)) -- needs checking
@@ -485,7 +503,6 @@ process = function(start) -- we cannot use the processor as we have no finalizer
end
start_tagged("mrow") -- begin of subsequence
elseif subtype == middlefence_code then
- -- middle
if delimiter then
start_tagged("ignore")
local top = fencesstack[#fencesstack]
@@ -520,8 +537,20 @@ process = function(start) -- we cannot use the processor as we have no finalizer
end
stop_tagged() -- end of subsequence
stop_tagged()
- else
- -- can't happen
+ elseif subtype == operatorfence_code then
+ -- the same as left but different key
+ local properties = { }
+ insert(fencesstack,properties)
+ setattr(start,a_tagged,start_tagged("mfenced",properties)) -- needs checking
+ if delimiter then
+ local chr = getchar(delimiter)
+ if chr ~= 0 then
+ properties.operator = chr
+ end
+ process(delimiter)
+ end
+ processsubsup(start)
+ start_tagged("mrow") -- begin of subsequence
end
elseif id == radical_code then
local left = getleftdelimiter(start)
diff --git a/tex/context/base/mkxl/mult-sys.mkxl b/tex/context/base/mkxl/mult-sys.mkxl
index f04418e43..428a8ddcf 100644
--- a/tex/context/base/mkxl/mult-sys.mkxl
+++ b/tex/context/base/mkxl/mult-sys.mkxl
@@ -224,6 +224,7 @@
\definesystemconstant {forget}
\definesystemconstant {format}
\definesystemconstant {fraktur}
+\definesystemconstant {fraktion}
\definesystemconstant {full}
\definesystemconstant {f}
\definesystemconstant {global}
@@ -419,6 +420,7 @@
\definesystemconstant {unpack}
\definesystemconstant {unknown}
\definesystemconstant {Unicode}
+\definesystemconstant {unroll}
\definesystemconstant {upright}
\definesystemconstant {userdata}
\definesystemconstant {userpage}
diff --git a/tex/context/base/mkxl/node-ali.lmt b/tex/context/base/mkxl/node-ali.lmt
index 69b1e7aa0..510e56b8e 100644
--- a/tex/context/base/mkxl/node-ali.lmt
+++ b/tex/context/base/mkxl/node-ali.lmt
@@ -26,6 +26,7 @@ local getglue = nuts.getglue
local setglue = nuts.setglue
local getwhd = nuts.getwhd
local setwhd = nuts.setwhd
+local setpenalty = nuts.setpenalty
local getlist = nuts.getlist
local setlist = nuts.setlist
local setattrlist = nuts.setattrlist
@@ -54,6 +55,7 @@ local nextrecord = traversers.alignrecord
local nextunset = traversers.unset
local nextglyph = traversers.glyph
local nextglue = traversers.glue
+local nextpenalty = traversers.penalty
local nextboundary = traversers.boundary
local nextnode = traversers.node
local nextlist = traversers.list
@@ -75,6 +77,7 @@ local fontkern_code = nodes.kerncodes.fontkern
local row_code = nodes.listcodes.alignment -- should be row
local cell_code = nodes.listcodes.cell
local line_code = nodes.listcodes.line
+local linepenalty_code = nodes.penaltycodes.linepanalty
-- local preamble_pass <const> = tex.alignmentcontextcodes.preamble
-- local preroll_pass <const> = tex.alignmentcontextcodes.preroll
@@ -349,54 +352,79 @@ do
local a_location = attributes.system("mathnumberlocation")
local a_threshold = attributes.system("mathnumberthreshold")
+ local v_first = interfaces.variables.first
+ local v_last = interfaces.variables.last
+ local v_both = interfaces.variables.both
+
-- Here:
local function openup(specification,head)
- local inbetween = specification.inbetween or 0
- local height = specification.height or 0
- local depth = specification.depth or 0
- local lines = { }
+ local inbetween = specification.inbetween or 0
+ local height = specification.height or 0
+ local depth = specification.depth or 0
+ local splitmethod = specification.splitmethod or ""
+ local lines = { }
for n, id, subtype, list in nextlist, head do
lines[#lines+1] = { n, subtype, getwhd(n) }
end
- local t = #lines
- if t > 0 then
- local l = 1
+ local noflines = #lines
+ if noflines > 0 then
+ local currentline = 1
for n, subtype in nextglue, head do
-- one day we can decide what to do with intertext stuff based on the
-- subtype but not now ... on our agenda (intertext etc)
if subtype == baselineskip_code or subtype == lineskip_code then
+ local nextline = currentline + 1
local amount, stretch, shrink = getglue(n)
- local prevdp = lines[l] [5]
- local nextht = lines[l+1][4]
+ local prevdp = lines[currentline][5]
+ local nextht = lines[nextline][4]
local delta = 0
if prevdp < depth then
- setdepth(lines[l][1],depth)
+ setdepth(lines[currentline][1],depth)
delta = delta + (depth - prevdp)
end
if nextht < height then
- setheight(lines[l+1][1],height)
+ setheight(lines[nextline][1],height)
delta = delta + (height - nextht)
end
- if subtype == lineskip_code then
- setglue(n,inbetween,stretch,shrink)
+-- if subtype == lineskip_code then
+-- setglue(n,inbetween,stretch,shrink)
setsubtype(n,baselineskip_code)
- else
+-- else
setglue(n,amount+inbetween-delta,stretch,shrink)
- end
- l = l + 1
--- if l > t then
--- break
-- end
+ curline = nextline
+-- if currentline > noflines then
+-- break
+-- end
+ end
+ end
+ if splitmethod ~= "" then
+ local currentline = 0
+ for n, subtype in nextpenalty, head do
+ if subtype == linepenalty_code then
+ if l == 1 then
+ if splitmethod == v_both or splitmethod == v_first then
+print("FIRST")
+ setpenalty(n, 10000)
+ end
+ elseif l == noflines then
+ if splitmethod == v_both or splitmethod == v_last then
+print("LAST")
+ setpenalty(n, 10000)
+ end
+ end
+ curline = currentline
+ end
end
end
local firstht = lines[1][4]
- local lastdp = lines[t][5]
+ local lastdp = lines[noflines][5]
if firstht < height then
setheight(lines[1],height)
end
if lastdp < depth then
- setdepth(lines[t],depth)
+ setdepth(lines[noflines],depth)
end
end
end
diff --git a/tex/context/base/mkxl/node-mig.lmt b/tex/context/base/mkxl/node-mig.lmt
index 890a7efbb..3e5454784 100644
--- a/tex/context/base/mkxl/node-mig.lmt
+++ b/tex/context/base/mkxl/node-mig.lmt
@@ -49,6 +49,7 @@ local t_sweeps = 0
local trialtypesetting = context.trialtypesetting
function nodes.handlers.migrate(head,where)
+ -- is this still needed
if head and not trialtypesetting() and where == "alignment" then
if trace_migrations then
report_nodes("migration sweep %a",where)
diff --git a/tex/context/base/mkxl/page-brk.mkxl b/tex/context/base/mkxl/page-brk.mkxl
index 31c7e64a4..23ffc872d 100644
--- a/tex/context/base/mkxl/page-brk.mkxl
+++ b/tex/context/base/mkxl/page-brk.mkxl
@@ -370,7 +370,7 @@
\relax}
\permanent\tolerant\protected\def\checkpage[#1]#*[#2]%
- {\relax % needed before \if
+ {\relax % look ahead prevention
\endgraf
\triggerpagebuilder
\relax
@@ -466,14 +466,17 @@
\definepagechecker[\s!unknown:2][\s!unknown:0][\c!method=2]
\definepagechecker[\s!unknown:3][\s!unknown:0][\c!method=3]
-\permanent\tolerant\protected\def\testpage [#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:1][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} %
-\permanent\tolerant\protected\def\testpageonly[#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:2][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % no penalties added to the mvl
-\permanent\tolerant\protected\def\testpagesync[#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:3][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % force sync
+% the \relax prevents premature expansion in case of lookahead
+
+\permanent\tolerant\protected\def\testpage [#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:1][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} %
+\permanent\tolerant\protected\def\testpageonly[#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:2][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % no penalties added to the mvl
+\permanent\tolerant\protected\def\testpagesync[#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:3][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % force sync
%D Test column breaks.
\permanent\tolerant\protected\def\testcolumn[#1]#*[#2]%
- {\ifdefined\page_otr_command_test_column
+ {\relax % look ahead prevention
+ \ifdefined\page_otr_command_test_column
\ifparameter#2\or
\page_otr_command_test_column[#1][#2]%
\else
diff --git a/tex/context/base/mkxl/spac-ali.mkxl b/tex/context/base/mkxl/spac-ali.mkxl
index 141adff0a..6ca9e5e55 100644
--- a/tex/context/base/mkxl/spac-ali.mkxl
+++ b/tex/context/base/mkxl/spac-ali.mkxl
@@ -1253,6 +1253,9 @@
\letcsname\??alignsimplereverse\v!flushright\endcsname\spac_align_simple_left
\letcsname\??alignsimplereverse\v!middle \endcsname\spac_align_simple_middle
+\protected\def\spac_align_simple#1%
+ {\begincsname\??alignsimple#1\endcsname}
+
\permanent\protected\def\simplealignedbox#1#2%
{\hbox \ifdim#1>\zeropoint to #1
\ifcsname\??alignsimple#2\endcsname
diff --git a/tex/context/base/mkxl/spac-prf.mklx b/tex/context/base/mkxl/spac-prf.mklx
index 6b4a966f2..824b14ca7 100644
--- a/tex/context/base/mkxl/spac-prf.mklx
+++ b/tex/context/base/mkxl/spac-prf.mklx
@@ -20,7 +20,11 @@
\unprotect
-\registerctxluafile{spac-prf}{autosuffix}
+\doiffileelse{spac-prf-new.lmt}{
+ \registerctxluafile{spac-prf-new}{autosuffix}
+} {
+ \registerctxluafile{spac-prf}{autosuffix}
+}
\definesystemattribute[profilemethod][public]
@@ -52,13 +56,15 @@
\c!distance=\zeropoint,
\c!factor=\plusone]
-\defineprofile[halffixed] [\v!fixed][\c!factor=\plustwo]
-\defineprofile[quarterfixed][\v!fixed][\c!factor=\plusfour]
-\defineprofile[eightsfixed] [\v!fixed][\c!factor=\pluseight]
+\appendtoks
+ \ifcstok{\profileparameter\c!define}\v!yes
+ \frozen\protected\edefcsname\e!start\currentprofile\endcsname{\spac_profile_start{\currentprofile}}%
+ \frozen\protected\defcsname \e!stop \currentprofile\endcsname{\spac_profile_stop}%
+ \fi
+\to \everydefineprofile
-\permanent\protected\def\setprofile[#profile]%
- {\edef\currentprofile{#profile}%
- \clf_setprofile
+\def\spac_profile_set
+ {\clf_setprofile
name {\currentprofile}%
height \dimexpr\profileparameter\c!height\relax
depth \dimexpr\profileparameter\c!depth\relax
@@ -68,6 +74,36 @@
method {\profileparameter\c!method}%
\relax}
+\tolerant\protected\def\spac_profile_start#profile#spacer[#settings]%
+ {\begingroup
+ \ifparameter#settings\or
+ \edef\currentprofile{#profile}%
+ \setupcurrentprofile[#settings]%
+ \orelse\ifhastok={#profile}%
+ \let\currentprofile\v!none
+ \setupcurrentprofile[#profile]%
+ \else
+ \edef\currentprofile{#profile}%
+ \fi
+ \spac_profile_set
+ \par
+ \profileparameter\c!before}
+
+\protected\def\spac_profile_stop
+ {\par % otherwise not applied
+ \profileparameter\c!after
+ \endgroup}
+
+\permanent\protected\def\startprofile[#profile]%
+ {\spac_profile_start{#profile}}
+
+\permanent\protected\def\stopprofile
+ {\spac_profile_stop}
+
+\permanent\protected\def\setprofile[#profile]%
+ {\edef\currentprofile{#profile}%
+ \spac_profile_set}
+
\permanent\protected\def\resetprofile
{\c_attr_profilemethod\attributeunsetvalue}
@@ -110,4 +146,8 @@
\relax
\endgroup}
+\defineprofile[halffixed] [\v!fixed][\c!factor=\plustwo]
+\defineprofile[quarterfixed][\v!fixed][\c!factor=\plusfour]
+\defineprofile[eightsfixed] [\v!fixed][\c!factor=\pluseight]
+
\protect \endinput
diff --git a/tex/context/base/mkxl/strc-lst.lmt b/tex/context/base/mkxl/strc-lst.lmt
new file mode 100644
index 000000000..467d916d8
--- /dev/null
+++ b/tex/context/base/mkxl/strc-lst.lmt
@@ -0,0 +1,1512 @@
+if not modules then modules = { } end modules ['strc-lst'] = {
+ version = 1.001,
+ comment = "companion to strc-lst.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- when all datastructures are stable a packer will be added which will
+-- bring down memory consumption a bit; we can use for instance a pagenumber,
+-- section, metadata cache (internal then has to move up one level) or a
+-- shared cache [we can use a fast and stupid serializer]
+
+-- todo: tag entry in list is crap
+--
+-- move more to commands
+
+local tonumber, type, next = tonumber, type, next
+local concat, insert, remove, sort = table.concat, table.insert, table.remove, table.sort
+local lpegmatch = lpeg.match
+
+local setmetatableindex = table.setmetatableindex
+local sortedkeys = table.sortedkeys
+
+local settings_to_set = utilities.parsers.settings_to_set
+local allocate = utilities.storage.allocate
+local checked = utilities.storage.checked
+
+local trace_lists = false trackers.register("structures.lists", function(v) trace_lists = v end)
+
+local report_lists = logs.reporter("structure","lists")
+
+local context = context
+local commands = commands
+local implement = interfaces.implement
+local conditionals = tex.conditionals
+
+local ctx_latelua = context.latelua
+
+local cheat = true
+
+local structures = structures
+local lists = structures.lists
+local sections = structures.sections
+local helpers = structures.helpers
+local documents = structures.documents
+local tags = structures.tags
+local counters = structures.counters
+local references = structures.references
+
+local collected = allocate()
+local tobesaved = allocate()
+local cached = allocate()
+local pushed = allocate()
+local kinds = allocate()
+local names = allocate()
+
+lists.collected = collected
+lists.tobesaved = tobesaved
+
+lists.enhancers = lists.enhancers or { }
+-----.internals = allocate(lists.internals or { }) -- to be checked
+lists.ordered = allocate(lists.ordered or { }) -- to be checked
+lists.cached = cached
+lists.pushed = pushed
+lists.kinds = kinds
+lists.names = names
+
+local sorters = sorters
+local sortstripper = sorters.strip
+local sortsplitter = sorters.splitters.utf
+local sortcomparer = sorters.comparers.basic
+
+local sectionblocks = allocate()
+lists.sectionblocks = sectionblocks
+
+references.specials = references.specials or { }
+
+local matchingtilldepth = sections.matchingtilldepth
+local numberatdepth = sections.numberatdepth
+local getsectionlevel = sections.getlevel
+local typesetnumber = sections.typesetnumber
+local autosectiondepth = sections.autodepth
+
+local variables = interfaces.variables
+
+local v_all = variables.all
+local v_reference = variables.reference
+local v_title = variables.title
+local v_command = variables.command
+local v_text = variables.text
+local v_current = variables.current
+local v_previous = variables.previous
+local v_intro = variables.intro
+local v_here = variables.here
+local v_component = variables.component
+local v_product = variables.product
+local v_local = variables["local"]
+local v_default = variables.default
+
+local cheats = {
+ [variables.fit] = true,
+ [variables.tight] = true,
+}
+
+local function zerostrippedconcat(t,separator)
+ local f = 1
+ local l = #t
+ for i=f,l do
+ if t[i] == 0 then
+ f = f + 1
+ end
+ end
+ for i=l,f,-1 do
+ if t[i] == 0 then
+ l = l - 1
+ end
+ end
+ return concat(t,separator,f,l)
+end
+
+-- -- -- -- -- --
+
+local function initializer()
+ -- create a cross reference between internal references
+ -- and list entries
+ local collected = lists.collected
+ local internals = checked(references.internals)
+ local ordered = lists.ordered
+ local usedinternals = references.usedinternals
+ local blockdone = { }
+ local lastblock = nil
+ for i=1,#collected do
+ local c = collected[i]
+ local m = c.metadata
+ local r = c.references
+ if m then
+ -- access by internal reference
+ if r then
+ local internal = r.internal
+ if internal then
+ internals[internal] = c
+ usedinternals[internal] = r.used
+ end
+ local block = r.block
+ if not block then
+ -- shouldn't happen
+ elseif lastblock == block then
+ -- we're okay
+ elseif lastblock then
+ if blockdone[block] then
+ report_lists("out of order sectionsblocks, maybe use \\setsectionblock")
+ else
+ blockdone[block] = true
+ sectionblocks[#sectionblocks+1] = block
+ end
+ lastblock = block
+ elseif not blockdone[block] then
+ blockdone[block] = true
+ sectionblocks[#sectionblocks+1] = block
+ lastblock = block
+ end
+ end
+ -- access by order in list
+ local kind = m.kind
+ local name = m.name
+ if kind and name then
+ local ok = ordered[kind]
+ if ok then
+ local on = ok[name]
+ if on then
+ on[#on+1] = c
+ else
+ ok[name] = { c }
+ end
+ else
+ ordered[kind] = { [name] = { c } }
+ end
+ kinds[kind] = true
+ names[name] = true
+ elseif kind then
+ kinds[kind] = true
+ elseif name then
+ names[name] = true
+ end
+ end
+ if r then
+ r.listindex = i -- handy to have
+ end
+ end
+end
+
+local function finalizer()
+ local flaginternals = references.flaginternals
+ local usedviews = references.usedviews
+ for i=1,#tobesaved do
+ local r = tobesaved[i].references
+ if r then
+ local i = r.internal
+ local f = flaginternals[i]
+ local v = usedviews[i]
+ if cheat and v and cheats[v] then -- cheats check added, to be tested by RKB
+ -- this permits runs=2 with interactivity
+ r.view = v
+ end
+ if f then
+ r.used = v or true
+ end
+ end
+ end
+end
+
+job.register('structures.lists.collected', tobesaved, initializer, finalizer)
+
+local groupindices = setmetatableindex("table")
+
+function lists.groupindex(name,group)
+ local groupindex = groupindices[name]
+ return groupindex and groupindex[group] or 0
+end
+
+-- we could use t (as hash key) in order to check for dup entries
+
+function lists.addto(t) -- maybe more more here (saves parsing at the tex end)
+ local metadata = t.metadata
+ local userdata = t.userdata
+ local numberdata = t.numberdata
+ if userdata and type(userdata) == "string" then
+ t.userdata = helpers.touserdata(userdata)
+ end
+ if not metadata.level then
+ metadata.level = structures.sections.currentlevel() -- this is not used so it will go away
+ end
+ --
+ -- if not conditionals.inlinelefttoright then
+ -- metadata.idir = "r2l"
+ -- end
+ -- if not conditionals.displaylefttoright then
+ -- metadata.ddir = "r2l"
+ -- end
+ --
+ if numberdata then
+ local numbers = numberdata.numbers
+ if type(numbers) == "string" then
+ counters.compact(numberdata,numbers,numberdata.level)
+ end
+ end
+ local group = numberdata and numberdata.group
+ local name = metadata.name
+ local kind = metadata.kind
+ if not group then
+ -- forget about it
+ elseif group == "" then
+ group, numberdata.group = nil, nil
+ else
+ local groupindex = groupindices[name][group]
+ if groupindex then
+ numberdata.numbers = cached[groupindex].numberdata.numbers
+ end
+ end
+ local setcomponent = references.setcomponent
+ if setcomponent then
+ setcomponent(t) -- can be inlined
+ end
+ local r = t.references
+ if r and not r.section then
+ r.section = structures.sections.currentid()
+ end
+ local b = r and t.block
+ if r and not b then
+ local s = r.section
+ if s then
+ s = structures.sections.tobesaved[s]
+ r.block = s and s.block or nil
+ end
+ end
+ local i = r and r.internal or 0 -- brrr
+ if r and kind and name then
+ local tag = tags.getid(kind,name)
+ if tag and tag ~= "?" then
+ r.tag = tag -- todo: use internal ... is unique enough
+ end
+ end
+ local p = pushed[i]
+ if not p then
+ p = #cached + 1
+ cached[p] = helpers.simplify(t)
+ pushed[i] = p
+ if r then
+ r.listindex = p
+ end
+ end
+ if group then
+ groupindices[name][group] = p
+ end
+ if trace_lists then
+ report_lists("added %a, internal %a",name,p)
+ end
+ return p
+end
+
+function lists.discard(n)
+ n = tonumber(n)
+ if not n then
+ -- maybe an error message
+ elseif n == #cached then
+ cached[n] = nil
+ n = n - 1
+ while n > 0 and cached[n] == false do
+ cached[n] = nil -- collect garbage
+ n = n - 1
+ end
+ else
+ cached[n] = false
+ end
+end
+
+function lists.iscached(n)
+ return cached[tonumber(n)]
+end
+
+-- this is the main pagenumber enhancer
+
+local enhanced = { }
+
+local synchronizepage = function(r) -- bah ... will move
+ synchronizepage = references.synchronizepage
+ return synchronizepage(r)
+end
+
+local function enhancelist(specification)
+ local n = specification.n
+ local l = cached[n]
+ if not l then
+ report_lists("enhancing %a, unknown internal",n)
+ elseif enhanced[n] then
+ if trace_lists then
+ report_lists("enhancing %a, name %a, duplicate ignored",n,name)
+ end
+ else
+ local metadata = l.metadata
+ local references = l.references
+ --
+ l.directives = nil -- might change
+ -- save in the right order (happens at shipout)
+ lists.tobesaved[#lists.tobesaved+1] = l
+ -- default enhancer (cross referencing)
+ synchronizepage(references)
+ -- tags
+ local kind = metadata.kind
+ local name = metadata.name
+ if trace_lists then
+ report_lists("enhancing %a, name %a, page %a",n,name,references.realpage or 0)
+ end
+-- if references then
+-- -- is this used ?
+-- local tag = tags.getid(kind,name)
+-- if tag and tag ~= "?" then
+-- references.tag = tag
+-- end
+-- end
+ -- specific enhancer (kind of obsolete)
+ local enhancer = kind and lists.enhancers[kind]
+ if enhancer then
+ enhancer(l)
+ end
+ --
+ enhanced[n] = true
+ return l
+ end
+end
+
+lists.enhance = enhancelist
+
+-- we can use level instead but we can also decide to remove level from the metadata
+
+local nesting = { }
+
+function lists.pushnesting(i)
+ local parent = lists.result[i]
+ local name = parent.metadata.name
+ local numberdata = parent and parent.numberdata
+ local numbers = numberdata and numberdata.numbers
+ local number = numbers and numbers[getsectionlevel(name)] or 0
+ insert(nesting, {
+ number = number,
+ name = name,
+ result = lists.result,
+ parent = parent
+ })
+end
+
+function lists.popnesting()
+ local old = remove(nesting)
+ if old then
+ lists.result = old.result
+ else
+ report_lists("nesting error")
+ end
+end
+
+-- Historically we had blocks but in the mkiv approach that could as well be a level
+-- which would simplify things a bit.
+
+local splitter = lpeg.splitat(":") -- maybe also :: or have a block parameter
+
+local listsorters = {
+ [v_command] = function(a,b)
+ if a.metadata.kind == "command" or b.metadata.kind == "command" then
+ return a.references.internal < b.references.internal
+ else
+ return a.references.order < b.references.order
+ end
+ end,
+ [v_all] = function(a,b)
+ return a.references.internal < b.references.internal
+ end,
+ [v_title] = function(a,b)
+ local da = a.titledata
+ local db = b.titledata
+ if da and db then
+ local ta = da.title
+ local tb = db.title
+ if ta and tb then
+ local sa = da.split
+ if not sa then
+ sa = sortsplitter(sortstripper(ta))
+ da.split = sa
+ end
+ local sb = db.split
+ if not sb then
+ sb = sortsplitter(sortstripper(tb))
+ db.split = sb
+ end
+ return sortcomparer(da,db) == -1
+ end
+ end
+ return a.references.internal < b.references.internal
+ end
+}
+
+-- was: names, criterium, number, collected, forced, nested, sortorder
+
+local filters = setmetatableindex(function(t,k) return t[v_default] end)
+
+local function filtercollected(specification)
+ --
+ local names = specification.names or { }
+ local criterium = specification.criterium or v_default
+ local number = 0 -- specification.number
+ local reference = specification.reference or ""
+ local collected = specification.collected or lists.collected
+ local forced = specification.forced or { }
+ local nested = specification.nested or false
+ local sortorder = specification.sortorder or specification.order
+ --
+ local numbers = documents.data.numbers
+ local depth = documents.data.depth
+ local block = false -- all
+ local wantedblock, wantedcriterium = lpegmatch(splitter,criterium) -- block:criterium
+ if wantedblock == "" or wantedblock == v_all or wantedblock == v_text then
+ criterium = wantedcriterium ~= "" and wantedcriterium or criterium
+ elseif not wantedcriterium then
+ block = documents.data.block
+ else
+ block = wantedblock
+ criterium = wantedcriterium
+ end
+ if block == "" then
+ block = false
+ end
+ if type(names) == "string" then
+ names = settings_to_set(names)
+ end
+ local all = not next(names) or names[v_all] or false
+ --
+ specification.names = names
+ specification.criterium = criterium
+ specification.number = 0 -- obsolete
+ specification.reference = reference -- new
+ specification.collected = collected
+ specification.forced = forced -- todo: also on other branched, for the moment only needed for bookmarks
+ specification.nested = nested
+ specification.sortorder = sortorder
+ specification.numbers = numbers
+ specification.depth = depth
+ specification.block = block
+ specification.all = all
+ --
+ if specification.atmost then
+ criterium = v_text
+ end
+ --
+ if trace_lists then
+ report_lists("filtering names %,t, criterium %a, block %a",sortedkeys(names), criterium, block or "*")
+ end
+ local result = filters[criterium](specification)
+ if trace_lists then
+ report_lists("criterium %a, block %a, found %a",specification.criterium, specification.block or "*", #result)
+ end
+ --
+ local levels = tonumber(specification.levels)
+ if levels then
+ local minlevel = 1000
+ local found = result
+ local nofresult = #result
+ for i=1,nofresult do
+ local v = found[i]
+ local l = v.metadata.level or 1
+ if l < minlevel then
+ minlevel = l
+ end
+ end
+ local maxlevel = minlevel + levels - 1
+ result = { }
+ nofresult = 0
+ for i=1,#found do
+ local v = found[i]
+ local l = v.metadata.level or 1
+ if l >= minlevel and l <= maxlevel then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ --
+ if sortorder then -- experiment
+ local sorter = listsorters[sortorder]
+ if sorter then
+ if trace_lists then
+ report_lists("sorting list using method %a",sortorder)
+ end
+ for i=1,#result do
+ result[i].references.order = i
+ end
+ sort(result,sorter)
+ end
+ end
+ --
+ return result
+end
+
+filters[v_intro] = function(specification)
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local all = specification.all
+ local names = specification.names
+ for i=1,#collected do
+ local v = collected[i]
+ local metadata = v.metadata
+ if metadata and (all or names[metadata.name or false]) then
+ local r = v.references
+ if r and r.section == 0 then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ return result
+end
+
+filters[v_reference] = function(specification)
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local names = specification.names
+ local sections = sections.collected
+ local reference = specification.reference
+ if reference ~= "" then
+ local prefix, rest = lpegmatch(references.prefixsplitter,reference) -- p::r
+ local r = prefix and rest and references.derived[prefix][rest] or references.derived[""][reference]
+ local s = r and r.numberdata -- table ref !
+ if s then
+ local depth = getsectionlevel(r.metadata.name)
+ local numbers = s.numbers
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and (not block or not r.block or block == r.block) then
+ local metadata = v.metadata
+ if metadata and names[metadata.name or false] then
+ local sectionnumber = (r.section == 0) or sections[r.section]
+ if sectionnumber then
+ if matchingtilldepth(depth,numbers,sectionnumber.numbers) then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ else
+ report_lists("unknown reference %a specified",reference)
+ end
+ else
+ report_lists("no reference specified")
+ end
+ return result
+end
+
+-- maybe:
+--
+-- filters[v_reference] = function(specification)
+-- local collected = specification.collected
+-- local result = { }
+-- local nofresult = 0
+-- local names = specification.names
+-- local sections = sections.collected
+-- local reference = specification.reference
+-- if reference ~= "" then
+-- local split = references.splitreference(reference)
+-- if split then
+-- local prefix = split and split.outer
+-- local rest = split and split.inner
+-- if prefix and rest then
+-- local d = references.derived
+-- local r = (d[prefix] and d[prefix][rest]) or (d[""] and d[""][reference])
+-- local s = r and r.numberdata -- table ref !
+-- if s then
+-- local depth = getsectionlevel(r.metadata.name)
+-- local numbers = s.numbers
+-- for i=1,#collected do
+-- local v = collected[i]
+-- local r = v.references
+-- if r and (not block or not r.block or block == r.block) then
+-- local metadata = v.metadata
+-- if metadata and names[metadata.name or false] then
+-- local sectionnumber = (r.section == 0) or sections[r.section]
+-- if sectionnumber then
+-- if matchingtilldepth(depth,numbers,sectionnumber.numbers) then
+-- nofresult = nofresult + 1
+-- result[nofresult] = v
+-- end
+-- end
+-- end
+-- end
+-- end
+-- else
+-- report_lists("unknown reference %a specified",reference)
+-- end
+-- end
+-- end
+-- else
+-- report_lists("no reference specified")
+-- end
+-- return result
+-- end
+
+filters[v_all] = function(specification)
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local block = specification.block
+ local all = specification.all
+ local forced = specification.forced
+ local names = specification.names
+ local sections = sections.collected
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and (not block or not r.block or block == r.block) then
+ local metadata = v.metadata
+ if metadata then
+ local name = metadata.name or false
+ local sectionnumber = (r.section == 0) or sections[r.section]
+ if forced[name] or (sectionnumber and not metadata.nolist and (all or names[name])) then -- and not sectionnumber.hidenumber then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ return result
+end
+
+filters[v_text] = filters[v_all]
+
+filters[v_current] = function(specification)
+ if specification.depth == 0 then
+ specification.nested = false
+ specification.criterium = v_intro
+ return filters[v_intro](specification)
+ end
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local depth = specification.depth
+ local block = specification.block
+ local all = specification.all
+ local names = specification.names
+ local numbers = specification.numbers
+ local sections = sections.collected
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and (not block or not r.block or block == r.block) then
+ local sectionnumber = sections[r.section]
+ if sectionnumber then -- and not sectionnumber.hidenumber then
+ local cnumbers = sectionnumber.numbers
+ local metadata = v.metadata
+ if cnumbers then
+ if metadata and not metadata.nolist and (all or names[metadata.name or false]) and #cnumbers > depth then
+ local ok = true
+ for d=1,depth do
+ local cnd = cnumbers[d]
+ if not (cnd == 0 or cnd == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ return result
+end
+
+filters[v_here] = function(specification)
+ -- this is quite dirty ... as cnumbers is not sparse we can misuse #cnumbers
+ if specification.depth == 0 then
+ specification.nested = false
+ specification.criterium = v_intro
+ return filters[v_intro](specification)
+ end
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local depth = specification.depth
+ local block = specification.block
+ local all = specification.all
+ local names = specification.names
+ local numbers = specification.numbers
+ local sections = sections.collected
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r then -- and (not block or not r.block or block == r.block) then
+ local sectionnumber = sections[r.section]
+ if sectionnumber then -- and not sectionnumber.hidenumber then
+ local cnumbers = sectionnumber.numbers
+ local metadata = v.metadata
+ if cnumbers then
+ if metadata and not metadata.nolist and (all or names[metadata.name or false]) and #cnumbers >= depth then
+ local ok = true
+ for d=1,depth do
+ local cnd = cnumbers[d]
+ if not (cnd == 0 or cnd == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ return result
+end
+
+filters[v_previous] = function(specification)
+ if specification.depth == 0 then
+ specification.nested = false
+ specification.criterium = v_intro
+ return filters[v_intro](specification)
+ end
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local block = specification.block
+ local all = specification.all
+ local names = specification.names
+ local numbers = specification.numbers
+ local sections = sections.collected
+ local depth = specification.depth
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and (not block or not r.block or block == r.block) then
+ local sectionnumber = sections[r.section]
+ if sectionnumber then -- and not sectionnumber.hidenumber then
+ local cnumbers = sectionnumber.numbers
+ local metadata = v.metadata
+ if cnumbers then
+ if metadata and not metadata.nolist and (all or names[metadata.name or false]) and #cnumbers >= depth then
+ local ok = true
+ for d=1,depth-1 do
+ local cnd = cnumbers[d]
+ if not (cnd == 0 or cnd == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ return result
+end
+
+filters[v_local] = function(specification)
+ local numbers = specification.numbers
+ local nested = nesting[#nesting]
+ if nested then
+ return filtercollected {
+ names = specification.names,
+ criterium = nested.name,
+ collected = specification.collected,
+ forced = specification.forced,
+ nested = nested,
+ sortorder = specification.sortorder,
+ }
+ else
+ specification.criterium = autosectiondepth(numbers) == 0 and v_all or v_current
+ specification.nested = false
+ return filtercollected(specification) -- rechecks, so better (for determining all)
+ end
+end
+
+filters[v_component] = function(specification)
+ -- special case, no structure yet
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local all = specification.all
+ local names = specification.names
+ local component = resolvers.jobs.currentcomponent() or ""
+ if component ~= "" then
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ local m = v.metadata
+ if r and r.component == component and (m and names[m.name] or all) then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ return result
+end
+
+filters[v_product] = function(specification)
+ local reference = specification.reference
+ if reference and reference ~= "" then
+-- local utilitydata = job.loadother(reference,true)
+ local fullname = file.replacesuffix(reference,"tuc")
+ if lfs.isfile(fullname) then
+ local utilitydata = job.loadother(fullname)
+ if utilitydata then
+ local collected = utilitydata.structures.lists.collected or { }
+ setmetatableindex(collected,{ external = reference })
+ return collected
+ end
+ end
+ end
+ return { }
+end
+
+-- local number = tonumber(number) or numberatdepth(depth) or 0
+-- if number > 0 then
+-- ...
+-- end
+
+filters[v_default] = function(specification) -- is named
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ ----- depth = specification.depth
+ local block = specification.block
+ local criterium = specification.criterium
+ local all = specification.all
+ local names = specification.names
+ local numbers = specification.numbers
+ local sections = sections.collected
+ local reference = specification.reference
+ local nested = specification.nested
+ --
+ if reference then
+ reference = tonumber(reference)
+ end
+ --
+ local depth = getsectionlevel(criterium)
+ local pnumbers = nil
+ local pblock = block
+ local parent = nested and nested.parent
+ --
+ if parent then
+ pnumbers = parent.numberdata.numbers or pnumbers -- so local as well as nested
+ pblock = parent.references.block or pblock
+ if trace_lists then
+ report_lists("filtering by block %a and section %a",pblock,criterium)
+ end
+ end
+ --
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+-- inspect(v)
+ if r and (not block or not r.block or pblock == r.block) then
+ local sectionnumber = sections[r.section]
+ if sectionnumber then
+ local metadata = v.metadata
+ local cnumbers = sectionnumber.numbers
+ if cnumbers then
+ if all or names[metadata.name or false] then
+ if reference then
+ -- filter by number
+ if reference == cnumbers[depth] then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ else
+ if #cnumbers >= depth and matchingtilldepth(depth,cnumbers,pnumbers) then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ return result
+end
+
+-- names, criterium, number, collected, forced, nested, sortorder) -- names is hash or string
+
+lists.filter = filtercollected
+
+lists.result = { }
+
+function lists.getresult(r)
+ return lists.result[r]
+end
+
+function lists.process(specification)
+ local result = filtercollected(specification)
+ local total = #result
+ lists.result = result
+ if total > 0 then
+ local usedinternals = references.usedinternals
+ local usedviews = references.usedviews
+ local specials = settings_to_set(specification.extras or "")
+ specials = next(specials) and specials or nil
+ for i=1,total do
+ local listentry = result[i]
+ local metadata = listentry.metadata
+ local numberdata = listentry.numberdata
+ local references = listentry.references
+ local special = specials and numberdata and specials[zerostrippedconcat(numberdata.numbers,".")] or ""
+ if cheat and references then
+ -- this permits runs=2 with interactivity
+ local internal = references.internal
+ usedinternals[internal] = true
+ usedviews [internal] = references.view
+ end
+ context.strclistsentryprocess(metadata.name,metadata.kind,i,special)
+ end
+ end
+end
+
+function lists.analyze(specification)
+ lists.result = filtercollected(specification)
+end
+
+function lists.userdata(name,r,tag) -- to tex (todo: xml)
+ local result = lists.result[r]
+ if result then
+ local userdata = result.userdata
+ local str = userdata and userdata[tag]
+ if str then
+ return str, result.metadata
+ end
+ end
+end
+
+function lists.uservalue(name,r,tag,default) -- to lua
+ local str = lists.result[r]
+ if str then
+ str = str.userdata
+ end
+ if str then
+ str = str[tag]
+ end
+ return str or default
+end
+
+function lists.size()
+ return #lists.result
+end
+
+function lists.external(n)
+ return lists.result.external or ""
+end
+
+function lists.location(n)
+ local l = lists.result[n]
+ return l and l.references.internal or n
+end
+
+function lists.label(n,default)
+ local l = lists.result[n]
+ local t = l.titledata
+ return t and t.label or default or ""
+end
+
+function lists.sectionnumber(name,n,spec)
+ local data = lists.result[n]
+ local sectiondata = sections.collected[data.references.section]
+ -- hm, prefixnumber?
+ typesetnumber(sectiondata,"prefix",spec,sectiondata) -- data happens to contain the spec too
+end
+
+-- some basics (todo: helpers for pages)
+
+function lists.title(name,n,tag) -- tag becomes obsolete
+ local data = lists.result[n]
+ if data then
+ local titledata = data.titledata
+ if titledata then
+ helpers.title(titledata[tag] or titledata.list or titledata.title or "",data.metadata)
+ end
+ end
+end
+
+function lists.hastitledata(name,n,tag)
+ local data = cached[tonumber(n)]
+ if data then
+ local titledata = data.titledata
+ if titledata then
+ return (titledata[tag] or titledata.title or "") ~= ""
+ end
+ end
+ return false
+end
+
+function lists.haspagedata(name,n)
+ local data = lists.result[n]
+ if data then
+ local references = data.references
+ if references and references.realpage then -- or references.pagedata
+ return true
+ end
+ end
+ return false
+end
+
+function lists.hasnumberdata(name,n)
+ local data = lists.result[n]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata and not numberdata.hidenumber then -- the hide number is true
+ return true
+ end
+ end
+ return false
+end
+
+function lists.rawnumber(n,name)
+ local data = lists.result[n]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata then
+ numberdata = numberdata.numbers
+ return numberdata and numberdata[getsectionlevel(name)] or numberdata[name] or 0
+ end
+ end
+ return 0
+end
+
+function lists.prefix(name,n,spec)
+ helpers.prefix(lists.result[n],spec)
+end
+
+function lists.page(name,n,pagespec)
+ helpers.page(lists.result[n],pagespec)
+end
+
+function lists.prefixedpage(name,n,prefixspec,pagespec)
+ helpers.prefixpage(lists.result[n],prefixspec,pagespec)
+end
+
+function lists.realpage(name,n)
+ local data = lists.result[n]
+ if data then
+ local references = data.references
+ return references and references.realpage or 0
+ else
+ return 0
+ end
+end
+
+-- numbers stored in entry.numberdata + entry.numberprefix
+
+function lists.number(name,n,spec)
+ local data = lists.result[n]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata then
+ typesetnumber(numberdata,"number",spec or false,numberdata or false)
+ end
+ end
+end
+
+function lists.prefixednumber(name,n,prefixspec,numberspec,forceddata)
+ local data = lists.result[n]
+ if data then
+ helpers.prefix(data,prefixspec)
+ local numberdata = data.numberdata or forceddata
+ if numberdata then
+ typesetnumber(numberdata,"number",numberspec or false,numberdata or false)
+ end
+ end
+end
+
+-- todo, do this in references namespace ordered instead (this is an experiment)
+--
+-- also see lpdf-ano (maybe move this there)
+
+local splitter = lpeg.splitat(":")
+
+function references.specials.order(var,actions) -- references.specials !
+ local operation = var.operation
+ if operation then
+ local kind, name, n = lpegmatch(splitter,operation)
+ local order = lists.ordered[kind]
+ order = order and order[name]
+ local v = order[tonumber(n)]
+ local r = v and v.references.realpage
+ if r then
+ actions.realpage = r
+ var.operation = r -- brrr, but test anyway
+ return references.specials.page(var,actions)
+ end
+ end
+end
+
+-- interface (maybe strclistpush etc)
+
+if not lists.reordered then
+ function lists.reordered(data)
+ return data.numberdata
+ end
+end
+
+implement { name = "pushlist", actions = lists.pushnesting, arguments = "integer" }
+implement { name = "poplist", actions = lists.popnesting }
+
+implement {
+ name = "addtolist",
+ actions = { lists.addto, context },
+ arguments = {
+ {
+ { "references", {
+ { "internal", "integer" },
+ { "block" },
+ { "section", "integer" },
+ { "location" },
+ { "prefix" },
+ { "reference" },
+ { "view" },
+ { "order", "integer" },
+ }
+ },
+ { "metadata", {
+ { "kind" },
+ { "name" },
+ { "level", "integer" },
+ { "catcodes", "integer" },
+ { "coding" },
+ { "xmlroot" },
+ { "setup" },
+ }
+ },
+ { "userdata" },
+ { "titledata", {
+ { "label" },
+ { "title" },
+ { "bookmark" },
+ { "marking" },
+ { "list" },
+ { "reference" },
+ }
+ },
+ { "prefixdata", {
+ { "prefix" },
+ { "separatorset" },
+ { "conversionset" },
+ { "conversion" },
+ { "set" },
+ { "segments" },
+ { "connector" },
+ }
+ },
+ { "numberdata", {
+ { "level", "integer" },
+ { "numbers" },
+ { "groupsuffix" },
+ { "group" },
+ { "counter" },
+ { "separatorset" },
+ { "conversionset" },
+ { "conversion" },
+ { "starter" },
+ { "stopper" },
+ { "segments" },
+ }
+ }
+ }
+ }
+}
+
+implement {
+ name = "enhancelist",
+ arguments = "integer",
+ actions = function(n)
+ enhancelist { n = n }
+ end
+}
+
+implement {
+ name = "deferredenhancelist",
+ arguments = "integer",
+ protected = true, -- for now, pre 1.09
+ actions = function(n)
+ ctx_latelua { action = enhancelist, n = n }
+ end,
+}
+
+implement {
+ name = "processlist",
+ actions = lists.process,
+ arguments = {
+ {
+ { "names" },
+ { "criterium" },
+ { "reference" },
+ { "extras" },
+ { "order" },
+ { "levels" },
+ }
+ }
+}
+
+implement {
+ name = "analyzelist",
+ actions = lists.analyze,
+ arguments = {
+ {
+ { "names" },
+ { "criterium" },
+ { "reference" },
+ }
+ }
+}
+
+implement {
+ name = "listtitle",
+ actions = lists.title,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "listprefixednumber",
+ actions = lists.prefixednumber,
+ arguments = {
+ "string",
+ "integer",
+ {
+ { "prefix" },
+ { "separatorset" },
+ { "conversionset" },
+ { "starter" },
+ { "stopper" },
+ { "set" },
+ { "segments" },
+ { "connector" },
+ },
+ {
+ { "separatorset" },
+ { "conversionset" },
+ { "starter" },
+ { "stopper" },
+ { "segments" },
+ }
+ }
+}
+
+implement {
+ name = "listprefixedpage",
+ actions = lists.prefixedpage,
+ arguments = {
+ "string",
+ "integer",
+ {
+ { "separatorset" },
+ { "conversionset" },
+ { "set" },
+ { "segments" },
+ { "connector" },
+ },
+ {
+ { "prefix" },
+ { "conversionset" },
+ { "starter" },
+ { "stopper" },
+ }
+ }
+}
+
+implement { name = "listsize", actions = { lists.size, context } }
+implement { name = "listexternal", actions = { lists.external, context }, arguments = "integer" }
+implement { name = "listlocation", actions = { lists.location, context }, arguments = "integer" }
+implement { name = "listlabel", actions = { lists.label, context }, arguments = { "integer", "string" } }
+implement { name = "listrealpage", actions = { lists.realpage, context }, arguments = { "string", "integer" } }
+implement { name = "listgroupindex", actions = { lists.groupindex, context }, arguments = "2 strings", }
+
+implement {
+ name = "currentsectiontolist",
+ actions = { sections.current, lists.addto, context }
+}
+
+local function userdata(name,r,tag)
+ local str, metadata = lists.userdata(name,r,tag)
+ if str then
+ -- local catcodes = metadata and metadata.catcodes
+ -- if catcodes then
+ -- context.sprint(catcodes,str)
+ -- else
+ -- context(str)
+ -- end
+ helpers.title(str,metadata)
+ end
+end
+
+implement {
+ name = "listuserdata",
+ actions = userdata,
+ arguments = { "string", "integer", "string" }
+}
+
+-- we could also set variables .. names will change (when this module is done)
+-- maybe strc_lists_savedtitle etc
+
+implement { name = "doifelselisthastitle", actions = { lists.hastitledata, commands.doifelse }, arguments = { "string", "integer" } }
+implement { name = "doifelselisthaspage", actions = { lists.haspagedata, commands.doifelse }, arguments = { "string", "integer" } }
+implement { name = "doifelselisthasnumber", actions = { lists.hasnumberdata, commands.doifelse }, arguments = { "string", "integer" } }
+implement { name = "doifelselisthasentry", actions = { lists.iscached, commands.doifelse }, arguments = "integer" }
+
+local function savedlisttitle(name,n,tag)
+ local data = cached[tonumber(n)]
+ if data then
+ local titledata = data.titledata
+ if titledata then
+ helpers.title(titledata[tag] or titledata.title or "",data.metadata)
+ end
+ end
+end
+
+local function savedlistnumber(name,n)
+ local data = cached[tonumber(n)]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata then
+ typesetnumber(numberdata,"number",numberdata or false)
+ end
+ end
+end
+
+local function savedlistprefixednumber(name,n)
+ local data = cached[tonumber(n)]
+ if data then
+ local numberdata = lists.reordered(data)
+ if numberdata then
+ helpers.prefix(data,data.prefixdata)
+ typesetnumber(numberdata,"number",numberdata or false)
+ end
+ end
+end
+
+lists.savedlisttitle = savedlisttitle
+lists.savedlistnumber = savedlistnumber
+lists.savedlistprefixednumber = savedlistprefixednumber
+
+implement {
+ name = "savedlistnumber",
+ actions = savedlistnumber,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "savedlisttitle",
+ actions = savedlisttitle,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "savedlistprefixednumber",
+ actions = savedlistprefixednumber,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "discardfromlist",
+ actions = lists.discard,
+ arguments = "integer"
+}
+
+implement {
+ name = "rawlistnumber",
+ actions = { lists.rawnumber, context },
+ arguments = { "integer", "string" },
+}
+
+-- new and experimental and therefore off by default
+
+lists.autoreorder = false -- true
+
+local function addlevel(t,k)
+ local v = { }
+ setmetatableindex(v,function(t,k)
+ local v = { }
+ t[k] = v
+ return v
+ end)
+ t[k] = v
+ return v
+end
+
+local internals = setmetatableindex({ }, function(t,k)
+
+ local sublists = setmetatableindex({ },addlevel)
+
+ local collected = lists.collected or { }
+
+ for i=1,#collected do
+ local entry = collected[i]
+ local numberdata = entry.numberdata
+ if numberdata then
+ local metadata = entry.metadata
+ if metadata then
+ local references = entry.references
+ if references then
+ local kind = metadata.kind
+ local name = numberdata.counter or metadata.name
+ local internal = references.internal
+ if kind and name and internal then
+ local sublist = sublists[kind][name]
+ sublist[#sublist + 1] = { internal, numberdata }
+ end
+ end
+ end
+ end
+ end
+
+ for k, v in next, sublists do
+ for k, v in next, v do
+ local tmp = { }
+ for i=1,#v do
+ tmp[i] = v[i]
+ end
+ sort(v,function(a,b) return a[1] < b[1] end)
+ for i=1,#v do
+ t[v[i][1]] = tmp[i][2]
+ end
+ end
+ end
+
+ setmetatableindex(t,nil)
+
+ return t[k]
+
+end)
+
+function lists.reordered(entry)
+ local numberdata = entry.numberdata
+ if lists.autoreorder then
+ if numberdata then
+ local metadata = entry.metadata
+ if metadata then
+ local references = entry.references
+ if references then
+ local kind = metadata.kind
+ local name = numberdata.counter or metadata.name
+ local internal = references.internal
+ if kind and name and internal then
+ return internals[internal] or numberdata
+ end
+ end
+ end
+ end
+ else
+ function lists.reordered(entry)
+ return entry.numberdata
+ end
+ end
+ return numberdata
+end
diff --git a/tex/context/base/mkxl/strc-lst.mklx b/tex/context/base/mkxl/strc-lst.mklx
index 66fd5dfb0..66a801241 100644
--- a/tex/context/base/mkxl/strc-lst.mklx
+++ b/tex/context/base/mkxl/strc-lst.mklx
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Structure Macros / Lists}
-\registerctxluafile{strc-lst}{}
+\registerctxluafile{strc-lst}{autosuffix}
% clean up in progress ...
%
@@ -365,6 +365,9 @@
\def\strc_lists_process_pagenumber#1%
{\begincsname\??listpagenumber#1\endcsname}
+\permanent\def\structurelistexternal
+ {\clf_listexternal\numexpr\currentlistindex\relax}
+
\permanent\def\structurelistlocation
{\clf_listlocation\numexpr\currentlistindex\relax}
@@ -1449,12 +1452,53 @@
\strc_lists_interaction_check_nop
\fi}
+% \def\strc_lists_interaction_check_yes_yes
+% {\edef\p_interaction_forward{\listparameter\c!interaction}%
+% \ifcsname\??listinteractions\p_interaction_forward\endcsname
+% %\expandafter\let\expandafter\p_interaction_forward\csname\??listinteractions\p_interaction_forward\endcsname
+% \expandafter\let\expandafter\p_interaction_forward\lastnamedcs
+% \strc_references_get_simple_reference{internal(\currentlistentrylocation)}%
+% \a_strc_lists_reference\currentreferenceattribute
+% \else
+% \a_strc_lists_reference\attributeunsetvalue
+% \fi
+% \ifnum\a_strc_lists_reference=\attributeunsetvalue
+% \let\strc_lists_get_reference_attribute\gobbleoneargument
+% \let\strc_lists_set_reference_attribute\gobbleoneargument
+% \let\strc_lists_set_style_color \strc_lists_set_style_color_normal
+% \else
+% \let\strc_lists_get_reference_attribute\strc_lists_get_reference_attribute_indeed
+% \let\strc_lists_set_reference_attribute\strc_lists_set_reference_attribute_indeed
+% \let\strc_lists_set_style_color \strc_lists_set_style_color_special
+% \fi
+% \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter !
+% \ifx\p_interaction_backward\v!list
+% \strc_references_set_simple_reference{*\currentlistentrylocation}%
+% \a_strc_lists_destination\currentdestinationattribute
+% \else
+% \a_strc_lists_destination\attributeunsetvalue
+% \fi
+% \ifnum\a_strc_lists_destination=\attributeunsetvalue
+% \lettonothing\strc_lists_get_destination_attribute
+% \lettonothing\strc_lists_set_destination_attribute
+% \else
+% \let\strc_lists_get_destination_attribute\strc_lists_get_destination_attribute_indeed
+% \let\strc_lists_set_destination_attribute\strc_lists_set_destination_attribute_indeed
+% \fi}
+
\def\strc_lists_interaction_check_yes_yes
- {\edef\p_interaction_forward{\listparameter\c!interaction}%
+ {\edef\p_interaction_forward {\listparameter\c!interaction}%
+ \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter !
\ifcsname\??listinteractions\p_interaction_forward\endcsname
%\expandafter\let\expandafter\p_interaction_forward\csname\??listinteractions\p_interaction_forward\endcsname
\expandafter\let\expandafter\p_interaction_forward\lastnamedcs
- \strc_references_get_simple_reference{internal(\currentlistentrylocation)}%
+ \ifcstok{\structurelistexternal}\emptytoks % luacall
+ \strc_references_get_simple_reference{internal(\currentlistentrylocation)}%
+ \else
+ % \writestatus{FAR OUT LIST}{\structurelistexternal::page(\number\structurelistrealpagenumber)}%
+ \strc_references_get_simple_reference{\structurelistexternal::page(\number\structurelistrealpagenumber)}%
+ \let\p_interaction_backward\empty
+ \fi
\a_strc_lists_reference\currentreferenceattribute
\else
\a_strc_lists_reference\attributeunsetvalue
@@ -1468,7 +1512,6 @@
\let\strc_lists_set_reference_attribute\strc_lists_set_reference_attribute_indeed
\let\strc_lists_set_style_color \strc_lists_set_style_color_special
\fi
- \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter !
\ifx\p_interaction_backward\v!list
\strc_references_set_simple_reference{*\currentlistentrylocation}%
\a_strc_lists_destination\currentdestinationattribute
diff --git a/tex/context/base/mkxl/strc-mat.mkxl b/tex/context/base/mkxl/strc-mat.mkxl
index 0d2f85239..025021edb 100644
--- a/tex/context/base/mkxl/strc-mat.mkxl
+++ b/tex/context/base/mkxl/strc-mat.mkxl
@@ -32,6 +32,7 @@
%\c!margin=,
%\c!align=,
%\c!separator=,
+ % \c!splitmethod=\v!both, % first|last|both|<empty>
\c!snap=\v!no,
\c!snapstep=\v!medium,
\c!grid=\v!math,
@@ -1443,10 +1444,10 @@
\def\strc_math_analyze_box
{\clf_handlemathhang
- stage \plusone
- alignstate \c_strc_math_ragged_status
- box \b_strc_math_display
- distance \formulaparameter\c!textdistance
+ stage \plusone
+ alignstate \c_strc_math_ragged_status
+ box \b_strc_math_display
+ distance \formulaparameter\c!textdistance
\relax
%\holdingmigrations\zerocount
\setbox\b_strc_math_display\vbox\bgroup % \vtop
@@ -1482,10 +1483,11 @@
\edef\v_spac_whitespace_current{\formulaparameter\c!spaceinbetween}%
\spac_whitespace_setup
\clf_handlemathhang
- stage \plusfour
- inbetween 1\parskip
- height \strutht
- depth \strutdp
+ stage \plusfour
+ inbetween 1\parskip
+ height \strutht
+ depth \strutdp
+ splitmethod {\formulaparameter\c!splitmethod}%
\relax
\endgroup}
@@ -1966,16 +1968,16 @@
\permanent\tolerant\protected\def\placenamedformula[#1]%
{\ifarguments
- \expandafter\strc_formulase_place_named_nop
+ \expandafter\strc_formulas_place_named_nop
\else
- \expandafter\strc_formulase_place_named_yes
+ \expandafter\strc_formulas_place_named_yes
\fi[#1]}
-\def\strc_formulase_place_named_yes[#1]#2%
+\def\strc_formulas_place_named_yes[#1]#2%
{\setformulalistentry{#2}%
\placeformula[#1]}
-\def\strc_formulase_place_named_nop[#1]#2%
+\def\strc_formulas_place_named_nop[#1]#2%
{\setformulalistentry{#2}%
\placeformula}
diff --git a/tex/context/base/mkxl/strc-ref.lmt b/tex/context/base/mkxl/strc-ref.lmt
index 32c2a5429..3c86d66d9 100644
--- a/tex/context/base/mkxl/strc-ref.lmt
+++ b/tex/context/base/mkxl/strc-ref.lmt
@@ -1274,8 +1274,9 @@ function references.loadpresets(product,component) -- we can consider a special
if product and component and product~= "" and component ~= "" and not productdata.product then -- maybe: productdata.filename ~= filename
productdata.product = product
productdata.component = component
+ -- todo: use other locator
local fullname = file.replacesuffix(product,"tuc")
- if lfs.isfile(fullname) then -- todo: use other locator
+ if lfs.isfile(fullname) then
local utilitydata = job.loadother(fullname)
if utilitydata then
if trace_importing then
@@ -1311,7 +1312,7 @@ if useproduct then
implement {
name = "useproduct",
actions = newuseproduct,
- arguments = "string",
+ arguments = "optional",
overload = true,
}
@@ -2243,7 +2244,13 @@ local function filterreference(name,prefixspec,numberspec) -- number page title
local cs = references.analyze() -- normally already analyzed but also sets state
context(tonumber(cs.realpage) or 0)
else -- assumes data is table
- local kind = type(data) == "table" and data.metadata and data.metadata.kind
+ local kind = false
+ if type(data) == "string" then
+ -- todo
+ end
+ if type(data) == "table" then
+ kind = data.metadata and data.metadata.kind
+ end
if kind then
local filter = filters[kind] or genericfilters
filter = filter and (filter[name] or filter.unknown or genericfilters[name] or genericfilters.unknown)
diff --git a/tex/context/base/mkxl/syst-ini.mkxl b/tex/context/base/mkxl/syst-ini.mkxl
index 241b83ae4..e3dd91af5 100644
--- a/tex/context/base/mkxl/syst-ini.mkxl
+++ b/tex/context/base/mkxl/syst-ini.mkxl
@@ -789,20 +789,6 @@
% \permanent\protected\def\uedef{\protected\edef}
% \permanent\protected\def\uxdef{\protected\xdef}
-% For now:
-
-\permanent\protected\def\defUmathfixedtopaccent #1#2#3#4{\global\immutable\protected\def#1{\Umathtopaccent \s!fixed "#2 "#3 "#4 }}
-\permanent\protected\def\defUmathfixedbottomaccent#1#2#3#4{\global\immutable\protected\def#1{\Umathbottomaccent \s!fixed "#2 "#3 "#4 }}
-\permanent\protected\def\defUmathtopaccent #1#2#3#4{\global\immutable\protected\def#1{\Umathtopaccent "#2 "#3 "#4 }}
-\permanent\protected\def\defUmathbottomaccent #1#2#3#4{\global\immutable\protected\def#1{\Umathbottomaccent "#2 "#3 "#4 }}
-\permanent\protected\def\defUdelimiterover #1#2#3#4{\global\immutable\protected\def#1{\Udelimiterover "#2 "#3 }}
-\permanent\protected\def\defUdelimiterunder #1#2#3#4{\global\immutable\protected\def#1{\Udelimiterunder "#2 "#3 }}
-%permanent\protected\def\defUdelimiter #1#2#3#4{\global\immutable\protected\def#1{\Udelimiter "#2 "#3 "#4 }}
-\permanent\protected\def\defUdelimiter #1#2#3#4{\global\immutable\Umathchardef #1 "#2 "#3 "#4 }
-\permanent\protected\def\defUradical #1#2#3{\global\immutable\protected\def#1{\Uradical "#2 "#3 }}
-\permanent\protected\def\defUroot #1#2#3{\global\immutable\protected\def#1{\Uroot "#2 "#3 }}
-\permanent\protected\def\defUmathchar #1#2#3#4{\global\immutable\Umathchardef #1 "#2 "#3 "#4 }
-
%D For a while we keep the following, as systems like tikz need it. Best not use
%D that one \CONTEXT. It will probably move to the tikz loader.
@@ -834,8 +820,7 @@
% no longer \errorstopmode cf. plain tex 3.141592653
\permanent\protected\def\tracingall
- {\tracingonline \plusone
- \tracingcommands \plusfour % > 3: show mode change independent
+ {\tracingcommands \plusfour % > 3: show mode change independent
\tracingmacros \plusthree % > 2: obey \untraced
\tracingoutput \plusone
\tracingpages \plusone
@@ -848,7 +833,8 @@
\tracingmath \plusone
\tracingalignments\plustwo % > 1: also show preamble
\showboxbreadth \maxcount
- \showboxdepth \maxcount}
+ \showboxdepth \maxcount
+ \tracingonline \plusone}
\permanent\protected\def\tracingless
{\tracingall
@@ -861,7 +847,8 @@
\tracingonline \zerocount}
\permanent\protected\def\tracingnone
- {\showboxdepth \plusfive % lessboxtracing
+ {\tracingonline \zerocount
+ \showboxdepth \plusfive % lessboxtracing
\showboxbreadth \plusten
\tracingalignments\zerocount
\tracingmath \zerocount
diff --git a/tex/context/base/mkxl/tabl-tsp.mkxl b/tex/context/base/mkxl/tabl-tsp.mkxl
index a2a147654..160357a06 100644
--- a/tex/context/base/mkxl/tabl-tsp.mkxl
+++ b/tex/context/base/mkxl/tabl-tsp.mkxl
@@ -207,7 +207,7 @@
% todo: keep tail to rest, so we need a lookahead
\newbox \b_split_content
-\newbox \b_split_result
+\newbox \b_split_result % watch out, semi public, accessed in cs-*
\newbox \b_split_head
\newbox \b_split_next
\newbox \b_split_tail
@@ -231,6 +231,8 @@
\newconditional\tabl_split_forced_page
+% \permanent\protected\def\lastsplithtdp{\htdp\b_split_result}
+
\appendtoks
\c_split_minimum_free_lines\zerocount
\d_split_minimum_free_space\zeropoint
diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg
index 32152e15d..c9021352b 100644
--- a/tex/context/fonts/mkiv/bonum-math.lfg
+++ b/tex/context/fonts/mkiv/bonum-math.lfg
@@ -42,11 +42,19 @@ return {
tweak = "replacealphabets",
list = {
{
- source = { first = 0x003B1 },
+ source = { first = 0x003B1 }, -- upright alpha
filename = "texgyrebonummath-companion.otf",
},
{
- source = { first = 0x1D6FC },
+ source = { first = 0x1D6FC }, -- italic alpha
+ filename = "texgyrebonummath-companion.otf",
+ },
+ {
+ source = { first = 0x1D6C2 }, -- bold upright alpha
+ filename = "texgyrebonummath-companion.otf",
+ },
+ {
+ source = { first = 0x1D736 }, -- bold italic alpha
filename = "texgyrebonummath-companion.otf",
},
},
diff --git a/tex/context/fonts/mkiv/ebgaramond-math.lfg b/tex/context/fonts/mkiv/ebgaramond-math.lfg
index d5d31c73f..812430525 100644
--- a/tex/context/fonts/mkiv/ebgaramond-math.lfg
+++ b/tex/context/fonts/mkiv/ebgaramond-math.lfg
@@ -81,6 +81,12 @@ return {
["0x27E9.variants.*"] = { topright = -0.2, bottomright = -0.2 },
[0x27EB] = { topright = -0.1, bottomright = -0.1 },
["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 },
+
+ [0x51] = { bottomright = 0.25 }, -- Upright Q
+ [0x211A] = { bottomright = 0.2 }, -- Blackboard bold Q
+ [0x1D410] = { bottomright = 0.2 }, -- Bold Q
+ [0x1D478] = { bottomright = 0.05 }, -- Bold Q
+ [0x1D5B0] = { bottomright = 0.05 }, -- Sans Q
},
},
{
diff --git a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
index 3be50a2de..31026df5b 100644
--- a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
@@ -29,11 +29,15 @@
\definefontfeature
[eb-garamond-normal]
[default]
- [mode=node,ccmp=yes,
- calt=yes,liga=yes,
- dlig=yes,hlig=yes,
- kern=yes,mark=yes,mkmk=yes,
- onum=yes,pnum=yes,salt=yes,
+ [mode=node,
+ ccmp=yes,
+ calt=yes,
+ dlig=no,
+ hlig=no,
+ % salt=yes,
+ % onum=yes,
+ onum=no,
+ pnum=yes,
script=latn]
\definefontfeature
@@ -41,6 +45,11 @@
[eb-garamond-normal]
[smcp=yes,c2sc=yes]
+\definefontfeature
+ [ysabeau-smallcaps]
+ [default]
+ [smcp=yes,c2sc=yes]
+
% \loadtypescriptfile[ebgaramond]
%
% \definefontfeature
@@ -67,6 +76,17 @@
\definefontsynonym [\s!SerifCaps] [\s!Serif] [\s!features=eb-garamond-smallcaps]
\stoptypescript
+
+
+ \starttypescript [\s!sans] [ysabeau]
+ % \setups[font:fallback:sans]
+ \definefontsynonym [\s!Sans] [\s!file:ysabeau-regular] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:ysabeau-italic] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:ysabeau-bold] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic][\s!file:ysabeau-bolditalic] [\s!features=\s!default]
+ \definefontsynonym [\s!SansCaps] [\s!Sans] [\s!features=ysabeau-smallcaps]
+ \stoptypescript
+
\starttypescript [\s!math] [ebgaramond,ebgaramond-nt]
\checkedmapfontsize[\typescripttwo][\s!script] [.70]
\checkedmapfontsize[\typescripttwo][\s!scriptscript][.50]
@@ -84,6 +104,7 @@
\starttypescript[ebgaramond,ebgaramond-nt]
\definetypeface [\typescriptone] [\s!rm] [\s!serif] [ebgaramond] [\s!default]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [ysabeau] [\s!default]
\definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.8]
% \definetypeface [\typescriptone] [\s!mm] [\s!math] [bonum] [\s!default] [\s!rscale=0.8]
\definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default]
diff --git a/tex/context/interface/mkii/keys-en.xml b/tex/context/interface/mkii/keys-en.xml
index adadb86c5..fae9ee691 100644
--- a/tex/context/interface/mkii/keys-en.xml
+++ b/tex/context/interface/mkii/keys-en.xml
@@ -594,6 +594,7 @@
<cd:variable name='temporary' value='temporary'/>
<cd:variable name='test' value='test'/>
<cd:variable name='text' value='text'/>
+ <cd:variable name='textdisplay' value='textdisplay'/>
<cd:variable name='textnote' value='textnote'/>
<cd:variable name='three' value='three'/>
<cd:variable name='thursday' value='thursday'/>
@@ -724,6 +725,7 @@
<cd:constant name='bookmark' value='bookmark'/>
<cd:constant name='bottom' value='bottom'/>
<cd:constant name='bottomafter' value='bottomafter'/>
+ <cd:constant name='bottomalign' value='bottomalign'/>
<cd:constant name='bottombefore' value='bottombefore'/>
<cd:constant name='bottomcolor' value='bottomcolor'/>
<cd:constant name='bottomcommand' value='bottomcommand'/>
@@ -1338,6 +1340,7 @@
<cd:constant name='toffset' value='toffset'/>
<cd:constant name='tolerance' value='tolerance'/>
<cd:constant name='top' value='top'/>
+ <cd:constant name='topalign' value='topalign'/>
<cd:constant name='topcolor' value='topcolor'/>
<cd:constant name='topcommand' value='topcommand'/>
<cd:constant name='topdistance' value='topdistance'/>
diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml
index f5474769a..3dc8bf282 100644
--- a/tex/context/interface/mkii/keys-fr.xml
+++ b/tex/context/interface/mkii/keys-fr.xml
@@ -725,6 +725,7 @@
<cd:constant name='bookmark' value='marquepage'/>
<cd:constant name='bottom' value='bas'/>
<cd:constant name='bottomafter' value='basaprès'/>
+ <cd:constant name='bottomalign' value='bottomalign'/>
<cd:constant name='bottombefore' value='basavant'/>
<cd:constant name='bottomcolor' value='bottomcolor'/>
<cd:constant name='bottomcommand' value='commandebas'/>
@@ -1339,6 +1340,7 @@
<cd:constant name='toffset' value='decalaget'/>
<cd:constant name='tolerance' value='tolerance'/>
<cd:constant name='top' value='haut'/>
+ <cd:constant name='topalign' value='topalign'/>
<cd:constant name='topcolor' value='topcolor'/>
<cd:constant name='topcommand' value='commandehaut'/>
<cd:constant name='topdistance' value='distancehaut'/>
diff --git a/tex/context/interface/mkii/keys-nl.xml b/tex/context/interface/mkii/keys-nl.xml
index 13abd22dd..e01eb74d1 100644
--- a/tex/context/interface/mkii/keys-nl.xml
+++ b/tex/context/interface/mkii/keys-nl.xml
@@ -594,6 +594,7 @@
<cd:variable name='temporary' value='voorlopig'/>
<cd:variable name='test' value='test'/>
<cd:variable name='text' value='tekst'/>
+ <cd:variable name='textdisplay' value='textdisplay'/>
<cd:variable name='textnote' value='tekstnoot'/>
<cd:variable name='three' value='drie'/>
<cd:variable name='thursday' value='donderdag'/>
@@ -724,6 +725,7 @@
<cd:constant name='bookmark' value='bookmark'/>
<cd:constant name='bottom' value='onder'/>
<cd:constant name='bottomafter' value='bottomafter'/>
+ <cd:constant name='bottomalign' value='bottomalign'/>
<cd:constant name='bottombefore' value='bottombefore'/>
<cd:constant name='bottomcolor' value='onderkleur'/>
<cd:constant name='bottomcommand' value='ondercommando'/>
@@ -1338,6 +1340,7 @@
<cd:constant name='toffset' value='toffset'/>
<cd:constant name='tolerance' value='tolerantie'/>
<cd:constant name='top' value='boven'/>
+ <cd:constant name='topalign' value='topalign'/>
<cd:constant name='topcolor' value='bovenkleur'/>
<cd:constant name='topcommand' value='bovencommando'/>
<cd:constant name='topdistance' value='bovenafstand'/>
diff --git a/tex/context/modules/mkiv/s-fonts-tables.mkiv b/tex/context/modules/mkiv/s-fonts-tables.mkiv
index f1340c3ea..aeb526f38 100644
--- a/tex/context/modules/mkiv/s-fonts-tables.mkiv
+++ b/tex/context/modules/mkiv/s-fonts-tables.mkiv
@@ -52,5 +52,6 @@
[cambria]
\starttext
- \showfontproperties[name=cambria]
+% \showfontproperties[name=cambria]
+ \showfontproperties[name=lbmi]
\stoptext
diff --git a/tex/context/modules/mkxl/m-oldmath.mkxl b/tex/context/modules/mkxl/m-oldmath.mkxl
index 2132d773e..db223b2d3 100644
--- a/tex/context/modules/mkxl/m-oldmath.mkxl
+++ b/tex/context/modules/mkxl/m-oldmath.mkxl
@@ -136,7 +136,8 @@
{\left(\matrix{#1}\right)}
\permanent\protected\def\root#1\of% #2%
- {\rootradical{#1}} % {#2}
+ %{\rootradical{#1}} % {#2}
+ {\Uradical \zerocount "221A{#1}} % {#2}
\protect
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index ee3ab219c..71dafd320 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 : 2023-01-05 17:43
+-- merge date : 2023-01-15 13:53
do -- begin closure to overcome local limits and interference