ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Math align not working
@ 2020-12-29 13:36 Johann Birnick
  2020-12-29 20:37 ` Otared Kavian
  2020-12-30 13:38 ` Hans Åberg
  0 siblings, 2 replies; 12+ messages in thread
From: Johann Birnick @ 2020-12-29 13:36 UTC (permalink / raw)
  To: ntg-context

Hi there,

I noticed that Math align is not working properly. In particular I mean the
alignment. For example, the following code


\starttext                                                                     

\startformula \startalign[m=2,distance=8em,n=5,
align={right,middle,middle,middle,left}]
\NC 0 \NC < \NC 2x + 5y \NC < \NC 10
\NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
\NC 3 \NC < \NC 2y + 3z \NC < \NC 15
\NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
\stopalign \stopformula

\stoptext


is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't
produce the intended result.

What's wrong?

Best regards,
Johann

___________________________________________________________________________________
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] 12+ messages in thread

* Re: Math align not working
  2020-12-29 13:36 Math align not working Johann Birnick
@ 2020-12-29 20:37 ` Otared Kavian
  2020-12-29 21:27   ` Johann Birnick
  2020-12-30 13:38 ` Hans Åberg
  1 sibling, 1 reply; 12+ messages in thread
From: Otared Kavian @ 2020-12-29 20:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Johann,

The example you sent works fine here with LMTX version 2020.12.28 01:41.
Which version of ConTeXt are you using ?

Best regards: Otared

> On 29 Dec 2020, at 14:36, Johann Birnick <johann.birnick@hotmail.de> wrote:
> 
> Hi there,
> 
> I noticed that Math align is not working properly. In particular I mean the
> alignment. For example, the following code
> 
> 
> \starttext                                                                     
> 
> \startformula \startalign[m=2,distance=8em,n=5,
> align={right,middle,middle,middle,left}]
> \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> \stopalign \stopformula
> 
> \stoptext
> 
> 
> is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't
> produce the intended result.
> 
> What's wrong?
> 
> Best regards,
> Johann
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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] 12+ messages in thread

* Re: Math align not working
  2020-12-29 20:37 ` Otared Kavian
@ 2020-12-29 21:27   ` Johann Birnick
  2020-12-30 10:26     ` Alain Delmotte
  0 siblings, 1 reply; 12+ messages in thread
From: Johann Birnick @ 2020-12-29 21:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Otared Kavian

