ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Possibly bug: misalignment with matrix
@ 2014-10-07  9:22 Xan
  2014-10-07 18:06 ` Thangalin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Xan @ 2014-10-07  9:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

Hi,

Minimal example:


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


\starttext
Digueu quines de les matrius següents són regulars. Quan ho siguin, trobeu la inversa

\startitemize[a,columns,four]
\item \startpmatrix[n=2]
\NC 2 \NC 3 \NR
\NC 6 \NC 7 \NR
\stoppmatrix

\item \startpmatrix[n=3]
\NC 3 \NC 2 \NC 1 \NR
\NC 4 \NC 5 \NC 3 \NR
\NC 5 \NC 0 \NC -2 \NR
\stoppmatrix

\item \startpmatrix[n=3]
\NC 5 \NC 4 \NC 2 \NR
\NC 2 \NC 2 \NC 3 \NR
\NC 7 \NC 6 \NC 5 \NR
\stoppmatrix

\item \startpmatrix[n=4]
\NC a \NC 0 \NC 0 \NC 0 \NR
\NC 0 \NC b \NC 0 \NC 0 \NR
\NC 0 \NC 0 \NC c \NC 0 \NR
\NC 0 \NC 0 \NC 0 \NC d \NR
\stoppmatrix

\stopitemize

\stoptext

produces misalignment in last item (I attach pdf)

Can anyone confirm that?

Thanks,
Xan

[-- Attachment #2: matrix.pdf --]
[-- Type: application/pdf, Size: 11018 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Possibly bug: misalignment with matrix
  2014-10-07  9:22 Possibly bug: misalignment with matrix Xan
@ 2014-10-07 18:06 ` Thangalin
  2014-10-09  7:53   ` Hans Hagen
  2014-10-12 16:40 ` Xan
  2014-10-12 17:08 ` Xan
  2 siblings, 1 reply; 8+ messages in thread
From: Thangalin @ 2014-10-07 18:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Looks like a bug; adding blank rows works around the problem (but
looks terrible):

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

\starttext
Digueu quines de les matrius següents són regulars. Quan ho siguin,
trobeu la inversa

\startitemize[a,columns,four]
\item \startpmatrix[n=4]
\NC \NR
\NC 2 \NC 3 \NR
\NC 6 \NC 7 \NR
\NC \NR
\stoppmatrix

\item \startpmatrix[n=4]
\NC 3 \NC 2 \NC 1 \NR
\NC 4 \NC 5 \NC 3 \NR
\NC 5 \NC 0 \NC -2 \NR
\NC
\stoppmatrix

\item \startpmatrix[n=4]
\NC 5 \NC 4 \NC 2 \NR
\NC 2 \NC 2 \NC 3 \NR
\NC 7 \NC 6 \NC 5 \NR
\NC
\stoppmatrix

\item \startpmatrix[n=4]
\NC a \NC 0 \NC 0 \NC 0 \NR
\NC 0 \NC b \NC 0 \NC 0 \NR
\NC 0 \NC 0 \NC c \NC 0 \NR
\NC 0 \NC 0 \NC 0 \NC d \NR
\stoppmatrix

\stopitemize

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

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

* Re: Possibly bug: misalignment with matrix
  2014-10-07 18:06 ` Thangalin
@ 2014-10-09  7:53   ` Hans Hagen
  2014-10-09 13:31     ` Aditya Mahajan
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2014-10-09  7:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10/7/2014 8:06 PM, Thangalin wrote:
> Looks like a bug; adding blank rows works around the problem (but
> looks terrible):
>
> \definemathmatrix[pmatrix] [left={\left(\,},right={\,\right)}]
>
> \starttext
> Digueu quines de les matrius següents són regulars. Quan ho siguin,
> trobeu la inversa
>
> \startitemize[a,columns,four]
> \item \startpmatrix[n=4]
> \NC \NR
> \NC 2 \NC 3 \NR
> \NC 6 \NC 7 \NR
> \NC \NR
> \stoppmatrix
>
> \item \startpmatrix[n=4]
> \NC 3 \NC 2 \NC 1 \NR
> \NC 4 \NC 5 \NC 3 \NR
> \NC 5 \NC 0 \NC -2 \NR
> \NC
> \stoppmatrix
>
> \item \startpmatrix[n=4]
> \NC 5 \NC 4 \NC 2 \NR
> \NC 2 \NC 2 \NC 3 \NR
> \NC 7 \NC 6 \NC 5 \NR
> \NC
> \stoppmatrix
>
> \item \startpmatrix[n=4]
> \NC a \NC 0 \NC 0 \NC 0 \NR
> \NC 0 \NC b \NC 0 \NC 0 \NR
> \NC 0 \NC 0 \NC c \NC 0 \NR
> \NC 0 \NC 0 \NC 0 \NC d \NR
> \stoppmatrix
>
> \stopitemize
>
> \stoptext

not a bug ...

(1) the matrix is centered around the math axis and has equal height and 
depth so indeed in columns that will not align horizontally

