Re: [NTG-context] Tagging and Math Matrix

2017-09-07 Thread Hans Hagen

On 9/7/2017 7:51 AM, Christoph Reller wrote:


However: Testing never stops ;-) I have the following MWE:
These alignments are kind of tricky. I made a fix (will upload later) 
but we need more tests or actually a proper test suite for this. I'm 
pretty sure that there are other issues. (For instance one needs to get 
rid of artifacts related to spacing and wrappers.)


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
___

Re: [NTG-context] Tagging and Math Matrix

2017-09-06 Thread Christoph Reller
On Wed, 6 Sep 2017 11:25:51 +0200 Hans Hagen  wrote:

> On 9/6/2017 9:55 AM, Christoph Reller wrote:
> > On Tue, 5 Sep 2017 16:29:52 +0200 Hans Hagen  > >   wrote:
> >
> > On 8/30/2017 9:45 AM, Christoph Reller wrote:
> >  > On Mon, Dec 28, 2015 at 3:45 PM Christoph Reller
> >  >  wrote:
> >  >
> >  > There seems to be a problem with the structure information added
> >  > when using \startmatrix:
> >  >
> >  > A fix would be very much appreciated.
> >
> > should be ok now
> >
> >
> > Thank you Hans for this fix!
> >
> > There seems to be, however, still a minor issue with a more complete MWE:
> > \math{
> >\startmatrix
> >  \NC A \NC B \NR
> >  \NC C \NC D \NR
> >\stopmatrix}
>
> can you test with
>
> \def\math_matrix_process#1#2%
>{\forgettagging % otherwise dummy mrows and such
> \dowithnextbox
>   {\scratchdimen\dimexpr(\nextboxdp-\nextboxht)/2
> \ifcase#2\or+\mathaxisheight\textfont2\fi\relax
>
>
> \ifcase#1\relax\or\lower\scratchdimen\or\or\raise\scratchdimen\fi\hbox\bgroup
>  \normalstartimath
>  \mathmatrixparameter\c!left
>  \vcenter{\unvbox\nextbox}%
>  \mathmatrixparameter\c!right
>  \normalstopimath
>\egroup}%
> \vbox}
>

Indeed, this is much better! Thank you!
I recommend to include this as a patch in ConTeXt.

However: Testing never stops ;-) I have the following MWE:

\definemathmatrix[pmatrix][left={\left(},right={\right)}]
\math{
  \startpmatrix
\NC A \NC B \NR
\NC C \NC D \NR
  \stoppmatrix}

This (including your suggested fix) results in the following structure tree:


|-
| '-
|   '-
| '-
|   '-
'-
  '-
|-
| |-
| | '-
| |   '-
| | '-
| |   '-"A"
| '-
|   '-
| '-
|   '-
| '-"B"
'-
  |-
  | '-
  |   '-
  | '-
  |   '-"C"
  '-
'-
  '-
'-
  '-"D"

I think that the  should be located within the , shouldn't
it?

Cheers,
Christoph
___
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
___

Re: [NTG-context] Tagging and Math Matrix

2017-09-06 Thread Hans Hagen

On 9/6/2017 9:55 AM, Christoph Reller wrote:
On Tue, 5 Sep 2017 16:29:52 +0200 Hans Hagen >   wrote:


On 8/30/2017 9:45 AM, Christoph Reller wrote:
 > On Mon, Dec 28, 2015 at 3:45 PM Christoph Reller
 > 
>>   wrote:
 >
 > There seems to be a problem with the structure information added
 > when using \startmatrix:
 >
 > A fix would be very much appreciated.

should be ok now


Thank you Hans for this fix!

There seems to be, however, still a minor issue with a more complete MWE:
\math{
   \startmatrix
     \NC A \NC B \NR
     \NC C \NC D \NR
   \stopmatrix}


can you test with

\def\math_matrix_process#1#2%
  {\forgettagging % otherwise dummy mrows and such
   \dowithnextbox
 {\scratchdimen\dimexpr(\nextboxdp-\nextboxht)/2 
\ifcase#2\or+\mathaxisheight\textfont2\fi\relax


\ifcase#1\relax\or\lower\scratchdimen\or\or\raise\scratchdimen\fi\hbox\bgroup
\normalstartimath
\mathmatrixparameter\c!left
\vcenter{\unvbox\nextbox}%
\mathmatrixparameter\c!right
\normalstopimath
  \egroup}%
   \vbox}




The resulting structure tree is as follows:

