From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27632 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Align with comments Date: Thu, 4 May 2006 02:44:32 -0400 (EDT) Message-ID: References: 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 1146725190 28408 80.91.229.2 (4 May 2006 06:46:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 May 2006 06:46:30 +0000 (UTC) Cc: Context Mailing List List , Bruce Wagner Original-X-From: ntg-context-bounces@ntg.nl Thu May 04 08:46:26 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 1FbXbV-00014F-N4 for gctc-ntg-context-518@m.gmane.org; Thu, 04 May 2006 08:46:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A576A12791; Thu, 4 May 2006 08:46:24 +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 11879-05; Thu, 4 May 2006 08:46:24 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DA099127A2; Thu, 4 May 2006 08:44:38 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 59C9B127A2 for ; Thu, 4 May 2006 08:44:37 +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 11880-02 for ; Thu, 4 May 2006 08:44:36 +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 C4A6912791 for ; Thu, 4 May 2006 08:44:35 +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 4459A2CF.3AAB0.5784 ; 4 May 2006 02:44:31 -0400 Original-To: David Arnold In-Reply-To: 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:27632 Archived-At: Hi David, On Wed, 3 May 2006, David Arnold wrote: > I think a while back you provided an align example with comments, such as: > > 2x+3=5 Add -3 to both sides > 2x+3-3=5-3 Simplify > 2x=2 Divide both sides by 2 > > Etc. > > Could you provide another sample of this for us? Assuming that you want to align at the = in the equations, you can use the following \startformula \startalign[m=2,distance=4em] \NC 2x + 3 \NC = 5 \NC\NC \text{Add -3 to both sides} \NR \NC 2x + 3 - 3 \NC = 5 - 3 \NC\NC \text{Simplify} \NR \NC 2x \NC = 2 \NC\NC \text{Divide both sides by 2} \NR \stopalign \stopformula If you use this kind of thing frequently, you can add some syntax sugar. \definemathalignment [aligncomments] [m=2,distance=4em] \def\Comment#1\NR{\NC\NC\text{#1}\NR} \startformula \startaligncomments \NC 2x + 3 \NC = 5 \Comment Add -3 to both sides \NR \NC 2x + 3 - 3 \NC = 5 - 3 \Comment Simplify \NR \NC 2x \NC = 2 \Comment Divide both sides by 2 \NR \stopaligncomments \stopformula If you simply want to left align the equations, you can use \definemathalignment [aligncomments] [n=1,align={left},m=2,distance=4em] \def\Comment#1\NR{\NC\text{#1}\NR} \startformula \startaligncomments \NC 2x + 3 = 5 \Comment Add -3 to both sides \NR \NC 2x + 3 - 3 = 5 - 3 \Comment Simplify \NR \NC 2x = 2 \Comment Divide both sides by 2 \NR \stopaligncomments \stopformula Aditya -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008