ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Bug in math alignment
@ 2022-11-02  9:38 Otared Kavian via ntg-context
  2022-11-02 11:53 ` Jeong Dal via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian via ntg-context @ 2022-11-02  9:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

Hi Hans and Mikael,

I think there is an issue with the size of math fonts in \frac when used in math alignments, as it is is shown in the following example.


%% begin bug-mathalignment.tex
\definemathmatrix[alignedcases]
	[align={1:right,2:left,3:left},
	distance=3pt,
	left={\left\{},
	right={\right.},
	style=\displaystyle]

\starttext
Consider this
\placeformula
\startformula
\startalignedcases
\NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
\NC  \frac{\partial u}{\partial {\bi n}} \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
\stopalignedcases
\stopformula
or this (with\type{\displaystyle} added)
\placeformula 
\startformula
\startalignedcases
\NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
\NC  \displaystyle\frac{\partial u}{\partial {\bi n}} \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
\stopalignedcases
\stopformula
Actually, one should have this
\startformula
\frac{\partial u}{\partial {\bi n}}  = V u + \phi  \qquad\text{on }\, \partial\Omega.
\stopformula
If one adds \type{\displaystyle} both to the numerator and denominator of \type{\frac}, the result is correct:
\placeformula 
\startformula
\startalignedcases
\NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
\NC  \frac{\displaystyle\partial u}{\displaystyle\partial {\bi n}} \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
\stopalignedcases
\stopformula

\stoptext
%% end bug-mathalignment.tex

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

* Re: Bug in math alignment
  2022-11-02  9:38 Bug in math alignment Otared Kavian via ntg-context
@ 2022-11-02 11:53 ` Jeong Dal via ntg-context
  2022-11-02 20:19   ` Otared Kavian via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Jeong Dal via ntg-context @ 2022-11-02 11:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jeong Dal


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

Dear Otared,

> 
> I think there is an issue with the size of math fonts in \frac when used in math alignments, as it is is shown in the following example.
> 

I confirm what you said.

However, if I use \dm{} instead of \displaystyle as following, then the output is correct.

\placeformula
\startformula
\startalignedcases
\NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
\NC  \dm{\frac{\partial u}{\partial {\bi n}}}
 \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
\stopalignedcases
\stopformula
or this (with\type{\displaystyle} added)
\placeformula 
\startformula
\startalignedcases
\NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
\NC  \dm{\frac{\partial u}{\partial {\bi n}}}
 \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
\stopalignedcases
\stopformula

In this example, it is OK to use \dm inside of \startformula … \stopformula.
I am not sure that it is what Hans and Mikael want.

Thanks,

Best regards,

Dalyoung





[-- Attachment #1.2: Type: text/html, Size: 6963 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] 5+ messages in thread

* Re: Bug in math alignment
  2022-11-02 11:53 ` Jeong Dal via ntg-context
@ 2022-11-02 20:19   ` Otared Kavian via ntg-context
  2022-11-02 20:44     ` Mikael Sundqvist via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian via ntg-context @ 2022-11-02 20:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian


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

Dear Jeong,

Thanks for testing my example, and pointing to the solution using \dm (which I didn’t know…).
I think the correct behaviour of math alignments should avoid using additional commands such as \dm.

We’ll see what Hans and Mikael say.

Best regards: OK

> On 2 Nov 2022, at 12:53, Jeong Dal via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Dear Otared,
> 
>> 
>> I think there is an issue with the size of math fonts in \frac when used in math alignments, as it is is shown in the following example.
>> 
> 
> I confirm what you said.
> 
> However, if I use \dm{} instead of \displaystyle as following, then the output is correct.
> 
> \placeformula
> \startformula
> \startalignedcases
> \NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
> \NC  \dm{\frac{\partial u}{\partial {\bi n}}}
>  \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
> \stopalignedcases
> \stopformula
> or this (with\type{\displaystyle} added)
> \placeformula 
> \startformula
> \startalignedcases
> \NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
> \NC  \dm{\frac{\partial u}{\partial {\bi n}}}
>  \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
> \stopalignedcases
> \stopformula
> 
> In this example, it is OK to use \dm inside of \startformula … \stopformula.
> I am not sure that it is what Hans and Mikael want.
> 
> Thanks,
> 
> Best regards,
> 
> Dalyoung
> 
> 
> 
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

Otared Kavian
e-mail: otared@gmail.com
Phone: +33 6 88 26 70 95




