From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92219 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Some questions about an environment (Metafun) Date: Tue, 4 Aug 2015 21:26:55 +0200 Message-ID: References: <55C0FFA9.4070908@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0197529388==" X-Trace: ger.gmane.org 1438716470 32421 80.91.229.3 (4 Aug 2015 19:27:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Aug 2015 19:27:50 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 04 21:27:38 2015 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 1ZMhsA-0002m2-82 for gctc-ntg-context-518@m.gmane.org; Tue, 04 Aug 2015 21:27:38 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3ACBE1022A for ; Tue, 4 Aug 2015 21:27:37 +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 z2N_CEtnQWzI for ; Tue, 4 Aug 2015 21:27:36 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E471F1023A for ; Tue, 4 Aug 2015 21:27:03 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 91E06101F6 for ; Tue, 4 Aug 2015 21:27:00 +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 c4g62UOk4Z2W for ; Tue, 4 Aug 2015 21:26:58 +0200 (CEST) Original-Received: from filter3-utr.mf.surf.net (filter3-utr.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 93C07101E6 for ; Tue, 4 Aug 2015 21:26:58 +0200 (CEST) Original-Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) by filter3-utr.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t74JQutb022721 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 4 Aug 2015 21:26:57 +0200 Original-Received: by ioeg141 with SMTP id g141so27425422ioe.3 for ; Tue, 04 Aug 2015 12:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=EiNiMr0LdSnL0HuKIjUgGhU69tXvpI2O3JRR3OgXPOU=; b=zOg/fKZpl6/h2JmhUwo7oiOpaX5zFLhj23pVhNI8S+29OlUz2040HPeFh++O78qDjD HgvhvrJfG7HfrKe5IXbN/9mPgRVf+enDFaVRDsAjF4TqSaQryk12qOsVmFpY7EhV2zxw MwUwYF6oqmO3sqGdtpv+rjnIXUXkWPnr+GNdjETuYQx9eCcBHLmqYigq0rCBaiQNNyBD uFHI/9D9L7daqNo6lGl376GhAsmKlZcHZUSdsV6WP0C7w/UAP2s5ucr5hfGqQGes0GTR XhB49jWfB/1i/sjEqlkPveIIvee1vMyxBahBLxP4hqaTsvNp8xX/V/HxETm50EaQkUkk 4ncA== X-Received: by 10.107.135.41 with SMTP id j41mr5546594iod.33.1438716415434; Tue, 04 Aug 2015 12:26:55 -0700 (PDT) Original-Received: by 10.64.248.227 with HTTP; Tue, 4 Aug 2015 12:26:55 -0700 (PDT) In-Reply-To: <55C0FFA9.4070908@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4001:c06::22f; country=US; region=Iowa; city=Council Bluffs; latitude=41.2619; longitude=-95.8608; http://maps.google.com/maps?q=41.2619,-95.8608&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08P0HqVoT - b5669309149d - 20150804 (trained as not-spam) Received-SPF: pass (filter3-utr.mf.surf.net: domain of fabrice1.couvreur@gmail.com designates 2607:f8b0:4001:c06::22f as permitted sender) receiver=filter3-utr.mf.surf.net; client-ip=2607:f8b0:4001:c06::22f; envelope-from=; helo=mail-io0-x22f.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) 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:92219 Archived-At: --===============0197529388== Content-Type: multipart/alternative; boundary=001a113ed0dcdfe691051c8144eb --001a113ed0dcdfe691051c8144eb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Hans, Thank you for your suggestion, but it's not what I want, but I probably misstated my request. For me, the image p contains the text "D=C3=A9finitio= n 1", and this is what I want orange rectangle translate to the left edge of the text area. Am I more clearly ? Fabrice 2015-08-04 20:08 GMT+02:00 Hans Hagen : > On 8/4/2015 5:04 PM, Fabrice Couvreur wrote: > >> Hi, >> How to have Definition 1, Definition 2, Definition 3 ...? >> >> Is it possible to translate the image p until the left edge of the text >> area ? >> > > > \startuseMPgraphic{MyFrame} > picture p ; > p :=3D textext.rt(\MPstring{MyFrame}) ; > p :=3D p shifted (0,OverlayHeight-ypart center p) ; > fill OverlayBox leftenlarged .1TextWidth withcolor \MPcolor{MyColor} = ; > fill boundingbox p withcolor \MPcolor{myColor} ; > draw p withcolor white ; > setbounds currentpicture to OverlayBox ; > \stopuseMPgraphic > > > > Thank you, >> Fabrice >> >> \showframe >> >> \setupcolors[state=3Dstart,cmyk=3Dyes] >> >> \definecolor[MyColor][c=3D0.00, m=3D0.10, y=3D0.20, k=3D0.00] >> \definecolor[myColor][c=3D0.00, m=3D0.62, y=3D1.00, k=3D0.00] >> >> \setupbodyfont[11pt] >> \defineoverlay[MyFrame][\useMPgraphic{MyFrame}] >> >> \defineframedtext >> [MyText] >> [frame=3Doff, >> background=3DMyFrame, >> width=3D0.9\textwidth, >> location=3Dright] >> >> \defineoverlay[MyFrame][\useMPgraphic{MyFrame}] >> >> \def\StartFrame{\startMyText} >> \def\StopFrame{\startMyText} >> >> \setMPtext{MyFrame}{\hbox spread 1em {\hss\strut >> {\bf\feature[+][f:smallcaps] D=C3=A9finition 1 }\hss}}} >> >> \startuseMPgraphic{MyFrame} >> >> path a ; >> path b ; >> picture p ; >> o :=3D BodyFontSize ; >> p :=3Dtextext.rt(\MPstring{MyFrame}) ; >> p :=3D p shifted (0,OverlayHeight-ypart center p) ; >> a :=3D unitsquare xyscaled(OverlayWidth,OverlayHeight) ; >> fill a withcolor \MPcolor{MyColor} ; >> b :=3D boundingbox p ; >> fill b withcolor \MPcolor{myColor} ; >> draw p withcolor white ; >> >> \stopuseMPgraphic >> >> \starttext >> \startlinecorrection[blank] >> \startMyText >> \input knuth >> \stopMyText >> \stoplinecorrection >> >> \startlinecorrection[blank] >> \startMyText >> \input knuth >> \stopMyText >> \stoplinecorrection >> >> \stoptext >> >> >> >> ________________________________________________________________________= ___________ >> If your question is of interest to others as well, please add an entry t= o >> 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 >> >> ________________________________________________________________________= ___________ >> >> > > -- > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com > | www.pragma-pod.nl > ----------------------------------------------------------------- > > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --001a113ed0dcdfe691051c8144eb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Hans,
Thank you for your suggestion, but it's not what I want, but I probably misstated my request. For me, the image p contains the text "D=C3= =A9finition 1", = and this is what I want orange rectangle t= ranslate to the left edge of the text area= .
Am I more clear= ly ?
Fabrice

