ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Strange interaction between mathalignment and mathmatrix
@ 2017-06-05 22:26 Henri Menke
  2017-06-05 23:06 ` Henri Menke
  0 siblings, 1 reply; 5+ messages in thread
From: Henri Menke @ 2017-06-05 22:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

When I have a mathmatrix inside a mathalignment the numbering using \NR[+] does not work anymore.
 Instead it prints "[+]" on the next line.  I guess the definition of \NR from mathmatrix leaks
outside.  Affects both TL2017 and latest beta.  MWE is below.

Cheers, Henri

---

\definemathmatrix
  [pmatrix]
  [left=\left(,right=\right)]

\starttext

\startformula
  \startmathalignment
    \NC \sigma_x \NC=
    \startpmatrix
      \NC 0 \NC 1 \NR
      \NC 1 \NC 0 \NR
    \stoppmatrix
    \NR[+]
    \NC \sigma_y \NC=
    \startpmatrix
      \NC 0 \NC -i \NR
      \NC i \NC 0 \NR
    \stoppmatrix
    \NR[+]
    \NC \sigma_z \NC=
    \startpmatrix
      \NC 1 \NC 0 \NR
      \NC 0 \NC -1 \NR
    \stoppmatrix
    \NR[+]
  \stopmathalignment
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Strange interaction between mathalignment and mathmatrix
  2017-06-05 22:26 Strange interaction between mathalignment and mathmatrix Henri Menke
@ 2017-06-05 23:06 ` Henri Menke
  2017-06-06  0:08   ` Henri Menke
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Henri Menke @ 2017-06-05 23:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

It seems that \NC in mathalignment is looking ahead for the next \NR, because when I wrap the matrix
in an explicit brace group it works fine again:

\definemathmatrix
  [pmatrix]
  [left=\left(,right=\right)]

\starttext

\placeformula
\startformula
  \startmathalignment
    \NC \sigma_x \NC=
    {\startpmatrix
      \NC 0 \NC 1 \NR
      \NC 1 \NC 0 \NR
    \stoppmatrix}
    \NR[+]
  \stopmathalignment
\stopformula

\stoptext

On Tue, 2017-06-06 at 10:26 +1200, Henri Menke wrote:
> Dear list,
> 
> When I have a mathmatrix inside a mathalignment the numbering using \NR[+] does not work anymore.
>  Instead it prints "[+]" on the next line.  I guess the definition of \NR from mathmatrix leaks
> outside.  Affects both TL2017 and latest beta.  MWE is below.
> 
> Cheers, Henri
> 
> ---
> 
> \definemathmatrix
>   [pmatrix]
>   [left=\left(,right=\right)]
> 
> \starttext
> 
> \startformula
>   \startmathalignment
>     \NC \sigma_x \NC=
>     \startpmatrix
>       \NC 0 \NC 1 \NR
>       \NC 1 \NC 0 \NR
>     \stoppmatrix
>     \NR[+]
>     \NC \sigma_y \NC=
>     \startpmatrix
>       \NC 0 \NC -i \NR
>       \NC i \NC 0 \NR
>     \stoppmatrix
>     \NR[+]
>     \NC \sigma_z \NC=
>     \startpmatrix
>       \NC 1 \NC 0 \NR
>       \NC 0 \NC -1 \NR
>     \stoppmatrix
>     \NR[+]
>   \stopmathalignment
> \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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Strange interaction between mathalignment and mathmatrix
  2017-06-05 23:06 ` Henri Menke
