ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* math functions
@ 2005-08-12 17:59 billet
  2005-08-13 10:20 ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: billet @ 2005-08-12 17:59 UTC (permalink / raw)


Hi,

I would like to set the font used for math functions like \sin to be
the body font. Of course, it should go for scriptsize when used in
exponents.

I tried without success to define  \def\mfunction#1{{\tf\rm #1}} 
What is the conTeXt way to do this?

Thanks for your help,
Olivier

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

* Re: math functions
  2005-08-12 17:59 math functions billet
@ 2005-08-13 10:20 ` Taco Hoekwater
  2005-08-13 10:43   ` billet
  0 siblings, 1 reply; 5+ messages in thread
From: Taco Hoekwater @ 2005-08-13 10:20 UTC (permalink / raw)




billet@eurecom.fr wrote:
> Hi,
> 
> I would like to set the font used for math functions like \sin to be
> the body font. Of course, it should go for scriptsize when used in
> exponents.

But they do that already, at least in the default font setup. Well,
you can try this:

   \def\mfuction#1%
     {\mathchoice
       {\hbox{\rm \tf #1}}
       {\hbox{\rm \tf #1}}
       {\hbox{\rm \tfx #1}}
       {\hbox{\rm \tfxx #1}}}

Cheers, Taco

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

* Re: math functions
  2005-08-13 10:20 ` Taco Hoekwater
@ 2005-08-13 10:43   ` billet
  2005-08-13 11:31     ` Taco Hoekwater
  2005-08-13 20:13     ` Hans Hagen
  0 siblings, 2 replies; 5+ messages in thread
From: billet @ 2005-08-13 10:43 UTC (permalink / raw)


Quoting  "Taco Hoekwater" :
> -- was taco@elvenkind.com on Aug 13, 2005 at 12:20:44PM --

> But they do that already, at least in the default font setup.
$ grep '\\def\\mfunction' /usr/share/texmf/tex/context/base/*
/usr/share/texmf/tex/context/base/math-ini.tex:\def\mfunction#1{{\mr#1}}


>   \def\mfuction#1%
>     {\mathchoice
>       {\hbox{\rm \tf #1}}
>       {\hbox{\rm \tf #1}}
>       {\hbox{\rm \tfx #1}}
>       {\hbox{\rm \tfxx #1}}}
Many thanks, that was what I was looking for.
Olivier

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

* Re: math functions
  2005-08-13 10:43   ` billet
@ 2005-08-13 11:31     ` Taco Hoekwater
  2005-08-13 20:13     ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Taco Hoekwater @ 2005-08-13 11:31 UTC (permalink / raw)


billet@eurecom.fr wrote:
> Quoting  "Taco Hoekwater" :
> 
>>-- was taco@elvenkind.com on Aug 13, 2005 at 12:20:44PM --
> 
> 
>>But they do that already, at least in the default font setup.
> 
> $ grep '\\def\\mfunction' /usr/share/texmf/tex/context/base/*
> /usr/share/texmf/tex/context/base/math-ini.tex:\def\mfunction#1{{\mr#1}}

Yes, I know. That definies does give me computer modern regular upright,
scaled properly.

Taco

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

* Re: math functions
  2005-08-13 10:43   ` billet
  2005-08-13 11:31     ` Taco Hoekwater
@ 2005-08-13 20:13     ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2005-08-13 20:13 UTC (permalink / raw)


billet@eurecom.fr wrote:

>Quoting  "Taco Hoekwater" :
>  
>
>>-- was taco@elvenkind.com on Aug 13, 2005 at 12:20:44PM --
>>    
>>
>
>  
>
>>But they do that already, at least in the default font setup.
>>    
>>
>$ grep '\\def\\mfunction' /usr/share/texmf/tex/context/base/*
>/usr/share/texmf/tex/context/base/math-ini.tex:\def\mfunction#1{{\mr#1}}
>
>
>  
>
>>  \def\mfuction#1%
>>    {\mathchoice
>>      {\hbox{\rm \tf #1}}
>>      {\hbox{\rm \tf #1}}
>>      {\hbox{\rm \tfx #1}}
>>      {\hbox{\rm \tfxx #1}}}
>>    
>>
>Many thanks, that was what I was looking for.
>  
>
Ok, I added thsi to math-ini:

%D Taco posted this solution as response to a mail by Olivier, so
%D let's integrate it here.

\def\setmathfunctionstyle#1% \rm \ss \tt
  {\def\mfunction##1% no families, just scaling a la text
     {\mathchoice
        {\hbox{\csname#1\endcsname\tf  ##1}}
        {\hbox{\csname#1\endcsname\tf  ##1}}
        {\hbox{\csname#1\endcsname\tfx ##1}}
        {\hbox{\csname#1\endcsname\tfxx##1}}}}

%D Usage:
%D
%D \starttyping
%D \setmathfunctionstyle\fontstyle % or {rm} or {ss} or ..
%D \rm test $\sin{(x^{\sin(x^{\sin(x)})})}$ test
%D \ss test $\sin{(x^{\sin(x^{\sin(x)})})}$ test
%D \tt test $\sin{(x^{\sin(x^{\sin(x)})})}$ test
%D \stoptyping

so, you can follow the style automatically 

Hans 

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

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

end of thread, other threads:[~2005-08-13 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-12 17:59 math functions billet
2005-08-13 10:20 ` Taco Hoekwater
2005-08-13 10:43   ` billet
2005-08-13 11:31     ` Taco Hoekwater
2005-08-13 20:13     ` 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).