From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30096 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: New math feature requests Date: Tue, 8 Aug 2006 01:49:15 -0400 (EDT) Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1155016176 30517 80.91.229.2 (8 Aug 2006 05:49:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Aug 2006 05:49:36 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 08 07:49:34 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1GAKT4-0003Da-N5 for gctc-ntg-context-518@m.gmane.org; Tue, 08 Aug 2006 07:49:30 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id ECD571FD76; Tue, 8 Aug 2006 07:49:29 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14244-01; Tue, 8 Aug 2006 07:49:25 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id ECEC21FD51; Tue, 8 Aug 2006 07:49:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4C0E41FD51 for ; Tue, 8 Aug 2006 07:49:23 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13806-06 for ; Tue, 8 Aug 2006 07:49:19 +0200 (CEST) Original-Received: from hellskitchen.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.82]) by ronja.ntg.nl (Postfix) with SMTP id 641F21FD08 for ; Tue, 8 Aug 2006 07:49:19 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY hellskitchen.mr.itd.umich.edu ID 44D825DD.85F8F.8947 ; 8 Aug 2006 01:49:17 -0400 Original-To: mailing list for ConTeXt users X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:30096 Archived-At: Hi Hans and Taco, I am back with some more math request---one alignment construct, one inner math alignment construct, and one formula tagging request. These are primarily to "complete" the context math environments. I am posting here rather than on the dev list, so that other math users can also contribute. This is a loong mail. 1. Multiline equations (they are called multline equations in amsmath) This is used to write multiline formulas (where alignement does not make sense). The first line is left aligned, the last line is rightaligned and all the middle lines are middle aligned. The entire formula gets only one number. If the formulas are numbered on the right, then the formula number is located on the last line; if the formulas are numbered on the left, then the formula number is located on the first line. The alignment of a single line can be changed. The first and the last line have a gap equal to \multlinegap from the text border. If the formula is numbered, the gap is used only for the line without the number. I do not know what is a good syntax for this command. First of all, I think we should call it multiline (rather than multline as in ams). Then we can have \placeformula \startmultilineformula[gap=5pt] \NC f(x) = ax \NR \NC + bx + c + \NR \NC e \NR \stopformula This should come out as (assuming formulas are numbered on the right) 5pt gap |---f(x) = ax | <---- left aligned | + bx + c + | <---- middle aligned | + e (1) | <---- right aligned If the formulas are numbered on the left |(1) f(x) = ax | | + bx + c + | | + e---| 5pt gap If there is no placeformula in the front then |---f(x) = ax |<-- left aligned (5pt gap) | + bx + c + |<-- middle aligned | + e---|<-- right aligned with 5pt gap If should be possible to get the 2nd line right aligned by using \NC f(x) = ax \NR \NC[align=right] + bx + c + \NR \NC +e \NR I am not sure of the syntax and the above \NC...\NR is just to illustrate the point. PS: I do not use multline of amsmath frequently. If someone does use it, please read this carefully to ensure that I did not misread the manual. 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\}}] \startformula \startaligned \NC ax + by \EQ c \NR \NC dx + ey \EQ f \NR \stopaligned \quad \text{(simultaneous equations)} \stopformula One crude way to implement this is as follows \def\startaligned{ %Whatever corresponds to left= \left. \framed[align=normal,frame=off,location=lohi] % I do not know how to do this in terms of hboxes \bgroup \vskip-\baselineskip %There should be a better way \startformula \startalign[n=2]} \def\stopaligned{ \stopalign \stopformula \egroup%end of framed % Whatever correspons to right= \right\} } \startformula \startaligned \NC ax + by \EQ c \NR \NC dx + ey \EQ f \NR \stopaligned \quad \text{(simultaneous equations)} \stopformula I am sure that this definition can be improved. The innermath environments should take three types of options (n=...,m=....,distance=....,etc, that are passed to \startalign; left=...,right=..., that put the left and right delimiters; and location=high|low|lohi that align the innermath environment to the baseline. Notice that the crude definition that I have given does not handle location nicely. I know Tex's limitation of scaling left and right delimiters on both sides of the math centerline, making it difficult to handle left|right and location correctly. It there is no easy fix, left|right can be left out. Such a construct will take care of aligned, gathered and split environments of amsmath. 3. Formula tagging amsmath allows formulas to be tagged. I will explain amsmath's behaviour and hope that Hans can come up with the context way of doing such things. Occasionally, one wants to tag a formula, e.g. \placefomrula[a] \startformula a x = b \stopformula \placetaggedformula[b]{*} \startformula x = \frac {b}{a} \stopformula should come out as a x = b (1) x = b/a (*) Notice that ( and ) correspond to left and right in setupformulas. It should also be possible to place a tag without these brackets, so \placetaggedformulawithoutbrackets[c]{**} \startformula b = ax \stopformula should come out as b = ax ** <--- no brackets here Maybe, instead of placetaggedformulawithout brackets, one can simply have \placetaggedformula[c][left=,right=]{**} but in such cases it is easy to get confused with the reference and options. I am not sure what is a good way to do this. It should also be possible to refer to these tagged formulas. So \in{formula}[b] should give * and \in{formula}[c] should give **. The tag should be set in text mode, so that one can say \placetagformula {Answer} and the Answer will come out in text mode. Thanks, Aditya