ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Math alignment
@ 2015-07-06  9:24 Hans Aberg
  2015-07-06 22:08 ` Wolfgang Schuster
  2015-07-06 23:46 ` Hans Aberg
  0 siblings, 2 replies; 15+ messages in thread
From: Hans Aberg @ 2015-07-06  9:24 UTC (permalink / raw)
  To: ntg-context

The example below shows the intended output when using original TeX code (compiled with  ‘context' of TeX Live 2015): a pair of left braced formulas. The first comment shows what works in AMS-LaTeX.

However, when trying similar ConTeXt commands, I get the error shown in the comment below. What ConTeXt command might use here?

---
\setupformulas[location=left]

\starttext

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

% AMS-LaTeX
%\def\equlb#1{\left\{ \begin{aligned} #1 \end{aligned}\right.} % equation left braced

% ConTeXt error: You can't use `\halign' in math mode.
%\def\equlb#1{\left\{ \startalign #1 \stopalign\right.}
%\def\equlb#1{\left\{ \startmathalignment #1 \stopmathalignment\right.}


\startformula \placeformula[JcoordDef]
 J^j:\equlb{ω^0 &→ 0 \cr ω^j &→ 0} \quad
 \equlb{ω^k &→ ω^l \cr ω^l &→ -ω^k} \stopformula

\stoptext
---


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-06  9:24 Math alignment Hans Aberg
@ 2015-07-06 22:08 ` Wolfgang Schuster
  2015-07-06 23:46 ` Hans Aberg
  1 sibling, 0 replies; 15+ messages in thread
From: Wolfgang Schuster @ 2015-07-06 22:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 602 bytes --]


