From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96724 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Framedtext in a float Date: Tue, 1 Nov 2016 10:47:22 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1110185929961646726==" X-Trace: blaine.gmane.org 1477993699 5650 195.159.176.226 (1 Nov 2016 09:48:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 1 Nov 2016 09:48:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 01 10:48:13 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1Vfk-0007qO-7g for gctc-ntg-context-518@m.gmane.org; Tue, 01 Nov 2016 10:48:00 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3DFBA1C868; Tue, 1 Nov 2016 10:47:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vJ9q3xbxgY1L; Tue, 1 Nov 2016 10:47:37 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 74F8E1C86E; Tue, 1 Nov 2016 10:47:37 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CF9D61C868 for ; Tue, 1 Nov 2016 10:47:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OMPEoiyoTazg for ; Tue, 1 Nov 2016 10:47:35 +0100 (CET) Original-Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id B16941C866 for ; Tue, 1 Nov 2016 10:47:24 +0100 (CET) Original-Received: by mail-oi0-f53.google.com with SMTP id i127so283268228oia.2 for ; Tue, 01 Nov 2016 02:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+8tiJFEhSnZSYyn3g8wLjuVXGWiLLc1xS+StbzvfA1I=; b=U3cHtl9kuwvL6aVzj4K41rWPod1jiyvQ2PZsAmKQFZb+tnypR1gQFAWAc+bz/qR1+K oxujac2AHz37kZy3TXd9sVOtHWu6ooC9pzEWyFlvqy2VHvaLh/DbTmuLUqCnboA6HwoD CD5lB3IZnvbSW/AEwBUiDS91w/MFk7qQ5R4lxYNlqmp40/1Kb5CjXBSnIes0abBKq56W bKoz/19U1nmnRRmcLupan7YQSkM1/QojbvW07HuFTXOF8BjuOGiTS9bR+MVMWJgP5l5c wVX+hJqQI4z7HLnDrpzpDeU+8R7uqCbUpGUtK+fkbZFVLOJgPnLXsYFO3tsiRZDpscpi /DjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=+8tiJFEhSnZSYyn3g8wLjuVXGWiLLc1xS+StbzvfA1I=; b=WtLin/4IOtAPbYt2hPg3EwZk+7yWr+A4+xoWdPYCHz1IlzfkafyulQWngvzkrPTWpF 1EfgpV+n0pRGKcPybmDuTJ9v4MMhH4Gk8rNqEJunaMjg5ALPjyTqBAuEp81uGz3oKKRS ttUDQKbL5tdFbvBoY4Tvqh7G29UIgMrl7G1UhcAO3XkUaMSEwju2nPSwLurZlxuulSjS fmMcQiGoW1pP4rO3zreuUNGbPjEGP6UgqyOchRR9LmLZA07DBGDaHf/pXzReFhuHoLPo PhBnRSjAncteS6nKYfUC+BqZuuSTn6UhnCqImRFElt8vR1W0Jh/cLn9KAXUz8udxNSSi lXRw== X-Gm-Message-State: ABUngvcz/gjRMkkNO+T1cyJFxSFBc54SLJpU3bFh5JwGhKX+7jKnbMUYJqIFCNtAbS8tvAClWbUoHb2N7cLsKg== X-Received: by 10.107.58.86 with SMTP id h83mr24427049ioa.117.1477993642714; Tue, 01 Nov 2016 02:47:22 -0700 (PDT) Original-Received: by 10.64.163.227 with HTTP; Tue, 1 Nov 2016 02:47:22 -0700 (PDT) In-Reply-To: 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:96724 Archived-At: --===============1110185929961646726== Content-Type: multipart/alternative; boundary=001a114ac8840dfa2505403a36af --001a114ac8840dfa2505403a36af Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, The option align =3D tolerant rule one of the problems I may encounter. But I wonder if it's possible that I should not choose myself width =3D 6cm to fit the text. If I have to use the command several times with different content, how make ? Thank you Fabrice 2016-11-01 9:23 GMT+01:00 Piotr Kopszak : > Just use > ... > \startMyFrame[Title=3DInfo] > \setupalign[hyphenated,morehyphenation,verytolerant] > ... > > Piotr > > 2016-11-01 0:12 GMT+01:00 Fabrice Couvreur : > > Hello, > > How to make the width of framedtext automatically adapts to its content= s. > > Fabrice > > > > \definefloat > > [recipe] > > [figure] > > > > \setupfloat > > [recipe] > > [default=3D{right,none}] > > > > \definecolor[MyColorA][r=3D0.8784, g=3D0.8784, b=3D0.8784] > > \definecolor[MyColorB][c=3D0.00,m=3D0.27,y=3D1.00,k=3D0.00] > > > > > > \defineframedtext > > [MyFrame] > > [before=3D{\blank}, > > after=3D{\blank}, > > frame=3Doff, > > background=3DMyFrame, > > width=3D6cm, > > height=3Dfit] > > > > \startuseMPgraphic{MyFrame} > > path b; > > picture p; > > p :=3D textext.rt("\tfx\white\framedtextparameter{Title}"); > > p :=3D p shifted (2BodyFontSize,OverlayHeight-ypart center > p+.25ExHeight); > > b :=3D boundingbox p enlarged .3EmWidth ; > > fill OverlayBox withcolor \MPcolor{MyColorA}; > > fill b withcolor \MPcolor{MyColorB} ; > > draw p ; > > setbounds currentpicture to boundingbox currentpicture enlarged 2mm ; > > \stopuseMPgraphic > > > > \defineoverlay > > [MyFrame] > > [\useMPgraphic{MyFrame}] > > > > \starttext > > > > \placerecipe{}{ > > \startMyFrame[Title=3DInfo] > > L'histogramme est constitu=C3=A9 de rectangles dont les bases corresp= ondent > aux > > classes et dont les aires sont proportionnelles aux effectifs ou > fr=C3=A9quences > > des classes. > > \stopMyFrame} > > > > \input Knuth > > > > \stoptext > > > > ____________________________________________________________ > _______________________ > > 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://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > ____________________________________________________________ > _______________________ > > > > -- > http://okle.pl > ____________________________________________________________ > _______________________ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ____________________________________________________________ > _______________________ > --001a114ac8840dfa2505403a36af Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello,
The option align =3D toleran= t rule one of the problems I<= /span> may encounter. But I wo= nder if it's possible that I sho= uld not choose myself width =3D 6cm to fit the text. If I have to use the command several times with different co= ntent, how make ?
Thank you
Fa= brice

