From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/15974 Path: main.gmane.org!not-for-mail From: Giuseppe Bilotta Newsgroups: gmane.comp.tex.context Subject: Re: Converting math from LaTeX to ConTeXt Date: Sat, 7 Aug 2004 17:12:08 +0200 Sender: ntg-context-bounces@ntg.nl Message-ID: <1716801547.20040807171208@iol.it> References: <4.3.1.2.20040725215940.01876a88@cits1.stanford.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1091976516 3757 80.91.224.253 (8 Aug 2004 14:48:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 8 Aug 2004 14:48:36 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Aug 08 16:48:28 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BtoyK-0007vc-00 for ; Sun, 08 Aug 2004 16:48:28 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6CD0D126F8; Sun, 8 Aug 2004 16:48:28 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 24117-09; Sun, 8 Aug 2004 16:48:28 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CF0881277E; Sun, 8 Aug 2004 16:24:14 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 05AF31277E for ; Sun, 8 Aug 2004 16:24:14 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 23714-07-2 for ; Sun, 8 Aug 2004 16:24:08 +0200 (CEST) Original-Received: from smtp1.libero.it (unknown [193.70.192.51]) by ronja.ntg.nl (Postfix) with ESMTP id 54A4D126F8 for ; Sun, 8 Aug 2004 16:24:08 +0200 (CEST) Original-Received: from localhost (172.16.1.84) by smtp1.libero.it (7.0.027-DD01) id 40C7315F00CA06AD for ntg-context@ntg.nl; Sun, 8 Aug 2004 16:24:13 +0200 Original-Received: from ppp-238-130.29-151.libero.it (151.29.130.238) by smtp1.libero.it (7.0.027-DD01) id 40CB290902C444B4 for ntg-context@ntg.nl; Sun, 8 Aug 2004 16:24:12 +0200 X-Priority: 3 (Normal) Original-To: mailing list for ConTeXt users In-Reply-To: <4.3.1.2.20040725215940.01876a88@cits1.stanford.edu> X-Virus-Scanned: by amavisd-new at libero.it X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:15974 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:15974 Hi Brook, sorry for the horrible delay with which I'm replying to you. I think I have a part of the solution to your problems. Monday, July 26, 2004 Brooks Moses wrote: > Also, many of these equations run over multiple lines using the macros from > the amsmath package (the "split" environment in particular, but also the > "align" environment), and I haven't been able to find much documentation on > how to do this in ConTeXt. I've been working on a ConTeXt module that provides some elementary AMS-compatible definitions, but for complex equations I have a personal preference for the Nath package in LaTeX, so for multiline you might have more luck using the nath module, which is available on CTAN. There is no manual, but you can use the LaTeX package manual as a reference. > For an example of the sorts of things I end up > doing: > \begin{equation} > \begin{split} > \lefteqn{ > \frac{\partial (\rho (\phi u)_j)}{\partial t} > + \nabla_k (\rho (\phi u)_k u_j) > }\quad\quad > \\ > = &\; > -\nabla_j (\phi p) > + \nabla_j (\lambda \nabla_k (\phi u_k)) > + \nabla_k \left[\mu \left( \nabla_k (\phi u)_j > + (\nabla_j (\phi u)_k) \right) \right] > \\&\; > {} - \lambda (\nabla_j u_k) \nabla_k \phi > - \mu (\nabla_k \phi) \nabla_k u_j > - \mu (\nabla_k u_k) \nabla \phi_j > - \tau_{\text{surface, $jk$}} \nabla_k \phi > \end{split} > \end{equation} With ConTeXt+nath, this could become something like \[ \frac{\partial (\rho (\phi u)_j)}{\partial t} + \nabla_k (\rho (\phi u)_k u_j) = \wall -\nabla_j (\phi p) + \nabla_j (\lambda \nabla_k (\phi u_k)) + \nabla_k [\mu ( \nabla_k (\phi u)_j + (\nabla_j (\phi u)_k) )] \\ - \lambda (\nabla_j u_k) \nabla_k \phi - \mu (\nabla_k \phi) \nabla_k u_j - \mu (\nabla_k u_k) \nabla \phi_j - \tau_{\text{surface, $jk$}} \nabla_k \phi \return \] or something. > Looking at that reminds me that I also rather heavily use the \text command > from amsmath as well, and rely on its ability to properly size things in > subscripts and such. Does this (or an analogue) exist in ConTeXt? Yes, there is a \text command in ConTeXt provided you use the amsl or nath modules (note that the nath module needs amsl) > Any suggestions? I'd like to be able to simply cut and paste the equations > like this one from my LaTeX documents into my ConTeXt documents with as > little editing as possible (so that I can maintain consistency between > documents in each format), but anything that produces the same output would > be good to know about. Well, if you can use the Nath module in your LaTeX documents (the module is sadly incompatible with much of the AMS features, so there are cases when it's impossible to convert an AMS-LaTeX document to a LaTeX+Nath module) you can do it with ease. Otherwise, some minor corrections will be necessary to reduce the AMS forms into Nath forms; in some cases cleanups are unnecessary (e.g., Nath will accept \left and \right which are not necessary because of its auto-sizing features) so you can often keep an extremely similar syntax for both forms. Do keep in mind, in all this, that the nath package for ConTeXt still has a few edges that needs smoothing, esp. when it comes to arrays, multiline equations and numbering. Hope this helps. -- Giuseppe "Oblomov" Bilotta