diff options
Diffstat (limited to 'tex/context/base/mkxl')
-rw-r--r-- | tex/context/base/mkxl/cont-new.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/context.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/font-lib.mklx | 6 | ||||
-rw-r--r-- | tex/context/base/mkxl/font-ots.lmt | 31 | ||||
-rw-r--r-- | tex/context/base/mkxl/font-txt.lmt | 1 | ||||
-rw-r--r-- | tex/context/base/mkxl/lang-def.mkxl | 43 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-dim.lmt | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-frc.lmt | 75 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-frc.mkxl | 269 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-ini.mkxl | 200 | ||||
-rw-r--r-- | tex/context/base/mkxl/math-noa.lmt | 70 | ||||
-rw-r--r-- | tex/context/base/mkxl/mult-sys.mkxl | 7 | ||||
-rw-r--r-- | tex/context/base/mkxl/node-ini.lmt | 20 | ||||
-rw-r--r-- | tex/context/base/mkxl/norm-ctx.mkxl | 173 | ||||
-rw-r--r-- | tex/context/base/mkxl/page-mix.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkxl/spac-hor.mkxl | 4 | ||||
-rw-r--r-- | tex/context/base/mkxl/strc-con.mklx | 18 | ||||
-rw-r--r-- | tex/context/base/mkxl/strc-enu.mklx | 14 | ||||
-rw-r--r-- | tex/context/base/mkxl/strc-itm.mklx | 11 | ||||
-rw-r--r-- | tex/context/base/mkxl/typo-syn.lmt | 3 |
20 files changed, 547 insertions, 406 deletions
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index e73df27b9..6e8f45f6d 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.01.10 08:33} +\newcontextversion{2022.01.15 11: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 dc5d14244..9cd838a16 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.01.10 08:33} +\immutable\edef\contextversion{2022.01.15 11:02} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/font-lib.mklx b/tex/context/base/mkxl/font-lib.mklx index 2f20214e7..c5543a107 100644 --- a/tex/context/base/mkxl/font-lib.mklx +++ b/tex/context/base/mkxl/font-lib.mklx @@ -49,7 +49,11 @@ \registerctxluafile{font-otd}{autosuffix,optimize} \registerctxluafile{font-otc}{} \registerctxluafile{font-oth}{} -\registerctxluafile{font-osd}{} +% \doifelsefileexists{font-osd-new.lmt}{ +% \registerctxluafile{font-osd-new}{autosuffix} +% } { + \registerctxluafile{font-osd}{} +% } %registerctxluafile{font-osm}{} \registerctxluafile{font-ogr}{autosuffix} diff --git a/tex/context/base/mkxl/font-ots.lmt b/tex/context/base/mkxl/font-ots.lmt index eda63cee5..c668c86d1 100644 --- a/tex/context/base/mkxl/font-ots.lmt +++ b/tex/context/base/mkxl/font-ots.lmt @@ -3236,7 +3236,8 @@ local function kernrun(disc,k_run,...) if done and trace_testruns then report_disc("done",disc) end - return nextstart, done +-- return nextstart, done + return nextstart end -- fonts like ebgaramond do ligatures this way (less efficient than e.g. dejavu which @@ -3289,7 +3290,8 @@ local function comprun(disc,c_run,...) -- vararg faster than the whole list setdisc(disc,pre,post,replace) end -- - return getnext(disc), renewed +-- return getnext(disc), renewed + return getnext(disc) end -- if we can hyphenate in a lig then unlikely a lig so we @@ -3417,7 +3419,8 @@ local function testrun(disc,t_run,c_run,...) end end -- next can have changed (copied list) - return getnext(disc), renewed +-- return getnext(disc), renewed + return getnext(disc) end -- 1{2{\oldstyle\discretionary{3}{4}{5}}6}7\par @@ -3960,13 +3963,16 @@ do start = nxt elseif id == disc_code then if not discs or discs[start] == true then - local ok +-- local ok if gpossing then - start, ok = kernrun(start,k_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler) +-- start, ok = kernrun(start,k_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler) + start = kernrun(start,k_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler) elseif forcetestrun then - start, ok = testrun(start,t_run_single,c_run_single,lookupcache,step,dataset,sequence,rlmode,skiphash,handler) +-- start, ok = testrun(start,t_run_single,c_run_single,lookupcache,step,dataset,sequence,rlmode,skiphash,handler) + start = testrun(start,t_run_single,c_run_single,lookupcache,step,dataset,sequence,rlmode,skiphash,handler) else - start, ok = comprun(start,c_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler) +-- start, ok = comprun(start,c_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler) + start = comprun(start,c_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler) end -- if ok then -- done = true @@ -4030,13 +4036,16 @@ do start = nxt elseif id == disc_code then if not discs or discs[start] == true then - local ok +-- local ok if gpossing then - start, ok = kernrun(start,k_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) +-- start, ok = kernrun(start,k_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) + start = kernrun(start,k_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) elseif forcetestrun then - start, ok = testrun(start,t_run_multiple,c_run_multiple,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) +-- start, ok = testrun(start,t_run_multiple,c_run_multiple,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) + start = testrun(start,t_run_multiple,c_run_multiple,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) else - start, ok = comprun(start,c_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) +-- start, ok = comprun(start,c_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) + start = comprun(start,c_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler) end else start = nxt diff --git a/tex/context/base/mkxl/font-txt.lmt b/tex/context/base/mkxl/font-txt.lmt index 29d3ca240..aae69ddd3 100644 --- a/tex/context/base/mkxl/font-txt.lmt +++ b/tex/context/base/mkxl/font-txt.lmt @@ -101,7 +101,6 @@ local getkern = nuts.getkern local getwidth = nuts.getwidth local ischar = nuts.ischar -local isnextchar = nuts.isnextchar local isglyph = nuts.isglyph local usesfont = nuts.usesfont diff --git a/tex/context/base/mkxl/lang-def.mkxl b/tex/context/base/mkxl/lang-def.mkxl index 441d328c8..e50be9afc 100644 --- a/tex/context/base/mkxl/lang-def.mkxl +++ b/tex/context/base/mkxl/lang-def.mkxl @@ -826,7 +826,31 @@ \installlanguage [\s!thai] [\s!th] -%D Malayalam (needs to be checked) +%D Indic languages (KauĊika) +% +% +%D Sanskit (someone needs to define the parameters): +%D +%D The file \type {lang-sa.lua} contains sanskrit hyphenation patterns for devanagari, +%D bengali, telugu, kannada, malayalam and roman(iast. + +\installlanguage + [\s!sa] + [\c!spacing=\v!broad, + \c!leftsentence=\endash, + \c!rightsentence=\endash, + \c!leftsubsentence=\emdash, + \c!rightsubsentence=\emdash, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!month,\space,\v!day,{,\space},\v!year}, + \s!patterns=\s!sa, + \s!lefthyphenmin=1, + \s!righthyphenmin=1] + +%D Malayalam needs some fine-tuning \installlanguage [\s!ml] @@ -844,7 +868,22 @@ \s!lefthyphenmin=2, \s!righthyphenmin=3] -\installlanguage [\s!malayalam] [\s!ml] +\installlanguage [\s!ml][\c!default=\s!sa,\s!patterns=\s!ml] +\installlanguage [\s!ta][\c!default=\s!sa,\s!patterns=ta] +\installlanguage [\s!kn][\c!default=\s!sa,\s!patterns=kn] +\installlanguage [\s!te][\c!default=\s!sa,\s!patterns=te] +\installlanguage [\s!gu][\c!default=\s!sa,\s!patterns=gu] +\installlanguage [\s!bn][\c!default=\s!sa,\s!patterns=bn] +\installlanguage [\s!hi][\c!default=\s!sa,\s!patterns=hi] + +\installlanguage [\s!tamil] [\s!ta] +\installlanguage [\s!kannada] [\s!kn] +\installlanguage [\s!telugu] [\s!te] +\installlanguage [\s!gujarati] [\s!gu] +\installlanguage [\s!hindi] [\s!hi] +\installlanguage [\s!bengali] [\s!bn] +\installlanguage [\s!sanskrit] [\s!sa] +\installlanguage [\s!malayalam][\s!ml] %D Todo: generate this one from languages.data diff --git a/tex/context/base/mkxl/math-dim.lmt b/tex/context/base/mkxl/math-dim.lmt index 1bf2420bf..3b88b0b0b 100644 --- a/tex/context/base/mkxl/math-dim.lmt +++ b/tex/context/base/mkxl/math-dim.lmt @@ -154,7 +154,7 @@ function mathematics.dimensions(dimens) -- beware, dimens get spoiled dimens["abs(mathxheight)/4"] = abs(mathxheight) / 4 dimens["abs(mathxheight*4)/5"] = abs(mathxheight * 4) / 5 dimens["<not set>"] = false - dimens["script_space"] = false -- at macro level + dimens["scriptspace"] = false -- at macro level for variable, styles in next, defaults do local tt = { } for style, default in next, styles do diff --git a/tex/context/base/mkxl/math-frc.lmt b/tex/context/base/mkxl/math-frc.lmt index 488c95056..0bc0e3895 100644 --- a/tex/context/base/mkxl/math-frc.lmt +++ b/tex/context/base/mkxl/math-frc.lmt @@ -26,60 +26,53 @@ table.setmetatableindex(resolved, function(t,k) return v end) -local ctx_normalatop = context.normalatop -local ctx_normalover = context.normalover - -local function mathfraction(how,left,right,width) - if how == v_no then - if left == 0x002E and right == 0x002E then - ctx_normalatop() - else - context("\\atopwithdelims%s%s",resolved[left],resolved[right]) - end - elseif how == v_yes or how == v_hidden then - local norule = how == v_hidden and " norule " or "" - if left == 0x002E and right == 0x002E then - context("\\normalabove%s%s%ssp",norule,width) - else - context("\\abovewithdelims%s%s%s%s%ssp",norule,resolved[left],resolved[right],width) - end - else -- v_auto - if left == 0x002E and right == 0x002E then - ctx_normalover() - else - context("\\overwithdelims%s%s",resolved[left],resolved[right]) - end - end -end - -interfaces.implement { - name = "mathfraction", - actions = mathfraction, - arguments = { "string", "number", "number", "dimen" } -} - local ctx_Uatop = context.Uatop local ctx_Uover = context.Uover -local function umathfraction(how,left,right,width) +local function umathfraction(how,style,left,right,width) + style = tonumber(style) -- or nil if how == v_no then if left == 0x002E and right == 0x002E then - ctx_Uatop() + if style then + context("\\Uatop style %i",style) + else + ctx_Uatop() + end else - context("\\Uatopwithdelims%s%s",resolved[left],resolved[right]) + if style then + context("\\Uatopwithdelims style %i %s%s",style,resolved[left],resolved[right]) + else + context("\\Uatopwithdelims%s%s",resolved[left],resolved[right]) + end end elseif how == v_yes or how == v_hidden then local norule = how == v_hidden and " norule " or "" - if left == 0x002E and right == 0x002E then - context("\\Uabove%s%ssp",norule,width) + if style then + if left == 0x002E and right == 0x002E then + context("\\Uabove style %i %s%ssp",style,norule,width) + else + context("\\Uabovewithdelims style %i %s%s%s%ssp",style,norule,resolved[left],resolved[right],width) + end else - context("\\Uabovewithdelims%s%s%s%ssp",norule,resolved[left],resolved[right],width) + if left == 0x002E and right == 0x002E then + context("\\Uabove%s%ssp",norule,width) + else + context("\\Uabovewithdelims%s%s%s%ssp",norule,resolved[left],resolved[right],width) + end end else -- v_auto if left == 0x002E and right == 0x002E then - ctx_Uover() + if style then + context("\\Uover style %i",style) + else + ctx_Uover() + end else - context("\\Uoverwithdelims%s%s",resolved[left],resolved[right]) + if style then + context("\\Uoverwithdelims style %i %s%s",style,resolved[left],resolved[right]) + else + context("\\Uoverwithdelims%s%s",resolved[left],resolved[right]) + end end end end @@ -87,5 +80,5 @@ end interfaces.implement { name = "umathfraction", actions = umathfraction, - arguments = { "string", "number", "number", "dimen" } + arguments = { "string", "string", "number", "number", "dimen" } } diff --git a/tex/context/base/mkxl/math-frc.mkxl b/tex/context/base/mkxl/math-frc.mkxl index 8d47e2883..c7165187c 100644 --- a/tex/context/base/mkxl/math-frc.mkxl +++ b/tex/context/base/mkxl/math-frc.mkxl @@ -21,8 +21,8 @@ \permanent\protected\def\topstrut{\vrule\s!width\zeropoint\s!height\strutht\s!depth\zeropoint\relax} \permanent\protected\def\botstrut{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp\relax} -\permanent\protected\def\mathtopstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\ht\scratchbox\s!depth\zeropoint\relax} -\permanent\protected\def\mathbotstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\dp\scratchbox\relax} +% \permanent\protected\def\mathtopstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\ht\scratchbox\s!depth\zeropoint\relax} +% \permanent\protected\def\mathbotstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\dp\scratchbox\relax} %D This module is reimplemented in \MKIV\ style. @@ -184,15 +184,30 @@ \letcsname\??mathfractionstrut\v!no\endcsname\math_frac_no_strut \defcsname\??mathfractionstrut\v!tight\endcsname - {\enforced\let\m_fractions_strut_top\mathbotstrut % indeed swapped name - \enforced\let\m_fractions_strut_bot\mathtopstrut} % indeed swapped name + {\enforced\let\m_fractions_strut_top\mathdepthstrut + \enforced\let\m_fractions_strut_bot\mathheightstrut} \math_frac_no_strut \newdimen\d_math_fraction_margin +\def\math_fraction_margin_kern_indeed{\kern\d_math_fraction_margin} + +\let\math_fraction_margin_kern\relax + +%D Because the fraction nodes uses the superscript and subscript for numerator and +%D denomerator so we wrap in a \type {\mathfrac}. Because with \type {\over} one +%D normally wraps the lot it goes unnoticed there. +%D +%D \starttyping +%D $\Uover{2}{3} ^4$ % double script error but no longer because we use the prescripts +%D ${\over{2}{3}}^4$ % no issue anyway because we wrap in {} (goes unnoticed) +%D $\frac {2}{3} ^4$ % we wrap in \mathfrac so we can also use prescripts +%D \stoptyping + \protected\def\math_frac#1% - {\begingroup + %{\begingroup + {\mathfrac\bgroup \edef\currentmathfraction{#1}% % \edef\p_math_fraction_fences{\mathfractionparameter\c!fences}% @@ -200,7 +215,12 @@ \math_fenced_fenced_start\p_math_fraction_fences \fi % - \d_math_fraction_margin\mathfractionparameter\c!margin + \d_math_fraction_margin\mathfractionparameter\c!margin\relax + \ifcase\d_math_fraction_margin + \let\math_fraction_margin_kern\relax + \else + \let\math_fraction_margin_kern\math_fraction_margin_kern_indeed + \fi % \edef\p_math_fractions_color{\mathfractionparameter\c!color}% % @@ -221,7 +241,8 @@ {\ifempty\p_math_fraction_fences \else \math_fenced_fenced_stop\p_math_fraction_fences \fi - \endgroup} + % \endgroup} + \egroup} \protected\def\math_frac_colored#1#2% {\savecolor @@ -235,128 +256,20 @@ \def\math_frac_no_delim{0x2E} -\def\math_frac_command - {\clf_mathfraction - {\mathfractionparameter\c!rule}% - \ifempty\p_math_fraction_fences - \mathfractionparameter\c!left \space - \mathfractionparameter\c!right\space - \else - \math_frac_no_delim\space - \math_frac_no_delim\space - \fi - \dimexpr\mathfractionparameter\c!rulethickness\relax - \relax} - % Having a \withmarginornot{#1}{#2} makes not much sense nor do 4 tests or 4 redundant % kerns (longer node lists plus possible interference). A split in normal and margin % also makes testing easier. When left and right margins are needed we might merge the % variants again. After all, these are not real installers. - -% the denominator is in cramped! - -\defcsname\??mathfractionalternative\v!inner\endcsname - {\ifcase\d_math_fraction_margin - \expandafter\math_fraction_inner_normal - \else - \expandafter\math_fraction_inner_margin - \fi} - -\defcsname\??mathfractionalternative\v!outer\endcsname - {\ifcase\d_math_fraction_margin - \expandafter\math_fraction_outer_normal - \else - \expandafter\math_fraction_outer_margin - \fi} - -\defcsname\??mathfractionalternative\v!both\endcsname - {\ifcase\d_math_fraction_margin - \expandafter\math_fraction_both_normal - \else - \expandafter\math_fraction_both_margin - \fi} - -% todo: store first state and reuse second time - -% \def\math_fraction_inner_normal#1#2% -% {\Ustack{% -% {% -% {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}}% -% \math_frac_command -% {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}}% -% }% -% }% -% \math_frac_wrapup} -% -% \def\math_fraction_outer_normal#1#2% -% {\Ustack{% -% \usemathstyleparameter\mathfractionparameter -% {% -% {\m_fractions_strut_top#1}% -% \math_frac_command -% {\m_fractions_strut_bot#2}% -% }% -% }% -% \math_frac_wrapup} -% -% \def\math_fraction_both_normal#1#2% -% {\Ustack{% -% \usemathstyleparameter\mathfractionparameter -% {% -% {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1}% -% \math_frac_command -% {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2}% -% }% -% }% -% \math_frac_wrapup} % -% \def n_inner_margin#1#2% -% {\Ustack{% -% {% -% {\kern\d_math_fraction_margin -% \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}% -% \kern\d_math_fraction_margin}% -% \math_frac_command -% {\kern\d_math_fraction_margin -% \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}% -% \kern\d_math_fraction_margin}% -% }% -% }% -% \math_frac_wrapup} +% The denominator is normally in cramped mode! % -% \def\math_fraction_outer_margin#1#2% -% {\Ustack{% -% \usemathstyleparameter\mathfractionparameter -% {% -% {\kern\d_math_fraction_margin -% \m_fractions_strut_top#1% -% \kern\d_math_fraction_margin}% -% \math_frac_command -% {\kern\d_math_fraction_margin -% \m_fractions_strut_bot#2% -% \kern\d_math_fraction_margin}% -% }% -% }% -% \math_frac_wrapup} -% -% \def\math_fraction_both_margin#1#2% -% {\Ustack{% -% \usemathstyleparameter\mathfractionparameter -% {% -% {\kern\d_math_fraction_margin -% \usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1% -% \kern\d_math_fraction_margin}% -% \math_frac_command -% {\kern\d_math_fraction_margin -% \usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2% -% \kern\d_math_fraction_margin}% -% }% -% }% -% \math_frac_wrapup} - -\def\math_frac_command_u +% See \MKIV\ for the old (more messy) implementation where we have to fight the over +% related syntax (we now use a lmtx primitive). + +\def\math_frac_command_u#1% {\clf_umathfraction {\mathfractionparameter\c!rule}% + {\ifcstok{#1}\emptytoks\else\tomathstyle#1\fi}% \ifempty\p_math_fraction_fences \mathfractionparameter\c!left \space \mathfractionparameter\c!right\space @@ -367,75 +280,51 @@ \dimexpr\mathfractionparameter\c!rulethickness\relax \relax} -\def\math_fraction_inner_normal#1#2% - {\Ustack{% forces num style - \math_frac_command_u - {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}}% - {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}}% - }% +\protected\defcsname\??mathfractionalternative\v!inner\endcsname#1#2% + {\math_frac_command_u +{}% {\expandedmathstyleparameter\mathfractionparameter}% + {\math_fraction_margin_kern +\usemathstyleparameter\mathfractionparameter + \m_fractions_strut_top#1% + \math_fraction_margin_kern}% + {\math_fraction_margin_kern +\usemathstyleparameter\mathfractionparameter + \m_fractions_strut_bot#2% + \math_fraction_margin_kern}% \math_frac_wrapup} -\def\math_fraction_outer_normal#1#2% - {\Ustack{% forces num style - \usemathstyleparameter\mathfractionparameter - \math_frac_command_u - {\m_fractions_strut_top#1}% - {\m_fractions_strut_bot#2}% - }% +\protected\defcsname\??mathfractionalternative\v!outer\endcsname#1#2% + {\beginmathgroup + \usemathstyleparameter\mathfractionparameter + \math_frac_command_u + {}% + {\math_fraction_margin_kern + \m_fractions_strut_top#1% + \math_fraction_margin_kern}% + {\math_fraction_margin_kern + \m_fractions_strut_bot#2% + \math_fraction_margin_kern}% + \endmathgroup \math_frac_wrapup} -\def\math_fraction_both_normal#1#2% - {\Ustack{% forces num style - \usemathstyleparameter\mathfractionparameter - \math_frac_command_u - {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1}% - {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2}% - }% +\protected\defcsname\??mathfractionalternative\v!both\endcsname#1#2% + {\beginmathgroup + \usemathstyleparameter\mathfractionparameter + \math_frac_command_u +{}% {\expandedmathstyleparameter\mathfractionparameter}% + {\math_fraction_margin_kern +\usemathstyleparameter\mathfractionparameter + \m_fractions_strut_top#1% + \math_fraction_margin_kern}% + {\math_fraction_margin_kern +\usemathstyleparameter\mathfractionparameter + \m_fractions_strut_bot#2% + \math_fraction_margin_kern}% + \endmathgroup \math_frac_wrapup} -\def\math_fraction_inner_margin#1#2% - {\Ustack{% - {% - \math_frac_command_u - {\kern\d_math_fraction_margin - \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}% - \kern\d_math_fraction_margin}% - {\kern\d_math_fraction_margin - \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}% - \kern\d_math_fraction_margin}% - }% - }% - \math_frac_wrapup} - -\def\math_fraction_outer_margin#1#2% - {\Ustack{% - \usemathstyleparameter\mathfractionparameter - {% - \math_frac_command_u - {\kern\d_math_fraction_margin - \m_fractions_strut_top#1% - \kern\d_math_fraction_margin}% - {\kern\d_math_fraction_margin - \m_fractions_strut_bot#2% - \kern\d_math_fraction_margin}% - }% - }% - \math_frac_wrapup} -\def\math_fraction_both_margin#1#2% - {\Ustack{% - \usemathstyleparameter\mathfractionparameter - {% - \math_frac_command_u - {\kern\d_math_fraction_margin - \usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1% - \kern\d_math_fraction_margin}% - {\kern\d_math_fraction_margin - \usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2% - \kern\d_math_fraction_margin}% - }% - }% - \math_frac_wrapup} +\nulldelimiterspace\zeropoint % was 1.2pt \definemathfraction[xfrac] [\c!alternative=\v!inner,\c!mathstyle=\s!script] \definemathfraction[xxfrac][\c!alternative=\v!inner,\c!mathstyle=\s!scriptscript] @@ -557,15 +446,15 @@ % $$ {{a}\abovewithdelims()#1pt{b}} $$ % } -\definemathfraction[i:frac] [\c!alternative=\v!inner,\c!mathstyle=] % was script and then small but nothing needed -\definemathfraction[i:tfrac][\c!alternative=\v!inner,\c!mathstyle=\s!text] % was script (before luatex fix) +\definemathfraction[i:frac] [\c!alternative=\v!inner,\c!mathstyle=\s!script] +\definemathfraction[i:tfrac][i:frac] \definemathfraction[i:sfrac][\c!alternative=\v!inner,\c!mathstyle=\s!scriptscript] \definemathfraction[i:dfrac][\c!alternative=\v!inner,\c!mathstyle=\s!display] \definemathfraction[d:frac] [\c!alternative=\v!inner,\c!mathstyle=\s!cramped] % was cramped,text -\definemathfraction[d:tfrac][\c!alternative=\v!both ,\c!mathstyle={\s!cramped,\s!text}] % was cramped,script (before luatex fix) -\definemathfraction[d:sfrac][\c!alternative=\v!both ,\c!mathstyle={\s!cramped,\s!scriptscript}] -\definemathfraction[d:dfrac][\c!alternative=\v!inner,\c!mathstyle=\s!display] +\definemathfraction[d:tfrac][\c!alternative=\v!both, \c!mathstyle={\s!cramped,\s!text}] +\definemathfraction[d:sfrac][\c!alternative=\v!both, \c!mathstyle={\s!cramped,\s!script}] +\definemathfraction[d:dfrac][d:frac] %D \protected\def\ShowMathFractions#1#2% %D {\dontleavehmode @@ -670,7 +559,9 @@ {\strut \ifx r#1\hfill\fi#4\ifx l#1\hfill\fi}% {\ifx r#2\hfill\fi#5\ifx l#2\hfill\fi}% - \kern-\nulldelimiterspace}} + \ifzeropt\nulldelimiterspace\else + \kern-\nulldelimiterspace + \fi}} %D \macros %D {splitfrac, splitdfrac} diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl index 8ff839107..f0db89cf2 100644 --- a/tex/context/base/mkxl/math-ini.mkxl +++ b/tex/context/base/mkxl/math-ini.mkxl @@ -722,34 +722,96 @@ % % this overflows so we use this instead: +% \protected\def\math_strut_htdp#1% nasty! +% {\s!height\dimexpr(\fontcharht#1\c_math_strut/\glyphscale)*\mathscale#1\relax +% \s!depth \dimexpr(\fontchardp#1\c_math_strut/\glyphscale)*\mathscale#1\relax} +% +% \protected\def\math_strut_normal +% {\vrule +% \s!width \zeropoint +% \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}% +% \relax} +% +% \protected\def\math_strut_visual +% {\hskip-.01\emwidth +% \vrule +% \s!width .02\emwidth +% \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}% +% \relax +% \hskip-.01\emwidth} + +\protected\def\math_strut_ht#1% nasty! + {\s!height\dimexpr(\fontcharht#1\c_math_strut/\glyphscale)*\mathscale#1\relax} + +\protected\def\math_strut_dp#1% nasty! + {\s!depth \dimexpr(\fontchardp#1\c_math_strut/\glyphscale)*\mathscale#1\relax} + \protected\def\math_strut_htdp#1% nasty! - {\s!height\dimexpr(\fontcharht#1\c_math_strut/\glyphscale)*\mathscale#1\relax - \s!depth \dimexpr(\fontchardp#1\c_math_strut/\glyphscale)*\mathscale#1\relax} + {\math_strut_ht{#1}% + \math_strut_dp{#1}} \protected\def\math_strut_normal {\vrule - \s!width \zeropoint - \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}% + \s!width \zeropoint + \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}% \relax} \protected\def\math_strut_visual {\hskip-.01\emwidth \vrule - \s!width .02\emwidth - \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}% + \s!width .02\emwidth + \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}% + \relax + \hskip-.01\emwidth} + +\permanent\protected\def\math_strut_height_normal + {\vrule + \s!width \zeropoint + \normalexpanded{\math_strut_ht{\mathstylefont\normalmathstyle}}% + \s!depth \zeropoint + \relax} + +\permanent\protected\def\math_strut_height_visual + {\hskip-.01\emwidth + \vrule + \s!width .02\emwidth + \normalexpanded{\math_strut_ht{\mathstylefont\normalmathstyle}}% + \s!depth \zeropoint + \relax + \hskip-.01\emwidth} + +\permanent\protected\def\math_strut_depth_normal + {\vrule + \s!width \zeropoint + \s!height\zeropoint + \normalexpanded{\math_strut_dp{\mathstylefont\normalmathstyle}}% + \relax} + +\permanent\protected\def\math_strut_depth_visual + {\hskip-.01\emwidth + \vrule + \s!width .02\emwidth + \s!height\zeropoint + \normalexpanded{\math_strut_dp{\mathstylefont\normalmathstyle}}% \relax \hskip-.01\emwidth} \permanent\protected\def\showmathstruts % let's not overload \math_strut_normal - {\enforced\let\math_strut\math_strut_visual} + {\enforced\let\math_strut \math_strut_visual + \enforced\let\math_strut_height\math_strut_height_visual + \enforced\let\math_strut_depth \math_strut_depth_visual} -\let\math_strut\math_strut_normal +\let\math_strut \math_strut_normal +\let\math_strut_height\math_strut_height_normal +\let\math_strut_depth \math_strut_depth_normal % \protected\def\mathstrut{\mathcodecommand{nothing}{\math_strut}} \pushoverloadmode - \definemathcommand [mathstrut] {\math_strut} + \definemathcommand [mathstrut] {\math_strut} + \definemathcommand [mathheightstrut] {\math_strut_height} + \definemathcommand [mathdepthstrut] {\math_strut_depth} \popoverloadmode @@ -2315,15 +2377,9 @@ \fi } -\permanent\tolerant\protected\def\setmathstyle[#1]#;#=% so we accept [] and {} - {\edef\m_math_style_asked{#1#2}% - \ifempty\m_math_style_asked \else - \math_style_set_indeed - \fi} - \permanent\def\installmathstyle#1#2% {\ifcsname\??mathstylecommand#1\endcsname \else - \setvalue{\??mathstylecommand#1}{#2}% + \defcsname\??mathstylecommand#1\endcsname{#2}% \fi} \def\math_style_collect#1% @@ -2342,17 +2398,17 @@ \defcsname\??mathstylecommand\v!small \endcsname{\c_math_styles_state_size \plusone} \defcsname\??mathstylecommand\v!big \endcsname{\c_math_styles_state_size \plustwo} -\permanent\protected\def\setupmathstyle[#1]% - {\edef\m_math_style_asked{#1}% - \ifempty\m_math_style_asked \else - \math_style_set_indeed - \fi} - -\permanent\protected\def\usemathstyleparameter#1% faster local variant - {\edef\m_math_style_asked{#1\c!mathstyle}% - \ifempty\m_math_style_asked \else - \math_style_set_indeed - \fi} +% \permanent\protected\def\setupmathstyle[#1]% +% {\edef\m_math_style_asked{#1}% +% \ifempty\m_math_style_asked \else +% \math_style_set_indeed +% \fi} +% +% \permanent\protected\def\usemathstyleparameter#1% faster local variant +% {\edef\m_math_style_asked{#1\c!mathstyle}% +% \ifempty\m_math_style_asked \else +% \math_style_set_indeed +% \fi} %D \startbuffer %D \definemathstyle[mystyle][scriptscript] @@ -2362,39 +2418,91 @@ %D %D \typebuffer \blank \start \getbuffer \stop \blank +% maybe move this to the lua end ... + \installcorenamespace {mathstyle} -\permanent\tolerant\protected\def\definemathstyle[#1]#*[#2]% - {\c_math_styles_state_style \zerocount - \c_math_styles_state_cramped\zerocount - \c_math_styles_state_size \zerocount - \rawprocesscommacommand[#2]\math_style_collect - \letcsname\??mathstyle#1\normalexpanded{\endcsname\math_style_add_to_cache_choice}} +% \permanent\tolerant\protected\def\definemathstyle[#1]#*[#2]% +% {\c_math_styles_state_style \zerocount +% \c_math_styles_state_cramped\zerocount +% \c_math_styles_state_size \zerocount +% \rawprocesscommacommand[#2]\math_style_collect +% \letcsname\??mathstyle#1\normalexpanded{\endcsname\math_style_add_to_cache_choice}} +% +% \def\math_style_set_indeed +% {\ifcsname\??mathstyle\m_math_style_asked\endcsname +% \lastnamedcs +% \else +% \math_style_set_mathstyle_mathstyle +% \fi} +% +% \def\math_style_set_mathstyle_mathstyle +% {\ifcsname\??mathstylecache\m_math_style_asked\endcsname +% \lastnamedcs +% \else +% \math_style_set_mathstyle_mathstylecache +% \fi} +% +% \def\math_style_set_mathstyle_mathstylecache +% {\c_math_styles_state_style \zerocount +% \c_math_styles_state_cramped\zerocount +% \c_math_styles_state_size \zerocount +% \rawprocesscommacommand[\m_math_style_asked]\math_style_collect +% \gletcsname\??mathstylecache\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}% +% \csname\??mathstylecache\m_math_style_asked\endcsname} + +\letcsname\??mathstyle \endcsname\empty +\letcsname\??mathstylecache\endcsname\empty \def\math_style_set_indeed {\ifcsname\??mathstyle\m_math_style_asked\endcsname \lastnamedcs + \orelse\ifcsname\??mathstylecache\m_math_style_asked\endcsname + \lastnamedcs \else - \math_style_set_mathstyle_mathstyle + \math_style_set_mathstyle_mathstylecache\m_math_style_asked \fi} -\def\math_style_set_mathstyle_mathstyle - {\ifcsname\??mathstylecache\m_math_style_asked\endcsname +\permanent\def\expandedmathstyleparameter#1% + {\ifcsname\??mathstyle#1\c!mathstyle\endcsname + \lastnamedcs + \orelse\ifcsname\??mathstylecache#1\c!mathstyle\endcsname \lastnamedcs \else - \math_style_set_mathstyle_mathstylecache + \math_style_set_mathstyle_mathstylecache#1% + \fi} + +\permanent\protected\def\usemathstyleparameter#1% + {\edef\m_math_style_asked{#1\c!mathstyle}% + \ifempty\m_math_style_asked \else + \math_style_set_indeed + \fi} + +\permanent\tolerant\protected\def\setmathstyle[#1]#;#=% so we accept [] and {} + {\edef\m_math_style_asked{#1#2}% + \ifempty\m_math_style_asked \else + \math_style_set_indeed + \fi} + +\permanent\protected\def\setupmathstyle[#1]% + {\edef\m_math_style_asked{#1}% + \ifempty\m_math_style_asked \else + \math_style_set_indeed \fi} -\def\math_style_set_mathstyle_mathstylecache - {\c_math_styles_state_style \zerocount +\def\math_style_set_mathstyle_mathstylecache#1% + {\beginlocalcontrol % so we can expand + \edef\m_math_style_asked{#1\c!mathstyle}% + \c_math_styles_state_style \zerocount \c_math_styles_state_cramped\zerocount \c_math_styles_state_size \zerocount \rawprocesscommacommand[\m_math_style_asked]\math_style_collect \gletcsname\??mathstylecache\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}% - \csname\??mathstylecache\m_math_style_asked\endcsname} + \endlocalcontrol + \csname\??mathstylecache#1\c!mathstyle\endcsname} -\letcsname\??mathstyle \??mathstyle \endcsname\math_style_set_mathstyle_mathstyle % still needed? -\letcsname\??mathstylecache\??mathstylecache\endcsname\math_style_set_mathstyle_mathstylecache % still needed? +% \letcsname\??mathstyle \??mathstyle \endcsname\math_style_set_mathstyle_mathstyle % still needed? +% \letcsname\??mathstylecache\??mathstylecache\endcsname\math_style_set_mathstyle_mathstylecache % still needed? %D \startbuffer %D $x\begingroup\setupmathstyle[script]x\endgroup x$ @@ -2409,9 +2517,9 @@ \ifempty\m_math_style_asked \enforced\aliased\let\stopmathstyle\relax \else - \bgroup + \beginmathgroup % \bgroup \math_style_set_indeed - \enforced\aliased\let\stopmathstyle\egroup + \enforced\aliased\let\stopmathstyle\endmathgroup % \egroup \fi} \aliased\let\stopmathstyle\relax @@ -2421,9 +2529,9 @@ \ifempty\m_math_style_asked \enforced\let\stopusemathstyleparameter\relax \else - \bgroup + \beginmathgroup % \bgroup \math_style_set_indeed - \enforced\let\stopusemathstyleparameter\egroup + \enforced\let\stopusemathstyleparameter\endmathgroup % \egroup \fi} \aliased\let\stopusemathstyleparameter\relax diff --git a/tex/context/base/mkxl/math-noa.lmt b/tex/context/base/mkxl/math-noa.lmt index 66e8caade..3699ae03c 100644 --- a/tex/context/base/mkxl/math-noa.lmt +++ b/tex/context/base/mkxl/math-noa.lmt @@ -185,17 +185,19 @@ local nodecodes = nodes.nodecodes local noadcodes = nodes.noadcodes local fencecodes = nodes.fencecodes -local ordnoad_code = noadcodes.ord -local opnoad_code = noadcodes.op -local binnoad_code = noadcodes.bin -local relnode_code = noadcodes.rel +local ordinarynoad_code = noadcodes.ordinary +local operatornoad_code = noadcodes.operator +local binarynoad_code = noadcodes.binary +local relationnoad_code = noadcodes.relation local opennoad_code = noadcodes.open local closenoad_code = noadcodes.close -local punctnoad_code = noadcodes.punct +local punctuationnoad_code = noadcodes.punctuation local innernoad_code = noadcodes.inner local undernoad_code = noadcodes.under local overnoad_code = noadcodes.over local vcenternoad_code = noadcodes.vcenter +local fractionnoad_code = noadcodes.fraction +local radicalnoad_code = noadcodes.radical local noad_code = nodecodes.noad local accent_code = nodecodes.accent @@ -1804,17 +1806,19 @@ do local collapse = { } local mathlists = characters.mathlists local validpair = { - [ordnoad_code] = true, - [opnoad_code] = true, - [binnoad_code] = true, -- new - [relnode_code] = true, - [opennoad_code] = true, -- new - [closenoad_code] = true, -- new - [punctnoad_code] = true, -- new - [innernoad_code] = false, - [undernoad_code] = false, - [overnoad_code] = false, - [vcenternoad_code] = false, + [ordinarynoad_code] = true, + [operatornoad_code] = true, + [binarynoad_code] = true, -- new + [relationnoad_code] = true, + [opennoad_code] = true, -- new + [closenoad_code] = true, -- new + [punctuationnoad_code] = true, -- new + [innernoad_code] = false, + [undernoad_code] = false, + [overnoad_code] = false, + [vcenternoad_code] = false, + [fractionnoad_code] = false, + [radicalnoad_code] = false, } local reported = setmetatableindex("table") @@ -2111,17 +2115,19 @@ do local classes = { } local colors = { - [relnode_code] = "trace:dr", - [ordnoad_code] = "trace:db", - [binnoad_code] = "trace:dg", - [opennoad_code] = "trace:dm", - [closenoad_code] = "trace:dm", - [punctnoad_code] = "trace:dc", - -- [opnoad_code] = "", - -- [innernoad_code = "", - -- [undernoad_code] = "", - -- [overnoad_code] = "", - -- [vcenternoad_code] = "", + [relationnoad_code] = "trace:dr", + [ordinarynoad_code] = "trace:db", + [binarynoad_code] = "trace:dg", + [opennoad_code] = "trace:dm", + [closenoad_code] = "trace:dm", + [punctuationnoad_code] = "trace:dc", + -- [operatornoad_code] = "", + -- [innernoad_code = "", + -- [undernoad_code] = "", + -- [overnoad_code] = "", + -- [vcenternoad_code] = "", + -- [fractionnoad_code] = "", + -- [radicalnoad_code] = "", } local setcolor = colortracers.set @@ -2165,11 +2171,13 @@ do local a_mathdomain = privateattribute("mathdomain") mathematics.domains = categories local permitted = { - ordinary = ordnoad_code, - binary = binnoad_code, - relation = relnode_code, - punctuation = punctnoad_code, + ordinary = ordinarynoad_code, + binary = binarynoad_code, + relation = relationnoad_code, + punctuation = punctuationnoad_code, inner = innernoad_code, + -- fraction = fractionnoad_code, + -- radical = radicalnoad_code, } function mathematics.registerdomain(data) diff --git a/tex/context/base/mkxl/mult-sys.mkxl b/tex/context/base/mkxl/mult-sys.mkxl index 48a35e0b2..1eae000e4 100644 --- a/tex/context/base/mkxl/mult-sys.mkxl +++ b/tex/context/base/mkxl/mult-sys.mkxl @@ -48,6 +48,7 @@ \definesystemconstant {ancientlatin} \definesystemconstant {ala} \definesystemconstant {arabic} \definesystemconstant {ar} \definesystemconstant {belarussian} \definesystemconstant {be} +\definesystemconstant {bengali} \definesystemconstant {bn} \definesystemconstant {bulgarian} \definesystemconstant {bg} \definesystemconstant {bokmal} \definesystemconstant {nb} \definesystemconstant {catalan} \definesystemconstant {ca} @@ -65,11 +66,14 @@ \definesystemconstant {gbenglish} \definesystemconstant {gb} \definesystemconstant {german} \definesystemconstant {de} \definesystemconstant {greek} \definesystemconstant {gr} +\definesystemconstant {gujarati} \definesystemconstant {gu} \definesystemconstant {hebrew} \definesystemconstant {he} +\definesystemconstant {hindi} \definesystemconstant {hi} \definesystemconstant {yiddish} \definesystemconstant {yi} \definesystemconstant {hungarian} \definesystemconstant {hu} \definesystemconstant {italian} \definesystemconstant {it} \definesystemconstant {japanese} \definesystemconstant {ja} +\definesystemconstant {kannada} \definesystemconstant {kn} \definesystemconstant {korean} \definesystemconstant {kr} \definesystemconstant {latin} \definesystemconstant {la} \definesystemconstant {lithuanian} \definesystemconstant {lt} @@ -82,11 +86,14 @@ \definesystemconstant {portuguese} \definesystemconstant {pt} \definesystemconstant {romanian} \definesystemconstant {ro} \definesystemconstant {russian} \definesystemconstant {ru} +\definesystemconstant {sanskrit} \definesystemconstant {sa} \definesystemconstant {slovak} \definesystemconstant {sk} \definesystemconstant {slovenian} \definesystemconstant {sl} \definesystemconstant {serbian} \definesystemconstant {sr} \definesystemconstant {spanish} \definesystemconstant {es} \definesystemconstant {swedish} \definesystemconstant {sv} +\definesystemconstant {tamil} \definesystemconstant {ta} +\definesystemconstant {telugu} \definesystemconstant {te} \definesystemconstant {thai} \definesystemconstant {th} % mojca mentioned it at BT2013 but we need more info \definesystemconstant {turkish} \definesystemconstant {tr} \definesystemconstant {turkmen} \definesystemconstant {tk} diff --git a/tex/context/base/mkxl/node-ini.lmt b/tex/context/base/mkxl/node-ini.lmt index 1ec0932ab..2b09485db 100644 --- a/tex/context/base/mkxl/node-ini.lmt +++ b/tex/context/base/mkxl/node-ini.lmt @@ -142,6 +142,26 @@ nodes.mathvalues = mathvalues nodes.nodecodes = nodecodes +-- we will transition to more verbose subtypes (after other math is done) + +noadcodes.ord = noadcodes.ord or noadcodes.ordinary +noadcodes.operator = noadcodes.op or noadcodes.operator +noadcodes.bin = noadcodes.bin or noadcodes.binary +noadcodes.rel = noadcodes.rel or noadcodes.relation +noadcodes.punct = noadcodes.punct or noadcodes.punctuation +noadcodes.rad = noadcodes.rad or noadcodes.radical +noadcodes.frac = noadcodes.frac or noadcodes.fraction + +-- so for now: + +noadcodes.ordinary = noadcodes.ordinary or noadcodes.ord +noadcodes.operator = noadcodes.operator or noadcodes.op +noadcodes.binary = noadcodes.binary or noadcodes.bin +noadcodes.relation = noadcodes.relation or noadcodes.rel +noadcodes.punctuation = noadcodes.punctuation or noadcodes.punct +noadcodes.radical = noadcodes.radical or noadcodes.rad +noadcodes.fraction = noadcodes.fraction or noadcodes.frac + local subtypes = allocate { glue = gluecodes, dir = dircodes, diff --git a/tex/context/base/mkxl/norm-ctx.mkxl b/tex/context/base/mkxl/norm-ctx.mkxl index 5cee04935..fb67c5f24 100644 --- a/tex/context/base/mkxl/norm-ctx.mkxl +++ b/tex/context/base/mkxl/norm-ctx.mkxl @@ -19,69 +19,114 @@ % more friendly in setups: -\aliased\let\ordordspacing \Umathordordspacing -\aliased\let\ordopspacing \Umathordopspacing -\aliased\let\ordbinspacing \Umathordbinspacing -\aliased\let\ordrelspacing \Umathordrelspacing -\aliased\let\ordopenspacing \Umathordopenspacing -\aliased\let\ordclosespacing \Umathordclosespacing -\aliased\let\ordpunctspacing \Umathordpunctspacing -\aliased\let\ordinnerspacing \Umathordinnerspacing -\aliased\let\opordspacing \Umathopordspacing -\aliased\let\opopspacing \Umathopopspacing -\aliased\let\opbinspacing \Umathopbinspacing -\aliased\let\oprelspacing \Umathoprelspacing -\aliased\let\opopenspacing \Umathopopenspacing -\aliased\let\opclosespacing \Umathopclosespacing -\aliased\let\oppunctspacing \Umathoppunctspacing -\aliased\let\opinnerspacing \Umathopinnerspacing -\aliased\let\binordspacing \Umathbinordspacing -\aliased\let\binopspacing \Umathbinopspacing -\aliased\let\binbinspacing \Umathbinbinspacing -\aliased\let\binrelspacing \Umathbinrelspacing -\aliased\let\binopenspacing \Umathbinopenspacing -\aliased\let\binclosespacing \Umathbinclosespacing -\aliased\let\binpunctspacing \Umathbinpunctspacing -\aliased\let\bininnerspacing \Umathbininnerspacing -\aliased\let\relordspacing \Umathrelordspacing -\aliased\let\relopspacing \Umathrelopspacing -\aliased\let\relbinspacing \Umathrelbinspacing -\aliased\let\relrelspacing \Umathrelrelspacing -\aliased\let\relopenspacing \Umathrelopenspacing -\aliased\let\relclosespacing \Umathrelclosespacing -\aliased\let\relpunctspacing \Umathrelpunctspacing -\aliased\let\relinnerspacing \Umathrelinnerspacing -\aliased\let\openordspacing \Umathopenordspacing -\aliased\let\openopspacing \Umathopenopspacing -\aliased\let\openbinspacing \Umathopenbinspacing -\aliased\let\openrelspacing \Umathopenrelspacing -\aliased\let\openopenspacing \Umathopenopenspacing -\aliased\let\openclosespacing \Umathopenclosespacing -\aliased\let\openpunctspacing \Umathopenpunctspacing -\aliased\let\openinnerspacing \Umathopeninnerspacing -\aliased\let\closeordspacing \Umathcloseordspacing -\aliased\let\closeopspacing \Umathcloseopspacing -\aliased\let\closebinspacing \Umathclosebinspacing -\aliased\let\closerelspacing \Umathcloserelspacing -\aliased\let\closeopenspacing \Umathcloseopenspacing -\aliased\let\closeclosespacing\Umathcloseclosespacing -\aliased\let\closepunctspacing\Umathclosepunctspacing -\aliased\let\closeinnerspacing\Umathcloseinnerspacing -\aliased\let\punctordspacing \Umathpunctordspacing -\aliased\let\punctopspacing \Umathpunctopspacing -\aliased\let\punctbinspacing \Umathpunctbinspacing -\aliased\let\punctrelspacing \Umathpunctrelspacing -\aliased\let\punctopenspacing \Umathpunctopenspacing -\aliased\let\punctclosespacing\Umathpunctclosespacing -\aliased\let\punctpunctspacing\Umathpunctpunctspacing -\aliased\let\punctinnerspacing\Umathpunctinnerspacing -\aliased\let\innerordspacing \Umathinnerordspacing -\aliased\let\inneropspacing \Umathinneropspacing -\aliased\let\innerbinspacing \Umathinnerbinspacing -\aliased\let\innerrelspacing \Umathinnerrelspacing -\aliased\let\inneropenspacing \Umathinneropenspacing -\aliased\let\innerclosespacing\Umathinnerclosespacing -\aliased\let\innerpunctspacing\Umathinnerpunctspacing -\aliased\let\innerinnerspacing\Umathinnerinnerspacing +\aliased\let\ordordspacing \Umathordordspacing +\aliased\let\ordopspacing \Umathordopspacing +\aliased\let\ordbinspacing \Umathordbinspacing +\aliased\let\ordrelspacing \Umathordrelspacing +\aliased\let\ordopenspacing \Umathordopenspacing +\aliased\let\ordclosespacing \Umathordclosespacing +\aliased\let\ordpunctspacing \Umathordpunctspacing +\aliased\let\ordinnerspacing \Umathordinnerspacing +\aliased\let\ordfracspacing \Umathordfracspacing +\aliased\let\ordradspacing \Umathordradspacing + +\aliased\let\opordspacing \Umathopordspacing +\aliased\let\opopspacing \Umathopopspacing +\aliased\let\opbinspacing \Umathopbinspacing +\aliased\let\oprelspacing \Umathoprelspacing +\aliased\let\opopenspacing \Umathopopenspacing +\aliased\let\opclosespacing \Umathopclosespacing +\aliased\let\oppunctspacing \Umathoppunctspacing +\aliased\let\opinnerspacing \Umathopinnerspacing +\aliased\let\opfracspacing \Umathopfracspacing +\aliased\let\opradspacing \Umathopradspacing + +\aliased\let\binordspacing \Umathbinordspacing +\aliased\let\binopspacing \Umathbinopspacing +\aliased\let\binbinspacing \Umathbinbinspacing +\aliased\let\binrelspacing \Umathbinrelspacing +\aliased\let\binopenspacing \Umathbinopenspacing +\aliased\let\binclosespacing \Umathbinclosespacing +\aliased\let\binpunctspacing \Umathbinpunctspacing +\aliased\let\bininnerspacing \Umathbininnerspacing +\aliased\let\binfracspacing \Umathbinfracspacing +\aliased\let\binradspacing \Umathbinradspacing + +\aliased\let\relordspacing \Umathrelordspacing +\aliased\let\relopspacing \Umathrelopspacing +\aliased\let\relbinspacing \Umathrelbinspacing +\aliased\let\relrelspacing \Umathrelrelspacing +\aliased\let\relopenspacing \Umathrelopenspacing +\aliased\let\relclosespacing \Umathrelclosespacing +\aliased\let\relpunctspacing \Umathrelpunctspacing +\aliased\let\relinnerspacing \Umathrelinnerspacing +\aliased\let\relfracspacing \Umathrelfracspacing +\aliased\let\relradspacing \Umathrelradspacing + +\aliased\let\openordspacing \Umathopenordspacing +\aliased\let\openopspacing \Umathopenopspacing +\aliased\let\openbinspacing \Umathopenbinspacing +\aliased\let\openrelspacing \Umathopenrelspacing +\aliased\let\openopenspacing \Umathopenopenspacing +\aliased\let\openclosespacing \Umathopenclosespacing +\aliased\let\openpunctspacing \Umathopenpunctspacing +\aliased\let\openinnerspacing \Umathopeninnerspacing +\aliased\let\openfracspacing \Umathopenfracspacing +\aliased\let\openradspacing \Umathopenradspacing + +\aliased\let\closeordspacing \Umathcloseordspacing +\aliased\let\closeopspacing \Umathcloseopspacing +\aliased\let\closebinspacing \Umathclosebinspacing +\aliased\let\closerelspacing \Umathcloserelspacing +\aliased\let\closeopenspacing \Umathcloseopenspacing +\aliased\let\closeclosespacing \Umathcloseclosespacing +\aliased\let\closepunctspacing \Umathclosepunctspacing +\aliased\let\closeinnerspacing \Umathcloseinnerspacing +\aliased\let\closefracspacing \Umathclosefracspacing +\aliased\let\closeradspacing \Umathcloseradspacing + +\aliased\let\punctordspacing \Umathpunctordspacing +\aliased\let\punctopspacing \Umathpunctopspacing +\aliased\let\punctbinspacing \Umathpunctbinspacing +\aliased\let\punctrelspacing \Umathpunctrelspacing +\aliased\let\punctopenspacing \Umathpunctopenspacing +\aliased\let\punctclosespacing \Umathpunctclosespacing +\aliased\let\punctpunctspacing \Umathpunctpunctspacing +\aliased\let\punctinnerspacing \Umathpunctinnerspacing +\aliased\let\punctfracspacing \Umathpunctfracspacing +\aliased\let\punctradspacing \Umathpunctradspacing + +\aliased\let\innerordspacing \Umathinnerordspacing +\aliased\let\inneropspacing \Umathinneropspacing +\aliased\let\innerbinspacing \Umathinnerbinspacing +\aliased\let\innerrelspacing \Umathinnerrelspacing +\aliased\let\inneropenspacing \Umathinneropenspacing +\aliased\let\innerclosespacing \Umathinnerclosespacing +\aliased\let\innerpunctspacing \Umathinnerpunctspacing +\aliased\let\innerinnerspacing \Umathinnerinnerspacing +\aliased\let\innerfracspacing \Umathinnerfracspacing +\aliased\let\innerradspacing \Umathinnerradspacing + +\aliased\let\fracordspacing \Umathfracordspacing +\aliased\let\fracopspacing \Umathfracopspacing +\aliased\let\fracbinspacing \Umathfracbinspacing +\aliased\let\fracrelspacing \Umathfracrelspacing +\aliased\let\fracopenspacing \Umathfracopenspacing +\aliased\let\fracclosespacing \Umathfracclosespacing +\aliased\let\fracpunctspacing \Umathfracpunctspacing +\aliased\let\fracinnerspacing \Umathfracinnerspacing +\aliased\let\fracfracspacing \Umathfracfracspacing +\aliased\let\fracradspacing \Umathfracradspacing + +\aliased\let\radordspacing \Umathradordspacing +\aliased\let\radopspacing \Umathradopspacing +\aliased\let\radbinspacing \Umathradbinspacing +\aliased\let\radrelspacing \Umathradrelspacing +\aliased\let\radopenspacing \Umathradopenspacing +\aliased\let\radclosespacing \Umathradclosespacing +\aliased\let\radpunctspacing \Umathradpunctspacing +\aliased\let\radinnerspacing \Umathradinnerspacing +\aliased\let\radfracspacing \Umathradfracspacing +\aliased\let\radradspacing \Umathradradspacing \protect \endinput diff --git a/tex/context/base/mkxl/page-mix.mkxl b/tex/context/base/mkxl/page-mix.mkxl index 32af22114..21e923864 100644 --- a/tex/context/base/mkxl/page-mix.mkxl +++ b/tex/context/base/mkxl/page-mix.mkxl @@ -635,7 +635,7 @@ \global\advance\c_page_mix_otr_nesting\plusone \ifcase\c_page_mix_otr_nesting\or \ifdim\pagetotal=\zeropoint \else - % make sure that whitespace an dblanks are done + % make sure that whitespace and blanks are done \strut \vskip-\lineheight % no, bad spacing: \obeydepth % we could handle this in pre material diff --git a/tex/context/base/mkxl/spac-hor.mkxl b/tex/context/base/mkxl/spac-hor.mkxl index 06a8f74f4..245195011 100644 --- a/tex/context/base/mkxl/spac-hor.mkxl +++ b/tex/context/base/mkxl/spac-hor.mkxl @@ -586,6 +586,8 @@ %D A couple of plain macros: \ifdefined\enspace \else \permanent\protected\def\enspace{\kern .5\emwidth} \fi +\ifdefined\emspace \else \permanent\protected\def\emspace{\kern \emwidth} \fi + \ifdefined\quad \else \permanent\protected\def\quad {\hskip \emwidth\relax} \fi \ifdefined\enskip \else \permanent\protected\def\enskip {\hskip.5\emwidth\relax} \fi \ifdefined\qquad \else \permanent\protected\def\qquad {\hskip 2\emwidth\relax} \fi @@ -593,7 +595,7 @@ \permanent\protected\def\negenspace{\kern-.5\emwidth} \permanent\protected\def\negemspace{\kern- \emwidth} -\aliased\let\emspace\quad +% \aliased\let\emspace\quad \permanent\protected\def\charspace{ } % the unexpandable \space (as space can also be delimiter for numbers) diff --git a/tex/context/base/mkxl/strc-con.mklx b/tex/context/base/mkxl/strc-con.mklx index ba9c62d48..55ddb8edf 100644 --- a/tex/context/base/mkxl/strc-con.mklx +++ b/tex/context/base/mkxl/strc-con.mklx @@ -399,8 +399,12 @@ % \dostarttagged\t!constructiontag\empty % todo \setbox\constructionheadbox\hbox - {\forgetall + {\scratchskip\parindent + \forgetall \dontcomplain + % new and under testing + \doif{\constructionparameter\c!headindenting}\v!yes{\hskip\scratchskip}% + % \ifx\currentconstructionalternative\v!serried % brrr, hack, will change \csname\??constructionmainhandler\currentconstructionhandler\endcsname\currentconstructiontext \else @@ -410,11 +414,9 @@ \ifx\p_strc_constructions_aligntitle\v!no \leftconstructionskip \leftskip \rightconstructionskip\rightskip - \else - \ifcase\c_strc_constructions_nested_state - \leftconstructionskip \leftskip - \rightconstructionskip\rightskip - \fi + \orelse\ifcase\c_strc_constructions_nested_state + \leftconstructionskip \leftskip + \rightconstructionskip\rightskip \fi \edef\p_strc_constructions_align{\constructionparameter\c!align}% \ifempty\p_strc_constructions_align \else @@ -938,10 +940,6 @@ \endgroup \stopsetups -\ifcase\contextlmtxmode \else - % just an empty check so that we can grep for contextlmtxmode in mkiv files -\fi - % \definedescription[whatever][alternative=right:bottom] % % \startwhatever{just a small\\example} diff --git a/tex/context/base/mkxl/strc-enu.mklx b/tex/context/base/mkxl/strc-enu.mklx index fd98b11f3..89e1b307a 100644 --- a/tex/context/base/mkxl/strc-enu.mklx +++ b/tex/context/base/mkxl/strc-enu.mklx @@ -307,16 +307,22 @@ \endgroup} \protected\def\strc_enumerations_inject_symbol % todo check - {\constructionparameter\c!left + {\begingroup + \useconstructionstyleandcolor\c!numberstyle\c!numbercolor + \constructionparameter\c!left \constructionparameter\c!symbol - \constructionparameter\c!right} + \constructionparameter\c!right + \endgroup} \protected\def\strc_enumerations_inject_number - {\constructionparameter\c!left + {\begingroup + \useconstructionstyleandcolor\c!numberstyle\c!numbercolor + \constructionparameter\c!left \constructionparameter\c!starter \clf_savedlistprefixednumber{\currentconstructionmain}\currentconstructionlistentry\relax \constructionparameter\c!stopper - \constructionparameter\c!right} + \constructionparameter\c!right + \endgroup} \protected\def\strc_enumerations_inject_text_and_number {\constructionparameter\c!numbercommand diff --git a/tex/context/base/mkxl/strc-itm.mklx b/tex/context/base/mkxl/strc-itm.mklx index 3ccc5358e..13b750ce3 100644 --- a/tex/context/base/mkxl/strc-itm.mklx +++ b/tex/context/base/mkxl/strc-itm.mklx @@ -203,7 +203,7 @@ % 0 = before/after % 1 = between unless before -% 2 = between +% 2 = between (auto) \newconstant \c_strc_itemgroups_spacing_mode \c_strc_itemgroups_spacing_mode\plustwo \newconditional\c_strc_itemgroups_optimize \settrue\c_strc_itemgroups_optimize @@ -909,6 +909,15 @@ \doadaptleftskip {\itemgroupparameter\c!leftmargindistance}% \doadaptrightskip{\itemgroupparameter\c!rightmargindistance}% % + \edef\m_strc_itemgroups_spacing{\itemgroupparameter\c!spacing}% + \ifx\m_strc_itemgroups_spacing\v!before + \c_strc_itemgroups_spacing_mode\zerocount + \orelse\ifx\m_strc_itemgroups_spacing\v!inbetween + \c_strc_itemgroups_spacing_mode\plusone + \orelse\ifx\m_strc_itemgroups_spacing\v!auto + \c_strc_itemgroups_spacing_mode\plustwo + \fi + % \usealignparameter\itemgroupparameter \edef\m_strc_itemgroups_indenting{\itemgroupparameter\c!indenting}% \ifnum\c_strc_itemgroups_nesting>\zerocount diff --git a/tex/context/base/mkxl/typo-syn.lmt b/tex/context/base/mkxl/typo-syn.lmt index fc03ccb3b..4a5b6ae85 100644 --- a/tex/context/base/mkxl/typo-syn.lmt +++ b/tex/context/base/mkxl/typo-syn.lmt @@ -7,6 +7,9 @@ if not modules then modules = { } end modules ['typo-syn'] = { license = "see context related readme files" } +-- For the moment we have the splitter here but it actually belongs +-- in the builders namespace. + local nodes = nodes local tasks = nodes.tasks |