questions about math formula
Hi all, I have two questions about math formula. 1) I'd like to use \startalign to typeset mathematical formulas since it is more convenient than \eqalign. But the formula number cannot be located between two lines just as \eqalign can. I hope following example can make me clear. \starttext \placeformula \startformula \eqalign{ a + b & = c + d\cr & = e + f\cr} \stopformula \placeformula \startformula \startalign \NC a + b \NC = c + d \NR[+] \NC \NC = e + f \NR \stopalign \stopformula \stoptext The number of equations in second formula can only be put on the first line or second line but not between them. My question is how to make the location of formula number in \startalign the same as it is in \eqalign ? 2) It seems that \left and \right cannot be used on separate groups. Here is a simple example: \starttext \placeformula \startformula \eqalign{ a & = \left(\frac{b+c}{d+e}\cr &\phantom{=~} + \frac{g}{h}\cr} \stopformula \stoptext If I change \left and \right to \big, it compiles successfully. But I think \left and \right are more convenient. Are there some solutions to use \left and \right in this situation ? Regards, Xiao Jianfeng
Quoting "fdu.xiaojf@gmail.com"
Hi all,
I have two questions about math formula.
1) I'd like to use \startalign to typeset mathematical formulas since it is more convenient than \eqalign. But the formula number cannot be located between two lines just as \eqalign can. I hope following example can make me clear.
\starttext
\placeformula \startformula \eqalign{ a + b & = c + d\cr & = e + f\cr} \stopformula
\placeformula \startformula \startalign \NC a + b \NC = c + d \NR[+] \NC \NC = e + f \NR \stopalign \stopformula
\stoptext
The number of equations in second formula can only be put on the first line or second line but not between them.
My question is how to make the location of formula number in \startalign the same as it is in \eqalign ?
As of now, no. This is equivalent to what split environment in amsmath does, and right now, there is no context equivalent. It is easy to provide simple support, (actually even some of the more sophisticated features), and has been on my todo list for a long time now. You can get something by using matrix environments, but then the interline spacing is not correct. See http://dl.contextgarden.net/myway/mathalign.pdf page 21.
2) It seems that \left and \right cannot be used on separate groups. Here is a simple example:
\starttext
\placeformula \startformula \eqalign{ a & = \left(\frac{b+c}{d+e}\cr &\phantom{=~} + \frac{g}{h}\cr} \stopformula
\stoptext
If I change \left and \right to \big, it compiles successfully. But I think \left and \right are more convenient. Are there some solutions to use \left and \right in this situation ?
The easier way is to use manual scaling, for example use \big, \bigg,
\Big, \Bigg or you can have a more fine-tuned control by
\protected\def\domathbig{\@@dobig}
and then use \domathbig{1.25} to have something which is 1.25 the body
font size, etc. The default values are
\def\big {\@@dobig{0.85}}
\def\Big {\@@dobig{1.15}}
\def\bigg{\@@dobig{1.45}}
\def\Bigg{\@@dobig{1.75}}
A more automated way is to use \vphantom, something like
\eqalign{
a &= \left(
Quoting Aditya Mahajan
The easier way is to use manual scaling, for example use \big, \bigg, \Big, \Bigg or you can have a more fine-tuned control by
\protected\def\domathbig{\@@dobig}
Oops, that should be \unprotected\def\.... \unprotected is same as surrounding the command by \unprotect ... \protect and useful for redefinitions of one or two commands. Aditya
participants (2)
-
Aditya Mahajan
-
fdu.xiaojf@gmail.com