From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62880 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: metafun Date: Sat, 23 Oct 2010 18:14:19 -0400 (EDT) Message-ID: References: <4CC338B5.6020000@FU-Berlin.DE> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1287872085 27265 80.91.229.12 (23 Oct 2010 22:14:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Oct 2010 22:14:45 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 24 00:14:43 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P9mMM-00043e-3w for gctc-ntg-context-518@m.gmane.org; Sun, 24 Oct 2010 00:14:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2BFB4CA770; Sun, 24 Oct 2010 00:14:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6mcEkfg-Dr82; Sun, 24 Oct 2010 00:14:38 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5E8BFCA70C; Sun, 24 Oct 2010 00:14:38 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 167CECA70C for ; Sun, 24 Oct 2010 00:14:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4eCw4cy1bbIY for ; Sun, 24 Oct 2010 00:14:24 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 510D3CA60F for ; Sun, 24 Oct 2010 00:14:24 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9NMELmi011110 for ; Sun, 24 Oct 2010 00:14:23 +0200 Original-Received: FROM adi-netbook (bas3-montreal02-1096680238.dsl.bell.ca [65.94.3.46]) By tombraider.mr.itd.umich.edu ID 4CC35E3C.71DB7.2517 ; Authuser adityam; 23 Oct 2010 18:14:20 EDT In-Reply-To: <4CC338B5.6020000@FU-Berlin.DE> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.12.86; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0eDmmem0H - f520931452eb - 20101024 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:62880 Archived-At: On Sat, 23 Oct 2010, Herbert Voss wrote: > It is a hard job to understand how all works ... I agree. That chapter is confusing if you do not know already how the mechanism works. > I tried to create the first example of the > documentation "Page 257 Anchors and layers", > but failed with mkii and iv. The page is created, > but without the graphical elements. Not using > \startbuffer--\stopbuffer makes no difference. You are simply setting the positions. You also need to tell ConTeXt to do something with the positions. 1. First define a position graphic that does something with the anchors that it is passed. \startMPpositiongraphic{mypos:arrow} pair c[] ; initialize_box(\MPpos{\MPvar{self}}); c[1] := cxy ; initialize_box(\MPpos{\MPvar{to}}); c[2] := cxy ; drawarrow c[1] -- c[2] withpen pencircle scaled 2bp ; \stopMPpositiongraphic cxy is the center of the box. See the defn of initialize_box in mp-core.mp for other values. I wish these were better documented. 2. Then define a position overlay that specifies the relation between the anchors. \startpositionoverlay{arrow} \setMPpositiongraphic{X-1}{mypos:arrow}{to=X-2} \setMPpositiongraphic{X-2}{mypos:arrow}{to=X-3} \stoppositionoverlay 3. Define an overlay that is mapped to MP position overlay. \defineoverlay[arrow][\positionoverlay{arrow}] 4. Hook the overlay as a page background \setupbackgrounds[page][background=arrow] 5. Then everything will work. \starttext \section {Anchors and layers} In a previous section we saw that some \hpos{X-1} {words} were \hpos{X-2}{circled} and connected by an \hpos{X-3} {arrow}. As with most things in \CONTEXT, marking these words is separated from declaring what to do with those words. This paragraph is keyed in as: \stoptext Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________