ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Changing font for math function
@ 2015-05-16 14:23 Maggyero
  2015-05-16 15:35 ` Hans Hagen
  0 siblings, 1 reply; 34+ messages in thread
From: Maggyero @ 2015-05-16 14:23 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1117 bytes --]

> Aditya Mahajan:
> By default, in all three formats the font for \log is mathupright rather
> than textrm. There needs to be a rationale for ConTeXt default to be
> different from other formats. Do you have any reference to a math book or
> journal that uses text fonts for \log-like operators?

Thanks for the examples. I had forgotten that math fonts can differ from
text fonts. Now I understand why you use \mathupright (which, according to
the source code is identical in math mode to \mathrm and \rm). And I know
that math fonts have different kerning and ligatures than text fonts.

But how is that in LaTeX, kerning and ligatures in math mode inside \mathrm
are the same as those of the TEXT font (while in ConTeXt \mathrm still uses
the kerning and ligatures of the math font, which seems logical)? Compare
the following:

LaTeX:

\documentclass{article}

\begin{document}
affinity\par
$\mathrm{affinity}$\par % kerning and ligatures of TEXT mode with math font
\end{document}

ConTeXt:

\starttext
affinity\par
$\mathrm affinity$\par % kerning and ligatures of MATH mode with math font
\stoptext


Maggyero

[-- Attachment #1.2: Type: text/html, Size: 1568 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Changing font for math function
@ 2015-05-15 23:34 Maggyero
  2015-05-16  0:24 ` Aditya Mahajan
  0 siblings, 1 reply; 34+ messages in thread
From: Maggyero @ 2015-05-15 23:34 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 5480 bytes --]

> Aditya Mahajan:
> The default should be \mathupright (as is the case in amstex
and latex, and probably also plaintex).

> Hans Hagen:
> next beta: when one of the stylealternatives text mode else mathmode
> (default nothing == math upright)

> Hans Hagen:
>> Because like in \mtext, the \text command is ESSENTIAL (for the function
names to have the mathcodes, kerning and ligatures of the text mode instead
of the ones of the math mode).
>that is not needed because if you use a style known as text style a text
font is used

Alright, but why not ALWAYS use your text style (or my \text), why talking
about \mathupright then? \mathupright should never be used to display a
name in text style in my opinion. I don't get it, is there something that I
missed with that \mathupright? (And I'm not managing to download the new
beta of yesterday so I don't have access to the new code yet).


Appart from that story of \text or not \text, what do you think about the
suggestion that I gave in the conclusion of my previous post? Do you plan
to still use version 1 or to implement version 2 after the freeze for
TeXLive 2015? My conclusion was:

CONCLUSION. — It all comes down to the choice of the best user interface
for math functions and math texts (usually used as subscripts of
variables). Their styles and colors is handled with \setupmathematics.
There are two choices of user interface:
1. $\normalmathop{\mfunction{Arsinh}}\nolimits x\ \text{and}\
n_{\mtext{air}}$.
2. $\mfunction{Arsinh} x\ \text{and}\ n_{\mtext{air}}$.

First, the default functionstyle and textstyle in \setupmathematics should
be \rm\tf (the text mode equivalent of \mathupright, as we are always in
text mode thanks to the \text hardcoded in \mfunction and \mtext).

Then, in the 1st solution \normalmathop is used instead of \mathop because
the latter is modified by ConTeXt to convert \rm to \mf, which makes
\setupmathematics[functionstyle=\rm] without effect.

The 2nd solution is obviously way cleaner, that is why I think it should be
preferred. The implementation is given in my '2nd DEFINITION of \mfunction'
for replacing the existing definition in math-ini.mkiv:
———————————————————————
\unexpanded\def\mfunction{\dosingleempty\domfunction}
\def\domfunction[#1]#2%
  {\iffirstargument

 \doifelse{#1}{op}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\doifelse{#1}{limop}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}\nolimits}}
   \else

 \normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}\nolimits
   \fi}
———————————————————————

We also saw that \mfunctionlabeltext is inconsistent with ConTeXt
\labeltext because the former has a style attached to it, so
\mfunctionlabeltext should be removed from math-ini.mkiv and
\mfunction{\mathlabeltext } should be used instead when needed.

To go even further in userfriendlyness, we the new macro \definemathcommand
should be added in math-ini.mkiv:
———————————————————————
\unexpanded\def\definemathfunction{\dodoubleempty\dodefinemathfunction}
\def\dodefinemathfunction[#1][#2]#3%
  {\ifsecondargument
     \definemathcommand[#1]{\mfunction[#2]{#3}}
   \else
     \definemathcommand[#1]{\mfunction{#3}}
   \fi}
———————————————————————

Finally, with this new \mfunction definition and the removal of the
misleading \mfunctionlabeltext, the functions defined in math-def.mkiv
should be rewrite as:
———————————————————————
\definemathcommand[cos]{\mfunction{\mathlabeltext{cos}}} % Or
\definemathcommand[cos]{\mfunction[nolop]{\mathlabeltext{cos}}}, it is the
same.
\definemathcommand[det]{\mfunction[limop]{\mathlabeltext{det}}}
\definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle
d}}\mathopen{}}
%etc.
———————————————————————

or
———————————————————————
\definemathfunction[cos]{\mathlabeltext{cos}} % Or
\definemathfunction[cos][nolop]{\mathlabeltext{cos}}, it is the same.
\definemathfunction[det][limop]{\mathlabeltext{det}}
\definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle
d}}\mathopen{}} % It is a special function so it should still be treated
with the more general \definemathcommand.
%etc.
———————————————————————

