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)
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: 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
On Sat, 16 May 2015, Maggyero wrote:
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)
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: 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).
Plaintex, amstex, and latex, all default to using \mathupright (or equivalent). Compare the output of the following: 1. Plain tex: \font\tenrm=ptmr7t at 10pt \tenrm log $\log$ log \bye 2. Latex: \documentclass{article} \usepackage{times} % Only changes the text font \begin{document} log $\log$ log \end{document} 3. Context: \definetypeface[mainfont][rm][serif][times][default] \definetypeface[mainfont][mm][math] [modern][default] \setupbodyfont[mainfont] \starttext log $\log$ log \stoptext 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? If you want you can set \setupmathematics[functionstyle=normal] and achieve the behaviour that you want. Aditya
On 5/16/2015 2:24 AM, Aditya Mahajan wrote:
On Sat, 16 May 2015, Maggyero wrote:
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)
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: 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).
Plaintex, amstex, and latex, all default to using \mathupright (or equivalent).
Compare the output of the following:
1. Plain tex: \font\tenrm=ptmr7t at 10pt \tenrm log $\log$ log \bye
2. Latex: \documentclass{article} \usepackage{times} % Only changes the text font \begin{document} log $\log$ log \end{document}
3. Context: \definetypeface[mainfont][rm][serif][times][default] \definetypeface[mainfont][mm][math] [modern][default] \setupbodyfont[mainfont] \starttext log $\log$ log \stoptext
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?
also, this is more robust with respect to mixed font usage: it would look weird if inside pagella math suddenly a function name in optima would be used when that font is used for the main body text
If you want you can set \setupmathematics[functionstyle=normal] and achieve the behaviour that you want.
indeed
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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- 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 -----------------------------------------------------------------
participants (3)
-
Aditya Mahajan
-
Hans Hagen
-
Maggyero