From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92248 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Some questions about an environment (Metafun) Date: Thu, 6 Aug 2015 23:38:01 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1257810074==" X-Trace: ger.gmane.org 1438897139 14161 80.91.229.3 (6 Aug 2015 21:38:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Aug 2015 21:38:59 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 06 23:38:46 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 1ZNSs9-0006LG-UJ for gctc-ntg-context-518@m.gmane.org; Thu, 06 Aug 2015 23:38:46 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 42AE010437 for ; Thu, 6 Aug 2015 23:38:45 +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 uf1GYTn-RlLv for ; Thu, 6 Aug 2015 23:38:44 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E38C410233 for ; Thu, 6 Aug 2015 23:38:14 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8D771101F7 for ; Thu, 6 Aug 2015 23:38:10 +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 42IiWV3biF6d for ; Thu, 6 Aug 2015 23:38:09 +0200 (CEST) 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 1C10A101E6 for ; Thu, 6 Aug 2015 23:38:09 +0200 (CEST) Original-Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) by filter2-til.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t76Lc21t015300 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 6 Aug 2015 23:38:07 +0200 Original-Received: by ioii16 with SMTP id i16so94698332ioi.0 for ; Thu, 06 Aug 2015 14:38:01 -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=UtsLPlTFCg6KkL8bjLcpNmbz7a4JfckTLY7N6qpTalc=; b=sH5+Z9lcikHbxc7ggcrTAGWOBRRgGMyj34XraoJ/rq2/wyLCHDVKTj3VxH0PW9hx/W AVZUWrsB/ybNteIpqE0pN61UQjQ9qX+CbhTqlkWXexNm1CV+melqE1nyFIZKFFPtMHK7 d26hHS7UzqD09pPzjTSWFn9z8hPAZ2zRpA/rhFsUxwnb2bh7j2VNFotg7J4l+IX/H96U ncc5VGSZcoCQmHrI9uPrhu8Tm3dlGrWLmd43XgQ025HT/jgnL4dcn5bJGglehRQqC64e Q9Qtc9RwsoFtXIXg8sFSlDmU1Jcybz0882KNODuStFArTdu6TIh1THioOeMorlBtPiLM t5yQ== X-Received: by 10.107.129.230 with SMTP id l99mr4978611ioi.32.1438897081438; Thu, 06 Aug 2015 14:38:01 -0700 (PDT) Original-Received: by 10.64.248.227 with HTTP; Thu, 6 Aug 2015 14:38:01 -0700 (PDT) In-Reply-To: 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: 0TP1xC2fj - e9e6a68a5494 - 20150806 (trained as not-spam) Received-SPF: pass (filter2-til.mf.surf.net: domain of fabrice1.couvreur@gmail.com designates 2607:f8b0:4001:c06::22a as permitted sender) receiver=filter2-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:92248 Archived-At: --===============1257810074== Content-Type: multipart/alternative; boundary=001a113ecd6068574a051cab5598 --001a113ecd6068574a051cab5598 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 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 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 >> >> ________________________________________________________________________= ___________ > > > --001a113ecd6068574a051cab5598 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,
= The following code (Metafun documentation, thanks again Ha= ns !) is fully unders= tood and works very well. Sorry if I insist, but can we create a counter to avoid writing \FrameTitle{D=C3=A9finition 1}, <= span class=3D"hps atn">

\= FrameTitle{D=C3=A9finition 2}... ?=
Thus,
the only in= vocation \startMyText= ... \stopMyText,=C2=A0
\startMyText = ... \stopMyText= ... this return D=C3=A9fin= ition 1, D=C3=A9finition 2 ...
Thank you,
Fabrice


\setupbodyfont [palatino= ,11pt]

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

\definecolor[My= Color][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][\useM= Pgraphic{MyFrame}]

\defineframedtext
=C2=A0=C2=A0 [MyText]
=C2= =A0=C2=A0 [frame=3Doff,
=C2=A0=C2=A0=C2=A0 background=3DMyFrame,
=C2= =A0=C2=A0=C2=A0 width=3D\textwidth,
=C2=A0=C2=A0=C2=A0 location=3Dright]=

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

\def\StartFr= ame{\startMyText}
\def\StopFrame{\startMyText}

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

\setMPtext{MyFrame}{}

\startuseMPgraphic{MyFrame}<= br>path a ;
path b ;
picture p ;
o :=3D BodyFontSize ;
p :=3Dte= xtext.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 w= ithcolor \MPcolor{myColor} ;
draw p withcolor white ;
\stopuseMPgraph= ic
\starttext
\FrameTitle{D=C3=A9finition 1}
\startMyText
\inpu= t knuth
\stopMyText
\FrameTitle{D=C3=A9finition 2}
\startMyText\input knuth
\stopMyText
\stoptext


2015-08-04 21:30= GMT+02:00 Fabrice Couvreur <fabrice1.couvreur@gmail.com>= :
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 <adityam@umich.edu&g= t;:
On Tue, 4 Aug 2015, Fabr= ice 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 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
___________________________________________________________________________= ________


--001a113ecd6068574a051cab5598-- --===============1257810074== 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= --===============1257810074==--