# [NTG-context] Math alignment

Hans Aberg haberg-1 at telia.com
Tue Jul 7 18:23:02 CEST 2015

> On 7 Jul 2015, at 16:47, Wolfgang Schuster <schuster.wolfgang at gmail.com> wrote:

>> I get errors when using \MC - see example below.
>>
> The \NR before \stopmathcases is missing in all your examples.

OK. Though I know it, it is hard to get used to, coming from LaTeX.

>> But the spacing is wrong: too much between the two components. These are not cases, but aligned formulas: one might have a number of alignments, not just one. And I just happen to use left braces on them.
>>
> Take a look at my previous example where I changed the distance between both columns with the distance key.

I missed that. It fixes the spaces within the formula, but adds space between the two sets relative both TeX and AMS-LaTeX (which has about the same as TeX), cf. example below.

In AMS-LaTeX one can have more than one alignment, though when trying it between the “-“ and the “ω” in the second (right-most) set, it adds a lot of space, rather than just trying to align a compactly as possible. In ConTeXt, nothing happens with extra alignments; in TeX, there is an error.

So using \startmathcases is a workaround: trying to force it to do something it wasn’t intended for.

----
\starttext

\def\equlb#1{\left\{\eqalign{#1}\right.} %equation left braced

\startformula
J^j:\startmathcases[distance=\spaceamount]\NC ω^0 \MC ↦ 0 \NR \NC ω^j \MC ↦ 0 \NR \stopmathcases \quad
\startmathcases[distance=\spaceamount] \NC ω^k \MC ↦ \MC ω^l \NR \NC ω^l \MC ↦ -\MC ω^k \NR \stopmathcases
\stopformula

\startformula
J^j:\equlb{ω^0 &↦ 0 \cr ω^j &↦ 0} \quad
\equlb{ω^k &↦ ω^l \cr ω^l &↦ -ω^k} \stopformula

\stoptext
----