@ 2017-06-06  0:08   ` Henri Menke
  2017-06-06  7:44   ` Hans Hagen
  2017-06-06  8:04   ` Hans Hagen
  2 siblings, 0 replies; 5+ messages in thread
From: Henri Menke @ 2017-06-06  0:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wow, mathalignment is completely screwed in beta and TL2017.  Hans, please fix!

---

\starttext

\placeformula
\startformula
  \startmathalignment[m=2]
    \NC a^2 + b^2 \NC= c^2 \NC a^2 + b^2 \NC= c^2 \NR
  \stopmathalignment
\stopformula

\stoptext

On Tue, 2017-06-06 at 11:06 +1200, Henri Menke wrote:
> It seems that \NC in mathalignment is looking ahead for the next \NR, because when I wrap the
> matrix
> in an explicit brace group it works fine again:
> 
> \definemathmatrix
>   [pmatrix]
>   [left=\left(,right=\right)]
> 
> \starttext
> 
> \placeformula
> \startformula
>   \startmathalignment
>     \NC \sigma_x \NC=
>     {\startpmatrix
>       \NC 0 \NC 1 \NR
>       \NC 1 \NC 0 \NR
>     \stoppmatrix}
>     \NR[+]
>   \stopmathalignment
> \stopformula
> 
> \stoptext
> 
> On Tue, 2017-06-06 at 10:26 +1200, Henri Menke wrote:
> > 
> > Dear list,
> > 
> > When I have a mathmatrix inside a mathalignment the numbering using \NR[+] does not work
> > anymore.
> >  Instead it prints "[+]" on the next line.  I guess the definition of \NR from mathmatrix leaks
> > outside.  Affects both TL2017 and latest beta.  MWE is below.
> > 
> > Cheers, Henri
> > 
> > ---
> > 
> > \definemathmatrix
> >   [pmatrix]
> >   [left=\left(,right=\right)]
> > 
> > \starttext
> > 
> > \startformula
> >   \startmathalignment
> >     \NC \sigma_x \NC=
> >     \startpmatrix
> >       \NC 0 \NC 1 \NR
> >       \NC 1 \NC 0 \NR
> >     \stoppmatrix
> >     \NR[+]
> >     \NC \sigma_y \NC=
> >     \startpmatrix
> >       \NC 0 \NC -i \NR
> >       \NC i \NC 0 \NR
> >     \stoppmatrix
> >     \NR[+]
> >     \NC \sigma_z \NC=
> >     \startpmatrix
> >       \NC 1 \NC 0 \NR
> >       \NC 0 \NC -1 \NR
> >     \stoppmatrix
> >     \NR[+]
> >   \stopmathalignment
> > \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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Strange interaction between mathalignment and mathmatrix
  2017-06-05 23:06 ` Henri Menke
  2017-06-06  0:08   ` Henri Menke
@ 2017-06-06  7:44   ` Hans Hagen
  2017-06-06  8:04   ` Hans Hagen
  2 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2017-06-06  7:44 UTC (permalink / raw)
  To: ntg-context

On 6/6/2017 1:06 AM, Henri Menke wrote:
> It seems that \NC in mathalignment is looking ahead for the next \NR, because when I wrap the matrix
> in an explicit brace group it works fine again:
> 
> \definemathmatrix
>    [pmatrix]
>    [left=\left(,right=\right)]
> 
> \starttext
> 
> \placeformula
> \startformula
>    \startmathalignment
>      \NC \sigma_x \NC=
>      {\startpmatrix
>        \NC 0 \NC 1 \NR
>        \NC 1 \NC 0 \NR
>      \stoppmatrix}
>      \NR[+]
>    \stopmathalignment
> \stopformula
> 
> \stoptext

yes. in retrospect giving \NR an argument was a bad idea as we need to 
pick it up in advance .. tricky to solve

> On Tue, 2017-06-06 at 10:26 +1200, Henri Menke wrote:
>> Dear list,
>>
>> When I have a mathmatrix inside a mathalignment the numbering using \NR[+] does not work anymore.
>>   Instead it prints "[+]" on the next line.  I guess the definition of \NR from mathmatrix leaks
>> outside.  Affects both TL2017 and latest beta.  MWE is below.
>>
>> Cheers, Henri
>>
>> ---
>>
>> \definemathmatrix
>>    [pmatrix]
>>    [left=\left(,right=\right)]
>>
>> \starttext
>>
>> \startformula
>>    \startmathalignment
>>      \NC \sigma_x \NC=
>>      \startpmatrix
>>        \NC 0 \NC 1 \NR
>>        \NC 1 \NC 0 \NR
>>      \stoppmatrix
>>      \NR[+]
>>      \NC \sigma_y \NC=
>>      \startpmatrix
>>        \NC 0 \NC -i \NR
>>        \NC i \NC 0 \NR
>>      \stoppmatrix
>>      \NR[+]
>>      \NC \sigma_z \NC=
>>      \startpmatrix
>>        \NC 1 \NC 0 \NR
>>        \NC 0 \NC -1 \NR
>>      \stoppmatrix
>>      \NR[+]
>>    \stopmathalignment
>> \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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Strange interaction between mathalignment and mathmatrix
  2017-06-05 23:06 ` Henri Menke
  2017-06-06  0:08   ` Henri Menke
  2017-06-06  7:44   ` Hans Hagen
@ 2017-06-06  8:04   ` Hans Hagen
  2 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2017-06-06  8:04 UTC (permalink / raw)
  To: ntg-context

On 6/6/2017 1:06 AM, Henri Menke wrote:
> It seems that \NC in mathalignment is looking ahead for the next \NR, because when I wrap the matrix
> in an explicit brace group it works fine again:
> 
> \definemathmatrix
>    [pmatrix]
>    [left=\left(,right=\right)]
> 
> \starttext
> 
> \placeformula
> \startformula
>    \startmathalignment
>      \NC \sigma_x \NC=
>      {\startpmatrix
>        \NC 0 \NC 1 \NR
>        \NC 1 \NC 0 \NR
>      \stoppmatrix}
>      \NR[+]
>    \stopmathalignment
> \stopformula
> 
> \stoptext
I'll add \NN so that we can this too:

\NN[+] ... \NC ... \NC ... \NR

(needed when we have left sided numbers in which case \NC[+] comes too 
late)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2017-06-06  8:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 22:26 Strange interaction between mathalignment and mathmatrix Henri Menke
2017-06-05 23:06 ` Henri Menke
2017-06-06  0:08   ` Henri Menke
2017-06-06  7:44   ` Hans Hagen
2017-06-06  8:04   ` Hans Hagen

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).