From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39604 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: A few questions about aligned maths Date: Sun, 23 Mar 2008 01:31:41 -0400 (EDT) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1206276396 9101 80.91.229.12 (23 Mar 2008 12:46:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Mar 2008 12:46:36 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 23 13:47:05 2008 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 lo.gmane.org with esmtp (Exim 4.50) id 1JdPbM-00020v-77 for gctc-ntg-context-518@m.gmane.org; Sun, 23 Mar 2008 13:47:04 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7C0E01FE4B; Sun, 23 Mar 2008 13:46:27 +0100 (CET) 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 06555-01-12; Sun, 23 Mar 2008 13:45:52 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 540091FF5A; Sun, 23 Mar 2008 10:50:01 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 48DF41FF55 for ; Sun, 23 Mar 2008 10:49:58 +0100 (CET) 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 25486-01-13 for ; Sun, 23 Mar 2008 10:49:36 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with ESMTP id 50012200C9 for ; Sun, 23 Mar 2008 06:30:23 +0100 (CET) Original-Received: FROM adi-laptop.local (c-68-40-40-75.hsd1.mi.comcast.net [68.40.40.75]) BY hackers.mr.itd.umich.edu ID 47E5EAED.535F2.20025 ; 23 Mar 2008 01:30:21 -0400 In-Reply-To: User-Agent: Alpine 1.00 (DEB 882 2007-12-20) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:39604 Archived-At: On Thu, 13 Mar 2008, Morgan Brassel wrote: > 3) Aditya, I saw your remark in your 'My Way' concerning the 'multline' > environment. I must admit I would really be glad to see it appear in > ConTeXt! I'm afraid I'm not able to implement it myself... I use it a > lot with amsmath: when a formula is just too long for one line, I put it > on two with multline. The first part of the formula is left aligned on the > first line, and the second part is right aligned on the second line. It seems > impossible to get the same result with only 'align'. Would it be difficult > to make it available in ConTeXt? Here is my first attempt. Completely bare-bones right now, but short enough to show what needs to be done. \unprotect \def\startmathlines {\def\stop@math{$} \def\NC{} \def\NR{\def\NC{\cr}} % Hack for number. Should be done by measuring the width of the number \scratchdimen\dimexpr\displaywidth-4em \relax \vbox \bgroup \halign\bgroup \hbox to \scratchdimen {\hfil \strut $\mathsurround\zeropoint\displaystyle{}## \stop@math \hfil}% \crcr \hfilneg} \def\stopmathlines {\hfilneg \crcr \egroup \egroup} \protect \starttext \placeformula \startformula \startmathlines \NC f(x) = (a+b)^n \NR \NC = a^n + n \cdot a^{n-1} b + \cdots + n \cdot a b^{n-1} + b^n \NR \NC = a^n + n \cdot a^{n-1} b + \cdots + n \cdot a b^{n-1} + b^n \NR \stopmathlines \stopformula \stoptext Taking care of [align=left|right] should be easy. This version will not break across pages. I cannot figure out how to get rid of the outer \vbox. Any suggestions? Aditya ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________