ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Math alignment problem
@ 2022-09-22 10:56 Jan-Erik Hägglöf via ntg-context
  2022-09-22 12:54 ` Alexandre Christe via ntg-context
  0 siblings, 1 reply; 9+ messages in thread
From: Jan-Erik Hägglöf via ntg-context @ 2022-09-22 10:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jan-Erik Hägglöf


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

Dear List!

I do not know how to solve this issue.

I want the formulas appear on same height, as you can se on the attachment the formula containing a fraction displaces on another vertical position compared to the other equations.

How do I correct this?

Code snippet pasted from garden

\starttext

\startitemize[a,columns,three]
\item $ 56 + 2 \cdot 3 $
\item $ 5-(7) $
\item $ \frac{21}{7} $
\stopitemize

\stoptext


Thanks in advance

Jan-Erik

[-- Attachment #1.2.1: Type: text/html, Size: 1244 bytes --]

[-- Attachment #1.2.2: result.pdf --]
[-- Type: application/pdf, Size: 8388 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 226 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Math alignment problem
  2022-09-22 10:56 Math alignment problem Jan-Erik Hägglöf via ntg-context
@ 2022-09-22 12:54 ` Alexandre Christe via ntg-context
  2022-09-22 20:53   ` Jan-Erik Hägglöf via ntg-context
  0 siblings, 1 reply; 9+ messages in thread
From: Alexandre Christe via ntg-context @ 2022-09-22 12:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Alexandre Christe


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

Hi Jan-Erik,

One way I came across searching the mailing list is the following:

\starttext

\startitemize [a,columns,joinedup] [n=3,grid=line]
\item $ 56 + 2 \cdot 3 $
\item $ 5-(7) $
\item $ \frac{21}{7} $
\stopitemize

\stoptext

Could be that there is a *better* way.

Le jeu. 22 sept. 2022 à 12:57, Jan-Erik Hägglöf via ntg-context <
ntg-context@ntg.nl> a écrit :

> Dear List!
>
> I do not know how to solve this issue.
>
> I want the formulas appear on same height, as you can se on the attachment
> the formula containing a fraction displaces on another vertical position
> compared to the other equations.
>
> How do I correct this?
>
> Code snippet pasted from garden
>
> \starttext
>
> \startitemize[a,columns,three]
> \item $ 56 + 2 \cdot 3 $
> \item $ 5-(7) $
> \item $ \frac{21}{7} $
> \stopitemize
>
> \stoptext
>
>
> Thanks in advance
>
> Jan-Erik
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
>
> ___________________________________________________________________________________
>

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

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

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Math alignment problem
  2022-09-22 12:54 ` Alexandre Christe via ntg-context
@ 2022-09-22 20:53   ` Jan-Erik Hägglöf via ntg-context
  0 siblings, 0 replies; 9+ messages in thread
From: Jan-Erik Hägglöf via ntg-context @ 2022-09-22 20:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jan-Erik Hägglöf


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

That was the solution, it worked!

Thank you so much!

/Jan-Erik

> 22 sep. 2022 kl. 14:54 skrev Alexandre Christe via ntg-context <ntg-context@ntg.nl>:
> 
> Hi Jan-Erik,
> 
> One way I came across searching the mailing list is the following:
> 
> \starttext
> 
> \startitemize [a,columns,joinedup] [n=3,grid=line]
> \item $ 56 + 2 \cdot 3 $
> \item $ 5-(7) $
> \item $ \frac{21}{7} $
> \stopitemize
> 
> \stoptext
> 
> Could be that there is a better way.
> 
> Le jeu. 22 sept. 2022 à 12:57, Jan-Erik Hägglöf via ntg-context <ntg-context@ntg.nl <mailto:ntg-context@ntg.nl>> a écrit :
> Dear List!
> 
> I do not know how to solve this issue.
> 
> I want the formulas appear on same height, as you can se on the attachment the formula containing a fraction displaces on another vertical position compared to the other equations.
> 
> How do I correct this?
> 
> Code snippet pasted from garden
> 
> \starttext
> 
> \startitemize[a,columns,three]
> \item $ 56 + 2 \cdot 3 $
> \item $ 5-(7) $
> \item $ \frac{21}{7} $
> \stopitemize
> 
> \stoptext
> 
> 
> Thanks in advance
> 
> Jan-Erik
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / https://www.ntg.nl/mailman/listinfo/ntg-context <https://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ <https://bitbucket.org/phg/context-mirror/commits/>
> wiki     : https://contextgarden.net <https://contextgarden.net/>
> ___________________________________________________________________________________
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / https://www.ntg.nl/mailman/listinfo/ntg-context <https://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ <https://bitbucket.org/phg/context-mirror/commits/>
> wiki     : https://contextgarden.net <https://contextgarden.net/>
> ___________________________________________________________________________________


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

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

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Math alignment problem
  2009-01-20  0:01       ` Marcin Borkowski
