ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* mathalignment not working (? again ?)
@ 2022-03-02  1:33 śrīrāma via ntg-context
  2022-03-02  7:45 ` Mikael Sundqvist via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: śrīrāma via ntg-context @ 2022-03-02  1:33 UTC (permalink / raw)
  To: ntg-context; +Cc: śrīrāma

Hi,

While setting some rather large set of equations in a document I could not 
achieve proper alignment of columns in mathalignment. Below is a demonstrative 
example:

\starttext
\placeformula
\startformula 
\startmathalignment[n=7,align={right,left,right,left,right,left,right}]
    \NC x_1 \NC + \NC x_2 \NC + \NC 6x_3 \NC = \NC 170, \NR
    \NC 3x_1 \NC - \NC 110x_2 \NC - \NC x_3 \NC = \NC 4, \NR
    \NC 14x_1 \NC + \NC 13x_2 \NC + \NC 10x_3 \NC = \NC 25. \NR
\stopmathalignment
\stopformula

\startformula \startmathalignment[align={left,right}]
    \NC \sin^2 x + \cos^2 x \NC = 1 \NR
    \NC e^{iπ}              \NC = -1 \NR
\stopmathalignment \stopformula
\stoptext

The first example is from the wiki and the second one is just something I wrote 
as an example. Compiling the above, I see that the equations are not aligned 
as requested. There was an earlier discussion on this here:
	https://www.mail-archive.com/ntg-context@ntg.nl/msg97115.html

However, I have:
	mtx-context     | current version: 2022.01.21 20:13
where I have verified that the fix therein is present (in math-ali.mkxl).

Have I gone wrong somewhere ?

Thanks,
Sreeram


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

* Re: mathalignment not working (? again ?)
  2022-03-02  1:33 mathalignment not working (? again ?) śrīrāma via ntg-context
@ 2022-03-02  7:45 ` Mikael Sundqvist via ntg-context
  2022-03-02  9:37   ` śrīrāma via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Sundqvist via ntg-context @ 2022-03-02  7:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mikael Sundqvist

On Wed, Mar 2, 2022 at 2:33 AM śrīrāma via ntg-context
<ntg-context@ntg.nl> wrote:
>
> Hi,
>
> While setting some rather large set of equations in a document I could not
> achieve proper alignment of columns in mathalignment. Below is a demonstrative
> example:
>
> \starttext
> \placeformula
> \startformula
> \startmathalignment[n=7,align={right,left,right,left,right,left,right}]
>     \NC x_1 \NC + \NC x_2 \NC + \NC 6x_3 \NC = \NC 170, \NR
>     \NC 3x_1 \NC - \NC 110x_2 \NC - \NC x_3 \NC = \NC 4, \NR
>     \NC 14x_1 \NC + \NC 13x_2 \NC + \NC 10x_3 \NC = \NC 25. \NR
> \stopmathalignment
> \stopformula
>
> \startformula \startmathalignment[align={left,right}]
>     \NC \sin^2 x + \cos^2 x \NC = 1 \NR
>     \NC e^{iπ}              \NC = -1 \NR
> \stopmathalignment \stopformula
> \stoptext
>
> The first example is from the wiki and the second one is just something I wrote
> as an example. Compiling the above, I see that the equations are not aligned
> as requested. There was an earlier discussion on this here:
>         https://www.mail-archive.com/ntg-context@ntg.nl/msg97115.html
>
> However, I have:
>         mtx-context     | current version: 2022.01.21 20:13
> where I have verified that the fix therein is present (in math-ali.mkxl).
>
> Have I gone wrong somewhere ?
>
> Thanks,
> Sreeram

Hi!

No, you have not gone wrong, but syntax has changed a bit. This works now:

\starttext
\placeformula
\startformula
\startmathalignment[n=7,align={1:right,2:left,3:right,4:left,5:right,6:left,7:right}]
\NC x_1 \NC + \NC x_2 \NC + \NC 6x_3 \NC = \NC 170, \NR
\NC 3x_1 \NC - \NC 110x_2 \NC - \NC x_3 \NC = \NC 4, \NR
\NC 14x_1 \NC + \NC 13x_2 \NC + \NC 10x_3 \NC = \NC 25. \NR
\stopmathalignment
\stopformula
\stoptext

This was done while changing alignments in matrices (and thus also in
alignments, it seems). You can now do align=all:right for example to
get all columns in a matrix right-aligned.

Hans: since people like to use right/left/right/left/ when typesetting
systems of equations... maybe one could add odd:right and even:left as
well?


/Mikael
___________________________________________________________________________________
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] 3+ messages in thread

* Re: mathalignment not working (? again ?)
  2022-03-02  7:45 ` Mikael Sundqvist via ntg-context
@ 2022-03-02  9:37   ` śrīrāma via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: śrīrāma via ntg-context @ 2022-03-02  9:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: śrīrāma, Mikael Sundqvist

On Wednesday, March 2, 2022 1:15 PM Mikael Sundqvist via ntg-context wrote:
> \starttext
> \placeformula
> \startformula
> \startmathalignment[n=7,align={1:right,2:left,3:right,4:left,5:right,6:left,7:righ
> t}] \NC x_1 \NC + \NC x_2 \NC + \NC 6x_3 \NC = \NC 170, \NR
> \NC 3x_1 \NC - \NC 110x_2 \NC - \NC x_3 \NC = \NC 4, \NR
> \NC 14x_1 \NC + \NC 13x_2 \NC + \NC 10x_3 \NC = \NC 25. \NR
> \stopmathalignment
> \stopformula
> \stoptext
> 
> This was done while changing alignments in matrices (and thus also in
> alignments, it seems). You can now do align=all:right for example to
> get all columns in a matrix right-aligned.

Oh! I see! Thanks. Indeed, that works. I have edited the wiki page to now 
reflect the new behavior:
  https://wiki.contextgarden.net/Multiline_equations

Thanks,
Sreeram


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

end of thread, other threads:[~2022-03-02  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02  1:33 mathalignment not working (? again ?) śrīrāma via ntg-context
2022-03-02  7:45 ` Mikael Sundqvist via ntg-context
2022-03-02  9:37   ` śrīrāma via ntg-context

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