Difference between revisions of "Math/functions"
(explanation of math functions) |
Flying sheep (talk | contribs) m (Switched to command template) |
||
Line 5: | Line 5: | ||
{| | {| | ||
|- | |- | ||
− | | | + | |{{cmd|arccos}} |
− | | | + | |{{cmd|arcsin}} |
− | | | + | |{{cmd|arctan}} |
− | | | + | |{{cmd|arg }} |
− | | | + | |{{cmd|cosh }} |
− | | | + | |{{cmd|cos }} |
− | | | + | |{{cmd|coth }} |
− | | | + | |{{cmd|cot }} |
− | | | + | |{{cmd|csc }} |
− | | | + | |{{cmd|deg }} |
|- | |- | ||
− | | | + | |{{cmd|det }} |
− | | | + | |{{cmd|dim }} |
− | | | + | |{{cmd|exp }} |
− | | | + | |{{cmd|gcd }} |
− | | | + | |{{cmd|hom }} |
− | | | + | |{{cmd|inf }} |
− | | | + | |{{cmd|injlim}} |
− | | | + | |{{cmd|ker }} |
− | | | + | |{{cmd|lg }} |
− | | | + | |{{cmd|liminf}} |
|- | |- | ||
− | | | + | |{{cmd|limsup}} |
− | | | + | |{{cmd|lim }} |
− | | | + | |{{cmd|ln }} |
− | | | + | |{{cmd|log }} |
− | | | + | |{{cmd|median}} |
− | | | + | |{{cmd|max }} |
− | | | + | |{{cmd|min }} |
− | | | + | |{{cmd|mod }} |
− | | | + | |{{cmd|div }} |
− | | | + | |{{cmd|projlim}} |
|- | |- | ||
− | | | + | |{{cmd|Pr }} |
− | | | + | |{{cmd|sec }} |
− | | | + | |{{cmd|sinh }} |
− | | | + | |{{cmd|sin }} |
− | | | + | |{{cmd|sup }} |
− | | | + | |{{cmd|tanh }} |
− | | | + | |{{cmd|tan }} |
|} | |} | ||
Line 50: | Line 50: | ||
== Defining new functions == | == Defining new functions == | ||
− | ConTeXt provides the command | + | ConTeXt provides the command {{cmd|definemathcommand}} to define new ''log like'' functions. For example, if you want to define a '''lcd''' function, you can do |
<texcode> | <texcode> | ||
Line 56: | Line 56: | ||
</texcode> | </texcode> | ||
− | The <code>nolop</code> option tells ConTeXt that subscripts should be placed on the side of the command (as in trignometric functions) rather than underneath the command (as in min, max, and limits). If you want to place the subscript underneath the command, you can use <code>limop</code> instead. The | + | The <code>nolop</code> option tells ConTeXt that subscripts should be placed on the side of the command (as in trignometric functions) rather than underneath the command (as in min, max, and limits). If you want to place the subscript underneath the command, you can use <code>limop</code> instead. The {{cmd|mfunction}} command sets its argument in the current math roman font. So, |
<texcode> | <texcode> |
Revision as of 16:05, 13 February 2020
<Math |
In writing mathematics, the names of variables are in italics, but some common functions like trignomeric functions, min, max, log, etc. are always written in upright roman font. The following log like functions are defined in ConTeXt.
Defining new functions
ConTeXt provides the command \definemathcommand to define new log like functions. For example, if you want to define a lcd function, you can do
\definemathcommand [lcd] [nolop] {\mfunction{lcd}}
The nolop
option tells ConTeXt that subscripts should be placed on the side of the command (as in trignometric functions) rather than underneath the command (as in min, max, and limits). If you want to place the subscript underneath the command, you can use limop
instead. The \mfunction command sets its argument in the current math roman font. So,
\definemathcommand [lcd] [nolop] {\mfunction{lcd}}
expands to
\def\lcd{\mathop{\mfunction{lcd}\nolimits}}}
while
\definemathcommand [argmin] [limop] {\mfunction{arg\,min}}
expands to
\def\argmin{\mathop{\mfunction{arg\,min}}} %Notice no \limits or \nolimits