summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/math-ali.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/math-ali.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/math-ali.mkiv44
1 files changed, 25 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/context/base/math-ali.mkiv b/Master/texmf-dist/tex/context/base/math-ali.mkiv
index 31f71219a44..f83619a2271 100644
--- a/Master/texmf-dist/tex/context/base/math-ali.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-ali.mkiv
@@ -53,7 +53,7 @@
\def\textineqalign#1{$\forgetalign#1$}
\def\eqalign#1% why no halign here, probably because of displaywidth
- {\null\,\vcenter
+ {\emptyhbox\,\vcenter
{\openup.25\bodyfontsize% was: \openup\jot
\mathsurround\zeropoint
\ialign{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##{}}$\hfil\crcr#1\crcr}%
@@ -61,7 +61,7 @@
% preamble is scanned for tabskips so we need the span to prevent an error message
-\chardef\eqalignmode\plusone
+\setnewconstant\eqalignmode\plusone
\def\preparereqalignno
{\!!toksa{\strut\firstineqalign\hfil\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
@@ -73,7 +73,7 @@
\else
\!!toksc{\hfil\tabskip\centering&\llap{\span\textineqalign{##}}\tabskip\zeropoint}%
\fi\fi
- \global\chardef\mathnumberstatus\zerocount
+ \global\mathnumberstatus\zerocount
\buildeqalign
\presetdisplaymath
\tabskip\centering}
@@ -89,7 +89,7 @@
\else
\!!toksc{\hfil\tabskip\centering&\kern-\displaywidth\rlap{\span\textineqalign{##}}\tabskip\displaywidth}%
\fi\fi
- \global\chardef\mathnumberstatus\zerocount
+ \global\mathnumberstatus\zerocount
\buildeqalign
\presetdisplaymath
\tabskip\centering}
@@ -109,7 +109,7 @@
\def\dobothaligneqalignno#1%
{\ifmmode
\displ@y
- \global\chardef\mathnumberstatus\plusone
+ \global\mathnumberstatus\plusone
\ifcase\mathraggedstatus
\def\finishalignno{\crcr\egroup}%
\else
@@ -127,12 +127,12 @@
\xdef\mathnumbercorrection{\the\wd\scratchbox}%
\fi
\box\scratchbox
- \global\chardef\mathnumberstatus\plustwo}
+ \global\mathnumberstatus\plustwo}
% \def\dobothaligneqalignno#1%
% {\ifmmode
% \displ@y
-% \global\chardef\mathnumberstatus\plusone
+% \global\mathnumberstatus\plusone
% we're in a mathbox
% \vcenter\bgroup
% \def\finishalignno{\crcr\egroup\egroup}%
@@ -193,8 +193,8 @@
\def\rightofeqalign{\getvalue{\??eq:\v!right:\number\eqaligncolumn}}
\def\doseteqaligncolumn#1%
- {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\empty
- \letvalue{\??eq:\v!right:\number\eqaligncolumn}\empty
+ {\letvalueempty{\??eq:\v!left :\number\eqaligncolumn}%
+ \letvalueempty{\??eq:\v!right:\number\eqaligncolumn}%
\doif{#1}\v!left {\letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfill}%
\doif{#1}\v!right {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfill}%
\doif{#1}\v!middle{\letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfill
@@ -611,7 +611,7 @@
\def\dodefinemathmatrix[#1]% [#2]%
{\setuvalue{\e!start#1}{\dodoubleempty\dostartmathmatrix[#1]}%
- \setuvalue{\e!stop #1}{\dostopmathmatrix}%
+ \setvalue {\e!stop #1}{\dostopmathmatrix}% no u else lookahead problem
\setupmathmatrix[#1]}% [#2]
\definemathmatrix[matrix]
@@ -696,7 +696,7 @@
{\begingroup
\edef\currentmathmatrix{#1}%
\doifassignmentelse{#2}{\setupmathmatrix[#1][#2]}\donothing
- \null
+ \emptyhbox
\executeifdefined{\??mx:\mathmatrixparameter\c!location}{\getvalue{\??mx:\v!lohi}}%
\mathmatrixleft
\mathmatrixbox\bgroup
@@ -857,8 +857,13 @@
%D Preliminary feature:
%D
%D {\em example code}
+%D
+%D The intertext commands have to be expandable (in aligment lookahead) so
+%D we cannot use \type {\unexpanded}.
+
+\let\stopintertext\relax
-\unexpanded\def\startintertext#1\stopintertext
+\def\startintertext#1\stopintertext
{\noalign{\dointertext{#1}}}
\def\intertext#1%
@@ -890,7 +895,7 @@
% \unexpanded\def\startsubstack
% {\begingroup
-% \null
+% \emptyhbox
% \vcenter\bgroup
% \pushmacro\domatrixNC
% \let\stopmathmode\relax
@@ -1038,11 +1043,11 @@
\unexpanded\def\overset#1#2%
{\preparebinrel{#2}%
- \currentbinrel{\mathop{\kern\zeropoint#2}\limits^{#1}}}
+ \currentbinrel{\mathop{\kern\zeropoint#2}\limits\normalsuperscript{#1}}}
\unexpanded\def\underset#1#2%
{\preparebinrel{#2}%
- \currentbinrel{\mathop{\kern\zeropoint#2}\limits_{#1}}}
+ \currentbinrel{\mathop{\kern\zeropoint#2}\limits\normalsubscript{#1}}}
%D The following code comes from \type {math-str.mkiv}.
@@ -1069,14 +1074,15 @@
\def\mathhbox
{\iftracemath\ruledhbox\else\hbox\fi}
-\chardef\mathraggedstatus=0 % normal left center right
-\chardef\mathnumberstatus=0 % nothing normal shift_right
+\newconstant\mathraggedstatus % normal left center right
+\newconstant\mathnumberstatus % nothing normal shift_right
+
\let\mathnumbercorrection\!!zeropoint
\unexpanded\def\startmathbox#1%
{\hsize\displaywidth
- \global\chardef\mathnumberstatus\plusone
- \chardef\mathraggedstatus#1\relax
+ \global\mathnumberstatus\plusone
+ \mathraggedstatus#1\relax
\let\mathnumbercorrection\!!zeropoint
\global\let\@eqno \empty \def\eqno {\gdef\@eqno }%
\global\let\@leqno\empty \def\leqno{\gdef\@leqno}%