(2) there is no n|m key support in matrices so the n does nothing in 
this kind of matrix

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Possibly bug: misalignment with matrix
  2014-10-09  7:53   ` Hans Hagen
@ 2014-10-09 13:31     ` Aditya Mahajan
  2014-10-09 20:36       ` Thangalin
  0 siblings, 1 reply; 8+ messages in thread
From: Aditya Mahajan @ 2014-10-09 13:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1286 bytes --]

On Thu, 9 Oct 2014, Hans Hagen wrote:

> On 10/7/2014 8:06 PM, Thangalin wrote:
>> Looks like a bug; adding blank rows works around the problem (but
>> looks terrible):
>>
>> \definemathmatrix[pmatrix] [left={\left(\,},right={\,\right)}]
>>
>> \starttext
>> Digueu quines de les matrius següents són regulars. Quan ho siguin,
>> trobeu la inversa
>>
>> \startitemize[a,columns,four]
>> \item \startpmatrix[n=4]
>> \NC \NR
>> \NC 2 \NC 3 \NR
>> \NC 6 \NC 7 \NR
>> \NC \NR
>> \stoppmatrix
>>
>> \item \startpmatrix[n=4]
>> \NC 3 \NC 2 \NC 1 \NR
>> \NC 4 \NC 5 \NC 3 \NR
>> \NC 5 \NC 0 \NC -2 \NR
>> \NC
>> \stoppmatrix
>>
>> \item \startpmatrix[n=4]
>> \NC 5 \NC 4 \NC 2 \NR
>> \NC 2 \NC 2 \NC 3 \NR
>> \NC 7 \NC 6 \NC 5 \NR
>> \NC
>> \stoppmatrix
>>
>> \item \startpmatrix[n=4]
>> \NC a \NC 0 \NC 0 \NC 0 \NR
>> \NC 0 \NC b \NC 0 \NC 0 \NR
>> \NC 0 \NC 0 \NC c \NC 0 \NR
>> \NC 0 \NC 0 \NC 0 \NC d \NR
>> \stoppmatrix
>>
>> \stopitemize
>>
>> \stoptext
>
> not a bug ...
>
> (1) the matrix is centered around the math axis and has equal height and 
> depth so indeed in columns that will not align horizontally

IIRC, we had added a `location=(high|middle|low)` key to change that 
behaviour. (Sorry, cannot test right now).

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Possibly bug: misalignment with matrix
  2014-10-09 13:31     ` Aditya Mahajan
@ 2014-10-09 20:36       ` Thangalin
  0 siblings, 0 replies; 8+ messages in thread
From: Thangalin @ 2014-10-09 20:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Xan,

It's not exactly what you want, but maybe it'll give you some other ideas:

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

\definenumber[pmatrix]
\resetnumber[pmatrix]

\define\nextmatrix{
  \incrementnumber[pmatrix]
  \getnumber[pmatrix].
}

\define[2]\pmatrices{
  \blank[big]
  \framed[frame=off]{
    \startmixedcolumns[n=#1]
      #2
    \stopmixedcolumns
  }
}

\starttext
Digueu quines de les matrius següents són regulars. Quan ho siguin,
trobeu la inversa

\pmatrices{4}{
  \nextmatrix
  \startpmatrix
    \NC 2 \NC 3 \NR
    \NC 6 \NC 7 \NR
  \stoppmatrix
  \column

  \nextmatrix
  \startpmatrix
    \NC 3 \NC 2 \NC 1 \NR
    \NC 4 \NC 5 \NC 3 \NR
    \NC 5 \NC 0 \NC -2 \NR
  \stoppmatrix
  \column

  \nextmatrix
  \startpmatrix
    \NC 5 \NC 4 \NC 2 \NR
    \NC 2 \NC 2 \NC 3 \NR
    \NC 7 \NC 6 \NC 5 \NR
  \stoppmatrix
  \column

  \nextmatrix
  \startpmatrix
    \NC a \NC 0 \NC 0 \NC 0 \NR
    \NC 0 \NC b \NC 0 \NC 0 \NR
    \NC 0 \NC 0 \NC c \NC 0 \NR
    \NC 0 \NC 0 \NC 0 \NC d \NR
  \stoppmatrix
}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Possibly bug: misalignment with matrix
  2014-10-07  9:22 Possibly bug: misalignment with matrix Xan
  2014-10-07 18:06 ` Thangalin
@ 2014-10-12 16:40 ` Xan
  2014-10-12 17:08 ` Xan
  2 siblings, 0 replies; 8+ messages in thread
From: Xan @ 2014-10-12 16:40 UTC (permalink / raw)
  To: Xan; +Cc: mailing list for ConTeXt users

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

Another bug.

@Hans: At least for user view point it's a bug. 
@Thangalin: thanks. A bigskip will solve me problems, but thanks.


\definemathmatrix[det]
[left={\left\lvert\,},right={\,\right\rvert}]


