![](https://secure.gravatar.com/avatar/6114858d84b0f40cf715f12237ab67a1.jpg?s=120&d=mm&r=g)
On 2/25/07, Aditya Mahajan wrote:
On Sun, 25 Feb 2007, Mojca Miklavec wrote:
Hello,
How can I do something similar to this?
\starttext \startMPcode draw textext("\startformula" & "\sum_{i=0}^N i^2" & "\stopformula"); \stopMPcode \stoptext
I could not get the usual tricks to work here (place in a vbox or framed), but unless you also want equation numbering, what is wrong with
draw textext("$ \displaystyle \sum_{i=0}^N i^2 $");
after that that is what \startformula is doing.
\startformula can indeed be replaced with \displaystyle, but my minimal example was "too minimal". Is something like the example below doable? Hans often mentioned \rawtex to shield expansion, but I didn't know how to apply it in this particular case. btex is out of question, \sometxt could be used, but not when metapost variables need to be read. \startMPcode a := 3; b := 4; draw textext("$ \displaystyle{\startalign" & "\NC a \NC =" & decimal a & "\NR" & "\NC b \NC =" & decimal b & "\NR" & "\stopalign}$"); \stopMPcode Mojca