From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22217 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: bug with active :!;? Date: Wed, 31 Aug 2005 10:19:41 +0200 Message-ID: <4315681D.9070304@elvenkind.com> References: <20050826100117.GA27668@blackowl.org> <4312E88B.1050805@wxs.nl> <20050829132001.GA1758@blackowl.org> <43155E8A.60606@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1125476543 28232 80.91.229.2 (31 Aug 2005 08:22:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Aug 2005 08:22:23 +0000 (UTC) Cc: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 31 10:22:21 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 1EANqJ-0007MT-8t for gctc-ntg-context-518@m.gmane.org; Wed, 31 Aug 2005 10:21:11 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C36FA12783; Wed, 31 Aug 2005 10:21:10 +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 30894-01; Wed, 31 Aug 2005 10:21:05 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B78B912815; Wed, 31 Aug 2005 10:21:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E402212815 for ; Wed, 31 Aug 2005 10:21:04 +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 30727-04 for ; Wed, 31 Aug 2005 10:21:04 +0200 (CEST) Original-Received: from post-23.mail.nl.demon.net (post-23.mail.nl.demon.net [194.159.73.193]) by ronja.ntg.nl (Postfix) with ESMTP id 53A0012783 for ; Wed, 31 Aug 2005 10:21:04 +0200 (CEST) Original-Received: from boo.demon.nl ([82.161.175.147]:40111 helo=[192.168.1.3]) by post-23.mail.nl.demon.net with esmtp (Exim 4.51) id 1EANqB-000PmW-1Q; Wed, 31 Aug 2005 08:21:04 +0000 User-Agent: Mozilla Thunderbird 1.0 (X11/20050215) X-Accept-Language: en-us, en Original-To: Hans Hagen In-Reply-To: <43155E8A.60606@wxs.nl> 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:22217 Archived-At: Hans Hagen wrote: > BILLET Olivier wrote: > >> By the way, does this include the possibility to treat the character in >> different ways depending on the current mode (math/text)? >> Because, in the current setting, if you request for 3cm before `:' and >> then define a mathematical function $f : R \to Z$ you'll end up with a >> huuuge space between f and : which you certainly isn't what you want. >> >> > see attached file; taco may know other tricks (i remember that there is > some mechanism in tex for active char treatment in math mode) It is possible to treat an arbitrary character as if it was \active inside math mode, but not the other way around: when a character has catcode \active, it is always treated as that macro, regardless of the current mode. For curious people, here is how you make a "mathmode only" macro: \mathcode`\!="8000 \begingroup \catcode`\!=13 \gdef!{\it math} \endgroup This is a $!$ test!. Cheers, Taco