From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39615 Path: news.gmane.org!not-for-mail From: Morgan Brassel Newsgroups: gmane.comp.tex.context Subject: Re: A few questions about aligned maths Date: Mon, 24 Mar 2008 01:00:24 +0100 (CET) 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 1206316905 5591 80.91.229.12 (24 Mar 2008 00:01:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Mar 2008 00:01:45 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Mar 24 01:02:15 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 1Jda8i-000267-Ux for gctc-ntg-context-518@m.gmane.org; Mon, 24 Mar 2008 01:02:13 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7D01E1FC03; Mon, 24 Mar 2008 01:01:36 +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 00760-01-5; Mon, 24 Mar 2008 01:01:10 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9C3281FBD4; Mon, 24 Mar 2008 01:01:10 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0D1C01FBD4 for ; Mon, 24 Mar 2008 01:01:09 +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 00760-01-4 for ; Mon, 24 Mar 2008 01:00:31 +0100 (CET) Original-Received: from smtp1-g19.free.fr (smtp1-g19.free.fr [212.27.42.27]) by ronja.ntg.nl (Postfix) with ESMTP id CAA2A1FBBD for ; Mon, 24 Mar 2008 01:00:31 +0100 (CET) Original-Received: from smtp1-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp1-g19.free.fr (Postfix) with ESMTP id 92A241AB2CB for ; Mon, 24 Mar 2008 01:00:31 +0100 (CET) Original-Received: from [192.168.0.32] (pas38-3-82-226-102-214.fbx.proxad.net [82.226.102.214]) by smtp1-g19.free.fr (Postfix) with ESMTP id 623C81AB2C6 for ; Mon, 24 Mar 2008 01:00:31 +0100 (CET) X-X-Sender: brassel@leo In-Reply-To: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) 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:39615 Archived-At: On Sun, 23 Mar 2008, Aditya Mahajan wrote: > 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 Sorry that I can't help you with the implementation, Aditya... I just want to confirm that your new macro perfectly fits my needs. I hope it will make it into the core, it really is useful! As always, a big thanks for your time and patience! Morgan ___________________________________________________________________________________ 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 ___________________________________________________________________________________