[NTG-context] Changing font for math function

Hans Hagen pragma at wxs.nl
Mon May 11 18:44:49 CEST 2015


On 5/11/2015 6:16 PM, Aditya Mahajan wrote:
> On Sun, 10 May 2015, Hans Hagen wrote:
>
>> next beta: when one of the stylealternatives text mode else mathmode
>> (default nothing == mathupright)
>>
>> \starttext
>>
>> \setupmathematics[functionstyle=,functioncolor=darkred]
>>
>> {\ss $\sin x$} {\bf $\sin x$}
>>
>> \setupmathematics[functionstyle=sansbold,functioncolor=darkblue]
>>
>> {\ss $\sin x$} {\bf $\sin x$}
>>
>> \setupmathematics[functionstyle=roman,functioncolor=darkgreen]
>>
>> {\ss $\sin x$} {\bf $\sin x$}
>>
>> \stoptext
>
> functionstyle=roman is affected by font switches \bf and \it. It should
> not be affected.
>
> \setupmathematics[functionstyle=roman]
> {\it $\sin x$}
>
> This is especially important because typically theorems, etc are typeset
> in italic. It tried setting functionstyle=\normalrm but that turns
> everything into italic.
>
> Complete example:
>
>
> \starttext
> \setupmathematics[functionstyle=,functioncolor=darkred]
>
> {\ss $\sin x$} {\bf $\sin x$} {\it $\sin x$}
>
> \setupmathematics[functionstyle=sansbold,functioncolor=darkblue]
>
> {\ss $\sin x$} {\bf $\sin x$} {\it $\sin x$}
>
> \setupmathematics[functionstyle=serif,functioncolor=darkgreen]
>
> {\ss $\sin x$} {\bf $\sin x$} {\it $\sin x$}
>
> \stoptext

we can add

\unprotect

\def\v!sansnormal {sansnormal}
%def\v!sansbold   {sansbold}
\def\v!serifnormal{serifnormal}
\def\v!serifbold  {serifbold}

\definealternativestyle [\v!sansnormal]  [\ss\tf]
%definealternativestyle [\v!sansbold]    [\ss\bf]
\definealternativestyle [\v!serifnormal] [\rm\tf]
\definealternativestyle [\v!serifbold]   [\rm\bf]

\protect

\setupmathematics[functionstyle=sansbold,functioncolor=darkblue]


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list