From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67581 Path: news.gmane.org!not-for-mail From: Tim Steenvoorden Newsgroups: gmane.comp.tex.context Subject: Position of MetaPost graphics Date: Fri, 1 Apr 2011 11:39:18 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1301814631 20156 80.91.229.12 (3 Apr 2011 07:10:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 3 Apr 2011 07:10:31 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Apr 03 09:10:26 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 1Q6HS5-0001jG-Sx for gctc-ntg-context-518@m.gmane.org; Sun, 03 Apr 2011 09:10:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E9DB6CAB77; Sun, 3 Apr 2011 09:09:53 +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 7gYBnFSAP0RQ; Sun, 3 Apr 2011 09:09:48 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 77D63CAB79; Sun, 3 Apr 2011 09:09:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A8BAACAB55 for ; Fri, 1 Apr 2011 11:38:53 +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 oSkOxvrjOT8Q for ; Fri, 1 Apr 2011 11:38:51 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id DADA0CAB4B for ; Fri, 1 Apr 2011 11:38:51 +0200 (CEST) Original-Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p319dI2F012038 for ; Fri, 1 Apr 2011 11:39:19 +0200 Original-Received: by wwi36 with SMTP id 36so3307424wwi.2 for ; Fri, 01 Apr 2011 02:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=ZB0V42nqMSwbfYGNwI9lEyW/AXmVhoBiLe0ymZrdBss=; b=IFu0pX40h2AGk2JV7RVeUIZtM4mJ1LG3D7S96KPVxuy/blGMJYu2+uWjXMZnpjCXzk 5UkQvIYZPJ0POtEvTzZoccBX70HzRA8Zz+CsnySO66behj92u6as+2wzIFt6dK6wxkex Gtg4PBF9drx2Vi4DfXkmkGcfR8fu4V0o1nrUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=VELMnU2/zJ8iZxjuToCf4EBE43GQX2LWWEhLJXsTT/jmX6S8oRwPLb5Gk4nlx434UV LFVhJAl23nRkDZQdbLuuGjwBoCOzmIbldHFtqHy9u6A9p38mpxF/OQWBzZd4lMlSForI NnqkbvcLlTVPOJ7Lxfo5bl7YPgK5BEGk0HDks= Original-Received: by 10.216.143.74 with SMTP id k52mr3568343wej.0.1301650758807; Fri, 01 Apr 2011 02:39:18 -0700 (PDT) Original-Received: by 10.216.7.84 with HTTP; Fri, 1 Apr 2011 02:39:18 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.45; 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: 0rEq9Djli - e64005f22c04 - 20110401 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-Mailman-Approved-At: Sun, 03 Apr 2011 09:09:47 +0200 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:67581 Archived-At: Dear list, I'm trying to make some fancy chapter headers. With MetaPost I drew a wave, which I'd like to place in the margin. I've read details.pdf and metafun.pdf, but I don't manage to get the positioning right. The wave should begin where the bottomframe ends and move on to the page border. Also, the graphic is placed in the page background layer, but nevertheless the text after the the graphic is shifted down. \startuniqueMPgraphic{wave} numeric periods, width; path wave; periods := 3 + 1/4; width := periods * 2*pi; wave := origin for x=0 step 0.1 until width: -- (x,x*sin(x)) endfor; pickup pencircle scaled 1pt; draw wave xscaled (OverlayWidth/width) yscaled (OverlayHeight/(2*width)); \stopuniqueMPgraphic \definelayer[decorations][position=yes,option=test,location=r] \setupbackgrounds[page][background=decorations] \defineoverlay[wave][\uniqueMPgraphic{wave}] \starttext {\ss\bfc A chapter title} \blank[small] \framed[frame=off,bottomframe=on,width=broad,rulethickness=1pt] {\ss\bfx \date \hfill Author Name} \setlayer[decorations]{\framed[background=wave,frame=off,width=\cutspace,height=2\lineheight]{}} \input knuth \stoptext What am I doing wrong? Is it a better idea to draw the bottomframe in MetaPost too? How do I take care of positioning in that case? Absolute positioning is not an option, because the length of the chapterheads can be two lines. It should also work on other paper sizes (A5 in particular). Kind regards, Tim Steenvoorden ___________________________________________________________________________________ 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 ___________________________________________________________________________________