From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/18834 Path: news.gmane.org!not-for-mail From: Gerben Wierda Newsgroups: gmane.comp.tex.context Subject: Re: ConTeXt equivalent for \ensuremath? Date: Fri, 11 Mar 2005 16:54:38 +0100 Message-ID: <3174c268c21997de08d338255598529a@rna.nl> References: <4010ecb891c7439727015208c6c6b11e@rna.nl> <20050311145716.GC5540@puritan.pcp.ath.cx> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1110556812 859 80.91.229.2 (11 Mar 2005 16:00:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2005 16:00:12 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Mar 11 17:00:11 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 1D9mSr-00045w-3r for gctc-ntg-context-518@m.gmane.org; Fri, 11 Mar 2005 16:54:13 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 23CB81286B; Fri, 11 Mar 2005 16:54:47 +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 22089-03; Fri, 11 Mar 2005 16:54:42 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A8F9112865; Fri, 11 Mar 2005 16:54:42 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2C6F612865 for ; Fri, 11 Mar 2005 16:54:42 +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 21938-05-2 for ; Fri, 11 Mar 2005 16:54:41 +0100 (CET) Original-Received: from post-24.mail.nl.demon.net (post-24.mail.nl.demon.net [194.159.73.194]) by ronja.ntg.nl (Postfix) with ESMTP id 7F12312855 for ; Fri, 11 Mar 2005 16:54:41 +0100 (CET) Original-Received: from ii2.demon.nl ([82.161.98.36]:23070 helo=mail.rna.nl) by post-24.mail.nl.demon.net with esmtp (Exim 4.43) id 1D9mTJ-000KAk-DY for ntg-context@ntg.nl; Fri, 11 Mar 2005 15:54:41 +0000 Original-Received: from [192.168.2.99] (hedwig.rna.nl [192.168.2.99]) by mail.rna.nl (Postfix) with ESMTP id E36646685F for ; Fri, 11 Mar 2005 16:54:40 +0100 (CET) In-Reply-To: <20050311145716.GC5540@puritan.pcp.ath.cx> Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.619.2) 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:18834 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:18834 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}}}} > ! Missing { inserted. > > \hbox > \hbox {\tf b}_\hbox > {\tf off} > \mathematics #1->\relax \ifmmode #1\else $#1 > $\fi > l.53 ...er off or on, lets call these \bit{b}{off} > and But my way also doesn't work. I get empty output as a result of the \bit{b}{off} command. Help? G