Changes

Jump to navigation Jump to search
684 bytes added ,  13:36, 30 August 2017
no edit summary
== mathstackers ==
ConTeXt has a nice structure called {{code|1=mathstackers}} in order to define new math commands in which some characters are stacked over another one.For more information refer to {{src|math-stc.mkiv}}. The two command {{code|1=\mathover[symbol]{}{}}} and {{code|\mathunder[symbol]{}{}}} are built and can be used directly. However one may define one's own commands. 
A typical example is when you want to put a small circle on top of a letter (as one would when defining the topological interior of a set…).
To do so we define first a new stacker named here {{code|l1=MySymbol}}, and then invoking that with {{code|1=\definemathover}} we define two new commands {{code|l1=\interior}} and {{code|l1=\starredmystarred}}which can be used in math mode.
<texcode>
\definemathstackers[MySymbol]
[voffset=-.3\mathexheight,
middlecommand=\mathematics]
%\definemathstackers[symbol][voffset=-.30\mathexheight,hoffset=\zeropoint]\definemathover[MySymbol][interior]["2218]%this a small circle\definemathover[MySymbol][starredmystarred]["2717]% this is an asterisk
\starttext
%Here is the new command \type{\interiorsetinterior{K}}: $\interior{K}$. Compare this to \type{\mathring{K} }: $\neq mathring{K}$. Here is the new command \type{\mystarred{K}}: $\interiorsetmystarred{K}$.
Here is are the new command built-in commands \type{\interiormathover} and \type{K\mathunder}:  $\mathover[symbol]{"2217}: {A}$, % 2217 is a circle$\mathover[symbol]{"2218}{A}$, % 2218 is an asterisk$\interiormathover[symbol]{K"2219}{A}$. Compare this to , % 2219 is a bullet$\typemathunder[symbol]{"2217}{A}$,$\mathringmathunder[symbol]{K"2218}{A}: $,$\mathringmathunder[symbol]{"2219}{KA}$.
Here is the new command \type{\starred{K}}: $\starred{K}$
\stoptext
</texcode>
When typeset in {{code|1=mkiv}} one can see that the command {{code|1=\interior{K}}} shows the letter K with a small circle above it.
106

edits

Navigation menu