diff options
author | Marius <mariausol@gmail.com> | 2011-11-25 12:20:14 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-11-25 12:20:14 +0200 |
commit | 8a9434e331825735e636700d6a509cf770d5ec41 (patch) | |
tree | 6ebe026b4865fa3d197c121d9f1d5d135016c52a /tex/context/base/math-ali.mkiv | |
parent | b0b3f63745dbcd338e4ce549c2f8c4427998ffcf (diff) | |
download | context-8a9434e331825735e636700d6a509cf770d5ec41.tar.gz |
beta 2011.11.25 10:34
Diffstat (limited to 'tex/context/base/math-ali.mkiv')
-rw-r--r-- | tex/context/base/math-ali.mkiv | 66 |
1 files changed, 46 insertions, 20 deletions
diff --git a/tex/context/base/math-ali.mkiv b/tex/context/base/math-ali.mkiv index b33838737..b0399d9d1 100644 --- a/tex/context/base/math-ali.mkiv +++ b/tex/context/base/math-ali.mkiv @@ -15,6 +15,9 @@ \unprotect +% todo: \aligntab +% todo: less code (more efficient) + %D The code here has been moved from other files. Beware: the \MKII\ and %D \MKIV\ code is not gathered in files with the same name. @@ -162,14 +165,10 @@ \noalign{\glet\math_alignment_NC\math_alignment_NC_first}} % noalign used for change state, conditional does not work here \def\math_alignment_NC_first - {\dostarttagged\t!mathtablerow\empty - \dostarttagged\t!mathtablecell\empty - \let\NC\math_alignment_NC_rest} + {\glet\math_alignment_NC\math_alignment_NC_rest} \def\math_alignment_NC_rest - {\aligntab - \dostoptagged % finish cell - \dostarttagged\t!mathtablecell\empty} + {\aligntab} \def\math_alignment_EQ {\NC=} @@ -196,7 +195,7 @@ \setupmathalignment[\currentmathalignment][#1]% \fi \the\everymathalignment - \eqaligncolumn\zerocount % LOCAL HERE? + \eqaligncolumn\zerocount \processcommacommand [\mathalignmentparameter\c!align] {\advance\eqaligncolumn\plusone\doseteqaligncolumn}% takes argument @@ -241,18 +240,45 @@ \newcount\eqaligncolumn -\def\firstineqalign{\global\eqaligncolumn\plusone} -\def\nextineqalign {\global\advance\eqaligncolumn\plusone} -\def\leftofeqalign {\getvalue{\??eq:\v!left :\number\eqaligncolumn}} -\def\rightofeqalign{\getvalue{\??eq:\v!right:\number\eqaligncolumn}} +\def\firstineqalign + {\global\eqaligncolumn\plusone + \dostarttagged\t!mathtablerow \empty + \dostarttagged\t!mathtablecell\empty} + +\def\nextineqalign + {\global\advance\eqaligncolumn\plusone + \dostoptagged % finish cell + \dostarttagged\t!mathtablecell\empty} + +% \def\leftofeqalign {\getvalue{\??eq:\v!left :\number\eqaligncolumn}} +% \def\rightofeqalign{\getvalue{\??eq:\v!right:\number\eqaligncolumn}} + +% \def\doseteqaligncolumn#1% we could just add to the preamble (as with other alignments) +% {\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 +% \letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfill}} + +\def\leftofeqalign + {\ifcase\csname\??eq::a::\number\eqaligncolumn\endcsname\or + \relax \or \hfill \or \hfill + \fi} + +\def\rightofeqalign + {\ifcase\csname\??eq::a::\number\eqaligncolumn\endcsname\or + \hfill \or \relax \or \hfill + \fi} + +\def\doseteqaligncolumn#1% we could just add to the preamble (as with other alignments) + {\expandafter\let\csname\??eq::a::\number\eqaligncolumn\expandafter\endcsname + \csname\??eq::a::\ifcsname\??eq::a::#1\endcsname#1\else\v!normal\fi\endcsname} -\def\doseteqaligncolumn#1% - {\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 - \letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfill}} +\letvalue{\??eq::a::\v!normal}\zerocount +\letvalue{\??eq::a::\v!left }\plusone +\letvalue{\??eq::a::\v!right }\plustwo +\letvalue{\??eq::a::\v!middle}\plusthree \def\dodoalignNC {\gdef\doalignNC##1{&##1}} @@ -548,7 +574,7 @@ \normalexpanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}% \dorecurse{\numexpr\scratchcounter-\plusone\relax} {\normalexpanded{\scratchtoks{\the\scratchtoks\the\!!toksb}}}% - \normalexpanded{\scratchtoks{\the\scratchtoks\the\!!toksc }}} + \normalexpanded{\scratchtoks{\the\scratchtoks\the\!!toksc}}} \def\preparemathmatrix {\!!toksa{\strut \firstineqalign\leftofeqalign \span @@ -666,7 +692,7 @@ \mathsurround\zeropoint \everycr\emptytoks \tabskip\zeropoint - \eqaligncolumn\zerocount % could be \scratchcounter LOCAL HERE? + \eqaligncolumn\zerocount \processcommacommand[\mathmatrixparameter\c!align]{\advance\eqaligncolumn\plusone\dosetmatrixcolumn}% \scratchcounter=\ifnum\eqaligncolumn>\zerocount \eqaligncolumn \else \plusone \fi \global\eqaligncolumn\plusone |