> Hans Aberg <mailto:haberg-1@telia.com>
> 6. Juli 2015 11:24
> The example below shows the intended output when using original TeX 
> code (compiled with ‘context' of TeX Live 2015): a pair of left braced 
> formulas. The first comment shows what works in AMS-LaTeX.
>
> However, when trying similar ConTeXt commands, I get the error shown 
> in the comment below. What ConTeXt command might use here?

Take a look at the wiki page [1] for multiline equations and also the 
linked PDF at the start of the page.

[1] http://wiki.contextgarden.net/Multiline_equations#Cases

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1694 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-06  9:24 Math alignment Hans Aberg
  2015-07-06 22:08 ` Wolfgang Schuster
@ 2015-07-06 23:46 ` Hans Aberg
  2015-07-07  2:46   ` Wolfgang Schuster
  1 sibling, 1 reply; 15+ messages in thread
From: Hans Aberg @ 2015-07-06 23:46 UTC (permalink / raw)
  To: ntg-context

[I do not get copies from the list, though having signed up.]

Wolfgang Schuster wrote:

>> On 6 Jul 2015, at 11:24, Hans Aberg <haberg-1@telia.com> wrote:
>> 
>> The example below shows the intended output when using original TeX code (compiled with  ‘context' of TeX Live 2015): a pair of left braced formulas. The first comment shows what works in AMS-LaTeX.
>> 
>> However, when trying similar ConTeXt commands, I get the error shown in the comment below. What ConTeXt command might use here?
> 
> Take a look at the wiki page [1] for multiline equations and also the 
> linked PDF at the start of the page.
> 
> [1] 
> http://wiki.contextgarden.net/Multiline_equations#Cases

The spacing is different in cases - TeX also has such a variation. Specifically, there is extra space before the conditionals.

In addition, it seems \startmathcases ... \stopmathcases is not working with UTF-8: in the example below, the ω’s on the second line, after the arrows, disappear in my PDF. 

----
\startformula
 J^j:\startmathcases\NC ω^0 \NC→ 0 \NR \NC ω^j \NC→ 0 \stopmathcases \quad
  \startmathcases \NC ω^k \NC→ ω^l \NR \NC ω^l \NC→ -ω^k \stopmathcases
\stopformula
----

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-06 23:46 ` Hans Aberg
@ 2015-07-07  2:46   ` Wolfgang Schuster
  2015-07-07  8:30     ` Hans Aberg
  0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Schuster @ 2015-07-07  2:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Aberg


[-- Attachment #1.1: Type: text/plain, Size: 1348 bytes --]


> Hans Aberg <mailto:haberg-1@telia.com>
> 7. Juli 2015 01:46
> [I do not get copies from the list, though having signed up.]
>
>
> The spacing is different in cases - TeX also has such a variation. 
> Specifically, there is extra space before the conditionals.
>
> In addition, it seems \startmathcases ... \stopmathcases is not 
> working with UTF-8: in the example below, the ω’s on the second line, 
> after the arrows, disappear in my PDF.
This is explained in section 8 of the document:

     There are two ways of specifying the second column — \MC (Math Column)
     and \NC (New Column). If \MC is used, the second column is in \math 
mode,
     with \NC it is in ‘text mode’.
> ----
> \startformula
> J^j:\startmathcases\NC ω^0 \NC→ 0 \NR \NC ω^j \NC→ 0 \stopmathcases \quad
> \startmathcases \NC ω^k \NC→ ω^l \NR \NC ω^l \NC→ -ω^k \stopmathcases
> \stopformula
> ----
Please send always working minimal examples like this:

\starttext

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

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2769 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07  2:46   ` Wolfgang Schuster
@ 2015-07-07  8:30     ` Hans Aberg
  2015-07-07 14:47       ` Wolfgang Schuster
  0 siblings, 1 reply; 15+ messages in thread
From: Hans Aberg @ 2015-07-07  8:30 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


> On 7 Jul 2015, at 04:46, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
> 
>> The spacing is different in cases - TeX also has such a variation. Specifically, there is extra space before the conditionals.
>> 
>> In addition, it seems \startmathcases ... \stopmathcases is not working with UTF-8: in the example below, the ω’s on the second line, after the arrows, disappear in my PDF. 
> This is explained in section 8 of the document:

FYI, the TeX Live 2015 version from 2007 called context-latex-math.pdf does not have ch. 8.

>     There are two ways of specifying the second column — \MC (Math Column)
>     and \NC (New Column). If \MC is used, the second column is in \math mode,
>     with \NC it is in ‘text mode’.

I get errors when using \MC - see example below.

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.

----
\starttext

\startformula
 J^j:\startmathcases\NC ω^0 \MC → 0 \NR \NC ω^j \MC → 0 \stopmathcases \quad
  \startmathcases \NC ω^k \MC → ω^l \NR \NC ω^l \MC → -ω^k \stopmathcases
\stopformula

\stoptext
----


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07  8:30     ` Hans Aberg
@ 2015-07-07 14:47       ` Wolfgang Schuster
  2015-07-07 16:23         ` Hans Aberg
  0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Schuster @ 2015-07-07 14:47 UTC (permalink / raw)
  To: Hans Aberg; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1289 bytes --]



> Hans Aberg <mailto:haberg-1@telia.com>
> 7. Juli 2015 10:30
>> On 7 Jul 2015, at 04:46, Wolfgang Schuster<schuster.wolfgang@gmail.com>  wrote:
>>
>>> The spacing is different in cases - TeX also has such a variation. Specifically, there is extra space before the conditionals.
>>>
>>> In addition, it seems \startmathcases ... \stopmathcases is not working with UTF-8: in the example below, the ω’s on the second line, after the arrows, disappear in my PDF.
>> This is explained in section 8 of the document:
>
> FYI, the TeX Live 2015 version from 2007 called context-latex-math.pdf does not have ch. 8.
>
>>      There are two ways of specifying the second column — \MC (Math Column)
>>      and \NC (New Column). If \MC is used, the second column is in \math mode,
>>      with \NC it is in ‘text mode’.
>
> I get errors when using \MC - see example below.
The \NR before \stopmathcases is missing in all your examples.
> 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.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2865 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 14:47       ` Wolfgang Schuster
@ 2015-07-07 16:23         ` Hans Aberg
  2015-07-07 18:17           ` Wolfgang Schuster
  0 siblings, 1 reply; 15+ messages in thread
From: Hans Aberg @ 2015-07-07 16:23 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


> On 7 Jul 2015, at 16:47, Wolfgang Schuster <schuster.wolfgang@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
----


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 16:23         ` Hans Aberg
@ 2015-07-07 18:17           ` Wolfgang Schuster
  2015-07-07 18:53             ` Hans Aberg
  2015-07-07 19:11             ` Hans Aberg
  0 siblings, 2 replies; 15+ messages in thread
From: Wolfgang Schuster @ 2015-07-07 18:17 UTC (permalink / raw)
  To: Hans Aberg; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1863 bytes --]



> Hans Aberg <mailto:haberg-1@telia.com>
> 7. Juli 2015 18:23
>> On 7 Jul 2015, at 16:47, Wolfgang Schuster<schuster.wolfgang@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.
You can set the alignment for each column in a matrix with the align key.

\definemathmatrix
   [aligned]
   [n=2,
    align={right,left},
    distance=\spaceamount]

\starttext

\startformula
     J^j:
     \startaligned[left=\left\{,right=\right.]
         \NC ω^0 \NC ↦ 0 \NR
         \NC ω^j \NC ↦ 0 \NR
     \stopaligned
     \quad
     \startaligned[n=3,align={right,middle,left},left=\left\{,right=\right.]
         \NC ω^k \NC ↦ \NC  ω^l \NR
         \NC ω^l \NC ↦ \NC -ω^k \NR
     \stopaligned
\stopformula

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 3388 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 18:17           ` Wolfgang Schuster
@ 2015-07-07 18:53             ` Hans Aberg
  2015-07-07 19:18               ` Wolfgang Schuster
  2015-07-07 19:11             ` Hans Aberg
  1 sibling, 1 reply; 15+ messages in thread
From: Hans Aberg @ 2015-07-07 18:53 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


> On 7 Jul 2015, at 20:17, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> You can set the alignment for each column in a matrix with the align key.
> 
> \definemathmatrix
>   [aligned]
>   [n=2,
>    align={right,left},
>    distance=\spaceamount]
> 
> \starttext
> 
> \startformula
>     J^j:
>     \startaligned[left=\left\{,right=\right.]
>         \NC ω^0 \NC ↦ 0 \NR
>         \NC ω^j \NC ↦ 0 \NR
>     \stopaligned
>     \quad
>     \startaligned[n=3,align={right,middle,left},left=\left\{,right=\right.]
>         \NC ω^k \NC ↦ \NC  ω^l \NR
>         \NC ω^l \NC ↦ \NC -ω^k \NR
>     \stopaligned
> \stopformula
> 
> \stoptext

That looks like the right thing. Thanks.

Your example is quite close to TeX, cf. example below.

I have also put in an extra alignment to see what happens, monospace code alignment style. Changing ‘left’ to ‘right did not seem to have any effect here.

----
\definemathmatrix
  [aligned]
  [n=2,
   align={right,left},
   distance=\spaceamount]

\starttext

\startformula
  J^j:
  \startaligned[left=\left\{,right=\right.]
    \NC ω^0 \NC ↦ 0 \NR
    \NC ω^j \NC ↦ 0 \NR
  \stopaligned
  \quad
  \startaligned[n=3,align={right,middle,left},left=\left\{,right=\right.]
    \NC ω^k \NC ↦ \NC  \NC ω^l \NR
    \NC ω^l \NC ↦ \NC -\NC ω^k \NR
  \stopaligned
\stopformula


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

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

\stoptext
----

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 18:17           ` Wolfgang Schuster
  2015-07-07 18:53             ` Hans Aberg
@ 2015-07-07 19:11             ` Hans Aberg
  2015-07-07 19:49               ` Wolfgang Schuster
  1 sibling, 1 reply; 15+ messages in thread
From: Hans Aberg @ 2015-07-07 19:11 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


> On 7 Jul 2015, at 20:17, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> You can set the alignment for each column in a matrix with the align key.

FYI, the document amshelp.pdf says that AMS-LaTeX environments align, align*, and aligned, can have multiple alignments, and gives this example:
\begin{align*}
  K &\approx G * H&   i&= j+k&  B &\subset C\\
  H &\approx A_{0}*B_{0}&  i’&= j’+k’&  C &= D\cap E\\
  G &\approx \coprod_{\alpha\in A} L_{\alpha}&  i’’&=j’’+k’’& A &= D \cup E
\end{align*}
which is typeset so that 'K &\approx G * H’ is one equation aligned on the ‘&’ with the others below, followed by 'i&= j+k’ in the next column.

So the ampersands have multiple functions here, it seems: alignment and separating columns.

Translating into ConTeXt, one might have (pseudocode):
\startformula
  \startalign
    \NC K \NA \approx G * H \NC  i\NA= j+k \NC B \NA \subset C \NR
    \NC H \NA \approx A_{0}*B_{0} \NC   i’\NA= j’+k’ \NC   C \NA = D\cap E\NR
    \NC G \NA \approx \coprod_{\alpha\in A} L_{\alpha}
      \NC   i’’\NA =j’’+k’’ \NC  A \NA = D \cup E \NR
  \stopalign
\stopformula
where I have introduce a symbol \NA for alignment.


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 18:53             ` Hans Aberg
@ 2015-07-07 19:18               ` Wolfgang Schuster
  2015-07-07 19:21                 ` Hans Aberg
  0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Schuster @ 2015-07-07 19:18 UTC (permalink / raw)
  To: Hans Aberg; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1345 bytes --]



