From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/16747 Path: main.gmane.org!not-for-mail From: Maurice Diamantini Newsgroups: gmane.comp.tex.context Subject: Re: Metapost + metaObjet connector label on arcs Date: Fri, 22 Oct 2004 18:35:54 +0200 Sender: ntg-context-bounces@ntg.nl Message-ID: <717A1C36-2448-11D9-BD8A-000A9595B57C@ensta.fr> References: <426C6168-228F-11D9-9E13-000A9595B57C@ensta.fr> <20041022122446.GC23718@cebitec.uni-bielefeld.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1098641719 28574 80.91.229.6 (24 Oct 2004 18:15:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Oct 2004 18:15:19 +0000 (UTC) Cc: Maurice Diamantini Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 24 20:15:04 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CLmtU-00055e-00 for ; Sun, 24 Oct 2004 20:15:04 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 46E0A127A3; Sun, 24 Oct 2004 20:15:04 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03093-06-4; Sun, 24 Oct 2004 20:15:01 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 57B8F127A6; Sun, 24 Oct 2004 20:15:01 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1342E127BE for ; Fri, 22 Oct 2004 18:38:29 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18549-09 for ; Fri, 22 Oct 2004 18:38:28 +0200 (CEST) Original-Received: from ns1.ensta.fr (unknown [147.250.10.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0DB4D12772 for ; Fri, 22 Oct 2004 18:38:28 +0200 (CEST) Original-Received: from localhost (unknown [127.0.0.1]) by ns1.ensta.fr (Postfix) with ESMTP id 4D56C313D04 for ; Fri, 22 Oct 2004 18:37:46 +0200 (CEST) Original-Received: from ns1.ensta.fr ([127.0.0.1]) by localhost (ns1.ensta.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06360-04 for ; Fri, 22 Oct 2004 18:37:44 +0200 (CEST) Original-Received: from ensta.ensta.fr (ensta.ensta.fr [147.250.1.1]) by ns1.ensta.fr (Postfix) with ESMTP id 862C1313D9A for ; Fri, 22 Oct 2004 18:37:44 +0200 (CEST) Original-Received: from [147.250.33.133] (mac-oc1 [147.250.33.133]) by ensta.ensta.fr (8.11.6/9.11.6) with ESMTP id i9MGbi929179; Fri, 22 Oct 2004 18:37:44 +0200 In-Reply-To: <20041022122446.GC23718@cebitec.uni-bielefeld.de> Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.619) X-Virus-Scanned: by amavisd-new at ntg.nl X-Mailman-Approved-At: Sun, 24 Oct 2004 20:15:00 +0200 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:16747 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:16747 Le 22 oct. 04, =E0 14:24, Eckhart Guth=F6hrlein a =E9crit : > You can attach named paths to objects and then labels these. Here is = my > first try, seems to work: Thank very much Eckhart, I read the metaObj manual, but I didn't realised showing that one can attached a labelObj to arbitrary objects (just for Matrix and trees). Now it works ! It is my first Metapost figure (I am switching from pstricks). As graph (in the sens nodes + arcs, not curve functions) will be frequentjy used (at least by me). I am thinking about some highlevel class (using MetaObj) - class Node for creating node - class Arc for connecting nodes. The goal is that the data (coordinate, various labels, ...) will be as simple as possible. Also it should be easy to pick the Node and Arc class, and personnalide them gor its own graph. For now, I'm trying to anderstand how the label options works, A new problem is that the label sep is to big from thes arcs, and I'm not able to ajust it. The "labshift" option doesn't seem to work with ncarc, althought it works for the nodes. P.S. is one of the Metapost lists still alive? Here is the full exemple (with only 2 nodes) I don use the inline context feature because it doesnt work for me, and I have to work on several workstation, so I still stay (for now) with the indenpendent file I'm sorry for the "latex" line on a context list, but Metafun is not clean installed (texlive 2003), I wanting for the next texlive... And I hope context will be install by default with Metafun . Thank you very much. -- Maurice Diamantini, verbatimtex % -*-latex-*- %&latex \documentclass{article} \usepackage[latin1]{inputenc} \begin{document} \sffamily etex input mp-tool ; % some initializations and auxiliary macros input mp-spec ; % macros that support special features input metaobj.mp ; % suffixe non indispensable ? beginfig(1) ; % For now node positions will be hardcoded numeric u; u=3D1cm; z0=3D(0u,2u); z1=3D(3u,4u); % % verbatimtex \small etex; setCurveDefaultOption("arcangle", 25); % % building nodes of the graph. Nodes are object that arc will be=20 able to % refere to. % Later, I will have to build my own Class "Activity" with some=20 other % parameters (labels above and under the circle, ...) % newCircle.n0(btex \large 0 etex) "circmargin(0.1u)"; ObjLabel.n0(btex b0 etex) "labshift((0, -.5u))"; ObjLabel.n0(btex u0 etex) "labshift((0, .5u))"; n0.c =3D z0; newCircle.n1(btex \large 1 etex) "circmargin(0.1u)"; ObjLabel.n1(btex b1 etex) "labshift((0, -.5u))"; ObjLabel.n1(btex u1 etex) "labshift((0, .5u))"; n1.c =3D z1; % % build some Arcs, with various label or other parameters % I'll have to make some vardef fonction for that. % For now, all arcs related stuffs are in th esame place % % - Howto reduce the label separation ? ("labshift" doen't work) ncarc.n0(n0)(n1) "name(n0_n1)"; ObjLabel.n0(btex $\times$ etex) "labpathname(n0_n1)", "labpos(0.8)"; ObjLabel.n0(btex $0\rightarrow 1$ etex) "labpathname(n0_n1)", "labpos(0.8)", "labangle(0)", "labshift((0, -0.5u))", "labdir(bot)" ; ncarc.n1(n1)(n0) "name(n1_n0)"; ObjLabel.n1(btex $\times$ etex) "labpathname(n1_n0)", "labpos(0.8)"; ObjLabel.n1(btex $1\rightarrow 0$ etex) "labpathname(n1_n0)", "labpos(0.8)", "labangle(180)", "labdir(top)" ; drawObj(n0, n1); endfig ; end .