From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/46809 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: MPgraphic with rounded corners Date: Thu, 15 Jan 2009 12:48:48 -0500 (EST) Message-ID: References: <496F71DF.5080605@capdm.com> 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: ger.gmane.org 1232041917 3200 80.91.229.12 (15 Jan 2009 17:51:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2009 17:51:57 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 15 18:53:08 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LNWOq-0006Jy-6I for gctc-ntg-context-518@m.gmane.org; Thu, 15 Jan 2009 18:53:00 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AB6881FE0A; Thu, 15 Jan 2009 18:51:41 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18799-04-4; Thu, 15 Jan 2009 18:50:25 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 51D981FDD2; Thu, 15 Jan 2009 18:50:25 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7142B1FDD2 for ; Thu, 15 Jan 2009 18:50:24 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18799-04-3 for ; Thu, 15 Jan 2009 18:49:45 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id A02CD1FDCF for ; Thu, 15 Jan 2009 18:49:45 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n0FHnheZ015954 for ; Thu, 15 Jan 2009 18:49:44 +0100 Original-Received: FROM [192.168.2.8] (c-71-234-195-113.hsd1.ct.comcast.net [71.234.195.113]) BY hackers.mr.itd.umich.edu ID 496F7736.3FBE7.28274 ; 15 Jan 2009 12:49:42 -0500 In-Reply-To: <496F71DF.5080605@capdm.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.81; 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: 166016633 - 163146bf5013 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:46809 Archived-At: On Thu, 15 Jan 2009, Duncan Hothersall wrote: > Hello all. > > I have adapted a bit of MP code from Aditya from a mailing list message dated > 2006-05-19 > (http://archive.contextgarden.net/message/20060519.214124.9174ac0e.en.html) > to ensure that when a page break occurs in a textbackground there is a forced > vertical space inside the box at the top of the new page. > > This code works fine for me (although interestingly not in the garden): > > > \setupcolors[state=start] > > \startuseMPgraphic{mpos:par:myexample} > path p; > for i = 1 upto nofmultipars : > p := multipars[1] topenlarged 8pt bottomenlarged 8pt; Change this to p := multipars[1] topenlarged 8pt bottomenlarged 8pt cornered 2mm ; > fill p withcolor 0.9white ; > draw p withcolor black > withpen pencircle scaled \MPvar{linewidth}; > endfor; > \stopuseMPgraphic > > \definetextbackground[ExampleBackground] > [mp=mpos:par:myexample,location=paragraph,leftoffset=1em,rightoffset=1em,rulethickness=1pt] > > \starttext > \input knuth \endgraf > \starttextbackground[ExampleBackground] > \dorecurse{13}{\input knuth \endgraf} > \stoptextbackground > \input knuth \endgraf > \stoptext > > > But now I need to make this box have rounded corners, and I am very confused > when reading core-pgr.tex because that is a level of MP code I just don't > understand. Look at the metafun manual. The path p is basically a box (whose dimentions are equal to the text on the page, but for metapost this is immaterial) and you wnat to make it have round corners. So you the appropriate metafun transformation (cornered in this case). 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________