[NTG-context] New math feature requests

Aditya Mahajan adityam at umich.edu
Tue Aug 8 17:38:14 CEST 2006


On Tue, 8 Aug 2006, Taco Hoekwater wrote:

> Aditya Mahajan wrote:
>>
>> 2. In amsmath, most of alignment constructs exist in two forms: outer
>> and inner. The mathalignment implemented in core-mat.tex corresponds
>> to outer alignment. The inner alignment is same as outer alignment,
>> but is only as wide as necessay. The most common amsmath inner
>> alignment constructs are aligned and gathered. It is easiest to
>> explain by means of an example. Suppose I want to type
>>
>>    a x + b y = c `\
>>                    } (simultaneous equations)
>>    d x + e y = f  /
>>                  ,
>>
>> I want to be able to do
>>
>> \defineinnermathalignment[aligned][n=2,left={\left.},right={\right\}}]
>
> This sounds very close to \definemathmatrix, yes?

It is, and my first thought was that this can be achieved using 
\definematrix (that is why the previous requests for location= and 
style=). However, all my attempts to use a matrix failed because:

1. Matrix does not "see" beyond the \NCs as align.

Comapre the output of

\startformula \startalign[n=2]
  \NC a \NC = bx + c \NR
  \NC   \NC + ey \NR
\stopalign \stopformula

with

\startformula \startmatrix[n=2,distance=0pt, style=\displaystyle]
  \NC a \NC = bx + c \NR
  \NC   \NC + ey \NR
\stopmatrix \stopformula

The '+' in the second line comes out as a unary operator rather than a binary
operator. This can be corrected by using \NC{}+ but should the user really
know the ugly implementation details?

2. Matrix does not correct interline space. Compare

\startformula \startalign[n=2]
  \NC f(x) \NC = \int_{-\infty}^{\infty} \phi(y-x) dy \NR
  \NC      \NC = \sum_{i=-\infty}^{\infty} \hat phi(i-x) \NR
\stopalign \stopformula

with

\startformula \startmatrix[n=2,distance=0pt, style=\displaystyle]
  \NC f(x) \NC = \int_{-\infty}^{\infty} \phi(y-x) dy \NR
  \NC      \NC = \sum_{i=-\infty}^{\infty} \hat phi(i-x) \NR
\stopmatrix \stopformula

The two lines are too close.

I thought that it might be easier to simply wrap the whole align 
around a hbox as these inner alignments need not break across pages. 
If matrix can be enhanced to take care of the above two requirements 
then matrix is fine. However, if I just want a matrix, then both above 
behaviours of the matrix are correct. I am not sure what kind of 
interface matrix should have to behave in both ways (the current 
matrix behaviour and the requested aligned behaviour).


Aditya


More information about the ntg-context mailing list