On 07/30/2010 08:20 AM, Oliver Buerschaper wrote:
No answer :-( Does that mean it's impossible with current technology?
Well, you could create a temporary file from withing the metapost graphic, then read that file back on the TeX side, and then shift the image vertically based on the info from that. Complicated and a bit ugly, but doable. A nicer solution is to adjust the bounging box of the image itself so that it does the right thing. This seems to do the trick (but I recall there is a way to pass a TeX variable to the figure; and that would be much cleaner; but I don't remember how offhand). \startuseMPgraphic{diagram2} u := StrutHeight; draw origin--(2u,0)--(u,sqrt(3)*u)--cycle; currentpicture := currentpicture shifted (0,-(sqrt(3)*u/3)); setbounds currentpicture to (origin--(2u,0)--(u,sqrt(3)*u)--cycle); \stopuseMPgraphic \starttext \startformula A\raise\Umathaxis\displaystyle\hbox{\useMPgraphic{diagram2}} =B \stopformula \stoptext