diff options
Diffstat (limited to 'tex/context/base/mkxl')
25 files changed, 999 insertions, 838 deletions
diff --git a/tex/context/base/mkxl/back-imp-pdp.lmt b/tex/context/base/mkxl/back-imp-pdp.lmt index 4c5d61b22..6b5a0edf9 100644 --- a/tex/context/base/mkxl/back-imp-pdp.lmt +++ b/tex/context/base/mkxl/back-imp-pdp.lmt @@ -6,8 +6,8 @@ if not modules then modules = { } end modules ['back-imp-pdp'] = { license = "see context related readme files" } --- This is temporary ... awaiting a better test .. basically we can --- always use this: pdf primitives. +-- We don't support late literals unless it's really needed by some third party +-- code. local context = context local lpdf = lpdf diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 667b2bc6d..45393d871 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.02.14 17:41} +\newcontextversion{2023.02.23 21:23} %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 b0539ce74..f5d46c9db 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2023.02.14 17:41} +\immutable\edef\contextversion{2023.02.23 21:23} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/core-uti.lmt b/tex/context/base/mkxl/core-uti.lmt index 8ce0cca4a..48737d7f6 100644 --- a/tex/context/base/mkxl/core-uti.lmt +++ b/tex/context/base/mkxl/core-uti.lmt @@ -409,8 +409,33 @@ function job.loadother(filename,cache) end unpacked.job.packed = nil -- nicer in inspecting if cache then - cache[filename] = unpacked + othercache[filename] = unpacked end + -- + local lists = utilitydata.structures.lists.collected or { } + local sections = utilitydata.structures.sections.collected or { } + local pages = utilitydata.structures.pages .collected or { } + for i=1,#lists do + local entry = lists[i] + local references = entry.references + if references then + local section = references.section + local realpage = references.realpage + -- maybe entry.* instead: + references.sectiondata = section and sections[section] + references.pagedata = realpage and pages[realpage] + -- get rid of these, maybe even crash as these are bogus + -- references.internal = nil + -- references.realpage = nil + -- references.section = nil + references.x = nil + references.y = nil + end + end + -- + -- also do the references here + -- + structures.references.registerfromlist(lists,derived,pages,sections) end end statistics.stoptiming(loadedfiles) diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt index 73e7085b2..09928f303 100644 --- a/tex/context/base/mkxl/driv-shp.lmt +++ b/tex/context/base/mkxl/driv-shp.lmt @@ -298,6 +298,7 @@ local flush_character do local csx = packet[3] local csy = packet[4] or csx pos_h = pos_h + flushchar(fnt,chr,csx,csy) +* sx elseif command == "slot" then local index = packet[2] local chr = packet[3] @@ -305,6 +306,7 @@ local flush_character do local csy = packet[5] or csx if index == 0 then pos_h = pos_h + flushchar(font,chr,csx,csy) +* sx else local okay = fonts and fonts[index] if okay then @@ -314,10 +316,12 @@ local flush_character do fnt = font end pos_h = pos_h + flushchar(fnt,chr,csx,csy) +* sx end else -- safeguard, we assume the font itself (often index 1) pos_h = pos_h + flushchar(font,chr,csx,csy) +* sx end end elseif command == "use" then @@ -394,6 +398,11 @@ local flush_character do pos_h = ph pos_v = pv end + elseif command == "stay" then + -- we can do a fast one if needed, it's more an experiment + push() + flushchar(font,packet[2],1,1) + pop() elseif command == "compose" then -- for now idem local ph = pos_h local pv = pos_v diff --git a/tex/context/base/mkxl/font-mat.mklx b/tex/context/base/mkxl/font-mat.mklx index 942c2fecd..76f6f87b9 100644 --- a/tex/context/base/mkxl/font-mat.mklx +++ b/tex/context/base/mkxl/font-mat.mklx @@ -555,4 +555,29 @@ \fi \to\everybodyfont +%D Something new, see type {type-imp-antykwa} for an example: + +% if we get more: + +% \installcorenamespace {fractionbar} +% \installcorenamespace {radicalbar} + +% \def\installfractionbar#1#2{\defcsname\??fractionbar#1\endcsname{#2}} +% \def\installradicalbar #1#2{\defcsname\??radicalbar #1\endcsname{#2}} + +% \def\fractionbarunicode{\ifcsname\??fractionbar\fontclass\endcsname\lastnamedcs\else\zerocount\fi} +% \def\radicalbarunicode {\ifcsname\??radicalbar \fontclass\endcsname\lastnamedcs\else\zerocount\fi} + +\mutable\lettonothing\currentmathfontclass + +\def\math_synchronize_setup + {\let\currentmathfontclass\fontclass + \fastsetup\fontclass} + +\appendtoks + \ifx\fontclass\currentmathfontclass\else + \math_synchronize_setup + \fi +\to \everymathematics + \protect \endinput diff --git a/tex/context/base/mkxl/font-vfc.lmt b/tex/context/base/mkxl/font-vfc.lmt index 479aa4ca0..6e9cd4013 100644 --- a/tex/context/base/mkxl/font-vfc.lmt +++ b/tex/context/base/mkxl/font-vfc.lmt @@ -82,6 +82,7 @@ end helpers.commands = utilities.storage.allocate { char = setmetatableindex(function(t,k) local v = { "char", k } t[k] = v return v end), + stay = setmetatableindex(function(t,k) local v = { "stay", k } t[k] = v return v end), right = setmetatableindex(function(t,k) local v = { "right", k } t[k] = v return v end), left = setmetatableindex(function(t,k) local v = { "left", k } t[k] = v return v end), down = setmetatableindex(function(t,k) local v = { "down", k } t[k] = v return v end), diff --git a/tex/context/base/mkxl/grph-epd.lmt b/tex/context/base/mkxl/grph-epd.lmt index 6f9e44f63..505599fff 100644 --- a/tex/context/base/mkxl/grph-epd.lmt +++ b/tex/context/base/mkxl/grph-epd.lmt @@ -36,6 +36,9 @@ local function mergegoodies(optionlist) if all or options[variables.layer] then codeinjections.mergeviewerlayers() end + if all or options[variables.media] then + codeinjections.mergerenditions() + end codeinjections.flushmergelayer() end diff --git a/tex/context/base/mkxl/lpdf-ano.lmt b/tex/context/base/mkxl/lpdf-ano.lmt index ed26b512e..55b145730 100644 --- a/tex/context/base/mkxl/lpdf-ano.lmt +++ b/tex/context/base/mkxl/lpdf-ano.lmt @@ -10,8 +10,16 @@ if not modules then modules = { } end modules ['lpdf-ano'] = { -- todo: /AA << WC << ... >> >> : WillClose actions etc --- internal references are indicated by a number (and turned into <autoprefix><number>) --- we only flush internal destinations that are referred +-- Internal references are indicated by a number (and turned into <autoprefix><number>) +-- we only flush internal destinations that are referred. + +-- In the end one can wonder if it was worth the effort to keep up with annotations. +-- Where acrobat at least supports most (can differ per version) other viewers +-- support partial. For instance sumatra (that I use for testing) can open an +-- external links but doesn't go to the page. So don't report issues before making +-- sure that it's not your browser that fails. One cannto complain about what comes +-- for free (browsers) but one should also not praise non commercial software to +-- much without looking critical at how it performs. local next, tostring, tonumber, rawget, type = next, tostring, tonumber, rawget, type local rep, format, find = string.rep, string.format, string.find diff --git a/tex/context/base/mkxl/lpdf-epa.lmt b/tex/context/base/mkxl/lpdf-epa.lmt index 750c008fb..26bb9f703 100644 --- a/tex/context/base/mkxl/lpdf-epa.lmt +++ b/tex/context/base/mkxl/lpdf-epa.lmt @@ -549,7 +549,7 @@ local function copyF(v,lock) -- todo: bxor 24 end -- Speed is not really an issue so we don't optimize this code too much. In the end (after --- testing we end up with less code that we started with. +-- testing) we ended up with less code that we started with. function codeinjections.mergecomments(specification) local specification, fullname, document = validdocument(specification) @@ -867,6 +867,33 @@ function codeinjections.mergefields(specification) end end +-- The crappy parts of pdf .. too unpredictable. + +function codeinjections.mergerenditions(specification) +-- local specification, fullname, document = validdocument(specification) +-- if not document then +-- return "" +-- end +-- local pagenumber = specification.page or 1 +-- local pagedata = document.pages[pagenumber] +-- local annotations = pagedata and pagedata.Annots +-- if annotations and #annotations > 0 then +-- local llx, lly, urx, ury, width, height, xscale, yscale = getmediasize(specification,pagedata,xscale,yscale) +-- initializelayer(height,width) +-- -- +-- for i=1,#annotations do +-- -- we keep the order +-- local annotation = annotations[i] +-- if annotation then +-- local subtype = annotation.Subtype +-- if subtype == "Screen" then +-- print("not done") +-- end +-- end +-- end +-- end +end + -- Beware, bookmarks can be in pdfdoc encoding or in unicode. However, in mkiv we -- write out the strings in unicode (hex). When we read them in, we check for a bom -- and convert to utf. diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index 19a43ce87..370415c81 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -1666,6 +1666,17 @@ do -- local addprivate = fonts.helpers.addprivate -- local newnextglyph = addprivate(target,formatters["M-N-%H"](nextglyph),newnextdata) + local nps = fonts.helpers.newprivateslot + + local umbracepiece = nps("um brace piece") -- will be created + local lmbracepiece = nps("lm brace piece") -- will be created + local cmbracepiece = nps("cm brace piece") -- will be created : center piece for brace builder hack + + local ulbracepiece = nps("ul brace piece") + local urbracepiece = nps("ur brace piece") + local llbracepiece = nps("ll brace piece") + local lrbracepiece = nps("lr brace piece") + local over = { factor = "over" } local under = { factor = "under" } @@ -2201,6 +2212,10 @@ do -- mirror -- smaller + local nps = fonts.helpers.newprivateslot + + local radicalbarextender = nps("radical bar extender") -- we reserve it here + local list = { 0x221A, } @@ -2627,7 +2642,7 @@ do width = 2*width - 1*advance, height = height, depth = depth, - callback = "devirtualize", +-- callback = "devirtualize", commands = { char, left, char }, } characters[triple] = { @@ -2635,7 +2650,7 @@ do width = 3*width - 2*advance, height = height, depth = depth, - callback = "devirtualize", +-- callback = "devirtualize", commands = { char, left, char, left, char }, } if trace_tweaking then @@ -2972,7 +2987,7 @@ do width = 2*width - 1*advance, height = height, depth = depth, - callback = "devirtualize", +-- callback = "devirtualize", commands = { charcommand[single], leftcommand[advance], @@ -2988,7 +3003,7 @@ do width = 3*width - 2*advance, height = height, depth = depth, - callback = "devirtualize", +-- callback = "devirtualize", commands = { charcommand[single], leftcommand[advance], diff --git a/tex/context/base/mkxl/math-ali.mkxl b/tex/context/base/mkxl/math-ali.mkxl index 20ea1d279..baaa4666a 100644 --- a/tex/context/base/mkxl/math-ali.mkxl +++ b/tex/context/base/mkxl/math-ali.mkxl @@ -739,10 +739,14 @@ {\c_math_eqalign_column\zerocount \rawprocesscommacommand[#1]\math_eqalign_set_columns_step} -\letcsname\??mathalignmentvariant\v!normal\endcsname\zerocount -\letcsname\??mathalignmentvariant\v!left \endcsname\plusone -\letcsname\??mathalignmentvariant\v!right \endcsname\plustwo -\letcsname\??mathalignmentvariant\v!middle\endcsname\plusthree +% can't we reuse these numbers ? + +\letcsname\??mathalignmentvariant\v!normal \endcsname\zerocount +\letcsname\??mathalignmentvariant\v!flushright\endcsname\plusone +\letcsname\??mathalignmentvariant\v!left \endcsname\plusone +\letcsname\??mathalignmentvariant\v!right \endcsname\plustwo +\letcsname\??mathalignmentvariant\v!flushleft \endcsname\plustwo +\letcsname\??mathalignmentvariant\v!middle \endcsname\plusthree %D \starttyping %D \placeformula[eqn0]\startformula \startalign[n=1] a\NR \stopalign \stopformula See \in[eqn0] @@ -2514,9 +2518,13 @@ \defcsname\??mathboxlocation\v!left \endcsname {\c_strc_math_number_location\plusone} +\defcsname\??mathboxlocation\v!flushright\endcsname + {\c_strc_math_number_location\plusone} \defcsname\??mathboxlocation\v!right\endcsname {\c_strc_math_number_location\plustwo} +\defcsname\??mathboxlocation\v!flushleft\endcsname + {\c_strc_math_number_location\plustwo} \defcsname\??mathboxlocation\v!atrightmargin\endcsname {\c_strc_math_number_location\plustwo diff --git a/tex/context/base/mkxl/math-frc.mkxl b/tex/context/base/mkxl/math-frc.mkxl index d11acac9b..47edc52c4 100644 --- a/tex/context/base/mkxl/math-frc.mkxl +++ b/tex/context/base/mkxl/math-frc.mkxl @@ -333,7 +333,7 @@ \s!vfactor \numexpr\mathfractionparameter\c!vfactor\relax \s!source \number\namedboxanchor{\mathfractionparameter\c!source}} -\installcorenamespace{mathalignsimple} +\installcorenamespace{mathalignsimple} % this should move to math-ali \defcsname\??mathalignsimple\v!right \endcsname#1{#1\hfill} \defcsname\??mathalignsimple\v!flushleft \endcsname#1{#1\hfill} diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl index c3bbb9587..c76d7313a 100644 --- a/tex/context/base/mkxl/math-ini.mkxl +++ b/tex/context/base/mkxl/math-ini.mkxl @@ -123,6 +123,7 @@ % +\ignorekerndimensionsmathcontrolcode % xits needs this (bad depth of fences) % +\ignoreflataccentsmathcontrolcode +\extendaccentsmathcontrolcode + +\extenddelimitersmathcontrolcode \relax % \mathpenaltiesmode\plusone diff --git a/tex/context/base/mkxl/math-noa.lmt b/tex/context/base/mkxl/math-noa.lmt index 1ee5c26e3..4a0cb5744 100644 --- a/tex/context/base/mkxl/math-noa.lmt +++ b/tex/context/base/mkxl/math-noa.lmt @@ -883,31 +883,47 @@ do setattr(pointer,a_mathsize,0) local delimiter = getdelimiter(pointer) if delimiter then - local chr, fnt, fam = getcharspec(delimiter) - if chr > 0 and fnt > 0 then - local data = fontdata[fnt] -local chardata = data.characters[chr] -local template = chardata.varianttemplate - local char = mathematics.big(data,template or chr,size,method) - local ht = getheight(pointer) - local dp = getdepth(pointer) - if template or ht == 1 or dp == 1 then -- 1 scaled point is a signal - local chardata = data.characters[char] - if template or ht == 1 then - setheight(pointer,chardata.height) + local oldchar, font, fam = getcharspec(delimiter) + if oldchar > 0 and font > 0 then + local ht = getheight(pointer) + local dp = getdepth(pointer) + local data = fontdata[font] + local characters = data.characters + local olddata = characters[oldchar] +-- local oldheight = olddata.height or 0 +-- local olddepth = olddata.depth or 0 + local template = olddata.varianttemplate + local newchar = mathematics.big(data,template or oldchar,size,method) + local newdata = characters[newchar] + local newheight = newdata.height or 0 + local newdepth = newdata.depth or 0 + if template then +-- local ratio = (newheight + newdepth) / (oldheight + olddepth) +-- setheight(pointer,ratio * oldheight) +-- setdepth(pointer,ratio * olddepth) + setheight(pointer,newheight) + setdepth(pointer,newdepth) + if not olddata.extensible then + -- check this on bonum and antykwa + setoptions(pointer,0) end - if template or dp == 1 then - setdepth(pointer,chardata.depth) + if trace_fences then +-- report_fences("replacing %C using method %a, size %a, template %C and ratio %.3f",newchar,method,size,template,ratio) + report_fences("replacing %C using method %a, size %a and template %C",newchar,method,size,template) + end + else + -- 1 scaled point is a signal, for now + if ht == 1 then + setheight(pointer,newheight) + end + if dp == 1 then + setdepth(pointer,newdepth) + end + setchar(delimiter,newchar) + if trace_fences then + report_fences("replacing %C by %C using method %a and size %a",oldchar,char,method,size) end end - if trace_fences then - report_fences("replacing %C by %C using method %a and size %a",chr,char,method,size) - end -if template then - setoptions(pointer,0) -else - setchar(delimiter,char) -end end end end diff --git a/tex/context/base/mkxl/math-rad.mklx b/tex/context/base/mkxl/math-rad.mklx index cb3cdb0a8..703481c08 100644 --- a/tex/context/base/mkxl/math-rad.mklx +++ b/tex/context/base/mkxl/math-rad.mklx @@ -189,14 +189,25 @@ % as struts are sort of predictable we can now fix all fonts in the lfg file. \protected\def\math_radical_common#degree% - {\Urooted + {\scratchcounter\ifcstok{\mathradicalparameter\c!rule}\v!symbol + \mathradicalparameter\c!top\relax + \else + \zerocount + \fi + \Urooted \s!height\dimexpr\mathradicalparameter\c!height\relax \s!depth \dimexpr\mathradicalparameter\c!depth\relax \s!source\numexpr\namedboxanchor{\mathradicalparameter\c!source}\relax \s!style \normalmathstyle + \ifzeronum\scratchcounter\else + top % \s!top + \fi \zerocount \mathradicalparameter\c!left \zerocount \mathradicalparameter\c!right - \relax + \ifzeronum\scratchcounter\else + \zerocount\scratchcounter + \fi + \relax {\mathstrut#degree}} \defcsname\??mathradicalalternative\v!default\endcsname % #body% @@ -365,6 +376,7 @@ \integerdef\delimitedleftanutityuc \privatecharactercode{delimited left annuity} \integerdef\delimitedrightanutityuc \privatecharactercode{delimited right annuity} +\integerdef\radicalbarextenderuc \privatecharactercode{radical bar extender} \definemathradical [rannuity] diff --git a/tex/context/base/mkxl/math-ttv.lmt b/tex/context/base/mkxl/math-ttv.lmt index e33a23478..3393ecc03 100644 --- a/tex/context/base/mkxl/math-ttv.lmt +++ b/tex/context/base/mkxl/math-ttv.lmt @@ -13,6 +13,48 @@ local setdigits = vfmath.setdigits local mathencodings = fonts.encodings.math +local nps = fonts.helpers.newprivateslot + +-- mathencodings["large-to-small-private"] = { +-- [0xFE07A] = 0x7A, -- bracehtipdownleft +-- [0xFE07B] = 0x7B, -- bracehtipdownright +-- [0xFE07C] = 0x7C, -- bracehtipupleft +-- [0xFE07D] = 0x7D, -- bracehtipupright +-- } + +mathencodings["large-to-small-private"] = { + [nps("ul brace piece")] = 0x7A, -- bracehtipdownleft + [nps("ur brace piece")] = 0x7B, -- bracehtipdownright + [nps("ll brace piece")] = 0x7C, -- bracehtipupleft + [nps("lr brace piece")] = 0x7D, -- bracehtipupright +} + +-- mathencodings["extensible-jmn-private"] = { +-- [0xFE080] = 200, -- minusjmn +-- [0xFE081] = 201, -- minusrightjmn +-- [0xFE082] = 202, -- minusleftjmn +-- [0xFE083] = 203, -- equaljmn +-- [0xFE084] = 204, -- equalrightjmn +-- [0xFE085] = 205, -- equalleftjmn +-- [0xFE086] = 206, -- arrowleftjmn +-- [0xFE087] = 207, -- arrowrightjmn +-- [0xFE088] = 208, -- arrowdblleftjmn +-- [0xFE089] = 209, -- arrowdblrightjmn +-- } + +-- mathencodings["extensible-jmn-private"] = { +-- [nps("rule middle piece")] = 200, -- minusjmn +-- [nps("rule right piece")] = 201, -- minusrightjmn +-- [nps("rule left piece")] = 202, -- minusleftjmn +-- [nps("double rule middle piece")] = 203, -- equaljmn +-- [nps("double rule right piece")] = 204, -- equalrightjmn +-- [nps("double rule left piece")] = 205, -- equalleftjmn +-- [nps("arrow left piece")] = 206, -- arrowleftjmn +-- [nps("arrow right piece")] = 207, -- arrowrightjmn +-- [nps("double arrow left piece")] = 208, -- arrowdblleftjmn +-- [nps("double arrow right piece")] = 209, -- arrowdblrightjmn +-- } + -- varphi is part of the alphabet, contrary to the other var*s' mathencodings["large-to-small"] = { @@ -59,14 +101,6 @@ mathencodings["large-to-small"] = { [0x02044] = 0x0E, -- / } -mathencodings["large-to-small-private"] = { - [0xFE07A] = 0x7A, -- bracehtipdownleft - [0xFE07B] = 0x7B, -- bracehtipdownright - [0xFE07C] = 0x7C, -- bracehtipupleft - [0xFE07D] = 0x7D, -- bracehtipupright - -} - -- Beware: these are (in cm/lm) below the baseline due to limitations -- in the tfm format but the engine (combined with the mathclass) takes -- care of it. If we need them in textmode, we should make them virtual @@ -111,17 +145,17 @@ mathencodings["tex-mr"] = { -- [0x002D8] = 0x15, -- [math]breve -- [0x000AF] = 0x16, -- [math]bar -- [0x00021] = 0x21, -- ! - [0x00028] = 0x28, -- ( - [0x00029] = 0x29, -- ) - [0x0002B] = 0x2B, -- + - [0x0002F] = 0x2F, -- / - [0x0003A] = 0x3A, -- : - [0x02236] = 0x3A, -- colon - [0x0003B] = 0x3B, -- ; - [0x0003C] = 0x3C, -- < - [0x0003D] = 0x3D, -- = - [0x0003E] = 0x3E, -- > - [0x0003F] = 0x3F, -- ? + [0x00028] = 0x28, -- ( + [0x00029] = 0x29, -- ) + [0x0002B] = 0x2B, -- + + [0x0002F] = 0x2F, -- / + [0x0003A] = 0x3A, -- : + [0x02236] = 0x3A, -- colon + [0x0003B] = 0x3B, -- ; + [0x0003C] = 0x3C, -- < + [0x0003D] = 0x3D, -- = + [0x0003E] = 0x3E, -- > + [0x0003F] = 0x3F, -- ? [0x00391] = 0x41, -- Alpha [0x00392] = 0x42, -- Beta [0x02145] = 0x44, @@ -136,8 +170,8 @@ mathencodings["tex-mr"] = { [0x003A4] = 0x54, -- Tau [0x003A7] = 0x58, -- Chi [0x00396] = 0x5A, -- Zeta - [0x0005B] = 0x5B, -- [ - [0x0005D] = 0x5D, -- ] + [0x0005B] = 0x5B, -- [ + [0x0005D] = 0x5D, -- ] -- [0x0005E] = 0x5E, -- [math]hat -- the text one [0x00302] = 0x5E, -- [math]hat -- the real math one -- [0x002D9] = 0x5F, -- [math]dot @@ -204,8 +238,10 @@ mathencodings["tex-mi"] = { [0x021BD] = 0x29, -- leftharpoondown [0x021C0] = 0x2A, -- rightharpoonup [0x021C1] = 0x2B, -- rightharpoondown - [0xFE322] = 0x2C, -- lhook (hook for combining arrows) - [0xFE323] = 0x2D, -- rhook (hook for combining arrows) +-- [0xFE322] = 0x2C, -- lhook (hook for combining arrows) +-- [0xFE323] = 0x2D, -- rhook (hook for combining arrows) + [nps("left hook piece")] = 0x2C, -- bracehtipdownleft + [nps("right hook piece")] = 0x2D, -- bracehtipdownleft [0x025B7] = 0x2E, -- triangleright : cf lmmath / BJ [0x025C1] = 0x2F, -- triangleleft : cf lmmath / BJ [0x022B3] = 0x2E, -- triangleright : cf lmmath this a cramped triangles / BJ / see * @@ -463,281 +499,11 @@ mathencodings["tex-sy"] = { [0x02662] = 0x7D, -- diamondsuit [0x02661] = 0x7E, -- heartsuit [0x02660] = 0x7F, -- spadesuit - [0xFE321] = 0x37, -- mapstochar - - [0xFE325] = 0x30, -- prime 0x02032 + -- [0xFE321] = 0x37, -- mapstochar + -- [0xFE325] = 0x30, -- prime 0x02032 + [nps("maps to piece")] = 0x37, -- mapstochar } --- -- The names in masm10.enc can be trusted best and are shown in the first --- -- column, while in the second column we show the tex/ams names. As usual --- -- it costs hours to figure out such a table. --- --- mathencodings["tex-ma"] = { --- [0x022A1] = 0x00, -- squaredot \boxdot --- [0x0229E] = 0x01, -- squareplus \boxplus --- [0x022A0] = 0x02, -- squaremultiply \boxtimes --- [0x025A1] = 0x03, -- square \square \Box --- [0x025A0] = 0x04, -- squaresolid \blacksquare --- [0x025AA] = 0x05, -- squaresmallsolid \centerdot --- [0x022C4] = 0x06, -- diamond \Diamond \lozenge --- [0x02666] = 0x07, -- diamondsolid \blacklozenge --- [0x021BB] = 0x08, -- clockwise \circlearrowright --- [0x021BA] = 0x09, -- anticlockwise \circlearrowleft --- [0x021CC] = 0x0A, -- harpoonleftright \rightleftharpoons --- [0x021CB] = 0x0B, -- harpoonrightleft \leftrightharpoons --- [0x0229F] = 0x0C, -- squareminus \boxminus --- [0x022A9] = 0x0D, -- forces \Vdash --- [0x022AA] = 0x0E, -- forcesbar \Vvdash --- [0x022A8] = 0x0F, -- satisfies \vDash --- [0x021A0] = 0x10, -- dblarrowheadright \twoheadrightarrow --- [0x0219E] = 0x11, -- dblarrowheadleft \twoheadleftarrow --- [0x021C7] = 0x12, -- dblarrowleft \leftleftarrows --- [0x021C9] = 0x13, -- dblarrowright \rightrightarrows --- [0x021C8] = 0x14, -- dblarrowup \upuparrows --- [0x021CA] = 0x15, -- dblarrowdwn \downdownarrows --- [0x021BE] = 0x16, -- harpoonupright \upharpoonright \restriction --- [0x021C2] = 0x17, -- harpoondownright \downharpoonright --- [0x021BF] = 0x18, -- harpoonupleft \upharpoonleft --- [0x021C3] = 0x19, -- harpoondownleft \downharpoonleft --- [0x021A3] = 0x1A, -- arrowtailright \rightarrowtail --- [0x021A2] = 0x1B, -- arrowtailleft \leftarrowtail --- [0x021C6] = 0x1C, -- arrowparrleftright \leftrightarrows --- -- [0x021C5] = 0x00, -- \updownarrows (missing in lm) --- [0x021C4] = 0x1D, -- arrowparrrightleft \rightleftarrows --- [0x021B0] = 0x1E, -- shiftleft \Lsh --- [0x021B1] = 0x1F, -- shiftright \Rsh --- [0x021DD] = 0x20, -- squiggleright \leadsto \rightsquigarrow --- [0x021AD] = 0x21, -- squiggleleftright \leftrightsquigarrow --- [0x021AB] = 0x22, -- curlyleft \looparrowleft --- [0x021AC] = 0x23, -- curlyright \looparrowright --- [0x02257] = 0x24, -- circleequal \circeq --- [0x0227F] = 0x25, -- followsorequal \succsim --- [0x02273] = 0x26, -- greaterorsimilar \gtrsim --- [0x02A86] = 0x27, -- greaterorapproxeql \gtrapprox --- [0x022B8] = 0x28, -- multimap \multimap --- [0x02234] = 0x29, -- therefore \therefore --- [0x02235] = 0x2A, -- because \because --- [0x02251] = 0x2B, -- equalsdots \Doteq \doteqdot --- [0x0225C] = 0x2C, -- defines \triangleq --- [0x0227E] = 0x2D, -- precedesorequal \precsim --- [0x02272] = 0x2E, -- lessorsimilar \lesssim --- [0x02A85] = 0x2F, -- lessorapproxeql \lessapprox --- [0x02A95] = 0x30, -- equalorless \eqslantless --- [0x02A96] = 0x31, -- equalorgreater \eqslantgtr --- [0x022DE] = 0x32, -- equalorprecedes \curlyeqprec --- [0x022DF] = 0x33, -- equalorfollows \curlyeqsucc --- [0x0227C] = 0x34, -- precedesorcurly \preccurlyeq --- [0x02266] = 0x35, -- lessdblequal \leqq --- [0x02A7D] = 0x36, -- lessorequalslant \leqslant --- [0x02276] = 0x37, -- lessorgreater \lessgtr --- [0x02035] = 0x38, -- primereverse \backprime --- -- [0x0] = 0x39, -- axisshort \dabar --- [0x02253] = 0x3A, -- equaldotrightleft \risingdotseq --- [0x02252] = 0x3B, -- equaldotleftright \fallingdotseq --- [0x0227D] = 0x3C, -- followsorcurly \succcurlyeq --- [0x02267] = 0x3D, -- greaterdblequal \geqq --- [0x02A7E] = 0x3E, -- greaterorequalslant \geqslant --- [0x02277] = 0x3F, -- greaterorless \gtrless --- [0x0228F] = 0x40, -- squareimage \sqsubset --- [0x02290] = 0x41, -- squareoriginal \sqsupset --- -- wrong: see ** --- -- [0x022B3] = 0x42, -- triangleright \rhd \vartriangleright --- -- [0x022B2] = 0x43, -- triangleleft \lhd \vartriangleleft --- -- cf lm --- [0x022B5] = 0x44, -- trianglerightequal \unrhd \trianglerighteq --- [0x022B4] = 0x45, -- triangleleftequal \unlhd \trianglelefteq --- -- --- [0x02605] = 0x46, -- star \bigstar --- [0x0226C] = 0x47, -- between \between --- [0x025BC] = 0x48, -- triangledownsld \blacktriangledown --- [0x025B6] = 0x49, -- trianglerightsld \blacktriangleright --- [0x025C0] = 0x4A, -- triangleleftsld \blacktriangleleft --- -- [0x0] = 0x4B, -- arrowaxisright --- -- [0x0] = 0x4C, -- arrowaxisleft --- [0x025B2] = 0x4D, -- triangle \triangleup \vartriangle --- [0x025B2] = 0x4E, -- trianglesolid \blacktriangle --- [0x025BD] = 0x4F, -- triangleinv \triangledown --- [0x02256] = 0x50, -- ringinequal \eqcirc --- [0x022DA] = 0x51, -- lessequalgreater \lesseqgtr --- [0x022DB] = 0x52, -- greaterlessequal \gtreqless --- [0x02A8B] = 0x53, -- lessdbleqlgreater \lesseqqgtr --- [0x02A8C] = 0x54, -- greaterdbleqlless \gtreqqless --- [0x000A5] = 0x55, -- Yen \yen --- [0x021DB] = 0x56, -- arrowtripleright \Rrightarrow --- [0x021DA] = 0x57, -- arrowtripleleft \Lleftarrow --- [0x02713] = 0x58, -- check \checkmark --- [0x022BB] = 0x59, -- orunderscore \veebar --- [0x022BC] = 0x5A, -- nand \barwedge --- [0x02306] = 0x5B, -- perpcorrespond \doublebarwedge --- [0x02220] = 0x5C, -- angle \angle --- [0x02221] = 0x5D, -- measuredangle \measuredangle --- [0x02222] = 0x5E, -- sphericalangle \sphericalangle --- -- [0x0] = 0x5F, -- proportional \varpropto --- -- [0x0] = 0x60, -- smile \smallsmile --- -- [0x0] = 0x61, -- frown \smallfrown --- [0x022D0] = 0x62, -- subsetdbl \Subset --- [0x022D1] = 0x63, -- supersetdbl \Supset --- [0x022D3] = 0x64, -- uniondbl \doublecup \Cup --- [0x022D2] = 0x65, -- intersectiondbl \doublecap \Cap --- [0x022CF] = 0x66, -- uprise \curlywedge --- [0x022CE] = 0x67, -- downfall \curlyvee --- [0x022CB] = 0x68, -- multiopenleft \leftthreetimes --- [0x022CC] = 0x69, -- multiopenright \rightthreetimes --- [0x02AC5] = 0x6A, -- subsetdblequal \subseteqq --- [0x02AC6] = 0x6B, -- supersetdblequal \supseteqq --- [0x0224F] = 0x6C, -- difference \bumpeq --- [0x0224E] = 0x6D, -- geomequivalent \Bumpeq --- [0x022D8] = 0x6E, -- muchless \lll \llless --- [0x022D9] = 0x6F, -- muchgreater \ggg \gggtr --- [0x0231C] = 0x70, -- rightanglenw \ulcorner --- [0x0231D] = 0x71, -- rightanglene \urcorner --- [0x024C7] = 0x72, -- circleR \circledR --- [0x024C8] = 0x73, -- circleS \circledS --- [0x022D4] = 0x74, -- fork \pitchfork --- [0x02214] = 0x75, -- dotplus \dotplus --- [0x0223D] = 0x76, -- revsimilar \backsim --- [0x022CD] = 0x77, -- revasymptequal \backsimeq -- AM: Check this! I mapped it to simeq. --- [0x0231E] = 0x78, -- rightanglesw \llcorner --- [0x0231F] = 0x79, -- rightanglese \lrcorner --- [0x02720] = 0x7A, -- maltesecross \maltese --- [0x02201] = 0x7B, -- complement \complement --- [0x022BA] = 0x7C, -- intercal \intercal --- [0x0229A] = 0x7D, -- circlering \circledcirc --- [0x0229B] = 0x7E, -- circleasterisk \circledast --- [0x0229D] = 0x7F, -- circleminus \circleddash --- } --- --- mathencodings["tex-mb"] = { --- -- [0x0] = 0x00, -- lessornotequal \lvertneqq --- -- [0x0] = 0x01, -- greaterornotequal \gvertneqq --- [0x02270] = 0x02, -- notlessequal \nleq --- [0x02271] = 0x03, -- notgreaterequal \ngeq --- [0x0226E] = 0x04, -- notless \nless --- [0x0226F] = 0x05, -- notgreater \ngtr --- [0x02280] = 0x06, -- notprecedes \nprec --- [0x02281] = 0x07, -- notfollows \nsucc --- [0x02268] = 0x08, -- lessornotdbleql \lneqq --- [0x02269] = 0x09, -- greaterornotdbleql \gneqq --- -- [0x0] = 0x0A, -- notlessorslnteql \nleqslant --- -- [0x0] = 0x0B, -- notgreaterorslnteql \ngeqslant --- [0x02A87] = 0x0C, -- lessnotequal \lneq --- [0x02A88] = 0x0D, -- greaternotequal \gneq --- -- [0x0] = 0x0E, -- notprecedesoreql \npreceq --- -- [0x0] = 0x0F, -- notfollowsoreql \nsucceq --- [0x022E8] = 0x10, -- precedeornoteqvlnt \precnsim --- [0x022E9] = 0x11, -- followornoteqvlnt \succnsim --- [0x022E6] = 0x12, -- lessornotsimilar \lnsim --- [0x022E7] = 0x13, -- greaterornotsimilar \gnsim --- -- [0x0] = 0x14, -- notlessdblequal \nleqq --- -- [0x0] = 0x15, -- notgreaterdblequal \ngeqq --- [0x02AB5] = 0x16, -- precedenotslnteql \precneqq --- [0x02AB6] = 0x17, -- follownotslnteql \succneqq --- [0x02AB9] = 0x18, -- precedenotdbleqv \precnapprox --- [0x02ABA] = 0x19, -- follownotdbleqv \succnapprox --- [0x02A89] = 0x1A, -- lessnotdblequal \lnapprox --- [0x02A8A] = 0x1B, -- greaternotdblequal \gnapprox --- [0x02241] = 0x1C, -- notsimilar \nsim --- [0x02247] = 0x1D, -- notapproxequal \ncong --- -- [0x0] = 0x1E, -- upslope \diagup --- -- [0x0] = 0x1F, -- downslope \diagdown --- -- [0x0] = 0x20, -- notsubsetoreql \varsubsetneq --- -- [0x0] = 0x21, -- notsupersetoreql \varsupsetneq --- -- [0x0] = 0x22, -- notsubsetordbleql \nsubseteqq --- -- [0x0] = 0x23, -- notsupersetordbleql \nsupseteqq --- [0x02ACB] = 0x24, -- subsetornotdbleql \subsetneqq --- [0x02ACC] = 0x25, -- supersetornotdbleql \supsetneqq --- -- [0x0] = 0x26, -- subsetornoteql \varsubsetneqq --- -- [0x0] = 0x27, -- supersetornoteql \varsupsetneqq --- [0x0228A] = 0x28, -- subsetnoteql \subsetneq --- [0x0228B] = 0x29, -- supersetnoteql \supsetneq --- [0x02288] = 0x2A, -- notsubseteql \nsubseteq --- [0x02289] = 0x2B, -- notsuperseteql \nsupseteq --- [0x02226] = 0x2C, -- notparallel \nparallel --- [0x02224] = 0x2D, -- notbar \nmid \ndivides --- -- [0x0] = 0x2E, -- notshortbar \nshortmid --- -- [0x0] = 0x2F, -- notshortparallel \nshortparallel --- [0x022AC] = 0x30, -- notturnstile \nvdash --- [0x022AE] = 0x31, -- notforces \nVdash --- [0x022AD] = 0x32, -- notsatisfies \nvDash --- [0x022AF] = 0x33, -- notforcesextra \nVDash --- [0x022ED] = 0x34, -- nottriangeqlright \ntrianglerighteq --- [0x022EC] = 0x35, -- nottriangeqlleft \ntrianglelefteq --- [0x022EA] = 0x36, -- nottriangleleft \ntriangleleft --- [0x022EB] = 0x37, -- nottriangleright \ntriangleright --- [0x0219A] = 0x38, -- notarrowleft \nleftarrow --- [0x0219B] = 0x39, -- notarrowright \nrightarrow --- [0x021CD] = 0x3A, -- notdblarrowleft \nLeftarrow --- [0x021CF] = 0x3B, -- notdblarrowright \nRightarrow --- [0x021CE] = 0x3C, -- notdblarrowboth \nLeftrightarrow --- [0x021AE] = 0x3D, -- notarrowboth \nleftrightarrow --- [0x022C7] = 0x3E, -- dividemultiply \divideontimes --- [0x02300] = 0x3F, -- diametersign \varnothing --- [0x02204] = 0x40, -- notexistential \nexists --- [0x1D538] = 0x41, -- A (blackboard A) --- [0x1D539] = 0x42, -- B --- [0x02102] = 0x43, -- C --- [0x1D53B] = 0x44, -- D --- [0x1D53C] = 0x45, -- E --- [0x1D53D] = 0x46, -- F --- [0x1D53E] = 0x47, -- G --- [0x0210D] = 0x48, -- H --- [0x1D540] = 0x49, -- I --- [0x1D541] = 0x4A, -- J --- [0x1D542] = 0x4B, -- K --- [0x1D543] = 0x4C, -- L --- [0x1D544] = 0x4D, -- M --- [0x02115] = 0x4E, -- N --- [0x1D546] = 0x4F, -- O --- [0x02119] = 0x50, -- P --- [0x0211A] = 0x51, -- Q --- [0x0211D] = 0x52, -- R --- [0x1D54A] = 0x53, -- S --- [0x1D54B] = 0x54, -- T --- [0x1D54C] = 0x55, -- U --- [0x1D54D] = 0x56, -- V --- [0x1D54E] = 0x57, -- W --- [0x1D54F] = 0x58, -- X --- [0x1D550] = 0x59, -- Y --- [0x02124] = 0x5A, -- Z (blackboard Z) --- [0x02132] = 0x60, -- finv \Finv --- [0x02141] = 0x61, -- fmir \Game --- -- [0x0] = 0x62, tildewide --- -- [0x0] = 0x63, tildewider --- -- [0x0] = 0x64, Finv --- -- [0x0] = 0x65, Gmir --- [0x02127] = 0x66, -- Omegainv \mho --- [0x000F0] = 0x67, -- eth \eth --- [0x02242] = 0x68, -- equalorsimilar \eqsim --- [0x02136] = 0x69, -- beth \beth --- [0x02137] = 0x6A, -- gimel \gimel --- [0x02138] = 0x6B, -- daleth \daleth --- [0x022D6] = 0x6C, -- lessdot \lessdot --- [0x022D7] = 0x6D, -- greaterdot \gtrdot --- [0x022C9] = 0x6E, -- multicloseleft \ltimes --- [0x022CA] = 0x6F, -- multicloseright \rtimes --- -- [0x0] = 0x70, -- barshort \shortmid --- -- [0x0] = 0x71, -- parallelshort \shortparallel --- -- [0x02216] = 0x72, -- integerdivide \smallsetminus (2216 already part of tex-sy --- -- [0x0] = 0x73, -- similar \thicksim --- -- [0x0] = 0x74, -- approxequal \thickapprox --- [0x0224A] = 0x75, -- approxorequal \approxeq --- [0x02AB8] = 0x76, -- followsorequal \succapprox --- [0x02AB7] = 0x77, -- precedesorequal \precapprox --- [0x021B6] = 0x78, -- archleftdown \curvearrowleft --- [0x021B7] = 0x79, -- archrightdown \curvearrowright --- [0x003DC] = 0x7A, -- Digamma \digamma --- [0x003F0] = 0x7B, -- kappa \varkappa --- [0x1D55C] = 0x7C, -- k \Bbbk (blackboard k) --- [0x0210F] = 0x7D, -- planckover2pi \hslash % 0x7D --- [0x00127] = 0x7E, -- planckover2pi1 \hbar % 0x7E --- [0x003F6] = 0x7F, -- epsiloninv \backepsilon --- } --- --- mathencodings["tex-mc"] = { --- -- this file has no tfm so it gets mapped in the private space --- [0xFE324] = "mapsfromchar", --- } - mathencodings["tex-fraktur"] = { -- [0x1D504] = 0x41, -- A (fraktur A) -- [0x1D505] = 0x42, -- B diff --git a/tex/context/base/mkxl/math-vfu.lmt b/tex/context/base/mkxl/math-vfu.lmt index bdd5de103..f3e0ea814 100644 --- a/tex/context/base/mkxl/math-vfu.lmt +++ b/tex/context/base/mkxl/math-vfu.lmt @@ -47,6 +47,7 @@ fonts.handlers.vf.math = vfmath local helpers = fonts.helpers local addprivate = helpers.addprivate +local hasprivate = helpers.hasprivate local vfcommands = helpers.commands local rightcommand = vfcommands.right @@ -56,511 +57,535 @@ local upcommand = vfcommands.up local push = vfcommands.push local pop = vfcommands.pop local slotcommand = vfcommands.slot +local staycommand = vfcommands.stay -local function brace(main,characters,id,size,unicode,first,rule,left,right,rule,last) - if not characters[unicode] then - local template = characters[first] - if template then - if not characters[rule] then - local width = template.width / 4 - local height = template.height - characters[rule] = { - height = 3*height, - depth = 2*height, - width = width, - commands = { push, { "rule", height, width }, pop }, +local nps = fonts.helpers.newprivateslot +local ps = fonts.helpers.privateslot + +do + + local function horibar(main,unicode,rule,left,right,normal) + local characters = main.characters + if not characters[unicode] then + local height = main.mathparameters.defaultrulethickness or 4*65536/10 + local f_rule = rule and formatters["M-HORIBAR-RULE-%H"](rule) + local p_rule = rule and hasprivate(main,f_rule) + if rule and left and right and normal then + local ldata = characters[left] + local mdata = characters[rule] + local rdata = characters[right] + local ndata = characters[normal] + local lwidth = ldata.width or 0 + local mwidth = mdata.width or 0 + local rwidth = rdata.width or 0 + local nwidth = ndata.width or 0 + local down = (mdata.height / 2) - height + -- + local f_left = right and formatters["M-HORIBAR-LEFT-%H"](right) + local f_right = right and formatters["M-HORIBAR-RIGHT-%H"](right) + local p_left = left and hasprivate(main,f_left) + local p_right = right and hasprivate(main,f_right) + -- + if not characters[p_rule] then + p_rule = addprivate(main,f_rule,{ + height = height, + width = mwidth, + width = .95*mwidth, + commands = { + push, + leftcommand[.025*mwidth], + downcommand[down], + slotcommand[0][rule], + pop, + }, + }) + end + if not characters[p_left] then + p_left = addprivate(main,f_left,{ + height = height, + width = lwidth, + width = .95*lwidth, + commands = { + push, + leftcommand[.025*lwidth], + downcommand[down], + slotcommand[0][left], + pop, + }, + }) + end + if not characters[p_right] then + p_right = addprivate(main,f_right,{ + height = height, + width = rwidth, + width = .95*rwidth, + commands = { + push, + leftcommand[.025*rwidth], + downcommand[down], + slotcommand[0][right], + pop, + }, + }) + end + characters[unicode] = { + keepvirtual = true, + partsorientation = "horizontal", + height = height, + width = nwidth, + commands = { + downcommand[down], + slotcommand[0][normal] + }, + parts = { + { glyph = p_left, ["end"] = 0.4*lwidth }, + { glyph = p_rule, extender = 1, ["start"] = mwidth, ["end"] = mwidth }, + { glyph = p_right, ["start"] = 0.6*rwidth }, + } } - end - characters[unicode] = { - keepvirtual = true, - partsorientation = "horizontal", - parts = { - { glyph = first }, - { glyph = rule, extender = 1 }, - { glyph = left }, - { glyph = right }, - { glyph = rule, extender = 1 }, - { glyph = last }, + else + local width = main.parameters.quad/4 or 4*65536 + if not characters[p_rule] then + p_rule = addprivate(main,f_rule,{ + height = height, + width = width, + commands = { push, { "rule", height, width }, pop }, + }) + end + characters[unicode] = { + keepvirtual = true, + partsorientation = "horizontal", + parts = { + { glyph = p_rule }, + { glyph = p_rule, extender = 1, ["start"] = width/2, ["end"] = width/2 }, + } } - } + end end end -end -local function horibar(main,characters,id,size,unicode,rule) - if not characters[unicode] then - if not characters[rule] then - local width = main.parameters .quad/4 or 4*65536 + -- local rootbarmiddle -- false = addprivate(main,formatters["M-R-%H"](next)) + -- local rootbarright -- false = addprivate(main,formatters["M-R-%H"](next)) + + local function rootbar(main,unicode,rule,right,normal) + local characters = main.characters + if not characters[unicode] then local height = main.mathparameters.defaultrulethickness or 4*65536/10 - characters[rule] = { - height = height, - width = width, - commands = { push, { "rule", height, width }, pop }, - } + if rule and right and normal then + local mdata = characters[rule] + local rdata = characters[right] + local ndata = characters[normal] + local mwidth = mdata.width or 0 + local rwidth = rdata.width or 0 + local nwidth = ndata.width or 0 + local down = (mdata.height / 2) - height + -- + local f_rule = rule and formatters["M-ROOTBAR-RULE-%H"](rule) + local f_right = right and formatters["M-ROOTBAR-RIGHT-%H"](right) + local p_rule = rule and hasprivate(main,f_rule) + local p_right = right and hasprivate(main,f_right) + -- + if not p_rule then + p_rule = addprivate(main,f_rule,{ + height = height, + width = .95*mwidth, + commands = { + push, + leftcommand[.05*mwidth], + downcommand[down], + slotcommand[0][rule], + pop, + }, + }) + end + if right and not p_right then + p_right = addprivate(main,p_right,{ + height = height, + width = .95*rwidth, + commands = { + push, + leftcommand[.05*rwidth], + downcommand[down], + slotcommand[0][right], + pop, + }, + }) + end + characters[unicode] = { + keepvirtual = true, + partsorientation = "horizontal", + height = height, + width = rwidth, + commands = { + slotcommand[0][p_right], + }, + parts = { + { glyph = p_rule, extender = 1, ["start"] = mwidth, ["end"] = 0.9*mwidth }, + { glyph = p_right, ["start"] = 0.6*rwidth }, + } + } + end end - characters[unicode] = { - keepvirtual = true, - partsorientation = "horizontal", - parts = { - { glyph = rule }, - { glyph = rule, extender = 1 }, - } - } end -end -local function parent(main,characters,id,size,unicode,first,rule,last,where) - if not characters[unicode] then - local template = characters[first] - if template then - if not characters[rule] then - local width = template.width / 4 - local height = template.height - characters[rule] = { - height = where == "top" and height or 3*height, - depth = where == "top" and 2*height or 0, - width = width, - commands = { push, { "rule", height, width }, pop }, + local function parent(main,unicode,first,rule,last,where) + local characters = main.characters + local chardata = characters[unicode] + if characters[unicode] then + local template = characters[first] + if template then + if not characters[rule] then + local xheight = main.mathparameters.xheight + local width = template.width / 4 + local height = template.height + local depth = template.depth + local rheight = where == "top" and height or 3*height + local rdepth = where == "top" and 2*height or 0 + characters[rule] = { + height = rheight, + depth = rdepth, + width = width, + commands = { push, { "rule", height, width }, pop }, + } + characters[first].depth = rdepth + characters[last] .depth = rdepth + while true do + chardata.height = chardata.height - xheight + chardata.depth = 0 + chardata.yoffset = -xheight + local next = chardata.next + if next then + unicode = next + chardata = characters[unicode] + else + break + end + end + end + chardata.keepvirtual = true + chardata.partsorientation = "horizontal" + chardata.parts = { + { glyph = first }, + { glyph = rule, extender = 1 }, + { glyph = last }, } end - characters[unicode] = { - keepvirtual = true, - partsorientation = "horizontal", - parts = { + end + end + + local function brace(main,unicode,first,rule,left,right,rule,last) + local characters = main.characters + local chardata = characters[unicode] + if chardata then + local template = characters[first] + if template then + if not characters[rule] then + local xheight = main.mathparameters.xheight + local width = template.width / 4 + local height = template.height + local depth = template.depth + local rheight = 3*height + local rdepth = 2*height + characters[rule] = { + height = rheight, + depth = rdepth, + width = width, + commands = { push, { "rule", height, width }, pop }, + } + characters[first].depth = rdepth + characters[last] .depth = rdepth + characters[left] .height = rheight + characters[right].height = rheight + while true do + chardata.height = chardata.height - xheight + chardata.depth = 0 + chardata.yoffset = -xheight + local next = chardata.next + if next then + unicode = next + chardata = characters[unicode] + else + break + end + end + end + chardata.keepvirtual = true + chardata.partsorientation = "horizontal" + chardata.parts = { { glyph = first }, { glyph = rule, extender = 1 }, + { glyph = left }, + { glyph = right }, + { glyph = rule, extender = 1 }, { glyph = last }, } - } + end end end -end - --- local function extension(main,characters,id,size,unicode,first,middle,last) --- local chr = characters[unicode] --- if not chr then --- return -- skip --- end --- local fw = characters[first] --- if not fw then --- return --- end --- local mw = characters[middle] --- if not mw then --- return --- end --- local lw = characters[last] --- if not lw then --- return --- end --- fw = fw.width --- mw = mw.width --- lw = lw.width --- if fw == 0 then --- fw = 1 --- end --- if lw == 0 then --- lw = 1 --- end --- chr.partsorientation = "horizontal" --- chr.parts = { --- { extender = 0, glyph = first, ["end"] = fw/2, start = 0, advance = fw }, --- { extender = 1, glyph = middle, ["end"] = mw/2, start = mw/2, advance = mw }, --- { extender = 0, glyph = last, ["end"] = 0, start = lw/2, advance = lw }, --- } --- end - --- local step = 0.2 -- 0.1 is nicer but gives larger files --- local function clipped(main,characters,id,size,unicode,original) -- push/pop needed? --- local minus = characters[original] --- if minus then --- local mu = size/18 --- local step = 3*mu --- local width = minus.width --- if width > step then --- width = width - step --- step = step / 2 --- else --- width = width / 2 --- step = width --- end --- characters[unicode] = { --- width = width, --- height = minus.height, --- depth = minus.depth, --- commands = { --- push, --- leftcommand[step], --- slotcommand[id][original], --- pop, --- } --- } --- end --- end - -local function dots(main,characters,id,size,unicode) - local c = characters[0x002E] - if c then - local w = c.width - local h = c.height - local d = c.depth - local mu = size/18 - local right3mu = rightcommand[3*mu] - local right1mu = rightcommand[1*mu] - local up1size = upcommand[.1*size] - local up4size = upcommand[.4*size] - local up7size = upcommand[.7*size] - local right2muw = rightcommand[2*mu + w] - local slot = slotcommand[id][0x002E] - if unicode == 0x22EF then - local c = characters[0x022C5] - if c then - local width = c.width - local height = c.height - local depth = c.depth - local slot = slotcommand[id][0x022C5] + local function dots(main,unicode) + local characters = main.characters + local c = characters[0x002E] + if c then + local w = c.width + local h = c.height + local d = c.depth + local size = main.parameters.size + local mu = size/18 + local right3mu = rightcommand[3*mu] + local right1mu = rightcommand[1*mu] + local up1size = upcommand[.1*size] + local up4size = upcommand[.4*size] + local up7size = upcommand[.7*size] + local right2muw = rightcommand[2*mu + w] + local slot = slotcommand[0][0x002E] + if unicode == 0x22EF then + local c = characters[0x022C5] + if c then + local width = c.width + local height = c.height + local depth = c.depth + local slot = slotcommand[0][0x022C5] + -- local stay = staycommand[0x022C5] + -- local right3mu = rightcommand[width+3*mu] + characters[unicode] = { + width = 3*width + 2*3*mu, + height = height, + depth = depth, + commands = { + slot, right3mu, slot, right3mu, slot, + -- push, slot, right3mu, slot, right3mu, slot, pop, + -- stay, right3mu, stay, right3mu, stay, + } + } + end + elseif unicode == 0x22EE then characters[unicode] = { - width = 3*width + 2*3*mu, - height = height, - depth = depth, + width = w, + height = h+0.8*size, + depth = 0, commands = { - push, slot, right3mu, slot, right3mu, slot, pop, + -- push, push, slot, pop, up4size, push, slot, pop, up4size, slot, pop, + push, slot, pop, up4size, push, slot, pop, up4size, slot, } } - end - elseif unicode == 0x22EE then - characters[unicode] = { - width = w, - height = h+0.8*size, - depth = 0, - commands = { - push, push, slot, pop, up4size, push, slot, pop, up4size, slot, pop, + elseif unicode == 0x22F1 then + characters[unicode] = { + width = 3*w + 6*size/18, + height = h+0.7*size, + depth = 0, + commands = { + -- push, + right1mu, + push, up7size, slot, pop, + right2muw, + push, up4size, slot, pop, + right2muw, + push, up1size, slot, pop, + right1mu, + -- pop + } } - } - elseif unicode == 0x22F1 then + elseif unicode == 0x22F0 then + characters[unicode] = { + width = 3*w + 6*size/18, + height = h+0.7*size, + depth = 0, + commands = { + -- push, + right1mu, + push, up1size, slot, pop, + right2muw, + push, up4size, slot, pop, + right2muw, + push, up7size, slot, pop, + right1mu, + -- pop + } + } + else + characters[unicode] = { + width = 3*w + 2*3*mu, + height = h, + depth = d, + commands = { + -- push, slot, right3mu, slot, right3mu, slot, pop, + slot, right3mu, slot, right3mu, slot, + } + } + end + end + end + + local function jointwo(main,unicode,u1,d12,u2) + local characters = main.characters + local c1 = characters[u1] + local c2 = characters[u2] + if c1 and c2 then + local w1 = c1.width + local w2 = c2.width + local width + if d12 == false then + d12 = 0 + width = w2 + elseif d12 < 0 then + d12 = d12 * w2 + width = w2 + else + d12 = d12 * main.parameters.size/18 -- mu + width = w1 + w2 - d12 + end characters[unicode] = { - width = 3*w + 6*size/18, - height = h+0.7*size, - depth = 0, + width = width, + height = max(c1.height or 0, c2.height or 0), + depth = max(c1.depth or 0, c2.depth or 0), commands = { - push, - right1mu, - push, up7size, slot, pop, - right2muw, - push, up4size, slot, pop, - right2muw, - push, up1size, slot, pop, - right1mu, - pop - } + -- { "inspect" }, + -- { "trace" }, + slotcommand[0][u1], + -- { "trace" }, + d12 ~= 0 and leftcommand[d12] or false, + slotcommand[0][u2], + -- { "trace" }, + }, } - elseif unicode == 0x22F0 then + end + end + + local function overlaytwo(main,unicode,u1,factor,u2) -- not ... + local characters = main.characters + local c1 = characters[u1] + local c2 = characters[u2] + if c1 and c2 then + local width = c2.width characters[unicode] = { - width = 3*w + 6*size/18, - height = h+0.7*size, - depth = 0, + width = width, + height = max(c1.height or 0, c2.height or 0), + depth = max(c1.depth or 0, c2.depth or 0), commands = { push, - right1mu, - push, up1size, slot, pop, - right2muw, - push, up4size, slot, pop, - right2muw, - push, up7size, slot, pop, - right1mu, - pop - } + slotcommand[0][u2], -- = + pop, + factor ~= 0 and rightcommand[factor*width] or false, + slotcommand[0][u1], -- / + }, } - else + end + end + + local function jointhree(main,unicode,u1,d12,u2,d23,u3) + local characters = main.characters + local c1 = characters[u1] + local c2 = characters[u2] + local c3 = characters[u3] + if c1 and c2 and c3 then + local w1 = c1.width + local w2 = c2.width + local w3 = c3.width + local mu = main.parameters.size/18 + d12 = d12 * ds + d23 = d23 * ds characters[unicode] = { - width = 3*w + 2*3*mu, - height = h, - depth = d, + width = w1 + w2 + w3 - d12 - d23, + height = max(c1.height or 0, c2.height or 0, c3.height or 0), + depth = max(c1.depth or 0, c2.depth or 0, c3.depth or 0), commands = { - push, slot, right3mu, slot, right3mu, slot, pop, + -- push, + slotcommand[0][u1], + -- pop, + d12 ~= 0 and leftcommand[d12] or false, + -- push, + slotcommand[0][u2], + -- pop, + d23 ~= 0 and leftcommand[d23] or false, + -- push, + slotcommand[0][u3], + -- pop, } } end end -end --- local function vertbar(main,characters,id,size,parent,scale,unicode) --- local cp = characters[parent] --- if cp then --- local sc = scale * size --- local pc = slotcommand[id][parent] --- characters[unicode] = { --- width = cp.width, --- height = cp.height + sc, --- depth = cp.depth + sc, --- next = cp.next, -- can be extensible --- commands = { --- push, upcommand [sc], pc, pop, --- push, downcommand[sc], pc, pop, --- pc, --- }, --- } --- cp.next = unicode --- end --- end - -local function jointwo(main,characters,id,size,unicode,u1,d12,u2,what) - local c1 = characters[u1] - local c2 = characters[u2] - if c1 and c2 then - local w1 = c1.width - local w2 = c2.width - local width - if d12 == false then - d12 = 0 - width = w2 - else - d12 = d12 * size/18 -- mu - width = w1 + w2 - d12 + local function stack(main,unicode,u1,d12,u2) + local characters = main.characters + local c1 = characters[u1] + if not c1 then + return end + local c2 = characters[u2] + if not c2 then + return + end + local w1 = c1.width or 0 + local h1 = c1.height or 0 + local d1 = c1.depth or 0 + local w2 = c2.width or 0 + local h2 = c2.height or 0 + local d2 = c2.depth or 0 + local mu = main.parameters.size/18 characters[unicode] = { - width = width, - height = max(c1.height or 0, c2.height or 0), - depth = max(c1.depth or 0, c2.depth or 0), - commands = { --- { "inspect" }, --- { "trace" }, - slotcommand[id][u1], --- { "trace" }, - d12 ~= 0 and leftcommand[d12] or false, - slotcommand[id][u2], --- { "trace" }, - }, - } - end -end - -local function jointhree(main,characters,id,size,unicode,u1,d12,u2,d23,u3) - local c1 = characters[u1] - local c2 = characters[u2] - local c3 = characters[u3] - if c1 and c2 and c3 then - local w1 = c1.width - local w2 = c2.width - local w3 = c3.width - d12 = d12 * size/18 -- mu - d23 = d23 * size/18 -- mu - characters[unicode] = { - width = w1 + w2 + w3 - d12 - d23, - height = max(c1.height or 0, c2.height or 0, c3.height or 0), - depth = max(c1.depth or 0, c2.depth or 0, c3.depth or 0), + width = w1, + height = h1 + h2 + d12*mu, + depth = d1, commands = { --- push, - slotcommand[id][u1], --- pop, - d12 ~= 0 and leftcommand[d12] or false, --- push, - slotcommand[id][u2], --- pop, - d23 ~= 0 and leftcommand[d23] or false, --- push, - slotcommand[id][u3], --- pop, + slotcommand[0][u1], + leftcommand[w1/2 + w2/2], + downcommand[-h1 + d2 -d12*mu], + slotcommand[0][u2], } } end -end - -local function stack(main,characters,id,size,unicode,u1,d12,u2) - local c1 = characters[u1] - if not c1 then - return - end - local c2 = characters[u2] - if not c2 then - return - end - local w1 = c1.width or 0 - local h1 = c1.height or 0 - local d1 = c1.depth or 0 - local w2 = c2.width or 0 - local h2 = c2.height or 0 - local d2 = c2.depth or 0 - local mu = size/18 - characters[unicode] = { - width = w1, - height = h1 + h2 + d12*mu, - depth = d1, - commands = { - slotcommand[id][u1], - leftcommand[w1/2 + w2/2], - downcommand[-h1 + d2 -d12*mu], - slotcommand[id][u2], - } - } -end -local function repeated(main,characters,id,size,unicode,u,n,fraction) - local c = characters[u] - if c then - if n == 1 then - -- skip this one - else - local width = c.width - local italic = fraction*width -- c.italic or 0 -- larger ones have funny italics - local tc = slotcommand[id][u] - local tr = leftcommand[italic] -- see hack elsewhere - local commands = { } - for i=1,n-1 do + local function repeated(main,unicode,u,n,fraction) + local characters = main.characters + local c = characters[u] + if c then + if n == 1 then + -- skip this one + else + local width = c.width + local italic = fraction*width -- c.italic or 0 -- larger ones have funny italics + local tc = slotcommand[0][u] + local tr = leftcommand[italic] -- see hack elsewhere + local commands = { } + for i=1,n-1 do + commands[#commands+1] = tc + commands[#commands+1] = tr + end commands[#commands+1] = tc - commands[#commands+1] = tr - end - commands[#commands+1] = tc - local next = c.next - if next then - local p = addprivate(main,formatters["M-R-%H"](next)) - repeated(main,characters,id,size,p,next,n,fraction) - next = p + local next = c.next + if next then + local p = addprivate(main,formatters["M-R-%H"](next)) + repeated(main,p,next,n,fraction) + next = p + end + characters[unicode] = { + width = width + (n-1)*(width-italic), + height = c.height, + depth = c.depth, + italic = italic, + commands = commands, + keepvirtual = true, + next = next, + } end - characters[unicode] = { - width = width + (n-1)*(width-italic), - height = c.height, - depth = c.depth, - italic = italic, - commands = commands, - keepvirtual = true, - next = next, - } end end -end - --- local function cloned(main,characters,id,size,source,target) --- local data = characters[source] --- if data then --- characters[target] = data --- return true --- end --- end - --- we use the fact that context defines the smallest sizes first .. a real dirty and ugly hack - --- todo: use privates as we don't need access by number - -local data_of_smaller = nil -local size_of_smaller = 0 - -function vfmath.addmissing(main,id,size) - - local id_of_smaller = nil - - if size < size_of_smaller or size_of_smaller == 0 then - data_of_smaller = main.fonts[id] - id_of_smaller = id - else - id_of_smaller = #main.fonts + 1 - main.fonts[id_of_smaller] = data_of_smaller - end - - -- here id is the index in fonts (normally 14 or so) and that slot points to self - - local characters = main.characters - local shared = main.shared - local variables = main.goodies.mathematics and main.goodies.mathematics.variables or { } - local joinrelfactor = variables.joinrelfactor or 3 - - brace (main,characters,id,size,0x23DE,0xFE07A,0xFE070,0xFE07D,0xFE07C,0xFE070,0xFE07B) - brace (main,characters,id,size,0x23DF,0xFE07C,0xFE070,0xFE07B,0xFE07A,0xFE070,0xFE07D) - - parent (main,characters,id,size,0x23DC,0xFE07A,0xFE071,0xFE07B,"top") - parent (main,characters,id,size,0x23DD,0xFE07C,0xFE072,0xFE07D,"bottom") - - dots (main,characters,id,size,0x2026) -- ldots - dots (main,characters,id,size,0x22EE) -- vdots - dots (main,characters,id,size,0x22EF) -- cdots - dots (main,characters,id,size,0x22F1) -- ddots - dots (main,characters,id,size,0x22F0) -- udots - - horibar (main,characters,id,size,0x203E,0xFE073) -- overbar underbar - - -- vertbar (main,characters,id,size,0x0007C,0.10,0xFF601) -- big : 0.85 bodyfontsize - -- vertbar (main,characters,id,size,0xFF601,0.30,0xFF602) -- Big : 1.15 bodyfontsize - -- vertbar (main,characters,id,size,0xFF602,0.30,0xFF603) -- bigg : 1.45 bodyfontsize - -- vertbar (main,characters,id,size,0xFF603,0.30,0xFF604) -- Bigg : 1.75 bodyfontsize - -- vertbar (main,characters,id,size,0x02016,0.10,0xFF605) - -- vertbar (main,characters,id,size,0xFF605,0.30,0xFF606) - -- vertbar (main,characters,id,size,0xFF606,0.30,0xFF607) - -- vertbar (main,characters,id,size,0xFF607,0.30,0xFF608) - -- clipped (main,characters,id,size,0xFF501,0x0002D) -- minus - -- clipped (main,characters,id,size,0xFF502,0x02190) -- lefthead - -- clipped (main,characters,id,size,0xFF503,0x02192) -- righthead - -- clipped (main,characters,id,size,0xFF504,0xFE321) -- mapsto - -- clipped (main,characters,id,size,0xFF505,0xFE322) -- lhook - -- clipped (main,characters,id,size,0xFF506,0xFE323) -- rhook - -- clipped (main,characters,id,size,0xFF507,0xFE324) -- mapsfrom - -- clipped (main,characters,id,size,0xFF508,0x021D0) -- double lefthead - -- clipped (main,characters,id,size,0xFF509,0x021D2) -- double righthead - -- clipped (main,characters,id,size,0xFF50A,0x0003D) -- equal - -- clipped (main,characters,id,size,0xFF50B,0x0219E) -- lefttwohead - -- clipped (main,characters,id,size,0xFF50C,0x021A0) -- righttwohead - -- clipped (main,characters,id,size,0xFF50D,0xFF350) -- lr arrow combi snippet - -- clipped (main,characters,id,size,0xFF50E,0xFF351) -- lr arrow combi snippet - -- clipped (main,characters,id,size,0xFF50F,0xFF352) -- lr arrow combi snippet - -- clipped (main,characters,id,size,0xFF510,0x02261) -- equiv - - -- extension(main,characters,id,size,0x2190,0xFF502,0xFF501,0xFF501) -- \leftarrow - -- extension(main,characters,id,size,0x2192,0xFF501,0xFF501,0xFF503) -- \rightarrow - - -- extension(main,characters,id,size,0x002D,0xFF501,0xFF501,0xFF501) -- \rel - -- extension(main,characters,id,size,0x003D,0xFF50A,0xFF50A,0xFF50A) -- \equal - -- extension(main,characters,id,size,0x2261,0xFF510,0xFF510,0xFF510) -- \equiv - - -- jointwo (main,characters,id,size,0x21A6,0xFE321,0,0x02192) -- \mapstochar\rightarrow - -- jointwo (main,characters,id,size,0x21A9,0x02190,joinrelfactor,0xFE323) -- \leftarrow\joinrel\rhook - -- jointwo (main,characters,id,size,0x21AA,0xFE322,joinrelfactor,0x02192) -- \lhook\joinrel\rightarrow - jointwo (main,characters,id,size,0x27F5,0x02190,joinrelfactor,0x0002D) -- \leftarrow\joinrel\relbar - jointwo (main,characters,id,size,0x27F6,0x0002D,joinrelfactor,0x02192,2) -- \relbar\joinrel\rightarrow - jointwo (main,characters,id,size,0x27F7,0x02190,joinrelfactor,0x02192) -- \leftarrow\joinrel\rightarrow - jointwo (main,characters,id,size,0x27F8,0x021D0,joinrelfactor,0x0003D) -- \Leftarrow\joinrel\Relbar - jointwo (main,characters,id,size,0x27F9,0x0003D,joinrelfactor,0x021D2) -- \Relbar\joinrel\Rightarrow - jointwo (main,characters,id,size,0x27FA,0x021D0,joinrelfactor,0x021D2) -- \Leftarrow\joinrel\Rightarrow - -- jointhree(main,characters,id,size,0x27FB,0x02190,joinrelfactor,0x0002D,0,0xFE324) -- \leftarrow\joinrel\relbar\mapsfromchar - -- jointhree(main,characters,id,size,0x27FC,0xFE321,0,0x0002D,joinrelfactor,0x02192) -- \mapstochar\relbar\joinrel\rightarrow - - -- extension(main,characters,id,size,0x21A6,0xFF504,0xFF501,0xFF503) -- \mapstochar\rightarrow - -- extension(main,characters,id,size,0x21A9,0xFF502,0xFF501,0xFF506) -- \leftarrow\joinrel\rhook - -- extension(main,characters,id,size,0x21AA,0xFF505,0xFF501,0xFF503) -- \lhook\joinrel\rightarrow - -- extension(main,characters,id,size,0x27F5,0xFF502,0xFF501,0xFF501) -- \leftarrow\joinrel\relbar - -- extension(main,characters,id,size,0x27F6,0xFF501,0xFF501,0xFF503) -- \relbar\joinrel\rightarrow - -- extension(main,characters,id,size,0x27F7,0xFF502,0xFF501,0xFF503) -- \leftarrow\joinrel\rightarrow - -- extension(main,characters,id,size,0x27F8,0xFF508,0xFF50A,0xFF50A) -- \Leftarrow\joinrel\Relbar - -- extension(main,characters,id,size,0x27F9,0xFF50A,0xFF50A,0xFF509) -- \Relbar\joinrel\Rightarrow - -- extension(main,characters,id,size,0x27FA,0xFF508,0xFF50A,0xFF509) -- \Leftarrow\joinrel\Rightarrow - -- extension(main,characters,id,size,0x27FB,0xFF502,0xFF501,0xFF507) -- \leftarrow\joinrel\relbar\mapsfromchar - -- extension(main,characters,id,size,0x27FC,0xFF504,0xFF501,0xFF503) -- \mapstochar\relbar\joinrel\rightarrow - - -- extension(main,characters,id,size,0x219E,0xFF50B,0xFF501,0xFF501) -- \twoheadleftarrow\joinrel\relbar - -- extension(main,characters,id,size,0x21A0,0xFF501,0xFF501,0xFF50C) -- \relbar\joinrel\twoheadrightarrow - -- extension(main,characters,id,size,0x21C4,0xFF50D,0xFF50E,0xFF50F) -- leftoverright - - -- 21CB leftrightharpoon - -- 21CC rightleftharpoon - - stack(main,characters,id,size,0x2259,0x0003D,3,0x02227) -- \buildrel\wedge\over= - - jointwo(main,characters,id,size,0x22C8,0x022B3,joinrelfactor,0x022B2) -- \mathrel\triangleright\joinrel\mathrel\triangleleft (4 looks better than 3) - jointwo(main,characters,id,size,0x22A7,0x0007C,joinrelfactor,0x0003D) -- \mathrel|\joinrel= - jointwo(main,characters,id,size,0x2260,0x00338,0,0x0003D) -- \not\equal - jointwo(main,characters,id,size,0x2284,0x00338,false,0x02282) -- \not\subset - jointwo(main,characters,id,size,0x2285,0x00338,false,0x02283) -- \not\supset - jointwo(main,characters,id,size,0x2209,0x00338,false,0x02208) -- \not\in - jointwo(main,characters,id,size,0x2254,0x03A,0,0x03D) -- := (≔) - - repeated(main,characters,id,size,0x222B,0x222B,1,1/2) - repeated(main,characters,id,size,0x222C,0x222B,2,1/2) - repeated(main,characters,id,size,0x222D,0x222B,3,1/2) - - characters[0x02B9] = characters[0x2032] -- we're nice + vfmath.builders = { + horibar = horibar, + rootbar = rootbar, + parent = parent, + brace = brace, + dots = dots, + jointwo = jointwo, + overlaytwo = overlaytwo, + jointhree = jointhree, + stack = stack, + repeated = repeated, + } - data_of_smaller = main.fonts[id] - size_of_smaller = size + -- todo: move this to the lfg files end @@ -706,6 +731,7 @@ local function virtualize(s,uni,fci,skewchar,move,mathparameters,unicode,paramet depth = half - axis end -- + local next = fci.next return { advance = advance, width = width, @@ -797,7 +823,9 @@ function vfmath.define(specification,set,goodies) hasitalics = true, hasmath = true, } - local goodies = { } + if not goodies then + goodies = { } + end local main = { metadata = metadata, properties = properties, @@ -899,8 +927,8 @@ function vfmath.define(specification,set,goodies) mathparameters.sup3 = newparameters[15] or 0 -- sup3 : superscript shift-up in cramped styles mathparameters.sub1 = newparameters[16] or 0 -- sub1 : subscript shift-down if superscript is absent mathparameters.sub2 = newparameters[17] or 0 -- sub2 : subscript shift-down if superscript is present - mathparameters.sup_drop = newparameters[18] or 0 -- sup_drop : superscript baseline below top of large box - mathparameters.sub_drop = newparameters[19] or 0 -- sub_drop : subscript baseline below bottom of large box + mathparameters.supdrop = newparameters[18] or 0 -- supdrop : superscript baseline below top of large box + mathparameters.subdrop = newparameters[19] or 0 -- subdrop : subscript baseline below bottom of large box mathparameters.delim1 = newparameters[20] or 0 -- delim1 : size of \atopwithdelims delimiters in display styles mathparameters.delim2 = newparameters[21] or 0 -- delim2 : size of \atopwithdelims delimiters in non-displays mathparameters.axisheight = newparameters[22] or 0 -- axisheight : height of fraction lines above the baseline @@ -984,11 +1012,24 @@ function vfmath.define(specification,set,goodies) end end end +-- if ss.jmn then +-- local extension = mathencodings["extensible-jmn-private"] +-- for unicode, index in sortedhash(extension) do +-- if not characters[unicode] then +-- local uni = backmap and backmap[index] or index +-- local fci = fc[uni] +-- characters[unicode] = virtualize(s,uni,fci,skewchar,false,mathparameters,unicode,fp) +-- end +-- end +-- end if isextension then local extension = mathencodings["large-to-small"] for uni, fci in sortedhash(fc) do - if not done[uni] then - local t = virtualize(s,uni,fci,skewchar,tonumber(badones and badones[fci.name or ""]),mathparameters,nil,fp) + local name = fci.name or "" + if ignore and ignore[name] then + -- get rid of ugly antykwa bar + elseif not done[uni] then + local t = virtualize(s,uni,fci,skewchar,tonumber(badones and badones[name]),mathparameters,nil,fp) local o = addprivate(main,f_extra(offset)) extras[uni] = o characters[o] = t @@ -1011,7 +1052,7 @@ function vfmath.define(specification,set,goodies) end fci.keepvirtual = true fci.parts = p - fci.partsorientation = "vertical" + fci.partsorientation = "vertical" -- nasty as some are horizontal fci.partsitalic = fci.partsitalic or fci.italic end end @@ -1045,7 +1086,11 @@ function vfmath.define(specification,set,goodies) size = size, fontname = name, -- diagnostics } - vfmath.addmissing(main,#fontlist,size) + -- + local addmissing = goodies.mathematics.addmissing + if type(addmissing) == "function" then + addmissing(main) + end -- mathematics.addfallbacks(main) -- @@ -1057,6 +1102,22 @@ function vfmath.define(specification,set,goodies) main.MathConstants = main.mathconstants main.nomath = false -- + mathematics.tweaks.setoptions(main,main,{ + tweak = "setoptions", + set = { "ignorekerndimensions" } + }) -- we have dp > ht fences + -- + mathematics.tweaks.fixprimes(main, main, { + tweak = "fixprimes", + factor = 1, -- accent base height + fake = 0.9, -- replace multiples with this width proportion + }) + -- +-- mathematics.tweaks.addbars(main,main,{ +-- tweak = "addbars", +-- advance = 0.52, +-- }) + -- if trace_virtual or trace_timings then report_virtual("loading and virtualizing font %a at size %p took %0.3f seconds",name,size,os.clock()-start) end @@ -1086,3 +1147,145 @@ function vfmath.setdigits(font_encoding, name, digits) enc[digits+i] = i + 0x30 end end + +-- local function extension(main,characters,id,size,unicode,first,middle,last) +-- local chr = characters[unicode] +-- if not chr then +-- return -- skip +-- end +-- local fw = characters[first] +-- if not fw then +-- return +-- end +-- local mw = characters[middle] +-- if not mw then +-- return +-- end +-- local lw = characters[last] +-- if not lw then +-- return +-- end +-- fw = fw.width +-- mw = mw.width +-- lw = lw.width +-- if fw == 0 then +-- fw = 1 +-- end +-- if lw == 0 then +-- lw = 1 +-- end +-- chr.partsorientation = "horizontal" +-- chr.parts = { +-- { extender = 0, glyph = first, ["end"] = fw/2, start = 0, advance = fw }, +-- { extender = 1, glyph = middle, ["end"] = mw/2, start = mw/2, advance = mw }, +-- { extender = 0, glyph = last, ["end"] = 0, start = lw/2, advance = lw }, +-- } +-- end + +-- local step = 0.2 -- 0.1 is nicer but gives larger files + +-- local function clipped(main,characters,id,size,unicode,original) -- push/pop needed? +-- local minus = characters[original] +-- if minus then +-- local mu = size/18 +-- local step = 3*mu +-- local width = minus.width +-- if width > step then +-- width = width - step +-- step = step / 2 +-- else +-- width = width / 2 +-- step = width +-- end +-- characters[unicode] = { +-- width = width, +-- height = minus.height, +-- depth = minus.depth, +-- commands = { +-- push, +-- leftcommand[step], +-- slotcommand[0][original], +-- pop, +-- } +-- } +-- end +-- end + +-- local function vertbar(main,characters,id,size,parent,scale,unicode) +-- local cp = characters[parent] +-- if cp then +-- local sc = scale * size +-- local pc = slotcommand[0][parent] +-- characters[unicode] = { +-- width = cp.width, +-- height = cp.height + sc, +-- depth = cp.depth + sc, +-- next = cp.next, -- can be extensible +-- commands = { +-- push, upcommand [sc], pc, pop, +-- push, downcommand[sc], pc, pop, +-- pc, +-- }, +-- } +-- cp.next = unicode +-- end +-- end + +-- vertbar (main,characters,id,size,0x0007C,0.10,0xFF601) -- big : 0.85 bodyfontsize +-- vertbar (main,characters,id,size,0xFF601,0.30,0xFF602) -- Big : 1.15 bodyfontsize +-- vertbar (main,characters,id,size,0xFF602,0.30,0xFF603) -- bigg : 1.45 bodyfontsize +-- vertbar (main,characters,id,size,0xFF603,0.30,0xFF604) -- Bigg : 1.75 bodyfontsize +-- vertbar (main,characters,id,size,0x02016,0.10,0xFF605) +-- vertbar (main,characters,id,size,0xFF605,0.30,0xFF606) +-- vertbar (main,characters,id,size,0xFF606,0.30,0xFF607) +-- vertbar (main,characters,id,size,0xFF607,0.30,0xFF608) + +-- clipped (main,characters,id,size,0xFF501,0x0002D) -- minus +-- clipped (main,characters,id,size,0xFF502,0x02190) -- lefthead +-- clipped (main,characters,id,size,0xFF503,0x02192) -- righthead +-- clipped (main,characters,id,size,0xFF504,ps("maps to piece") -- mapsto +-- clipped (main,characters,id,size,0xFF505,0xFE322) -- lhook +-- clipped (main,characters,id,size,0xFF506,0xFE323) -- rhook +-- clipped (main,characters,id,size,0xFF507,0xFE324) -- mapsfrom +-- clipped (main,characters,id,size,0xFF508,0x021D0) -- double lefthead +-- clipped (main,characters,id,size,0xFF509,0x021D2) -- double righthead +-- clipped (main,characters,id,size,0xFF50A,0x0003D) -- equal +-- clipped (main,characters,id,size,0xFF50B,0x0219E) -- lefttwohead +-- clipped (main,characters,id,size,0xFF50C,0x021A0) -- righttwohead +-- clipped (main,characters,id,size,0xFF50D,0xFF350) -- lr arrow combi snippet +-- clipped (main,characters,id,size,0xFF50E,0xFF351) -- lr arrow combi snippet +-- clipped (main,characters,id,size,0xFF50F,0xFF352) -- lr arrow combi snippet +-- clipped (main,characters,id,size,0xFF510,0x02261) -- equiv + +-- extension(main,characters,id,size,0x2190,0xFF502,0xFF501,0xFF501) -- \leftarrow +-- extension(main,characters,id,size,0x2192,0xFF501,0xFF501,0xFF503) -- \rightarrow + +-- extension(main,characters,id,size,0x002D,0xFF501,0xFF501,0xFF501) -- \rel +-- extension(main,characters,id,size,0x003D,0xFF50A,0xFF50A,0xFF50A) -- \equal +-- extension(main,characters,id,size,0x2261,0xFF510,0xFF510,0xFF510) -- \equiv + +-- local lh = ps("left hook piece")] -- was FE322 +-- local rh = ps("right hook piece")] -- was FE323 + +-- jointwo (main,characters,id,size,0x21A6,ps("maps to piece"),0,0x02192) -- \mapstochar\rightarrow +-- jointwo (main,characters,id,size,0x21A9,0x02190,joinrelfactor,0xFE323) -- \leftarrow\joinrel\rhook +-- jointwo (main,characters,id,size,0x21AA,0xFE322,joinrelfactor,0x02192) -- \lhook\joinrel\rightarrow +-- jointhree(main,characters,id,size,0x27FB,0x02190,joinrelfactor,0x0002D,0,0xFE324) -- \leftarrow\joinrel\relbar\mapsfromchar + +-- jointhree(main,characters,id,size,0x27FC,ps("maps to piece"),0,0x0002D,joinrelfactor,0x02192) -- \mapstochar\relbar\joinrel\rightarrow + +-- extension(main,characters,id,size,0x21A6,0xFF504,0xFF501,0xFF503) -- \mapstochar\rightarrow +-- extension(main,characters,id,size,0x21A9,0xFF502,0xFF501,0xFF506) -- \leftarrow\joinrel\rhook +-- extension(main,characters,id,size,0x21AA,0xFF505,0xFF501,0xFF503) -- \lhook\joinrel\rightarrow +-- extension(main,characters,id,size,0x27F5,0xFF502,0xFF501,0xFF501) -- \leftarrow\joinrel\relbar +-- extension(main,characters,id,size,0x27F6,0xFF501,0xFF501,0xFF503) -- \relbar\joinrel\rightarrow +-- extension(main,characters,id,size,0x27F7,0xFF502,0xFF501,0xFF503) -- \leftarrow\joinrel\rightarrow +-- extension(main,characters,id,size,0x27F8,0xFF508,0xFF50A,0xFF50A) -- \Leftarrow\joinrel\Relbar +-- extension(main,characters,id,size,0x27F9,0xFF50A,0xFF50A,0xFF509) -- \Relbar\joinrel\Rightarrow +-- extension(main,characters,id,size,0x27FA,0xFF508,0xFF50A,0xFF509) -- \Leftarrow\joinrel\Rightarrow +-- extension(main,characters,id,size,0x27FB,0xFF502,0xFF501,0xFF507) -- \leftarrow\joinrel\relbar\mapsfromchar +-- extension(main,characters,id,size,0x27FC,0xFF504,0xFF501,0xFF503) -- \mapstochar\relbar\joinrel\rightarrow + +-- extension(main,characters,id,size,0x219E,0xFF50B,0xFF501,0xFF501) -- \twoheadleftarrow\joinrel\relbar +-- extension(main,characters,id,size,0x21A0,0xFF501,0xFF501,0xFF50C) -- \relbar\joinrel\twoheadrightarrow +-- extension(main,characters,id,size,0x21C4,0xFF50D,0xFF50E,0xFF50F) -- leftoverright diff --git a/tex/context/base/mkxl/pack-ori.lmt b/tex/context/base/mkxl/pack-ori.lmt index a786b19ef..81e8776b9 100644 --- a/tex/context/base/mkxl/pack-ori.lmt +++ b/tex/context/base/mkxl/pack-ori.lmt @@ -30,8 +30,8 @@ local horizontal = { [variables.middle] = 0x000, [variables.flushleft] = 0x100, [variables.flushright] = 0x200, - [variables.left] = 0x300, - [variables.right] = 0x400, + [variables.left] = 0x300, -- why not 0x100 + [variables.right] = 0x400, -- why not 0x200 } implement { diff --git a/tex/context/base/mkxl/strc-lst.lmt b/tex/context/base/mkxl/strc-lst.lmt index 703e580d7..359fbd6b6 100644 --- a/tex/context/base/mkxl/strc-lst.lmt +++ b/tex/context/base/mkxl/strc-lst.lmt @@ -873,17 +873,17 @@ end filters[v_product] = function(specification) local reference = specification.reference if reference and reference ~= "" then - -- local utilitydata = job.loadother(reference,true) - local fullname = file.replacesuffix(reference,"tuc") - if lfs.isfile(fullname) then - local utilitydata = job.loadother(fullname) + local utilitydata = job.loadother(reference,true) +-- local fullname = file.replacesuffix(reference,"tuc") +-- if lfs.isfile(fullname) then +-- local utilitydata = job.loadother(fullname) if utilitydata then local collected = utilitydata.structures.lists.collected or { } - setmetatableindex(collected,{ external = reference }) local result = { } local nofresult = 0 local all = specification.all local names = specification.names +setmetatableindex(result,{ external = reference }) -- brr for i=1,#collected do local v = collected[i] local m = v.metadata @@ -893,7 +893,7 @@ filters[v_product] = function(specification) end end return result - end +-- end end end return { } diff --git a/tex/context/base/mkxl/strc-mat.mkxl b/tex/context/base/mkxl/strc-mat.mkxl index 86e77e63c..bcbe4a6f8 100644 --- a/tex/context/base/mkxl/strc-mat.mkxl +++ b/tex/context/base/mkxl/strc-mat.mkxl @@ -1326,6 +1326,11 @@ \lastnamedcs\else\begincsname\??mathtextalign\v!middle:\v!auto\endcsname \fi} +\letcsname\??mathtextalign\v!right \expandafter\endcsname\csname\??mathtextalign\v!flushleft \endcsname +\letcsname\??mathtextalign\v!left \expandafter\endcsname\csname\??mathtextalign\v!flushright \endcsname +\letcsname\??mathtextalign\v!right:\v!auto\expandafter\endcsname\csname\??mathtextalign\v!flushleft :\v!auto\endcsname +\letcsname\??mathtextalign\v!left :\v!auto\expandafter\endcsname\csname\??mathtextalign\v!flushright:\v!auto\endcsname + \startsetups[math:penalties:\v!text] \interlinepenalty \plustenthousand \shapingpenalty \plustenthousand diff --git a/tex/context/base/mkxl/strc-ref.lmt b/tex/context/base/mkxl/strc-ref.lmt index 238201336..b97a1619b 100644 --- a/tex/context/base/mkxl/strc-ref.lmt +++ b/tex/context/base/mkxl/strc-ref.lmt @@ -494,7 +494,7 @@ implement { -- no metatable here .. better be sparse -local function register_from_lists(collected,derived,pages,sections) +local function register_from_list(collected,derived,pages,sections) local derived_g = derived[""] -- global local derived_p = nil local derived_c = nil @@ -556,7 +556,11 @@ local function register_from_lists(collected,derived,pages,sections) end end -references.registerinitializer(function() register_from_lists(lists.collected,derived) end) +references.registerfromlist = function(collected,pages,sections) + register_from_list(collected,derived,pages,sections) +end + +references.registerinitializer(function() register_from_list(lists.collected,derived) end) -- tracing @@ -1025,13 +1029,26 @@ local function loadexternalreferences(name,utilitydata) report_importing("registering %a reference, kind %a, name %a, prefix %a, reference %a", "external","regular",name,prefix,reference) end - local section = reference.section - local realpage = reference.realpage - if section then - reference.sectiondata = lists[section] - end - if realpage then - reference.pagedata = pages[realpage] + -- weird code + -- local section = reference.section + -- local realpage = reference.realpage + -- if section then + -- reference.sectiondata = lists[section] + -- end + -- if realpage then + -- reference.pagedata = pages[realpage] + -- end + -- better? + local references = data.references -- hm. plural + if references then + local section = references.section + local realpage = references.realpage + if not references.sectiondata then + references.sectiondata = sections[references.section or false] + end + if not references.pagedata then + references.pagedata = pages[references.realpage or false] + end end end end @@ -1046,20 +1063,18 @@ local function loadexternalreferences(name,utilitydata) local kind = metadata.kind local realpage = references.realpage if kind and realpage then - references.pagedata = pages[realpage] + -- quite likely already done so this might go + if pages and not references.pagedata then + references.pagedata = pages[references.realpage or false] + end + if sections and not references.sectiondata then + references.sectiondata = sections[references.section or false] + end + -- local prefix = references.prefix or "" if prefix == "" then prefix = name -- this can clash! end - local section = references.section - if section then - -- we have to make sure that the right section is used, see helpers.prefix - if sections then - references.sectiondata = sections[section] - else - -- warning - end - end local target = external[prefix] if not target then target = { } @@ -1127,8 +1142,9 @@ local function loadproductreferences(productname,componentname,utilitydata) local struc = utilitydata.structures if struc then local productreferences = struc.references.collected -- direct references - local lists = struc.lists.collected -- indirect references (derived) - local pages = struc.pages.collected -- pagenumber data + local lists = struc.lists.collected -- indirect references (derived) + local pages = struc.pages.collected -- pagenumber data + local sections = struc.sections.collected -- section number data -- we use indirect tables to save room but as they are eventually -- just references we resolve them to data here (the mechanisms -- that use this data check for indirectness) @@ -1138,13 +1154,11 @@ local function loadproductreferences(productname,componentname,utilitydata) report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a", "product","regular",productname,prefix,reference) end - local section = reference.section - local realpage = reference.realpage - if section then - reference.sectiondata = lists[section] + if not reference.sectiondata then + reference.sectiondata = sections[reference.section or false] end - if realpage then - reference.pagedata = pages[realpage] + if not reference.pagedata then + reference.pagedata = pages[reference.realpage or false] end end end @@ -1160,7 +1174,6 @@ local function loadproductreferences(productname,componentname,utilitydata) local kind = metadata.kind local realpage = references.realpage if kind and realpage then - references.pagedata = pages[realpage] local prefix = references.prefix or "" local component = references.component local ctarget, ptarget diff --git a/tex/context/base/mkxl/strc-reg.lmt b/tex/context/base/mkxl/strc-reg.lmt index 85198a151..a3a7dae6c 100644 --- a/tex/context/base/mkxl/strc-reg.lmt +++ b/tex/context/base/mkxl/strc-reg.lmt @@ -1403,7 +1403,9 @@ function registers.flush(data,options,prefixspec,pagespec) if nofpages > 0 then -- or 0 d = dd for p=1,nofpages do - local first, last = pages[p][1], pages[p][2] + local page = pages[p] + local first = page[1] + local last = page[2] if first == last then if first.references.lastrealpage then pagerange(first,first,true,prefixspec,pagespec) diff --git a/tex/context/base/mkxl/tabl-ntb.mkxl b/tex/context/base/mkxl/tabl-ntb.mkxl index 049dff58c..6eb926b09 100644 --- a/tex/context/base/mkxl/tabl-ntb.mkxl +++ b/tex/context/base/mkxl/tabl-ntb.mkxl @@ -331,13 +331,13 @@ \letcsname\??naturaltablesqueeze\v!local\endcsname\donetrue \def\tabl_ntb_let_gal{\gletcsname\??naturaltablegal\m_tabl_tbl_level\endcsname} -\def\tabl_ntb_get_gal{\csname\??naturaltablegal\m_tabl_tbl_level\endcsname} +\def\tabl_ntb_get_gal{\csname \??naturaltablegal\m_tabl_tbl_level\endcsname} \def\tabl_ntb_let_tal#1{\gletcsname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname} -\def\tabl_ntb_get_tal#1{\csname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname} +\def\tabl_ntb_get_tal#1{\csname \??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname} \def\tabl_ntb_set_nob#1{\letcsname\??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone} -\def\tabl_ntb_get_nob#1{\ifcsname\??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone\else\zerocount\fi} +\def\tabl_ntb_get_nob#1{\ifcsname \??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone\else\zerocount\fi} %def\tabl_ntb_set_tag#1#2{\expandafter\integerdef\csname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname} \def\tabl_ntb_set_col#1#2{\expandafter\integerdef\csname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname} @@ -733,9 +733,23 @@ % \bTR \bTD left \eTD\bTD right \eTD\eTR % \eTABLE +% plugin + +\let\tabl_ntb_section_mark \relax +\let\tabl_ntb_section_checkup\relax +\let\tabl_ntb_section_split \relax +\let\tabl_ntb_section_install\relax +\let\tabl_ntb_section_setup \relax +\let\tabl_ntb_section_wrapup \relax + +% till here + \tolerant\protected\def\tabl_ntb_tr[#1]% {\c_tabl_ntb_running_col\zerocount \c_tabl_ntb_encountered_col\zerocount + % + \tabl_ntb_section_mark + % \advanceby\c_tabl_ntb_maximum_row\plusone \ifparameter#1\or \expandafter\tabl_ntb_tr_yes @@ -1009,6 +1023,7 @@ \setupcurrentnaturaltablelocal[\c!align={\v!right,\v!broad,\v!high},#1]% % \tabl_ntb_anchor_setup + \tabl_ntb_section_setup % \d_tabl_ntb_leftmargindistance \naturaltablelocalparameter\c!leftmargindistance\relax \d_tabl_ntb_rightmargindistance\naturaltablelocalparameter\c!rightmargindistance\relax @@ -1052,6 +1067,7 @@ \let\currentTABLEcolumn\tabl_ntb_current_column \let\nofTABLErows \tabl_ntb_n_of_rows \let\nofTABLEcolumns \tabl_ntb_n_of_columns + % \enforced\let\bTR\tabl_ntb_bTR \enforced\let\bTD\tabl_ntb_bTD \enforced\let\bTH\tabl_ntb_bTH @@ -1133,6 +1149,7 @@ % \vskip-\strutdp % \fi \fi + \tabl_ntb_section_wrapup % tracing % \iftrue % \blank \tttf @@ -1375,6 +1392,7 @@ \ifconditional\c_strc_tags_enabled \tabl_ntb_start_tagged \fi + \tabl_ntb_section_checkup \hbox\bgroup \kern\dimexpr\d_tabl_ntb_leftmargindistance\relax} @@ -1798,6 +1816,7 @@ \t_split_after{\m_tabl_ntb_after_split}% \t_split_before{\m_tabl_ntb_before_split}% not used (yet) \setbox\b_split_content\vbox{\tabl_ntb_flush_content}% + \tabl_ntb_section_install % we need content to be set \ifmultipleTBLheads \localcontrolledloop\plusone\c_tabl_ntb_n_of_head_lines\plusone {\setbox\scratchbox\vsplit\b_split_content to \lineheight diff --git a/tex/context/base/mkxl/tabl-tsp.mkxl b/tex/context/base/mkxl/tabl-tsp.mkxl index 160357a06..6facbfcae 100644 --- a/tex/context/base/mkxl/tabl-tsp.mkxl +++ b/tex/context/base/mkxl/tabl-tsp.mkxl @@ -217,6 +217,7 @@ \newtoks \t_split_before \newtoks \t_split_inbetween \newtoks \t_split_after +\newtoks \t_split_section \newtoks \everyresettsplit \newinteger \c_split_minimum_free_lines @@ -246,6 +247,7 @@ \t_split_inbetween \emptytoks \t_split_before \emptytoks \t_split_after \emptytoks + \t_split_section \emptytoks \let\postprocesstsplit \donothing \to \everyresettsplit @@ -301,6 +303,7 @@ \setbox\b_split_result\vbox {\ifdim\ht\b_split_head>\zeropoint \unvcopy\b_split_head + \the\t_split_section \the\t_split_inbetween \fi}% \ifconditional\c_tabl_split_done \else |