ConTeXt users are now provided, if Hans agrees to implement the code given
in this conclusion, with three extremely useful macros:
— \mtext (that should be used for all math texts such as subscripts of
variables):
  $n_{\mtext{air}}$;
— \mfunction (the equivalent of LaTeX \operatorname macro of the amsopn
package):
  $\mfunction{Arsinh} x$
  $\mfunction[op]{Arsinh} x$ or equivalently $\mfunction[limop]{Arsinh} x$;
— \definemathfunction (the equivalent of LaTeX \DeclareMathOperator macro
of the amsopn package):
  \definemathfunction[arsinh]{Arsinh} $\arsinh x$
  \definemathfunction[arsinh][op]{Arsinh} $\arsinh x$ or equivalently
\definemathfunction[arsinh][limop]{Arsinh} $\arsinh x$.


Maggyero

[-- Attachment #1.2: Type: text/html, Size: 6370 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Changing font for math function
@ 2015-05-13 15:51 Maggyero
  2015-05-13 16:13 ` Hans Hagen
  0 siblings, 1 reply; 34+ messages in thread
From: Maggyero @ 2015-05-13 15:51 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 24505 bytes --]

> Hans Hagen:
> mfunction will stay as it is also needed for tagged pdf and exporting
> (basically it's an apply math function thing) so if something else is
> needed another name/mechanism have to be made (with appropriate tagging)
> the label itself is a special case as it's optional (and is just there
> for cultural differences as not all countries use the english names)
> so, \rho_{\mathlabel{air}} is something different then, some kind of
> multi-character variable?

Actually no, it has nothing to do with ConTeXt label texts (that is why I
removed the word 'text' in it to avoid the confusion), \mathlabel was just
a name that I gave to encompass two different things that are usually
typeset the same way (upright): the names of functions (\mfunction) and the
names often used in the subscripts of variables. But after some thought and
your new suggestion (\mtext) for the latter case, I find that my
'mathlabel' is misleading and that it is better for the user to keep them
separate (with \mfunction AND \mtext), and it gives him more control.

> Hans Hagen:
>
\unexpanded\def\mtext#1{\text{\usemathematicsstyleandcolor\c!textstyle\c!textcolor#1}}
> which can be used as:
> $x^{\mtext{effe}}$
> and obeys
> \setupmathematics[textstyle=bold, textcolor=darkgreen]

Perfect! Not only \mtext is short but also very meaningful and symmetrical
with \mfunction, therefore easy to memorize. I totally agree with that new
definition.

QUESTION 1. — Did you include the \text command as well in the definition
of your new \mfunction (like below)?

1st DEFINITION of \mfunction.
———————————————————————
\unexpanded\def\mfunction#1{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#1}}
———————————————————————

Because like in \mtext, the \text command is ESSENTIAL (for the function
names to have the mathcodes, kerning and ligatures of the text mode instead
of the ones of the math mode).

> Hans Hagen:
> next beta: when one of the stylealternatives text mode else mathmode
> (default nothing == mathupright)

> Aditya Mahajan:
> The default should be \mathupright (as is the case in amstex
and latex, and probably also plaintex).

No, I strongly disagree. Yes it should be upright by default, but it should
always be in TEXT mode, even by default, that is why I used the \text
command in the definition of \mfunction. \mathupright in math mode doesn't
solve the problems of mathcodes, kerning and ligatures (if you want call
your function 'AVL' or 'low-frequency' for instance, the result is terrible
with \mathupright: the space between A and V is too large and the hyphen
between w and f becomes a minus sign binary operator—try
$\mathupright{AVL}$ and $\mathupright{low-frequency}$). \text{\rm\tf} does.
Consequently \rm\tf should be the default functionstyle and textstyle in
\setupmathematics. (And Aditya, don't forget that \mathupright is just a
macro for \rm\tf in math mode.)

So now, let us see what the user have to write to get a math function and a
math text (usually used as the subscript of a variable):
———————————————————————
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\mathnolop{\mfunction{Arsinh}} x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

The syntax is okay but a bit complicated since the symmetry is not perfect
(\mtext vs \mathnolop{\mfunction}). Symmetry is important in a user
interface so I think the user expects simply \mtext and \mfunction (not
\mathnolop{\mfunction}). Therefore we need to wrap this \mathnolop in
\mfunction. And the possibility to choose \mathop (synonym: \mathlimop)
instead of \mathnolop—which should be the default—should be given to the
user with an optional argument. To keep it consistent with the ConTeXt
syntax, the optional argument should be [op] (synonym: [limop]). So let us
redefine our \mfunction.

2nd DEFINITION of \mfunction.
———————————————————————
\unexpanded\def\mfunction{\dosingleempty\domfunction}
\def\domfunction[#1]#2%
  {\iffirstargument

 \doifelse{#1}{op}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\doifelse{#1}{limop}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}\nolimits}}
   \else

 \normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}\nolimits
   \fi}
———————————————————————

Notice in that new definition that we use \normalmathop instead of \mathop
because the \mathop in ConTeXt uses a modified version of the normal
\mathop (the latter is renamed \normalmathop by ConTeXt) that converts the
serif font style command \rm to the math font style command \mf, which as a
result makes \rm without effect in \setupmathematics[functionstyle=\rm] as
I came to realize after some testing. Indeed, ConTeXt has currently the
following lines in math-ini.mkiv:

\let\normalmathop\mathop
\unexpanded\def\mathop
  {\normalmathop
   \bgroup
   \let\rm\mf
   \let\nexttoken=}

QUESTION 2. — By the way, why this conversion of \rm to \mf inside \mathop
atoms (\let\rm\mf)?

So with the new definition for \mfunction, the user can now simply and
elegantly write this:
———————————————————————
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\mfunction{Arsinh} x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

With that new \mfunction, ConTeXt users now have an equivalent macro to the
LaTeX \operatorname macro of the amsopn package, which I think was very
missing.

Now, let us look at how the user can DEFINE his math function.

A. With the 1st definition of \mfunction (the one that doesn't include
\mathnolop or \mathop), the user can write this (notice again that we use
\normalmathop \nolimits instead of \mathnolop—or equivalently [nolop]—to
avoid the conversion of \rm to \mf that would make
\setupmathematics[functionstyle=\rm] without effect):
———————————————————————
\definemathcommand[arsinh]{\normalmathop{\mfunction{Arsinh}}\nolimits}
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

or, alternatively this (if the user wants also to define a label text for
his function):
———————————————————————
\setupmathlabeltext[arsinh=Arsinh]
\definemathcommand[arsinh]{\normalmathop{\mfunctionlabeltext{arsinh}}\nolimits}
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

assuming that \mfunctionlabeltext is defined the following way (which I
think is already the case in the last beta).

1st DEFINITION of \mfunctionlabeltext.
———————————————————————
\unexpanded\def\mfunctionlabeltext#1{\mfunction{\mathlabeltext{#1}}}
———————————————————————

Thus with the 1st definition of \mfunction (and \mfunctionlabeltext), the
definition of a math function for the user is a bit complicated (he has to
write \normalmathop \nolimits in addition to \mfunction or
\mfunctionlabeltext, unless Hans decides to remove \let\rm\mf from his
redefinition of \mathop in which case the user just has to add the optional
argument [nolop] instead of the verbose and hard to remember \normalmathop
\nolimits).

B. With the 2nd definition of \mfunction (the one that includes \mathnolop
or \mathop), the user can write this:
———————————————————————
\definemathcommand[arsinh]{\mfunction{Arsinh}}
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

or, alternatively this (if the user wants also to define a label text for
his function):
———————————————————————
\setupmathlabeltext[arsinh=Arsinh]
\definemathcommand[arsinh]{\mfunctionlabeltext{arsinh}}
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

assuming that \mfunctionlabeltext is defined the following way (the
additional optional argument is for that of \mfunction).

2nd DEFINITION of \mfunctionlabeltext.
———————————————————————
\unexpanded\def\mfunctionlabeltext{\dosingleempty\domfunctionlabeltext}
\def\domfunctionlabeltext[#1]#2%
  {\iffirstargument
     \mfunction[#1]{\mathlabeltext{#2}}
   \else
     \mfunction{\mathlabeltext{#2}}
   \fi}
———————————————————————

Thus with the 2nd definition of \mfunction (and \mfunctionlabeltext), the
definition of a math function for the user is easier (no need to write
\normalmathop \nolimits since it is taken into account in \mfunction, and
Hans doesn't have to remove \let\rm\mf from his redefinition of \mathop).
It confirms that the 2nd definition of \mfunction (and \mfunctionlabeltext)
is the way to go.

However the command \mfunctionlabeltext is unnecessary and inconsistent
with the other ConTeXt command \labeltext since it has a style attached to
it, so may confuse the user. The direct command \mathlabeltext (the math
equivalent of \labeltext) should be preferred. Therefore I think Hans
should remove \mfunctionlabeltext from math-ini.mkiv and the user should
use \mfunction{\mathlabeltext } when needed:
———————————————————————
\setupmathlabeltext[arsinh=Arsinh]
\definemathcommand[arsinh]{\mfunction{\mathlabeltext{arsinh}}}
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

But we can go a little further in user friendliness by wrapping the
\mfunction in a new macro, that we should name \definemathfunction to be
consistent with the other macros (\definemathcommand, \definemathsymbol,
\definemathcharacter, etc.). The possibility to choose between \mathop
(synonym: \mathlimop) and \mathnolop—which should be the default—is once
more given to the user with the optional argument [op] (synonym: [limop])
to be consistent with the ConTeXt syntax. The macro is defined as follows.

DEFINITION of \definemathfunction.
———————————————————————
\unexpanded\def\definemathfunction{\dodoubleempty\dodefinemathfunction}
\def\dodefinemathfunction[#1][#2]#3%
  {\ifsecondargument
     \definemathcommand[#1]{\mfunction[#2]{#3}}
   \else
     \definemathcommand[#1]{\mfunction{#3}}
   \fi}
———————————————————————

Notice that we use again \normalmathop for the same reasons as before. That
new \definemathfunction macro now allows the user to write this:
———————————————————————
\definemathfunction[arsinh]{arsinh}
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

or, alternatively this (if the user wants also to define a label text for
his function):
———————————————————————
\setupmathlabeltext[arsinh=Arsinh]
\definemathfunction[arsinh]{\mathlabeltext{arsinh}}
\setupmathematics[functionstyle=bold, functioncolor=red, textstyle=bold,
textcolor=green]
\starttext
  $\arsinh x\ \text{and}\ n_{\mtext{air}}$.
\stoptext
———————————————————————

With that new \definemathfunction, ConTeXt users now have an equivalent
macro to the LaTeX \DeclareMathOperator macro of the amsopn package, which
I think was very missing as well.

The math functions defined in math-def.mkiv should of course use
\mfunction{\mathlabeltext } instead of the old \mfunctionlabeltext, or the
new macro \definemathfunction:
———————————————————————
\definemathcommand[cos]{\mfunction{\mathlabeltext{cos}}} % Or
\definemathcommand[cos]{\mfunction[nolop]{\mathlabeltext{cos}}}, it is the
same.
\definemathcommand[det]{\mfunction[limop]{\mathlabeltext{det}}}
\definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle
d}}\mathopen{}}
%etc.
———————————————————————

or
———————————————————————
\definemathfunction[cos]{\mathlabeltext{cos}} % Or
\definemathfunction[cos][nolop]{\mathlabeltext{cos}}, it is the same.
\definemathfunction[det][limop]{\mathlabeltext{det}}
\definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle
d}}\mathopen{}} % It is a special function so it should still be treated
with the more general \definemathcommand.
%etc.
———————————————————————

Notice the removal of [nolop] and [limop] which are already present in
\mfunction and \mfunction[limop] respectively (since we now use the 2nd
definition of \mfunction for all the reasons we gave above).

Now before concluding, here is a little example illustrating the new
mechanism of Hans (functionstyle, functioncolor, textstyle and textcolor
keys in \setupmathematics) of which I improved the consistency and
simplicity of the related macros (\mtext and \mfunction, and the new
\definemathfunction) in practical use. In this example as I still don't
have access to the last beta I didn't use the new keys of \setupmathematics
(functionstyle, textstyle) but local definitions. For Aditya, this time the
given example works correctly contrary to my last post where I realized
afterwards that \rm was not working in \setupmathematics because of the use
of \mathop which converts it to \mf (hence my use of \normalmathop in this
post as explained earlier).

EXAMPLE.
———————————————————————
\define\mathtextstyle{\rm\tf}
\define[1]\mtext{\text{\mathtextstyle #1}}

\define\mfunction{\dosingleempty\domfunction}
\def\domfunction[#1]#2{%
    \iffirstargument
        \doifelse{#1}{op}{\normalmathop{\text{\mathfunctionstyle
#2}}}{\doifelse{#1}{limop}{\normalmathop{\text{\mathfunctionstyle
#2}}}{\normalmathop{\text{\mathfunctionstyle #2}}\nolimits}}
    \else
        \normalmathop{\text{\mathfunctionstyle #2}}\nolimits
    \fi}

\define\mathfunctionstyle{\rm\tf}
\define\definemathfunction{\dodoubleempty\dodefinemathfunction}
\def\dodefinemathfunction[#1][#2]#3{%
    \ifsecondargument
        \definemathcommand[#1]{\mfunction[#2]{#3}}
    \else
        \definemathcommand[#1]{\mfunction{#3}}
    \fi}

\setupmathlabeltext[arsinh=Arsinh]
\definemathfunction[arsinh]{\mathlabeltext{arsinh}}

\starttext
\startbuffer
    $\arsinh x\ \text{and}\ n_{\mtext{air}}$
\stopbuffer

\defineparagraphs[myparagraphs][n=5, rule=on]
\setupparagraphs[myparagraphs][1][width=\dimexpr 0.3\textwidth\relax]
\setupparagraphs[myparagraphs][2][width=\dimexpr 0.3\textwidth\relax]
\setupparagraphs[myparagraphs][3][width=\dimexpr 0.3\textwidth\relax]

\section{{\tt \backslash setupmathematics[functionstyle=\backslash
rm\backslash tf,textstyle=\backslash rm\backslash tf]} (default setup)}
\define\mathfunctionstyle{\rm\tf}
\define\mathtextstyle{\rm\tf}

\startmyparagraphs
\switchtobodyfont[rm]
{\tt \backslash switchtobodyfont[rm]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[ss]
{\tt \backslash switchtobodyfont[ss]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[tt]
{\tt \backslash switchtobodyfont[tt]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\stopmyparagraphs

\section{{\tt \backslash setupmathematics[functionstyle=\backslash
tf,textstyle=\backslash tf]}}
\define\mathfunctionstyle{\tf}
\define\mathtextstyle{\tf}

\startmyparagraphs
\switchtobodyfont[rm]
{\tt \backslash switchtobodyfont[rm]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[ss]
{\tt \backslash switchtobodyfont[ss]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[tt]
{\tt \backslash switchtobodyfont[tt]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\stopmyparagraphs

\section{{\tt \backslash setupmathematics[functionstyle=\backslash
bf,textstyle=\backslash bf]}}
\define\mathfunctionstyle{\bf}
\define\mathtextstyle{\bf}

\startmyparagraphs
\switchtobodyfont[rm]
{\tt \backslash switchtobodyfont[rm]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[ss]
{\tt \backslash switchtobodyfont[ss]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[tt]
{\tt \backslash switchtobodyfont[tt]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\stopmyparagraphs
\stoptext
———————————————————————

CONCLUSION. — It all comes down to the choice of the best user interface
for math functions and math texts (usually used as subscripts of
variables). Their styles and colors is handled with \setupmathematics.
There are two choices of user interface:
1. $\normalmathop{\mfunction{Arsinh}}\nolimits x\ \text{and}\
n_{\mtext{air}}$.
2. $\mfunction{Arsinh} x\ \text{and}\ n_{\mtext{air}}$.

First, the default functionstyle and textstyle in \setupmathematics should
be \rm\tf (the text mode equivalent of \mathupright, as we are always in
text mode thanks to the \text hardcoded in \mfunction and \mtext).

Then, in the 1st solution \normalmathop is used instead of \mathop because
the latter is modified by ConTeXt to convert \rm to \mf, which makes
\setupmathematics[functionstyle=\rm] without effect.

The 2nd solution is obviously way cleaner, that is why I think it should be
preferred. The implementation is given in my '2nd DEFINITION of \mfunction'
for replacing the existing definition in math-ini.mkiv:
———————————————————————
\unexpanded\def\mfunction{\dosingleempty\domfunction}
\def\domfunction[#1]#2%
  {\iffirstargument

 \doifelse{#1}{op}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\doifelse{#1}{limop}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}}{\normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}\nolimits}}
   \else

 \normalmathop{\text{\usemathematicsstyleandcolor\c!functionstyle\c!functioncolor#2}}\nolimits
   \fi}
———————————————————————

We also saw that \mfunctionlabeltext is inconsistent with ConTeXt
\labeltext because the former has a style attached to it, so
\mfunctionlabeltext should be removed from math-ini.mkiv and
\mfunction{\mathlabeltext } should be used instead when needed.

To go even further in userfriendlyness, we the new macro \definemathcommand
should be added in math-ini.mkiv:
———————————————————————
\unexpanded\def\definemathfunction{\dodoubleempty\dodefinemathfunction}
\def\dodefinemathfunction[#1][#2]#3%
  {\ifsecondargument
     \definemathcommand[#1]{\mfunction[#2]{#3}}
   \else
     \definemathcommand[#1]{\mfunction{#3}}
   \fi}
———————————————————————

Finally, with this new \mfunction definition and the removal of the
misleading \mfunctionlabeltext, the functions defined in math-def.mkiv
should be rewrite as:
———————————————————————
\definemathcommand[cos]{\mfunction{\mathlabeltext{cos}}} % Or
\definemathcommand[cos]{\mfunction[nolop]{\mathlabeltext{cos}}}, it is the
same.
\definemathcommand[det]{\mfunction[limop]{\mathlabeltext{det}}}
\definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle
d}}\mathopen{}}
%etc.
———————————————————————

or
———————————————————————
\definemathfunction[cos]{\mathlabeltext{cos}} % Or
\definemathfunction[cos][nolop]{\mathlabeltext{cos}}, it is the same.
\definemathfunction[det][limop]{\mathlabeltext{det}}
\definemathcommand[diff]{\normalmathop{\text{\mathfunctionstyle
d}}\mathopen{}} % It is a special function so it should still be treated
with the more general \definemathcommand.
%etc.
———————————————————————

ConTeXt users are now provided, if Hans agrees to implement the code given
in this conclusion, with three extremely useful macros:
— \mtext (that should be used for all math texts such as subscripts of
variables):
  $n_{\mtext{air}}$;
— \mfunction (the equivalent of LaTeX \operatorname macro of the amsopn
package):
  $\mfunction{Arsinh} x$
  $\mfunction[op]{Arsinh} x$ or equivalently $\mfunction[limop]{Arsinh} x$;
— \definemathfunction (the equivalent of LaTeX \DeclareMathOperator macro
of the amsopn package):
  \definemathfunction[arsinh]{Arsinh} $\arsinh x$
  \definemathfunction[arsinh][op]{Arsinh} $\arsinh x$ or equivalently
\definemathfunction[arsinh][limop]{Arsinh} $\arsinh x$.


Maggyero

[-- Attachment #1.2: Type: text/html, Size: 28669 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Changing font for math function
@ 2015-05-12 15:18 Maggyero
  0 siblings, 0 replies; 34+ messages in thread
From: Maggyero @ 2015-05-12 15:18 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1547 bytes --]

Sorry, I did 3 typos in my previous post.

— First typo:
> 3. Using only \mathlabeltext with \setuplabeltext is also more consistent
with the current \labeltext that works with \setuplabeltext.
3. Using only \mathlabeltext with \setupmathlabeltext is also more
consistent with the current \labeltext that works with \setuplabeltext.

— Second typo:
> \define\function{\dosingleempty\dofunction}
> \def\dofunction[#1]#2{%
>    \iffirstargument
>
 \doifelse{#1}{limop}{\mathop{\mathlabel{#2}}}{\mathop{\mathlabel{#2}}\nolimits}
>    \else
>      \mathop{\mathlabel{#2}}\nolimits
>    \fi}
\define\function{\dosingleempty\dofunction}
\def\dofunction[#1]#2{%
    \iffirstargument

\doifelse{#1}{op}{\mathop{\mathlabel{#2}}}{\doifelse{#1}{limop}{\mathop{\mathlabel{#2}}}{\mathop{\mathlabel{#2}}\nolimits}}
    \else
        \mathop{\mathlabel{#2}}\nolimits
    \fi}

Plus these 2 definitions were not supposed to be in this post (I forgot to
remove them during my tests). Nevertheless Hans could had them as well in
math-ini.mkiv if he thinks the user should have access to this \function
command, which is the ConTeXt version of the well known \operatorname and
\operatorname* command in LaTeX. It provides:

\starttext
\startformula
  \function{lim}_{x\to a} f(x)\quad \function[op]{lim}_{x\to a} f(x)\quad
\function[limop]{lim}_{x\to a} f(x)
\stopformula
\stoptext

— Third typo:
> \definemathcommand[arsinh][op]{\mathlabel{arsinh}}
\definemathcommand[arsinh][nolop]{\mathlabel{arsinh}}


Maggyero

[-- Attachment #1.2: Type: text/html, Size: 2884 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Changing font for math function
@ 2015-05-12 14:19 Maggyero
  2015-05-12 16:03 ` Hans Hagen
                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Maggyero @ 2015-05-12 14:19 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 10087 bytes --]