'-
   '-
     '-
       '-
         |-
         | '-
         |   |-
         |   | '-
         |   |   '-
         |   |     '-
         |   |       '-"A"
         |   '-
         |     '-
         |       '-
         |         '-
         |           '-"B"
         |-            (*)
         |-
         | '-
         |   |-
         |   | '-
         |   |   '-
         |   |     '-
         |   |       '-"C"
         |   '-
         |     '-
         |       '-
         |         '-
         |           '-"D"
         '-            (*)

The elements marked with (*) are IMHO unnecessary. Do you agree?

Cheers
Christoph



___
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
___




--

-
  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
___

Re: [NTG-context] Tagging and Math Matrix

2017-09-06 Thread Christoph Reller
On Tue, 5 Sep 2017 16:29:52 +0200 Hans Hagen    wrote:

> On 8/30/2017 9:45 AM, Christoph Reller wrote:
> > On Mon, Dec 28, 2015 at 3:45 PM Christoph Reller
> >  >>   wrote:
> >
> > There seems to be a problem with the structure information added
> > when using \startmatrix:
> >
> > A fix would be very much appreciated.
>
> should be ok now
>

Thank you Hans for this fix!

There seems to be, however, still a minor issue with a more complete MWE:
\math{
  \startmatrix
\NC A \NC B \NR
\NC C \NC D \NR
  \stopmatrix}

The resulting structure tree is as follows:

'-
  '-
'-
  '-
|-
| '-
|   |-
|   | '-
|   |   '-
|   | '-
|   |   '-"A"
|   '-
| '-
|   '-
| '-
|   '-"B"
|-(*)
|-
| '-
|   |-
|   | '-
|   |   '-
|   | '-
|   |   '-"C"
|   '-
| '-
|   '-
| '-
|   '-"D"
'-(*)

The elements marked with (*) are IMHO unnecessary. Do you agree?

Cheers
Christoph
___
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
___

Re: [NTG-context] Tagging and Math Matrix

2017-09-05 Thread Hans Hagen

On 8/30/2017 9:45 AM, Christoph Reller wrote:
On Mon, Dec 28, 2015 at 3:45 PM Christoph Reller 
>   wrote:


There seems to be a problem with the structure information added
when using
\startmatrix:

\setuptagging[state=start]
\starttext
\math{
   \startmatrix
     \NC A \NR
     \NC B \NR
   \stopmatrix}
\stoptext

The log reports an open chain: document>1 => mtr>1 => mtd>1 => mtr>2 =>
mtd>2 => mtr>3
This may be a bug.


This is clearly a bug. The resulting structure tree of the above MWE is 
as follows (sorry for the ASCII art):



'-
   '-
     |-
     | '-
     |   |-
     |   | '-
     |   |   |-
     |   |   | '-
     |   |   |   '-
     |   |   |     '-
     |   |   |       |-
     |   |   |       '-
     |   |   '-
     |   |     '-
     |   |       '-
     |   |         |-
     |   |         '-
     |   '-
     |     '-
     |       '-
     |         '-"B"
     '-
       '-
         '-
           '-"A"

A fix would be very much appreciated.


should be ok now


--

-
  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
___

Re: [NTG-context] Tagging and Math Matrix

2017-08-30 Thread Christoph Reller
On Mon, Dec 28, 2015 at 3:45 PM Christoph Reller    wrote:

> There seems to be a problem with the structure information added when using
> \startmatrix:
>
> \setuptagging[state=start]
> \starttext
> \math{
>   \startmatrix
> \NC A \NR
> \NC B \NR
>   \stopmatrix}
> \stoptext
>
> The log reports an open chain: document>1 => mtr>1 => mtd>1 => mtr>2 =>
> mtd>2 => mtr>3
> This may be a bug.
>

This is clearly a bug. The resulting structure tree of the above MWE is as
follows (sorry for the ASCII art):


'-
  '-
|-
| '-
|   |-
|   | '-
|   |   |-
|   |   | '-
|   |   |   '-
|   |   | '-
|   |   |   |-
|   |   |   '-
|   |   '-
|   | '-
|   |   '-
|   | |-
|   | '-
|   '-
| '-
|   '-
| '-"B"
'-
  '-
'-
  '-"A"

A fix would be very much appreciated.
Thanks in advance,
Christoph
___
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
___

[NTG-context] Tagging and Math Matrix

2015-12-28 Thread Christoph Reller
Hi,

There seems to be a problem with the structure information added when using
\startmatrix:

\setuptagging[state=start]
\starttext
\math{
  \startmatrix
\NC A \NR
\NC B \NR
  \stopmatrix}
\stoptext

The log reports an open chain: document>1 => mtr>1 => mtd>1 => mtr>2 =>
mtd>2 => mtr>3
This may be a bug.

Kind regards,
Christoph
___
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
___