From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67596 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Position of MetaPost graphics Date: Mon, 4 Apr 2011 09:33:30 +0200 Message-ID: References: <4D9859C6.9040200@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1301902445 23307 80.91.229.12 (4 Apr 2011 07:34:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Apr 2011 07:34:05 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 04 09:34:00 2011 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 1Q6eIP-0006a4-0Q for gctc-ntg-context-518@m.gmane.org; Mon, 04 Apr 2011 09:33:57 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4E79DCAB9A; Mon, 4 Apr 2011 09:33:56 +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 WGtNOAHJl8MT; Mon, 4 Apr 2011 09:33:50 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 935ACCAB97; Mon, 4 Apr 2011 09:33:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A18E5CAB97 for ; Mon, 4 Apr 2011 09:33:49 +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 oD33l4gKDGXP for ; Mon, 4 Apr 2011 09:33:36 +0200 (CEST) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 3D86ECAB82 for ; Mon, 4 Apr 2011 09:33:36 +0200 (CEST) Original-Received: from mail-bw0-f41.google.com (mail-bw0-f41.google.com [209.85.214.41]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p347XZmh014130 for ; Mon, 4 Apr 2011 09:33:35 +0200 Original-Received: by bwz17 with SMTP id 17so5540878bwz.14 for ; Mon, 04 Apr 2011 00:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to :x-mailer; bh=ETEu8VM/e0/2NcNc7bfcyHlQMA39pmBKmqY/IbpDu3Y=; b=Sl+oaOLjrH8x3h/wltjT34/RqyLnHDs6r1ybAJwhZNq1JDVLvekYH0fa5JyGlaqPfc NqPcsdr53Tykdh+wkiGNhMwhsjwFe7CVitfyKK2iJ6C1KhEgtvcu21ggj23zhN/9VymJ LItuYVdPpP+KX4XUoLpZr8LaBUwvJNVNSuclQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=OWtxuvG72WNmBOQmug9W6J+CGzlBLs96pkBzCxggc7ydlWazaiztiyCCtKF8bQTTQ8 bi7KQ13MEebGhGVjGQlZYncqLqpoAuprtDZ1TCxCCe5K6E1BAaGzNGUlBtXgBMQjue0F A3rLnmnfhEPJiQZQk+sOCBfVQr6yPDVIqu/w0= Original-Received: by 10.205.37.2 with SMTP id tc2mr6147797bkb.14.1301902415350; Mon, 04 Apr 2011 00:33:35 -0700 (PDT) Original-Received: from [192.168.2.31] (p5B295E4C.dip.t-dialin.net [91.41.94.76]) by mx.google.com with ESMTPS id v21sm2866833bkt.23.2011.04.04.00.33.32 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Apr 2011 00:33:34 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.9995 (Score 4.7, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06ErjxzEg - b110d454f930 - 20110404 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 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:67596 Archived-At: Am 04.04.2011 um 01:22 schrieb Tim Steenvoorden: > Thanks Peter! You are right it is easier to draw both the wave and the > line in Metapost. And the dx=3D-\cutspace is just what I needed for left > pages! > = > I striped the frames out of the code and placed just the graphics in > the layer with a reuseMPgraphic. Also, I pulled out the definition of > the wave into a MPinclusions. I have to do LoadPageState in each > graphic though. > = > %\showframe > \setuppapersize[A5][A5] > \setuppagenumbering[alternative=3Ddoublesided] > = > \startMPinclusions > numeric periods, width; > path wave; > periods :=3D 3 + 1/4; > width :=3D periods * 2*pi; > wave :=3D origin for x=3D0 step 0.1 until width: > .. (x,x*sin(x)) > endfor; > \stopMPinclusions > = > \startreusableMPgraphic{rightwave} > LoadPageState; > pickup pencircle scaled 1pt; > draw origin -- (TextWidth,0) -- wave xscaled (CutSpace/width) yscaled > (LineHeight/width) shifted (TextWidth,0); > %setbounds currentpicture to unitsquare xscaled (TextWidth+CutSpace); > \stopreusableMPgraphic > = > \startreusableMPgraphic{leftwave} > LoadPageState; > pickup pencircle scaled 1pt; > draw reverse wave xscaled (-1*CutSpace/width) yscaled > (LineHeight/width) -- (TextWidth,0); > \stopreusableMPgraphic > = > \definelayer[decorations][position=3Dyes,option=3Dtest] > \setupbackgrounds[page][background=3Ddecorations] > = > \starttext > = > {\ss\bfc A chapter title} > \blank[small] > {\ss\bfx \date \hfill Author Name} > \setlayer[decorations][location=3Dr]{\reuseMPgraphic{rightwave}} > = > \input knuth > = > \page > = > {\ss\bfc A very long chapter title on two or more lines} > \blank[small] > {\ss\bfx \date \hfill Author Name} > \setlayer[decorations][location=3Dr,dx=3D-\cutspace]{\reuseMPgraphic{left= wave}} > = > \input knuth > = > \stoptext > = > Just one problem is left. The graphic occupies space in the text layer > as if the location was set to rb. If you place it with the position=3Dno > option, it is properly placed in the background and it doesn't disturb > the text. Is this a bug or a feature? > = > I tried to play a bit with the bounding boxes, but I think I don't > understand them that well. Your problem is that you use {\ss\bfc =85} etc. to place the title rather than contexts \title command where you can define your own command. With such a command you can put all text in a frame with your graphic a background. - http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content - http://wiki.contextgarden.net/Titles#A_complex_graphical_element_under_th= e_chapter_title Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________