>Hans Hagen wrote:
>for functions one can now use:
>\setupmathematics
>   [functionstyle=\rm]

Fantastic! Thank you Hans, it is way better than the old mechanism
\setmathfunctionstyle. Now I have a few suggestions to improve the
consistency of this new mechanism. First, I think this functionstyle key
a) should be better called 'mathlabelstyle';
b) be default to \tf to make the FONT ALTERNATIVE always upright;
c) be linked to this following new definition in math-ini.mkiv:

+ \unexpanded\def\mathlabel#1{\text{\mathlabelstyle #1}}

so that \mathlabel can be used for labeling math objects like functions but
ALSO for labeling variables with subscripts (e.g., \rho_{\mathlabel{air}}).
The hardcoded \text in the definition of \mathlabel is used here for these
5 reasons:
1. It CAN make the FONT STYLE adaptative to the surrounding style (if the
\mathlabelstyle inside—defined by the user in
\setupmathematics[mathlabelstyle=]—does not specify another FONT STYLE like
\rm, \ss or \tt).
2. It uses proper mathcodes (hyphens are not converted to minus binary
operators—useful if one wants to call its function or subscript
'low-frequency' for instance—, apostrophes are not converted to
primes—useful if one wants to call its function 'Riemann's function' for
instance).
3. It uses proper kerning (if one wants to call its function or subscript
'WALL' for instance).
4. It uses proper ligatures (if one wants to call its function or subscript
'efficiency' for instance).
5. It avoids the user having to add \kern\zeropoint to prevent vertical
alignment to the middle of the fraction bar when used inside \mathop for
one-character function names (if one wants to call its function 'd' for
instance).