[-- Attachment #1: Type: text/plain, Size: 2379 bytes --]

Hi Otared,

I'm using the same version. The problem is the "right"-alignment. See the 4 on
the right side. It should be right-aligned. I attached my pdf.

Best regards,
Johann


On Tue, 2020-12-29 at 21:37 +0100, Otared Kavian wrote:
> Hi Johann,
> 
> The example you sent works fine here with LMTX version 2020.12.28 01:41.
> Which version of ConTeXt are you using ?
> 
> Best regards: Otared
> 
> > On 29 Dec 2020, at 14:36, Johann Birnick <johann.birnick@hotmail.de> wrote:
> > 
> > Hi there,
> > 
> > I noticed that Math align is not working properly. In particular I mean the
> > alignment. For example, the following code
> > 
> > 
> > \starttext                                                                  
> >    
> > 
> > \startformula \startalign[m=2,distance=8em,n=5,
> > align={right,middle,middle,middle,left}]
> > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> > \stopalign \stopformula
> > 
> > \stoptext
> > 
> > 
> > is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't
> > produce the intended result.
> > 
> > What's wrong?
> > 
> > Best regards,
> > Johann
> > 
> > ____________________________________________________________________________
> > _______
> > 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
> > ____________________________________________________________________________
> > _______
> 
> ______________________________________________________________________________
> _____
> 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
> ______________________________________________________________________________
> _____

[-- Attachment #2: test.pdf --]
[-- Type: application/pdf, Size: 7302 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Math align not working
  2020-12-29 21:27   ` Johann Birnick
@ 2020-12-30 10:26     ` Alain Delmotte
  2020-12-30 12:10       ` Johann Birnick
  0 siblings, 1 reply; 12+ messages in thread
From: Alain Delmotte @ 2020-12-30 10:26 UTC (permalink / raw)
  To: Johann Birnick, mailing list for ConTeXt users

[-- Attachment #1: Type: text/html, Size: 5599 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Math align not working
  2020-12-30 10:26     ` Alain Delmotte
@ 2020-12-30 12:10       ` Johann Birnick
  0 siblings, 0 replies; 12+ messages in thread
From: Johann Birnick @ 2020-12-30 12:10 UTC (permalink / raw)
  To: Alain Delmotte, mailing list for ConTeXt users

Hi Alain,

I don't know what you mean by "you have two position in the second and one in
the first" ?

The 4 is not aligned correctly. Please see
https://dl.contextgarden.net/myway/mathalign.pdf where the example comes from.
The output looks different.

Best regards,
Johann

On Wed, 2020-12-30 at 11:26 +0100, Alain Delmotte wrote:
> Hi Johann,
> The 4 is right aligned, but for this column you have two position in the
> second and one in the first.
> You could try ~4 and it will align with 10.
> Best regards,
> Alain
> Le 29/12/2020 à 22:27, Johann Birnick a écrit :
> Hi Otared,
> 
> I'm using the same version. The problem is the "right"-alignment. See the 4 on
> the right side. It should be right-aligned. I attached my pdf.
> 
> Best regards,
> Johann
> 
> 
> On Tue, 2020-12-29 at 21:37 +0100, Otared Kavian wrote:
>  
> > Hi Johann,
> > 
> > The example you sent works fine here with LMTX version 2020.12.28 01:41.
> > Which version of ConTeXt are you using ?
> > 
> > Best regards: Otared
> > 
> >  
> > > On 29 Dec 2020, at 14:36, Johann Birnick <johann.birnick@hotmail.de>
> > > wrote:
> > > 
> > > Hi there,
> > > 
> > > I noticed that Math align is not working properly. In particular I mean
> > > the
> > > alignment. For example, the following code
> > > 
> > > 
> > > \starttext                                                                
> > >   
> > >    
> > > 
> > > \startformula \startalign[m=2,distance=8em,n=5,
> > > align={right,middle,middle,middle,left}]
> > > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> > > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> > > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> > > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> > > \stopalign \stopformula
> > > 
> > > \stoptext
> > > 
> > > 
> > > is copied from https://dl.contextgarden.net/myway/mathalign.pdf but
> > > doesn't
> > > produce the intended result.
> > > 
> > > What's wrong?
> > > 
> > > Best regards,
> > > Johann
> > > 
> > > __________________________________________________________________________
> > > __
> > > _______
> > > 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
> > > __________________________________________________________________________
> > > __
> > > _______
> > ____________________________________________________________________________
> > __
> > _____
> > 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
> > ____________________________________________________________________________
> > __
> > _____
> >  
> >  
> > ____________________________________________________________________________
> > _______
> > 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
> > ____________________________________________________________________________
> > _______
>   

___________________________________________________________________________________
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] 12+ messages in thread

* Re: Math align not working
  2020-12-29 13:36 Math align not working Johann Birnick
  2020-12-29 20:37 ` Otared Kavian
@ 2020-12-30 13:38 ` Hans Åberg
  2020-12-30 14:01   ` Johann Birnick
  1 sibling, 1 reply; 12+ messages in thread
From: Hans Åberg @ 2020-12-30 13:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

One has to indicate the align pattern for all columns, otherwise it defaults to left, it seems:

\starttext

\startformula \startalign[m=2,distance=8em,n=5,
align={right,middle,middle,middle,left,right,middle,middle,middle,left}]
\NC 0 \NC < \NC 2x + 5y \NC < \NC 10
\NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
\NC 3 \NC < \NC 2y + 3z \NC < \NC 15
\NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
\stopalign \stopformula

\stoptext


> On 29 Dec 2020, at 14:36, Johann Birnick <johann.birnick@hotmail.de> wrote:
> 
> Hi there,
> 
> I noticed that Math align is not working properly. In particular I mean the
> alignment. For example, the following code
> 
> 
> \starttext                                                                     
> 
> \startformula \startalign[m=2,distance=8em,n=5,
> align={right,middle,middle,middle,left}]
> \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> \stopalign \stopformula
> 
> \stoptext
> 
> 
> is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't
> produce the intended result.
> 
> What's wrong?
> 
> Best regards,
> Johann
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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] 12+ messages in thread

* Re: Math align not working
  2020-12-30 13:38 ` Hans Åberg
@ 2020-12-30 14:01   ` Johann Birnick
  2020-12-30 14:51     ` Hans Åberg
  2021-01-01  7:21     ` Aditya Mahajan
  0 siblings, 2 replies; 12+ messages in thread
From: Johann Birnick @ 2020-12-30 14:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Okay, but I think it's a bug, because as you see in the linked pdf it worked the
simple way some years ago...


On Wed, 2020-12-30 at 14:38 +0100, Hans Åberg wrote:
> One has to indicate the align pattern for all columns, otherwise it defaults
> to left, it seems:
> 
> \starttext
> 
> \startformula \startalign[m=2,distance=8em,n=5,
> align={right,middle,middle,middle,left,right,middle,middle,middle,left}]
> \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> \stopalign \stopformula
> 
> \stoptext
> 
> 
> > On 29 Dec 2020, at 14:36, Johann Birnick <johann.birnick@hotmail.de> wrote:
> > 
> > Hi there,
> > 
> > I noticed that Math align is not working properly. In particular I mean the
> > alignment. For example, the following code
> > 
> > 
> > \starttext                                                                  
> >    
> > 
> > \startformula \startalign[m=2,distance=8em,n=5,
> > align={right,middle,middle,middle,left}]
> > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> > \stopalign \stopformula
> > 
> > \stoptext
> > 
> > 
> > is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't
> > produce the intended result.
> > 
> > What's wrong?
> > 
> > Best regards,
> > Johann
> > 
> > ____________________________________________________________________________
> > _______
> > 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
> > ____________________________________________________________________________
> > _______
> 
> ______________________________________________________________________________
> _____
> 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
> ______________________________________________________________________________
> _____

___________________________________________________________________________________
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] 12+ messages in thread

* Re: Math align not working
  2020-12-30 14:01   ` Johann Birnick
@ 2020-12-30 14:51     ` Hans Åberg
  2021-01-01  7:21     ` Aditya Mahajan
  1 sibling, 0 replies; 12+ messages in thread
From: Hans Åberg @ 2020-12-30 14:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

The developers might tune in; perhaps it was changed.


> On 30 Dec 2020, at 15:01, Johann Birnick <johann.birnick@hotmail.de> wrote:
> 
> Okay, but I think it's a bug, because as you see in the linked pdf it worked the
> simple way some years ago...

___________________________________________________________________________________
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] 12+ messages in thread

* Re: Math align not working
  2020-12-30 14:01   ` Johann Birnick
  2020-12-30 14:51     ` Hans Åberg
@ 2021-01-01  7:21     ` Aditya Mahajan
  2021-01-01 11:49       ` Hans Hagen
  1 sibling, 1 reply; 12+ messages in thread
From: Aditya Mahajan @ 2021-01-01  7:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 30 Dec 2020, Johann Birnick wrote:

> Okay, but I think it's a bug, because as you see in the linked pdf it worked the
> simple way some years ago...

Yes, something has changed internally. Earlier, if you used:

\startalign[align={right,left}, n=4]
 ...
\stopalign

then the alignment was right left right left, i.e., the alignment cycled. Now, the alignment is right left left left, i.e., unspecified alignments default to left. So, in your example, each column in the second "block" is left aligned. To change that, you can use:

\starttext                                                                     

\startformula \startalign[m=2,distance=8em,n=5,
align={right,middle,middle,middle,left, right,middle,middle,middle,left}]
\NC 0 \NC < \NC 2x + 5y \NC < \NC 10
\NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
\NC 3 \NC < \NC 2y + 3z \NC < \NC 15
\NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
\stopalign \stopformula

\stoptext

But this is ugly. 

I haven't looked at the math alignment code in a while, but I'll check with Hans if the old behavior can be reintroduced. 

Aditya
___________________________________________________________________________________
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] 12+ messages in thread

* Re: Math align not working
  2021-01-01  7:21     ` Aditya Mahajan
@ 2021-01-01 11:49       ` Hans Hagen
  2021-01-02  7:15         ` Aditya Mahajan
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2021-01-01 11:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Aditya Mahajan

On 1/1/2021 8:21 AM, Aditya Mahajan wrote:
> \startformula \startalign[m=2,distance=8em,n=5,
> align={right,middle,middle,middle,left, right,middle,middle,middle,left}]
> \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> \stopalign \stopformula
> 
> \stoptext


Aditya:

can you check this?

\def\math_build_eqalign
   {\scratchtoks\emptytoks
    \d_math_eqalign_distance\mathalignmentparameter\c!distance\relax
    \scratchcounterone\mathalignmentparameter\c!m
    \scratchcountertwo\mathalignmentparameter\c!n
    \etoksapp\scratchtoks{\the\t_math_align_a}%
    \scratchcounter\plusone
    \dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax}
      {\ifnum\scratchcounter=\scratchcountertwo
         \scratchcounter\plusone
         \etoksapp\scratchtoks{\math_eqalign_distance}%
         \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}%
       \else
         \advance\scratchcounter\plusone
       \fi
       \etoksapp\scratchtoks{\the\t_math_align_b}}%
    \etoksapp\scratchtoks{\the\t_math_align_c}}


