From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/26844 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Myway on using mathalign Date: Thu, 6 Apr 2006 01:17:30 -0400 (EDT) Message-ID: References: <44331A3E.8070604@cs.com> <44345E25.5000908@cs.com> 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 1144300667 13630 80.91.229.2 (6 Apr 2006 05:17:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Apr 2006 05:17:47 +0000 (UTC) Cc: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 06 07:17:45 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 1FRMsG-00035E-9y for gctc-ntg-context-518@m.gmane.org; Thu, 06 Apr 2006 07:17:40 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id ED99F127A0; Thu, 6 Apr 2006 07:17:39 +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 06670-04-5; Thu, 6 Apr 2006 07:17:34 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9B0141278F; Thu, 6 Apr 2006 07:17:34 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C7E371278F for ; Thu, 6 Apr 2006 07:17:33 +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 06670-04-4 for ; Thu, 6 Apr 2006 07:17:32 +0200 (CEST) Original-Received: from beyondborders.mr.itd.umich.edu (beyondborders.mr.itd.umich.edu [141.211.93.146]) by ronja.ntg.nl (Postfix) with SMTP id 1A9231278D for ; Thu, 6 Apr 2006 07:17:31 +0200 (CEST) Original-Received: from aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) by beyondborders.mr.itd.umich.edu (smtp) with ESMTP id k365HTcJ028925; Thu, 6 Apr 2006 01:17:29 -0400 Original-To: WN In-Reply-To: <44345E25.5000908@cs.com> 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:26844 Archived-At: On Thu, 6 Apr 2006, WN wrote: > adityam@umich.edu wrote: >> On Wed, 5 Apr 2006, WN wrote: >>> One thing I want to do with a set of subformula's is >>> to reference the main formula but still subnumbering the equations >>> like >> >> Try this. Warning: I do not know everything that is happening here. There >> may be some unexpected side effects. >> >> \unprotect >> \def\placesubformulawithnumber{% >> \dodoubleempty\doplacesubformulawithnumber} >> >> \def\doplacesubformulawithnumber[#1][#2]%#2 gobbles spaces >> {\iffirstargument >> \incrementnumber[\v!formula] >> \makesectionnumber[\v!formula] >> \rawreference{\s!for}{#1}{\composedsectionnumber} >> \else >> \incrementnumber[\v!formula] >> \fi\placesubformula} >> \protect >> >> >>> \starttext >> %% > \incrementnumber[formula] >> %% > \placesubformula >> \placesubformulawithnumber[eqn1] %I need to think of a smaller name >>> \startformula >>> \startalign >>> \NC div \vec{E} \NC = \epsilon_{0}^{-1} \rho \NR[eqn1:A][a] >>> \NC rot \vec{E} \NC = 0 \NR >>> \NC div \vec{B} \NC = 0 \NR[eqn1:B][b] >>> \NC rot \vec{B} \NC = \mu_{0} \vec{j} \NR >>> \stopalign >>> \stopformula >>> See *\in[eqn1] *for the static Maxwell equations, where we are going to >>> examine \in[eqn1:A] a bit further .... >>> \stoptext >>> >> >> Also, note that div and rot should be in text font. You should probably do >> \startmathcollection[default] >> \definemathcommand [div] [nolop] {\mfunction{div}} >> \definemathcommand [rot] [nolop] {\mfunction{rot}} >> \stopmathcollection >> >> and use \div \rot etc. >> > Hi Aditya, > I tested your solution and it works great. I cannot see any problems > in my output. I wish I had your Tex programming skills, I am trying > to learn the language myself from the TexBook (D.Knuth) but I still > have a long way to go. Well, I do not understand Tex. What I usually do is look at the context source, which is much easier to read than latex internals, and then copy from there, play around a bit, and sometimes things work. > Another test to check that the formula numbers work as expected > \placeformula[kem-chapter-eqn11] > \startformula > \cases{ > \eqalign{ > \widehat{\vec{x}} &= - \vec{x} \cr > \widehat{t} & = t \cr > }} > \quad \text{resp.} \quad > \cases{\eqalign{ > \widehat{\vec{x}} &= \vec{x} \cr > \widehat{t} & = -t \cr > }} > \stopformula How about \definemathmatrix [group] [left={\left\{\,},right={\right.}] \startformula \startgroup \NC \widehat{\vec{x}} \NC= - \vec x \NR \NC \widehat t \NC= t \NR \stopgroup \quad \text{resp} \quad \startgroup \NC \widehat{\vec{x}} \NC= \vec x \NR \NC \widehat t \NC= -t \NR \stopgroup \stopformula There is also startstop cases, but that does not give the correct spacing in this case. May be useful otherwise. \startformula \startcases \NC \widehat{\vec{x}} \MC= - \vec x \NR \NC \widehat t \MC= t \NR \stopcases % Read MC as Math Column, there is also the usual NC % which gives a text column \quad \text{resp} \quad \startcases \NC \widehat{\vec{x}} \MC= \vec x \NR \NC \widehat t \MC= -t \NR \stopcases \stopformula HTH, Aditya