From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21316 Path: news.gmane.org!not-for-mail From: Brooks Moses Newsgroups: gmane.comp.tex.context Subject: A couple of questions on math customizing. Date: Mon, 11 Jul 2005 01:48:40 -0700 Message-ID: <4.3.1.2.20050711013942.02742248@cits1.stanford.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: sea.gmane.org 1121071786 15148 80.91.229.2 (11 Jul 2005 08:49:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Jul 2005 08:49:46 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Jul 11 10:49:44 2005 Return-path: 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 1DrtyQ-0006zc-MY for gctc-ntg-context-518@m.gmane.org; Mon, 11 Jul 2005 10:49:10 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8C703127A3; Mon, 11 Jul 2005 10:48:59 +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 02576-07-3; Mon, 11 Jul 2005 10:48:54 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 35503127B5; Mon, 11 Jul 2005 10:48:54 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 81E93127A3 for ; Mon, 11 Jul 2005 10:48:53 +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 02576-07-2 for ; Mon, 11 Jul 2005 10:48:52 +0200 (CEST) Original-Received: from smtp1.Stanford.EDU (smtp1.Stanford.EDU [171.67.16.123]) by ronja.ntg.nl (Postfix) with ESMTP id 4B50D127B5 for ; Mon, 11 Jul 2005 10:48:51 +0200 (CEST) Original-Received: from mindolluin.stanford.edu (DNab42a50c.Stanford.EDU [171.66.165.12]) by smtp1.Stanford.EDU (8.12.11/8.12.11) with ESMTP id j6B8miYH022537 for ; Mon, 11 Jul 2005 01:48:48 -0700 X-Sender: brooks@cits1.stanford.edu X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Original-To: ConTeXt users list X-Virus-Scanned: 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: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:21316 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21316 I'm working on doing my own math alignment routines. After a lot of poking about in core-mat.tex, I came to the conclusion that \startinnermath and \stopinnermath were probably the things to modify, and the "most polite" way to do that was by defining my own alignment name. So, the following does what I want for a test case: (Note that \defineinnermathhandler is a shortcut to define versions of \startinnermath and \stopinnermath corresponding to the given alignment.) \starttext \defineinnermathhandler{test} {\let\doplaceformulanumber\empty} {} \setupformulas[align=test] \placeformula{a} \startformula c^2 = a^2 + b^2 \eqno{\formulanumber} \stopformula \stoptext First, if I want \stopinnermath to handle the formula number, I have to somehow turn off the \doplaceformulanumber that gets called at the beginning of \dostopformula. Redefining the macro to \empty in \startinnermath works, but it seems a bit inelegant. Is there a better way? Second, if I move that \eqno{\formulanumber} up into \stopinnermath, as in the following sample, I get an error about "\eqno not allowed in math mode", despite the fact that it seems to be doing the exact same thing as the previous example. \starttext \defineinnermathhandler{test} {\let\doplaceformulanumber\empty} {\eqno{\formulanumber}} \setupformulas[align=test] \placeformula{a} \startformula c^2 = a^2 + b^2 \stopformula \stoptext Then, if I enclose the \eqno in an if statement borrowed from the just-erased definition of \doplaceformulanumber, it works again: \starttext \unprotect \defineinnermathhandler{test} {\let\doplaceformulanumber\empty} {\eqno{\formulanumber}} {\doifelse \@@fmlocation \v!left% {\normalleqno {\formulanumber}}% {\normalreqno {\formulanumber}}} \protect \setupformulas[align=test] \placeformula{a} \startformula c^2 = a^2 + b^2 \stopformula \stoptext What's up with that, and what do I need to do to be able to put a bare \eqno in the \stopinnermath macro? Thanks! - Brooks