From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/12850 Path: main.gmane.org!not-for-mail From: Mikael Persson Newsgroups: gmane.comp.tex.context Subject: Re: MetaPost backgrounds Date: Sun, 10 Aug 2003 23:59:29 +0200 Sender: ntg-context-admin@ntg.nl Message-ID: <20030810235929.6575ca52.md9per@mdstud.chalmers.se> References: <20030810093048.5d6fc12b.md9per@mdstud.chalmers.se> <20030810205058.278afdf2.morawski@gmx.net> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1060553100 9131 80.91.224.253 (10 Aug 2003 22:05:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Aug 2003 22:05:00 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Mon Aug 11 00:04:58 2003 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19lyJ8-00057U-00 for ; Mon, 11 Aug 2003 00:04:58 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 7DD7010B3C; Mon, 11 Aug 2003 00:04:55 +0200 (MEST) Original-Received: from lillpelle.home (dynamic-195-176.dialup.chalmers.se [129.16.195.176]) by ref.ntg.nl (Postfix) with ESMTP id 4AFA510AE7 for ; Sun, 10 Aug 2003 23:59:52 +0200 (MEST) Original-Received: from lillpelle.home (localhost.localdomain [127.0.0.1]) by lillpelle.home (8.12.8/8.12.8) with ESMTP id h7ALxXvt013996 for ; Sun, 10 Aug 2003 23:59:34 +0200 Original-Received: (from micke@localhost) by lillpelle.home (8.12.8/8.12.8/Submit) id h7ALxXi6013994; Sun, 10 Aug 2003 23:59:33 +0200 Original-To: ntg-context@ntg.nl In-Reply-To: <20030810205058.278afdf2.morawski@gmx.net> X-Mailer: Sylpheed version 0.9.3claws (GTK+ 1.2.10; i386-redhat-linux-gnu) Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:12850 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:12850 On Sun, 10 Aug 2003 20:50:58 +0200 Jens-Uwe Morawski wrote: > On Sun, 10 Aug 2003 09:30:48 +0200 > Mikael Persson wrote: > > > I had some problems with backgrounds in a table. I wanted just a > > horizontal line, but in different heights. The problem is that the > > > line will always be in the middle of the cell if I don't add more > > > > graphics. > > See the example file below. > > the graphics are always centered in the cell. therefore you have to > > set the bounding box of the graphic to the cell size > > > % This works, but is not nice. > > > > \startuniqueMPgraphic{splittop} > > draw (0,0)--(OverlayWidth,OverlayHeight) withcolor white;%should not > > be necessary > > draw (0,0.725*OverlayHeight)--(OverlayWidth,0.725*OverlayHeight); > > \stopuniqueMPgraphic > > the following should give what you want (untested) > > \startuniqueMPgraphic{splittop} > draw (0,0.725*OverlayHeight)--(OverlayWidth,0.725*OverlayHeight); > setbounds currentpicture to (unitsquare xyscaled > > > (OverlayWidth,OverlayHeight)) ;\stopuniqueMPgraphic > > in order to save some typing you could define a macro > > \startMPinclusions > def FitToOverlay = > setbounds currentpicture to (unitsquare xyscaled > > > (OverlayWidth,OverlayHeight)) ; > enddef; > \stopMPinclusions > > \startuniqueMPgraphic{splittop} > draw (0,0.725*OverlayHeight)--(OverlayWidth,0.725*OverlayHeight); > FitToOverlay ; > \stopuniqueMPgraphic > > Jens Jens, Thanks a lot! I did not know that the graphics are centered in the cell. Now this mystery (to me) is not a mystery no more :) Regards, Micke P