From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/32045 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: \placeformula and $$ doesn't work anymore Date: Tue, 5 Dec 2006 17:09:44 -0500 (EST) Message-ID: References: <20061204212456.GA17543@shahin.dnsalias.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1165356622 8291 80.91.229.10 (5 Dec 2006 22:10:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Dec 2006 22:10:22 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 05 23:10:19 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 dough.gmane.org with esmtp (Exim 4.50) id 1GriUL-0004Jk-1A for gctc-ntg-context-518@m.gmane.org; Tue, 05 Dec 2006 23:10:09 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7AF421FF2C; Tue, 5 Dec 2006 23:07:28 +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 32267-02; Tue, 5 Dec 2006 23:07:18 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C681C1FEDA; Tue, 5 Dec 2006 23:07:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 105641FEF6 for ; Tue, 5 Dec 2006 23:07:12 +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 32258-05-7 for ; Tue, 5 Dec 2006 23:07:06 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with SMTP id 2836B1FED8 for ; Tue, 5 Dec 2006 23:07:05 +0100 (CET) Original-Received: FROM aditya.engin.umich.edu (udhcp-wlan96.public.engin.umich.edu [141.213.120.106]) BY hackers.mr.itd.umich.edu ID 4575EE28.3B167.21875 ; 5 Dec 2006 17:09:44 -0500 Original-To: mailing list for ConTeXt users In-Reply-To: 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:32045 Archived-At: On Tue, 5 Dec 2006, Aditya Mahajan wrote: > On Mon, 4 Dec 2006, Hubertus Schmidt wrote: > > > Hi all, > > for some weeks I need to tex formulas again and tried the way I used to do it: > > > > \placeformula > > $$ > > f(t)={1\over2\pi}\int_0^\infty e^{i(\omega t-kx)} dx > > $$ > > > > It didn't work anymore?!? It doesn't place a number nor does it do the spacing > > properly. It does work the "context" way using > > > > \placeformula > > \startformula > > f(t)={1\over2\pi}\int_0^\infty e^{i(\omega t-kx)} dx > > \stopformula > > This is a bug in doplaceformula. I do not know how to avoid it, but > the next code illustrates what is happening. > > \def\dotest{ > \def\nextnext{$}% > \ifx\next\nextnext > Inside dispplaceformula\ldots % This always fails > \else > Inside dodoplaceformula\ldots > \fi} > > \def\test{\futurelet\next\dotest} > > \test$$A = B$$ > > This prints "Inside dodoplaceformula" even though the next character > is \$. > > So, the \next=\nextnext branch never matches. I do not know why this > happens, but a more robust check is needed in doplaceformula. \ifcat seems to be working, but I do not really know how robust this is? \unprotect \def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces {\def\redoplaceformula {\bgroup \ifx\next\bgroup \egroup \@EA\moreplaceformula % [ref]{} \else % \def\nextnext{$}% % \ifx\next\nextnext \ifcat\next$% \egroup \@EAEAEA\dispplaceformula % [ref]$$ \else \egroup \@EAEAEA\dodoplaceformula % [ref]\start \fi \fi[#1]{}}% \futurelet\next\redoplaceformula} \long\def\moreplaceformula[#1]#2#3#4% #2 dummy #4 gobbles spaces {\def\redoplaceformula {\bgroup % \def\nextnext{$}% % \ifx\next\nextnext \ifcat\next$% \egroup \@EA\dispplaceformula % [ref]$$ \else \egroup \@EA\dodoplaceformula % [ref]\start \fi [#1]{#3}}% \futurelet\next\redoplaceformula#4} \protect \starttext \placeformula[eq:test] $$A = B$$ \stoptext Aditya