> Hans Aberg <mailto:haberg-1@telia.com>
> 7. Juli 2015 20:53
>> On 7 Jul 2015, at 20:17, Wolfgang Schuster<schuster.wolfgang@gmail.com>  wrote:
>
>> You can set the alignment for each column in a matrix with the align key.
>>
>> \definemathmatrix
>>    [aligned]
>>    [n=2,
>>     align={right,left},
>>     distance=\spaceamount]
>>
>> \starttext
>>
>> \startformula
>>      J^j:
>>      \startaligned[left=\left\{,right=\right.]
>>          \NC ω^0 \NC ↦ 0 \NR
>>          \NC ω^j \NC ↦ 0 \NR
>>      \stopaligned
>>      \quad
>>      \startaligned[n=3,align={right,middle,left},left=\left\{,right=\right.]
>>          \NC ω^k \NC ↦ \NC  ω^l \NR
>>          \NC ω^l \NC ↦ \NC -ω^k \NR
>>      \stopaligned
>> \stopformula
>>
>> \stoptext
>
> That looks like the right thing. Thanks.
>
> Your example is quite close to TeX, cf. example below.
>
> I have also put in an extra alignment to see what happens, monospace code alignment style. Changing ‘left’ to ‘right did not seem to have any effect here.
>
Can you see the effect of the alignment?

\starttext

\startformula
     \startmatrix[align={left,middle,right}]
     \NC a   \NC b   \NC c   \NR
     \NC aa  \NC bb  \NC cc  \NR
     \NC aaa \NC bbb \NC ccc \NR
     \stopmatrix
\stopformula

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2553 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 19:18               ` Wolfgang Schuster
@ 2015-07-07 19:21                 ` Hans Aberg
  0 siblings, 0 replies; 15+ messages in thread
From: Hans Aberg @ 2015-07-07 19:21 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


> On 7 Jul 2015, at 21:18, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

>> I have also put in an extra alignment to see what happens, monospace code alignment style. Changing ‘left’ to ‘right did not seem to have any effect here.
>> 
> Can you see the effect of the alignment?
> 
> \starttext
> 
> \startformula
>     \startmatrix[align={left,middle,right}]
>     \NC a   \NC b   \NC c   \NR
>     \NC aa  \NC bb  \NC cc  \NR
>     \NC aaa \NC bbb \NC ccc \NR
>     \stopmatrix
> \stopformula
> 
> \stoptext

Thanks. I know that example. I just noticed it seemed to have no effect in the other example, for some reason.


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 19:11             ` Hans Aberg
@ 2015-07-07 19:49               ` Wolfgang Schuster
  2015-07-07 20:01                 ` Hans Aberg
  2015-07-07 20:56                 ` Hans Aberg
  0 siblings, 2 replies; 15+ messages in thread
From: Wolfgang Schuster @ 2015-07-07 19:49 UTC (permalink / raw)
  To: Hans Aberg; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1997 bytes --]


> Hans Aberg <mailto:haberg-1@telia.com>
> 7. Juli 2015 21:11
>> On 7 Jul 2015, at 20:17, Wolfgang Schuster<schuster.wolfgang@gmail.com>  wrote:
>
>> You can set the alignment for each column in a matrix with the align key.
>
> FYI, the document amshelp.pdf says that AMS-LaTeX environments align, align*, and aligned, can have multiple alignments, and gives this example:
> \begin{align*}
>    K&\approx G * H&    i&= j+k&   B&\subset C\\
>    H&\approx A_{0}*B_{0}&   i’&= j’+k’&   C&= D\cap E\\
>    G&\approx \coprod_{\alpha\in A} L_{\alpha}&   i’’&=j’’+k’’&  A&= D \cup E
> \end{align*}
> which is typeset so that 'K&\approx G * H’ is one equation aligned on the ‘&’ with the others below, followed by 'i&= j+k’ in the next column.
>
> So the ampersands have multiple functions here, it seems: alignment and separating columns.
>
> Translating into ConTeXt, one might have (pseudocode):
> \startformula
>    \startalign
>      \NC K \NA \approx G * H \NC  i\NA= j+k \NC B \NA \subset C \NR
>      \NC H \NA \approx A_{0}*B_{0} \NC   i’\NA= j’+k’ \NC   C \NA = D\cap E\NR
>      \NC G \NA \approx \coprod_{\alpha\in A} L_{\alpha}
>        \NC   i’’\NA =j’’+k’’ \NC  A \NA = D \cup E \NR
>    \stopalign
> \stopformula
> where I have introduce a symbol \NA for alignment.
>
You should google for mathalign.pdf which explains and shows examples 
for the matrix, cases etc. environments.

To get the same result as your LaTeX example you can use the m key for 
\startalign.

\starttext

\startformula
     \startalign[m=3,distance=3em]
     \NC K \NC \approx G * H                            \NC  i   \NC = 
j+k     \NC B \NC \subset C  \NR
     \NC H \NC \approx A_{0}*B_{0}                      \NC  i'  \NC = 
j'+k'   \NC C \NC = D\cap E  \NR
     \NC G \NC \approx \coprod_{\alpha\in A} L_{\alpha} \NC  i'' \NC  
=j''+k'' \NC A \NC = D \cup E \NR
     \stopalign
\stopformula

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 3359 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 19:49               ` Wolfgang Schuster
@ 2015-07-07 20:01                 ` Hans Aberg
  2015-07-07 20:56                 ` Hans Aberg
  1 sibling, 0 replies; 15+ messages in thread
From: Hans Aberg @ 2015-07-07 20:01 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


> On 7 Jul 2015, at 21:49, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> You should google for mathalign.pdf which explains and shows examples for the matrix, cases etc. environments.
> 
> To get the same result as your LaTeX example you can use the m key for \startalign.
> 
> \starttext
> 
> \startformula
>     \startalign[m=3,distance=3em]
>     \NC K \NC \approx G * H                            \NC  i   \NC = j+k     \NC B \NC \subset C  \NR
>     \NC H \NC \approx A_{0}*B_{0}                      \NC  i'  \NC = j'+k'   \NC C \NC = D\cap E  \NR
>     \NC G \NC \approx \coprod_{\alpha\in A} L_{\alpha} \NC  i'' \NC  =j''+k'' \NC A \NC = D \cup E \NR
>     \stopalign
> \stopformula
> 
> \stoptext

That is where I started - it does not work with \left\{ … \right. :-)


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Math alignment
  2015-07-07 19:49               ` Wolfgang Schuster
  2015-07-07 20:01                 ` Hans Aberg
@ 2015-07-07 20:56                 ` Hans Aberg
  1 sibling, 0 replies; 15+ messages in thread
From: Hans Aberg @ 2015-07-07 20:56 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


> On 7 Jul 2015, at 21:49, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> You should google for mathalign.pdf which explains and shows examples for the matrix, cases etc. environments.

It looks rather basic, except for last formula of section 9. 

The document amshelp.pdf, ch. 7, has some nice pure math style examples.


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-07-07 20:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-06  9:24 Math alignment Hans Aberg
2015-07-06 22:08 ` Wolfgang Schuster
2015-07-06 23:46 ` Hans Aberg
2015-07-07  2:46   ` Wolfgang Schuster
2015-07-07  8:30     ` Hans Aberg
2015-07-07 14:47       ` Wolfgang Schuster
2015-07-07 16:23         ` Hans Aberg
2015-07-07 18:17           ` Wolfgang Schuster
2015-07-07 18:53             ` Hans Aberg
2015-07-07 19:18               ` Wolfgang Schuster
2015-07-07 19:21                 ` Hans Aberg
2015-07-07 19:11             ` Hans Aberg
2015-07-07 19:49               ` Wolfgang Schuster
2015-07-07 20:01                 ` Hans Aberg
2015-07-07 20:56                 ` Hans Aberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).