Changes

Jump to navigation Jump to search
1,997 bytes added ,  16:08, 13 March 2007
explanation of math functions
<[[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.

{|
|-
|<cmd>arccos</cmd>
|<cmd>arcsin</cmd>
|<cmd>arctan</cmd>
|<cmd>arg </cmd>
|<cmd>cosh </cmd>
|<cmd>cos </cmd>
|<cmd>coth </cmd>
|<cmd>cot </cmd>
|<cmd>csc </cmd>
|<cmd>deg </cmd>
|-
|<cmd>det </cmd>
|<cmd>dim </cmd>
|<cmd>exp </cmd>
|<cmd>gcd </cmd>
|<cmd>hom </cmd>
|<cmd>inf </cmd>
|<cmd>injlim</cmd>
|<cmd>ker </cmd>
|<cmd>lg </cmd>
|<cmd>liminf</cmd>
|-
|<cmd>limsup</cmd>
|<cmd>lim </cmd>
|<cmd>ln </cmd>
|<cmd>log </cmd>
|<cmd>median</cmd>
|<cmd>max </cmd>
|<cmd>min </cmd>
|<cmd>mod </cmd>
|<cmd>div </cmd>
|<cmd>projlim</cmd>
|-
|<cmd>Pr </cmd>
|<cmd>sec </cmd>
|<cmd>sinh </cmd>
|<cmd>sin </cmd>
|<cmd>sup </cmd>
|<cmd>tanh </cmd>
|<cmd>tan </cmd>
|}


== Defining new functions ==

ConTeXt provides the command <cmd>definemathcommand</cmd> to define new ''log like'' functions. For example, if you want to define a '''lcd''' function, you can do

<texcode>
\definemathcommand [lcd] [nolop] {\mfunction{lcd}}
</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 <cmd>mfunction</cmd> command sets its argument in the current math roman font. So,

<texcode>
\definemathcommand [lcd] [nolop] {\mfunction{lcd}}
</texcode>
expands to
<texcode>
\def\lcd{\mathop{\mfunction{lcd}\nolimits}}}
</texcode>

while
<texcode>
\definemathcommand [argmin] [limop] {\mfunction{arg\,min}}
</texcode>
expands to
<texcode>
\def\argmin{\mathop{\mfunction{arg\,min}}} %Notice no \limits or \nolimits
</texcode>


[[Category:Math]]

Navigation menu