2016-11-01 9:23 GMT+01:00 Piotr Kopszak <= ;kopszak@gmail.com>:
Just use
...
\startMyFrame[Title=3DInfo]
\setupalign[hyphenated,morehyphenation,verytolerant]
...

Piotr

2016-11-01 0:12 GMT+01:00 Fabrice Couvreur <
fabrice1.couvreur@gmail.com>:
> Hello,
> How to make the width of framedtext automatically adapts to its conten= ts.
> Fabrice
>
> \definefloat
>=C2=A0 =C2=A0 [recipe]
>=C2=A0 =C2=A0 [figure]
>
> \setupfloat
>=C2=A0 =C2=A0 [recipe]
>=C2=A0 =C2=A0 [default=3D{right,none}]
>
> \definecolor[MyColorA][r=3D0.8784, g=3D0.8784, b=3D0.8784]
> \definecolor[MyColorB][c=3D0.00,m=3D0.27,y=3D1.00,k=3D0.00]
>
>
> \defineframedtext
>=C2=A0 =C2=A0[MyFrame]
>=C2=A0 =C2=A0[before=3D{\blank},
>=C2=A0 =C2=A0 after=3D{\blank},
>=C2=A0 =C2=A0 frame=3Doff,
>=C2=A0 =C2=A0 background=3DMyFrame,
>=C2=A0 =C2=A0 width=3D6cm,
>=C2=A0 =C2=A0 height=3Dfit]
>
> \startuseMPgraphic{MyFrame}
>=C2=A0 path b;
>=C2=A0 picture p;
>=C2=A0 p :=3D textext.rt("\tfx\white\framedtextparameter{Titl= e}");
>=C2=A0 p :=3D p shifted (2BodyFontSize,OverlayHeight-ypart center = p+.25ExHeight);
>=C2=A0 b :=3D boundingbox p enlarged .3EmWidth ;
>=C2=A0 fill OverlayBox withcolor \MPcolor{MyColorA};
>=C2=A0 fill b withcolor \MPcolor{MyColorB} ;
>=C2=A0 draw p ;
>=C2=A0 setbounds currentpicture to boundingbox currentpicture enlarged = 2mm ;
> \stopuseMPgraphic
>
> \defineoverlay
>=C2=A0 =C2=A0[MyFrame]
>=C2=A0 =C2=A0[\useMPgraphic{MyFrame}]
>
>=C2=A0 =C2=A0\starttext
>
>=C2=A0 =C2=A0\placerecipe{}{
>=C2=A0 =C2=A0\startMyFrame[Title=3DInfo]
>=C2=A0 =C2=A0L'histogramme est constitu=C3=A9 de rectangles dont le= s bases correspondent aux
> classes et dont les aires sont proportionnelles aux effectifs ou fr=C3= =A9quences
> des classes.
>=C2=A0 =C2=A0\stopMyFrame}
>
>=C2=A0 =C2=A0\input Knuth
>
>=C2=A0 =C2=A0\stoptext
>
> ___________________________________________________________________________________
> 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-conte= xt
> webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.ne= t
> archive=C2=A0 : https://bitbucket.org/phg/context-mirror/commits/
> wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
> ____________________________________________________________= _______________________



--
http://okle= .pl
_____________________= ______________________________________________________________ If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" rel=3D"noreferrer= " target=3D"_blank">http://www.ntg.nl/mailman/listinfo/ntg-context=
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/cont= ext-mirror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
_________________________________________________________________= __________________

--001a114ac8840dfa2505403a36af-- --===============1110185929961646726== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============1110185929961646726==--