From db25374e65d39dc254ddce11b40ad4a95e6a385b Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 27 Dec 2022 21:56:16 +0100 Subject: 2022-12-27 21:04:00 --- .../context/lexers/data/scite-context-data-tex.lua | 2 +- .../context/scite-context-data-tex.properties | 96 +++--- .../manuals/lowlevel/lowlevel-alignments.tex | 102 ++++++ .../general/manuals/lowlevel/lowlevel-boxes.tex | 24 +- .../manuals/lowlevel/lowlevel-paragraphs.tex | 369 +++++++++++++++++++++ metapost/context/base/mpxl/mp-cont.mpxl | 1 + source/luametatex/source/mp/mpc/mp.c | 6 + source/luametatex/source/mp/mpw/mp.w | 7 + source/luametatex/source/tex/texadjust.c | 2 +- source/luametatex/source/tex/texalign.c | 351 +++++++++++++++++++- source/luametatex/source/tex/texbuildpage.c | 2 +- source/luametatex/source/tex/texcommands.c | 1 + source/luametatex/source/tex/texdumpdata.c | 2 +- source/luametatex/source/tex/texdumpdata.h | 2 +- source/luametatex/source/tex/texequivalents.h | 3 + source/luametatex/source/tex/texinserts.c | 2 +- source/luametatex/source/tex/texmaincontrol.c | 27 +- source/luametatex/source/tex/texnesting.c | 4 +- source/luametatex/source/tex/texnodes.h | 13 +- source/luametatex/source/tex/texpackaging.c | 32 +- source/luametatex/source/tex/texpackaging.h | 35 ++ source/luametatex/source/tex/texrules.c | 2 +- source/luametatex/source/tex/textypes.h | 1 - tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/mult-prm.lua | 1 + tex/context/base/mkiv/status-files.pdf | Bin 24598 -> 24611 bytes tex/context/base/mkiv/status-lua.pdf | Bin 264785 -> 264782 bytes tex/context/base/mkxl/buff-ini.mkxl | 2 +- tex/context/base/mkxl/colo-ext.mkxl | 2 +- tex/context/base/mkxl/colo-grp.mkxl | 8 +- tex/context/base/mkxl/colo-ini.mkxl | 4 +- tex/context/base/mkxl/cont-new.mkxl | 2 +- tex/context/base/mkxl/context.mkxl | 2 +- tex/context/base/mkxl/core-con.mkxl | 22 +- tex/context/base/mkxl/driv-shp.lmt | 22 +- tex/context/base/mkxl/enco-ini.mkxl | 4 +- tex/context/base/mkxl/file-ini.mklx | 2 +- tex/context/base/mkxl/file-job.mklx | 6 +- tex/context/base/mkxl/font-ini.mklx | 2 +- tex/context/base/mkxl/font-sym.mklx | 24 +- tex/context/base/mkxl/lang-ini.mkxl | 4 +- tex/context/base/mkxl/lpdf-rul.lmt | 12 +- tex/context/base/mkxl/mlib-ctx.mkxl | 11 + tex/context/base/mkxl/mlib-fio.lmt | 11 +- tex/context/base/mkxl/mlib-int.lmt | 12 +- tex/context/base/mkxl/mult-aux.mkxl | 2 +- tex/context/base/mkxl/mult-ini.mkxl | 6 +- tex/context/base/mkxl/pack-ori.mkxl | 3 +- tex/context/base/mkxl/page-com.mkxl | 2 +- tex/context/base/mkxl/page-lay.mkxl | 2 +- tex/context/base/mkxl/page-lin.mklx | 2 +- tex/context/base/mkxl/page-mak.mklx | 4 +- tex/context/base/mkxl/page-txt.mklx | 2 +- tex/context/base/mkxl/publ-ini.mkxl | 8 +- tex/context/base/mkxl/scrn-but.mklx | 50 +-- tex/context/base/mkxl/scrn-wid.mklx | 2 +- tex/context/base/mkxl/spac-hor.mkxl | 4 +- tex/context/base/mkxl/spac-ver.lmt | 28 +- tex/context/base/mkxl/spac-ver.mkxl | 8 +- tex/context/base/mkxl/strc-flt.mklx | 10 +- tex/context/base/mkxl/strc-itm.mklx | 237 ++++++++----- tex/context/base/mkxl/strc-lab.mkxl | 8 +- tex/context/base/mkxl/strc-lst.mklx | 4 +- tex/context/base/mkxl/strc-not.mklx | 2 +- tex/context/base/mkxl/strc-pag.mkxl | 16 +- tex/context/base/mkxl/strc-sbe.mkxl | 2 +- tex/context/base/mkxl/strc-sec.mkxl | 4 +- tex/context/base/mkxl/supp-box.mkxl | 2 +- tex/context/base/mkxl/syst-aux.mkxl | 9 + tex/context/base/mkxl/tabl-tbl.mkxl | 285 ++++++++++++---- tex/context/base/mkxl/trac-vis.lmt | 36 +- tex/context/base/mkxl/typo-ada.mkxl | 23 +- tex/context/base/mkxl/typo-adj.lmt | 5 +- tex/context/base/mkxl/typo-itm.mkxl | 10 +- tex/context/base/mkxl/typo-mar.mkxl | 10 +- tex/context/base/mkxl/typo-syn.lmt | 2 +- tex/context/base/mkxl/typo-syn.mkxl | 2 + tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 81 files changed, 1586 insertions(+), 453 deletions(-) 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 f2a3a67b7..afe36c27b 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,7 +1,7 @@ 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", "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", "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" }, ["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", "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" }, diff --git a/context/data/scite/context/scite-context-data-tex.properties b/context/data/scite/context/scite-context-data-tex.properties index 8dec975b5..540328e0f 100644 --- a/context/data/scite/context/scite-context-data-tex.properties +++ b/context/data/scite/context/scite-context-data-tex.properties @@ -89,54 +89,54 @@ ifdimval ifempty ifflags ifhaschar ifhastok \ ifhastoks ifhasxtoks ifincsname ifinsert ifmathparameter \ ifmathstyle ifnumexpression ifnumval ifparameter ifparameters \ ifrelax iftok ifzerodim ifzeronum ignorearguments \ -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 +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 keywordclass.tex.omega=\ Omegaminorversion Omegarevision Omegaversion diff --git a/doc/context/sources/general/manuals/lowlevel/lowlevel-alignments.tex b/doc/context/sources/general/manuals/lowlevel/lowlevel-alignments.tex index 1b8bc6552..a70e222ea 100644 --- a/doc/context/sources/general/manuals/lowlevel/lowlevel-alignments.tex +++ b/doc/context/sources/general/manuals/lowlevel/lowlevel-alignments.tex @@ -690,6 +690,108 @@ could not achieve the same already, it's just a bit programmer friendly. \stopsectionlevel +\startsectionlevel[title=Rows] + +Alignment support is what the documented source calls \quote {interwoven}. When +the engine scans for input it processing text, math or alignment content. While +doing alignments it collects rows, and inside these cells but also deals with +material that ends up in between. In \LUAMETATEX\ I tried to isolate the bits and +pieces as good as possible but it remains \ complicated (for all good reasons). +Cells as well as rows are finalized after the whole alignment has been collected +and processed. In the end cells and rows are boxes but till we're done they are +in an \quote {unset} state. + +Scanning starts with interpreting the preamble, and then grabbing rows. There is +some nasty lookahead involved for \type {\noalign}, \type {\span}, \type {\omit}, +\type {\cr} and \type {\crcr} and that is not code one wants to tweak too much +(although we did in \LUAMETATEX). This means for instance that adding \quote +{let's start a row here} primitive is sort of tricky (but it might happen some +day) which in turn means that it is not really possible to set row properties. As +an experiment we can set some properties now by hijacking \type {\noalign} and +storing them on the alignment stack (indeed: at the cost of some extra overhead +and memory). This permits the following: + +% \theorientation{down} "002 + +\startbuffer +\halign { + \hss + \ignorespaces \alignmark \removeunwantedspaces + \hss + \quad \aligntab \quad + \hss + \ignorespaces \alignmark \removeunwantedspaces + \hss + \cr + \noalign xoffset 40pt {} + {\darkred cell one} \aligntab {\darkgray cell one} \cr + \noalign orientation "002 {} + {\darkgreen cell one} \aligntab {\darkblue cell one} \cr + \noalign xoffset 40pt {} + {\darkred cell two} \aligntab {\darkgray cell two} \cr + \noalign orientation "002 {} + {\darkgreen cell two} \aligntab {\darkblue cell two} \cr + \noalign xoffset 40pt {} + {\darkred cell three} \aligntab {\darkgray cell three} \cr + \noalign orientation "002 {} + {\darkgreen cell three} \aligntab {\darkblue cell three} \cr + \noalign xoffset 40pt {} + {\darkred cell four} \aligntab {\darkgray cell four} \cr + \noalign orientation "002 {} + {\darkgreen cell four} \aligntab {\darkblue cell four} \cr +} +\stopbuffer + +\typebuffer[option=TEX] + +\startlinecorrection +\showmakeup[line] +\ruledvbox{\getbuffer} +\stoplinecorrection + +The supported keywords are similar to those for boxes: \type {source}, \type +{target}, \type {anchor}, \type {orientation}, \type {shift}, \type {xoffset}, +\type {yoffset}, \type {xmove} and \type {ymove}. The dimensions can be prefixed +by \type {add} and \type {reset} wipes all. Here is another example: + +\startbuffer +\halign { + \hss + \ignorespaces \alignmark \removeunwantedspaces + \hss + \quad \aligntab \quad + \hss + \ignorespaces \alignmark \removeunwantedspaces + \hss + \cr + \noalign xmove 40pt {} + {\darkred cell one} \aligntab {\darkgray cell one} \cr + {\darkgreen cell one} \aligntab {\darkblue cell one} \cr + \noalign xmove 20pt {} + {\darkred cell two} \aligntab {\darkgray cell two} \cr + {\darkgreen cell two} \aligntab {\darkblue cell two} \cr + \noalign xmove 40pt {} + {\darkred cell three} \aligntab {\darkgray cell three} \cr + {\darkgreen cell three} \aligntab {\darkblue cell three} \cr + \noalign xmove 20pt {} + {\darkred cell four} \aligntab {\darkgray cell four} \cr + {\darkgreen cell four} \aligntab {\darkblue cell four} \cr +} +\stopbuffer + +\typebuffer[option=TEX] + +\startlinecorrection +\showmakeup[line] +\ruledvbox{\getbuffer} +\stoplinecorrection + +Some more features might be added in the future as is it an interesting +playground. It is to be seen how this ends up in \CONTEXT\ high level interfaces +like tabulate. + +\stopsectionlevel + \startsectionlevel[title=Remark] It can be that the way alignments are interfaced with respect to attributes is a bit diff --git a/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex b/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex index dd6c2f2d4..0efe63721 100644 --- a/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex +++ b/doc/context/sources/general/manuals/lowlevel/lowlevel-boxes.tex @@ -1,3 +1,4 @@ +three % language=us runpath=texruns:manuals/lowlevel % \hfil \hss @@ -141,7 +142,28 @@ available space. So, here we force the text to the right or left. {\dontcomplain\showboxes\getbuffer} \stoplinecorrection -We have three kind of boxes: \type {\hbox}, \type {\vbox} and \type {\vtop}: +Instead of \type {\raise} you can also provide the shift (up or down) with a +keyword: + +\startbuffer +\ruledhbox\bgroup + x\raise 5pt\ruledhbox {1}x + x\raise-10pt\ruledhbox {2}x + x\raise -5pt\ruledhbox shift -20pt{3}x + x\ruledhbox shift -10pt{4}x +\egroup +\stopbuffer + +\typebuffer[option=TEX] + +\startlinecorrection +{\dontcomplain\showboxes\getbuffer} +\stoplinecorrection + + +We have three kind of boxes: \type {\hbox}, \type {\vbox} and \type {\vtop}. +Actually we have a fourth type \type {\dbox} but that is a variant on \type +{\vbox} to which we come back later. \startbuffer \hbox{\strut height and depth\strut} diff --git a/doc/context/sources/general/manuals/lowlevel/lowlevel-paragraphs.tex b/doc/context/sources/general/manuals/lowlevel/lowlevel-paragraphs.tex index 0521a43de..65b36da94 100644 --- a/doc/context/sources/general/manuals/lowlevel/lowlevel-paragraphs.tex +++ b/doc/context/sources/general/manuals/lowlevel/lowlevel-paragraphs.tex @@ -999,6 +999,375 @@ examples are visualized in \in {figure} [fig:flow]. \stopsectionlevel +\startsectionlevel[title=Leaders] + +Leaders are a basic feature that users probably never run into directly. They +repeat content till it fits the specified width which can be stretched out. The +content is typeset once and it is the backend that does the real work of +repetition. + +\startbuffer +\strut\leaders \hbox{!}\hfill\strut +\strut\xleaders\hbox{!}\hfill\strut +\strut\cleaders\hbox{!}\hfill\strut +\strut\gleaders\hbox{!}\hfill\strut +\stopbuffer + +\typebuffer + +Here \type {\leaders} starts at the left edge and are repeats the box as long as +it fits, \type {\xleaders} spreads till the edges and \type {\cleaders} centers +the lot. The \type {\gleaders} primitive (which is not in orginal \TEX) takes the +outer box as reference and further behaves like \type {\cleaders}. + +\startlines \showmakeup[line] \getbuffer \stoplines + +The leader primitives take box or rule but in \LUAMETATEX\ a glyph can also be +specified, which saves wrapping in a box. + +\startbuffer +\ruledvbox \bgroup \hsize 10cm + \strut\cleaders\hbox{!}\hfill\strut +\egroup + +\ruledvbox \bgroup \hsize 10cm + \strut\cleaders\hrule\hfill\strut +\egroup + +\ruledvbox \bgroup \hsize 10cm + \strut\cleaders\glyph`!\hfill\strut +\egroup +\stopbuffer + +\typebuffer + +\getbuffer + +The \LUAMETATEX\ engine also introduced \type {\uleaders} + +\definecolor[tred] [r=.6,a=1,t=.5] +\definecolor[tgreen][g=.6,a=1,t=.5] +\definecolor[tblue] [b=.6,a=1,t=.5] + +\startbuffer[one] + x xx xxx xxxx + \ruledhbox{L\hss R}\space + x xx xxx xxxx +\stopbuffer + +\startbuffer[two] + x xx xxx xxxx + \uleaders\backgroundhbox[gray]{L\hss R}\hskip\zeropoint plus 100pt\relax\space + x xx xxx xxxx +\stopbuffer + +\startbuffer[three] + x xx xxx xxxx + \uleaders\ruledhbox{L\hss R}\hskip\zeropoint plus 100pt\relax\space + x xx xxx xxxx +\stopbuffer + +We show three boxes, a regular one first (red): + +\typebuffer[one] + +The second one (blue) is also a box but one that stretches upto 100pt and is in a +later stage, when the paragraph has been built, is repackaged to the effective +width. The third example (green) leaves out the background. + +\startlinecorrection +\startoverlay + {\vbox{\color[tgreen]{\small\dorecurse {20} {\getbuffer[three]}}}} + {\vbox{\color[tblue] {\small\dorecurse {20} {\getbuffer [two]}}}} + {\vbox{\color[tred] {\small\dorecurse {20} {\getbuffer [one]}}}} +\stopoverlay +\stoplinecorrection + +In \CONTEXT\ we have wrapped this feature in the adaptive box mechanism, so here +a few a few examples: + +\setupexternalfigures[location={default,local,global}] + +\startbuffer +\startsetups adaptive:test:a + \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup + \externalfigure + [cow.pdf] + [width=\framedmaxwidth, + frame=on, + height=\usedadaptivetotal]% + \egroup +\stopsetups + +\startsetups adaptive:test:b + \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup + \externalfigure + [cow.pdf] + [width=\usedadaptivewidth, + frame=on, + height=\usedadaptivetotal]% + \egroup +\stopsetups +\stopbuffer + +\typebuffer \getbuffer + +We use this as follows (see \in {figure} [fig:adaptive] for the result): + +\startbuffer +\framed[height=18cm,align=middle,adaptive=yes,top=,bottom=] {% + \begstrut \samplefile{tufte} \endstrut + \par + \adaptivevbox + [strut=yes,setups=adaptive:test:a] + {\showstruts\strut\hsize5cm\hss}% + \par + \adaptivevbox + [strut=yes,setups=adaptive:test:b] + {\showstruts\strut\hsize5cm\hss}% + \par + \begstrut \samplefile{tufte} \endstrut +} +\stopbuffer + +\typebuffer + +\startplacefigure[reference=fig:adaptive] + \getbuffer +\stopplacefigure + +Here is one that you can test yourself: + +\starttyping +\startsetups adaptive:test + \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup + \externalfigure + [cow.pdf] + [width=\usedadaptivewidth, + height=\usedadaptivetotal]% + \egroup +\stopsetups + +\ruledvbox to \textheight { + \par \begstrut \samplefile{tufte} \endstrut \par + \adaptivevbox[strut=yes,setups=adaptive:test]{\hsize\textwidth\hss} + \par \begstrut \samplefile{tufte} \endstrut +} +\stoptyping + +The next example comes from the test suite (where it runs over many pages in +order to illustrate the idea): + +\startbuffer +\startMPdefinitions + def TickTock = + interim linecap := squared; + save p ; path p ; + p := fullsquare xysized(AdaptiveWidth,.9(AdaptiveHeight+AdaptiveDepth)) ; + fill p withcolor AdaptiveColor ; + draw bottomboundary (p enlarged (-AdaptiveThickness) ) + withdashes (3*AdaptiveThickness) + withpen pencircle scaled AdaptiveThickness + withcolor white ; + enddef ; +\stopMPdefinitions + +\startsetups adaptive:test + \setbox\usedadaptivebox\hbox + to \usedadaptivewidth + yoffset -.9\usedadaptivedepth + \bgroup + \hss + \startMPcode + TickTock ; + \stopMPcode + \hss + \egroup +\stopsetups + +\definecolor[adaptive:tick][.25(blue,green)] +\definecolor[adaptive:tock][.75(blue,green)] + +\defineadaptive + [tick] + [setups=adaptive:test, + color=adaptive:tick, + foregroundcolor=white, + foregroundstyle=\infofont, + strut=yes] + +\defineadaptive + [tock] + [tick] + [color=adaptive:tock] + +\dostepwiserecurse{8}{12}{1}{% + \dostepwiserecurse{5}{15}{1}{% + this~#1.##1 is~#1.##1 test~#1.##1 + \ifodd##1\relax + \adaptivebox[tick]{\hss tick #1.##1\hss} + \else + \adaptivebox[tock]{\hss tock #1.##1\hss} + \fi + } +} +\stopbuffer + +\typebuffer \getbuffer + +In the next example the graphics adapt to the available space: + +\startbuffer +\startsetups adaptive:test + \setbox\usedadaptivebox\hbox + to \usedadaptivewidth + yoffset -\usedadaptivedepth + \bgroup + \externalfigure + [cow.pdf] + [width=\usedadaptivewidth, + height=\dimexpr\usedadaptivetotal\relax]% + \egroup +\stopsetups + +\dostepwiserecurse{1}{50}{1}{% + this~#1 is~#1 test~#1 + {\adaptivebox[strut=yes,setups=adaptive:test]{}} +} +\stopbuffer + +\typebuffer \getbuffer + +\stopsectionlevel + +\startsectionlevel[title=Prevdepth] + +The depth of a box is normally positive but rules can have a negative depth in +order to get a rule above the baseline. When \TEX\ was written the assumption was +that a negative depth of more than 1000 point made no sense at all. The last +depth on a vertical list is registered in the \type {\prevdepth} variable. This +is basically a reference into the current list. In order to illustrate some +interesting side effects of setting this \type {\prevdepth} and especially when +we set it to -1000pt. In order to illustrate this this special value can be set +to a different value in \LUAMETATEX. However, as dealing with the property is +somewhat special in the engine you should not set it unless you know that the +macro package is ware of it. + +\startbuffer +line 1\par line 2 \par \nointerlineskip line 3 \par +\stopbuffer + +\typebuffer + +Assuming that we haven't set any inter paragraph spacing this gives: + +\startlinecorrection +\ruledvbox{\setupwhitespace[none]\showmakeup[line]\getbuffer} +\stoplinecorrection + +Here \type {\nointerlineskip} is (normally) defined as: + +\starttyping +\prevdepth-1000pt +\stoptyping + +although in \CONTEXT\ we use \type {\ignoredepthcriterium} instead of the hard +coded dimension. We now give a more extensive example: + +\startbuffer[definition-1] +\def\PrevTest#1% + {\setbox0\ruledhbox{\strut$\tf#1$}% + \dp0=#1 + \vbox\bgroup\hsize4em + FIRST\par + \unhbox0\par + LAST\par + \egroup} +\stopbuffer + +\startbuffer[definition-2] +\def\PrevTest#1% + {\setbox0\ruledhbox{\strut$\tf#1$}% + \dp0=#1 + \vbox\bgroup + \ruledhbox{FIRST}\par + \box0\par + \ruledhbox{LAST}\par + \egroup} +\stopbuffer + +\startbuffer[example] +\ruledhbox \bgroup + \PrevTest{-10.0pt}\quad + \PrevTest{-20.0pt}\quad + \PrevTest{-49.9pt}\quad + \PrevTest{-50.0pt}\quad + \PrevTest{-50.1pt}\quad + \PrevTest{-60.0pt}\quad + \PrevTest{-80.0pt}% +\egroup +\stopbuffer + +In this example we set \type {\ignoredepthcriterium} to $\tf-50.0pt$ instead of the +normal $\tf -1000pt$. The helper is defined as: + +\typebuffer[option=TEX][definitions-1] + +or + +\typebuffer[option=TEX][definitions-2] + +The result of the following example is shown in \in {figures} [fig:prevdepth-1] +\in {and} [fig:prevdepth-2]. The first case is what we normally have in text and +we haven't set \type {prevdepth} explicitly between lines so \TEX\ will just look +at the depth of the lines. In the second case the depth is ignored when less than +the criterium which is why, when we set the depth of the box to a negative value +we get somewhat interesting skips. + +\startplacefigure[reference=fig:prevdepth-1] + \showmakeup[line] + \ignoredepthcriterium-50pt + \setupwhitespace[none] + \getbuffer[definition-1,example] +\stopplacefigure + +\startplacefigure[reference=fig:prevdepth-2] + \showmakeup[line] + \ignoredepthcriterium-50pt + \setupwhitespace[none] + \getbuffer[definition-2,example] + \blank[5*line] +\stopplacefigure + +I'm sure one can use this effect otherwise than intended but I doubt is any user +is willing to do this but the fact that we can lower the criterium makes for nice +experiments. Just for the record, in \in {figure} [fig:prevdepth-3] you see what +we get with positive values: + +\startbuffer[example] +\ruledhbox \bgroup + \PrevTest{10.0pt}\quad + \PrevTest{20.0pt}\quad + \PrevTest{49.9pt}\quad + \PrevTest{50.0pt}\quad + \PrevTest{50.1pt}\quad + \PrevTest{60.0pt}\quad + \PrevTest{80.0pt}% +\egroup +\stopbuffer + +\startplacefigure[reference=fig:prevdepth-3] + \showmakeup[line] + \ignoredepthcriterium50pt + \setupwhitespace[none] + \getbuffer[definition-2,example] +\stopplacefigure + +Watch the interline skip kicking in when we make the depth larger than in +\type {\ignoredepthcriterium} being $\tf 50pt$. + +\stopsectionlevel + \startsectionlevel[title=Normalization] {\em todo: users don't need to bother about this but it might be interesting anyway} diff --git a/metapost/context/base/mpxl/mp-cont.mpxl b/metapost/context/base/mpxl/mp-cont.mpxl index 1213a1e61..a636a8dd6 100644 --- a/metapost/context/base/mpxl/mp-cont.mpxl +++ b/metapost/context/base/mpxl/mp-cont.mpxl @@ -259,6 +259,7 @@ permanent newscriptindex mfid_AdaptiveWidth ; mfid_AdaptiveWidth := scriptindex "AdaptiveWidth" ; vardef AdaptiveWidth = runscript mfid_AdaptiveWidth enddef ; newscriptindex mfid_AdaptiveHeight ; mfid_AdaptiveHeight := scriptindex "AdaptiveHeight" ; vardef AdaptiveHeight = runscript mfid_AdaptiveHeight enddef ; newscriptindex mfid_AdaptiveDepth ; mfid_AdaptiveDepth := scriptindex "AdaptiveDepth" ; vardef AdaptiveDepth = runscript mfid_AdaptiveDepth enddef ; +newscriptindex mfid_AdaptiveTotal ; mfid_AdaptiveTotal := scriptindex "AdaptiveDepth" ; vardef AdaptiveTotal = runscript mfid_AdaptiveTotal enddef ; newscriptindex mfid_AdaptiveThickness ; mfid_AdaptiveThickness := scriptindex "AdaptiveThickness" ; vardef AdaptiveThickness = runscript mfid_AdaptiveThickness enddef ; newscriptindex mfid_AdaptiveColor ; mfid_AdaptiveColor := scriptindex "AdaptiveColor" ; vardef AdaptiveColor = runscript mfid_AdaptiveColor enddef ; diff --git a/source/luametatex/source/mp/mpc/mp.c b/source/luametatex/source/mp/mpc/mp.c index a79f7db3f..032d8f34a 100644 --- a/source/luametatex/source/mp/mpc/mp.c +++ b/source/luametatex/source/mp/mpc/mp.c @@ -17038,6 +17038,7 @@ static void mp_do_binary (MP mp, mp_node p, int c) } break; case mp_times_operation: + TIMES: if ((mp->cur_exp.type < mp_color_type) || (p->type < mp_color_type)) { mp_bad_binary(mp, p, mp_times_operation); } else if ((mp->cur_exp.type == mp_known_type) || (p->type == mp_known_type)) { @@ -17222,6 +17223,11 @@ static void mp_do_binary (MP mp, mp_node p, int c) mp_do_edges_trans(mp, p, (int) c); mp_finish_binary(mp, old_p, old_exp); return; + case mp_color_type: + case mp_cmykcolor_type: + if (c == mp_scaled_operation) { + goto TIMES; + } default: mp_bad_binary(mp, p, (int) c); break; diff --git a/source/luametatex/source/mp/mpw/mp.w b/source/luametatex/source/mp/mpw/mp.w index fe47d3d82..6acecd35b 100644 --- a/source/luametatex/source/mp/mpw/mp.w +++ b/source/luametatex/source/mp/mpw/mp.w @@ -24713,6 +24713,7 @@ static void mp_do_binary (MP mp, mp_node p, int c) } break; case mp_times_operation: + TIMES: if ((mp->cur_exp.type < mp_color_type) || (p->type < mp_color_type)) { mp_bad_binary(mp, p, mp_times_operation); } else if ((mp->cur_exp.type == mp_known_type) || (p->type == mp_known_type)) { @@ -24904,6 +24905,12 @@ static void mp_do_binary (MP mp, mp_node p, int c) mp_do_edges_trans(mp, p, (int) c); mp_finish_binary(mp, old_p, old_exp); return; + case mp_color_type: + case mp_cmykcolor_type: + if (c == mp_scaled_operation) { + goto TIMES; + } + /* fall through */ default: mp_bad_binary(mp, p, (int) c); break; diff --git a/source/luametatex/source/tex/texadjust.c b/source/luametatex/source/tex/texadjust.c index cb2f8c247..882227ec2 100644 --- a/source/luametatex/source/tex/texadjust.c +++ b/source/luametatex/source/tex/texadjust.c @@ -146,7 +146,7 @@ void tex_run_vadjust(void) tex_normal_paragraph(vadjust_par_context); tex_push_nest(); cur_list.mode = -vmode; - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; } void tex_finish_vadjust_group(void) diff --git a/source/luametatex/source/tex/texalign.c b/source/luametatex/source/tex/texalign.c index ac7712870..f35bb50b5 100644 --- a/source/luametatex/source/tex/texalign.c +++ b/source/luametatex/source/tex/texalign.c @@ -205,6 +205,19 @@ Todo: lefttabskip righttabskip middletabskip */ +typedef struct alignment_row_state { + halfword orientation; + scaled xoffset; + scaled yoffset; + scaled xmove; + scaled ymove; + halfword shift; + halfword source; + halfword target; + halfword anchor; + halfword attrlist; +} alignment_row_state; + typedef struct alignment_state_info { halfword cur_align; /*tex The current position in the preamble list. */ halfword cur_span; /*tex The start of the currently spanned columns in the preamble list. */ @@ -223,11 +236,14 @@ typedef struct alignment_state_info { halfword no_align_level; halfword no_tab_skips; halfword attr_list; - halfword cell_source; - halfword wrap_source; + halfword cell_source; + halfword wrap_source; /*tex There's also a field in the row_state. */ halfword callback; // halfword reverse; // todo // halfword discard_skips; // todo + halfword row_state_set; + halfword padding; + alignment_row_state row_state; } alignment_state_info ; static alignment_state_info lmt_alignment_state = { @@ -253,8 +269,38 @@ static alignment_state_info lmt_alignment_state = { .callback = 0, // .reverse = 0, // .discard_skips = 0, + .row_state_set = 0, + .padding = 0, + .row_state = { + .attrlist = null, + .orientation = 0, + .xoffset = 0, + .yoffset = 0, + .xmove = 0, + .ymove = 0, + .shift = 0, + .source = 0, + .target = 0, + .anchor = 0, + } }; +static void tex_aux_wipe_row_state(void) +{ + delete_attribute_reference(lmt_alignment_state.row_state.attrlist); + lmt_alignment_state.row_state.attrlist = null; + lmt_alignment_state.row_state.orientation = 0; + lmt_alignment_state.row_state.xoffset = 0; + lmt_alignment_state.row_state.yoffset = 0; + lmt_alignment_state.row_state.xmove = 0; + lmt_alignment_state.row_state.ymove = 0; + lmt_alignment_state.row_state.shift = 0; + lmt_alignment_state.row_state.source = 0; + lmt_alignment_state.row_state.target = 0; + lmt_alignment_state.row_state.anchor = 0; + lmt_alignment_state.row_state_set = 0; +} + /*tex We could as well save these in the alignment stack. */ typedef enum saved_align_items { @@ -313,6 +359,7 @@ static void tex_aux_push_alignment(void) { /*tex The new alignment stack node: */ halfword p = tex_new_node(align_stack_node, 0); + /* todo: just a memory copy */ align_stack_align_ptr(p) = lmt_alignment_state.align_ptr; align_stack_cur_align(p) = lmt_alignment_state.cur_align; align_stack_preamble(p) = preamble; @@ -331,6 +378,18 @@ static void tex_aux_push_alignment(void) align_stack_cur_pre_migrate_tail(p) = lmt_alignment_state.cur_pre_migrate_tail; align_stack_no_tab_skips(p) = lmt_alignment_state.no_tab_skips; align_stack_attr_list(p) = lmt_alignment_state.attr_list; + /* */ + align_stack_row_attrlist(p) = lmt_alignment_state.row_state.attrlist; + align_stack_row_orientation(p) = lmt_alignment_state.row_state.orientation; + align_stack_row_yoffset(p) = lmt_alignment_state.row_state.xoffset; + align_stack_row_xoffset(p) = lmt_alignment_state.row_state.yoffset; + align_stack_row_ymove(p) = lmt_alignment_state.row_state.xmove; + align_stack_row_xmove(p) = lmt_alignment_state.row_state.ymove; + align_stack_row_shift(p) = lmt_alignment_state.row_state.shift; + align_stack_row_source(p) = lmt_alignment_state.row_state.source; + align_stack_row_target(p) = lmt_alignment_state.row_state.target; + align_stack_row_anchor(p) = lmt_alignment_state.row_state.anchor; + /* */ lmt_alignment_state.align_ptr = p; lmt_alignment_state.cur_post_adjust_head = tex_new_temp_node(); lmt_alignment_state.cur_pre_adjust_head = tex_new_temp_node(); @@ -339,6 +398,8 @@ static void tex_aux_push_alignment(void) /* */ lmt_alignment_state.cell_source = 0; lmt_alignment_state.wrap_source = 0; + /* todo: put in align_stack, also wipe attr if needed */ + tex_aux_wipe_row_state(); } static void tex_aux_pop_alignment(void) @@ -367,6 +428,18 @@ static void tex_aux_pop_alignment(void) lmt_alignment_state.cur_pre_migrate_tail = align_stack_cur_pre_migrate_tail(p); lmt_alignment_state.no_tab_skips = align_stack_no_tab_skips(p); lmt_alignment_state.attr_list = align_stack_attr_list(p); + /* */ + lmt_alignment_state.row_state.attrlist = align_stack_row_attrlist(p); + lmt_alignment_state.row_state.orientation = align_stack_row_orientation(p); + lmt_alignment_state.row_state.xoffset = align_stack_row_yoffset(p); + lmt_alignment_state.row_state.yoffset = align_stack_row_xoffset(p); + lmt_alignment_state.row_state.xmove = align_stack_row_ymove(p); + lmt_alignment_state.row_state.ymove = align_stack_row_xmove(p); + lmt_alignment_state.row_state.shift = align_stack_row_shift(p); + lmt_alignment_state.row_state.source = align_stack_row_source(p); + lmt_alignment_state.row_state.target = align_stack_row_target(p); + lmt_alignment_state.row_state.anchor = align_stack_row_anchor(p); + /* */ tex_flush_node(p); } @@ -590,7 +663,154 @@ static void tex_aux_trace_no_align(const char *s) static void tex_aux_run_no_align(void) { - tex_scan_left_brace(); + /* */ + int brace = 0; + int done = lmt_alignment_state.row_state_set; + while (1) { + int add = 0; + AGAIN: + switch (tex_scan_character("atrsoxyATRSOXY", 1, 1, 1)) { + case 0: + goto DONE; + case 't': case 'T': + if (tex_scan_mandate_keyword("target", 1)) { + lmt_alignment_state.row_state.target = tex_scan_int(1, NULL); + done = 1; + } + break; + case 'a': case 'A': + switch (tex_scan_character("ntdNTD", 0, 0, 0)) { + case 'd': case 'D': + if (tex_scan_mandate_keyword("add", 2)) { + add = 1; + goto AGAIN; + } + break; + case 't': case 'T': + if (tex_scan_mandate_keyword("attr", 2)) { + halfword i = tex_scan_attribute_register_number(); + halfword v = tex_scan_int(1, NULL); + if (eq_value(register_attribute_location(i)) != v) { + if (lmt_alignment_state.row_state.attrlist) { + lmt_alignment_state.row_state.attrlist = tex_patch_attribute_list(lmt_alignment_state.row_state.attrlist, i, v); + } else { + lmt_alignment_state.row_state.attrlist = tex_copy_attribute_list_set(tex_current_attribute_list(), i, v); + } + done = 1; + } + } + break; + case 'n': case 'N': + if (tex_scan_mandate_keyword("anchor", 2)) { + switch (tex_scan_character("sS", 0, 0, 0)) { + case 's': case 'S': + lmt_alignment_state.row_state.anchor = tex_scan_anchors(0); + break; + default: + lmt_alignment_state.row_state.anchor = tex_scan_anchor(0); + break; + } + done = 1; + } + break; + default: + tex_aux_show_keyword_error("attr|anchor|add"); + goto DONE; + } + break; + case 'r': case 'R': + if (tex_scan_mandate_keyword("reset", 1)) { + tex_aux_wipe_row_state(); + done = 0; + } + break; + case 's': case 'S': + switch (tex_scan_character("hoHO", 0, 0, 0)) { + case 'h': case 'H': + if (tex_scan_mandate_keyword("shift", 2)) { + lmt_alignment_state.row_state.shift = (add ? lmt_alignment_state.row_state.shift : 0) + + tex_scan_dimen(0, 0, 0, 0, NULL); + done = 1; + } + break; + case 'o': case 'O': + if (tex_scan_mandate_keyword("source", 2)) { + lmt_alignment_state.row_state.source = tex_scan_int(1, NULL); + done = 1; + } + break; + default: + tex_aux_show_keyword_error("shift|source"); + goto DONE; + } + break; + case 'o': case 'O': + if (tex_scan_mandate_keyword("orientation", 1)) { + lmt_alignment_state.row_state.orientation = tex_scan_orientation(0); + done = 1; + } + break; + case 'x': case 'X': + switch (tex_scan_character("omOM", 0, 0, 0)) { + case 'o': case 'O' : + if (tex_scan_mandate_keyword("xoffset", 2)) { + lmt_alignment_state.row_state.xoffset = (add ? lmt_alignment_state.row_state.xoffset : 0) + + tex_scan_dimen(0, 0, 0, 0, NULL); + done = 1; + } + break; + case 'm': case 'M' : + if (tex_scan_mandate_keyword("xmove", 2)) { + lmt_alignment_state.row_state.xmove = (add ? lmt_alignment_state.row_state.xmove : 0) + + tex_scan_dimen(0, 0, 0, 0, NULL); + done = 1; + } + break; + default: + tex_aux_show_keyword_error("xoffset|xmove"); + goto DONE; + } + break; + case 'y': case 'Y': + switch (tex_scan_character("omOM", 0, 0, 0)) { + case 'o': case 'O' : + if (tex_scan_mandate_keyword("yoffset", 2)) { + lmt_alignment_state.row_state.yoffset = (add ? lmt_alignment_state.row_state.yoffset : 0) + + tex_scan_dimen(0, 0, 0, 0, NULL); + done = 1; + } + break; + case 'm': case 'M' : + if (tex_scan_mandate_keyword("ymove", 2)) { + lmt_alignment_state.row_state.ymove = (add ? lmt_alignment_state.row_state.ymove : 0) + + tex_scan_dimen(0, 0, 0, 0, NULL); + done = 1; + } + break; + default: + tex_aux_show_keyword_error("yoffset|ymove"); + goto DONE; + } + break; + case '{': + brace = 1; + goto DONE; + default: + goto DONE; + } + add = 0; + } + DONE: + lmt_alignment_state.row_state_set = done; + if (! lmt_alignment_state.row_state.attrlist) { + /* this alse sets the reference when not yet set */ + lmt_alignment_state.row_state.attrlist = tex_current_attribute_list(); + } + add_attribute_reference(lmt_alignment_state.row_state.attrlist); + /* */ + if (! brace) { + tex_scan_left_brace(); + } tex_new_save_level(no_align_group); ++lmt_alignment_state.no_align_level; tex_aux_trace_no_align("entering"); @@ -598,6 +818,7 @@ static void tex_aux_run_no_align(void) tex_normal_paragraph(no_align_par_context); } } + static int tex_aux_nested_no_align(void) { int state = lmt_alignment_state.no_align_level > 0; @@ -846,7 +1067,7 @@ static void tex_aux_initialize_span(halfword p) if (cur_list.mode == -hmode) { cur_list.space_factor = 1000; } else { - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; tex_normal_paragraph(span_par_context); } lmt_alignment_state.cur_span = p; @@ -864,8 +1085,8 @@ static void tex_aux_initialize_span(halfword p) static void tex_aux_initialize_row(void) { tex_push_nest(); - cur_list.mode = (- hmode - vmode) - cur_list.mode; /* weird code */ - if (cur_list.mode == -hmode) { + cur_list.mode = (- hmode - vmode) - cur_list.mode; /* weird code : - 3 - cur_list.mode : so a buogus line */ + if (cur_list.mode == -hmode) { cur_list.space_factor = 0; } else { cur_list.prev_depth = 0; @@ -882,6 +1103,7 @@ static void tex_aux_initialize_row(void) lmt_alignment_state.cur_post_migrate_tail = lmt_alignment_state.cur_post_migrate_head; lmt_alignment_state.cur_pre_migrate_tail = lmt_alignment_state.cur_pre_migrate_head; tex_aux_initialize_span(lmt_alignment_state.cur_align); + /* todo: wipe attr */ } /*tex @@ -1200,12 +1422,114 @@ static void tex_aux_finish_row(void) tex_tail_append(row); cur_list.space_factor = 1000; } + /*tex + Currently this one can be overloaded by the one set on the row via the noalign trickery + which is probably okay. + */ if (lmt_alignment_state.wrap_source) { box_source_anchor(row) = lmt_alignment_state.wrap_source; - tex_set_box_geometry(row, anchor_geometry); + box_geometry(row) |= anchor_geometry; } + /* + This also wipes (list) fields that we might set below, like |xoffset| that is used for + specific alignments purposes. + */ tex_aux_change_list_type(row, unset_node); - tex_attach_attribute_list_attribute(row, lmt_alignment_state.attr_list); + /* */ + tex_attach_attribute_list_attribute(row, lmt_alignment_state.row_state.attrlist ? + lmt_alignment_state.row_state.attrlist : lmt_alignment_state.attr_list); + /*tex + The next blob of code duplicates some of packaging code but because we fetch from different + fields we cannot share. Maybe, when I add this kind of features to other mechanisms (how + about cells!) then the next code will become some helper. + */ + if (lmt_alignment_state.row_state_set) { + halfword orientation = lmt_alignment_state.row_state.orientation; + halfword anchor = lmt_alignment_state.row_state.anchor; + scaled shift = lmt_alignment_state.row_state.shift; + halfword source = lmt_alignment_state.row_state.source; + halfword target = lmt_alignment_state.row_state.target; + scaled xoffset = lmt_alignment_state.row_state.xoffset; + scaled yoffset = lmt_alignment_state.row_state.yoffset; + scaled xmove = lmt_alignment_state.row_state.xmove; + scaled ymove = lmt_alignment_state.row_state.ymove; + singleword geometry = box_geometry(row); + /* */ + if (xoffset || yoffset || xmove || ymove) { + geometry |= offset_geometry; + } + if (orientation) { + geometry |= orientation_geometry; + } + /* */ + if (tex_has_geometry(geometry, offset_geometry) || tex_has_geometry(geometry, orientation_geometry)) { + scaled wd = box_width(row); + scaled ht = box_height(row); + scaled dp = box_depth(row); + if (xmove) { + xoffset = tex_aux_checked_dimen1(xoffset + xmove); + wd = tex_aux_checked_dimen2(wd + xmove); + set_box_package_state(row, package_dimension_size_set); /* safeguard */ + } + if (ymove) { + yoffset = tex_aux_checked_dimen1(yoffset + ymove); + ht = tex_aux_checked_dimen2(ht + ymove); + dp = tex_aux_checked_dimen2(dp - ymove); + } + box_w_offset(row) = wd; + box_h_offset(row) = ht; + box_d_offset(row) = dp; + switch (orientationonly(orientation)) { + case 0 : /* 0 */ + break; + case 2 : /* 180 */ + box_height(row) = dp; + box_depth(row) = ht; + geometry |= orientation_geometry; + break; + case 1 : /* 90 */ + case 3 : /* 270 */ + box_width(row) = ht + dp; + box_height(row) = wd; + box_depth(row) = 0; + geometry |= orientation_geometry; + break; + case 4 : /* 0 */ + box_height(row) = ht + dp; + box_depth(row) = 0; + geometry |= orientation_geometry; + break; + case 5 : /* 180 */ + box_height(row) = 0; + box_depth(row) = ht + dp; + geometry |= orientation_geometry; + break; + default : + break; + } + if (xoffset || yoffset) { + box_x_offset(row) = xoffset; + box_y_offset(row) = yoffset; + geometry |= offset_geometry; + } + } + if (shift) { + box_shift_amount(row) = shift; + } + if (source || target) { + box_source_anchor(row) = source; + box_target_anchor(row) = target; + geometry |= anchor_geometry; + } + box_anchor(row) = anchor; + box_orientation(row) = orientation; + box_geometry(row) = (singleword) geometry; + } + /*tex + We no longer need the row state so best wipe it now! Then we're ready for the next row. + */ + tex_aux_wipe_row_state(); + /* */ if (every_cr_par) { tex_begin_token_list(every_cr_par, every_cr_text); } @@ -1438,10 +1762,12 @@ static void tex_aux_finish_align(void) halfword preptr; halfword colptr; if (cur_list.mode == -vmode) { - tex_aux_change_list_type(rowptr, hlist_node); + /* tex_aux_change_list_type(rowptr, hlist_node); */ /* too much */ + node_type(rowptr) = hlist_node; box_width(rowptr) = box_width(preroll); } else { - tex_aux_change_list_type(rowptr, vlist_node); + /* tex_aux_change_list_type(rowptr, vlist_node); */ /* too much */ + node_type(rowptr) = vlist_node; box_height(rowptr) = box_height(preroll); } node_subtype(rowptr) = align_row_list; @@ -1609,6 +1935,11 @@ static void tex_aux_finish_align(void) if (reverse) { box_list(rowptr) = tex_reversed_node_list(box_list(rowptr)); } + if (has_box_package_state(rowptr, package_dimension_size_set)) { + if (box_w_offset(rowptr) > box_width(rowptr)) { + box_width(rowptr) = box_w_offset(rowptr); + } + } } break; case rule_node: diff --git a/source/luametatex/source/tex/texbuildpage.c b/source/luametatex/source/tex/texbuildpage.c index 0cf8b70e9..fb7a2dde5 100644 --- a/source/luametatex/source/tex/texbuildpage.c +++ b/source/luametatex/source/tex/texbuildpage.c @@ -1131,7 +1131,7 @@ static void tex_aux_fire_up(halfword c) ++lmt_page_builder_state.dead_cycles; tex_push_nest(); cur_list.mode = -vmode; - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; cur_list.mode_line = -lmt_input_state.input_line; tex_begin_token_list(output_routine_par, output_text); tex_new_save_level(output_group); diff --git a/source/luametatex/source/tex/texcommands.c b/source/luametatex/source/tex/texcommands.c index eeef6b9f6..615db76c9 100644 --- a/source/luametatex/source/tex/texcommands.c +++ b/source/luametatex/source/tex/texcommands.c @@ -306,6 +306,7 @@ void tex_initialize_commands(void) tex_primitive(luatex_command, "pxdimen", internal_dimen_cmd, px_dimen_code, internal_dimen_base); tex_primitive(luatex_command, "tabsize", internal_dimen_cmd, tab_size_code, internal_dimen_base); tex_primitive(luatex_command, "pageextragoal", internal_dimen_cmd, page_extra_goal_code, internal_dimen_base); + tex_primitive(luatex_command, "ignoredepthcriterium", internal_dimen_cmd, ignore_depth_criterium_code, internal_dimen_base); /* mostly for myself, tutorials etc */ /*tex Probably never used with \UNICODE\ omnipresent now: */ diff --git a/source/luametatex/source/tex/texdumpdata.c b/source/luametatex/source/tex/texdumpdata.c index dfac980c5..1500ec78b 100644 --- a/source/luametatex/source/tex/texdumpdata.c +++ b/source/luametatex/source/tex/texdumpdata.c @@ -287,7 +287,7 @@ static void tex_aux_undump_fmt_data(dumpstream f) /*tex This should go elsewhere. */ - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; } /* diff --git a/source/luametatex/source/tex/texdumpdata.h b/source/luametatex/source/tex/texdumpdata.h index 6a9eb5fa4..31d422784 100644 --- a/source/luametatex/source/tex/texdumpdata.h +++ b/source/luametatex/source/tex/texdumpdata.h @@ -55,7 +55,7 @@ */ -# define luametatex_format_fingerprint 680 +# define luametatex_format_fingerprint 681 /* These end up in the string pool. */ diff --git a/source/luametatex/source/tex/texequivalents.h b/source/luametatex/source/tex/texequivalents.h index 82e500fb3..ca32280ef 100644 --- a/source/luametatex/source/tex/texequivalents.h +++ b/source/luametatex/source/tex/texequivalents.h @@ -636,6 +636,7 @@ typedef enum dimen_codes { px_dimen_code, tab_size_code, page_extra_goal_code, + ignore_depth_criterium_code, /*tex total number of dimension parameters */ number_dimen_pars, } dimen_codes; @@ -1359,6 +1360,8 @@ extern void tex_forced_word_define (int g, halfword p, singleword flag, halfword # define split_max_depth_par dimen_parameter(split_max_depth_code) # define overfull_rule_par dimen_parameter(overfull_rule_code) # define box_max_depth_par dimen_parameter(box_max_depth_code) +# define ignore_depth_criterium_par dimen_parameter(ignore_depth_criterium_code) + # define top_skip_par glue_parameter(top_skip_code) # define split_top_skip_par glue_parameter(split_top_skip_code) diff --git a/source/luametatex/source/tex/texinserts.c b/source/luametatex/source/tex/texinserts.c index 3d634dd39..4ff07625d 100644 --- a/source/luametatex/source/tex/texinserts.c +++ b/source/luametatex/source/tex/texinserts.c @@ -451,7 +451,7 @@ void tex_run_insert(void) tex_normal_paragraph(insert_par_context); tex_push_nest(); cur_list.mode = -vmode; - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; } void tex_finish_insert_group(void) diff --git a/source/luametatex/source/tex/texmaincontrol.c b/source/luametatex/source/tex/texmaincontrol.c index 62b6d1e1e..11007d9cd 100644 --- a/source/luametatex/source/tex/texmaincontrol.c +++ b/source/luametatex/source/tex/texmaincontrol.c @@ -64,32 +64,6 @@ main_control_state_info lmt_main_control_state = { .quit_loop = 0, }; -/*tex - A few helpers: -*/ - -inline static scaled tex_aux_checked_dimen1(scaled v) -{ - if (v > max_dimen) { - return max_dimen; - } else if (v < -max_dimen) { - return -max_dimen; - } else { - return v; - } -} - -inline static scaled tex_aux_checked_dimen2(scaled v) -{ - if (v > max_dimen) { - return max_dimen; - } else if (v < 0) { - return 0; - } else { - return v; - } -} - /*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! @@ -6569,6 +6543,7 @@ void tex_initialize_variables(void) math_left_class_par = unset_noad_class; math_right_class_par = unset_noad_class; variable_family_par = -1, + ignore_depth_criterium_par = ignore_depth; aux_get_date_and_time(&time_par, &day_par, &month_par, &year_par, &lmt_engine_state.utc_time); } } diff --git a/source/luametatex/source/tex/texnesting.c b/source/luametatex/source/tex/texnesting.c index f281eee2e..f29bfe0a2 100644 --- a/source/luametatex/source/tex/texnesting.c +++ b/source/luametatex/source/tex/texnesting.c @@ -247,7 +247,7 @@ void tex_initialize_nesting(void) cur_list.delim = null; cur_list.prev_graf = 0; cur_list.mode_line = 0; - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; cur_list.space_factor = 1000; cur_list.incomplete_noad = null; cur_list.direction_stack = null; @@ -389,7 +389,7 @@ void tex_show_activities(void) switch (abs(n.mode) / (max_command_cmd + 1)) { case 0: { - if (n.prev_depth <= ignore_depth) { + if (n.prev_depth <= ignore_depth_criterium_par) { tex_print_format("%l[prevdepth ignored"); } else { tex_print_format("%l[prevdepth %D", n.prev_depth, pt_unit); diff --git a/source/luametatex/source/tex/texnodes.h b/source/luametatex/source/tex/texnodes.h index 9cc1cbb39..3c9d54452 100644 --- a/source/luametatex/source/tex/texnodes.h +++ b/source/luametatex/source/tex/texnodes.h @@ -1412,7 +1412,7 @@ inline static int tex_same_mathspec(halfword a, halfword b) Here are some more stack related nodes. */ -# define align_stack_node_size 10 +# define align_stack_node_size 15 # define align_stack_align_ptr(a) vinfo(a,1) # define align_stack_cur_align(a) vlink(a,1) # define align_stack_preamble(a) vinfo(a,2) @@ -1432,6 +1432,17 @@ inline static int tex_same_mathspec(halfword a, halfword b) # define align_stack_no_tab_skips(a) vinfo(a,9) # define align_stack_attr_list(a) vlink(a,9) +# define align_stack_row_attrlist(a) vinfo(a,10) +# define align_stack_row_orientation(a) vlink(a,10) +# define align_stack_row_yoffset(a) vinfo(a,11) +# define align_stack_row_xoffset(a) vlink(a,11) +# define align_stack_row_ymove(a) vinfo(a,12) +# define align_stack_row_xmove(a) vlink(a,12) +# define align_stack_row_shift(a) vinfo(a,13) +# define align_stack_row_source(a) vlink(a,13) +# define align_stack_row_target(a) vinfo(a,14) +# define align_stack_row_anchor(a) vlink(a,14) + /*tex If nodes are for nesting conditionals. We have more state information that in (for instance) \LUATEX\ because we have more tracing and more test variants. diff --git a/source/luametatex/source/tex/texpackaging.c b/source/luametatex/source/tex/texpackaging.c index 49a18497c..3cea2b7b8 100644 --- a/source/luametatex/source/tex/texpackaging.c +++ b/source/luametatex/source/tex/texpackaging.c @@ -2323,7 +2323,7 @@ void tex_run_vcenter(void) tex_normal_paragraph(vcenter_par_context); tex_push_nest(); cur_list.mode = -vmode; - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; if (every_vbox_par) { tex_begin_token_list(every_vbox_par, every_vbox_text); } @@ -2358,28 +2358,6 @@ void tex_finish_vcenter_group(void) } } -inline static scaled tex_aux_checked_dimen1(halfword v) -{ - if (v > max_dimen) { - return max_dimen; - } else if (v < -max_dimen) { - return -max_dimen; - } else { - return v; - } -} - -inline static scaled tex_aux_checked_dimen2(halfword v) -{ - if (v > max_dimen) { - return max_dimen; - } else if (v < 0) { - return 0; - } else { - return v; - } -} - static scaled tex_aux_first_height(halfword boxnode) { halfword list = box_list(boxnode); @@ -2816,14 +2794,14 @@ void tex_append_to_vlist(halfword b, int location, const line_break_properties * { if (location >= 0) { halfword result = null; - halfword next_depth = ignore_depth; + halfword next_depth = ignore_depth_criterium_par; int prev_set = 0; int check_depth = 0; if (lmt_append_to_vlist_callback(b, location, cur_list.prev_depth, &result, &next_depth, &prev_set, &check_depth)) { if (prev_set) { cur_list.prev_depth = next_depth; } - if (check_depth && result && (cur_list.prev_depth > ignore_depth)) { + if (check_depth && result && (cur_list.prev_depth > ignore_depth_criterium_par)) { /*tex We only deal with a few types and one can always at the \LUA\ end check for some of these and decide not to apply the correction. @@ -2848,7 +2826,7 @@ void tex_append_to_vlist(halfword b, int location, const line_break_properties * return; } } - if (cur_list.prev_depth > ignore_depth) { + 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; @@ -3422,7 +3400,7 @@ void tex_begin_box(int boxcontext, scaled shift, halfword slot) update_tex_internal_dir_state(0); cur_list.mode = - mode; if (mode == vmode) { - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; if (every_vbox_par) { tex_begin_token_list(every_vbox_par, every_vbox_text); } diff --git a/source/luametatex/source/tex/texpackaging.h b/source/luametatex/source/tex/texpackaging.h index 0e3c0a471..8cef36619 100644 --- a/source/luametatex/source/tex/texpackaging.h +++ b/source/luametatex/source/tex/texpackaging.h @@ -70,6 +70,19 @@ typedef enum saved_full_spec_items { saved_full_spec_n_of_items = 21, } saved_full_spec_items; +// typedef enum saved_align_spec_items { +// saved_align_spec_item_attr_list = 0, +// saved_align_spec_item_orientation = 1, +// saved_align_spec_item_anchor = 2, +// saved_align_spec_item_geometry = 3, +// saved_align_spec_item_xoffset = 4, +// saved_align_spec_item_yoffset = 5, +// saved_align_spec_item_shift = 6, +// saved_align_spec_item_source = 7, +// saved_align_spec_item_target = 8, +// saved_align_spec_n_of_items = 9, +// } saved_align_spec_items; + typedef enum holding_migration_options { holding_none_option = 0x00, holding_marks_option = 0x01, @@ -212,4 +225,26 @@ typedef enum box_flags { extern void tex_begin_box (int boxcontext, scaled shift, halfword slot); extern int tex_ignore_math_skip (halfword p); +inline static scaled tex_aux_checked_dimen1(halfword v) +{ + if (v > max_dimen) { + return max_dimen; + } else if (v < -max_dimen) { + return -max_dimen; + } else { + return v; + } +} + +inline static scaled tex_aux_checked_dimen2(halfword v) +{ + if (v > max_dimen) { + return max_dimen; + } else if (v < 0) { + return 0; + } else { + return v; + } +} + # endif diff --git a/source/luametatex/source/tex/texrules.c b/source/luametatex/source/tex/texrules.c index 1a3040585..768f640b1 100644 --- a/source/luametatex/source/tex/texrules.c +++ b/source/luametatex/source/tex/texrules.c @@ -141,7 +141,7 @@ void tex_aux_run_vrule(void) void tex_aux_run_hrule(void) { tex_tail_append(tex_aux_scan_rule_spec(h_rule_type, cur_chr)); - cur_list.prev_depth = ignore_depth; + cur_list.prev_depth = ignore_depth_criterium_par; } void tex_aux_run_mrule(void) diff --git a/source/luametatex/source/tex/textypes.h b/source/luametatex/source/tex/textypes.h index 12a0aadf9..05324db83 100644 --- a/source/luametatex/source/tex/textypes.h +++ b/source/luametatex/source/tex/textypes.h @@ -171,7 +171,6 @@ extern halfword tex_badness( # define default_rule 26214 /*tex 0.4pt */ # define ignore_depth -65536000 /*tex The magic dimension value to mean \quote {ignore me}: -1000pt */ -# define ignore_depth_zero_baselineskip -131072000 /*tex Idem but keep zero skip: -2000pt */ # define min_quarterword 0 /*tex The smallest allowable value in a |quarterword|. */ # define max_quarterword 65535 /*tex The largest allowable value in a |quarterword|. */ diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 3809814e6..910099ba4 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2022.12.22 22:14} +\newcontextversion{2022.12.27 21:02} %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 73d2ecbc6..ebc3a7ed1 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2022.12.22 22:14} +\edef\contextversion{2022.12.27 21:02} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index b863f8982..9da0701b3 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2022.12.22 22:14} +\newcontextversion{2022.12.27 21:02} %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 5186fe98b..76d26f591 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2022.12.22 22:14} +\edef\contextversion{2022.12.27 21:02} %D Kind of special: diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index 8285b26be..87e7119f2 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -427,6 +427,7 @@ return { "ifzerodim", "ifzeronum", "ignorearguments", + "ignoredepthcriterium", "ignorepars", "immediate", "immutable", diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index f172a1695..401fcaf55 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 11e841468..da72ebe62 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkxl/buff-ini.mkxl b/tex/context/base/mkxl/buff-ini.mkxl index e7b243374..d192a01ea 100644 --- a/tex/context/base/mkxl/buff-ini.mkxl +++ b/tex/context/base/mkxl/buff-ini.mkxl @@ -31,7 +31,7 @@ \permanent\tolerant\protected\def\resetbuffer[#1]{\clf_erasebuffer{#1}} % todo: use public implementor -\permanent\setuvalue{\e!start\v!buffer}% +\permanent\protected\defcsname\e!start\v!buffer\endcsname {\begingroup % (3) \obeylines \buff_start} diff --git a/tex/context/base/mkxl/colo-ext.mkxl b/tex/context/base/mkxl/colo-ext.mkxl index 51e9b91ff..a70bd9b18 100644 --- a/tex/context/base/mkxl/colo-ext.mkxl +++ b/tex/context/base/mkxl/colo-ext.mkxl @@ -46,7 +46,7 @@ \installcorenamespace{colorintent} \permanent\protected\def\registercolorintent#1#2% \relax is needed ! - {\setevalue{\??colorintent#1}{\c_attr_colorintent\clf_registercolorintent{#2}\relax}} + {\edefcsname\??colorintent#1\endcsname{\c_attr_colorintent\clf_registercolorintent{#2}\relax}} \protected\def\colo_intents_set {\clf_enablecolorintents diff --git a/tex/context/base/mkxl/colo-grp.mkxl b/tex/context/base/mkxl/colo-grp.mkxl index 952bb18b3..1d3df712c 100644 --- a/tex/context/base/mkxl/colo-grp.mkxl +++ b/tex/context/base/mkxl/colo-grp.mkxl @@ -76,10 +76,10 @@ {\advanceby\c_colo_groups_n\plusone \csname\??colorgroupsetter\ifcsname\??colorgroupsetter#2\endcsname#2\else\s!rgb\fi\endcsname[#1:\the\c_colo_groups_n][#3:0:0:0:0]} -\setvalue{\??colorgroupsetter\s!gray}[#1][#2:#3]{\definecolor[#1][s=#2]} -\setvalue{\??colorgroupsetter\s!rgb }[#1][#2:#3:#4:#5]{\definecolor[#1][r=#2,g=#3,b=#4]} -\setvalue{\??colorgroupsetter\s!cmyk}[#1][#2:#3:#4:#5:#6]{\definecolor[#1][c=#2,m=#3=,y=#4,k=#5]} -\setvalue{\??colorgroupsetter\s!spot}[#1][#2:#3:#4]{\definespotcolor[#1][#2][p=#3]} +\defcsname\??colorgroupsetter\s!gray\endcsname[#1][#2:#3]{\definecolor[#1][s=#2]} +\defcsname\??colorgroupsetter\s!rgb \endcsname[#1][#2:#3:#4:#5]{\definecolor[#1][r=#2,g=#3,b=#4]} +\defcsname\??colorgroupsetter\s!cmyk\endcsname[#1][#2:#3:#4:#5:#6]{\definecolor[#1][c=#2,m=#3=,y=#4,k=#5]} +\defcsname\??colorgroupsetter\s!spot\endcsname[#1][#2:#3:#4]{\definespotcolor[#1][#2][p=#3]} %D \macros %D {showcolorgroup} diff --git a/tex/context/base/mkxl/colo-ini.mkxl b/tex/context/base/mkxl/colo-ini.mkxl index f17ec0b2b..6b9b8a5f8 100644 --- a/tex/context/base/mkxl/colo-ini.mkxl +++ b/tex/context/base/mkxl/colo-ini.mkxl @@ -538,14 +538,14 @@ % \or % \colo_palet_prepare{#1}% % \ifcondition\validassignment{#2}% -% \setevalue{\??colorpaletspecification#1}{#2}% +% \edefcsname\??colorpaletspecification#1\endcsname{#2}% % \processcommalist[#2]{\colo_palets_define_one{#1}}% % \orelse\ifcsname\??colorpaletspecification#2\endcsname % \normalexpanded{\colo_palets_define_b{#1}{\lastnamedcs}{}}% % \fi % \or % \colo_palet_prepare{#1}% -% \setevalue{\??colorpaletspecification#1}{#2}% +% \edefcsname\??colorpaletspecification#1\endcsname{#2}% % \colo_palet_extend{#2}% % \colo_palets_define_assign{#1}{#2}{#3}% % \fi} diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index ed5b54767..f704da4e1 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2022.12.22 22:14} +\newcontextversion{2022.12.27 21:02} %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 77660ad15..2aec57d7b 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2022.12.22 22:14} +\immutable\edef\contextversion{2022.12.27 21:02} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/core-con.mkxl b/tex/context/base/mkxl/core-con.mkxl index 5a2d50493..f9aa1a69d 100644 --- a/tex/context/base/mkxl/core-con.mkxl +++ b/tex/context/base/mkxl/core-con.mkxl @@ -419,7 +419,7 @@ \installcorenamespace{date} \permanent\tolerant\protected\def\definedate[#1]#,[#2]% - {\ifarguments\else\setvalue{\??date#1}{#2}\fi} + {\ifarguments\else\defcsname\??date#1\endcsname{#2}\fi} \def\syst_converters_check_date_specification#1% {\ifcsname\??date#1\endcsname @@ -568,8 +568,8 @@ \def\syst_converters_define_conversion_indeed#1#2#3% {\doifelseinstring{,}{\detokenize{#3}} {\clf_defineconversion{#2}{\detokenize{#3}}% a set e.g. of symbols - \setgvalue{\??conversion#1}{\syst_converters_checked_conversion{#2}}} - {\setgvalue{\??conversion#1}{#3}}} + \gdefcsname\??conversion#1\endcsname{\syst_converters_checked_conversion{#2}}} + {\gdefcsname\??conversion#1\endcsname{#3}}} \def\syst_converters_checked_conversion#1#2% {\clf_checkedconversion{#1}\numexpr#2\relax} @@ -588,9 +588,9 @@ \permanent\protected\def\uconvertnumber % unexpandable {\convertnumber} -\setvalue{\??conversionarguments1}#1{\csname\??conversion\currentlanguage#1\endcsname} -\setvalue{\??conversionarguments2}#1{\csname\??conversion #1\endcsname} -\letvalue{\??conversionarguments3}\syst_converters_checked_conversion +\defcsname\??conversionarguments1\endcsname#1{\csname\??conversion\currentlanguage#1\endcsname} +\defcsname\??conversionarguments2\endcsname#1{\csname\??conversion #1\endcsname} +\letcsname\??conversionarguments3\endcsname \syst_converters_checked_conversion % we can also add a \ctxcommand{doifelseconversion("#1","\currentlanguage")} to check % if we have definitions that are not matched at the lua end .. eventually we might do @@ -617,11 +617,11 @@ %D Handy. -\setvalue{\??conversionwords\v!one }{1} -\setvalue{\??conversionwords\v!two }{2} -\setvalue{\??conversionwords\v!three}{3} -\setvalue{\??conversionwords\v!four }{4} -\setvalue{\??conversionwords\v!five }{5} +\defcsname\??conversionwords\v!one \endcsname{1} +\defcsname\??conversionwords\v!two \endcsname{2} +\defcsname\??conversionwords\v!three\endcsname{3} +\defcsname\??conversionwords\v!four \endcsname{4} +\defcsname\??conversionwords\v!five \endcsname{5} %permanent\def\wordtonumber#1#2{\ifcsname\??conversionwords#1\endcsname\csname\??conversionwords#1\endcsname\else#2\fi} \permanent\def\wordtonumber#1#2{\ifcsname\??conversionwords#1\endcsname\lastnamedcs\else#2\fi} diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt index 7aba4ac01..9a37ccf8a 100644 --- a/tex/context/base/mkxl/driv-shp.lmt +++ b/tex/context/base/mkxl/driv-shp.lmt @@ -856,16 +856,18 @@ local hlist_out, vlist_out do local save_h = cur_h if pos_r == righttoleft_code then cur_h = ref_h - shipbox_h + cur_h - cur_h = width * (cur_h // width) + cur_h = width * (cur_h / width) cur_h = ref_h - shipbox_h - cur_h else cur_h = ref_h - shipbox_h - cur_h - cur_h = width * (cur_h // width) + cur_h = width * (cur_h / width) cur_h = ref_h - shipbox_h - cur_h end if cur_h < save_h then cur_h = cur_h + width end + local lr = gluewidth % width + cur_h = cur_h + lr / 2 elseif subtype == leaders_code then local save_h = cur_h cur_h = width * (cur_h / width) @@ -873,8 +875,8 @@ local hlist_out, vlist_out do cur_h = cur_h + width end else - lq = gluewidth / width - lr = gluewidth % width + local lq = gluewidth / width + local lr = gluewidth % width if subtype == cleaders_code then cur_h = cur_h + lr / 2 else @@ -1306,11 +1308,13 @@ local hlist_out, vlist_out do if subtype == gleaders_code then save_v = cur_v cur_v = ref_v - shipbox_v - cur_v - cur_v = total * (cur_v // total) + cur_v = total * (cur_v / total) cur_v = ref_v - shipbox_v - cur_v if cur_v < save_v then cur_v = cur_v + total end + local lr = glueheight % total + cur_v = cur_v + lr / 2 elseif subtype == leaders_code then -- aleader save_v = cur_v cur_v = top_edge + total * ((cur_v - top_edge) // total) @@ -1318,13 +1322,13 @@ local hlist_out, vlist_out do cur_v = cur_v + total end else - lq = glueheight / total - lr = glueheight % total + local lq = glueheight / total + local lr = glueheight % total if subtype == cleaders_code then - cur_v = cur_v + lr // 2 + cur_v = cur_v + lr / 2 else ly = lr // (lq + 1) - cur_v = cur_v + (lr - (lq - 1) * ly) // 2 + cur_v = cur_v + (lr - (lq - 1) * ly) / 2 end end local shift = getshift(leader) diff --git a/tex/context/base/mkxl/enco-ini.mkxl b/tex/context/base/mkxl/enco-ini.mkxl index 5370035ed..3d87ee776 100644 --- a/tex/context/base/mkxl/enco-ini.mkxl +++ b/tex/context/base/mkxl/enco-ini.mkxl @@ -71,7 +71,7 @@ \fi \endcsname} -\immutable\letvalue{\??accents}\empty +\immutable\letcsname\??accents\endcsname\empty %D Because now have this (\type {\chr} issues a one|-|time warning): @@ -237,7 +237,7 @@ {\topaccent{0pt}{0}{15}{\textgrave}} % e.g. \permanent\protected\def\definemathaccent#1 #2% - {\setvalue{#1}{\mathaccent#2 }} + {\defcsname#1\endcsname{\mathaccent#2 }} % can be redefined % from enco-def: diff --git a/tex/context/base/mkxl/file-ini.mklx b/tex/context/base/mkxl/file-ini.mklx index 66107a083..106536eea 100644 --- a/tex/context/base/mkxl/file-ini.mklx +++ b/tex/context/base/mkxl/file-ini.mklx @@ -214,7 +214,7 @@ {\ifcsname\??fileonce#whatever\endcsname \expandafter\gobbleoneargument \else - \letgvalue{\??fileonce#whatever}\relax + \aliased\gletcsname\??fileonce#whatever\endcsname\relax \expandafter\firstofoneargument \fi} diff --git a/tex/context/base/mkxl/file-job.mklx b/tex/context/base/mkxl/file-job.mklx index 6dc3d34be..6272b551f 100644 --- a/tex/context/base/mkxl/file-job.mklx +++ b/tex/context/base/mkxl/file-job.mklx @@ -277,8 +277,8 @@ \normalexpanded {% \startsetups[\currentdocument:\v!start]\noexpand\directsetup{\ifempty\currentdocumentparent\s!document\else\currentdocumentparent\fi:\v!start}\stopsetups \startsetups[\currentdocument:\v!stop ]\noexpand\directsetup{\ifempty\currentdocumentparent\s!document\else\currentdocumentparent\fi:\v!stop }\stopsetups - \permanent\setvalue{\e!start\currentdocument}{\startdocument[\currentdocument]}% - \permanent\setvalue{\e!stop \currentdocument}{\stopdocument} + \permanent\defcsname\e!start\currentdocument\endcsname{\startdocument[\currentdocument]}% + \permanent\defcsname\e!stop \currentdocument\endcsname{\stopdocument} }% \to \everydefinedocument @@ -339,7 +339,7 @@ % % \protected\def\samplefile#1% % {\ifcsname\??samplefile#1\endcsname \else -% \setxvalue{\??samplefile#1}{\cldloadfile{#1}}% +% \xdefcsname\??samplefile#1\endcsname{\cldloadfile{#1}}% % \fi % \lastnamedcs} diff --git a/tex/context/base/mkxl/font-ini.mklx b/tex/context/base/mkxl/font-ini.mklx index e32ed0bf2..6647bd061 100644 --- a/tex/context/base/mkxl/font-ini.mklx +++ b/tex/context/base/mkxl/font-ini.mklx @@ -1949,7 +1949,7 @@ % we need to check the fontclass \permanent\def\registerfontclass#class% - {\letgvalue{\??fontclassyes#class}\v!yes} % global ? + {\gletcsname\??fontclassyes#class\endcsname\v!yes} % global ? \permanent\def\setcurrentfontclass#class% {\ifcsname\??fontclassyes#class\endcsname diff --git a/tex/context/base/mkxl/font-sym.mklx b/tex/context/base/mkxl/font-sym.mklx index 83b3447ea..9e6482c8d 100644 --- a/tex/context/base/mkxl/font-sym.mklx +++ b/tex/context/base/mkxl/font-sym.mklx @@ -56,19 +56,17 @@ % potential generalization: % -% \letvalue{\??fontfile:t:\s!rm}\s!Serif -% \letvalue{\??fontfile:t:\s!ss}\s!Sans -% \letvalue{\??fontfile:t:\s!tt}\s!Mono -% -% \letvalue{\??fontfile:a:\s!rm}\s!Regular -% \letvalue{\??fontfile:a:\s!ss}\s!Support -% \letvalue{\??fontfile:a:\s!tt}\s!Type -% -% \letvalue{\??fontfile:s:\s!bf}\s!Bold -% \letvalue{\??fontfile:s:\s!sl}\s!Slanted -% \letvalue{\??fontfile:s:\s!it}\s!Italic -% \letvalue{\??fontfile:s:\s!bs}\s!BoldSlanted -% \letvalue{\??fontfile:s:\s!bi}\s!BoldItalic +% \letcsname\??fontfile:t:\s!rm\endcsname\s!Serif +% \letcsname\??fontfile:t:\s!ss\endcsname\s!Sans +% \letcsname\??fontfile:t:\s!tt\endcsname\s!Mono +% \letcsname\??fontfile:a:\s!rm\endcsname\s!Regular +% \letcsname\??fontfile:a:\s!ss\endcsname\s!Support +% \letcsname\??fontfile:a:\s!tt\endcsname\s!Type +% \letcsname\??fontfile:s:\s!bf\endcsname\s!Bold +% \letcsname\??fontfile:s:\s!sl\endcsname\s!Slanted +% \letcsname\??fontfile:s:\s!it\endcsname\s!Italic +% \letcsname\??fontfile:s:\s!bs\endcsname\s!BoldSlanted +% \letcsname\??fontfile:s:\s!bi\endcsname\s!BoldItalic % % \def\v_font_string_a{\executeifdefined{\??fontfile:t:\fontstyle}\s!Serif} % \def\v_font_string_a{\executeifdefined{\??fontfile:t:\fontstyle}\s!Serif} diff --git a/tex/context/base/mkxl/lang-ini.mkxl b/tex/context/base/mkxl/lang-ini.mkxl index ef85838dc..93b991e44 100644 --- a/tex/context/base/mkxl/lang-ini.mkxl +++ b/tex/context/base/mkxl/lang-ini.mkxl @@ -379,10 +379,10 @@ \let\lang_basics_synchronize_nop\zerocount % not loaded anyway -\letvalue{\??languagenumbers}\lang_basics_synchronize_nop % initime +\letcsname\??languagenumbers\endcsname\lang_basics_synchronize_nop % initime \appendtoks - \letvalue{\??languagenumbers}\lang_basics_synchronize_yes % runtime + \letcsname\??languagenumbers\endcsname\lang_basics_synchronize_yes % runtime \to \everydump \def\lang_basics_synchronize diff --git a/tex/context/base/mkxl/lpdf-rul.lmt b/tex/context/base/mkxl/lpdf-rul.lmt index bfedf23b2..dfa5d1a89 100644 --- a/tex/context/base/mkxl/lpdf-rul.lmt +++ b/tex/context/base/mkxl/lpdf-rul.lmt @@ -352,17 +352,17 @@ do end end - local f_rectangle = formatters["%.6N w %.6N %.6N %.6N %.6N re %s"] - local f_baselined = formatters["%.6N w %.6N %.6N %.6N %.6N re s %.6N %.6N m %.6N %.6N l s"] - local f_dashlined = formatters["%.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s"] - local f_dashtwice = formatters["%.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s %.6N %.6N m %.6N %.6N l s"] + local f_rectangle = formatters["q %.6N w %.6N %.6N %.6N %.6N re %s Q"] + local f_baselined = formatters["q %.6N w %.6N %.6N %.6N %.6N re s %.6N %.6N m %.6N %.6N l s Q"] + local f_dashlined = formatters["q %.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s Q"] + local f_dashtwice = formatters["q %.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s %.6N %.6N m %.6N %.6N l s Q"] local f_radtangle = formatters[ -[[%.6N w %.6N %.6N m +[[q %.6N w %.6N %.6N m %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y %.6N %.6N l %.6N %.6N %.6N %.6N y -h %s]] +h %s Q]] ] local rule_any = function(p,h,v,i,n) diff --git a/tex/context/base/mkxl/mlib-ctx.mkxl b/tex/context/base/mkxl/mlib-ctx.mkxl index 7c88585e9..91bcaa58b 100644 --- a/tex/context/base/mkxl/mlib-ctx.mkxl +++ b/tex/context/base/mkxl/mlib-ctx.mkxl @@ -15,6 +15,17 @@ \installcorenamespace{graphicvariable} +% \unprotect + +% \newdimension\d_adaptive_width +% \newdimension\d_adaptive_height +% \newdimension\d_adaptive_depth +% \newdimension\d_adaptive_line +% \newdimension\d_adaptive_hsize +% \newbox \b_adaptive_box + +% \protect + \registerctxluafile{mlib-fio}{autosuffix} \registerctxluafile{mlib-run}{autosuffix} \registerctxluafile{mlib-ctx}{autosuffix} diff --git a/tex/context/base/mkxl/mlib-fio.lmt b/tex/context/base/mkxl/mlib-fio.lmt index e4db28cea..07c9275be 100644 --- a/tex/context/base/mkxl/mlib-fio.lmt +++ b/tex/context/base/mkxl/mlib-fio.lmt @@ -9,7 +9,8 @@ if not modules then modules = { } end modules ['mlib-fio'] = { local type = type local find = string.find local concat = table.concat -local suffix, addsuffix = file.suffix, file.addsuffix +local suffix, addsuffix, is_writable = file.suffix, file.addsuffix, file.is_writable +local urlhashed = url.hashed local findfile = resolvers.findfile local mplibnew = mplib.new @@ -90,7 +91,7 @@ end -- finders.file = function(specification,name,mode,kind) -- if mode == "r" then -- return findmpfile(name,kind) --- elseif file.is_writable(name) then +-- elseif is_writable(name) then -- return name -- else -- return nil @@ -102,7 +103,7 @@ end -- finders.file = function(specification,name,mode,kind) -- if not mode or mode == "r" then -- return findmpfile(name,kind) --- elseif file.is_writable(name) then +-- elseif is_writable(name) then -- return name -- else -- return nil @@ -113,14 +114,14 @@ end finders.file = function(specification,name,mode,kind) if mode == "w" then - return file.is_writable(name) and name or nil + return is_writable(name) and name or nil else return findmpfile(name,kind) or nil end end local function finder(name,mode,kind) -- fake message for mpost.map and metafun.mpvi - local specification = url.hashed(name) + local specification = urlhashed(name) local finder = finders[specification.scheme] or finders.file local found = finder(specification,name,mode,validftype(ftype)) return found diff --git a/tex/context/base/mkxl/mlib-int.lmt b/tex/context/base/mkxl/mlib-int.lmt index ea9092611..3d71db82f 100644 --- a/tex/context/base/mkxl/mlib-int.lmt +++ b/tex/context/base/mkxl/mlib-int.lmt @@ -244,10 +244,14 @@ end do - local d_adaptive_width = isdimen("d_adaptive_width") registerdirect("AdaptiveWidth", function() return d_adaptive_width * factor end) - local d_adaptive_height = isdimen("d_adaptive_height") registerdirect("AdaptiveHeight", function() return d_adaptive_height * factor end) - local d_adaptive_depth = isdimen("d_adaptive_depth") registerdirect("AdaptiveDepth", function() return d_adaptive_depth * factor end) - local d_adaptive_line = isdimen("d_adaptive_line") registerdirect("AdaptiveThickness", function() return d_adaptive_line * factor end) + local d_adaptive_width = isdimen("d_adaptive_width") registerdirect("AdaptiveWidth", function() return getdimen(d_adaptive_width) * factor end) + local d_adaptive_height = isdimen("d_adaptive_height") registerdirect("AdaptiveHeight", function() return getdimen(d_adaptive_height) * factor end) + local d_adaptive_depth = isdimen("d_adaptive_depth") registerdirect("AdaptiveDepth", function() return getdimen(d_adaptive_depth) * factor end) + local d_adaptive_line = isdimen("d_adaptive_line") registerdirect("AdaptiveThickness", function() return getdimen(d_adaptive_line) * factor end) registerdirect("AdaptiveColor", function() return getmacro("m_adaptive_color") end) + registerdirect("AdaptiveTotal", function() + return (getdimen(d_adaptive_height) + getdimen(d_adaptive_depth)) * factor + end) + end diff --git a/tex/context/base/mkxl/mult-aux.mkxl b/tex/context/base/mkxl/mult-aux.mkxl index d45a48923..08d75a5b3 100644 --- a/tex/context/base/mkxl/mult-aux.mkxl +++ b/tex/context/base/mkxl/mult-aux.mkxl @@ -796,7 +796,7 @@ % First we had, in tune with the regular system variables: % % \starttyping -% \protected\def\installnamespace#1{\setvalue{????#1}{@@@@#1}} +% \protected\def\installnamespace#1{\defcsname ????#1\endcsname{@@@@#1}} % \stoptyping % % The following variant is nicer and in principle faster but that gets unnoticed diff --git a/tex/context/base/mkxl/mult-ini.mkxl b/tex/context/base/mkxl/mult-ini.mkxl index 0e010429e..19370814f 100644 --- a/tex/context/base/mkxl/mult-ini.mkxl +++ b/tex/context/base/mkxl/mult-ini.mkxl @@ -357,7 +357,7 @@ \permanent\protected\def\startmessages #1 library: #2 % {\begingroup - \ifcsname\m!prefix!#2\endcsname\else\immutable\setgvalue{\m!prefix!#2}{#2}\fi + \ifcsname\m!prefix!#2\endcsname\else\immutable\gdefcsname\m!prefix!#2\endcsname{#2}\fi \catcode\endoflineasciicode\othercatcode \doifelseinset{#1}{\currentresponses,all}\mult_messages_start_yes\mult_messages_start_nop{#2}} @@ -716,9 +716,9 @@ \permanent\overloaded\protected\def\setinterfaceelement#1#2% {\clf_setinterfaceelement{#1}{#2}% \ifcsname\e!prefix!#1\endcsname - \doifnotvalue{\e!prefix!#1}{#2}{\enforced\immutable\setvalue{\e!prefix!#1}{#2}}% + \doifnotvalue{\e!prefix!#1}{#2}{\enforced\immutable\defcsname\e!prefix!#1\endcsname{#2}}% \else - \enforced\immutable\setvalue{\e!prefix!#1}{#2}% + \enforced\immutable\defcsname\e!prefix!#1\endcsname{#2}% \fi} \permanent\protected\def\setinterfacecommand#1#2% \frozen ? \permanent ? diff --git a/tex/context/base/mkxl/pack-ori.mkxl b/tex/context/base/mkxl/pack-ori.mkxl index 83ff08822..584e70c22 100644 --- a/tex/context/base/mkxl/pack-ori.mkxl +++ b/tex/context/base/mkxl/pack-ori.mkxl @@ -36,7 +36,7 @@ \c!vertical=\v!normal] \appendtoks - \expandafter\chardef\csname\??orientations\currentorientation\endcsname\toorientation + \expandafter\integerdef\csname\??orientations\currentorientation\endcsname\toorientation orientation {\orientationparameter\c!orientation} horizontal {\orientationparameter\c!horizontal} vertical {\orientationparameter\c!vertical} @@ -51,6 +51,7 @@ \defineorientation[\v!right] [\c!orientation=\v!right] \defineorientation[\v!top] [\c!orientation=\v!top] \defineorientation[\v!bottom][\c!orientation=\v!bottom] +\defineorientation[\v!line] [\c!orientation=\v!line] %D There will be some more helpers here. diff --git a/tex/context/base/mkxl/page-com.mkxl b/tex/context/base/mkxl/page-com.mkxl index 525a7fd3a..ae408f384 100644 --- a/tex/context/base/mkxl/page-com.mkxl +++ b/tex/context/base/mkxl/page-com.mkxl @@ -163,7 +163,7 @@ \hskip\dimexpr\paperwidth+\d_page_comments_distance+\d_page_comments_offset\relax \fi}} -\permanent\protected\setvalue{\e!start\v!pagecomment}% +\permanent\protected\defcsname\e!start\v!pagecomment\endcsname {\global\settrue\c_page_comment_enabled \grabbufferdatadirect\v!pagecomment{\e!start\v!pagecomment}{\e!stop\v!pagecomment}} diff --git a/tex/context/base/mkxl/page-lay.mkxl b/tex/context/base/mkxl/page-lay.mkxl index 9fc767800..d56becbc6 100644 --- a/tex/context/base/mkxl/page-lay.mkxl +++ b/tex/context/base/mkxl/page-lay.mkxl @@ -809,7 +809,7 @@ {\xdefcsname\??layoutcolumn\recurselevel\endcsname {\the\numexpr\recurselevel-\plusone\relax\dimexpr\layoutcolumnwidth+\layoutcolumndistance\relax}} -\letvalue{\??layoutcolumn0}\zeropoint +\aliased\letcsname\??layoutcolumn0\endcsname\zeropoint \permanent\def\layoutcolumnoffset#1% can travel around so we can't use \lastnamedcs {\csname\??layoutcolumn\ifcsname\??layoutcolumn#1\endcsname#1\else0\fi\endcsname} diff --git a/tex/context/base/mkxl/page-lin.mklx b/tex/context/base/mkxl/page-lin.mklx index d16d19942..71a0e0c6e 100644 --- a/tex/context/base/mkxl/page-lin.mklx +++ b/tex/context/base/mkxl/page-lin.mklx @@ -94,7 +94,7 @@ \glet\page_postprocessors_linenumbers_column \page_postprocessors_linenumbers_column_indeed} \def\page_lines_start_define - {\setxvalue{\??linenumberinginstance\currentlinenumbering}% + {\xdefcsname\??linenumberinginstance\currentlinenumbering\endcsname {\clf_registerlinenumbering % continue {\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi}% continue {\ifzero\c_page_lines_mode\v!yes\else\v!no\fi}% diff --git a/tex/context/base/mkxl/page-mak.mklx b/tex/context/base/mkxl/page-mak.mklx index 2a5cd4352..f0d01cc36 100644 --- a/tex/context/base/mkxl/page-mak.mklx +++ b/tex/context/base/mkxl/page-mak.mklx @@ -184,11 +184,11 @@ \normalexpanded{\setuplayout[\m_page_makeup_name][\s!parent=\??layout]}% is remembered but checked later anyway \fi} -\setvalue{\??makeupdoublesided\v!yes}% +\defcsname\??makeupdoublesided\v!yes\endcsname {\emptyhbox \page} -\setvalue{\??makeupdoublesided\v!empty}% +\defcsname\??makeupdoublesided\v!empty\endcsname {\the\t_page_makeup_every_setup % == \page[\v!dummy] \page[\v!blank]% diff --git a/tex/context/base/mkxl/page-txt.mklx b/tex/context/base/mkxl/page-txt.mklx index 7b044284f..76aa15cab 100644 --- a/tex/context/base/mkxl/page-txt.mklx +++ b/tex/context/base/mkxl/page-txt.mklx @@ -219,7 +219,7 @@ %D Left and right texts are swapped on odd and even pages, but only when double %D sided typesetting is enabled. -\setvalue{\??layouttextstrut\v!yes}{\setstrut\strut} % maybe more variants +\defcsname\??layouttextstrut\v!yes\endcsname{\setstrut\strut} % maybe more variants \lettonothing\m_page_layouts_element_content diff --git a/tex/context/base/mkxl/publ-ini.mkxl b/tex/context/base/mkxl/publ-ini.mkxl index e64104305..b75a933ad 100644 --- a/tex/context/base/mkxl/publ-ini.mkxl +++ b/tex/context/base/mkxl/publ-ini.mkxl @@ -363,7 +363,7 @@ \publ_command_yes{#1}} \permanent\protected\def\definebtxcommand#1% {body} #1..#n{body} - {\setuvalue{\??btxcommand\csstring#1}}% + {\protected\defcsname\??btxcommand\csstring#1\endcsname}% % access @@ -1757,9 +1757,9 @@ % \installcorenamespace{btxjournal} % -% \letvalue{\s!btxjournal\v!long }\btxexpandedjournal -% \letvalue{\s!btxjournal\v!short }\btxabbreviatedjournal -% \letvalue{\s!btxjournal\v!normal}\firstofoneargument +% \aliased\letcsname\s!btxjournal\v!long \endcsname\btxexpandedjournal +% \aliased\letcsname\s!btxjournal\v!short \endcsname\btxabbreviatedjournal +% \aliased\letcsname\s!btxjournal\v!normal\endcsname\firstofoneargument % % \protected\def\btxcheckedjournal % {\expandnamespaceparameter\s!btxjournal\btxrenderingparameter\c!journalconversion} diff --git a/tex/context/base/mkxl/scrn-but.mklx b/tex/context/base/mkxl/scrn-but.mklx index db3e3af1e..e22751618 100644 --- a/tex/context/base/mkxl/scrn-but.mklx +++ b/tex/context/base/mkxl/scrn-but.mklx @@ -475,14 +475,14 @@ \ht\b_scrn_menu\d_scrn_menu_asked_height \dp\b_scrn_menu\zeropoint} -\setvalue{\??menualign\v!right }{\let\scrn_menu_left_align\raggedright} -\setvalue{\??menualign\v!left }{\let\scrn_menu_left_align\raggedleft} -\setvalue{\??menualign\v!flushright}{\let\scrn_menu_left_align\raggedleft} -\setvalue{\??menualign\v!flushleft }{\let\scrn_menu_left_align\raggedright} -\setvalue{\??menualign\v!middle }{\let\scrn_menu_left_align\raggedcenter} -\setvalue{\??menualign\v!low }{\let\scrn_menu_top_align\vss\let\scrn_menu_bottom_align\relax} -\setvalue{\??menualign\v!high }{\let\scrn_menu_top_align\relax\let\scrn_menu_bottom_align\vss} -\setvalue{\??menualign\v!lohi }{\let\scrn_menu_top_align\vss\let\scrn_menu_bottom_align\vss} +\defcsname\??menualign\v!right \endcsname{\let\scrn_menu_left_align\raggedright} +\defcsname\??menualign\v!left \endcsname{\let\scrn_menu_left_align\raggedleft} +\defcsname\??menualign\v!flushright\endcsname{\let\scrn_menu_left_align\raggedleft} +\defcsname\??menualign\v!flushleft \endcsname{\let\scrn_menu_left_align\raggedright} +\defcsname\??menualign\v!middle \endcsname{\let\scrn_menu_left_align\raggedcenter} +\defcsname\??menualign\v!low \endcsname{\let\scrn_menu_top_align\vss\let\scrn_menu_bottom_align\relax} +\defcsname\??menualign\v!high \endcsname{\let\scrn_menu_top_align\relax\let\scrn_menu_bottom_align\vss} +\defcsname\??menualign\v!lohi \endcsname{\let\scrn_menu_top_align\vss\let\scrn_menu_bottom_align\vss} \let\scrn_menu_left_align \relax \let\scrn_menu_right_align \relax @@ -490,7 +490,7 @@ \let\scrn_menu_bottom_align\relax \def\scrn_menu_set_align - {\csname\??menualign\interactionmenuparameter\c!itemalign\endcsname} + {\begincsname\??menualign\interactionmenuparameter\c!itemalign\endcsname} %D Hook into the pagebuilder (as less testing as possible): @@ -523,13 +523,13 @@ \let\scrn_menu_packager\relax -\setvalue{\??menupacker\v!vertical}% all menus +\defcsname\??menupacker\v!vertical\endcsname % all menus {\let\scrn_menu_packager\scrn_menu_packager_vertical \setbox\b_scrn_menu\hbox{\scrn_menu_actions\currentinteractionmenulocation}% \scrn_menu_apply_final \box\b_scrn_menu} -\setvalue{\??menupacker\v!horizontal}% all menus +\defcsname\??menupacker\v!horizontal\endcsname % all menus {\let\scrn_menu_packager\scrn_menu_packager_horizontal \setbox\b_scrn_menu\vbox{\scrn_menu_actions\currentinteractionmenulocation}% \scrn_menu_apply_final @@ -682,13 +682,13 @@ \endgroup \ignorespaces} -\aliased\let\startraw \aliased\let\stopraw\relax \ifdefined\raw\else \aliased\let\raw\relax \fi -\aliased\let\startbut \aliased\let\stopbut\relax \ifdefined\but\else \aliased\let\but\relax \fi -\aliased\let\startgot \aliased\let\stopgot\relax \ifdefined\got\else \aliased\let\got\relax \fi -\aliased\let\startnop \aliased\let\stopnop\relax \ifdefined\nop\else \aliased\let\nop\relax \fi -\aliased\let\starttxt \aliased\let\stoptxt\relax \ifdefined\txt\else \aliased\let\txt\relax \fi -\aliased\let\startrul \aliased\let\stoprul\relax \ifdefined\rul\else \aliased\let\rul\relax \fi -\aliased\let\startcom \aliased\let\stopcom\relax \ifdefined\com\else \aliased\let\com\relax \fi +\aliased\let\startraw\relax \aliased\let\stopraw\relax \ifdefined\raw\else \aliased\let\raw\relax \fi +\aliased\let\startbut\relax \aliased\let\stopbut\relax \ifdefined\but\else \aliased\let\but\relax \fi +\aliased\let\startgot\relax \aliased\let\stopgot\relax \ifdefined\got\else \aliased\let\got\relax \fi +\aliased\let\startnop\relax \aliased\let\stopnop\relax \ifdefined\nop\else \aliased\let\nop\relax \fi +\aliased\let\starttxt\relax \aliased\let\stoptxt\relax \ifdefined\txt\else \aliased\let\txt\relax \fi +\aliased\let\startrul\relax \aliased\let\stoprul\relax \ifdefined\rul\else \aliased\let\rul\relax \fi +\aliased\let\startcom\relax \aliased\let\stopcom\relax \ifdefined\com\else \aliased\let\com\relax \fi \protected\def\scrn_menu_raw_start[#action]#text\stopraw {\scrn_menu_action_start @@ -763,13 +763,13 @@ {\ignorespaces#text\removeunwantedspaces \ignorespaces} -\permanent\protected\def\scrn_menu_raw#content\\{\scrn_menu_raw_start#content\stopraw} \aliased\let\stopraw\relax -\permanent\protected\def\scrn_menu_but#content\\{\scrn_menu_but_start#content\stopbut} \aliased\let\stopbut\relax -\permanent\protected\def\scrn_menu_got#content\\{\scrn_menu_got_start#content\stopgot} \aliased\let\stopgot\relax -\permanent\protected\def\scrn_menu_nop#content\\{\scrn_menu_nop_start#content\stopnop} \aliased\let\stopnop\relax -\permanent\protected\def\scrn_menu_txt#content\\{\scrn_menu_txt_start#content\stoptxt} \aliased\let\stoptxt\relax -\permanent\protected\def\scrn_menu_rul#content\\{\scrn_menu_rul_start#content\stoprul} \aliased\let\stoprul\relax -\permanent\protected\def\scrn_menu_com#content\\{\scrn_menu_com_start#content\stopcom} \aliased\let\stopcom\relax +\permanent\protected\def\scrn_menu_raw#content\\{\scrn_menu_raw_start#content\stopraw} +\permanent\protected\def\scrn_menu_but#content\\{\scrn_menu_but_start#content\stopbut} +\permanent\protected\def\scrn_menu_got#content\\{\scrn_menu_got_start#content\stopgot} +\permanent\protected\def\scrn_menu_nop#content\\{\scrn_menu_nop_start#content\stopnop} +\permanent\protected\def\scrn_menu_txt#content\\{\scrn_menu_txt_start#content\stoptxt} +\permanent\protected\def\scrn_menu_rul#content\\{\scrn_menu_rul_start#content\stoprul} +\permanent\protected\def\scrn_menu_com#content\\{\scrn_menu_com_start#content\stopcom} \newtoks\everysetmenucommands % public diff --git a/tex/context/base/mkxl/scrn-wid.mklx b/tex/context/base/mkxl/scrn-wid.mklx index d377d47ec..382635882 100644 --- a/tex/context/base/mkxl/scrn-wid.mklx +++ b/tex/context/base/mkxl/scrn-wid.mklx @@ -502,7 +502,7 @@ \dp\b_scrn_comment_link\currentcommentdepth \expandnamespaceparameter\??commentlocation\commentparameter\c!location\s!unknown} -\letvalue{\??commentmethods\v!hidden}\donothing +\aliased\letcsname\??commentmethods\v!hidden\endcsname\donothing \protected\def\scrn_comment_flush_traced {\hpack\bgroup diff --git a/tex/context/base/mkxl/spac-hor.mkxl b/tex/context/base/mkxl/spac-hor.mkxl index 75ac2e454..ba7633bec 100644 --- a/tex/context/base/mkxl/spac-hor.mkxl +++ b/tex/context/base/mkxl/spac-hor.mkxl @@ -97,7 +97,7 @@ \installcorenamespace {indentingpreset} \permanent\tolerant\protected\def\defineindenting[#1]#*[#2]% todo: mixes - {\ifarguments\else\setevalue{\??indentingpreset#1}{#2}\fi} + {\ifarguments\else\edefcsname\??indentingpreset#1\endcsname{#2}\fi} \def\spac_indentation_apply_step_one_nested {\expandafter\processcommacommand\expandafter[\lastnamedcs]\spac_indentation_apply_step_one} @@ -383,7 +383,7 @@ \permanent\protected\def\newfrenchspacing{\spac_spacecodes_set_fixed{1050}} \permanent\protected\def\nonfrenchspacing{\spac_spacecodes_set_stretch} -\permanent\protected\def\installspacingmethod#1#2{\setvalue{\??spacecodemethod#1}{#2}} +\permanent\protected\def\installspacingmethod#1#2{\defcsname\??spacecodemethod#1\endcsname{#2}} \installspacingmethod \empty {} % keep values \installspacingmethod \v!fixed {\frenchspacing } % equal spaces everywhere diff --git a/tex/context/base/mkxl/spac-ver.lmt b/tex/context/base/mkxl/spac-ver.lmt index c9faf3873..01690b7ae 100644 --- a/tex/context/base/mkxl/spac-ver.lmt +++ b/tex/context/base/mkxl/spac-ver.lmt @@ -2233,7 +2233,7 @@ do local flush = false stackhack = true -- todo: only when grid snapping once enabled - for n, id, subtype in nextnode, newhead do -- we could just look for glue nodes + for n, id, subtype in nextnode, newhead do if id ~= glue_code then flush = true elseif subtype == userskip_code then @@ -2359,7 +2359,9 @@ do enabled = v end) - local ignoredepth = -65536000 + local function ignoredepth() + return texgetdimen("ignoredepthcriterium") -- -65536000 + end -- A previous version analyzed the number of lines moved to the next page in -- synchronizepage because prevgraf is unreliable in that case. However, we cannot @@ -2423,16 +2425,17 @@ do local newdepth = outer.prevdepth local olddepth = newdepth if not texlists.pagehead then - newdepth = ignoredepth - texset("prevdepth",ignoredepth) - outer.prevdepth = ignoredepth + newdepth = ignoredepth() + texset("prevdepth",newdepth) + outer.prevdepth = newdepth end report("page %i, prevdepth %p => %p",texgetcount("realpageno"),olddepth,newdepth) -- report("list %s",nodes.idsandsubtypes(head)) else if not texlists.pagehead then - texset("prevdepth",ignoredepth) - outer.prevdepth = ignoredepth + local newdepth = ignoredepth() + texset("prevdepth",newdepth) + outer.prevdepth = newdepth end end end @@ -2893,3 +2896,14 @@ do } end + +do + + implement { + name = "injectzerobaselineskip", + protected = true, + public = true, + actions = { nodes.pool.baselineskip, context }, + } + +end diff --git a/tex/context/base/mkxl/spac-ver.mkxl b/tex/context/base/mkxl/spac-ver.mkxl index 99756a147..2b16e42ee 100644 --- a/tex/context/base/mkxl/spac-ver.mkxl +++ b/tex/context/base/mkxl/spac-ver.mkxl @@ -1195,14 +1195,14 @@ \pushoverloadmode \overloaded\permanent\protected\def\offinterlineskip % later we will overload this with a push pop - {\baselineskip-\thousandpoint + {\baselineskip \ignoredepthcriterium % -\thousandpoint \lineskip \zeropoint \lineskiplimit\maxdimen % We also need this here now; thanks to taco for figuring that out! \let\minimumlinedistance\zeropoint} \overloaded\permanent\protected\def\nointerlineskip - {\prevdepth-\thousandpoint} + {\prevdepth\ignoredepthcriterium}% -\thousandpoint \aliased\let\normaloffinterlineskip\offinterlineskip % knuth's original @@ -2143,10 +2143,10 @@ \defcsname\??vspace#1:#2\endcsname{#3}% \fi} -\letvalue{\??vspace:\s!unknown}\zeropoint +\letcsname\??vspace:\s!unknown\endcsname\zeropoint \def\spac_vspace_unknown - {\csname\??vspace:\s!unknown\endcsname} + {\csname\??vspace:\s!unknown\endcsname} % why not a let? \permanent\tolerant\protected\def\vspace[#1]#*[#2]% {\par diff --git a/tex/context/base/mkxl/strc-flt.mklx b/tex/context/base/mkxl/strc-flt.mklx index 68d97593b..40c627b2c 100644 --- a/tex/context/base/mkxl/strc-flt.mklx +++ b/tex/context/base/mkxl/strc-flt.mklx @@ -2180,7 +2180,7 @@ \def\strc_floats_relocate_caption_right#1{\strc_floats_align_caption{\hbox to \d_strc_float_temp_width{\hss#1}}} \def\strc_floats_relocate_caption_left #1{\strc_floats_align_caption{\hbox to \d_strc_float_temp_width{#1\hss}}} -\permanent\protected\def\installfloatboxbuilder#1#2{\setvalue{\??floatbuilder#1}{#2}} +\permanent\protected\def\installfloatboxbuilder#1#2{\defcsname\??floatbuilder#1\endcsname{#2}} \def\strc_floats_build_box {\strc_floats_build_box_before @@ -2415,13 +2415,13 @@ % \expandnamespacemacro\??floatpreparesidecaption\p_strc_floats_caption_width\s!unknown % \dostoptagged} % -% \setvalue{\??floatpreparesidecaption\v!max}% +% \defcsname\??floatpreparesidecaption\v!max\endcsname % {\setbox\b_strc_floats_caption\vbox % {\strc_floats_caption_set_align % \hsize\wd\b_strc_floats_content % \strc_floats_make_complete_caption}} % -% \setvalue{\??floatpreparesidecaption\v!fit}% +% \defcsname\??floatpreparesidecaption\v!fit\endcsname % {\ifdim\wd\b_strc_floats_caption>\wd\b_strc_floats_content\relax % \setbox\b_strc_floats_caption\vbox % {\forgetall % needed? @@ -2432,7 +2432,7 @@ % {\hss\hbox{\strc_floats_make_complete_caption}\hss}% % \fi} % -% \setvalue{\??floatpreparesidecaption\s!unknown}% +% \defcsname\??floatpreparesidecaption\s!unknown\endcsname % {\setbox\b_strc_floats_caption\vbox % {\strc_floats_caption_set_align % \hsize\p_strc_floats_caption_width % \wd\b_strc_floats_content @@ -2554,7 +2554,7 @@ % {\ifcsname\??floatsettings#1:#2\endcsname \else % \expandafter\newtoks\csname\??floatsettings#1:#2\endcsname % \fi -% \setvalue{\??floatmethods#1:#2}{#3}} +% \defcsname\??floatmethods#1:#2\endcsname{#3}} % % \protected\def\startfloatmethodsettings#1#2 #3\stopfloatmethodsettings % {\csname\??floatsettings#1:#2\endcsname\expandafter{\the\csname\??floatsettings#1:#2\endcsname#3}} diff --git a/tex/context/base/mkxl/strc-itm.mklx b/tex/context/base/mkxl/strc-itm.mklx index 7c3f0af8a..a3a4c0040 100644 --- a/tex/context/base/mkxl/strc-itm.mklx +++ b/tex/context/base/mkxl/strc-itm.mklx @@ -369,21 +369,28 @@ \fi \fi} -\def\strc_itemgroups_insert_breakallow {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakallow_indeed} -\def\strc_itemgroups_insert_breakno {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakno_indeed } -\def\strc_itemgroups_insert_break {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_break_indeed } -\def\strc_itemgroups_insert_nobreak {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_nobreak_indeed } - -\def\strc_itemgroups_insert_breakallow_indeed{\vspacing[\v!item @0]} -\def\strc_itemgroups_insert_breakno_indeed {\vspacing[\v!item @10000]} -\def\strc_itemgroups_insert_break_indeed {\flushnotes - \vspacing[\v!item @-5]} -\def\strc_itemgroups_insert_nobreak_indeed {\flushnotes - \ifinsidecolumns % todo - \vspacing[\v!item @5]% - \else - \vspacing[\v!item @500]% - \fi} +\def\strc_itemgroups_insert_breakallow{\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakallow_indeed} +\def\strc_itemgroups_insert_breakno {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakno_indeed } +\def\strc_itemgroups_insert_break {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_break_indeed } +\def\strc_itemgroups_insert_nobreak {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_nobreak_indeed } + +\def\strc_itemgroups_insert_breakallow_indeed + {\vspacing[\v!item @0]} + +\def\strc_itemgroups_insert_breakno_indeed + {\vspacing[\v!item @10000]} + +\def\strc_itemgroups_insert_break_indeed + {\flushnotes + \vspacing[\v!item @-5]} + +\def\strc_itemgroups_insert_nobreak_indeed + {\flushnotes + \ifinsidecolumns % todo + \vspacing[\v!item @5]% + \else + \vspacing[\v!item @500]% + \fi} \protected\def\strc_itemgroups_process_options#options% {\processcommacommand[#options]\strc_itemgroups_process_option} % expansion of options is handy for xml @@ -421,65 +428,123 @@ \setfalse\c_strc_itemgroups_pack \fi} -\setvalue{\??itemgroupkeyword\!!zerocount }{} % ignore 0 -\setvalue{\??itemgroupkeyword\v!packed }{\strc_itemgroups_process_set_option_pack} -\setvalue{\??itemgroupkeyword\v!unpacked }{\strc_itemgroups_process_set_option_unpack} -\setvalue{\??itemgroupkeyword\v!intro }{\settrue\c_strc_itemgroups_intro} % here? not set to false -\setvalue{\??itemgroupkeyword\v!autointro }{\settrue\c_strc_itemgroups_auto_intro} -\setvalue{\??itemgroupkeyword\v!broad }{\ifempty\itemgroupfirst - \let\itemgroupfirst\!!plusone - \fi - \letitemgroupparameter\c!factor\itemgroupfirst} -\setvalue{\??itemgroupkeyword\v!text }{\settrue\c_strc_itemgroups_text - \settrue\c_strc_itemgroups_inline - \settrue\c_strc_itemgroups_joined - \strc_itemgroups_process_set_option_pack} -\setvalue{\??itemgroupkeyword\v!before }{\settrue\c_strc_itemgroups_before} -\setvalue{\??itemgroupkeyword\v!after }{\settrue\c_strc_itemgroups_after} -\setvalue{\??itemgroupkeyword\v!nowhite }{\settrue\c_strc_itemgroups_nowhite} -\setvalue{\??itemgroupkeyword\v!margin }{\setitemgroupparameter\c!width{-2em}} % signal -\setvalue{\??itemgroupkeyword\v!inmargin }{\setitemgroupparameter\c!width{-2em}} % signal -\setvalue{\??itemgroupkeyword\v!atmargin }{\ifnum\c_strc_itemgroups_nesting>\plusone - \setitemgroupparameter\c!width{0em}% - \fi} % signal -\setvalue{\??itemgroupkeyword\v!intext }{\settrue\c_strc_itemgroups_inline} -\setvalue{\??itemgroupkeyword\v!headintext }{\settrue\c_strc_itemgroups_inline_head} -\setvalue{\??itemgroupkeyword\v!loose }{\setfalse\c_strc_itemgroups_optimize} -\setvalue{\??itemgroupkeyword\v!fit }{\settrue\c_strc_itemgroups_fitting} -\setvalue{\??itemgroupkeyword\v!nofit }{\setfalse\c_strc_itemgroups_fitting} -\setvalue{\??itemgroupkeyword\v!paragraph }{\settrue\c_strc_itemgroups_paragraph - \strc_itemgroups_process_set_option_pack} -\setvalue{\??itemgroupkeyword\v!joinedup }{\settrue\c_strc_itemgroups_joined - \strc_itemgroups_process_set_option_pack} -\setvalue{\??itemgroupkeyword\v!notjoinedup}{\setfalse\c_strc_itemgroups_joined} -\setvalue{\??itemgroupkeyword\v!serried }{\edef\itemgroupfirst{-\ifempty\itemgroupfirst1\else\itemgroupfirst\fi}% - \letitemgroupparameter\c!factor\itemgroupfirst} -\setvalue{\??itemgroupkeyword\v!stopper }{\letitemgroupparameter\c!placestopper\v!yes} % keep {} -\setvalue{\??itemgroupkeyword\v!nostopper }{\letitemgroupparameter\c!placestopper\v!no} % keep {} -\setvalue{\??itemgroupkeyword\v!repeat }{\settrue\c_strc_itemgroups_repeat} -\setvalue{\??itemgroupkeyword\v!norepeat }{\setfalse\c_strc_itemgroups_repeat} -\setvalue{\??itemgroupkeyword\v!reverse }{\settrue\c_strc_itemgroups_reverse} -\setvalue{\??itemgroupkeyword\v!columns }{\settrue\c_strc_itemgroups_columns} -\setvalue{\??itemgroupkeyword\v!one }{\letitemgroupparameter\c!n\plusone} -\setvalue{\??itemgroupkeyword\v!two }{\letitemgroupparameter\c!n\plustwo} -\setvalue{\??itemgroupkeyword\v!three }{\letitemgroupparameter\c!n\plusthree} -\setvalue{\??itemgroupkeyword\v!four }{\letitemgroupparameter\c!n\plusfour} -\setvalue{\??itemgroupkeyword\v!five }{\letitemgroupparameter\c!n\plusfive} -\setvalue{\??itemgroupkeyword\v!six }{\letitemgroupparameter\c!n\plussix} -\setvalue{\??itemgroupkeyword\v!seven }{\letitemgroupparameter\c!n\plusseven} -\setvalue{\??itemgroupkeyword\v!eight }{\letitemgroupparameter\c!n\pluseight} -\setvalue{\??itemgroupkeyword\v!nine }{\letitemgroupparameter\c!n\plusnine} -\setvalue{\??itemgroupkeyword\v!standard }{\setitemgroupparameter\c!width {1.5\emwidth}% - \setitemgroupparameter\c!distance {.5\emwidth}% - %\letitemgroupparameter\c!factor \!!zerocount - \letitemgroupparameter\c!factor {\zerocount}% - \setitemgroupparameter\c!packcriterium{\zerocount}% - \resetitemgroupparameter\c!inner - \resetitemgroupparameter\c!beforehead - \letitemgroupparameter\c!afterhead \blank - \letitemgroupparameter\c!before \blank - \letitemgroupparameter\c!inbetween \blank - \letitemgroupparameter\c!after \blank} +\defcsname\??itemgroupkeyword\!!zerocount\endcsname + {} % ignore 0 + +\defcsname\??itemgroupkeyword\v!packed\endcsname + {\strc_itemgroups_process_set_option_pack} + +\defcsname\??itemgroupkeyword\v!unpacked\endcsname + {\strc_itemgroups_process_set_option_unpack} + +\defcsname\??itemgroupkeyword\v!intro\endcsname + {\settrue\c_strc_itemgroups_intro} % here? not set to false + +\defcsname\??itemgroupkeyword\v!autointro\endcsname + {\settrue\c_strc_itemgroups_auto_intro} + +\defcsname\??itemgroupkeyword\v!broad\endcsname + {\ifempty\itemgroupfirst + \let\itemgroupfirst\!!plusone + \fi + \letitemgroupparameter\c!factor\itemgroupfirst} + +\defcsname\??itemgroupkeyword\v!text\endcsname + {\settrue\c_strc_itemgroups_text + \settrue\c_strc_itemgroups_inline + \settrue\c_strc_itemgroups_joined + \strc_itemgroups_process_set_option_pack} + +\defcsname\??itemgroupkeyword\v!before\endcsname + {\settrue\c_strc_itemgroups_before} + +\defcsname\??itemgroupkeyword\v!after\endcsname + {\settrue\c_strc_itemgroups_after} + +\defcsname\??itemgroupkeyword\v!nowhite\endcsname + {\settrue\c_strc_itemgroups_nowhite} + +\defcsname\??itemgroupkeyword\v!margin\endcsname % signal + {\setitemgroupparameter\c!width{-2em}} + +\defcsname\??itemgroupkeyword\v!inmargin\endcsname % signal + {\setitemgroupparameter\c!width{-2em}} + +\defcsname\??itemgroupkeyword\v!atmargin\endcsname% signal + {\ifnum\c_strc_itemgroups_nesting>\plusone + \setitemgroupparameter\c!width{0em}% + \fi} + +\defcsname\??itemgroupkeyword\v!intext\endcsname + {\settrue\c_strc_itemgroups_inline} + +\defcsname\??itemgroupkeyword\v!headintext\endcsname + {\settrue\c_strc_itemgroups_inline_head} + +\defcsname\??itemgroupkeyword\v!loose\endcsname + {\setfalse\c_strc_itemgroups_optimize} + +\defcsname\??itemgroupkeyword\v!fit\endcsname + {\settrue\c_strc_itemgroups_fitting} + +\defcsname\??itemgroupkeyword\v!nofit\endcsname + {\setfalse\c_strc_itemgroups_fitting} + +\defcsname\??itemgroupkeyword\v!paragraph\endcsname + {\settrue\c_strc_itemgroups_paragraph + \strc_itemgroups_process_set_option_pack} + +\defcsname\??itemgroupkeyword\v!joinedup\endcsname + {\settrue\c_strc_itemgroups_joined + \strc_itemgroups_process_set_option_pack} + +\defcsname\??itemgroupkeyword\v!notjoinedup\endcsname + {\setfalse\c_strc_itemgroups_joined} + +\defcsname\??itemgroupkeyword\v!serried\endcsname + {\edef\itemgroupfirst{-\ifempty\itemgroupfirst1\else\itemgroupfirst\fi}% + \letitemgroupparameter\c!factor\itemgroupfirst} + +\defcsname\??itemgroupkeyword\v!stopper\endcsname + {\letitemgroupparameter\c!placestopper\v!yes} % keep {} + +\defcsname\??itemgroupkeyword\v!nostopper\endcsname + {\letitemgroupparameter\c!placestopper\v!no} % keep {} + +\defcsname\??itemgroupkeyword\v!repeat\endcsname + {\settrue\c_strc_itemgroups_repeat} + +\defcsname\??itemgroupkeyword\v!norepeat\endcsname + {\setfalse\c_strc_itemgroups_repeat} + +\defcsname\??itemgroupkeyword\v!reverse\endcsname + {\settrue\c_strc_itemgroups_reverse} + +\defcsname\??itemgroupkeyword\v!columns\endcsname + {\settrue\c_strc_itemgroups_columns} + +\defcsname\??itemgroupkeyword\v!one \endcsname{\letitemgroupparameter\c!n\plusone} +\defcsname\??itemgroupkeyword\v!two \endcsname{\letitemgroupparameter\c!n\plustwo} +\defcsname\??itemgroupkeyword\v!three\endcsname{\letitemgroupparameter\c!n\plusthree} +\defcsname\??itemgroupkeyword\v!four \endcsname{\letitemgroupparameter\c!n\plusfour} +\defcsname\??itemgroupkeyword\v!five \endcsname{\letitemgroupparameter\c!n\plusfive} +\defcsname\??itemgroupkeyword\v!six \endcsname{\letitemgroupparameter\c!n\plussix} +\defcsname\??itemgroupkeyword\v!seven\endcsname{\letitemgroupparameter\c!n\plusseven} +\defcsname\??itemgroupkeyword\v!eight\endcsname{\letitemgroupparameter\c!n\pluseight} +\defcsname\??itemgroupkeyword\v!nine \endcsname{\letitemgroupparameter\c!n\plusnine} + +\defcsname\??itemgroupkeyword\v!standard\endcsname + {\setitemgroupparameter \c!width {1.5\emwidth}% + \setitemgroupparameter \c!distance {.5\emwidth}% + %\letitemgroupparameter \c!factor \!!zerocount + \letitemgroupparameter \c!factor {\zerocount}% + \setitemgroupparameter \c!packcriterium{\zerocount}% + \resetitemgroupparameter\c!inner + \resetitemgroupparameter\c!beforehead + \letitemgroupparameter \c!afterhead \blank + \letitemgroupparameter \c!before \blank + \letitemgroupparameter \c!inbetween \blank + \letitemgroupparameter \c!after \blank} \def\strc_itemgroups_initialize_local {\setfalse\c_strc_itemgroups_inline @@ -689,9 +754,18 @@ \installcorenamespace{itemstopper} -\setvalue{\??itemstopper\v!yes }{\itemgroupparameter\c!stopper} -\setvalue{\??itemstopper\v!display}{\ifconditional\c_strc_itemgroups_inline\else\itemgroupparameter\c!stopper\fi} -\setvalue{\??itemstopper\v!inline }{\ifconditional\c_strc_itemgroups_inline\itemgroupparameter\c!stopper\fi} +\defcsname\??itemstopper\v!yes\endcsname + {\itemgroupparameter\c!stopper} + +\defcsname\??itemstopper\v!display\endcsname + {\ifconditional\c_strc_itemgroups_inline\else + \itemgroupparameter\c!stopper + \fi} + +\defcsname\??itemstopper\v!inline\endcsname + {\ifconditional\c_strc_itemgroups_inline + \itemgroupparameter\c!stopper + \fi} \def\strc_itemgroups_insert_item_counter_indeed % quite slow ... every time this setup .. but it {\begingroup % can be optimized ... best move some to strc-num @@ -1573,13 +1647,13 @@ \strc_itemgroups_check_for_repeated \ignorepars} % \ignorespaces -\setvalue{\??itemgroupdistance\v!none}% +\defcsname\??itemgroupdistance\v!none\endcsname {\let\m_strc_itemgroups_text_distance\zeropoint} -\setvalue{\??itemgroupdistance\v!space}% +\defcsname\??itemgroupdistance\v!space\endcsname {\def\m_strc_itemgroups_text_distance{\interwordspace\s!plus\interwordstretch\s!minus\interwordshrink}} -\setvalue\??itemgroupdistance % catches empty value +\defcsname\??itemgroupdistance\endcsname % catches empty value {\let\m_strc_itemgroups_text_distance\zeropoint} \protected\def\strc_itemgroups_set_text_item_distance @@ -1724,7 +1798,8 @@ \normalexpanded{\def\strc_itemgroups_collected_store#1\csname\e!stop\v!item\endcsname}% {\advanceby\c_strc_itemgroups_collected_stored\plusone - \setvalue{\??itemgroupstack\number\c_strc_itemgroups_collected_stored}{\startitemgroupitem#1\stopitemgroupitem}} + \defcsname\??itemgroupstack\number\c_strc_itemgroups_collected_stored\endcsname + {\startitemgroupitem#1\stopitemgroupitem}} \def\strc_itemgroups_collected_flush_randomize {\m_strc_itemgroups_collected} diff --git a/tex/context/base/mkxl/strc-lab.mkxl b/tex/context/base/mkxl/strc-lab.mkxl index 98bd390f9..327810a51 100644 --- a/tex/context/base/mkxl/strc-lab.mkxl +++ b/tex/context/base/mkxl/strc-lab.mkxl @@ -111,7 +111,7 @@ \newconditional\c_strc_constructions_number_keep -\setvalue{\??constructioninitializer\v!label}% +\defcsname\??constructioninitializer\v!label\endcsname {\let \currentlabel \currentconstruction \enforced\let\constructionparameter \labelparameter \enforced\let\constructionnamespace \??label @@ -139,7 +139,7 @@ \setfalse\c_strc_constructions_title_state \fi} -\setvalue{\??constructionfinalizer\v!label}% +\defcsname\??constructionfinalizer\v!label\endcsname {\ifconditional\c_strc_constructions_number_state \iftrialtypesetting \strc_counters_restore\currentconstructionnumber @@ -173,12 +173,12 @@ \letcsname\??constructionmainhandler\v!label\expandafter\endcsname\csname\??constructionmainhandler\v!description\endcsname -\protected\setevalue{\??constructioncommandhandler\v!label}% +\protected\edefcsname\??constructioncommandhandler\v!label\endcsname {\csname\??constructionstarthandler\v!construction\endcsname \csname\??constructionstophandler \v!construction\endcsname \endgroup} -\protected\setvalue{\??constructiontexthandler\v!label}% +\protected\defcsname\??constructiontexthandler\v!label\endcsname {\begingroup \useconstructionstyleandcolor\c!headstyle\c!headcolor \strc_labels_text diff --git a/tex/context/base/mkxl/strc-lst.mklx b/tex/context/base/mkxl/strc-lst.mklx index 652a40c89..66fd5dfb0 100644 --- a/tex/context/base/mkxl/strc-lst.mklx +++ b/tex/context/base/mkxl/strc-lst.mklx @@ -159,7 +159,7 @@ userdata {\detokenize\expandafter{\normalexpanded{#userdata}}} \relax \edef\currentlistnumber{\the\scratchcounter}% - \setxvalue{\??listlocations\currentlist}{\the\locationcount}% + \xdefcsname\??listlocations\currentlist\endcsname{\the\locationcount}% \ifx\p_location\v!here % this branch injects nodes ! \strc_lists_inject_enhance{\currentlistnumber}% @@ -684,7 +684,7 @@ % \installcorenamespace{listfiller} % % \protected\def\installlistfiller#1#2% -% {\setuvalue{\??listfiller#1}{#2}} +% {\protected\defcsname\??listfiller#1\endcsname{#2}} % % \protected\def\listfiller#1% % {\begincsname\??listfiller#1\endcsname} diff --git a/tex/context/base/mkxl/strc-not.mklx b/tex/context/base/mkxl/strc-not.mklx index 3bddc7126..29440f582 100644 --- a/tex/context/base/mkxl/strc-not.mklx +++ b/tex/context/base/mkxl/strc-not.mklx @@ -2004,7 +2004,7 @@ % % \protected\def\setnotesymbol[#1]#2#3% % {\prewordbreak % prevent lookback -% \setgvalue{\??notesymbol#1}{#3} +% \gdefcsname\??notesymbol#1\endcsname{#3} % \strc_notes_inject_symbol} % % \protected\def\ownnote[#1]#2#3#4% diff --git a/tex/context/base/mkxl/strc-pag.mkxl b/tex/context/base/mkxl/strc-pag.mkxl index ffdd7772b..2da565067 100644 --- a/tex/context/base/mkxl/strc-pag.mkxl +++ b/tex/context/base/mkxl/strc-pag.mkxl @@ -292,14 +292,14 @@ \permanent\protected\def\decrementpagenumber{\csname\??pagenumberdec\namedcounterparameter\s!userpage\c!state\endcsname} \permanent\protected\def\incrementpagenumber{\csname\??pagenumberinc\namedcounterparameter\s!userpage\c!state\endcsname} -\letvalue{\??pagenumberdec\v!start}\strc_pagenumbers_decrement_userpage -\letvalue{\??pagenumberdec\v!none }\strc_pagenumbers_decrement_userpage -\letvalue{\??pagenumberdec\v!empty}\strc_pagenumbers_decrement_userpage - -\letvalue{\??pagenumberinc\v!start}\strc_pagenumbers_increment_userpage -\letvalue{\??pagenumberinc\v!none }\strc_pagenumbers_increment_userpage -\setvalue{\??pagenumberinc\v!empty}{\strc_pagenumbers_increment_userpage\strc_pagenumbers_synchronize_userpage} -\letvalue{\??pagenumberinc\v!keep }\strc_pagenumbers_synchronize_userpage +\letcsname\??pagenumberdec\v!start\endcsname\strc_pagenumbers_decrement_userpage +\letcsname\??pagenumberdec\v!none \endcsname\strc_pagenumbers_decrement_userpage +\letcsname\??pagenumberdec\v!empty\endcsname\strc_pagenumbers_decrement_userpage + +\letcsname\??pagenumberinc\v!start\endcsname\strc_pagenumbers_increment_userpage +\letcsname\??pagenumberinc\v!none \endcsname\strc_pagenumbers_increment_userpage +\defcsname\??pagenumberinc\v!empty\endcsname{\strc_pagenumbers_increment_userpage\strc_pagenumbers_synchronize_userpage} +\letcsname\??pagenumberinc\v!keep \endcsname\strc_pagenumbers_synchronize_userpage % Setup general page numbering diff --git a/tex/context/base/mkxl/strc-sbe.mkxl b/tex/context/base/mkxl/strc-sbe.mkxl index 5ece81a43..ade59da0b 100644 --- a/tex/context/base/mkxl/strc-sbe.mkxl +++ b/tex/context/base/mkxl/strc-sbe.mkxl @@ -128,7 +128,7 @@ \protected\def\strc_sectionblock_get_environment#1% {\csname\??sectionblockenvironment#1\endcsname} -\permanent\tolerant\protected\setvalue{\e!start\v!sectionblockenvironment}[#1]% evt \pushendofline \popendofline +\permanent\tolerant\protected\defcsname\e!start\v!sectionblockenvironment\endcsname[#1]% evt \pushendofline \popendofline {\grabuntil{\e!stop\v!sectionblockenvironment}{\strc_sectionblock_set_environment{#1}}} \permanent\protected\expandafter\lettonothing\csname\e!stop\v!sectionblockenvironment\endcsname diff --git a/tex/context/base/mkxl/strc-sec.mkxl b/tex/context/base/mkxl/strc-sec.mkxl index 3ea3a990b..002945208 100644 --- a/tex/context/base/mkxl/strc-sec.mkxl +++ b/tex/context/base/mkxl/strc-sec.mkxl @@ -1048,7 +1048,7 @@ {\xdefcsname\??hiddenheadattr\currenthead\endcsname {\headreferenceattributes}% can be used when making a box \xdefcsname\??hiddenheadsync\currenthead\endcsname - {\noexpand\letgvalue{\??hiddenheadsync\currenthead}\relax + {\noexpand\gletcsname\??hiddenheadsync\currenthead\endcsname\relax % {\noexpand\gletcsname\??hiddenheadsync\currenthead\endcsname\relax \hpack\headreferenceattributes\bgroup \noexpand\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}% otherwise no destination ... maybe tag ref as hidden and fall back on page reference @@ -1068,7 +1068,7 @@ {\xdefcsname\??hiddenheadattr\currenthead\endcsname {\headreferenceattributes}% can be used when making a box \xdefcsname\??hiddenheadsync\currenthead\endcsname - {\noexpand\letgvalue{\??hiddenheadsync\currenthead}\relax + {\noexpand\gletcsname\??hiddenheadsync\currenthead\endcsname\relax \noexpand\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}% \hpack\headreferenceattributes{}% otherwise no destination ... maybe tag ref as hidden and fall back on page reference \theheadsynchronization}} % and it's a node anyway diff --git a/tex/context/base/mkxl/supp-box.mkxl b/tex/context/base/mkxl/supp-box.mkxl index 8a2a90a1a..bbbc7591e 100644 --- a/tex/context/base/mkxl/supp-box.mkxl +++ b/tex/context/base/mkxl/supp-box.mkxl @@ -946,7 +946,7 @@ % \par before the next \vskip gives far worse results \ifdim\parskip>\zeropoint\vskip\parskip\else\par\fi % and take a look - \ifdim\prevdepth=-\thousandpoint + \ifdim\prevdepth=-\thousandpoint % or <= \prevdepth\zeropoint \fi \ifdim\prevdepth<\zeropoint\relax diff --git a/tex/context/base/mkxl/syst-aux.mkxl b/tex/context/base/mkxl/syst-aux.mkxl index f968cba97..cf39c1cf8 100644 --- a/tex/context/base/mkxl/syst-aux.mkxl +++ b/tex/context/base/mkxl/syst-aux.mkxl @@ -584,6 +584,15 @@ \expandafter\secondoftwoarguments \fi} +% or (test this): +% +% \permanent\protected\def\processallactionsinset[#1]% +% {\ifcstok{#1}\emptytoks +% \expandafter\processaction +% \else +% \expandafter\syst_helpers_process_all_actions_in_set_indeed +% \fi[#1]} + \aliased\let\doifemptyelse\doifelseempty \permanent\protected\def\doifempty#1% diff --git a/tex/context/base/mkxl/tabl-tbl.mkxl b/tex/context/base/mkxl/tabl-tbl.mkxl index 960138a14..253d3c411 100644 --- a/tex/context/base/mkxl/tabl-tbl.mkxl +++ b/tex/context/base/mkxl/tabl-tbl.mkxl @@ -193,6 +193,7 @@ \newconditional \c_tabl_tabulate_pwidth_set \newconditional \c_tabl_tabulate_reshape \newconditional \c_tabl_tabulate_no_blank_in_paragraphs % can become always on +\newconditional \c_tabl_tabulate_no_interline_space \settrue \c_tabl_tabulate_split \settrue \c_tabl_tabulate_handlepbreak @@ -516,7 +517,9 @@ \bgroup \tabl_tabulate_hook_G \tabl_tabulate_entry_before - \aligncontent % \alignmark\alignmark +\tabl_tabulate_hook_box_begin % might move + \aligncontent +\tabl_tabulate_hook_box_end % might move \tabl_tabulate_entry_after \egroup \noexpand\ifnum\noexpand\c_tabl_tabulate_type=\plusone\noexpand\else @@ -525,6 +528,7 @@ \noexpand\fi \ifconditional\c_tabl_tabulate_reshape \tabl_tabulate_shaped_par_end + \else \fi \noexpand#2% \tabl_tabulate_hook_e @@ -735,41 +739,82 @@ % \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR} % \stoptabulate +% \starttabulate[|w(top,3cm)|w(top,3cm)|] +% \NC test \NC test \par test \NC \NR +% \NC test \NC test \par test \NC \NR +% \stoptabulate +% +% \starttabulate[|w(top,packed,3cm)|w(top,packed,3cm)|] +% \NC test \NC test \par test \NC \NR +% \NC test \NC test \par test \NC \NR +% \stoptabulate +% +% \starttabulate[interlinespace=no,format={|w(bottom,3cm)|w(bottom,3cm)|}] +% \NC test \NC test \par test \NC \NR +% \NC test \NC test \par test \NC \NR +% \stoptabulate +% +% \starttabulate[format={|w(3cm)|w(3cm)|}] +% \NC \vtop{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR +% \NC \vtop{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR +% \stoptabulate +% +% \starttabulate[interlinespace=no,format={|w(3cm)|w(3cm)|}] +% \NC \vtop{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR +% \NC \vtop{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR +% \stoptabulate +% +% \starttabulate[interlinespace=no,format={|w(3cm)|w(3cm)|}] +% \NC \vbox{\strut test} \NC \vbox{\strut test\par \strut test} \NC \NR +% \NC \vbox{\strut test} \NC \vbox{\strut test\par \strut test} \NC \NR +% \stoptabulate +% +% \starttabulate[interlinespace=no,format={|w(3cm)|w(3cm)|}] +% \NC \vtop{\strut test} \NC \vbox{\strut test\par \strut test} \NC \NR +% \NC \vbox{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR +% \stoptabulate + +\installcorenamespace{tabulatewidth} + +\defcsname\??tabulatewidth\v!fit\endcsname + {\c_tabl_tabulate_modus\plusthree} + +\defcsname\??tabulatewidth\v!fixed\endcsname + {\c_tabl_tabulate_modus\plusthree + \settrue\c_tabl_tabulate_nopbreak} + +\defcsname\??tabulatewidth\v!packed\endcsname + {\settrue\c_tabl_tabulate_no_interline_space} + +\defcsname\??tabulatewidth\v!auto\endcsname + {\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_reshape} + +\lettonothing\tabl_tabulate_hook_box_begin +\lettonothing\tabl_tabulate_hook_box_end + +\defcsname\??tabulatewidth\v!top\endcsname + {\def\tabl_tabulate_hook_box_begin{\vtop\bgroup\begstrut}% + \def\tabl_tabulate_hook_box_end {\endstrut\egroup}} + +\defcsname\??tabulatewidth\v!bottom\endcsname + {\def\tabl_tabulate_hook_box_begin{\vbox\bgroup\begstrut}% + \def\tabl_tabulate_hook_box_end {\endstrut\egroup}} + +\def\tabl_tabulate_set_width_step#1% + {\ifcsname\??tabulatewidth#1\endcsname + \lastnamedcs + \else + \d_tabl_tabulate_width#1\relax + \fi} + \def\tabl_tabulate_set_width_indeed(#1)% - {\processallactionsinset % can be made faster - [#1]% - [ \v!fit=>\c_tabl_tabulate_modus\plusthree, - \v!fixed=>\c_tabl_tabulate_modus\plusthree - \settrue\c_tabl_tabulate_nopbreak, - \v!auto=>\c_tabl_tabulate_modus\plusthree - \settrue\c_tabl_tabulate_reshape, - \s!unknown=>\d_tabl_tabulate_width#1\relax]% + {\rawprocesscommacommand[#1]\tabl_tabulate_set_width_step \ifconditional\c_tabl_tabulate_pwidth_set \global\advanceby\d_tabl_tabulate_width_p\d_tabl_tabulate_width % accumulated parwidth \fi \tabl_tabulate_set_preamble} -% faster but seldom used -% -% \installcorenamespace{tabulatewidth} -% -% \defcsname\??tabulatewidth\v!fit \endcsname{\c_tabl_tabulate_modus\plusthree} -% \defcsname\??tabulatewidth\v!fixed\endcsname{\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_nopbreak} -% \defcsname\??tabulatewidth\v!auto \endcsname{\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_reshape} -% -% \def\tabl_tabulate_set_width_step#1% -% {\ifcsname\??tabulatewidth#1\endcsname -% \lastnamedcs -% \else -% \d_tabl_tabulate_width#1\relax -% \fi} -% -% \def\tabl_tabulate_set_width_indeed(#1)% -% {\rawprocesscommacommand[#1]\tabl_tabulate_set_width_step -% \ifconditional\c_tabl_tabulate_pwidth_set -% \global\advanceby\d_tabl_tabulate_width_p\d_tabl_tabulate_width % accumulated parwidth -% \fi -% \tabl_tabulate_set_preamble} +% done \def\tabl_tabulate_set_raggedright {\ifnum\c_tabl_tabulate_type=\plusone \else\raggedright \fi} \def\tabl_tabulate_set_raggedcenter{\ifnum\c_tabl_tabulate_type=\plusone \else\raggedcenter\fi} @@ -845,11 +890,12 @@ \glettonothing\m_tabl_tabulate_color \glettonothing\m_tabl_tabulate_text_color \glettonothing\m_tabl_tabulate_vrule_color + \glettonothing\tabl_tabulate_hook_box \global\c_tabl_tabulate_colorspan\zerocount \global\setfalse\c_tabl_auto_align_mode \global\setfalse\c_tabl_auto_align_mode_new \resetalignmentcharacter -% \attribute\aligncharacterattribute\attributeunsetvalue + % \attribute\aligncharacterattribute\attributeunsetvalue \global\advanceby\c_tabl_tabulate_columns\plusone \letcsname\??tabulatesetup\the\c_tabl_tabulate_columns\endcsname\donothing % here ? \iftok{#1}\emptytoks @@ -1326,16 +1372,18 @@ {\tabulationparameter\c!after} \def\tabl_tabulate_outside_inbetween_indeed - {\doifempty{\tabulationparameter\c!after} - {\vskip\strutdp - \verticalstrut - \vskip-\struttotal}} + {\ifcstok{\tabulationparameter\c!after}\emptytoks\else + \vskip\strutdp + \verticalstrut + \vskip-\struttotal + \fi} \def\tabl_tabulate_inside_inbetween % needs checking - {\doifempty{\tabulationparameter\c!after} - {\vskip\strutdp - \verticalstrut - \vskip-\struttotal}} + {\ifcstok{\tabulationparameter\c!after}\emptytoks\else + \vskip\strutdp + \verticalstrut + \vskip-\struttotal + \fi} \protected\def\tabl_tabulate_start_building {\ifinsidefloat @@ -1350,15 +1398,16 @@ % \resetcharacteralign % - \edef\p_distance {\tabulationparameter\c!distance}% - \edef\p_align {\tabulationparameter\c!align}% - \edef\p_line {\tabulationparameter\c!rule}% - \edef\p_rulecolor {\tabulationparameter\c!rulecolor}% - \edef\p_rulethickness{\tabulationparameter\c!rulethickness}% - \edef\p_bodyfont {\tabulationparameter\c!bodyfont}% - \edef\p_indenting {\tabulationparameter\c!indenting}% - \edef\p_keeptogether {\tabulationparameter\c!keeptogether}% - \edef\p_blank {\tabulationparameter\c!blank}% + \edef\p_distance {\tabulationparameter\c!distance}% + \edef\p_align {\tabulationparameter\c!align}% + \edef\p_line {\tabulationparameter\c!rule}% + \edef\p_rulecolor {\tabulationparameter\c!rulecolor}% + \edef\p_rulethickness {\tabulationparameter\c!rulethickness}% + \edef\p_bodyfont {\tabulationparameter\c!bodyfont}% + \edef\p_indenting {\tabulationparameter\c!indenting}% + \edef\p_keeptogether {\tabulationparameter\c!keeptogether}% + \edef\p_blank {\tabulationparameter\c!blank}% + \edef\p_interlinespace{\tabulationparameter\c!interlinespace}% % \ifx\p_keeptogether\v!no \settrue \c_tabl_tabulate_tolerant_break @@ -1368,6 +1417,12 @@ %\settrue \c_tabl_tabulate_handlepbreak \fi % + \ifx\p_interlinespace\v!no + \settrue\c_tabl_tabulate_no_interline_space + \else + \setfalse\c_tabl_tabulate_no_interline_space + \fi + % \settrue\c_tabl_tabulate_split \begincsname\??tabulatesplit\tabulationparameter\c!split\endcsname % @@ -1738,9 +1793,6 @@ \tabl_tabulate_color_reset_indeed \fi} -% \def\tabl_tabulate_color_reset_indeed -% {\dorecurse\c_tabl_tabulate_max_colorcolumn{\letgvalue{\??tabulatecolor\recurselevel}\undefined}} % slow - \def\tabl_tabulate_color_reset_indeed {\dofastloopcs\c_tabl_tabulate_max_colorcolumn\tabl_tabulate_color_reset_step} @@ -1888,6 +1940,84 @@ \permanent\protected\def\tabl_tabulate_CM_first{\global\c_tabl_tabulate_localcolorspan\plustwo \tabl_tabulate_set_color_column\zerocount} \permanent\protected\def\tabl_tabulate_CR_first{\global\c_tabl_tabulate_localcolorspan\plusthree\tabl_tabulate_set_color_column\zerocount} +%D New per 27/12/2022: + +% \defineorientation[test][orientation=down,vertical=top] +% +% \definetabulatemove[a][xoffset=40pt] +% \definetabulatemove[b][orientation=test,yoffset=depth] +% +% \startbuffer[b] +% \starttabulate[|c|c|] +% \TM[a] \NC \darkred cell one \NC \darkgray cell one \NC \NR +% \TM[b] \NC \darkgreen cell one \NC \darkblue cell one \NC \NR +% \TM[a] \NC \darkred cell two \NC \darkgray cell two \NC \NR +% \TM[b] \NC \darkgreen cell two \NC \darkblue cell two \NC \NR +% \TM[a] \NC \darkred cell three \NC \darkgray cell three \NC \NR +% \TM[b] \NC \darkgreen cell three \NC \darkblue cell three \NC \NR +% \TM[a] \NC \darkred cell four \NC \darkgray cell four \NC \NR +% \TM[b] \NC \darkgreen cell four \NC \darkblue cell four \NC \NR +% \stoptabulate +% \stopbuffer +% +% \start \showmakeup[line] \showstruts \ruledvbox{\getbuffer[b]} \stop +% \start \showstruts \ruledvbox{\getbuffer[b]} \stop +% \start \ruledvbox{\getbuffer[b]} \stop +% +% \startbuffer[b] +% \starttabulate[|p|p|] +% \TM[a] \NC \darkred \samplefile{tufte} \NC \darkgray \samplefile{ward} \NC \NR +% \NC \darkgreen \samplefile{tufte} \NC \darkblue \samplefile{ward} \NC \NR +% \TM[a] \NC \darkred \samplefile{tufte} \NC \darkgray \samplefile{ward} \NC \NR +% \NC \darkgreen \samplefile{tufte} \NC \darkblue \samplefile{ward} \NC \NR +% \stoptabulate +% \stopbuffer +% +% \start \showmakeup[line] \showstruts \getbuffer[b] \stop + +\installcorenamespace{tabulatemove} + +\installcommandhandler \??tabulatemove {tabulatemove} \??tabulatemove + +\setuptabulatemove + [\c!xoffset=\zeropoint, + \c!yoffset=\zeropoint, + \c!orientation=] + +\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_yes[#1]#*[#2]% + {\beginlocalcontrol + \ifhastok={#1}% + \setupcurrenttabulatemove[#1]% + \else + \edef\currenttabulatemove{#1}% + \setupcurrenttabulatemove[#2]% + \fi + \edef\m_orientation{\theorientation{\tabulatemoveparameter\c!orientation}}% + \edef\m_xoffset {\tabulatemoveparameter\c!xoffset}% + \edef\m_yoffset {\tabulatemoveparameter\c!yoffset}% + \scratchyoffset + \ifx\m_yoffset\v!depth + -\strutdp + \orelse\ifx\m_yoffset\v!height + -\strutht + \else + \m_yoffset + \fi + \relax + \scratchxoffset\m_xoffset\relax + \xdef\tabl_tabulate_tm + {\ifzeropt\scratchxoffset\else\s!xmove \the\scratchxoffset\fi % or move + \ifzeropt\scratchyoffset\else\s!ymove \the\scratchyoffset\fi % or move + \ifzero \m_orientation \else\s!orientation\m_orientation \fi + }% + \endlocalcontrol + \noalign\tabl_tabulate_tm{}} + +\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_nop[#1]#*[#2]% + {} + +\lettonothing\tabl_tabulate_tm % new 27/12/2022 + %D Sort of special: %D %D \startbuffer @@ -1945,6 +2075,7 @@ \appendtoks \enforced\let\NR\tabl_tabulate_NR_second \enforced\let\NB\tabl_tabulate_NB_second + \enforced\let\TM\tabl_tabulate_TM_yes \to \t_tabl_tabulate_initializers_second \appendtoks @@ -1953,6 +2084,7 @@ \enforced\let\MR\NR \enforced\let\LR\NR \enforced\let\AR\NR + \enforced\let\TM\tabl_tabulate_TM_nop \to \t_tabl_tabulate_initializers_first % \permanent\protected\def\tabl_tabulate_NR_common#1#2% @@ -2002,7 +2134,11 @@ \fi \fi \fi - \global\setfalse\c_tabl_tabulate_firstflushed} + \global\setfalse\c_tabl_tabulate_firstflushed + \ifconditional\c_tabl_tabulate_no_interline_space + \nointerlineskip + \injectzerobaselineskip + \fi} \protected\def\tabl_tabulate_bbskip_second_split_yes {\ifvoid\b_tabl_tabulate_current\c_tabl_tabulate_column @@ -2046,20 +2182,45 @@ \protected\def\tabl_tabulate_xbskip_second{\tabl_tabulate_bskip} \protected\def\tabl_tabulate_xeskip_second{\tabl_tabulate_eskip} +% \protected\def\tabl_tabulate_flush_second_indeed +% {\glettonothing\tabl_tabulate_flush_collected_indeed +% \global\c_tabl_tabulate_column\zerocount +% \tabl_tabulate_pbreak_check +% \dofastloopcs\c_tabl_tabulate_columns\tabl_tabulate_flush_second_step +% \global\settrue\c_tabl_tabulate_firstflushed} +% +% \protected\def\tabl_tabulate_flush_second_step +% {\ifvoid\b_tabl_tabulate_current\fastloopindex\else +% \gdef\tabl_tabulate_flush_collected_indeed{\the\t_tabl_tabulate_dummy}% +% \fi} +% +% \def\tabl_tabulate_flush_second +% {\noalign{\tabl_tabulate_flush_second_indeed}% +% \tabl_tabulate_flush_collected_indeed} + \protected\def\tabl_tabulate_flush_second_indeed {\glettonothing\tabl_tabulate_flush_collected_indeed \global\c_tabl_tabulate_column\zerocount \tabl_tabulate_pbreak_check + \global\setfalse\c_tabl_tabulate_split_done % new 27/12/2022 \dofastloopcs\c_tabl_tabulate_columns\tabl_tabulate_flush_second_step + \ifconditional\c_tabl_tabulate_split_done\else + \glet\tabl_tabulate_tm\s!reset % new 27/12/2022 + \fi \global\settrue\c_tabl_tabulate_firstflushed} \protected\def\tabl_tabulate_flush_second_step - {\ifvoid\b_tabl_tabulate_current\fastloopindex\else + {\ifvoid\b_tabl_tabulate_current\fastloopindex + \else \gdef\tabl_tabulate_flush_collected_indeed{\the\t_tabl_tabulate_dummy}% + \ifvoid\b_tabl_tabulate_current\fastloopindex \else + \global\settrue\c_tabl_tabulate_split_done % new 27/12/2022 + \fi \fi} \def\tabl_tabulate_flush_second {\noalign{\tabl_tabulate_flush_second_indeed}% + \noalign\tabl_tabulate_tm{\ifx\tabl_tabulate_tm\s!reset\glettonothing\tabl_tabulate_tm\fi}% new 27/12/2022 \tabl_tabulate_flush_collected_indeed} \protected\def\tabl_tabulate_bskip_second_split_nop @@ -2105,8 +2266,8 @@ \permanent\tolerant\noaligned\protected\def\tabl_tabulate_BL_second[#1]{\noalign{\tabl_tabulate_hrule_preset[#1]\tabl_tabulate_BL_second_indeed}} \protected\def\tabl_tabulate_FL_second_indeed - {\ifinsidefloat\else - \doifempty{\tabulationparameter\c!before}\tabl_tabulate_baselinecorrection % no expansion + {\ifinsidefloat\orelse\ifcstok{\tabulationparameter\c!before}\emptytoks + \tabl_tabulate_baselinecorrection \fi \tabl_tabulate_hrule_inject \tabl_tabulate_nobreak_inject @@ -2528,7 +2689,7 @@ % \NC text \NC text \NC \NR % \stoptabulate -\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB[#1]% +\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB_yes[#1]% {\noalign\bgroup \unless\iftok{#1}\emptytoks \blank[#1] @@ -2539,9 +2700,17 @@ \fi \egroup} +\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB_nop[#1]% + {} + \appendtoks - \enforced\let\TB\tabl_tabulate_TB -\to \everytabulate + \enforced\let\TB\tabl_tabulate_TB_yes +\to \t_tabl_tabulate_initializers_first + + +\appendtoks + \enforced\let\TB\tabl_tabulate_TB_nop +\to \t_tabl_tabulate_initializers_second % %D Between alignment lines certain rules apply, and even a simple test can mess % %D up a table, which is why we have a special test facilityL diff --git a/tex/context/base/mkxl/trac-vis.lmt b/tex/context/base/mkxl/trac-vis.lmt index df59f83c0..0cf6cb6a3 100644 --- a/tex/context/base/mkxl/trac-vis.lmt +++ b/tex/context/base/mkxl/trac-vis.lmt @@ -797,6 +797,7 @@ local ruledbox do local getshift = nuts.getshift local getorientation = nuts.getorientation + local setorientation = nuts.setorientation local getheight = nuts.getheight setmetatableindex(o_cache,function(t,size) @@ -811,10 +812,16 @@ local ruledbox do ruledbox = function(head,current,vertical,layer,what,simple,previous,trace_origin,parent) local wd, ht, dp = getwhd(current) --- todo local wd, ht, dh, shift = getlistdimensions(current) +-- local wd, ht, dh, shift = nuts.getlistdimensions(current) -- MAYBE local force_origin = wd == 0 or (dp + ht) == 0 local shift = getshift(current) - local orientation, xoffset, yoffset = getorientation(current) +-- print(getorientation(current,true)) + local orientation, xoffset, yoffset, w, h, d = getorientation(current) -- TODO +if orientation and orientation ~= 0 and (h ~= 0 or d ~= 0) then +-- wd = w + ht = h + dp = d +end local next = getnext(current) local prev = previous setboth(current) @@ -831,26 +838,6 @@ local ruledbox do b_cache[what] = this end end - -- we need to trigger the right mode (else sometimes no whatits) --- local info = setlink( --- this and copylist(this) or nil, --- (force_origin and emptyrule(wd,ht,dp)) -- we accept some overhead --- or dp == 0 and userrule { --- width = wd, --- height = ht, --- line = linewidth, --- type = "box", --- baseline = false, --- } --- or userrule { --- width = wd, --- height = ht, --- depth = dp, --- line = linewidth, --- type = "box", --- dashed = 3*size, --- } --- ) local rest, more if force_origin then rest = emptyrule(wd,ht,dp) -- we accept some overhead @@ -888,6 +875,7 @@ local ruledbox do dashed = 3*size, } end + -- local info = setlink(this and copylist(this) or nil,rest,more) -- setlisttransparency(info,"trace:s") @@ -934,6 +922,10 @@ local ruledbox do end info = new_hlist(info,wd,ht,dp,shift) end +-- if orientation then +-- setorientation(current,0,0) +-- setorientation(info,orientation,xoffset,yoffset) +-- end if next then setlink(info,next) end diff --git a/tex/context/base/mkxl/typo-ada.mkxl b/tex/context/base/mkxl/typo-ada.mkxl index 8da36f5e4..6e686a932 100644 --- a/tex/context/base/mkxl/typo-ada.mkxl +++ b/tex/context/base/mkxl/typo-ada.mkxl @@ -21,13 +21,22 @@ \unprotect -\newdimension\d_adaptive_width \aliasdimension\usedadaptivewidth \d_adaptive_width -\newdimension\d_adaptive_height \aliasdimension\usedadaptiveheight\d_adaptive_height -\newdimension\d_adaptive_depth \aliasdimension\usedadaptivedepth \d_adaptive_depth -\newdimension\d_adaptive_line \aliasdimension\usedadaptiveline \d_adaptive_line -\newdimension\d_adaptive_hsize \aliasdimension\usedadaptivehsize \d_adaptive_hsize - -\newbox \b_adaptive_box \aliased\let\usedadaptivebox\b_adaptive_box +\ifdefined\d_adaptive_width \else + \newdimension\d_adaptive_width + \newdimension\d_adaptive_height + \newdimension\d_adaptive_depth + \newdimension\d_adaptive_line + \newdimension\d_adaptive_hsize + \newbox \b_adaptive_box +\fi + +\aliasdimension\usedadaptivewidth \d_adaptive_width +\aliasdimension\usedadaptiveheight\d_adaptive_height +\aliasdimension\usedadaptivedepth \d_adaptive_depth +\aliasdimension\usedadaptiveline \d_adaptive_line +\aliasdimension\usedadaptivehsize \d_adaptive_hsize + +\aliased\let\usedadaptivebox\b_adaptive_box \mutable\lettonothing\m_adaptive_color diff --git a/tex/context/base/mkxl/typo-adj.lmt b/tex/context/base/mkxl/typo-adj.lmt index 1bd82c7b4..d902187e3 100644 --- a/tex/context/base/mkxl/typo-adj.lmt +++ b/tex/context/base/mkxl/typo-adj.lmt @@ -19,6 +19,8 @@ local getdepth = nuts.getdepth local newglue = nuts.pool.glue local insertafter = nuts.insertafter +local texgetdimen = tex.getdimen + ----- a_adjuster = attributes.system("adjuster") local function correct_depth(head,tail) @@ -37,7 +39,8 @@ local function correct_depth(head,tail) end local function block_baselineskip(head,tail) - tex.prevdepth = -1000 * 65536 -- ignoredepth + -- tex.prevdepth = -1000 * 65536 -- ignoredepth + tex.prevdepth = texgetdimen("ignoredepthcriterium") return head end diff --git a/tex/context/base/mkxl/typo-itm.mkxl b/tex/context/base/mkxl/typo-itm.mkxl index acc12c8ae..5a10cfc9d 100644 --- a/tex/context/base/mkxl/typo-itm.mkxl +++ b/tex/context/base/mkxl/typo-itm.mkxl @@ -197,7 +197,7 @@ \defineitems[\v!top][\c!width=\d_typo_items_text_width,\c!textalign=\itemsparameter\c!align] -\setvalue{\??itemsalternatives\v!top}#1% +\defcsname\??itemsalternatives\v!top\endcsname#1% {\let\typo_items_make\typo_items_make_horizontal \let\typo_items_item\typo_items_item_horizontal \typo_items_construct_items_boxes{#1}% @@ -213,7 +213,7 @@ \defineitems[\v!bottom][\c!width=\d_typo_items_text_width,\c!textalign=\itemsparameter\c!align] -\setvalue{\??itemsalternatives\v!bottom}#1% +\defcsname\??itemsalternatives\v!bottom\endcsname#1% {\let\typo_items_make\typo_items_make_horizontal \let\typo_items_item\typo_items_item_horizontal \typo_items_construct_items_boxes{#1}% @@ -229,7 +229,7 @@ \defineitems[\v!inmargin][\c!width=1.5\emwidth,\c!align=\v!flushright,\c!distance=\leftmargindistance] -\setvalue{\??itemsalternatives\v!inmargin}#1% +\defcsname\??itemsalternatives\v!inmargin\endcsname#1% {\let\typo_items_make\typo_items_make_vertical \let\typo_items_item\typo_items_item_vertical \typo_items_construct_items_boxes{#1}% @@ -242,7 +242,7 @@ \defineitems[\v!left][\c!width=1.5\emwidth,\c!align=\v!flushleft] -\setvalue{\??itemsalternatives\v!left}#1% +\defcsname\??itemsalternatives\v!left\endcsname#1% {\let\typo_items_make\typo_items_make_vertical \let\typo_items_item\typo_items_item_vertical \advanceby\d_typo_items_text_width-\dimexpr\d_typo_items_symbol_width+\d_typo_items_distance\relax @@ -257,7 +257,7 @@ \defineitems[\v!right][\c!width=1.5\emwidth,\c!align=\v!flushright] -\setvalue{\??itemsalternatives\v!right}#1% +\defcsname\??itemsalternatives\v!right\endcsname#1% {\let\typo_items_make\typo_items_make_vertical \let\typo_items_item\typo_items_item_vertical \advanceby\d_typo_items_text_width-\dimexpr\d_typo_items_symbol_width+\d_typo_items_distance\relax diff --git a/tex/context/base/mkxl/typo-mar.mkxl b/tex/context/base/mkxl/typo-mar.mkxl index be43e667d..85161c942 100644 --- a/tex/context/base/mkxl/typo-mar.mkxl +++ b/tex/context/base/mkxl/typo-mar.mkxl @@ -328,11 +328,11 @@ % \installcorenamespace{oppositemargin} % -% \letvalue{\??oppositemargin\v!left }\v!right -% \letvalue{\??oppositemargin\v!right }\v!left -% \letvalue{\??oppositemargin\v!inner }\v!outer -% \letvalue{\??oppositemargin\v!outer }\v!inner -% \letvalue{\??oppositemargin\v!normal}\v!normal +% \letcsname\??oppositemargin\v!left \endcsname\v!right +% \letcsname\??oppositemargin\v!right \endcsname\v!left +% \letcsname\??oppositemargin\v!inner \endcsname\v!outer +% \letcsname\??oppositemargin\v!outer \endcsname\v!inner +% \letcsname\??oppositemargin\v!normal\endcsname\v!normal % % \def\oppositemargin#1% % {\csname\??oppositemargin\ifcsname\??oppositemargin#1\endcsname#1\else\v!normal\fi\endcsname} diff --git a/tex/context/base/mkxl/typo-syn.lmt b/tex/context/base/mkxl/typo-syn.lmt index 4a5b6ae85..53e576391 100644 --- a/tex/context/base/mkxl/typo-syn.lmt +++ b/tex/context/base/mkxl/typo-syn.lmt @@ -402,7 +402,7 @@ do mcriterium = scaninteger() elseif key == "shrinkcriterium" then mcriterium = scaninteger() - elseif key == "stretchcriteriun" then + elseif key == "stretchcriterium" then pcriterium = scaninteger() else break diff --git a/tex/context/base/mkxl/typo-syn.mkxl b/tex/context/base/mkxl/typo-syn.mkxl index 053f65922..3f71fa43d 100644 --- a/tex/context/base/mkxl/typo-syn.mkxl +++ b/tex/context/base/mkxl/typo-syn.mkxl @@ -256,4 +256,6 @@ \definesynchronize [paralleltext] +% defined in lua: \hsplit to upto width height depth criterium shrinkcriterium stretchcriterium + \protect \endinput diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index ab96db37c..d9d7127a9 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2022-12-22 22:14 +-- merge date : 2022-12-27 21:02 do -- begin closure to overcome local limits and interference -- cgit v1.2.3