[-- Attachment #1.2: Type: text/html, Size: 9112 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] 5+ messages in thread

* Re: Bug in math alignment
  2022-11-02 20:19   ` Otared Kavian via ntg-context
@ 2022-11-02 20:44     ` Mikael Sundqvist via ntg-context
  2022-11-03  8:31       ` Otared Kavian via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Sundqvist via ntg-context @ 2022-11-02 20:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mikael Sundqvist

Hi,

On Wed, Nov 2, 2022 at 9:19 PM Otared Kavian via ntg-context
<ntg-context@ntg.nl> wrote:
>
> Dear Jeong,
>
> Thanks for testing my example, and pointing to the solution using \dm (which I didn’t know…).
> I think the correct behaviour of math alignments should avoid using additional commands such as \dm.
>
> We’ll see what Hans and Mikael say.
>
> Best regards: OK
>
> On 2 Nov 2022, at 12:53, Jeong Dal via ntg-context <ntg-context@ntg.nl> wrote:
>
> Dear Otared,
>
>
> I think there is an issue with the size of math fonts in \frac when used in math alignments, as it is is shown in the following example.
>
>
> I confirm what you said.
>
> However, if I use \dm{} instead of \displaystyle as following, then the output is correct.
>
> \placeformula
> \startformula
> \startalignedcases
> \NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
> \NC \dm{\frac{\partial u}{\partial {\bi n}}}
> \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
> \stopalignedcases
> \stopformula
> or this (with\type{\displaystyle} added)
> \placeformula
> \startformula
> \startalignedcases
> \NC - \Delta u \NC = 0 \NC \qquad\text{in }\, \Omega \NR
> \NC \dm{\frac{\partial u}{\partial {\bi n}}}
> \NC = V u + \phi \NC \qquad\text{on }\, \partial\Omega. \NR
> \stopalignedcases
> \stopformula
>
> In this example, it is OK to use \dm inside of \startformula … \stopformula.
> I am not sure that it is what Hans and Mikael want.
>
> Thanks,
>
> Best regards,
>
> Dalyoung
>
>

I think in this case it is better to use a mathsimplealign instead of a matrix.

\definemathsimplealign[pdeproblem][
left={\startmathfenced[cases]},
right=\stopmathfenced,
align={1:right,2:left,3:left},
strut=yes,
]

\definemathsimplealign[collected][
left={\startmathfenced[sesac]},
right=\stopmathfenced,
align={1:right,2:left,3:left},
strut=yes,
]

\starttext

\placeformula
\startformula
\startpdeproblem
\NC - \Delta u \NC = 0 \NC \qquad\text{in } \Omega \NR
\NC \frac{\partial u}{\partial {\bi n}} \NC = V u + \phi \NC
\qquad\text{on } \partial\Omega \NR
\stoppdeproblem
\stopformula

\placeformula
\startformula
\startcollected
\NC - \Delta u \NC = 0 \NC \qquad\text{in } \Omega \NR
\NC \frac{\partial u}{\partial {\bi n}} \NC = V u + \phi \NC
\qquad\text{on } \partial\Omega \NR
\stopcollected
\stopformula

\stoptext

Best, Mikael
___________________________________________________________________________________
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] 5+ messages in thread

* Re: Bug in math alignment
  2022-11-02 20:44     ` Mikael Sundqvist via ntg-context
@ 2022-11-03  8:31       ` Otared Kavian via ntg-context
  0 siblings, 0 replies; 5+ messages in thread
From: Otared Kavian via ntg-context @ 2022-11-03  8:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

Hi Mikael,

Thanks for your reply.
Indeed with your hint the issue disappears. 
I’ll change my definition…

Best regards: Otared

> On 2 Nov 2022, at 21:44, Mikael Sundqvist via ntg-context <ntg-context@ntg.nl> wrote:
> […]
> I think in this case it is better to use a mathsimplealign instead of a matrix.
> 
> \definemathsimplealign[pdeproblem][
> left={\startmathfenced[cases]},
> right=\stopmathfenced,
> align={1:right,2:left,3:left},
> strut=yes,
> ]
> 
> \definemathsimplealign[collected][
> left={\startmathfenced[sesac]},
> right=\stopmathfenced,
> align={1:right,2:left,3:left},
> strut=yes,
> ]
> 
> \starttext
> 
> \placeformula
> \startformula
> \startpdeproblem
> \NC - \Delta u \NC = 0 \NC \qquad\text{in } \Omega \NR
> \NC \frac{\partial u}{\partial {\bi n}} \NC = V u + \phi \NC
> \qquad\text{on } \partial\Omega \NR
> \stoppdeproblem
> \stopformula
> 
> \placeformula
> \startformula
> \startcollected
> \NC - \Delta u \NC = 0 \NC \qquad\text{in } \Omega \NR
> \NC \frac{\partial u}{\partial {\bi n}} \NC = V u + \phi \NC
> \qquad\text{on } \partial\Omega \NR
> \stopcollected
> \stopformula
> 
> \stoptext
> 
> Best, Mikael
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

Otared Kavian
e-mail: otared@gmail.com
Phone: +33 6 88 26 70 95



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

end of thread, other threads:[~2022-11-03  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02  9:38 Bug in math alignment Otared Kavian via ntg-context
2022-11-02 11:53 ` Jeong Dal via ntg-context
2022-11-02 20:19   ` Otared Kavian via ntg-context
2022-11-02 20:44     ` Mikael Sundqvist via ntg-context
2022-11-03  8:31       ` Otared Kavian 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).