# [NTG-context] Updated My Way on math alignment

WN wneimeijer01 at cs.com
Sat Aug 5 15:55:01 CEST 2006

adityam at umich.edu wrote:
> Hi Wim,
>
> On Fri, 4 Aug 2006, WN wrote:
>
>
>> I have a question about \startcases .. \stopcases.
>> I am trying to adjust the distance of the cases and the right brace, the
>> left brace is empty,
>> see example below. Is this possible ?
>>
>
> It is. You can do it in different ways, depending on what you like.
>
>
>> % Example
>> \starttext
>> \startformula
>> *\startcases[left={\left.},right={\right\}}]*
>> \NC (\lambda + \mu ) \cdot a = \lambda \cdot a + \mu \cdot a \NC \NR
>> \NC \lambda ( a + b ) = \lambda \cdot a + \lambda \cdot b  \NC \NR
>> \stopcases
>> \text{(distributieve eigenschappen)}
>> \stopformula
>> \stoptext
>>
>
>
>   \starttext
>
> The original one.
>
>   \startformula
>   \startcases[left={\left.},right={\right\}}]
>   \NC (\lambda + \mu ) \cdot a = \lambda \cdot a + \mu \cdot a \NC \NR
>   \NC \lambda ( a + b ) = \lambda \cdot a + \lambda \cdot b  \NC \NR
>   \stopcases
>   \text{(distributieve eigenschappen)}
>   \stopformula
>
> You can reduce the \quotation{width} of the cases,
>
> \startformula
> \startcases[left={\left.},right={\right\}},numberdistance=0pt]
>   \NC (\lambda + \mu ) \cdot a = \lambda \cdot a + \mu \cdot a \NC \NR
>   \NC \lambda ( a + b ) = \lambda \cdot a + \lambda \cdot b  \NC \NR
>   \stopcases
>   \text{(distributieve eigenschappen)}
>   \stopformula
>
> or use a matrix (only one column)
>
> \startformula
>    \startmatrix[left={\left.},right={\right\}}]
>      \NC (\lambda + \mu ) \cdot a = \lambda \cdot a + \mu \cdot a \NR
>      \NC \lambda ( a + b ) = \lambda \cdot a + \lambda \cdot b    \NR
>   \stopmatrix
>   \text{(distributieve eigenschappen)}
>   \stopformula
>
> maybe a right aligned one
>
> \startformula
>    \startmatrix[left={\left.},right={\right\}},align=right]
>      \NC (\lambda + \mu ) \cdot a = \lambda \cdot a + \mu \cdot a \NR
>      \NC \lambda ( a + b ) = \lambda \cdot a + \lambda \cdot b    \NR
>   \stopmatrix
>   \text{(distributieve eigenschappen)}
>   \stopformula
>
>   and this is how I would do it
>
> \definemathmatrix[aligned][n=2,align={right,left},distance=0pt]
>
> \startformula
>    \startaligned[left={\left.},right={\right\}}]
>      \NC (\lambda + \mu ) \cdot a \NC{} = \lambda \cdot a + \mu \cdot a
> \NR
>      \NC \lambda ( a + b ) \NC {}= \lambda \cdot a + \lambda \cdot b
> \NR
> \stopaligned
>   \text{(distributieve eigenschappen)}
>   \stopformula
>
>
> _______________________________________________
> ntg-context mailing list
> ntg-context at ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
I did not know the numberdistance existed, I would think it specifies the
distance between the columns and the number of the equation. Anyways
your solutions work like a charm.