That \mathlabel should replace \mfunction which should be removed, and
\mfunctionlabeltext should be removed as well and one should directly use
the already defined \mathlabeltext instead, for these 3 reasons:
1. Every command containing the word 'labeltext' should not have a style
attached to it.
2. The word 'function' is misleading because \mfunction and
\mfunctionlabeltext do not create a \mathop atom and it makes the user
believe its usage is restricted for labeling functions while the command
should also be used for labeling variable with subscripts (e.g.,
\rho_{\mathlabel{air}} is far better than \rho_\mfunction{air}).
3. Using only \mathlabeltext with \setuplabeltext is also more consistent
with the current \labeltext that works with \setuplabeltext.

Thus the function definitions in math-def.mkiv should be changed:

- \definemathcommand [arccos]  [nolop] {\mfunctionlabeltext{arccos}}
+ \definemathcommand [arccos]  [nolop] {\mathlabel{\mathlabeltext{arccos}}}
etc.

And I think you should add in this file the definition of the differential
operator which is so widely used in mathematics, so that users have at
their disposal once for all a proper implementation of this operator and
don't have to make their own hack:

+ \definemathcommand[diff]{\mathop{\mathlabel{d}}\mathopen{}}

With this new \mathlabel command, the user now have a convenient and
consistent way to label its math objets (functions and variables with
subscripts):

