Changes

Jump to navigation Jump to search
485 bytes added ,  22:17, 19 January 2009
m
Changed pre -> texcode
There are several built-in commands for displaying mathematical formulas. For instance
<pretexcode>
\startcases, \stopcases
\startmathmatrix, \stopmathmatrix
\startalign,\stopalign
</pretexcode>
Each has its own advantage and can be customized: for a thorough understanding of these commands please
refer to Aditya Mohajan's excellent user's guide
most of the core ConTeXt math macros.
<precontext source="yes">\starttext 
This is an example of aligned equations:
\startformula
\stopmatrix
\stopformula
 \stoptext</precontext>
In these structures it is important (well, in the above example it is not important and the result is the same, but I have been told that it is necessary in some other situations...) to notice that the sign "=" is preceded by "\NC{}, since
otherwise that sign would be considered as a binary operator and the alignment would be
For instance the following definition
<pretexcode>
\definemathmatrix[alignedcases]
[align={right,left,left},
right={\right.},
style=\displaystyle]
</pretexcode>
creates two new commands,
<pretexcode>
\startalignedcases, \stopalignedcases:
</pretexcode>
after which one may use them in a displayed formula as follows:
<pretexcode>The following formula is displayed in two lines with an appropriate alignment of the equations: \startformula\startalignedcases \NC -\Delta u + g(u) \NC{} = f \NC \quad\mbox{in } \Omega\NR \NC {\partial u \over \partial {\bf n} } \NC{} = h(u) \NC \quad\mbox{on } \partial\Omega \NR\stopalignedcases\stopformula</texcode> <context>\definemathmatrix[alignedcases] [align={right,left,left}, distance=3pt, left={\left\{}, right={\right.}, style=\starttextdisplaystyle]
The following formula is displayed in two lines with an appropriate alignment of the equations:
\stopalignedcases
\stopformula
 \stoptext</precontext>

Navigation menu