@ 2009-01-20  0:37         ` Aditya Mahajan
  0 siblings, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2009-01-20  0:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, 20 Jan 2009, Marcin Borkowski wrote:

> Dnia Sat, Jan 10, 2009 at 07:14:58PM -0500, Aditya Mahajan napisa&#322;(a):
>>>> On Sat, 10 Jan 2009, Marcin Borkowski wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> I'd like to typeset a system of simultaneous equations.  I want it to
>>>>> have a brace on the left (like "cases"), but inside I want it to have
>>>>> two columns aligned like "align".  Also, I'd like to have the vertical
>>>>> space between the equations be small (like in cases), not so big as in
>>>>> align.
>>>>>
>>>>> How to do this?
>
> (answers cut)
>
> Thank you very much.  But one thing still puzzles me: the vertical
> distance between the cases.  How to increase it?  (Shouldn't there be a
> parameter for this?  But I couldn't find one...)

For matrix, the current definition works hard so that you cannot change 
vertical distance. For simultaneous equations, you need a math strucutre 
which ConTeXt does not provide.

>From what I understand amsmath hasthere are three kinds of math 
"strucures"

1. Outer display structures (equation, align, gather, and multline)
2. Inner display structures (aligned, gathered, and multlined (provided by 
mathtools package))
3. Inner inline structures (matrix, cases, etc).

The first two display structures have \displaystyle set and have "loose" 
spacing. The last inline structure has no \displaystyle set and has 
"tight" spacing. So, what you need for simultaneous equations is something 
from class 2 with the ability to put a brace on the left (empheq package 
in latex allows you to do this with aligned, etc).

Currently, ConTeXt does not provide anything of class 2. It is easy to 
provide it (one just needs to copy the definitions of mathalign but not 
set the width of hbox to be textwidth), but everytime I start working on 
it I get distracted by the bigger problem---ConTeXt is not as good as it 
can be for outer display.

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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Math alignment problem
  2009-01-11  0:14     ` Aditya Mahajan
@ 2009-01-20  0:01       ` Marcin Borkowski
  2009-01-20  0:37         ` Aditya Mahajan
  0 siblings, 1 reply; 9+ messages in thread
From: Marcin Borkowski @ 2009-01-20  0:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dnia Sat, Jan 10, 2009 at 07:14:58PM -0500, Aditya Mahajan napisa&#322;(a):
> >>On Sat, 10 Jan 2009, Marcin Borkowski wrote:
> >>
> >>>Hi all,
> >>>
> >>>I'd like to typeset a system of simultaneous equations.  I want it to
> >>>have a brace on the left (like "cases"), but inside I want it to have
> >>>two columns aligned like "align".  Also, I'd like to have the vertical
> >>>space between the equations be small (like in cases), not so big as in
> >>>align.
> >>>
> >>>How to do this?

(answers cut)

