summaryrefslogtreecommitdiff
path: root/tex/context/modules
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/modules')
-rw-r--r--tex/context/modules/mkiv/m-simulate.mkiv2
-rw-r--r--tex/context/modules/mkiv/m-zint.mkiv4
-rw-r--r--tex/context/modules/mkiv/s-math-characters.lua73
-rw-r--r--tex/context/modules/mkiv/s-math-repertoire.mkiv135
-rw-r--r--tex/context/modules/mkxl/m-barcodes.mkxl11
-rw-r--r--tex/context/modules/mkxl/m-json.mkxl2
-rw-r--r--tex/context/modules/mkxl/m-oldmath.mkxl142
-rw-r--r--tex/context/modules/mkxl/s-layout-show.mkxl30
-rw-r--r--tex/context/modules/mkxl/s-math-tweaks.mkxl182
-rw-r--r--tex/context/modules/mkxl/x-mathml.lmt126
-rw-r--r--tex/context/modules/mkxl/x-mathml.mkxl13
11 files changed, 617 insertions, 103 deletions
diff --git a/tex/context/modules/mkiv/m-simulate.mkiv b/tex/context/modules/mkiv/m-simulate.mkiv
index dc4448903..c4817b95e 100644
--- a/tex/context/modules/mkiv/m-simulate.mkiv
+++ b/tex/context/modules/mkiv/m-simulate.mkiv
@@ -109,7 +109,7 @@
\else
\discretionary{\p_hyphen}{}{\kern\scratchdimenthree}%
\fi\fi\fi\fi\fi\fi}%
- \edef\truncated##1##2\relax{##1}%
+ \def\truncated##1##2\relax{##1}%
% trialtypesetting: tricky
\ifx\p_random\empty \else
\pushrandomseed
diff --git a/tex/context/modules/mkiv/m-zint.mkiv b/tex/context/modules/mkiv/m-zint.mkiv
index 87e0d382c..4880aa39b 100644
--- a/tex/context/modules/mkiv/m-zint.mkiv
+++ b/tex/context/modules/mkiv/m-zint.mkiv
@@ -108,8 +108,8 @@ end
% \blank
% \barcode[alternative=isbn,text=9789490688011,width=3cm]
% \blank
- \barcode[alternative=datamatrix,text=whatever,width=3cm,option=--square]
-
+% \barcode[alternative=datamatrix,text=whatever,width=3cm,option=--square,suffix=png]
+ \barcode[alternative=maxicode,text=whatever,width=3cm,suffix=png]
\stoptext
diff --git a/tex/context/modules/mkiv/s-math-characters.lua b/tex/context/modules/mkiv/s-math-characters.lua
index aed3258d2..b634a203f 100644
--- a/tex/context/modules/mkiv/s-math-characters.lua
+++ b/tex/context/modules/mkiv/s-math-characters.lua
@@ -113,36 +113,38 @@ function moduledata.math.characters.showlist(specification)
end
else
-local function collectalllookups(tfmdata,script,language)
- local all = setmetatableindex(function(t,k) local v = setmetatableindex("table") t[k] = v return v end)
- local shared = tfmdata.shared
- local rawdata = shared and shared.rawdata
- if rawdata then
- local features = rawdata.resources.features
- if features.gsub then
- for kind, feature in next, features.gsub do
- local validlookups, lookuplist = fonts.handlers.otf.collectlookups(rawdata,kind,script,language)
- if validlookups then
- for i=1,#lookuplist do
- local lookup = lookuplist[i]
- local steps = lookup.steps
- for i=1,lookup.nofsteps do
- local coverage = steps[i].coverage
- if coverage then
- for k, v in next, coverage do
- all[k][lookup.type][kind] = v
+ local function collectalllookups(tfmdata,script,language)
+ local all = setmetatableindex(function(t,k) local v = setmetatableindex("table") t[k] = v return v end)
+ local shared = tfmdata.shared
+ local rawdata = shared and shared.rawdata
+ if rawdata then
+ local features = rawdata.resources.features
+ if features.gsub then
+ for kind, feature in next, features.gsub do
+ local validlookups, lookuplist = fonts.handlers.otf.collectlookups(rawdata,kind,script,language)
+ if validlookups then
+ for i=1,#lookuplist do
+ local lookup = lookuplist[i]
+ local steps = lookup.steps
+ for i=1,lookup.nofsteps do
+ local coverage = steps[i].coverage
+ if coverage then
+ for k, v in next, coverage do
+ all[k][lookup.type][kind] = v
+ end
+ end
end
end
end
end
end
end
+ return all
end
- end
- return all
-end
-local alllookups = collectalllookups(tfmdata,"math","dflt")
+ local alllookups = collectalllookups(tfmdata,"math","dflt")
+
+ local luametatex = LUATEXENGINE == "luametatex"
context.showmathcharactersstart()
for _, unicode in next, sorted do
@@ -163,10 +165,29 @@ local alllookups = collectalllookups(tfmdata,"math","dflt")
local mathspec = info.mathspec
local mathsymbol = info.mathsymbol
local description = info.description or no_description
- context.showmathcharactersstartentry()
- context.showmathcharactersreference(f_unicode(unicode))
- context.showmathcharactersentryhexdectit(f_unicode(code),code,lower(description))
- context.showmathcharactersentrywdhtdpic(round(char.width or 0),round(char.height or 0),round(char.depth or 0),round(char.italic or 0))
+ context.showmathcharactersstartentry(
+ )
+ context.showmathcharactersreference(
+ f_unicode(unicode)
+ )
+ context.showmathcharactersentryhexdectit(
+ f_unicode(code),
+ code,
+ lower(description)
+ )
+ if luametatex then
+ context.showmathcharactersentrywdhtdpicta(
+ code
+ )
+ else
+ context.showmathcharactersentrywdhtdpicta(
+ round(char.width or 0),
+ round(char.height or 0),
+ round(char.depth or 0),
+ round(char.italic or 0),
+ round(char.topaccent or 0)
+ )
+ end
if virtual and commands then
local t = { }
for i=1,#commands do
diff --git a/tex/context/modules/mkiv/s-math-repertoire.mkiv b/tex/context/modules/mkiv/s-math-repertoire.mkiv
index 826c13fb0..59a2b828b 100644
--- a/tex/context/modules/mkiv/s-math-repertoire.mkiv
+++ b/tex/context/modules/mkiv/s-math-repertoire.mkiv
@@ -34,6 +34,8 @@
\definecolor[backgroundcolory][g=.6]
\definecolor[baselinecolor] [a=1,t=.5,s=.6]
\definecolor[charactercolor] [b=.6]
+\definecolor[italiccolor] [r=.6]
+\definecolor[anchorcolor] [s=1]
\definecolor[pagecolor] [s=.1]
\definecolor[nonecolor] [s=.5]
\definecolor[textcolor] [s=.9]
@@ -225,24 +227,68 @@
{\iffontchar\font#2\relax
\scale
[sx=#1,sy=#1]
- {\dontleavehmode
- \begingroup
- \setbox\scratchbox\hbox{\charactercolor\char#2}%
- \scratchdimen\wd\scratchbox
- \ifdim\scratchdimen>\zeropoint
+ {\dontleavehmode\hbox\bgroup
+ \setbox\scratchbox\hbox\bgroup
+ \charactercolor
+ \char#2\relax
+ \egroup
+ \scratchwidth \wd\scratchbox
+ \scratchheight\ht\scratchbox
+ \scratchdepth \dp\scratchbox
+ \scratchitalic\ifdefined\glyphscale\glyphxscaled\fontcharic\font#2\relax\else\zeropoint\fi
+ \setbox\scratchbox\hbox\bgroup
+ \ifdim\scratchitalic=\zeropoint\else
+ \hskip\scratchwidth
+ \ifdim\scratchitalic<\zeropoint
+ \hskip\scratchitalic
+ \scratchitalic-\scratchitalic
+ \fi
+ \italiccolor
+ \vrule
+ width \scratchitalic
+ height \scratchheight
+ depth \scratchdepth
+ \relax
+ \hskip-\dimexpr\scratchwidth+\scratchitalic\relax
+ \fi
+ \unhbox\scratchbox
+ \egroup
+ \scratchtotal\dimexpr\scratchwidth+\scratchitalic\relax
+ \wd\scratchbox\scratchtotal
+ %
+ \ifdim\scratchtotal>\zeropoint
\backgroundline[backgroundcolor]{\box\scratchbox}%
- \else\ifdim\scratchdimen<\zeropoint
- \scratchdimen-\scratchdimen
- \setbox\scratchbox\hbox to \scratchdimen{\hss\charactercolor\char#2}%
+ \else\ifdim\scratchtotal<\zeropoint
+ % really negative width?
+ \scratchtotal-\scratchtotal
+ \setbox\scratchbox\hbox to \scratchtotal{\hss\charactercolor\char#2}%
\backgroundline[backgroundcolorx]{\box\scratchbox}%
\else
\setbox\scratchbox\hbox to \emwidth{\hss\charactercolor\char#2}%
- \scratchdimen\wd\scratchbox
+ \scratchtotal\wd\scratchbox
\backgroundline[backgroundcolory]{\box\scratchbox}%
\fi\fi
- \hskip-\scratchdimen
- \baselinecolor\vrule width \scratchdimen height .05\exheight depth .05\exheight
- \endgroup}%
+ \hskip-\scratchtotal
+ \baselinecolor\vrule width \scratchtotal height .05\exheight depth .05\exheight
+ %
+ \ifdefined\glyphscale
+ \scratchdimen\glyphyscaled\fontcharta\font#2\relax
+ \ifdim\scratchdimen=\zeropoint\else
+ \hskip-\scratchtotal
+ \hbox to \scratchwidth yoffset \scratchheight \bgroup
+ \hskip\scratchdimen
+ \anchorcolor
+ \vrule
+ width .10\exheight
+ height .05\exheight
+ depth .05\exheight
+ \relax
+ \hss
+ \egroup
+ \hskip\scratchitalic
+ \fi
+ \fi
+ \egroup}%
\fi}
\unexpanded\def\showmathcharactersmth#1#2%
@@ -325,17 +371,50 @@
[preset=middlebottom,voffset=5mm]
{\showmathcharactersbodyfontschars{#2}}}}
-% dimensions
-
-\unexpanded\def\showmathcharactersentrywdhtdpic#1#2#3#4%
- {\setlayer
- [page]
- [preset=leftbottom,offset=5mm]
- {\somedata[align=normal,width=5cm]
- {\strut width \hfill \the\dimexpr#1\scaledpoint\par
- \strut height\hfill \the\dimexpr#2\scaledpoint\par
- \strut depth \hfill \the\dimexpr#3\scaledpoint\par
- \strut italic\hfill \the\dimexpr#4\scaledpoint}}}
+% dimensions (we can ask them in tex)
+
+\ifcase\contextlmtxmode
+
+ \unexpanded\def\showmathcharactersentrywdhtdpicta#1#2#3#4#5%
+ {\setlayer
+ [page]
+ [preset=leftbottom,offset=5mm]
+ {\somedata[align=normal,width=5cm]
+ {\strut width \hfill \the\dimexpr#1\scaledpoint\par
+ \strut height\hfill \the\dimexpr#2\scaledpoint\par
+ \strut depth \hfill \the\dimexpr#3\scaledpoint\par
+ \ifnum#4=\zerocount\else
+ \strut italic\hfill \the\dimexpr#4\scaledpoint\par
+ \fi
+ \ifnum#5=\zerocount\else
+ \strut accent\hfill \the\dimexpr#5\scaledpoint
+ \fi
+ }}}
+
+\else
+
+ \unexpanded\def\showmathcharactersentrywdhtdpicta#1%
+ {\setlayer
+ [page]
+ [preset=leftbottom,offset=5mm]
+ {\somedata[align=normal,width=5cm]
+ {\scratchwidth \glyphxscaled\fontcharwd\font#1%
+ \scratchheight\glyphxscaled\fontcharht\font#1%
+ \scratchdepth \glyphxscaled\fontchardp\font#1%
+ \scratchitalic\glyphxscaled\fontcharic\font#1%
+ \scratchdimen \glyphxscaled\fontcharta\font#1%
+ \strut width \hfill \the\scratchwidth \par
+ \strut height\hfill \the\scratchheight\par
+ \strut depth \hfill \the\scratchdepth \par
+ \ifnum\scratchitalic=\zerocount\else
+ \strut italic\hfill \the\scratchitalic\par
+ \fi
+ \ifnum\scratchdimen=\zerocount\else
+ \strut accent\hfill \the\scratchdimen
+ \fi
+ }}}
+
+\fi
\unexpanded\def\showmathcharactersentryresource#1%
{} % {virtual: #1\par}
@@ -459,16 +538,20 @@
\continueifinputfile{s-math-repertoire.mkiv}
+% \enabledirectives[math.nogoodies]
+
% \showmathcharacterssetbodyfonts{lucidaot,cambria,xits,stixtwo,modern,pagella,termes,bonum,schola,dejavu}
+\showmathcharacterssetbodyfonts{lucidaot,cambria,stixtwo,modern,pagella,termes,bonum,schola,ebgaramond,dejavu,modernlatin}
% \showmathcharacterssetbodyfonts{newcomputermodern-book,lucidaot,cambria,stixtwo,modern,pagella,termes,bonum,schola,dejavu}
% \showmathcharacterssetbodyfonts{newcomputermodern-book,stixtwo,modern,pagella,termes,bonum,schola,dejavu}
-\showmathcharacterssetbodyfonts{newcomputermodern-book,lucidaot,cambria,stixtwo,modern,pagella,termes,schola,dejavu}
+% \showmathcharacterssetbodyfonts{newcomputermodern-book,lucidaot,cambria,stixtwo,modern,pagella,termes,schola,dejavu}
+% \showmathcharacterssetbodyfonts{modernlatin,lucidaot,cambria,stixtwo,modern,pagella,termes,schola,dejavu}
\starttext
\doifelse {\getdocumentargument{bodyfont}} {} {
- % \setupbodyfont[cambria, 12pt]
+ \setupbodyfont[cambria, 12pt]
% \setupbodyfont[modern, 12pt]
% \setupbodyfont[lmvirtual, 12pt]
% \setupbodyfont[pxvirtual, 12pt]
@@ -484,7 +567,7 @@
% \setupbodyfont[schola, 12pt]
% \setupbodyfont[dejavu, 12pt]
% \setupbodyfont[lucidaot, 12pt]
- \setupbodyfont[newcomputermodern-book, 12pt]
+ % \setupbodyfont[newcomputermodern-book, 12pt]
} {
diff --git a/tex/context/modules/mkxl/m-barcodes.mkxl b/tex/context/modules/mkxl/m-barcodes.mkxl
index 43540e457..0ded9bbd6 100644
--- a/tex/context/modules/mkxl/m-barcodes.mkxl
+++ b/tex/context/modules/mkxl/m-barcodes.mkxl
@@ -31,10 +31,13 @@
\continueifinputfile{m-barcodes.mkxl}
\starttext
- \startTEXpage
- \barcode[type=isbn,text=978-9490688011]
- \blank
- \barcode[type=isbn,text=9780500518724]
+ \startTEXpage[offset=1dk]
+ \startcombination[2*2]
+ {\barcode[type=isbn,text=978-9490688011,width=3cm]} {}
+ {\barcode[type=isbn,text=9780500518724,width=3cm]} {}
+ {\barcode[type=datamatrix,text=whatever,width=3cm,option=--square]} {}
+ {\barcode[type=maxicode,text=whatever,width=3cm]} {}
+ \stopcombination
\stopTEXpage
\stoptext
diff --git a/tex/context/modules/mkxl/m-json.mkxl b/tex/context/modules/mkxl/m-json.mkxl
index 46c2f79a7..893abbe75 100644
--- a/tex/context/modules/mkxl/m-json.mkxl
+++ b/tex/context/modules/mkxl/m-json.mkxl
@@ -41,7 +41,7 @@
end,
arguments = "2 arguments",
public = true,
-protected = true,
+ protected = true,
}
interfaces.implement {
diff --git a/tex/context/modules/mkxl/m-oldmath.mkxl b/tex/context/modules/mkxl/m-oldmath.mkxl
new file mode 100644
index 000000000..248ff66bd
--- /dev/null
+++ b/tex/context/modules/mkxl/m-oldmath.mkxl
@@ -0,0 +1,142 @@
+%D \module
+%D [ file=m-oldmath,
+%D version=2022.06.17,
+%D title=Math,
+%D subtitle=Fallback to old stuff,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is therefore copyrighted
+%D by \PRAGMA. See mreadme.pdf for details.
+
+%D For the \type {\over} die|-|hards (for this occasion I checked out Outlaw Vern's
+%D updated review on that movie):
+
+\unprotect
+
+\mathgroupingmode \zerocount
+
+\permanent\protected\def\eqalign#1% rather plain, is this used at all ...
+ {\dontleavehmode
+ \mskip\thinmuskip\vcenter\bgroup % \vcenter \s!class \mathwrappercode \bgroup
+ \mathsurround\zeropoint % \math_eqalign_set_defaults
+ \ialign
+ {\strut
+ \hfil
+ \mathbeginclass\mathordcode
+ \mathendclass \mathordcode
+ \startforceddisplaymath\aligncontent\stopforceddisplaymath
+ \aligntab
+ \mathbeginclass\mathordcode
+ \mathendclass \mathordcode
+ \startforceddisplaymath\aligncontent\stopforceddisplaymath
+ \hfil
+ \crcr
+ #1%
+ \crcr}%
+ \egroup\mskip\thinmuskip} % \egroup
+
+%D Obsolete:
+
+% \permanent\protected\def\displaylines#1%
+% {\the\mathdisplayaligntweaks
+% \tabskip\zeroskip
+% \halign
+% {\hbox to \displaywidth{%
+% \normalstartimath\tabskip\zeroskip\everycr\emptytoks\hfil\displaystyle\alignmark\alignmark\hfil\normalstopimath}\crcr
+% #1\crcr}}
+
+%D no longer defined:
+
+% \permanent\def\ialign % initialized \halign, to be used grouped!
+% {\everycr\emptytoks
+% \tabskip\zeroskip
+% \halign}
+%
+% \permanent\def\oalign#1%
+% {\leavevmode % plain tex uses this
+% \vtop
+% {\baselineskip\zeroskip
+% \lineskip.25\exheight
+% \ialign{\alignmark\alignmark\crcr#1\crcr}}}
+%
+% \permanent\def\ooalign % chars over each other
+% {\lineskiplimit-\maxdimen
+% \oalign}
+
+%D More old plain stuff:
+
+\permanent\protected\def\buildrel#1\over#2%
+ {\mathrel{\mathop{\kern\zeropoint#2}\limits^{#1}}}
+
+\permanent\protected\def\math_openup
+ {\afterassignment\math_openup_indeed\scratchdimen}
+
+\aliased\let\math_closeup\relax
+
+\def\math_openup_indeed
+ {\enforced\permanent\protected\edef\math_closeup
+ {\lineskip \the\lineskip
+ \baselineskip \the\baselineskip
+ \lineskiplimit\the\lineskiplimit
+ \relax}%
+ \advance\lineskip \scratchdimen
+ \advance\baselineskip \scratchdimen
+ \advance\lineskiplimit\scratchdimen}
+
+\permanent\protected\def\openup {\math_openup } % the low level ones are used elsewhere
+\permanent\protected\def\closeup{\math_closeup} % the low level ones are used elsewhere
+
+%D Who knows:
+
+\permanent\protected\def\choose{\atopwithdelims()} % used in korean test file, has to go
+\permanent\protected\def\brack {\atopwithdelims[]}
+\permanent\protected\def\brace {\atopwithdelims\{\}}
+
+%D We have better ways:
+
+\permanent\protected\def\cases#1%
+ {\left\{%
+ \mskip\thinmuskip
+ \vcenter
+ {\normalbaselines
+ \mathsurround\zeropoint
+ \ialign{%
+ \normalstartimath\alignmark\alignmark\hfil\normalstopimath
+ \aligntab
+ \quad\alignmark\alignmark\hfil
+ \crcr
+ #1%
+ \crcr}}%
+ \right.}
+
+\permanent\protected\def\matrix#1%
+ {\emptyhbox
+ \mskip\thinmuskip
+ \vcenter
+ {\normalbaselines
+ \mathsurround\zeropoint
+ \ialign{%
+ \hfil\normalstartimath\alignmark\alignmark\normalstopimath\hfil
+ \aligntab
+ \aligntab
+ \quad\hfil\normalstartimath\alignmark\alignmark\normalstopimath\hfil
+ \crcr
+ \mathstrut
+ \crcr
+ \noalign{\kern-\baselineskip}
+ #1\crcr
+ \mathstrut
+ \crcr
+ \noalign{\kern-\baselineskip}}}%
+ \mskip\thinmuskip}
+
+\permanent\protected\def\pmatrix#1%
+ {\left(\matrix{#1}\right)}
+
+
+
+\protect
+
+\endinput
diff --git a/tex/context/modules/mkxl/s-layout-show.mkxl b/tex/context/modules/mkxl/s-layout-show.mkxl
index 95a6d3371..948b0953f 100644
--- a/tex/context/modules/mkxl/s-layout-show.mkxl
+++ b/tex/context/modules/mkxl/s-layout-show.mkxl
@@ -118,6 +118,36 @@
\NC inner margin \NC \the\innermarginwidth \NC \NR
\stoptabulate}
+\permanent\protected\gdef\showcentering
+ {\setupbackgrounds
+ [\v!text]
+ [\c!background=centeringlines]}
+
+\defineoverlay
+ [centeringlines]
+ [\vpack to \d_overlay_height \bgroup
+ \vfill
+ \hpack to \d_overlay_width \bgroup
+ \hss
+ \hskip1cm
+ \dorecurse{15}{%
+ \kern-.25\onepoint
+ \ifodd\recurselevel
+ \darkred
+ \else
+ \darkblue
+ \fi
+ \vrule
+ height.5\d_overlay_height
+ depth .5\d_overlay_height
+ width .5\onepoint
+ \hskip1cm
+ }%
+ \hss
+ \egroup
+ \vfill
+ \egroup]
+
%D Page grids:
\newconstant\c_page_grids_location
diff --git a/tex/context/modules/mkxl/s-math-tweaks.mkxl b/tex/context/modules/mkxl/s-math-tweaks.mkxl
index 2579f1ec4..8a70d431f 100644
--- a/tex/context/modules/mkxl/s-math-tweaks.mkxl
+++ b/tex/context/modules/mkxl/s-math-tweaks.mkxl
@@ -147,6 +147,151 @@
\stopsubject
\stoptexdefinition
+\starttexdefinition protected showmathalphabettweaks_check_flush #1
+ \dontleavehmode
+ \hbox \bgroup
+ \smallinfofont
+ \setstrut
+ \lower \dimexpr\dp\scratchbox+\ht\strutbox\relax \hbox to \wd\scratchbox\bgroup
+ \hss
+ \strut
+ \hexnumber{#1}
+ \hss
+ \egroup
+ \hskip-\wd\scratchbox
+ \box\scratchbox
+ \egroup
+\stoptexdefinition
+
+\starttexdefinition protected showmathalphabettweaks_check_scripts
+ \subscript 1
+ \superscript 2
+ \subprescript 3
+ \superprescript4
+\stoptexdefinition
+
+\starttexdefinition protected showmathalphabettweaks_check_hat #1
+ \setbox\scratchbox\ruledhbox {
+ \im {
+ \resetmathattributes
+ \widehat{\Uchar#1}
+ \showmathalphabettweaks_check_scripts
+ }
+ }
+ \showmathalphabettweaks_check_flush{#1}
+\stoptexdefinition
+
+\starttexdefinition protected showmathalphabettweaks_check_fences #1
+ \setbox\scratchbox\ruledhbox {
+ \im {
+ \resetmathattributes
+ \left(
+ \Uchar#1
+ \showmathalphabettweaks_check_scripts
+ \right)
+ }
+ }
+ \showmathalphabettweaks_check_flush{#1}
+\stoptexdefinition
+
+\starttexdefinition protected showmathalphabettweaks_check #1#2
+ \startsubsubsubject[title=#1]
+ \traverseblock {#1} {
+ \begingroup
+ \showglyphs
+ \showfontitalics
+ \showfontkerns
+ #2{##1}%
+ \endgroup
+ \space\space
+ }
+ \removeunwantedspaces
+ \stopsubsubsubject
+\stoptexdefinition
+
+\starttexdefinition protected showmathalphabettweaks_all #1
+ \startsubsubject[title={Numbers}]
+ \showmathalphabettweaks_check{digits normal}#1
+ \showmathalphabettweaks_check{digits bold}#1
+ \showmathalphabettweaks_check{digits sansserif normal}#1
+ \showmathalphabettweaks_check{digits sansserif bold}#1
+ \showmathalphabettweaks_check{digits monospace}#1
+ \showmathalphabettweaks_check{digits doublestruck}#1
+ \stopsubsubject
+ \startsubsubject[title={Lowercase}]
+ \showmathalphabettweaks_check{lowercase normal}#1
+ \showmathalphabettweaks_check{lowercase italic}#1
+ \showmathalphabettweaks_check{lowercase bold}#1
+ \showmathalphabettweaks_check{lowercase bold italic}#1
+ \showmathalphabettweaks_check{lowercase sansserif normal}#1
+ \showmathalphabettweaks_check{lowercase sansserif italic}#1
+ \showmathalphabettweaks_check{lowercase sansserif bold}#1
+ \showmathalphabettweaks_check{lowercase sansserif bolditalic}#1
+ \showmathalphabettweaks_check{lowercase monospace}#1
+ \showmathalphabettweaks_check{lowercase fraktur}#1
+ \showmathalphabettweaks_check{lowercase bold fraktur}#1
+ \showmathalphabettweaks_check{lowercase script}#1
+ \showmathalphabettweaks_check{lowercase bold script}#1
+ \showmathalphabettweaks_check{lowercase doublestruck}#1
+ \showmathalphabettweaks_check{lowercase greek normal}#1
+ \showmathalphabettweaks_check{lowercase greek italic}#1
+ \showmathalphabettweaks_check{lowercase greek bold}#1
+ \showmathalphabettweaks_check{lowercase greek bold italic}#1
+ % \showmathalphabettweaks_check{lowercase greek sansserif normal}#1
+ % \showmathalphabettweaks_check{lowercase greek sansserif italic}#1
+ \showmathalphabettweaks_check{lowercase greek sansserif bold}#1
+ \showmathalphabettweaks_check{lowercase greek sansserif bolditalic}#1
+ \stopsubsubject
+ \startsubsubject[title={Uppercase}]
+ \showmathalphabettweaks_check{uppercase normal}#1
+ \showmathalphabettweaks_check{uppercase italic}#1
+ \showmathalphabettweaks_check{uppercase bold}#1
+ \showmathalphabettweaks_check{uppercase bolditalic}#1
+ \showmathalphabettweaks_check{uppercase sansserif normal}#1
+ \showmathalphabettweaks_check{uppercase sansserif italic}#1
+ \showmathalphabettweaks_check{uppercase sansserif bold}#1
+ \showmathalphabettweaks_check{uppercase sansserif bolditalic}#1
+ \showmathalphabettweaks_check{uppercase monospace}#1
+ \showmathalphabettweaks_check{uppercase fraktur}#1
+ \showmathalphabettweaks_check{uppercase bold fraktur}#1
+ \showmathalphabettweaks_check{uppercase script}#1
+ \showmathalphabettweaks_check{uppercase bold script}#1
+ \showmathalphabettweaks_check{uppercase doublestruck}#1
+ \showmathalphabettweaks_check{uppercase greek normal}#1
+ \showmathalphabettweaks_check{uppercase greek italic}#1
+ \showmathalphabettweaks_check{uppercase greek bold}#1
+ \showmathalphabettweaks_check{uppercase greek bolditalic}#1
+ \showmathalphabettweaks_check{uppercase greek sansserif bold}#1
+ \showmathalphabettweaks_check{uppercase greek sansserif bolditalic}#1
+ \stopsubsubject
+\stoptexdefinition
+
+\starttexdefinition protected showmathaccenttweaks
+ \showmathalphabettweaks_all\showmathalphabettweaks_check_hat
+\stoptexdefinition
+
+\starttexdefinition protected showmathfencetweaks
+ \showmathalphabettweaks_all\showmathalphabettweaks_check_fences
+\stoptexdefinition
+
+\starttexdefinition protected showmathmiddletweaks
+ \dostepwiserecurse {5} {75} {1} {
+ $\left\{
+ \mathatom class \mathconstructcode \bgroup \vcenter \bgroup \hbox \bgroup
+ \blackrule
+ [\c!height=\dimexpr##1pt/2\relax,
+ \c!depth=\dimexpr##1pt/2\relax,
+ \c!width=\emwidth,
+ \c!color=darkblue]%
+ \egroup \egroup \egroup
+ \middle|
+ % \begingroup\darkblue\scriptscriptstyle\mathtt{##1}\endgroup
+ \right)$
+ \space
+ }
+ \removeunwantedspaces
+\stoptexdefinition
+
\protect
\stopmodule
@@ -156,30 +301,55 @@
\setuplayout
[tight]
+\setuphead
+ [chapter]
+ [style=\bfd]
+
+\setuphead
+ [section]
+ [style=\bfc]
+
+\setuphead
+ [subsection]
+ [style=\bfb]
+
+\setuphead
+ [subsubsection]
+ [before=\blank,
+ style=\bfa]
+
+% \enabletrackers[math.tweaks]
+
\starttext
-\definefontfeature[mathextra][compose=yes]
+% \definefontfeature[mathextra][compose=yes]
-% \number"23DC
\doifelse {\getdocumentargument{bodyfont}} {} {
% \setupbodyfont[cambria,10pt] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
-% \setupbodyfont[modern] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
+% \setupbodyfont[modern] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
% \setupbodyfont[pagella] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
% \setupbodyfont[termes] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
% \setupbodyfont[bonum] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
% \setupbodyfont[schola] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
% \setupbodyfont[lucidaot,10pt] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
- \setupbodyfont[ebgaramond] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
+% \setupbodyfont[ebgaramond] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
% \setupbodyfont[stixtwo] \starttitle[title=\fontclass] \showmathfonttweaks \stoptitle
+% \setupbodyfont[bonum] \starttitle[title=\fontclass] \showmathaccenttweaks \stoptitle
+
+% \setupbodyfont[bonum] \starttitle[title=\fontclass] \showmathfencetweaks \stoptitle
+ \setupbodyfont[bonum] \starttitle[title=\fontclass] \showmathmiddletweaks \stoptitle
+% \setupbodyfont[modern] \starttitle[title=\fontclass] \showmathfencetweaks \stoptitle
+
} {
\normalexpanded{\setupbodyfont[\getdocumentargument{bodyfont},12pt]}
\showmathfonttweaks
-
+ \showmathaccenttweaks
+ \showmathfencetweaks
+ \showmathmiddletweaks
}
-
\stoptext
diff --git a/tex/context/modules/mkxl/x-mathml.lmt b/tex/context/modules/mkxl/x-mathml.lmt
index 5d4653268..30a435cde 100644
--- a/tex/context/modules/mkxl/x-mathml.lmt
+++ b/tex/context/modules/mkxl/x-mathml.lmt
@@ -610,44 +610,108 @@ function mathml.mfenced(id) -- multiple separators
ctx_disabledelimiter()
end
-local function flush(e,tag,toggle)
- if tag == "none" then
- -- if not toggle then
- context("{}") -- {} starts a new ^_ set
- -- end
- elseif toggle then
- context("^{")
- xmlsprint(e.dt)
- context("}{}") -- {} starts a new ^_ set
- else
- context("_{")
- xmlsprint(e.dt)
- context("}")
- end
- return not toggle
-end
+-- local function flush(e,tag,toggle)
+-- if tag == "none" then
+-- -- if not toggle then
+-- context("{}") -- {} starts a new ^_ set
+-- -- end
+-- elseif toggle then
+-- context("^{")
+-- xmlsprint(e.dt)
+-- context("}{}") -- {} starts a new ^_ set
+-- else
+-- context("_{")
+-- xmlsprint(e.dt)
+-- context("}")
+-- end
+-- return not toggle
+-- end
+--
+-- function mathml.mmultiscripts(id)
+-- local done, toggle = false, false
+-- for e in lxmlcollected(id,"/*") do
+-- local tag = e.tg
+-- if tag == "mprescripts" then
+-- context("{}")
+-- done = true
+-- elseif done then
+-- toggle = flush(e,tag,toggle)
+-- end
+-- end
+-- local done, toggle = false, false
+-- for e in lxmlcollected(id,"/*") do
+-- local tag = e.tg
+-- if tag == "mprescripts" then
+-- break
+-- elseif done then
+-- toggle = flush(e,tag,toggle)
+-- else
+-- xmlsprint(e)
+-- done = true
+-- end
+-- end
+-- end
function mathml.mmultiscripts(id)
- local done, toggle = false, false
+ local prescripts = false
+ local subscripts = true
+ local firstdone = false
for e in lxmlcollected(id,"/*") do
- local tag = e.tg
- if tag == "mprescripts" then
- context("{}")
- done = true
- elseif done then
- toggle = flush(e,tag,toggle)
+ if firstdone then
+ xmlsprint(e.dt)
+ firstdone = true
+ else
+ local tag = e.tg
+ if tag == "none" then
+ subscripts = not subscripts
+ elseif tag == "prescripts" then
+ prescripts = true
+ subscripts = true
+ elseif subscripts then
+ if prescripts then
+ context("\\subprescript{")
+ xmlsprint(e.dt)
+ context("}")
+ end
+ subscripts = false
+ else
+ if prescripts then
+ context("\\superprescript{")
+ xmlsprint(e.dt)
+ context("}")
+ end
+ subscripts = true
+ end
end
end
- local done, toggle = false, false
+ local prescripts = false
+ local subscripts = true
+ local firstdone = false
for e in lxmlcollected(id,"/*") do
- local tag = e.tg
- if tag == "mprescripts" then
- break
- elseif done then
- toggle = flush(e,tag,toggle)
+ if firstdone then
+ firstdone = true
else
- xmlsprint(e)
- done = true
+ local tag = e.tg
+ if tag == "none" then
+ subscripts = not subscripts
+ elseif tag == "prescripts" then
+ prescripts = true
+ subscripts = true
+ elseif subscripts then
+ if not prescripts then
+ context("\\subscript{")
+ xmlsprint(e.dt)
+ context("}")
+ end
+ subscripts = false
+ else
+ if not prescripts then
+ context("\\superscript{")
+ xmlsprint(e.dt)
+ context("}")
+ end
+ subscripts = true
+ end
end
end
end
diff --git a/tex/context/modules/mkxl/x-mathml.mkxl b/tex/context/modules/mkxl/x-mathml.mkxl
index 11da32126..07faea353 100644
--- a/tex/context/modules/mkxl/x-mathml.mkxl
+++ b/tex/context/modules/mkxl/x-mathml.mkxl
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D We should update this one wrt grouping and styles.
+
% \xmlfilter{#1}{/*/name()} -> \xmltag
% This implementation looks like a hack ... this is because we deal with all weird
@@ -1299,7 +1301,8 @@
}
} {
% beware, the second {} is needed for the superscript
- \xmlconcatrange{#1}{/*}{2}{}{}\normalsuperscript\prime
+ % \xmlconcatrange{#1}{/*}{2}{}{}\normalsuperscript\prime
+ \xmlconcatrange{#1}{/*}{2}{}{}\prime
}
}
} {
@@ -2023,11 +2026,9 @@
% probably not yet ok
\setdimensionwithunit\scratchdimen\mmlfraclinethickness{pt}
}
- {
- {\mmlfirst{#1}}
- \above\scratchdimen
- {\mmlsecond{#1}}
- }
+% {
+ \Uabove\scratchdimen{\mmlfirst{#1}}{\mmlsecond{#1}}
+% }
\fi
\endgroup
\stopxmlsetups