From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/81025 Path: news.gmane.org!not-for-mail From: Roland Thiers Newsgroups: gmane.comp.tex.context Subject: Re: text overlayed Date: Mon, 4 Mar 2013 14:30:23 +0100 Message-ID: References: <20130304113758.GN29684@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset="windows-1252"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1362403833 6723 80.91.229.3 (4 Mar 2013 13:30:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Mar 2013 13:30:33 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Mar 04 14:30:57 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCVTl-00010B-Lr for gctc-ntg-context-518@m.gmane.org; Mon, 04 Mar 2013 14:30:57 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0D7EA101FA; Mon, 4 Mar 2013 14:30:36 +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 l-ObsF2EAikB; Mon, 4 Mar 2013 14:30:34 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 845F3101F2; Mon, 4 Mar 2013 14:30:34 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 02522101F2 for ; Mon, 4 Mar 2013 14:30:33 +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 LudRy+RiDwkF for ; Mon, 4 Mar 2013 14:30:28 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 10C3B101EF for ; Mon, 4 Mar 2013 14:30:28 +0100 (CET) Original-Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r24DUQsA019999 for ; Mon, 4 Mar 2013 14:30:27 +0100 Original-Received: by mail-wi0-f178.google.com with SMTP id hq4so2018903wib.17 for ; Mon, 04 Mar 2013 05:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; bh=1wA2rGYyF/pheo8i38B150NQnCJGwuLcJSKQK4hDPeQ=; b=HFYsOSzEm1fmZrtpjtp7FEcRVAxKueD4Ojh3yOr8VB9Ta/X+fmYGqUOKKgGwLfktVv XiPIR0mNECYUhgZathMSdX/nQ2A5qUFZeiSON9nEoewB8Svq08uoDrfgIPtz+3ev05fe IhILn4zo6czE7QO/s6i87cfOL7QmyESCY0WZiQLbY1rAmrdchJHsT1F1M7HCtOXB7n6d FWGksbbef5uHKjtFSAC7ZQ6RAPX1QGghmuRkIQFOS7/rSoJ2h4LSaxfOPqTmwRe6oGO/ qjN1CqkB5WAouXV3s8UG9rYAp5ca+eh8X71Fw7pepD+/s69kz1edUzinof8NShbpe81j 1xkw== X-Received: by 10.180.75.143 with SMTP id c15mr11537179wiw.18.1362403826753; Mon, 04 Mar 2013 05:30:26 -0800 (PST) Original-Received: from [192.168.0.10] (ax113-3-82-234-26-247.fbx.proxad.net. [82.234.26.247]) by mx.google.com with ESMTPS id o8sm14144312wix.7.2013.03.04.05.30.25 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 04 Mar 2013 05:30:25 -0800 (PST) In-Reply-To: <20130304113758.GN29684@homerow> X-Mailer: Apple Mail (2.936) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.212.178; 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: 0TJ7puqIU - 610d533f85b1 - 20130304 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:81025 Archived-At: Le 4 mars 13 =E0 12:37, Marco Patzer a =E9crit : > On 2013=9603=9604 Roland Thiers wrote: > >> I'm learning a little bit of metapost language, using metafun manual. >> I made some background for a title (surely the code is awful, thanks >> for suggestions of improvement) but it's static, i'd like to adapt = >> it to >> the widthof the text. I don't know if it is possible from my code >> and if it is i don't know how to do ! > > You can use the variable OverlayWidth to obtain the width of the > overlay, which is determined by the provided text. You can use it as > follows: > > \setuplayout > [backspace=3D6cm] > > \startuniqueMPgraphic{essai} > path p,p',q,q'; > > w:=3D2OverlayWidth; > > p :=3D (0,0.1cm) -- (w,0.3cm); > q :=3D (11cm,-0.7cm) -- (w,2.2cm); > p':=3D (w,1.3cm) -- (-0.4cm,1.4cm); > q':=3D (0.3cm,2.4cm) -- (0.2cm,-0.3cm); > > pickup pencircle scaled 1mm; > drawoptions(withcolor 0.3white); > > draw p; draw p'; > draw q; draw q'; > > pair A; A:=3Dq'intersectionpoint p'; > pair B; B:=3Dq intersectionpoint p'; > pair C; C:=3Dp intersectionpoint q; > pair D; D:=3Dq'intersectionpoint p; > path s; s:=3D A--B--C--D--cycle; > > fill s withcolor .8white; > \stopuniqueMPgraphic > > \defineoverlay > [encadrement] > [\uniqueMPgraphic{essai}] > > \defineframed > [boxframed] > [frame=3Doff, > foregroundstyle=3Dbolditalic, > foregroundcolor=3Ddarkred, > background=3Dencadrement] > > \starttext > \boxframed{Devoir de math=E9matiques} > \blank [2cm] > \boxframed{Devoir de math=E9matiques and some more text} > \stoptext > > > Marco Great ! Thank you very much, Marco ! I saw the use of the numeric = variable OverlayWidth and also all your improvements like drawoptions, defineframed ... in preamble. Roland > _________________________________________________________________________= __________ > 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-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________