ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* special math minus
@ 2001-02-15 13:17 Hans Hagen
  2001-02-15 14:22 ` Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2001-02-15 13:17 UTC (permalink / raw)


Hi, 

Sometimes a special minus sign is used to distinguish between a - b and -b.
In the second case, the sign is alightly raised and looks more like a
hyphen than a math minus.

Is there a pre-coocked macro for that? [the problem is that \hbox's are not
zware of superscript status and therefore cannot be used, 

Hans  
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: special math minus
  2001-02-15 13:17 special math minus Hans Hagen
@ 2001-02-15 14:22 ` Taco Hoekwater
  2001-02-15 15:52   ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2001-02-15 14:22 UTC (permalink / raw)


Hans Hagen wrote:
> 
> Hi,
> 
> Sometimes a special minus sign is used to distinguish between a - b and -b.
> In the second case, the sign is alightly raised and looks more like a
> hyphen than a math minus.
> 
> Is there a pre-coocked macro for that? [the problem is that \hbox's are not
> zware of superscript status and therefore cannot be used,

Not one I know of, so you need a mathchoice instead. Something like this
should work:

\def\doneg{\mathord{{#1\raise.2ex\hbox{{#1 -}}}}}

\def\negative{\mathchoice{\doneg{\tf}}{\doneg{\tf}}{\doneg{\tfx}}{\doneg{\tfxx}}}

-- 
groeten,

Taco


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: special math minus
  2001-02-15 14:22 ` Taco Hoekwater
@ 2001-02-15 15:52   ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2001-02-15 15:52 UTC (permalink / raw)
  Cc: ntg-context

At 03:22 PM 2/15/01 +0100, Taco Hoekwater wrote:
>Hans Hagen wrote:
>> 
>> Hi,
>> 
>> Sometimes a special minus sign is used to distinguish between a - b and -b.
>> In the second case, the sign is alightly raised and looks more like a
>> hyphen than a math minus.
>> 
>> Is there a pre-coocked macro for that? [the problem is that \hbox's are not
>> zware of superscript status and therefore cannot be used,
>
>Not one I know of, so you need a mathchoice instead. Something like this

if you don't know it, then there is no -)    

>should work:
>
>\def\doneg{\mathord{{#1\raise.2ex\hbox{{#1 -}}}}}
>
>\def\negative{\mathchoice{\doneg{\tf}}{\doneg{\tf}}{\doneg{\tfx}}{\doneg{\t
fxx}}}

Thanks, I now have: 

\def\domminus#1#2%
  {\mathord{{#2\raise.#1ex\hbox{#2-}}}}

\def\mminus
  {\mathchoice
     {\donegative5\tf}
     {\donegative5\tf}
     {\donegative4\tfx}
     {\donegative3\tfxx}}

$\negative10^{\negative10^{\negative10}}$

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-02-15 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-15 13:17 special math minus Hans Hagen
2001-02-15 14:22 ` Taco Hoekwater
2001-02-15 15:52   ` Hans Hagen

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).