how to use \startformula inside textext(...)?
Hello, How can I do something similar to this? \starttext \startMPcode draw textext("\startformula" & "\sum_{i=0}^N i^2" & "\stopformula"); \stopMPcode \stoptext Thanks a lot, Mojca
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. Aditya
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
draw textext("\startformula" & "\sum_{i=0}^N i^2" & "\stopformula");
I'm always a bit scared of textext, but here's how I do what I think you are trying to do (get limits underneath) using btex..etex: label(btex $\displaystyle{\sum_{i=0}^N i^2}$ etex, origin); Hopefully the same works in textext. -Sanjoy `Not all those who wander are lost.' (J.R.R. Tolkien)
participants (3)
-
Aditya Mahajan
-
Mojca Miklavec
-
Sanjoy Mahajan