Changes

Jump to navigation Jump to search
1,136 bytes added ,  16:29, 27 February 2017
no edit summary
< [[Math]]|>
= Display Math =
<table width="100%" cols="2" cellpadding="5"><tr valign="top"><td width="50%">
<texcode>
\setupformulas[conversionnumberconversion=Character]
</texcode>
</td>
\setuppapersize[A5]
\setuplayout[width=8cm]
\setupformulas[conversionnumberconversion=Character]
\placeformula
\startformula
(see also [[Framed]])
To highlight part of a formula, you can give it a gray background using {{cmd|mframed}}: the following is the code you can use in mkii (see below what one has to do in mkiv):
<context source="yes">
\ln (1+x) =\, \graymath{x - {x^2\over2}} \,+ {x^3\over3}-\cdots.
\stopformula
</context>
 
In mkiv the code is slightly different: one may define {{cmd|graymath}} directly using {{cmd|definemathframed}}
 
<texcode>
\setuppapersize[A5]
\definemathframed[graymath]
[
frame=off,
location=mathematics,
background=color,
backgroundcolor=lightgray,
backgroundoffset=2pt
]
\starttext
Since for $|x| < 1$ we have
\startformula
\log(1+x) = \graymath{x- \displaystyle{x^2\over2}} + {x^3 \over 3} + \cdots
\stopformula
we may write $\log(1+x) = x + O(x^2)$.
\stoptext
</texcode>
 
The result is shown below (possibly the framed part of the formula is not aligned correctly with the remainder of the formula because the mkiv engine on Context Garden is not up to date…).
 
<context mode=mkiv>
\setuppapersize[A5]
\definemathframed[graymath]
[
frame=off,
location=mathematics,
background=color,
backgroundcolor=lightgray,
backgroundoffset=2pt
]
 
Since for $|x| < 1$ we have
\startformula
\log(1+x) = \graymath{x- \displaystyle{x^2\over2}} + {x^3 \over 3} + \cdots
\stopformula
we may write $\log(1+x) = x + O(x^2)$.
</context>

Navigation menu