From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92259 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Some questions about an environment (Metafun) Date: Fri, 7 Aug 2015 17:11:35 +0200 Message-ID: References: <55C4A3DD.8040905@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0750188003==" X-Trace: ger.gmane.org 1438960365 5685 80.91.229.3 (7 Aug 2015 15:12:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Aug 2015 15:12:45 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 07 17:12:31 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 1ZNjJu-0003ML-I3 for gctc-ntg-context-518@m.gmane.org; Fri, 07 Aug 2015 17:12:30 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 998F11021E for ; Fri, 7 Aug 2015 17:12:29 +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 rhGwHWYZdRD4 for ; Fri, 7 Aug 2015 17:12:28 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B52CC10234 for ; Fri, 7 Aug 2015 17:11:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B06FA101FD for ; Fri, 7 Aug 2015 17:11:41 +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 7xHsbwRLYaFO for ; Fri, 7 Aug 2015 17:11:39 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 8F9CB101F7 for ; Fri, 7 Aug 2015 17:11:39 +0200 (CEST) Original-Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) by filter1-til.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t77FBake014524 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 7 Aug 2015 17:11:37 +0200 Original-Received: by iodd187 with SMTP id d187so114482447iod.2 for ; Fri, 07 Aug 2015 08:11:36 -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=Bf35/6GqKs22tz5OkGEqya0R2efzwk5Y4EUIGjPMxnw=; b=cSJReofcqGD79c+GR6uZkrVO729uI8fcMHNVniRs5nHwYVtOjlMxkNGBHPSCgtnvmz KbaLvrSPhQMSkud/OxEc1z/qqcl1dsqXvnrzZDXWpmHadSJZWh4ZcPLh7cnvKpwnoqLl EDCnWGQoBM2Zj92JPxksNz3AxxeQEUkuynQizbREj7iJfKGRTUJTOx/PRiSQHLGd2rzm LffBmGChIni6exAXfGbzoFuXjxkSetrwwhSyG68w8DQmajX7U4fx/Un/OS8M8NbyzCyq ncdDZwLULQnBZyyZcyG7fBLFGOcQD781nAIhAs6u43lTHhsvNSpF4fk5UEcDx6I7N5Gu a5fA== X-Received: by 10.107.135.41 with SMTP id j41mr7984999iod.33.1438960295965; Fri, 07 Aug 2015 08:11:35 -0700 (PDT) Original-Received: by 10.64.248.227 with HTTP; Fri, 7 Aug 2015 08:11:35 -0700 (PDT) In-Reply-To: <55C4A3DD.8040905@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::22a; 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: 0RP1PbB8l - 897cf59bffaa - 20150807 (trained as not-spam) Received-SPF: pass (filter1-til.mf.surf.net: domain of fabrice1.couvreur@gmail.com designates 2607:f8b0:4001:c06::22a as permitted sender) receiver=filter1-til.mf.surf.net; client-ip=2607:f8b0:4001:c06::22a; envelope-from=; helo=mail-io0-x22a.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:92259 Archived-At: --===============0750188003== Content-Type: multipart/alternative; boundary=001a113ed0dc497c7b051cba0dc7 --001a113ed0dc497c7b051cba0dc7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Hans, Thank you for responding to my request, it's really nice. By cons I do not understand what you mean " some day textext might handle it okay" Fabrice 2015-08-07 14:26 GMT+02:00 Hans Hagen : > On 8/6/2015 11:38 PM, Fabrice Couvreur wrote: > >> Hi, >> The following code (Metafun documentation, thanks again Hans !) is fully >> understood and works very well. Sorry if I insist, but can we create a >> counter to avoid writing \FrameTitle{D=C3=A9finition 1}, >> \FrameTitle{D=C3=A9finition 2}... ? >> Thus, the only invocation \startMyText ... \stopMyText, \startMyText ... >> \stopMyText... this return D=C3=A9finition 1, D=C3=A9finition 2 ... >> >> Thank you, >> Fabrice >> >> >> \setupbodyfont [palatino,11pt] >> >> \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] >> >> \defineoverlay[MyFrame][\useMPgraphic{MyFrame}] >> >> \defineframedtext >> [MyText] >> [frame=3Doff, >> background=3DMyFrame, >> width=3D\textwidth, >> location=3Dright] >> >> \defineoverlay[MyFrame][\useMPgraphic{MyFrame}] >> >> \def\StartFrame{\startMyText} >> \def\StopFrame{\startMyText} >> >> \def\FrameTitle#1{\setMPtext{MyFrame}{\hbox spread >> 1em{\hss\strut{\bf\feature[+][f:smallcaps]}#1\hss}}} >> >> \setMPtext{MyFrame}{} >> >> \startuseMPgraphic{MyFrame} >> path a ; >> path b ; >> picture p ; >> o :=3D BodyFontSize ; >> p :=3Dtextext.rt(\MPstring{MyFrame}) ; >> p :=3D p shifted (2o,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 >> \FrameTitle{D=C3=A9finition 1} >> \startMyText >> \input knuth >> \stopMyText >> \FrameTitle{D=C3=A9finition 2} >> \startMyText >> \input knuth >> \stopMyText >> \stoptext >> >> > \setupbodyfont [palatino,11pt] > > \definecolor[MyColorB][c=3D0.00, m=3D0.62, y=3D1.00, k=3D0.00] > \definecolor[MyColorA][.75(MyColorB,white)] %c=3D0.00, m=3D0.10, y=3D0.2= 0, > k=3D0.00] > > \defineframedtext > [MyText] > [frame=3Doff, > background=3DMyFrame, > width=3D\textwidth, > location=3Dright] > > \defineoverlay > [MyFrame] > [\useMPgraphic{MyFrame}] > > \definelabel > [D=C3=A9finition] > [headstyle=3D\bf\smallcaps] > > \startuseMPgraphic{MyFrame} > path b ; > picture p ; > p :=3D textext.rt("\white\D=C3=A9finition") ; % some day textext migh= t handle > it okay > p :=3D p shifted (2BodyFontSize,OverlayHeight-ypart center > p+.25ExHeight) ; > b :=3D boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ; > fill OverlayBox withcolor \MPcolor{MyColorA} ; > fill b withcolor \MPcolor{MyColorB} ; > draw p ; > \stopuseMPgraphic > > \starttext > > \startMyText > \input knuth > \stopMyText > > \startMyText > \input knuth > \stopMyText > > \stoptext > > 2015-08-04 21:30 GMT+02:00 Fabrice Couvreur > >: >> >> Hi Aditya, >> Thank you, I have already thought of this solution, but I do not >> know to use with the environment that I created. >> Fabrice >> >> 2015-08-04 18:02 GMT+02:00 Aditya Mahajan > >: >> >> On Tue, 4 Aug 2015, Fabrice Couvreur wrote: >> >> How to have Definition 1, Definition 2, Definition 3 ... ? >> >> >> \defineenumeration[definition][text=3DDefinition] >> >> 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 : http://foundry.supelec.fr/projects/contextrev/ >> wiki : http://contextgarden.net >> >> ________________________________________________________________________= ___________ >> >> >> >> >> >> >> ________________________________________________________________________= ___________ >> 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 > > _________________________________________________________________________= __________ > --001a113ed0dc497c7b051cba0dc7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Hans,
Thank you for responding to my request
, it's really nice. By cons I do not understand what you mean = "
some day textext might handle it= okay"
Fabrice