\starttext
Calculeu els determinants següents:

\startitemize[a,columns]

\item $\startdet[n=4]
\NC 1 \NC 1 \NC 1 \NC 1 \NR
\NC 1 \NC 2 \NC 3 \NC 4 \NR
\NC 1 \NC 3 \NC 6 \NC 10 \NR
\NC 1 \NC 4 \NC 10 \NC 20 \NR
\stopdet$

\item $\startdet[n=4]
\NC 1 \NC -2 \NC 0 \NC 1 \NR
\NC 1 \NC 1 \NC 0 \NC 2 \NR
\NC 0 \NC 3 \NC -2 \NC -1 \NR
\NC 1 \NC 1 \NC 1 \NC 3 \NR
\stopdet$

\item $\startdet[n=5]
\NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NR
\NC 2 \NC 3 \NC 4 \NC 5 \NC 1 \NR
\NC 3 \NC 4 \NC 5 \NC 1 \NC 2 \NR
\NC 4 \NC 5 \NC 1 \NC 2 \NC 3 \NR
\NC 5 \NC 1 \NC 2 \NC 3 \NC 4 \NR
\stopdet$

\item $\startdet[n=3]
\NC 1 \NC 2 \NC 3 \NR
\NC 1 \NC 4 \NC 9 \NR
\NC 1 \NC 8 \NC 27 \NR
\stopdet$

\stopitemize

Proveu, sense desenvolupar, que els determinants següents són nuls:

\startitemize[a]
\item $\startdet[n=3]
\NC -\sqrt{3} \NC 3 \NR
\NC 5 \NC -\sqrt{3}\cdot 5 \NR
\stopdet$

\item $\startdet[n=3]
\NC 2 \NC 1 \NC 3 \NR
\NC 1 \NC 0 \NC 1 \NR
\NC -3 \NC 2 \NC -1 \NR
\stopdet$

\stopitemize

\stoptext


[-- Attachment #2: matrix2.pdf --]
[-- Type: application/pdf, Size: 11012 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Possibly bug: misalignment with matrix
  2014-10-07  9:22 Possibly bug: misalignment with matrix Xan
  2014-10-07 18:06 ` Thangalin
  2014-10-12 16:40 ` Xan
@ 2014-10-12 17:08 ` Xan
  2014-10-13  9:19   ` Hans Hagen
  2 siblings, 1 reply; 8+ messages in thread
From: Xan @ 2014-10-12 17:08 UTC (permalink / raw)
  To: Xan; +Cc: mailing list for ConTeXt users

and 

\item $\startdet[n=3]
\NC yz \NC \frac{1}{x} \NC x \NR
\NC zx \NC \frac{1}{y} \NC y \NR
\NC xy \NC \frac{1}{z} \NC z \NR
\stopdet$


puts x over 1 in the second row
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Possibly bug: misalignment with matrix
  2014-10-12 17:08 ` Xan
@ 2014-10-13  9:19   ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2014-10-13  9:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Xan

On 10/12/2014 7:08 PM, Xan wrote:
> and
>
> \item $\startdet[n=3]
> \NC yz \NC \frac{1}{x} \NC x \NR
> \NC zx \NC \frac{1}{y} \NC y \NR
> \NC xy \NC \frac{1}{z} \NC z \NR
> \stopdet$
>
>
> puts x over 1 in the second row

in a next beta ...

\definemathmatrix[TheMatrixA][left={\left\lvert\,},right={\,\right\rvert}]
\definemathmatrix[TheMatrixB][left={\left\lvert\,},right={\,\right\rvert},strut=1.25]
\definemathmatrix[TheMatrixC][left={\left\lvert\,},right={\,\right\rvert},strut=1.50]

\starttext

     $\startTheMatrixA[n=3]
         \NC yz \NC \frac{1}{x} \NC x \NR
         \NC zx \NC \frac{1}{y} \NC y \NR
         \NC xy \NC \frac{1}{z} \NC z \NR
     \stopTheMatrixA$

     $\startTheMatrixB[n=3]
         \NC yz \NC \frac{1}{x} \NC x \NR
         \NC zx \NC \frac{1}{y} \NC y \NR
         \NC xy \NC \frac{1}{z} \NC z \NR
     \stopTheMatrixB$

     $\startTheMatrixC[n=3]
         \NC yz \NC \frac{1}{x} \NC x \NR
         \NC zx \NC \frac{1}{y} \NC y \NR
         \NC xy \NC \frac{1}{z} \NC z \NR
     \stopTheMatrixC$

\stoptext

upto you to wikify it


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2014-10-13  9:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-07  9:22 Possibly bug: misalignment with matrix Xan
2014-10-07 18:06 ` Thangalin
2014-10-09  7:53   ` Hans Hagen
2014-10-09 13:31     ` Aditya Mahajan
2014-10-09 20:36       ` Thangalin
2014-10-12 16:40 ` Xan
2014-10-12 17:08 ` Xan
2014-10-13  9:19   ` 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).