I added:

         \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}%

Hans

-----------------------------------------------------------------
                                           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] 12+ messages in thread

* Re: Math align not working
  2021-01-01 11:49       ` Hans Hagen
@ 2021-01-02  7:15         ` Aditya Mahajan
  2021-01-09 12:59           ` Johann Birnick
  0 siblings, 1 reply; 12+ messages in thread
From: Aditya Mahajan @ 2021-01-02  7:15 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Fri, 1 Jan 2021, Hans Hagen wrote:

> On 1/1/2021 8:21 AM, Aditya Mahajan wrote:
> > \startformula \startalign[m=2,distance=8em,n=5,
> > align={right,middle,middle,middle,left, right,middle,middle,middle,left}]
> > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> > \stopalign \stopformula
> > 
> > \stoptext
> 
> 
> Aditya:
> 
> can you check this?
> 
> \def\math_build_eqalign
>   {\scratchtoks\emptytoks
>    \d_math_eqalign_distance\mathalignmentparameter\c!distance\relax
>    \scratchcounterone\mathalignmentparameter\c!m
>    \scratchcountertwo\mathalignmentparameter\c!n
>    \etoksapp\scratchtoks{\the\t_math_align_a}%
>    \scratchcounter\plusone
>    \dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax}
>      {\ifnum\scratchcounter=\scratchcountertwo
>         \scratchcounter\plusone
>         \etoksapp\scratchtoks{\math_eqalign_distance}%
>         \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}%
>       \else
>         \advance\scratchcounter\plusone
>       \fi
>       \etoksapp\scratchtoks{\the\t_math_align_b}}%
>    \etoksapp\scratchtoks{\the\t_math_align_c}}
> 
> 
> I added:
> 
>         \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}%
> 

This works nicely. Thanks.

I'll also go back to the mathalign document and try to update it for the current LMTX to catch other regressions which might have happened.

Aditya
___________________________________________________________________________________
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] 12+ messages in thread

* Re: Math align not working
  2021-01-02  7:15         ` Aditya Mahajan