Thank you very much.  But one thing still puzzles me: the vertical
distance between the cases.  How to increase it?  (Shouldn't there be a
parameter for this?  But I couldn't find one...)

Thanks in advance

-- 
Marcin Borkowski (http://mbork.pl)

Walka trwa!
Nie przeciw ciału i krwi, lecz przeciw złym siłom.
Naszym ogniem Miłość Boga, naszym mieczem wierność Jego!
Walka trwa!
                        (Izaiash)
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Math alignment problem
  2009-01-10 18:31   ` Marcin Borkowski
@ 2009-01-11  0:14     ` Aditya Mahajan
  2009-01-20  0:01       ` Marcin Borkowski
  0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2009-01-11  0:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 10 Jan 2009, Marcin Borkowski wrote:

> Dnia Sat, Jan 10, 2009 at 01:15:28PM -0500, Aditya Mahajan napisa&#322;(a):
>> On Sat, 10 Jan 2009, Marcin Borkowski wrote:
>>
>>> Hi all,
>>>
>>> I'd like to typeset a system of simultaneous equations.  I want it to
>>> have a brace on the left (like "cases"), but inside I want it to have
>>> two columns aligned like "align".  Also, I'd like to have the vertical
>>> space between the equations be small (like in cases), not so big as in
>>> align.
>>>
>>> How to do this?
>>
>> I do not completely understand what you want. Do the following give the
>> desired output.
>
> Sorry;).
>
>> \starttext
>>
>> \startformula
>>   \startcases[align={right,left},distance=3pt]
>>     \NC 2x + 3y \MC{} = 10 \NR
>>     \NC 3x + 2y \MC{} = 5   \NR
>>   \stopcases
>> \stopformula
>>
>> \startformula
>>   \startmatrix[align={right,left},distance=3pt,left={\left\{},
>> right={\right.}]
>>     \NC 2x + 3y \NC{} = 10 \NR
>>     \NC 3x + 2y \NC{} = 5   \NR
>>   \stopmatrix
>> \stopformula
>>
>> \stoptext
>
> Both work just fine, but with distance=0pt instead.  Thanks!  There is
> only a minor problem with the former one: it's somehow shifted to the
> left compared with the latter (both in MkII and MkIV).  I have no idea
> why.

mathcases has a numberdistance key, which adds some width at the end of 
each row. You can set numberdistance to zero.

>> The {} after the alignment \NC is useful if the next symbol is something
>> that can be a uniary or binary symbol (eg, + or -). The {} tells tex to
>> treat is as a binary symbol.
>
> Of course - the {} is an "ord" atom for TeX, AFAIR.
>
>> If you frequently need something like this, you can use
>> definemathcases/definemathmatrix to define a new environment with
>> appropriate parameters.
>
> Yes; however, I'd still have to use the {} after the \NC...

Yes. You can define something like \OC (ord column) to be \NC{}.

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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Math alignment problem
  2009-01-10 18:15 ` Aditya Mahajan
@ 2009-01-10 18:31   ` Marcin Borkowski
  2009-01-11  0:14     ` Aditya Mahajan
  0 siblings, 1 reply; 9+ messages in thread
From: Marcin Borkowski @ 2009-01-10 18:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dnia Sat, Jan 10, 2009 at 01:15:28PM -0500, Aditya Mahajan napisa&#322;(a):
> On Sat, 10 Jan 2009, Marcin Borkowski wrote:
> 
> >Hi all,
> >
> >I'd like to typeset a system of simultaneous equations.  I want it to
> >have a brace on the left (like "cases"), but inside I want it to have
> >two columns aligned like "align".  Also, I'd like to have the vertical
> >space between the equations be small (like in cases), not so big as in
> >align.
> >
> >How to do this?
> 
> I do not completely understand what you want. Do the following give the 
> desired output.

Sorry;).

> \starttext
> 
> \startformula
>   \startcases[align={right,left},distance=3pt]
>     \NC 2x + 3y \MC{} = 10 \NR
>     \NC 3x + 2y \MC{} = 5   \NR
>   \stopcases
> \stopformula
> 
> \startformula
>   \startmatrix[align={right,left},distance=3pt,left={\left\{}, 
> right={\right.}]
>     \NC 2x + 3y \NC{} = 10 \NR
>     \NC 3x + 2y \NC{} = 5   \NR
>   \stopmatrix
> \stopformula
> 
> \stoptext

Both work just fine, but with distance=0pt instead.  Thanks!  There is
only a minor problem with the former one: it's somehow shifted to the
left compared with the latter (both in MkII and MkIV).  I have no idea
why.

> The {} after the alignment \NC is useful if the next symbol is something 
> that can be a uniary or binary symbol (eg, + or -). The {} tells tex to 
> treat is as a binary symbol.

Of course - the {} is an "ord" atom for TeX, AFAIR.

> If you frequently need something like this, you can use 
> definemathcases/definemathmatrix to define a new environment with 
> appropriate parameters.

Yes; however, I'd still have to use the {} after the \NC...

> 
> Aditya

Thank you!

-- 
Marcin Borkowski (http://mbork.pl)

Nie mam w ręku miecza, ani karabinu, stoję nieuzbrojony pod murami Babilonu.
Wzywam pomocy Ducha - Duch przychodzi w ogniu!
Wokół zostają tylko gruzy Babilonu!
                        (Korzeń Z Kraju Melchizedeka)
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Math alignment problem
  2009-01-10 17:53 Marcin Borkowski
@ 2009-01-10 18:15 ` Aditya Mahajan
  2009-01-10 18:31   ` Marcin Borkowski
  0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2009-01-10 18:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 10 Jan 2009, Marcin Borkowski wrote:

> Hi all,
>
> I'd like to typeset a system of simultaneous equations.  I want it to
> have a brace on the left (like "cases"), but inside I want it to have
> two columns aligned like "align".  Also, I'd like to have the vertical
> space between the equations be small (like in cases), not so big as in
> align.
>
> How to do this?

I do not completely understand what you want. Do the following give the 
desired output.

\starttext

\startformula
   \startcases[align={right,left},distance=3pt]
     \NC 2x + 3y \MC{} = 10 \NR
     \NC 3x + 2y \MC{} = 5   \NR
   \stopcases
\stopformula

\startformula
   \startmatrix[align={right,left},distance=3pt,left={\left\{}, 
right={\right.}]
     \NC 2x + 3y \NC{} = 10 \NR
     \NC 3x + 2y \NC{} = 5   \NR
   \stopmatrix
\stopformula

\stoptext

The {} after the alignment \NC is useful if the next symbol is something 
that can be a uniary or binary symbol (eg, + or -). The {} tells tex to 
treat is as a binary symbol.

If you frequently need something like this, you can use 
definemathcases/definemathmatrix to define a new environment with 
appropriate parameters.

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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Math alignment problem
@ 2009-01-10 17:53 Marcin Borkowski
  2009-01-10 18:15 ` Aditya Mahajan
  0 siblings, 1 reply; 9+ messages in thread
From: Marcin Borkowski @ 2009-01-10 17:53 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

Hi all,

I'd like to typeset a system of simultaneous equations.  I want it to
have a brace on the left (like "cases"), but inside I want it to have
two columns aligned like "align".  Also, I'd like to have the vertical
space between the equations be small (like in cases), not so big as in
align.

How to do this?

-- 
Marcin Borkowski (http://mbork.pl)
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2022-09-22 20:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 10:56 Math alignment problem Jan-Erik Hägglöf via ntg-context
2022-09-22 12:54 ` Alexandre Christe via ntg-context
2022-09-22 20:53   ` Jan-Erik Hägglöf via ntg-context
  -- strict thread matches above, loose matches on Subject: below --
2009-01-10 17:53 Marcin Borkowski
2009-01-10 18:15 ` Aditya Mahajan
2009-01-10 18:31   ` Marcin Borkowski
2009-01-11  0:14     ` Aditya Mahajan
2009-01-20  0:01       ` Marcin Borkowski
2009-01-20  0:37         ` Aditya Mahajan

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