From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/89293 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: overlay Date: Mon, 24 Nov 2014 12:02:58 +0100 Message-ID: <54731062.6060605@gmx.net> References: <24F8D443-4B30-4BC3-BDBF-D78E96A4BCC1@inradius.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080402020903050000060109" X-Trace: ger.gmane.org 1416827040 16966 80.91.229.3 (24 Nov 2014 11:04:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Nov 2014 11:04:00 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Nov 24 12:03:49 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XsrQq-0000Oz-N9 for gctc-ntg-context-518@m.gmane.org; Mon, 24 Nov 2014 12:03:48 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1F87810222 for ; Mon, 24 Nov 2014 12:03:48 +0100 (CET) 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 PhWaShYv4y6I for ; Mon, 24 Nov 2014 12:03:44 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E63BF10234 for ; Mon, 24 Nov 2014 12:03:12 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 03421101EA for ; Mon, 24 Nov 2014 12:03:09 +0100 (CET) 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 VKKu4CRu7wyw for ; Mon, 24 Nov 2014 12:03:06 +0100 (CET) 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 D35E5101E8 for ; Mon, 24 Nov 2014 12:03:06 +0100 (CET) Original-Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id sAOB35bW003914 for ; Mon, 24 Nov 2014 12:03:06 +0100 Original-Received: from [192.168.178.37] ([37.201.193.26]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0LyB6P-1XyJXu3uHF-015YxW for ; Mon, 24 Nov 2014 12:03:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <24F8D443-4B30-4BC3-BDBF-D78E96A4BCC1@inradius.net> X-Provags-ID: V03:K0:iX01YuYaXfXq4bb3JCl2XhM4ttRSIo1Cq/FDUpy8JVV3pJXnRHF AqyxdYcwfnwso79biLJzKOThTCPjGuGJvuR7E08C7fsz33EhvfNAUR2ZXioqCnGoVviDcwQ NBhkB30MyYgD5Sq2gBQ7ngR0nIy27O1b9UPdKxzRw/5zUcmTpM2nkHn+rZ3GwORLmPZdwLw f57D88XnGPMA+NpaRYH+A== X-UI-Out-Filterresults: notjunk:1; X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=212.227.17.20; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QNjn35Lw - 56df78c1cbf2 - 20141124 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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 Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:89293 Archived-At: This is a multi-part message in MIME format. --------------080402020903050000060109 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am 22.11.2014 um 21:32 schrieb John Kitzmiller: > Given rectangles with text: >=20 > \starttext > Before:\\ > \startMPcode > draw unitsquare xscaled 2cm yscaled 1cm; =20 > \stopMPcode > \\ > After:\\ > \startMPcode > for i=3D0 upto 1: > draw unitsquare scaled 1cm xshifted i*cm; > endfor; > \stopMPcode > \stoptext >=20 >=20 > How can a line be drawn connecting the right edges of the rectangles? I > have played with: >=20 > \startuniqueMPgraphic{line} > path a; > a:=3D(0,0)--(0,3cm); > draw a withpen pencircle scaled 3pt withcolor green; > \stopuniqueMPgraphic >=20 > \defineoverlay[line][{\uniqueMPgraphic{line}}] >=20 >=20 > and using it in \framed, but placing the line correctly is elusive. >=20 >=20 Just a quick and dirty solution. The trick is to draw the extra line as part of the graphic and then fake the boundingbox. This is also limited to a few centimeter, objects are cut off after you reach that 'invisible' border around the boundingbox. I would use uniqueMPgraphic with proper parameters for the graphics. Using overlays is also possible (urcorner OverlayBox), but I see no real need or benefit to do so. HTH, Peter --------------080402020903050000060109 Content-Type: text/x-tex; name="test.tex" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="test.tex" \startMPinclusions numeric lw; lw:=3D 1; numeric n; n:=3D 8; numeric u; u:=3D 1cm; \stopMPinclusions \starttext Before:\\ \startMPcode pickup pencircle scaled lw; draw unitsquare xyscaled (n*u,u); =20 \stopMPcode \\ After:\\ \startMPcode path p,q; pickup pencircle scaled lw; p:=3D unitsquare scaled u; for i=3D0 upto n-1: draw p xshifted i*u; endfor; q:=3D boundingbox currentpicture; draw (urcorner(q) shifted(-.5lw,-.5lw)) -- (urcorner(q) shifted(-.5lw,-= =2E5lw +1.5u)); setbounds currentpicture to q; \stopMPcode \stoptext --------------080402020903050000060109 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --------------080402020903050000060109--