@ 2021-01-09 12:59           ` Johann Birnick
  0 siblings, 0 replies; 12+ messages in thread
From: Johann Birnick @ 2021-01-09 12:59 UTC (permalink / raw)
  To: ntg-context, adityam

Hi Aditya,

thank you very much, now I need to specify the alignment only for one "column"
and it gets applied for all of them. However, there is still the problem with
the standard setting of the alignment. For example, 

\starttext
\startformula \startalign[m=2, align={right,left}]
\NC ab \NC = cd
\NC efgh \NC = ijkl \NR
\NC efgh \NC = ijkl
\NC ab \NC = cd \NR
\stopalign \stopformula
\stoptext

works now. But the setting [align={right,left}] should be the standard when n is
not set. So (also according to your documentation) the following code 

\starttext
\startformula \startalign[m=2]
\NC ab \NC = cd
\NC efgh \NC = ijkl \NR
\NC efgh \NC = ijkl
\NC ab \NC = cd \NR
\stopalign \stopformula
\stoptext

should work, but it doesn't. The first column is right-oriented, the third (i.e.
the first in the right "column") not.

Could you please fix that?

Thanks you very much,
Johann


On Sat, 2021-01-02 at 02:15 -0500, Aditya Mahajan wrote:
> On Fri, 1 Jan 2021, Hans Hagen wrote:
> 
> > On 1/1/2021 8:21 AM, Aditya Mahajan wrote:
> > > \startformula \startalign[m=2,distance=8em,n=5,
> > > align={right,middle,middle,middle,left, right,middle,middle,middle,left}]
> > > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10
> > > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR
> > > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15
> > > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR
> > > \stopalign \stopformula
> > > 
> > > \stoptext
> > 
> > 
> > Aditya:
> > 
> > can you check this?
> > 
> > \def\math_build_eqalign
> >   {\scratchtoks\emptytoks
> >    \d_math_eqalign_distance\mathalignmentparameter\c!distance\relax
> >    \scratchcounterone\mathalignmentparameter\c!m
> >    \scratchcountertwo\mathalignmentparameter\c!n
> >    \etoksapp\scratchtoks{\the\t_math_align_a}%
> >    \scratchcounter\plusone
> >    \dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax}
> >      {\ifnum\scratchcounter=\scratchcountertwo
> >         \scratchcounter\plusone
> >         \etoksapp\scratchtoks{\math_eqalign_distance}%
> >         \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}%
> >       \else
> >         \advance\scratchcounter\plusone
> >       \fi
> >       \etoksapp\scratchtoks{\the\t_math_align_b}}%
> >    \etoksapp\scratchtoks{\the\t_math_align_c}}
> > 
> > 
> > I added:
> > 
> >         \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}%
> > 
> 
> This works nicely. Thanks.
> 
> I'll also go back to the mathalign document and try to update it for the
> current LMTX to catch other regressions which might have happened.
> 
> Aditya
> ______________________________________________________________________________
> _____
> 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
> ______________________________________________________________________________
> _____

___________________________________________________________________________________
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] 12+ messages in thread

end of thread, other threads:[~2021-01-09 12:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-29 13:36 Math align not working Johann Birnick
2020-12-29 20:37 ` Otared Kavian
2020-12-29 21:27   ` Johann Birnick
2020-12-30 10:26     ` Alain Delmotte
2020-12-30 12:10       ` Johann Birnick
2020-12-30 13:38 ` Hans Åberg
2020-12-30 14:01   ` Johann Birnick
2020-12-30 14:51     ` Hans Åberg
2021-01-01  7:21     ` Aditya Mahajan
2021-01-01 11:49       ` Hans Hagen
2021-01-02  7:15         ` Aditya Mahajan
2021-01-09 12:59           ` Johann Birnick

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