diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/math-stc.mkvi')
-rw-r--r-- | Master/texmf-dist/tex/context/base/math-stc.mkvi | 375 |
1 files changed, 290 insertions, 85 deletions
diff --git a/Master/texmf-dist/tex/context/base/math-stc.mkvi b/Master/texmf-dist/tex/context/base/math-stc.mkvi index 2dc2b2c22c1..76a07db5c68 100644 --- a/Master/texmf-dist/tex/context/base/math-stc.mkvi +++ b/Master/texmf-dist/tex/context/base/math-stc.mkvi @@ -48,6 +48,10 @@ %D %D In the end we have a more flexible mechanism which also handles text variants. +%D When wrapping up some math developments I decided to add mp support here +%D as well. A nice evening job with Joe Bonamassa performing live on the big +%D screen (real nice bluray's). See meta-imp-mat.mkiv for examples. + % possible improvements: % % - we could skip the left/right offsets when offset=normal, this saves some access time @@ -56,27 +60,40 @@ \installcorenamespace {mathextensiblefallbacks} +% currently no italic correction ... problem is that we don't know yet if we have an italic +% below so we we need to postpone + \def\math_stackers_fallback {\hbox to \scratchwidth{\csname\??mathextensiblefallbacks\ifcsname\??mathextensiblefallbacks\number\scratchunicode\endcsname\number\scratchunicode\fi\endcsname}} %{\csname\??mathextensiblefallbacks\ifcsname\??mathextensiblefallbacks\number\scratchunicode\endcsname\number\scratchunicode\fi\endcsname } +% \def\math_stackers_regular +% {\mathstylehbox{\Umathaccent\fam\zerocount\scratchunicode{\hskip\scratchwidth}}} + \def\math_stackers_regular - {\mathstylehbox{\Umathaccent\fam\zerocount\scratchunicode{\hskip\scratchwidth}}} + {\mathstylehbox{\usemathstackerscolorparameter\c!color + \Umathaccent\fam\zerocount\scratchunicode{\hskip\scratchwidth}}} \def\math_stackers_stretch % we don't have that one yet - {\mathstylehbox{\Umathaccent\fam\zerocount\scratchunicode{\hskip\hsize}}} + {\mathstylehbox{\usemathstackerscolorparameter\c!color + \Umathaccent\fam\zerocount\scratchunicode{\hskip\hsize}}} + +% these delimiters are a unuseable as theu don't center for small arguments: +% +% $\Umathaccent 0 0 "2190{x}$ \par $\Umathaccent 0 0 "27F8{x}$\par +% $\Udelimiterunder 0 "2190{x}$ \par $\Udelimiterunder 0 "27F8{x}$\par \setvalue{\??mathextensiblefallbacks}{\hbox{\vrule\!!width\scratchwidth\!!height.1\exheight\!!depth\zeropoint}} -\def\math_stackers_with_fallback#codepoint% - {\begingroup - \scratchunicode#codepoint\relax - \ifcase\mathextensiblecode\fam\scratchunicode\relax - \math_stackers_fallback - \else - \math_stackers_stretch - \fi - \endgroup} +% \def\math_stackers_with_fallback#codepoint% +% {\begingroup +% \scratchunicode#codepoint\relax +% \ifcase\mathextensiblecode\fam\scratchunicode\relax +% \math_stackers_fallback +% \else +% \math_stackers_stretch +% \fi +% \endgroup} %D We don't really need this because we can assume that fonts have the right %D extensibles. If needed I will make a general virtual extender for \OPENTYPE\ @@ -114,6 +131,12 @@ [%c!alternative=\v!text, % text | mathematics \c!left=, \c!right=, + \c!mathclass=\s!rel, + \c!alternative=\v!normal, + \c!mp=math:stacker:\number\scratchunicode, + \c!mpheight=\exheight, + \c!mpdepth=\exheight, + \c!mpoffset=.25\exheight, \c!voffset=.25\exheight, \c!hoffset=.5\emwidth, \c!minheight=\exheight, @@ -121,7 +144,7 @@ \c!minwidth=\emwidth, \c!order=\v!normal, \c!strut=, - %\c!color=, % todo: when I need it + \c!color=, % todo: when I need it \c!topcommand=, \c!middlecommand=, \c!bottomcommand=, @@ -132,6 +155,7 @@ %D top of the baseline by default. \installcorenamespace {mathstackerslocation} +\installcorenamespace {mathstackersalternative} \letvalue{\??mathstackerslocation\v!top }\plusone % on top of baseline \letvalue{\??mathstackerslocation\v!high }\plustwo % 25 % down @@ -172,6 +196,23 @@ \math_stackers_fallback \fi} +% no checking, we assume sane use + +\letvalue{\??mathstackersalternative\v!normal }\math_stackers_content +\letvalue{\??mathstackersalternative\v!default}\math_stackers_content + +\setvalue{\??mathstackersalternative\v!mp}% + {\hbox\bgroup % todo: add code key + tag + \edef\overlaywidth {\the\scratchwidth}% + \edef\overlayheight {\the\dimexpr\mathstackersparameter\c!mpheight}% + \edef\overlaydepth {\the\dimexpr\mathstackersparameter\c!mpdepth}% + \edef\overlayoffset {\the\dimexpr\mathstackersparameter\c!mpoffset}% + \edef\overlaylinewidth{\the\linewidth}% + \edef\overlaylinecolor{\mathstackersparameter\c!color}% + \edef\p_mp{\mathstackersparameter\c!mp}% + \uniqueMPgraphic{\p_mp}% + \egroup} + \def\math_stackers_check_unicode#codepoint% {\scratchunicode#codepoint\relax \scratchhoffset\mathstackersparameter\c!hoffset\relax @@ -223,11 +264,12 @@ {\begingroup \edef\currentmathstackers{#category}% \mathstackersparameter\c!left\relax - \ifmmode\mathrel\else\dontleavehmode\fi - {\edef\p_offset {\mathstackersparameter\c!offset}% - \edef\p_location{\mathstackersparameter\c!location}% - \edef\p_order {\mathstackersparameter\c!order}% - \edef\p_strut {\mathstackersparameter\c!strut}% + \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi + {\edef\p_offset {\mathstackersparameter\c!offset}% + \edef\p_location {\mathstackersparameter\c!location}% + \edef\p_order {\mathstackersparameter\c!order}% + \edef\p_strut {\mathstackersparameter\c!strut}% + \edef\p_alternative{\mathstackersparameter\c!alternative}% \ifx\p_order\v!reverse \edef\m_math_stackers_text_top {#bottomtext}% \edef\m_math_stackers_text_bottom{#toptext}% @@ -285,17 +327,17 @@ \advance\scratchwidth2\scratchhoffset % \ifcase#method\relax - \setbox\scratchboxthree\math_stackers_content + \setbox\scratchboxthree\csname\??mathstackersalternative\p_alternative\endcsname \fi % \ifdim\wd\scratchboxone<\scratchwidth - \setbox\scratchboxone\hbox to \scratchwidth{\hss\box\scratchboxone\hss}% + \setbox\scratchboxone\hbox to \scratchwidth{\hss\unhbox\scratchboxone\hss}% unhboxing makes leaders work \fi \ifdim\wd\scratchboxtwo<\scratchwidth - \setbox\scratchboxtwo\hbox to \scratchwidth{\hss\box\scratchboxtwo\hss}% + \setbox\scratchboxtwo\hbox to \scratchwidth{\hss\unhbox\scratchboxtwo\hss}% \fi \ifdim\wd\scratchboxthree<\scratchwidth - \setbox\scratchboxthree\hbox to \scratchwidth{\hss\box\scratchboxthree\hss}% + \setbox\scratchboxthree\hbox to \scratchwidth{\hss\unhbox\scratchboxthree\hss}% \fi % \ifcsname\??mathstackerslocation\p_location\endcsname @@ -395,17 +437,30 @@ %D The next one deals with under and over extensibles (arrows mostly): -\unexpanded\def\math_stackers_double#where#category#codepoint#text% +\installcorenamespace {mathclasses} + +\letvalue{\??mathclasses }\mathord +\letvalue{\??mathclasses rel}\mathrel +\letvalue{\??mathclasses ord}\mathord + +\def\math_class_by_parameter#1% + {\normalexpanded{\noexpand\math_class_by_parameter_indeed{#1\c!mathclass}}} + +\def\math_class_by_parameter_indeed#1% + {\csname\??mathclasses\ifcsname\??mathclasses#1\endcsname#1\fi\endcsname} + +\unexpanded\def\math_stackers_make_double#top#bottom#category#codepoint#codeextra#text% {\begingroup \edef\currentmathstackers{#category}% \mathstackersparameter\c!left\relax - \ifmmode\mathrel\else\dontleavehmode\fi + \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi {\edef\currentmathstackers{#category}% \edef\m_math_stackers_text_middle {#text}% % - \edef\p_offset {\mathstackersparameter\c!offset}% - \edef\p_location{\mathstackersparameter\c!location}% - \edef\p_strut {\mathstackersparameter\c!strut}% + \edef\p_offset {\mathstackersparameter\c!offset}% + \edef\p_location {\mathstackersparameter\c!location}% + \edef\p_strut {\mathstackersparameter\c!strut}% + \edef\p_alternative{\mathstackersparameter\c!alternative}% % \scratchleftoffset \zeropoint \scratchrightoffset\zeropoint @@ -425,7 +480,7 @@ \fi \advance\scratchwidth2\scratchhoffset % - \setbox\scratchboxtwo \math_stackers_content + \setbox\scratchboxtwo \csname\??mathstackersalternative\p_alternative\endcsname \setbox\scratchboxthree\hbox to \scratchwidth{\hss\box\scratchboxthree\hss}% % \math_stackers_normalize_three @@ -436,49 +491,74 @@ % \ifdim\htdp\scratchboxtwo>\zeropoint \kern-\scratchwidth - \ifcase#where\relax + \ifcase#top\else \math_stackers_top\bgroup - \raise\dimexpr\scratchheight+\scratchtopoffset\relax + % \raise\dimexpr\scratchheight+\scratchtopoffset\relax + \raise\dimexpr\scratchheight+\mathstackersparameter\c!voffset\relax \box\scratchboxtwo \egroup - \else + \fi + \scratchunicode#codeextra\relax + \ifcase\scratchunicode\else + \kern-\scratchwidth + \setbox\scratchboxtwo\csname\??mathstackersalternative\p_alternative\endcsname + \fi + \ifcase#bottom\else \math_stackers_bottom\bgroup - \lower\dimexpr\scratchdepth+\ht\scratchboxtwo+\scratchbottomoffset\relax + % \lower\dimexpr\scratchdepth+\ht\scratchboxtwo+\scratchbottomoffset\relax + \lower\dimexpr\scratchdepth+\ht\scratchboxtwo+\mathstackersparameter\c!voffset\relax \box\scratchboxtwo \egroup \fi \fi}% \mathstackersparameter\c!right\relax - \endgroup} - -\unexpanded\def\definemathoverextensible {\dotripleempty\math_extensiblies_define_over } -\unexpanded\def\definemathunderextensible{\dotripleempty\math_extensiblies_define_under} - -\def\math_extensiblies_define_over[#1][#2][#3]% + \edef\p_limits{\mathstackersparameter\c!mathlimits}% + \ifx\p_limits\v!yes + \expandafter\endgroup\expandafter\limits + \else + \expandafter\endgroup + \fi} + +\unexpanded\def\definemathoverextensible {\dotripleempty \math_extensibles_define_over } +\unexpanded\def\definemathunderextensible {\dotripleempty \math_extensibles_define_under} +\unexpanded\def\definemathdoubleextensible{\doquadrupleempty\math_extensibles_define_double} + +\def\math_extensibles_define_over[#1][#2][#3]% {\ifthirdargument - \setuevalue{#2}{\math_stackers_double\zerocount{#1}{\number#3}}% + \setuevalue{#2}{\math_stackers_make_double\plusone \zerocount{#1}{\number#3}{0}}% \else - \setuevalue{#1}{\math_stackers_double\zerocount\noexpand\currentmathstackers{\number#2}}% + \setuevalue{#1}{\math_stackers_make_double\plusone \zerocount\noexpand\currentmathstackers{\number#2}{0}}% \fi} -\def\math_extensiblies_define_under[#1][#2][#3]% +\def\math_extensibles_define_under[#1][#2][#3]% {\ifthirdargument - \setuevalue{#2}{\math_stackers_double\plusone{#1}{\number#3}}% + \setuevalue{#2}{\math_stackers_make_double\zerocount\plusone{#1}{\number#3}{0}}% + \else + \setuevalue{#1}{\math_stackers_make_double\zerocount\plusone\noexpand\currentmathstackers{\number#2}{0}}% + \fi} + +\def\math_extensibles_define_double[#1][#2][#3][#4]% + {\iffourthargument + \setuevalue{#2}{\math_stackers_make_double\plusone \plusone{#1}{\number#3}{\number#4}}% \else - \setuevalue{#1}{\math_stackers_double\plusone\noexpand\currentmathstackers{\number#2}}% + \setuevalue{#1}{\math_stackers_make_double\plusone \plusone\noexpand\currentmathstackers{\number#2}{\number#3}}% \fi} -\unexpanded\def\mathover {\begingroup\dosingleempty\math_stackers_handle_over } -\unexpanded\def\mathunder{\begingroup\dosingleempty\math_stackers_handle_under} +\unexpanded\def\mathover {\begingroup\dosingleempty\math_stackers_handle_over } +\unexpanded\def\mathunder {\begingroup\dosingleempty\math_stackers_handle_under } +\unexpanded\def\mathdouble{\begingroup\dodoubleempty\math_stackers_handle_double} \def\math_stackers_handle_over[#category]% - {\math_stackers_handle_double\zerocount{\iffirstargument#category\else\v!top \fi}} % will be defined later on + {\math_stackers_direct_double\plusone\zerocount{\iffirstargument#category\else\v!top \fi}} % will be defined later on \def\math_stackers_handle_under[#category]#codepoint#bottomtext% - {\math_stackers_handle_double\plusone {\iffirstargument#category\else\v!bottom\fi}} % will be defined later on + {\math_stackers_direct_double\zerocount\plusone{\iffirstargument#category\else\v!bottom\fi}} % will be defined later on + +\def\math_stackers_handle_double[#category]#codepoint#bottomtext% + {\math_stackers_direct_double\plusone\plusone {\iffirstargument#category\else\v!bottom\fi}} % will be defined later on -\def\math_stackers_handle_double#location#category#codepoint#text% - {\math_stackers_double#location{#category}{#codepoint}{#text}% +\def\math_stackers_direct_double#top#bottom#category#codepoint#text% + {\math_stackers_make_double#top#bottom{#category}{#codepoint}{#text}% \endgroup} %D Here is a bonus macro that takes three texts. It can be used to get consistent @@ -558,23 +638,79 @@ [\c!order=\v!reverse] \definemathstackers - [\v!top] + [\v!both] [\v!mathematics] - [\c!location=\v!top, + [\c!location=\v!top, % ? \c!strut=\v!no, \c!middlecommand=\mathematics, \c!hoffset=\zeropoint] \definemathstackers + [\v!top] + [\v!both] + +\definemathstackers [\v!bottom] - [\v!mathematics] - [\c!location=\v!top, - \c!strut=\v!no, - \c!middlecommand=\mathematics, - \c!hoffset=\zeropoint] + [\v!both] + +\definemathstackers + [vfenced] + [\v!both] + [\c!mathclass=\s!ord, + \c!mathlimits=\v!yes] % These are compatibity definitions, math only. +% todo: top= bottom= middle= is nicer (compare math-fen) + +%D We save a few definitions that we automatically got from the \type {char-def.lua} +%D database. + +% Be careful in choosing what accents you take (the code below uses a +% combining one): +% +% \startbuffer +% % $\Umathaccent top 0 0 "20D7 {example}$ +% % $\Umathaccent top fixed 0 0 "20D7 {example}$ +% $\Umathaccent 0 0 "20D7 {example}$ +% $\Umathaccent fixed 0 0 "20D7 {example}$ +% $\Umathaccent bottom 0 0 "20D7 {example}$ +% $\Umathaccent bottom fixed 0 0 "20D7 {example}$ +% $\Umathaccent both 0 0 "20D7 +% 0 0 "20D7 {example}$ +% $\Umathaccent both fixed 0 0 "20D7 +% fixed 0 0 "20D7 {example}$ +% $\Umathaccent both 0 0 "20D7 +% fixed 0 0 "20D7 {example}$ +% $\Umathaccent both fixed 0 0 "20D7 +% 0 0 "20D7 {example}$ +% \stopbuffer +% +% \setupbodyfont[modern] \getbuffer +% \setupbodyfont[xits] \getbuffer +% \setupbodyfont[cambria] \getbuffer + +\unexpanded\def\normaldoublebrace {\Umathaccents 0 \defaultmathfamily "23DE 0 \defaultmathfamily "23DF } +\unexpanded\def\normaldoubleparent{\Umathaccents 0 \defaultmathfamily "23DC 0 \defaultmathfamily "23DD } + +% let's keep this + +\let\normaloverbrace \overbrace +\let\normalunderbrace \underbrace +\let\normaloverparent \overparent +\let\normalunderparent \underparent +\let\normaloverbracket \overbracket +\let\normalunderbracket \underbracket +\let\normalunderleftarrow \underleftarrow +\let\normaloverleftarrow \overleftarrow +\let\normalunderrightarrow\underrightarrow +\let\normaloverrightarrow \overrightarrow + +\let\lceil \lceiling +\let\rceil \rceiling + +%D Here come the new ones: + \definemathstackers [\v!none] [\v!mathematics] [\c!hoffset=\zeropoint] \definemathstackers [\v!normal] [\v!mathematics] [\c!hoffset=0.5\emwidth] % the default \definemathstackers [\v!small] [\v!mathematics] [\c!hoffset=1\emwidth] @@ -583,8 +719,12 @@ \definemathextensible [\v!reverse] [xrel] ["002D] \definemathextensible [\v!reverse] [xequal] ["003D] -\definemathextensible [\v!reverse] [xleftarrow] ["2190] -\definemathextensible [\v!reverse] [xrightarrow] ["2192] +\definemathextensible [\v!reverse] [xleftarrow] ["2190] % ["27F5] +\definemathextensible [\v!reverse] [xrightarrow] ["2192] % ["27F6] +\definemathextensible [\v!reverse] [xleftrightarrow] ["27F7] +\definemathextensible [\v!reverse] [xLeftarrow] ["27F8] +\definemathextensible [\v!reverse] [xRightarrow] ["27F9] +\definemathextensible [\v!reverse] [xLeftrightarrow] ["27FA] \definemathextensible [\v!reverse] [xtwoheadleftarrow] ["219E] \definemathextensible [\v!reverse] [xtwoheadrightarrow] ["21A0] \definemathextensible [\v!reverse] [xmapsto] ["21A6] @@ -598,15 +738,15 @@ \definemathextensible [\v!reverse] [xleftrightharpoons] ["21CB] \definemathextensible [\v!reverse] [xrightleftharpoons] ["21CC] \definemathextensible [\v!reverse] [xtriplerel] ["2261] -\definemathextensible [\v!reverse] [xleftrightarrow] ["27F7] -\definemathextensible [\v!reverse] [xLeftarrow] ["27F8] -\definemathextensible [\v!reverse] [xRightarrow] ["27F9] -\definemathextensible [\v!reverse] [xLeftrightarrow] ["27FA] \definemathextensible [\v!mathematics] [mrel] ["002D] \definemathextensible [\v!mathematics] [mequal] ["003D] -\definemathextensible [\v!mathematics] [mleftarrow] ["2190] -\definemathextensible [\v!mathematics] [mrightarrow] ["2192] +\definemathextensible [\v!mathematics] [mleftarrow] ["2190] % ["27F5] +\definemathextensible [\v!mathematics] [mrightarrow] ["2192] % ["27F6] +\definemathextensible [\v!mathematics] [mleftrightarrow] ["27F7] +\definemathextensible [\v!mathematics] [mLeftarrow] ["27F8] +\definemathextensible [\v!mathematics] [mRightarrow] ["27F9] +\definemathextensible [\v!mathematics] [mLeftrightarrow] ["27FA] \definemathextensible [\v!mathematics] [mtwoheadleftarrow] ["219E] \definemathextensible [\v!mathematics] [mtwoheadrightarrow] ["21A0] \definemathextensible [\v!mathematics] [mmapsto] ["21A6] @@ -620,18 +760,18 @@ \definemathextensible [\v!mathematics] [mleftrightharpoons] ["21CB] \definemathextensible [\v!mathematics] [mrightleftharpoons] ["21CC] \definemathextensible [\v!mathematics] [mtriplerel] ["2261] -\definemathextensible [\v!mathematics] [mleftrightarrow] ["27F7] -\definemathextensible [\v!mathematics] [mLeftarrow] ["27F8] -\definemathextensible [\v!mathematics] [mRightarrow] ["27F9] -\definemathextensible [\v!mathematics] [mLeftrightarrow] ["27FA] \definemathextensible [\v!text] [trel] ["002D] \definemathextensible [\v!text] [tequal] ["003D] -\definemathextensible [\v!text] [tleftarrow] ["2190] -\definemathextensible [\v!text] [trightarrow] ["2192] +\definemathextensible [\v!text] [tmapsto] ["21A6] +\definemathextensible [\v!text] [tleftarrow] ["2190] % ["27F5] +\definemathextensible [\v!text] [trightarrow] ["2192] % ["27F6] +\definemathextensible [\v!text] [tleftrightarrow] ["27F7] +\definemathextensible [\v!text] [tLeftarrow] ["27F8] +\definemathextensible [\v!text] [tRightarrow] ["27F9] +\definemathextensible [\v!text] [tLeftrightarrow] ["27FA] \definemathextensible [\v!text] [ttwoheadleftarrow] ["219E] \definemathextensible [\v!text] [ttwoheadrightarrow] ["21A0] -\definemathextensible [\v!text] [tmapsto] ["21A6] \definemathextensible [\v!text] [thookleftarrow] ["21A9] \definemathextensible [\v!text] [thookrightarrow] ["21AA] \definemathextensible [\v!text] [tleftharpoondown] ["21BD] @@ -642,30 +782,59 @@ \definemathextensible [\v!text] [tleftrightharpoons] ["21CB] \definemathextensible [\v!text] [trightleftharpoons] ["21CC] \definemathextensible [\v!text] [ttriplerel] ["2261] -\definemathextensible [\v!text] [tleftrightarrow] ["27F7] -\definemathextensible [\v!text] [tLeftarrow] ["27F8] -\definemathextensible [\v!text] [tRightarrow] ["27F9] -\definemathextensible [\v!text] [tLeftrightarrow] ["27FA] -\definemathoverextensible [\v!top] [overleftarrow] ["2190] -\definemathoverextensible [\v!top] [overrightarrow] ["2192] +\definemathoverextensible [\v!top] [overleftarrow] ["2190] % ["27F5] +\definemathoverextensible [\v!top] [overrightarrow] ["2192] % ["27F6] +\definemathoverextensible [\v!top] [overleftrightarrow] ["27F7] +\definemathoverextensible [\v!top] [overtwoheadleftarrow] ["27F8] +\definemathoverextensible [\v!top] [overtwoheadrightarrow] ["27F9] \definemathoverextensible [\v!top] [overleftharpoondown] ["21BD] \definemathoverextensible [\v!top] [overleftharpoonup] ["21BC] \definemathoverextensible [\v!top] [overrightharpoondown] ["21C1] \definemathoverextensible [\v!top] [overrightharpoonup] ["21C0] -\definemathoverextensible [\v!top] [overleftrightarrow] ["27F7] -\definemathoverextensible [\v!top] [overtwoheadleftarrow] ["27F8] -\definemathoverextensible [\v!top] [overtwoheadrightarrow] ["27F9] -\definemathunderextensible [\v!bottom] [underleftarrow] ["2190] -\definemathunderextensible [\v!bottom] [underrightarrow] ["2192] +\definemathunderextensible [\v!bottom] [underleftarrow] ["2190] % ["27F5] +\definemathunderextensible [\v!bottom] [underrightarrow] ["2192] % ["27F6] +\definemathunderextensible [\v!bottom] [underleftrightarrow] ["27F7] +\definemathunderextensible [\v!bottom] [undertwoheadleftarrow] ["27F8] +\definemathunderextensible [\v!bottom] [undertwoheadrightarrow] ["27F9] \definemathunderextensible [\v!bottom] [underleftharpoondown] ["21BD] \definemathunderextensible [\v!bottom] [underleftharpoonup] ["21BC] \definemathunderextensible [\v!bottom] [underrightharpoondown] ["21C1] \definemathunderextensible [\v!bottom] [underrightharpoonup] ["21C0] -\definemathunderextensible [\v!bottom] [underleftrightarrow] ["27F7] -\definemathunderextensible [\v!bottom] [undertwoheadleftarrow] ["27F8] -\definemathunderextensible [\v!bottom] [undertwoheadrightarrow] ["27F9] + +% We don't use overline and underline. This is one of the overlooked aspects of +% unicode cq. opentype math: why treat rules different than e.g. arrows and +% accents. It is a bit unfortunate that the opportunity to move math to new +% technologies happened outside the tex domain (and/or some aspects were kept +% while in fact they were side effects of limitations of traditional fonts). +% From the unicode aware tex engines' implementation point of view things +% could have been done a bit nicer but then: the community didn't seem to care +% too much and just has to follow now. +% +% Anyhow, we use a character based approach so that at least we get unicode +% stuff in the backend (okay, we still need to deal with some cut and paste +% issues but at least we now know what we deal with. + +% alternatively we can move the original to FE* + +\definemathoverextensible [vfenced] [overbar] ["FE33E] % ["203E] +\definemathunderextensible [vfenced] [underbar] ["FE33F] % ["203E] +\definemathdoubleextensible [vfenced] [doublebar] ["FE33E] ["FE33F] + +\definemathoverextensible [vfenced] [overbrace] ["FE3DE] % ["023DE] +\definemathunderextensible [vfenced] [underbrace] ["FE3DF] % ["023DF] +\definemathdoubleextensible [vfenced] [doublebrace] ["FE3DE] ["FE3DF] + +\definemathoverextensible [vfenced] [overparent] ["FE3DC] % ["023DC] +\definemathunderextensible [vfenced] [underparent] ["FE3DD] % ["023DD] +\definemathdoubleextensible [vfenced] [doubleparent] ["FE3DC] ["FE3DD] + +\definemathoverextensible [vfenced] [overbracket] ["FE3B4] % ["023B4] +\definemathunderextensible [vfenced] [underbracket] ["FE3B5] % ["023B5] +\definemathdoubleextensible [vfenced] [doublebracket] ["FE3B4] ["FE3B5] + +% \unexpanded\def\mathopwithlimits#1#2{\mathop{#1{#2}}\limits} %D Some bonus ones (for the moment here): @@ -696,7 +865,7 @@ #3% \endgroup}} -% These will be defined in char-def as well: +% These will be defined in char-def as well once we have \leaders<number> \unexpanded\def\rightarrowfill {\math_stackers_hacked_fill \relbar \relbar \rightarrow} \unexpanded\def\leftarrowfill {\math_stackers_hacked_fill \leftarrow \relbar \relbar } @@ -734,6 +903,7 @@ {\expandafter\let\csname\??mathextensiblefallbacks\number#2\expandafter\endcsname\csname#1\endcsname \expandafter\let\csname #1\expandafter\endcsname\csname#1\endcsname} +\defineextensiblefiller [barfill] ["203E] \defineextensiblefiller [relfill] ["002D] \defineextensiblefiller [equalfill] ["003D] \defineextensiblefiller [leftarrowfill] ["2190] @@ -755,6 +925,7 @@ \defineextensiblefiller [Leftarrowfill] ["27F8] \defineextensiblefiller [Rightarrowfill] ["27F9] \defineextensiblefiller [Leftrightarrowfill] ["27FA] +\defineextensiblefiller [Leftrightarrowfill] ["27FA] %D Extra: @@ -766,6 +937,40 @@ % \mathchardef\doublebond"003D % \mathchardef\triplebond"2261 +%D Also handy: + +\unexpanded\def\definemathunstacked + {\dotripleempty\math_stackers_define_unstacked_normal} + +\def\math_stackers_define_unstacked_normal[#1][#2][#3]% category name unicode + {\ifthirdargument + \setuevalue{#2}{\math_stackers_unstacked_normal{#1}{\number#3}}% + \else + \setuevalue{#1}{\math_stackers_unstacked_normal\noexpand\currentmathstackers{\number#2}}% + \fi} + +\unexpanded\def\math_stackers_unstacked_normal#category#codepoint% + {\begingroup + \edef\currentmathstackers{#category}% + \edef\p_moffset{\mathstackersparameter\c!moffset}% + \ifx\p_moffset\empty \else + \mskip\scratchmuskip + \fi + \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi + {\usemathstackerscolorparameter\c!color + \Umathchar\zerocount\defaultmathfamily#codepoint}% + \ifx\p_moffset\empty \else + \mskip\scratchmuskip + \fi + \endgroup} + +\definemathstackers [\v!wide] [\c!moffset=\thickmuskip,\c!mathclass=\s!rel] + +\definemathunstacked [\v!wide] [And] ["0026] % \mathrel{\;&\;} +\definemathunstacked [\v!wide] [impliedby] ["27F8] % \mathrel{\;\Longleftarrow\;} +\definemathunstacked [\v!wide] [implies] ["27F9] % \mathrel{\;\Longrightarrow\;} +\definemathunstacked [\v!wide] [iff] ["27FA] % \mathrel{\;\Longleftrightarrow\;} + \protect \endinput % \mathrel{\mathop{\hbox to \dimen0{\hss\copy4\hss}} |