\definemathcommand[arsinh][nolop]{\mathlabel{arsinh}}

\starttext
$\arsinh z = \ln\bigl(z + \sqrt{z^2 + 1}\bigr)$\par
$\rho_{\mathlabel{air}} = \frac{p}{R_{\mathlabel{specific}}T}$\par
\stoptext

>Hans Hagen wrote:
>\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

In this case, for completeness, I would also add the definitions for the
remaining style \tt:

\def\v!mononormal {mononormal}
\def\v!monobold {monobold}
\definealternativestyle [\v!mononormal]  [\tt\tf]
\definealternativestyle [\v!monobold]    [\tt\bf]

>Aditya Mahajan wrote:
>\sin etc should not behave like \text{...}. \text should adapt to the
surrounding style while \mathoptext should not. In particular, in the
following
>   {\ss $\sin x$}
>   {\bf $\sin x$}
>\sin should be in normal text upright font and not adapted to the
surrounded text.
>Is it possible to set a value of functionstyle so that the surrounding
text font styles are ignored (but the font size is not).

You should try \mathop{\text{\rm\tf sin}} or \mathoptext{\rm\tf sin} (Hans
defined this \mathoptext in math-ini.mkiv as equal to
\mathop#1{\text{1#}}), or equivalently but better: \mathop{\mathlabel{sin}}
with \setupmathematics[mathlabelstyle=\rm\tf] with the new command
\mathlabel that I have defined above.

And in my opinion, names for operators and subscripts should all be
upright, that is adaptative to the surrounding TEXT STYLE (\rm, \ss and
\tt) BUT not adaptative to the surrounding TEXT ALTERNATIVE or MATH
ALTERNATIVE (\it, \bi, \sl, \bs) and stay in the normal alternative \tf
(upright). So for your case it becomes simply \mathop{\text{\tf sin}} or
equivalently  but better: \mathop{\mathlabel{sin}} with
\setupmathematics[mathlabelstyle=\tf].

About \mathupright: it is just a wrapper for \rm\tf. Better use
\text{\rm\tf} or equivalently \mathop{\mathlabel{}} with
\setupmathematics[mathlabelstyle=\rm\tf].

Here is a little example showing the behaviour of the new command
\mathlabel defined above:


\define\mathlabelstyle{\tf} % I don't have access to the last beta yet so
let's assume that the key 'mathlabelstyle' (called by Hans 'functionstyle'
so far) of \setupmathematics is implemented this way, with the default
value \tf (Aditya prefers \rm\tf as the default value so it is just a
matter of taste).
\define[1]\mathlabel{\text{\mathlabelstyle #1}}

\define\function{\dosingleempty\dofunction}
\def\dofunction[#1]#2{%
    \iffirstargument

\doifelse{#1}{limop}{\mathlimop{\mathlabel{#2}}}{\mathop{\mathlabel{#2}}}
    \else
        \mathop{\mathlabel{#2}}
    \fi}

\definemathcommand[arsinh][op]{\mathlabel{arsinh}}

\startbuffer
    $\arsinh x\ \text{and}\ n_{\mathlabel{red}}$
\stopbuffer

\starttext
\defineparagraphs[myparagraphs][n=5, rule=on]
\setupparagraphs[myparagraphs][1][width=\dimexpr 0.3\textwidth\relax]
\setupparagraphs[myparagraphs][2][width=\dimexpr 0.3\textwidth\relax]
\setupparagraphs[myparagraphs][3][width=\dimexpr 0.3\textwidth\relax]

\section{{\tt \backslash setupmathematics[mathlabelstyle=\backslash tf]}
(default)}

\startmyparagraphs
\switchtobodyfont[rm]
{\tt \backslash switchtobodyfont[rm]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[ss]
{\tt \backslash switchtobodyfont[ss]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[tt]
{\tt \backslash switchtobodyfont[tt]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\stopmyparagraphs

\section{{\tt \backslash setupmathematics[mathlabelstyle=\backslash
rm\backslash tf]} (Aditya's setup)}
\define\mathlabelstyle{\rm\tf}

\startmyparagraphs
\switchtobodyfont[rm]
{\tt \backslash switchtobodyfont[rm]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[ss]
{\tt \backslash switchtobodyfont[ss]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[tt]
{\tt \backslash switchtobodyfont[tt]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\stopmyparagraphs

\section{{\tt \backslash setupmathematics[mathlabelstyle=\backslash bf]}}
\define\mathlabelstyle{\bf}

\startmyparagraphs
\switchtobodyfont[rm]
{\tt \backslash switchtobodyfont[rm]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[ss]
{\tt \backslash switchtobodyfont[ss]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\nextmyparagraphs

\switchtobodyfont[tt]
{\tt \backslash switchtobodyfont[tt]}\crlf
{\tt \backslash tf}: {\tf \getbuffer}\par
{\tt \backslash bf}: {\bf \getbuffer}\par
{\tt \backslash it}: {\it \getbuffer}\par
{\tt \backslash bi}: {\bi \getbuffer}\par
{\tt \backslash sl}: {\sl \getbuffer}\par
{\tt \backslash bs}: {\bs \getbuffer}\par
\stopmyparagraphs
\stoptext


Maggyero

[-- Attachment #1.2: Type: text/html, Size: 12326 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Changing font for math function
@ 2015-05-09  0:03 Aditya Mahajan
  2015-05-09 10:14 ` Hans Hagen
                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Aditya Mahajan @ 2015-05-09  0:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

There is a question on TeX.SX asking how to change the font of \sin, \cos, 
etc.

http://tex.stackexchange.com/q/243893/323

I looked at the code, and there does not appear to be an easy solution. 
The \mathfunctionlabeltext command has \mathupright hard coded.

One option is to keep this configurable using \setupmathematics, perhaps 
mfunction=(normal|italic|sans).

In any case, I think that the current implementation is a bug. The default 
font for mathfunctionlabeltext should be typeset in the bodyfont.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2015-05-16 15:35 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-16 14:23 Changing font for math function Maggyero
2015-05-16 15:35 ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2015-05-15 23:34 Maggyero
2015-05-16  0:24 ` Aditya Mahajan
2015-05-16  8:23   ` Hans Hagen
2015-05-13 15:51 Maggyero
2015-05-13 16:13 ` Hans Hagen
2015-05-12 15:18 Maggyero
2015-05-12 14:19 Maggyero
2015-05-12 16:03 ` Hans Hagen
2015-05-12 18:05 ` Aditya Mahajan
2015-05-12 18:29   ` Mikael P. Sundqvist
2015-05-12 20:23 ` Aditya Mahajan
2015-05-09  0:03 Aditya Mahajan
2015-05-09 10:14 ` Hans Hagen
2015-05-09 11:02 ` Wolfgang Schuster
2015-05-09 11:46 ` Hans Hagen
2015-05-09 11:56   ` Wolfgang Schuster
2015-05-09 13:00     ` Hans Hagen
2015-05-09 16:28       ` Wolfgang Schuster
2015-05-09 13:50   ` Aditya Mahajan
2015-05-09 14:16     ` Aditya Mahajan
2015-05-09 23:30       ` Hans Hagen
2015-05-10 12:19         ` Aditya Mahajan
2015-05-10 17:22           ` Hans Hagen
2015-05-11 16:16             ` Aditya Mahajan
2015-05-11 16:44               ` Hans Hagen
2015-05-11 17:08                 ` Aditya Mahajan
2015-05-11 19:28                   ` Hans Hagen
2015-05-10 16:16         ` Otared Kavian
2015-05-11  2:47           ` Aditya Mahajan
2015-05-11  7:07             ` Otared Kavian
2015-05-11  8:05               ` Hans Hagen
2015-05-11  8:33                 ` Otared Kavian

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