On Wed, Oct 20, 2004 at 01:57:47PM +0200, Maurice Diamantini wrote:
I hope I'm not too much out of topic, but I'm trying to put a metapost figure in a context file. I use a separate file for the figure to keep it independant, (and to avoid cumul of problems :-)
The objectif is to build a graph by positionning some node (for now, it is just a circle) connecting them bu some ncarc connector (using metaObj) and the put label onto these arc.
I know that one can do that using tree or matrix mataObj feature, but I'd want to be flexible on the node positions,
You can attach named paths to objects and then labels these. Here is my first try, seems to work: \startMPinclusions input metaobj; \stopMPinclusions \startreusableMPgraphic{labeltest} newCircle.a(btex A etex); newCircle.b(btex B etex); a.c=origin; b.c=a.c+(1cm,2cm); ncline.b(a)(b) "name(ab)"; ObjLabel.b(btex $a\rightarrow b$ etex) "labpathname(ab)", "labangle(0)"; drawObj(a,b); \stopreusableMPgraphic \starttext \reuseMPgraphic{labeltest} \stoptext For more options for labels, see page 54ff of the metaobj manual. Greetings, Eckhart