From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/18921 Path: news.gmane.org!not-for-mail From: h h extern Newsgroups: gmane.comp.tex.context Subject: Re: ConTeXt equivalent for \ensuremath? Date: Sun, 13 Mar 2005 22:24:16 +0100 Message-ID: <4234AF80.9020005@wxs.nl> References: <4010ecb891c7439727015208c6c6b11e@rna.nl> <20050311145716.GC5540@puritan.pcp.ath.cx> <3174c268c21997de08d338255598529a@rna.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 1110756923 6864 80.91.229.2 (13 Mar 2005 23:35:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 13 Mar 2005 23:35:23 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Mar 14 00:35:22 2005 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 1DAcbO-0006fD-8E for gctc-ntg-context-518@m.gmane.org; Mon, 14 Mar 2005 00:34:30 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 91B60128A0; Mon, 14 Mar 2005 00:35:26 +0100 (CET) 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 30945-01-2; Mon, 14 Mar 2005 00:35:23 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3DA1F12872; Mon, 14 Mar 2005 00:35:23 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AA2771285C for ; Mon, 14 Mar 2005 00:35:21 +0100 (CET) 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 30945-01 for ; Mon, 14 Mar 2005 00:35:21 +0100 (CET) Original-Received: from mailrelay01.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 219DE1289B for ; Mon, 14 Mar 2005 00:08:18 +0100 (CET) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay01.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j2DN8C23005220; Mon, 14 Mar 2005 00:08:12 +0100 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 9535617C21; Sun, 13 Mar 2005 23:52:46 +0100 (CET) Original-Received: from [127.0.0.1] (unknown [10.100.1.1]) by server-1.pragma-net.nl (Postfix) with ESMTP id 1871A17B39; Sun, 13 Mar 2005 22:52:44 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users , Gerben.Wierda@rna.nl In-Reply-To: <3174c268c21997de08d338255598529a@rna.nl> X-Virus-Scanned: ClamAV 0.80/744/Fri Mar 4 04:01:45 2005 clamav-milter version 0.80j on mailrelay01 X-Virus-Status: Clean 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: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl X-MailScanner-From: ntg-context-bounces@ntg.nl X-MailScanner-To: gctc-ntg-context-518@m.gmane.org Xref: news.gmane.org gmane.comp.tex.context:18921 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:18921 Gerben Wierda wrote: > On Mar 11, 2005, at 15:57, Nikolai Weibull wrote: > >>> \newcommand{\ensuremath}[1]{\ifmmode\expandafter\FirtsOfOne% >>> \else\expandafter\EnsuredMath\fi} >>> \long\def\FirstOfOne#1{#1} >>> \long\def\EnsuredMath#1{$\relax#1$} >>> \newcommand{\bit}[2]{\ensuremath{\hbox{\tf #1}_\hbox{\tf #2}}} >> >> >>> but is there a ConTeXt way of doing this? >> >> >> \mathematics{...}, >> nikolai >> > > Replacing \ensuremath above with \mathematics gives an error (both > attempts): > >>> \newcommand{\bit}[2]{\mathematics{\hbox{\tf #1}_\hbox{\tf #2}}} >>> \newcommand{\bit}[2]{\mathematics{{\hbox{\tf #1}_\hbox{\tf #2}}}} you now say something like _\hbox and since _ kind of takes an argument, it gets an hbox only; you need _{\hbox{..}} as in: \def\bit#1#2{\mathematics{\hbox{\tf#1}_{\hbox{\tf#2}}}} \bit{1}{2} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------