2015-08-04 20:08= GMT+02:00 Hans Hagen <pragma@wxs.nl>:
On 8/4/2015 5:04 PM, Fabrice Couvreur wrote:
Hi,
How to have Definition 1, Definition 2, Definition 3 ...?

Is it possible to translate the image p until the left edge of the text
area ?


\startuseMPgraphic{MyFrame}
=C2=A0 =C2=A0 picture p ;
=C2=A0 =C2=A0 p :=3D textext.rt(\MPstring{MyFrame}) ;
=C2=A0 =C2=A0 p :=3D p shifted (0,OverlayHeight-ypart center p) ;
=C2=A0 =C2=A0 fill OverlayBox leftenlarged .1TextWidth withcolor \MPcolor{M= yColor} ;
=C2=A0 =C2=A0 fill boundingbox p withcolor \MPcolor{myColor} ;
=C2=A0 =C2=A0 draw p withcolor white ;
=C2=A0 =C2=A0 setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic



Thank you,
Fabrice

\showframe

\setupcolors[state=3Dstart,cmyk=3Dyes]

\definecolor[MyColor][c=3D0.00, m=3D0.10, y=3D0.20, k=3D0.00]
\definecolor[myColor][c=3D0.00, m=3D0.62, y=3D1.00, k=3D0.00]

\setupbodyfont[11pt]
\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

\defineframedtext
=C2=A0 =C2=A0 [MyText]
=C2=A0 =C2=A0 [frame=3Doff,
=C2=A0 =C2=A0 =C2=A0background=3DMyFrame,
=C2=A0 =C2=A0 =C2=A0width=3D0.9\textwidth,
=C2=A0 =C2=A0 =C2=A0location=3Dright]

\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

\def\StartFrame{\startMyText}
\def\StopFrame{\startMyText}

\setMPtext{MyFrame}{\hbox spread 1em {\hss\strut
{\bf\feature[+][f:smallcaps]=C2=A0 D=C3=A9finition 1 }\hss}}}

\startuseMPgraphic{MyFrame}

path a ;
path b ;
picture p ;
o :=3D BodyFontSize ;
p :=3Dtextext.rt(\MPstring{MyFrame}) ;
p :=3D p shifted (0,OverlayHeight-ypart center p) ;
a :=3D unitsquare xyscaled(OverlayWidth,OverlayHeight) ;
fill a withcolor \MPcolor{MyColor} ;
b :=3D boundingbox p ;
fill b withcolor \MPcolor{myColor} ;
draw p withcolor white ;

\stopuseMPgraphic

\starttext
\startlinecorrection[blank]
\startMyText
\input knuth
\stopMyText
\stoplinecorrection

\startlinecorrection[blank]
\startMyText
\input knuth
\stopMyText
\stoplinecorrection

\stoptext


___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://tex.aanhet.net
archive=C2=A0 : http://foundry.supelec.fr/projects/con= textrev/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________



--

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 H= ans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Ridderstraat 27 | 8061 GH = Hasselt | The Netherlands
=C2=A0 =C2=A0 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| www.pragma-pod.nl
-----------------------------------------------------------------

___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://tex.aanhet.net
archive=C2=A0 : http://foundry.supelec.fr/projects/con= textrev/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________

--001a113ed0dcdfe691051c8144eb-- --===============0197529388== 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= --===============0197529388==--