From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/26839 Path: news.gmane.org!not-for-mail From: WN Newsgroups: gmane.comp.tex.context Subject: Re: Myway on using mathalign Date: Thu, 06 Apr 2006 02:17:41 +0200 Message-ID: <44345E25.5000908@cs.com> References: <44331A3E.8070604@cs.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090309040105050808070209" X-Trace: sea.gmane.org 1144282472 29957 80.91.229.2 (6 Apr 2006 00:14:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Apr 2006 00:14:32 +0000 (UTC) Cc: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 06 02:14:29 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 1FRI8m-0004em-Ii for gctc-ntg-context-518@m.gmane.org; Thu, 06 Apr 2006 02:14:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1B1F812796; Thu, 6 Apr 2006 02:14: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 02619-05; Thu, 6 Apr 2006 02:14:20 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DB2211278D; Thu, 6 Apr 2006 02:14:19 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 17D3C1278D for ; Thu, 6 Apr 2006 02:14:18 +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 02658-01 for ; Thu, 6 Apr 2006 02:14:17 +0200 (CEST) Original-Received: from imo-d21.mx.aol.com (imo-d21.mx.aol.com [205.188.144.207]) by ronja.ntg.nl (Postfix) with SMTP id E895C1276F for ; Thu, 6 Apr 2006 02:14:16 +0200 (CEST) Original-Received: from Wneimeijer01@cs.com by imo-d21.mx.aol.com (mail_out_v38_r7.3.) id a.36f.12cbd91 (15889); Wed, 5 Apr 2006 20:14:07 -0400 (EDT) Original-Received: from [192.168.1.33] (3e331ada.dslaccess.aol.com [62.51.26.218]) by air-id08.mx.aol.com (v108_r3.6) with ESMTP id MAILINID84-3e1144345d4d1b1; Wed, 05 Apr 2006 20:14:06 -0400 User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: adityam@umich.edu In-Reply-To: X-AOL-IP: 62.51.26.218 X-Mailer: Unknown (No Version) 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:26839 Archived-At: --------------090309040105050808070209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. > > HTH, > Aditya > > 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. BTW Thanks for your comment on the div, rot. I indeed defined the div and rot in text font, it is defined in one of my environment settings. Attached my small Context script to confirm your solution Again thanks for your help, Kind regards Wim --------------090309040105050808070209 Content-Type: text/plain; name="testformula.tex" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="testformula.tex" \unprotect % ========= Aditya code ============ \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} \startmathcollection[default] \definemathcommand [div] [nolop] {\mfunction{div}} \definemathcommand [rot] [nolop] {\mfunction{rot}} \stopmathcollection % ================================= \definereferenceformat [informula] [left=(, right=), text=] \protect \starttext Some math tests, use of formula/subformula numbering. \placesubformulawithnumber[kem-chapter1-eqn1] \startformula \startalign \NC \div \vec{E} \NC = \frac{\rho}{\epsilon_{0}}\NR[kem-chapter1-eqn1:A][a] \NC \rot \vec{B} \NC = \mu_{0} \:\vec{j} \NR[kem-chapter1-eqn1:B][b] \NC \div \vec{B} \NC = 0 \NR[kem-chapter1-eqn1:C][c] \NC \rot \vec{E} + \frac{\partial \vec{B} }{\partial t} \NC = 0 \NR[kem-chapter1-eqn1:D][d] \stopalign \stopformula See \informula[kem-chapter1-eqn1] or alternatively \informula[kem-chapter1-eqn1:A], \informula[kem-chapter1-eqn1:B],\informula[kem-chapter1-eqn1:C] or \informula[kem-chapter1-eqn1:D]. \blank 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 \stoptext --------------090309040105050808070209 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --------------090309040105050808070209--