2015-08-07 14:26 GMT+02:00 Han= s Hagen <pragma@wxs.nl>:
On 8/6/2015 11:38 PM, Fabrice Couvreur wrote:
Hi,
The following code (Metafun documentation, thanks again Hans !) is fully understood and works very well. Sorry if I insist, but can we create a
counter to avoid writing \FrameTitle{D=C3=A9finition 1},
\FrameTitle{D=C3=A9finition 2}... ?
Thus, the only invocation \startMyText ... \stopMyText, \startMyText ...
\stopMyText... this return D=C3=A9finition 1, D=C3=A9finition 2 ...

Thank you,
Fabrice


\setupbodyfont [palatino,11pt]

\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]

\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=3D\textwidth,
=C2=A0 =C2=A0 =C2=A0location=3Dright]

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

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

\def\FrameTitle#1{\setMPtext{MyFrame}{\hbox spread
1em{\hss\strut{\bf\feature[+][f:smallcaps]}#1\hss}}}

\setMPtext{MyFrame}{}

\startuseMPgraphic{MyFrame}
path a ;
path b ;
picture p ;
o :=3D BodyFontSize ;
p :=3Dtextext.rt(\MPstring{MyFrame}) ;
p :=3D p shifted (2o,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
\FrameTitle{D=C3=A9finition 1}
\startMyText
\input knuth
\stopMyText
\FrameTitle{D=C3=A9finition 2}
\startMyText
\input knuth
\stopMyText
\stoptext


\setupbodyfont [palatino,11pt]

\definecolor[MyColorB][c=3D0.00, m=3D0.62, y=3D1.00, k=3D0.00]
\definecolor[MyColorA][.75(MyColorB,white)]=C2=A0 %c=3D0.00, m=3D0.10, y=3D= 0.20, k=3D0.00]

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

\defineoverlay
=C2=A0 [MyFrame]
=C2=A0 [\useMPgraphic{MyFrame}]

\definelabel
=C2=A0 [D=C3=A9finition]
=C2=A0 [headstyle=3D\bf\smallcaps]

\startuseMPgraphic{MyFrame}
=C2=A0 =C2=A0 path b ;
=C2=A0 =C2=A0 picture p ;
=C2=A0 =C2=A0 p :=3D textext.rt("\white\D=C3=A9finition") ; % som= e day textext might handle it okay
=C2=A0 =C2=A0 p :=3D p shifted (2BodyFontSize,OverlayHeight-ypart center p+= .25ExHeight) ;
=C2=A0 =C2=A0 b :=3D boundingbox p leftenlarged .5EmWidth rightenlarged .5E= mWidth ;
=C2=A0 =C2=A0 fill OverlayBox withcolor \MPcolor{MyColorA} ;
=C2=A0 =C2=A0 fill b withcolor \MPcolor{MyColorB} ;
=C2=A0 =C2=A0 draw p ;
\stopuseMPgraphic

\starttext

\startMyText
=C2=A0 =C2=A0 \input knuth
\stopMyText

\startMyText
=C2=A0 =C2=A0 \input knuth
\stopMyText

\stoptext

2015-08-04 21:30 GMT+02:00 Fabrice Couvreur <fabrice1.couvreur@gmail.com
<mailto:fabrice1.couvreur@gmail.com>>:

=C2=A0 =C2=A0 Hi Aditya,
=C2=A0 =C2=A0 Thank you, I have already thought of this solution, but I do = not
=C2=A0 =C2=A0 know to use with the environment that I created.
=C2=A0 =C2=A0 Fabrice

=C2=A0 =C2=A0 2015-08-04 18:02 GMT+02:00 Aditya Mahajan <adityam@umich.edu
=C2=A0 =C2=A0 <mailto:adityam@umich.edu>>:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 On Tue, 4 Aug 2015, Fabrice Couvreur wrote:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 How to have Definition 1, Definit= ion 2, Definition 3 ... ?


=C2=A0 =C2=A0 =C2=A0 =C2=A0 \defineenumeration[definition][text=3DDefinitio= n]

=C2=A0 =C2=A0 =C2=A0 =C2=A0 Aditya
=C2=A0 =C2=A0 =C2=A0 =C2=A0 _______________________________________________= ____________________________________
=C2=A0 =C2=A0 =C2=A0 =C2=A0 If your question is of interest to others as we= ll, please add an
=C2=A0 =C2=A0 =C2=A0 =C2=A0 entry to the Wiki!

=C2=A0 =C2=A0 =C2=A0 =C2=A0 maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> /
=C2=A0 =C2=A0 =C2=A0 =C2=A0 http://www.ntg.nl/mailman/= listinfo/ntg-context
=C2=A0 =C2=A0 =C2=A0 =C2=A0 webpage=C2=A0 : http://www.pragma-ade.nl / <= a href=3D"http://tex.aanhet.net" rel=3D"noreferrer" target=3D"_blank">http:= //tex.aanhet.net
=C2=A0 =C2=A0 =C2=A0 =C2=A0 archive=C2=A0 : http://fou= ndry.supelec.fr/projects/contextrev/
=C2=A0 =C2=A0 =C2=A0 =C2=A0 wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.n= et
=C2=A0 =C2=A0 =C2=A0 =C2=A0 _______________________________________________= ____________________________________





___________________________________________________________________________= ________
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
___________________________________________________________________________= ________

--001a113ed0dc497c7b051cba0dc7-- --===============0750188003== 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= --===============0750188003==--