From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38742 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: amsmath features Date: Mon, 21 Jan 2008 12:57:52 -0500 (EST) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1200938373 19794 80.91.229.12 (21 Jan 2008 17:59:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jan 2008 17:59:33 +0000 (UTC) Cc: mailing list for ConTeXt users To: "Peter I. Hansen" Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 21 18:59:51 2008 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 lo.gmane.org with esmtp (Exim 4.50) id 1JH0w3-0001XU-4o for gctc-ntg-context-518@m.gmane.org; Mon, 21 Jan 2008 18:59:51 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 616751FC45; Mon, 21 Jan 2008 18:59:21 +0100 (CET) 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 04377-01; Mon, 21 Jan 2008 18:58:44 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A8FD41FC27; Mon, 21 Jan 2008 18:58:44 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B26661FC27 for ; Mon, 21 Jan 2008 18:58:43 +0100 (CET) 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 04380-01-4 for ; Mon, 21 Jan 2008 18:58:06 +0100 (CET) Original-Received: from skycaptain.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.160]) by ronja.ntg.nl (Postfix) with ESMTP id C43F01FC12 for ; Mon, 21 Jan 2008 18:58:02 +0100 (CET) Original-Received: FROM adi-laptop.local (c-68-40-40-75.hsd1.mi.comcast.net [68.40.40.75]) BY skycaptain.mr.itd.umich.edu ID 4794DD27.7ACCA.30787 ; 21 Jan 2008 12:57:59 -0500 X-X-Sender: adityam@adi-laptop In-Reply-To: X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:38742 Archived-At: On Mon, 21 Jan 2008, Peter I. Hansen wrote: > Hi, I'm sending you this off-list because of the attachment... > > Your patch works nicely for what I want it do do (The displaylimits), > but I'm a bit confused about the behaviour of the intext math in with > the third option (intlimitcode = 2). > Did I mess things up? > > Best, Peter I had made a mistake in the code. Here is a corrected version, which works for all three cases Aditya \chardef\intlimitcode\zerocount %0 nolimits 1 displaylimits 2 limits \def\intlimits {\ifcase\intlimitcode \nolimits \or \displaylimits \or \limits \fi} \definemathcommand [int] {\intop \intlimits} \definemathcommand [oint] {\ointop\intlimits} \def\repeatintegral#1% {\scratchtoks\emptytoks \let\dointlimits\donothing \let\dodointlimits\intlimits \dorecurse{#1}{\appendtoks \intop \dointkern \to \scratchtoks} \appendtoks \intop \dointlimits \dodointlimits \to \scratchtoks \edef\dodorepeatintegral{\the\scratchtoks}% \futurelet\next\dorepeatintegral} \def\dorepeatintegral {\ifx\next\limits \dointlimitcorrection \else \ifx\next\displaylimits \dointlimitcorrection \else \ifx\next\nolimits \donothing \else \ifcase\intlimitcode\else \dointlimitcorrection \fi\fi\fi\fi \dodorepeatintegral} \def\dointlimitcorrection {\mkern-7mu\mathchoice{\mkern-2mu}{}{}{}% \mathop\bgroup \mkern7mu\mathchoice{\mkern2mu}{}{}{}% \let\dointlimits\egroup} \starttext \startbuffer $\int_a^b f(x) dx$ and also $\iint_a^b f(x,y) dxdy$, $\iiint_a^b f(x,y) dxdy$, $\iiiint_a^b f(x) dx$ \startformula \int_a^b f(x) dx \quad \iint_a^b f(x) dx \quad \iiint_a^b f(x) dx \quad \iiiint_a^b f(x) dx \quad \stopformula $\iint\limits_a^b$ $\iint\nolimits_a^b$ $\iint\displaylimits_a^b$ \startformula \iint\limits_a^b \iint\nolimits_a^b \iint\displaylimits_a^b \stopformula \stopbuffer Default: \getbuffer Displaylimits: \chardef\intlimitcode\plusone \getbuffer Limits: \chardef\intlimitcode\plustwo \getbuffer \stoptext ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________