ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gerben Wierda <Gerben.Wierda@rna.nl>
Subject: Re: ConTeXt equivalent for \ensuremath?
Date: Fri, 11 Mar 2005 16:54:38 +0100	[thread overview]
Message-ID: <3174c268c21997de08d338255598529a@rna.nl> (raw)
In-Reply-To: <20050311145716.GC5540@puritan.pcp.ath.cx>

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.
> <to be read again>
>                    \hbox
> <argument> \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

  reply	other threads:[~2005-03-11 15:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-11 14:46 Gerben Wierda
2005-03-11 14:57 ` Nikolai Weibull
2005-03-11 15:54   ` Gerben Wierda [this message]
2005-03-11 17:20     ` Adam Lindsay
2005-03-11 18:03       ` Gerben Wierda
2005-03-13 21:24     ` h h extern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3174c268c21997de08d338255598529a@rna.nl \
    --to=gerben.wierda@rna.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).